chunk-4bfa8db5.86b2736b.js 27 KB

12
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-4bfa8db5"],{"0091":function(t,e,r){},"0b79":function(t,e,r){"use strict";var n=r("2ed0"),i=r.n(n);i.a},"0cd2":function(t,e,r){},"0fb6":function(t,e,r){},"15b5":function(t,e,r){"use strict";var n=r("5f54"),i=r.n(n);i.a},"1bca":function(t,e,r){"use strict";r.d(e,"b",function(){return i}),r.d(e,"a",function(){return a}),r.d(e,"d",function(){return o}),r.d(e,"e",function(){return s}),r.d(e,"c",function(){return c});var n=r("bf9a");function i(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return n["b"].get("worker",{params:t})}function a(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return n["b"].get("worker/workOrderChart",{params:t})}function o(t){return n["b"].post("worker",t)}function s(t,e){return n["b"].put("worker/".concat(t),e)}function c(t){return n["b"].post("worker/reset",t)}},"1c4c":function(t,e,r){"use strict";var n=r("9b43"),i=r("5ca1"),a=r("4bf8"),o=r("1fa8"),s=r("33a4"),c=r("9def"),u=r("f1ae"),l=r("27ee");i(i.S+i.F*!r("5cc5")(function(t){Array.from(t)}),"Array",{from:function(t){var e,r,i,f,d=a(t),p="function"==typeof this?this:Array,h=arguments.length,m=h>1?arguments[1]:void 0,b=void 0!==m,g=0,v=l(d);if(b&&(m=n(m,h>2?arguments[2]:void 0,2)),void 0==v||p==Array&&s(v))for(e=c(d.length),r=new p(e);e>g;g++)u(r,g,b?m(d[g],g):d[g]);else for(f=v.call(d),r=new p;!(i=f.next()).done;g++)u(r,g,b?o(f,m,[i.value,g],!0):i.value);return r.length=g,r}})},"2ed0":function(t,e,r){},3107:function(t,e,r){"use strict";var n=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("pop-confirm",t._b({attrs:{type:"danger",confirm:t.onConfirm,size:"small"}},"pop-confirm",t.$attrs,!1),[t._t("default",[t._v("删除")])],2)},i=[],a=(r("96cf"),r("3b8d")),o=r("bd0b"),s=r("bf9a"),c=r("873a"),u=r("91a0"),l={name:"RowDestroy",components:{PopConfirm:o["a"]},mixins:[u["a"]],methods:{onConfirm:function(){var t=Object(a["a"])(regeneratorRuntime.mark(function t(){return regeneratorRuntime.wrap(function(t){while(1)switch(t.prev=t.next){case 0:return this.checkResourceName(),this.setIdentify(),t.next=4,s["b"].delete("".concat(this.resource,"/").concat(this.identify));case 4:this.data.splice(this.getIndex(),1),this.$message.success(Object(c["h"])("destroyed"));case 6:case"end":return t.stop()}},t,this)}));function e(){return t.apply(this,arguments)}return e}()}},f=l,d=r("2877"),p=Object(d["a"])(f,n,i,!1,null,null,null);e["a"]=p.exports},"323a":function(t,e,r){"use strict";r.d(e,"e",function(){return i}),r.d(e,"f",function(){return a}),r.d(e,"a",function(){return o}),r.d(e,"c",function(){return s}),r.d(e,"d",function(){return c}),r.d(e,"b",function(){return u});var n=r("bf9a");function i(t){return n["b"].post("admin_merchants",t)}function a(t,e){return n["b"].put("admin_merchants/".concat(t),e)}function o(t){return n["b"].get("admin_merchants/".concat(t,"/edit"))}function s(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return n["b"].get("admin_merchants",{params:t})}function c(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return n["b"].get("admin_merchant_config/get",{params:t})}function u(t){return n["b"].post("admin_merchant_config/edit",t)}},"386d":function(t,e,r){"use strict";var n=r("cb7c"),i=r("83a1"),a=r("5f1b");r("214f")("search",1,function(t,e,r,o){return[function(r){var n=t(this),i=void 0==r?void 0:r[e];return void 0!==i?i.call(r,n):new RegExp(r)[e](String(n))},function(t){var e=o(r,t,this);if(e.done)return e.value;var s=n(t),c=String(this),u=s.lastIndex;i(u,0)||(s.lastIndex=0);var l=a(s,c);return i(s.lastIndex,u)||(s.lastIndex=u),null===l?-1:l.index}]})},"3c1b":function(t,e,r){"use strict";var n=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("button-link",{attrs:{size:"small",to:t.link}},[t._t("default",[t._v("编辑")])],2)},i=[],a=r("c3c6"),o=r("91a0"),s={name:"RowToEdit",components:{ButtonLink:a["a"]},mixins:[o["a"]],data:function(){return{identify:void 0}},computed:{link:function(){return this.checkResourceName(),"/".concat(this.resource,"/").concat(this.identify,"/edit")}},mounted:function(){this.setIdentify()}},c=s,u=r("2877"),l=Object(u["a"])(c,n,i,!1,null,null,null);e["a"]=l.exports},"469f":function(t,e,r){r("6c1c"),r("1654"),t.exports=r("7d7b")},"5d73":function(t,e,r){t.exports=r("469f")},"5f54":function(t,e,r){},"69d9":function(t,e,r){"use strict";r("8e6e"),r("456d"),r("7f7f"),r("ac6a");var n=r("bd86");function i(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function a(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?i(r,!0).forEach(function(e){Object(n["a"])(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):i(r).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}var o,s,c={name:"SearchForm",data:function(){return{form:{},show:!0}},props:{fields:Array,resetCurrentPage:{type:Boolean,default:!0}},created:function(){this.initFormShow()},methods:{onSubmit:function(){var t=this,e=a({},this.$route.query);this.resetCurrentPage&&delete e.page,this.fields.forEach(function(r){var n=r.field,i=t.form[n];"string"===typeof i&&(i=i.trim()),""===i||void 0===i?delete e[n]:(e[n]=i,"time_between"===n&&(e[n]=null==i?i:[i[0],i[1]]))}),this.$router.push({path:this.$route.path,query:e})},dateFormat:function(t){var e=t.getFullYear()+"-"+this.p(t.getMonth()+1)+"-"+this.p(t.getDate()),r=this.p(t.getHours())+":"+this.p(t.getMinutes())+":"+this.p(t.getSeconds());return e+r},p:function(t){return t<10?"0"+t:t},onReset:function(){this.form={},this.onSubmit()},initFormShow:function(){var t=this;this.fields.some(function(e){if(t.$route.query[e.field])return t.show=!0,!0})},setFormValueFromQuery:function(){var t=this,e=this.$route.query;this.fields.forEach(function(r){var n=r.field,i=e[n];t.$set(t.form,n,i)})},toggleShow:function(){this.show=!this.show},getOffsetHeight:function(){var t=document.getElementById("div-searchForm"),e=t.clientWidth||t.offsetWidth;this.formHeight=e}},watch:{$route:{handler:function(){this.setFormValueFromQuery()},immediate:!0}},render:function(t){var e=this;return t("el-collapse-transition",[t("div",{directives:[{name:"show",value:this.show}]},[t("el-form",{attrs:{inline:!0},nativeOn:{keydown:function(t){return"button"in t||!e._k(t.keyCode,"enter",13,t.key,"Enter")?(t.preventDefault(),e.onSubmit(t)):null}}},[this.fields.map(function(r){var n;switch(r.type){case"el-select":n=t("el-select",{style:"width:150px;",attrs:{placeholder:r.label,filterable:!0,clearable:!0},model:{value:e.form[r.field],callback:function(t){e.$set(e.form,r.field,t)}}},[r.options.map(function(e){return t("el-option",{key:e.value||e.id,attrs:{label:e.label||e.name,value:String(e.value||e.id)}})})]);break;case"time-between":n=t("el-date-picker",{attrs:{type:"datetimerange","value-format":"yyyy-MM-dd HH:mm:ss","start-placeholder":r.label1,"end-placeholder":r.label2},model:{value:e.form[r.field],callback:function(t){e.$set(e.form,r.field,t)}}});break;case"super-input":n=t("el-input",{attrs:{placeholder:r.label,clearable:!0},model:{value:e.form[r.field],callback:function(t){e.$set(e.form,r.field,t)}}});break;default:n=t("el-input",{attrs:{placeholder:r.label,clearable:!0},model:{value:e.form[r.field],callback:function(t){e.$set(e.form,r.field,t)}}})}return t("el-form-item",{key:r.field},[n])}),t("el-form-item",{class:"actions"},[t("el-button",{attrs:{type:"primary"},on:{click:this.onSubmit}},["查询"]),t("el-button",{on:{click:this.onReset}},["重置"])])])])])}},u=c,l=(r("cafd"),r("2877")),f=Object(l["a"])(u,o,s,!1,null,"6dd66826",null);e["a"]=f.exports},"6cbc":function(t,e,r){"use strict";var n=r("0cd2"),i=r.n(n);i.a},"768b":function(t,e,r){"use strict";var n=r("a745"),i=r.n(n);function a(t){if(i()(t))return t}var o=r("5d73"),s=r.n(o);function c(t,e){var r=[],n=!0,i=!1,a=void 0;try{for(var o,c=s()(t);!(n=(o=c.next()).done);n=!0)if(r.push(o.value),e&&r.length===e)break}catch(u){i=!0,a=u}finally{try{n||null==c["return"]||c["return"]()}finally{if(i)throw a}}return r}function u(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}function l(t,e){return a(t)||c(t,e)||u()}r.d(e,"a",function(){return l})},"7d7b":function(t,e,r){var n=r("e4ae"),i=r("7cd6");t.exports=r("584a").getIterator=function(t){var e=i(t);if("function"!=typeof e)throw TypeError(t+" is not iterable!");return n(e.call(t))}},"81df":function(t,e,r){"use strict";var n=function(){var t=this,e=t.$createElement,r=t._self._c||e;return t.page?r("el-pagination",t._b({ref:"page",attrs:{"page-sizes":t.pageSizes,"current-page":t.currentPage,"page-size":t.perPage,total:t.page.total,layout:t.layout,background:""},on:{"size-change":t.onSizeChange,"current-change":t.onChange,"update:currentPage":function(e){t.currentPage=e},"update:current-page":function(e){t.currentPage=e},"update:pageSize":function(e){t.perPage=e},"update:page-size":function(e){t.perPage=e}}},"el-pagination",t.$attrs,!1)):t._e()},i=[],a={name:"Pagination",data:function(){return{currentPage:1,perPage:10}},props:{page:Object,layout:{type:String,default:"total, prev, pager, next, sizes, jumper"},autoPush:{type:Boolean,default:!0}},computed:{pageSizes:function(){var t=[10,30,50,100,200],e=this.page.per_page;return-1===t.indexOf(e)?[this.page.per_page].concat(t):t}},methods:{push:function(){var t=Object.assign({},this.$route.query,{page:this.currentPage,per_page:this.perPage});this.$router.push({path:this.$route.path,query:t})},onSizeChange:function(t){this.$emit("size-change",t),this.autoPush&&(this.currentPage=1,this.push())},onChange:function(t){this.$emit("current-change",t),this.autoPush&&this.push()}},watch:{page:{handler:function(t){var e=this;t&&(this.currentPage=t.current_page,this.perPage=t.per_page,this.$nextTick(function(){e.$refs.page.internalCurrentPage=t.current_page}))},immediate:!0}}},o=a,s=r("2877"),c=Object(s["a"])(o,n,i,!1,null,"f691fd2e",null);e["a"]=c.exports},"83a1":function(t,e){t.exports=Object.is||function(t,e){return t===e?0!==t||1/t===1/e:t!=t&&e!=e}},"8a92":function(t,e,r){"use strict";var n=r("0091"),i=r.n(n);i.a},"8c59":function(t,e,r){"use strict";r.r(e);var n=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("el-card",{scopedSlots:t._u([{key:"header",fn:function(){return[r("content-header")]},proxy:!0}])},[r("div",{staticClass:"header-button"},[r("search-form",{ref:"searchForm",attrs:{fields:t.search}}),r("div",{staticClass:"selections"},[r("el-button",{attrs:{type:"primary"},on:{click:t.addWorker}},[t._v("添加地勤人员")])],1)],1),r("el-dialog",{attrs:{title:"地勤人员",visible:t.dialogVisible,width:"25%"},on:{"update:visible":function(e){t.dialogVisible=e}}},[r("lz-form",{ref:"form",staticStyle:{margin:"10px 0"},attrs:{submit:t.onSubmit,model:t.form,"edit-mode":t.isedit,rules:t.rules,errors:t.errors,"disable-redirect":!0,"in-dialog":!0,"label-width":"80px"},on:{"update:errors":function(e){t.errors=e}}},[r("el-form-item",{attrs:{required:"",prop:"job_number",label:"工号"}},[r("el-input",{staticClass:"limitwidth",attrs:{onkeyup:"this.value=this.value.replace(/[^\\d.]/g,'');",maxlength:"6","show-word-limit":""},model:{value:t.form.job_number,callback:function(e){t.$set(t.form,"job_number",e)},expression:"form.job_number"}})],1),r("el-form-item",{attrs:{required:"",prop:"name",label:"姓名"}},[r("el-input",{staticClass:"limitwidth",model:{value:t.form.name,callback:function(e){t.$set(t.form,"name",e)},expression:"form.name"}})],1),r("el-form-item",{staticStyle:{margin:"0"},attrs:{required:"",prop:"account",label:"账号"}},[r("el-input",{staticClass:"limitwidth",model:{value:t.form.account,callback:function(e){t.$set(t.form,"account",e)},expression:"form.account"}}),r("p",{staticClass:"help-info"},[t._v("!密码默认为123456789,可在运维端自行修改")])],1),r("el-form-item",{attrs:{required:"",prop:"phone",label:"手机号"}},[r("el-input",{staticClass:"limitwidth",model:{value:t.form.phone,callback:function(e){t.$set(t.form,"phone",e)},expression:"form.phone"}})],1),r("el-form-item",{attrs:{required:"",prop:"area_id",label:"负责区域"}},[r("el-select",{staticClass:"limitwidth",attrs:{filterable:"",clearable:"",placeholder:"请选择"},model:{value:t.form.area_id,callback:function(e){t.$set(t.form,"area_id",e)},expression:"form.area_id"}},t._l(t.areas,function(t){return r("el-option",{key:t.id,attrs:{label:t.name,value:t.id}})}),1)],1),r("el-form-item",{attrs:{required:"",prop:"status",label:"状态"}},[r("el-radio",{attrs:{label:"1"},model:{value:t.form.status,callback:function(e){t.$set(t.form,"status",e)},expression:"form.status"}},[t._v("正常")]),r("el-radio",{attrs:{label:"0"},model:{value:t.form.status,callback:function(e){t.$set(t.form,"status",e)},expression:"form.status"}},[t._v("停用")])],1)],1)],1),r("el-table",{attrs:{data:t.users,resource:"worker"}},[r("el-table-column",{attrs:{prop:"account",label:"账号",width:"180"}}),r("el-table-column",{attrs:{prop:"name",label:"姓名",width:"180"}}),r("el-table-column",{attrs:{prop:"job_number",label:"工号",width:"120"}}),r("el-table-column",{attrs:{prop:"phone",label:"手机号",width:"120"}}),r("el-table-column",{attrs:{prop:"area_name",label:"负责区域"}}),r("el-table-column",{attrs:{label:"状态",align:"center",width:"80"},scopedSlots:t._u([{key:"default",fn:function(e){return[e.row.status?r("el-tag",{attrs:{type:"success"}},[t._v("正常")]):r("el-tag",{attrs:{type:"danger"}},[t._v("停用")])]}}])}),r("el-table-column",{attrs:{prop:"created_at",label:"添加时间",width:"180"}}),r("el-table-column",{attrs:{label:"操作",width:"300"},scopedSlots:t._u([{key:"default",fn:function(e){var n=e.row;e.$index;return[r("row-destroy"),r("el-button",{attrs:{type:"success",size:"small"},on:{click:function(e){return t.editRow(n)}}},[t._v(" 编辑")]),r("el-button",{attrs:{type:"primary",size:"small"},on:{click:function(e){return t.resetClick(n)}}},[t._v(" 重置")]),r("button-link",{attrs:{type:"success",size:"small",to:t.link(n)}},[t._t("default",[t._v("绩效")])],2)]}}],null,!0)})],1),r("div",{staticClass:"card-footer"},[r("pagination",{attrs:{page:t.page}})],1),r("el-dialog",{attrs:{title:"提示",visible:t.resetPasswordDialogVisible,width:"30%"},on:{"update:visible":function(e){t.resetPasswordDialogVisible=e}}},[r("span",[t._v("确认重置密码吗?")]),r("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[r("el-button",{on:{click:function(e){t.resetPasswordDialogVisible=!1}}},[t._v("取 消")]),r("el-button",{attrs:{type:"primary"},on:{click:function(e){return t.resetPassword()}}},[t._v("确 定")])],1)])],1)},i=[],a=(r("7f7f"),r("386d"),r("ac6a"),r("5df3"),r("768b")),o=(r("96cf"),r("3b8d")),s=r("ada3"),c=r("69d9"),u=r("81df"),l=r("1bca"),f=r("b64d"),d=r("3107"),p=r("3c1b"),h=r("fe06"),m=r("c3c6"),b=r("323a"),g={name:"Index",components:{LzForm:s["a"],RowToEdit:p["a"],RowDestroy:d["a"],SearchForm:c["a"],Pagination:u["a"],ButtonLink:m["a"]},mixins:[h["a"]],data:function(){var t=function(t,e,r){if(!e)return r(new Error("手机号不能为空"));var n=/^1[3|4|5|7|8][0-9]\d{8}$/;if(!n.test(e))return r(new Error("请输入正确的手机号"));r()};return{search:[{type:"el-select",field:"area_id",label:"骑行区域",options:[{id:"",name:"全部"}]},{type:"el-select",field:"status",label:"状态",options:[{id:"",name:"全部"},{id:"1",name:"正常"},{id:"0",name:"停用"}]},{field:"name",label:"姓名"},{field:"account",label:"账号"},{field:"phone",label:"手机号"},{field:"job_number",label:"工号"},{type:"el-select",field:"merchant_id",label:"商户",options:[{id:"",name:"全部"}]}],form:{id:"",job_number:"",name:"",account:"",phone:"",area_id:"",status:"1"},users:[],page:null,areas:[],dialogVisible:!1,rules:{phone:[{validator:t,trigger:"blur"}],job_number:[{min:3,max:6,message:"长度在 3 到 6个字符",trigger:"blur"}]},errors:{},isedit:!1,resetPasswordDialogVisible:!1,reset_id:""}},inject:["reload"],watch:{$route:{handler:function(){var t=Object(o["a"])(regeneratorRuntime.mark(function t(e){var r,n,i,a;return regeneratorRuntime.wrap(function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,Object(l["b"])(e.query);case 2:r=t.sent,n=r.data,i=n.data,a=n.meta,this.users=i,this.page=a;case 8:case"end":return t.stop()}},t,this)}));function e(e){return t.apply(this,arguments)}return e}(),immediate:!0}},created:function(){var t=Object(o["a"])(regeneratorRuntime.mark(function t(){var e,r,n,i,o,s;return regeneratorRuntime.wrap(function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,Promise.all([Object(f["b"])({all:1})]);case 2:if(e=t.sent,r=Object(a["a"])(e,1),n=r[0].data,this.areas.push.apply(this.areas,n),this.search[0].options.push.apply(this.search[0].options,n),"administrator"!==this.$store.state.users.user.roles[0]){t.next=16;break}return t.next=10,Promise.all([Object(b["c"])({all:1})]);case 10:i=t.sent,o=Object(a["a"])(i,1),s=o[0].data,this.search[6].options.push.apply(this.search[6].options,s.data),t.next=17;break;case 16:this.search.splice(6,1);case 17:case"end":return t.stop()}},t,this)}));function e(){return t.apply(this,arguments)}return e}(),methods:{link:function(t){return"/worker/achievements?worker_id="+t.id},addWorker:function(){this.form.job_number="",this.form.name="",this.form.phone="",this.form.account="",this.form.status="1",this.form.area_id="",this.isedit=!1,this.dialogVisible=!0},editRow:function(t){this.isedit=!0,this.form.id=t.id,this.form.job_number=t.job_number,this.form.name=t.name,this.form.phone=t.phone,this.form.account=t.account,this.form.status=String(t.status),this.form.area_id=t.area_id,this.dialogVisible=!0},onSubmit:function(){var t=Object(o["a"])(regeneratorRuntime.mark(function t(){return regeneratorRuntime.wrap(function(t){while(1)switch(t.prev=t.next){case 0:if(!this.isedit){t.next=6;break}return t.next=3,Object(l["e"])(this.form.id,this.form);case 3:this.reload(),t.next=11;break;case 6:return this.dialogVisible=!1,delete this.form.id,t.next=10,Object(l["d"])(this.form);case 10:this.reload();case 11:case"end":return t.stop()}},t,this)}));function e(){return t.apply(this,arguments)}return e}(),resetClick:function(t){this.reset_id=t.id,this.resetPasswordDialogVisible=!0},resetPassword:function(){var t=this,e={id:this.reset_id};Object(l["c"])(e).then(function(e){e.then(function(e){e&&t.$message({showClose:!0,message:"重置成功",type:"success"})})}),this.resetPasswordDialogVisible=!1}}},v=g,y=(r("0b79"),r("2877")),w=Object(y["a"])(v,n,i,!1,null,null,null);e["default"]=w.exports},"91a0":function(t,e,r){"use strict";r("7f7f"),r("5df3"),r("1c4c"),r("c5f6");e["a"]={inject:{elTable:{default:""}},data:function(){return{identify:void 0}},props:{resource:{type:String,default:function(){return this.elTable&&this.elTable.resource}},data:{type:Array,default:function(){return this.elTable&&this.elTable.data}},index:[Number,String],rowKey:{type:String,default:function(){return this.elTable&&this.elTable.rowKey}}},methods:{getIndex:function(){if(void 0!==this.index)return this.index;if(this.elTable){var t=this.findTr();if(t){var e=Array.from(this.elTable.$el.querySelectorAll(".el-table__body tr")).indexOf(t);return-1===e?void 0:e}}},findTr:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.$el;if(t){var e=t.tagName.toLowerCase();return"tr"===e?t:"tbody"===e?void 0:this.findTr(t.parentNode)}},setIdentify:function(){if(void 0===this.identify){var t=this.getIndex();this.identify=this.data[t][this.rowKey]}},checkResourceName:function(){if(!this.resource)throw new Error("必须在 [ 表格 ] 或者 [ ".concat(this.$options.name," ] 中,传入 [ resource ] 属性"))}}}},ada3:function(t,e,r){"use strict";r("8e6e"),r("456d");var n=r("bd86"),i=r("75fc"),a=(r("a481"),r("96cf"),r("3b8d")),o=(r("ac6a"),r("28a5"),r("9948")),s=r.n(o),c=r("9b02"),u=r.n(c),l=r("1a38"),f=r("873a"),d=r("a22f");function p(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function h(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?p(r,!0).forEach(function(e){Object(n["a"])(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):p(r).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}var m,b,g={name:"LzForm",components:{FlexSpacer:d["a"]},inject:{view:{from:"view",default:null}},data:function(){return{loading:!1,stay:!1}},props:{getData:Function,submit:Function,errors:Object,form:Object,submitText:{type:String,default:"保存"},labelPosition:String,inDialog:Boolean,createdRedirect:{type:[String,Function],default:function(){var t=this.$route.path.split("/");return"/"+(t[t.length-2]||"")}},updatedRedirect:{type:[String,Function],default:function(){return this.$router.back.bind(this.$router)}},disableRedirect:Boolean,disableStay:Boolean,editMode:Boolean},computed:{realLabelPosition:function(){return this.labelPosition||(this.$store.state.miniWidth?"top":"right")},miniWidth:function(){return this.$store.state.miniWidth}},created:function(){this.copyMethods()},methods:{copyMethods:function(){var t=this;[l["default"].extends.methods,l["default"].methods].forEach(function(e){s()(e,function(e,r){t[r]=function(){e.apply(this.$refs.form,arguments)}})})},_getData:function(){var t=Object(a["a"])(regeneratorRuntime.mark(function t(){var e=this;return regeneratorRuntime.wrap(function(t){while(1)switch(t.prev=t.next){case 0:if(this.loading=!0,this.view&&this.$emit("update:form",this.view.formBak),t.prev=2,t.t0=this.getData,!t.t0){t.next=7;break}return t.next=7,this.getData();case 7:this.$nextTick(function(){e.setInitialValues()}),t.next=13;break;case 10:t.prev=10,t.t1=t["catch"](2),Promise.reject(t.t1);case 13:this.loading=!1;case 14:case"end":return t.stop()}},t,this,[[2,10]])}));function e(){return t.apply(this,arguments)}return e}(),onSubmit:function(){var t=Object(a["a"])(regeneratorRuntime.mark(function t(){var e;return regeneratorRuntime.wrap(function(t){while(1)switch(t.prev=t.next){case 0:if(this.$emit("update:errors",{}),t.prev=1,t.t0=this.submit,!t.t0){t.next=6;break}return t.next=6,this.submit();case 6:if(this.$message.success(Object(f["h"])(this.editMode?"updated":"created")),!this.stay&&!this.disableRedirect){t.next=9;break}return t.abrupt("return");case 9:e=this.editMode?this.updatedRedirect:this.createdRedirect,"string"===typeof e?this.$router.push(e):"function"===typeof e&&e(),t.next=17;break;case 13:t.prev=13,t.t1=t["catch"](1),this.$emit("update:errors",Object(f["j"])(t.t1.response)),422!==u()(t.t1,"response.status")&&Promise.reject(t.t1);case 17:case"end":return t.stop()}},t,this,[[1,13]])}));function e(){return t.apply(this,arguments)}return e}(),onReset:function(){this.$refs.form.resetFields()}},watch:{$route:{handler:function(){this.$active&&this._getData()},immediate:!0}},render:function(t){var e=this,r=this.$slots.default;Array.isArray(r)&&(r=r.map(function(r){var n=r.componentOptions,a=n.propsData,o=a.helper,s=a.label;if(o){o=o.replace(/\n/g,"<br>");var c=t("template",{slot:"label"},[t("span",[s]),t("el-tooltip",{attrs:{effect:"dark",placement:"top-start","popper-class":"form-helper-popper ".concat(e.miniWidth?"mini-width":"")}},[t("div",{slot:"content",domProps:{innerHTML:o}}),t("i",{class:"ml-1 el-icon-question helper"})])]);return t("el-form-item",{props:n.propsData},[c].concat(Object(i["a"])(n.children)))}return r}));!this.disableStay&&t("el-checkbox",{attrs:{title:"表单提交后,留在此页"},model:{value:e.stay,callback:function(t){e.stay=t}}},["留在此页"]);var n=this.$slots.footer||t("el-form-item",{class:"footer"},[t("loading-action",{attrs:{type:"primary",action:this.onSubmit}},[this.submitText]),t("el-button",{on:{click:this.onReset}},["重置"]),this.$slots.footerAppend,t("flex-spacer")]);return t("el-form",{props:h({model:this.form,errors:this.errors,labelPosition:this.realLabelPosition},this.$attrs),on:h({},this.$listeners),class:{"in-dialog":this.inDialog},style:{width:this.inDialog?"auto":"800px"},directives:[{name:"loading",value:this.loading}],ref:"form"},[r,n])}},v=g,y=(r("6cbc"),r("8a92"),r("2877")),w=Object(y["a"])(v,m,b,!1,null,"3084f0c4",null);e["a"]=w.exports},b64d:function(t,e,r){"use strict";r.d(e,"b",function(){return i}),r.d(e,"c",function(){return a}),r.d(e,"d",function(){return o}),r.d(e,"e",function(){return s}),r.d(e,"a",function(){return c});var n=r("bf9a");function i(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return n["b"].get("area",{params:t})}function a(t){return n["b"].get("area/".concat(t))}function o(t){return n["b"].post("area",t)}function s(t,e){return n["b"].put("area/".concat(t),e)}function c(t){return n["b"].get("area/".concat(t,"/edit"))}},bd0b:function(t,e,r){"use strict";var n=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r(t.comp,t._b({tag:"component",staticClass:"pop-confirm",attrs:{type:t.type,disabled:t.disabled}},"component",t.$attrs,!1),[r("el-popover",{attrs:{placement:"top",width:"160",disabled:t.disabled},model:{value:t.visible,callback:function(e){t.visible=e},expression:"visible"}},[r("p",[t._v(t._s(t.notice))]),r("div",{staticStyle:{"text-align":"right",margin:"0"}},[r("el-button",{attrs:{size:"mini"},on:{click:t.onCancel}},[t._v("取消")]),r("loading-action",{attrs:{type:t.confirmType,size:"mini",action:t.action,disabled:t.disabled}},[t._v("\n 确定\n ")])],1),r("span",{staticClass:"trigger",attrs:{slot:"reference"},slot:"reference"})]),t._t("default")],2)},i=[],a=(r("96cf"),r("3b8d")),o={name:"PopConfirm",data:function(){return{visible:!1}},props:{notice:{type:String,default:"确认操作?"},confirmType:{type:String,default:"primary"},confirm:Function,type:String,disabled:Boolean,comp:{type:String,default:"el-button"}},methods:{onCancel:function(){this.visible=!1,this.$emit("cancel")},action:function(){var t=Object(a["a"])(regeneratorRuntime.mark(function t(){return regeneratorRuntime.wrap(function(t){while(1)switch(t.prev=t.next){case 0:if(!this.disabled){t.next=2;break}return t.abrupt("return");case 2:return t.next=4,this.confirm();case 4:this.visible=!1;case 5:case"end":return t.stop()}},t,this)}));function e(){return t.apply(this,arguments)}return e}()}},s=o,c=(r("15b5"),r("2877")),u=Object(c["a"])(s,n,i,!1,null,"f59b5a72",null);e["a"]=u.exports},cafd:function(t,e,r){"use strict";var n=r("0fb6"),i=r.n(n);i.a},fe06:function(t,e,r){"use strict";var n=r("873a");e["a"]={provide:function(){return{view:this}},data:function(){return{formField:"form",idField:"id"}},computed:{editMode:function(){return!!this.resourceId},resourceId:function(){return this.$route.params[this.idField]}},created:function(){this.backupForm()},methods:{getResourceId:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"id";return this.$route.params[t]},backupForm:function(){this.formBak=JSON.parse(JSON.stringify(this.$data[this.formField]))},fillForm:function(t){this.$data[this.formField]=Object(n["b"])(this.$data[this.formField],t)}}}}}]);
  2. //# sourceMappingURL=chunk-4bfa8db5.86b2736b.js.map