(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["store"],{"1da1":function(e,t,r){"use strict";r.d(t,"a",(function(){return o}));r("d3b7");function n(e,t,r,n,o,a,i){try{var c=e[a](i),s=c.value}catch(u){return void r(u)}c.done?t(s):Promise.resolve(s).then(n,o)}function o(e){return function(){var t=this,r=arguments;return new Promise((function(o,a){var i=e.apply(t,r);function c(e){n(i,o,a,c,s,"next",e)}function s(e){n(i,o,a,c,s,"throw",e)}c(void 0)}))}}},"262b":function(e,t,r){"use strict";r("e897")},"73f5":function(e,t,r){"use strict";r.d(t,"f",(function(){return a})),r.d(t,"k",(function(){return i})),r.d(t,"i",(function(){return c})),r.d(t,"a",(function(){return s})),r.d(t,"h",(function(){return u})),r.d(t,"b",(function(){return l})),r.d(t,"g",(function(){return d})),r.d(t,"c",(function(){return f})),r.d(t,"e",(function(){return h})),r.d(t,"j",(function(){return m})),r.d(t,"d",(function(){return p}));var n=r("f6ae"),o=r("b775");function a(e){return Object(o["b"])({url:n["a"].store.list,method:"get",params:e})}function i(e){var t=e.storeId;return Object(o["b"])({url:n["a"].store.superLogin,method:"get",params:{storeId:t}})}function c(e){return Object(o["b"])({url:n["a"].store.recycle,method:"get",params:e})}function s(e){return Object(o["b"])({url:n["a"].store.add,method:"post",data:e})}function u(e){return Object(o["b"])({url:n["a"].store.recovery,method:"post",data:e})}function l(e){return Object(o["b"])({url:n["a"].store.delete,method:"post",data:e})}function d(e){return Object(o["b"])({url:n["a"].store.move,method:"post",data:e})}function f(e){return Object(o["b"])({url:n["a"].store.module.dataList,method:"post",data:e})}function h(e){return Object(o["b"])({url:n["a"].store.module.getStorePlatform,method:"get"})}function m(e){return Object(o["b"])({url:n["a"].store.module.setStorePlatform,method:"post",data:e})}function p(e){return Object(o["b"])({url:n["a"].store.module.getGoodsList,method:"get",params:e})}},bb50:function(e,t,r){"use strict";r.r(t);r("b0c0");var n=function(){var e=this,t=e._self._c;return t("a-card",{attrs:{bordered:!1}},[t("content-header",{attrs:{title:"商城列表"}}),t("div",{staticClass:"table-operator"},[t("a-button",{attrs:{type:"primary",icon:"plus"},on:{click:function(t){return e.$refs.createModal.show()}}},[e._v("新增")])],1),t("s-table",{ref:"table",attrs:{size:"default",rowKey:"store_id",columns:e.columns,data:e.loadData,showPagination:"auto",pageSize:15},scopedSlots:e._u([{key:"action",fn:function(r,n){return t("span",{staticClass:"actions"},[t("a",{on:{click:function(t){return e.getPlatFormItem(n)}}},[e._v("数据授权")]),t("a",{on:{click:function(t){return e.handleInto(n)}}},[e._v("进入商城")]),t("a",{on:{click:function(t){return e.handleDelete(n)}}},[e._v("删除")]),t("a",{on:{click:function(t){return e.handleModule(n)}}},[e._v("功能模块")])])}}])}),t("create-form",{ref:"createModal",on:{handleSubmit:e.handleRefresh}}),t("ModuleForm",{ref:"ModuleForm",on:{handleSubmit:e.handleRefresh}}),t("a-modal",{attrs:{title:"数据授权"},on:{ok:e.handleOk},model:{value:e.open,callback:function(t){e.open=t},expression:"open"}},[t("div",[t("a-checkbox-group",{attrs:{value:e.checkedList},on:{change:e.onChange}},[t("a-row",[t("a-col",{attrs:{span:24}},e._l(e.checkList,(function(r,n){return t("a-checkbox",{key:n,attrs:{value:r.id}},[e._v(" "+e._s(r.name)+" ")])})),1)],1)],1)],1)])],1)},o=[],a=(r("d3b7"),r("159b"),r("b64b"),r("d81d"),r("73f5")),i=r("2af9"),c=function(){var e=this,t=e._self._c;return t("a-modal",{attrs:{title:"新增商城",width:720,visible:e.visible,confirmLoading:e.confirmLoading,maskClosable:!1},on:{ok:e.handleSubmit,cancel:e.handleCancel}},[t("a-spin",{attrs:{spinning:e.confirmLoading}},[t("a-form",{attrs:{form:e.form}},[t("a-form-item",{attrs:{label:"商城名称",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[t("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["store_name",{rules:[{required:!0,min:3,message:"请输入至少3个字符"}]}],expression:"['store_name', {rules: [{required: true, min: 3, message: '请输入至少3个字符'}]}]"}]})],1),t("a-form-item",{attrs:{label:"商家用户名",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"商家后台登录用户名"}},[t("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["user_name",{rules:[{required:!0,min:4,message:"请输入至少4个字符"}]}],expression:"['user_name', {rules: [{required: true, min: 4, message: '请输入至少4个字符'}]}]"}]})],1),t("a-form-item",{attrs:{label:"用户密码",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"商家后台登录密码"}},[t("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["password",{rules:[{required:!0,min:6,message:"请输入至少6个字符"}]}],expression:"['password', {rules: [\n {required: true, min: 6, message: '请输入至少6个字符'}\n ]}]"}],attrs:{type:"password"}})],1),t("a-form-item",{attrs:{label:"确认密码",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[t("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["password_confirm",{rules:[{required:!0,message:"请输入确认密码"},{validator:e.compareToFirstPassword}]}],expression:"['password_confirm', {rules: [\n {required: true, message: '请输入确认密码'},\n {validator: compareToFirstPassword}\n ]}]"}],attrs:{type:"password"}})],1),t("a-form-item",{attrs:{label:"排序",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"数字越小越靠前"}},[t("a-input-number",{directives:[{name:"decorator",rawName:"v-decorator",value:["sort",{initialValue:100,rules:[{required:!0,message:"请输入至少1个数字"}]}],expression:"['sort', {initialValue: 100, rules: [{required: true, message: '请输入至少1个数字'}]}]"}],attrs:{min:0}})],1)],1)],1)],1)},s=[],u={data:function(){return{labelCol:{span:7},wrapperCol:{span:13},visible:!1,confirmLoading:!1,form:this.$form.createForm(this)}},methods:{show:function(){this.visible=!0,this.form.resetFields()},handleSubmit:function(){var e=this,t=this.form.validateFields;t((function(t,r){!t&&e.onFormSubmit(r)}))},handleCancel:function(){this.visible=!1,this.form.resetFields()},compareToFirstPassword:function(e,t,r){var n=this.form;return!t||t===n.getFieldValue("password")||new Error("您输入的确认密码不一致")},onFormSubmit:function(e){var t=this;this.confirmLoading=!0,Object(a["a"])({form:e}).then((function(r){t.$message.success(r.message,1.2),t.handleCancel(),t.$emit("handleSubmit",e)})).finally((function(e){t.confirmLoading=!1}))}}},l=u,d=r("2877"),f=Object(d["a"])(l,c,s,!1,null,null,null),h=f.exports,m=function(){var e=this,t=e._self._c;return t("a-modal",{attrs:{title:e.title,width:720,visible:e.visible,confirmLoading:e.confirmLoading,maskClosable:!1},on:{ok:e.handleSubmit,cancel:e.handleCancel}},[t("a-spin",{attrs:{spinning:e.confirmLoading}},[t("a-form",{attrs:{form:e.form}},[t("a-form-item",{staticStyle:{"margin-bottom":"5px"},attrs:{label:"商城名称",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[t("span",{staticStyle:{"margin-left":"23px",color:"rgba(0, 0, 0, 0.85)"}},[e._v(e._s(e.record.store_name))])]),t("a-form-item",{attrs:{label:"模块列表",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"设置当前商城可使用的功能模块"}},[t("a-tree",{ref:"ModuleTree",attrs:{checkable:"",checkStrictly:"",treeData:e.treeData,autoExpandParent:!1},on:{check:e.onCheckedModule},model:{value:e.checkedKeys,callback:function(t){e.checkedKeys=t},expression:"checkedKeys"}})],1)],1)],1)],1)},p=[],v=r("2909"),b=r("c7eb"),g=r("1da1"),y=(r("99af"),r("2ef0")),w=r.n(y),k=r("f6ae"),x=r("b775");function _(e){return Object(x["b"])({url:k["a"].store.module.default,method:"get",params:e})}function C(e){return Object(x["b"])({url:k["a"].store.module.detail,method:"get",params:e})}function L(e){return Object(x["b"])({url:k["a"].store.module.edit,method:"post",data:e})}var O={props:{},data:function(){return{title:"设置功能模块",labelCol:{xs:{span:24},sm:{span:7}},wrapperCol:{xs:{span:24},sm:{span:13}},visible:!1,confirmLoading:!1,form:this.$form.createForm(this),record:{},default:{},moduleKeys:{},treeData:[],checkedKeys:{checked:[],halfChecked:[]}}},created:function(){this.getDefault()},methods:{show:function(e){var t=this;return Object(g["a"])(Object(b["a"])().mark((function r(){return Object(b["a"])().wrap((function(r){while(1)switch(r.prev=r.next){case 0:return t.visible=!0,t.record=e,r.next=4,t.getModuleDetail(e);case 4:t.getTreeData(),t.setModuleChecked();case 6:case"end":return r.stop()}}),r)})))()},getTreeData:function(){this.treeData=this.formatTreeData(this.default)},getDefault:function(){var e=this;return Object(g["a"])(Object(b["a"])().mark((function t(){return Object(b["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return e.confirmLoading=!0,t.next=3,_().then((function(e){return e.data.default}));case 3:e.default=t.sent,e.confirmLoading=!1;case 5:case"end":return t.stop()}}),t)})))()},setModuleChecked:function(){var e=this.treeData,t=this.moduleKeys,r=this.getAllKeys(e);this.checkedKeys.checked=w.a.intersection(t,r)},getModuleDetail:function(e){var t=this;return Object(g["a"])(Object(b["a"])().mark((function r(){return Object(b["a"])().wrap((function(r){while(1)switch(r.prev=r.next){case 0:return t.confirmLoading=!0,r.next=3,C({storeId:e["store_id"]}).then((function(e){return e.data.moduleKeys}));case 3:t.moduleKeys=r.sent,t.confirmLoading=!1;case 5:case"end":return r.stop()}}),r)})))()},formatTreeData:function(e,t){var r=[];for(var n in e){var o=e[n],a={title:o.name,key:o.key,checkable:!o.required,parentKey:t};o.children&&(a["children"]=this.formatTreeData(o["children"],o.key)),r.push(a)}return r},handleSubmit:function(){var e=this.$refs.ModuleTree,t={moduleKeys:[].concat(Object(v["a"])(e.getCheckedKeys()),Object(v["a"])(e.getHalfCheckedKeys()))};this.onFormSubmit(t)},handleCancel:function(){this.visible=!1,this.form.resetFields();var e=this.$refs.ModuleTree;e.clearExpandedKeys(),this.checkedKeys.checked=[]},onFormSubmit:function(e){var t=this;this.confirmLoading=!0,L({storeId:this.record["store_id"],form:e}).then((function(r){t.$message.success(r.message),t.handleCancel(),t.$emit("handleSubmit",e)})).finally((function(){return t.confirmLoading=!1}))},onCheckedModule:function(e,t){var r=t.checked,n=t.node,o=this.treeData,a=this.findNode(n.eventKey,o);this.onCheckChilds(r,a),this.onCheckParents(r,a)},findNode:function(e,t){for(var r=0;r=0;--o){var a=this.tryEntries[o],i=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var c=r.call(a,"catchLoc"),s=r.call(a,"finallyLoc");if(c&&s){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),h}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;O(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:S(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),h}},e}},e897:function(e,t,r){}}]);