(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-acddb8d0"],{"00ab":function(e,t,a){"use strict";a("1458")},"13b4":function(e,t,a){},1458:function(e,t,a){},"2ac9":function(e,t,a){e.exports=a.p+"static/img/jieshi.5c06290e.png"},"68ba":function(e,t,a){"use strict";a("bebc")},bebc:function(e,t,a){},dd76:function(e,t,a){"use strict";a("13b4")},fcb1:function(e,t,a){"use strict";a.r(t);var o=function(){var e=this,t=e.$createElement,o=e._self._c||t;return o("div",{staticClass:"divBox"},[o("el-card",{staticClass:"box-card"},[o("div",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["platform:menu:add"],expression:"['platform:menu:add']"}],attrs:{slot:"header"},slot:"header"},[o("el-button",{attrs:{type:"primary",icon:"el-icon-plus",size:"small"},on:{click:function(t){return e.handleAddorEdit(null,"add")}}},[e._v("新增菜单")])],1),e._v(" "),o("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.listLoading,expression:"listLoading"}],attrs:{data:e.menuList,"row-key":"id","tree-props":{children:"childList",hasChildren:"hasChildren"}}},[o("el-table-column",{attrs:{prop:"name",label:"菜单名称","show-overflow-tooltip":"",width:"450"}}),e._v(" "),o("el-table-column",{attrs:{prop:"sort",width:"180"}},[o("template",{slot:"header"},[o("span",[e._v("排序")]),e._v(" "),o("img",{staticClass:"explain",attrs:{src:a("2ac9")},on:{mouseover:function(t){e.showExplain=!0},mouseleave:function(t){e.showExplain=!1}}})])],2),e._v(" "),o("el-table-column",{attrs:{label:"关联商品分类"},scopedSlots:e._u([{key:"default",fn:function(t){return[0===t.row.childList.length?o("span",[e._v(e._s(t.row.categoryName))]):e._e()]}}])}),e._v(" "),o("el-table-column",{attrs:{prop:"createTime",label:"创建时间"}}),e._v(" "),o("el-table-column",{attrs:{label:"操作",width:"180",fixed:"right"},scopedSlots:e._u([{key:"default",fn:function(t){return[t.row.level<3?o("el-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["platform:menu:add"],expression:"['platform:menu:add']"}],attrs:{size:"small",type:"text"},on:{click:function(a){return e.handleAddorEdit(t.row,"add")}}},[e._v("添加子菜单")]):e._e(),e._v(" "),o("el-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["platform:menu:update","platform:admin:role:info"],expression:"['platform:menu:update', 'platform:admin:role:info']"}],attrs:{size:"small",type:"text"},on:{click:function(a){return e.handleAddorEdit(t.row,"edit")}}},[e._v("编辑")]),e._v(" "),o("el-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["platform:menu:delete"],expression:"['platform:menu:delete']"}],attrs:{size:"small",type:"text"},on:{click:function(a){return e.handleDelete(t.row)}}},[e._v("删除")])]}}])})],1),e._v(" "),e.showAddMallMenuDialog?o("div",[o("addMallMenuDialog",{ref:"amdRef",on:{refreshList:e.getList,cancel:function(t){e.showAddMallMenuDialog=!1}}})],1):e._e(),e._v(" "),e.showExplain?o("div",{staticClass:"explain-text"},[e._v("该排序为正序规则,一级菜单排序为菜单栏排序,一级对应里面的二/三级菜单排序各自独立")]):e._e()],1)],1)},i=[],l=a("c4c8"),n=a("e350"),r=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",[a("el-dialog",{attrs:{visible:e.showAddMallMenuDialog,width:"640px"},on:{"update:visible":function(t){e.showAddMallMenuDialog=t},close:e.cancel}},[a("div",{attrs:{slot:"title"},slot:"title"},[1!==e.ruleForm.level||e.ruleForm.id?e._e():a("div",{staticClass:"dialog-title"},[e._v("新增一级菜单")]),e._v(" "),2!==e.ruleForm.level||e.ruleForm.id?e._e():a("div",{staticClass:"dialog-title"},[e._v("新增二级菜单")]),e._v(" "),3!==e.ruleForm.level||e.ruleForm.id?e._e():a("div",{staticClass:"dialog-title"},[e._v("新增三级菜单")]),e._v(" "),e.ruleForm.id?a("div",{staticClass:"dialog-title"},[e._v("编辑")]):e._e()]),e._v(" "),a("el-form",{ref:"ruleForm",staticClass:"demo-ruleForm",attrs:{model:e.ruleForm,rules:e.rules,"label-width":"110px"}},[a("el-form-item",{attrs:{label:"菜单名称",prop:"name"}},[a("el-input",{attrs:{placeholder:"请输入菜单名称"},model:{value:e.ruleForm.name,callback:function(t){e.$set(e.ruleForm,"name",t)},expression:"ruleForm.name"}})],1),e._v(" "),2===e.ruleForm.level?a("el-form-item",{attrs:{label:"关联一级菜单",prop:"pname"}},[a("el-input",{attrs:{disabled:""},model:{value:e.ruleForm.pname,callback:function(t){e.$set(e.ruleForm,"pname",t)},expression:"ruleForm.pname"}})],1):e._e(),e._v(" "),3===e.ruleForm.level?a("el-form-item",{attrs:{label:"关联二级菜单",prop:"pname"}},[a("el-input",{attrs:{disabled:""},model:{value:e.ruleForm.pname,callback:function(t){e.$set(e.ruleForm,"pname",t)},expression:"ruleForm.pname"}})],1):e._e(),e._v(" "),e.ruleForm.isHaveChildren?a("el-form-item",{attrs:{label:"关联商品分类",prop:"categoryId"}},[e.ruleForm.categoryId?a("span",{staticStyle:{cursor:"pointer"},on:{click:function(t){return e.openGoodsCategoryDialog(e.ruleForm.categoryId,e.ruleForm.categoryName)}}},[e._v(e._s(e.ruleForm.categoryName))]):a("el-button",{attrs:{type:"primary",size:"small"},on:{click:e.openGoodsCategoryDialog}},[e._v("添加商品分类")])],1):e._e(),e._v(" "),a("el-form-item",{attrs:{label:"排序",prop:"sort"}},[a("el-input-number",{attrs:{size:"small",min:0},model:{value:e.ruleForm.sort,callback:function(t){e.$set(e.ruleForm,"sort",t)},expression:"ruleForm.sort"}})],1)],1),e._v(" "),a("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["platform:menu:update"],expression:"['platform:menu:update']"}],attrs:{type:"primary"},on:{click:function(t){return e.submitForm("ruleForm")}}},[e._v("确 定")]),e._v(" "),a("el-button",{on:{click:e.cancel}},[e._v("取 消")])],1)],1),e._v(" "),e.showGoodsCategoryDialog?a("div",[a("goodsCategoryDialog",{ref:"gcdRef",on:{cancel:function(t){e.showGoodsCategoryDialog=!1},confirm:e.getCategoryId}})],1):e._e()],1)},s=[],c=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",[a("el-dialog",{attrs:{visible:e.showGoodsCategoryDialog,width:"680px"},on:{"update:visible":function(t){e.showGoodsCategoryDialog=t},close:e.cancel}},[a("div",{staticClass:"header",attrs:{slot:"title"},slot:"title"},[a("div",{staticClass:"title"},[e._v("商品分类")]),e._v(" "),a("el-input",{staticClass:"input",attrs:{size:"small",placeholder:"请输入分类名称进行搜索"},model:{value:e.name,callback:function(t){e.name=t},expression:"name"}},[a("i",{staticClass:"el-input__icon el-icon-search",attrs:{slot:"suffix"},on:{click:e.getInfo},slot:"suffix"})])],1),e._v(" "),a("el-table",{attrs:{data:e.goodsCategoryList},on:{"current-change":e.checkedCategory}},[a("el-table-column",{attrs:{label:"分类名称"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-radio",{attrs:{label:t.row.name},model:{value:e.radioIndex,callback:function(t){e.radioIndex=t},expression:"radioIndex"}})]}}])}),e._v(" "),a("el-table-column",{attrs:{label:"商品数量",prop:"productNum",align:"center"}}),e._v(" "),a("el-table-column",{attrs:{label:"创建时间",prop:"createTime",align:"center"}})],1),e._v(" "),a("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{on:{click:e.cancel}},[e._v("取消")]),e._v(" "),a("el-button",{attrs:{type:"primary"},on:{click:e.confirm}},[e._v("确定")])],1)],1)],1)},d=[],u={data:function(){return{goodsCategoryList:[],categoryInfo:null,radioIndex:"",showGoodsCategoryDialog:!0,name:""}},methods:{openDialog:function(e,t){e&&t&&(this.categoryInfo={id:e,name:t},this.radioIndex=t),this.getInfo()},cancel:function(){this.$emit("cancel")},getInfo:function(){var e=this;Object(l["i"])(this.name).then((function(t){e.goodsCategoryList=t}))},checkedCategory:function(e){this.categoryInfo=e,this.radioIndex=e.name},confirm:function(){this.categoryInfo?(this.cancel(),this.$emit("confirm",this.categoryInfo)):this.$message.warning("至少选择一个关联分类")}}},m=u,f=(a("dd76"),a("2877")),p=Object(f["a"])(m,c,d,!1,null,"2a5d0fa6",null),g=p.exports,v={components:{goodsCategoryDialog:g},data:function(){return{showAddMallMenuDialog:!0,ruleForm:{id:"",categoryId:"",categoryName:"",level:1,name:"",pid:0,pname:"",sort:0,type:0,isHaveChildren:!0},rules:{name:[{required:!0,message:"请输入菜单名称",trigger:"blur"}],pname:[{required:!0,message:"请输入菜单名称",trigger:"blur"}],categoryId:[{required:!0,message:"请添加商品分类",trigger:"blur"}],sort:[{required:!0,message:"请选择排序",trigger:"blur"}]},showGoodsCategoryDialog:!1}},methods:{openDialog:function(e){console.log(e),e&&(this.ruleForm=e)},cancel:function(){this.$emit("cancel")},openGoodsCategoryDialog:function(e,t){var a=this;this.showGoodsCategoryDialog=!0,this.$nextTick((function(){a.$refs.gcdRef.openDialog(e,t)}))},getCategoryId:function(e){this.ruleForm.categoryId=e.id,this.ruleForm.categoryName=e.name},submitForm:function(e){var t=this;this.$refs[e].validate((function(e){if(e){var a=t.ruleForm.id?"edit":"add";Object(l["a"])(t.ruleForm,a).then((function(e){var a=t.ruleForm.id?"修改菜单成功":"新建菜单成功";t.$message.success(a),t.cancel(),t.$emit("refreshList")})).catch((function(){}))}}))}}},h=v,b=(a("00ab"),Object(f["a"])(h,r,s,!1,null,"a2c74afa",null)),y=b.exports,_={name:"mallMenuBar",components:{addMallMenuDialog:y},data:function(){return{listLoading:!1,showAddMallMenuDialog:!1,menuList:[],showExplain:!1}},mounted:function(){Object(n["a"])(["platform:admin:role:list"])&&this.getList()},methods:{checkPermi:n["a"],getList:function(){var e=this;this.listLoading=!0,Object(l["j"])(0).then((function(t){e.menuList=t,e.listLoading=!1})).catch((function(){e.listLoading=!1}))},handleAddorEdit:function(e,t){var a=this;this.showAddMallMenuDialog=!0,this.$nextTick((function(){if(e){if("add"===t)a.$refs.amdRef.openDialog({id:"",categoryId:"",categoryName:"",level:e.level+1,name:"",pid:e.id,pname:e.name,sort:0,type:0,isHaveChildren:!0});else if("edit"===t)if(1===e.level)a.$refs.amdRef.openDialog({id:e.id,categoryId:e.categoryId,categoryName:e.categoryName,level:e.level,name:e.name,pid:e.pid,pname:"",sort:e.sort,type:e.type,isHaveChildren:0===e.childList.length});else if(2===e.level){var o=a.menuList.findIndex((function(t){return t.id===e.pid}));-1!==o&&a.$refs.amdRef.openDialog({id:e.id,categoryId:e.categoryId,categoryName:e.categoryName,level:e.level,name:e.name,pid:e.pid,pname:a.menuList[o].name,sort:e.sort,type:e.type,isHaveChildren:0===e.childList.length})}else 3===e.level&&a.menuList.forEach((function(t){var o=t.childList.findIndex((function(t){return t.id===e.pid}));-1!==o&&a.$refs.amdRef.openDialog({id:e.id,categoryId:e.categoryId,categoryName:e.categoryName,level:e.level,name:e.name,pid:e.pid,pname:t.childList[o].name,sort:e.sort,type:e.type,isHaveChildren:0===e.childList.length})}))}else a.$refs.amdRef.openDialog(e)}))},handleDelete:function(e){var t=this,a="";if(1===e.level)a="确定删除该一级菜单的配置吗?删除后不可撤回,请谨慎操作!";else if(2===e.level){var o=this.menuList.findIndex((function(t){return t.id===e.pid}));-1!==o&&(a=1===this.menuList[o].childList.length?"确定删除该二级菜单的配置吗?删除后请及时将对应的一级菜单做商品分类关联,请知悉!":"确定删除该二级菜单的配置吗?删除后不可撤回,请谨慎操作!")}else 3===e.level&&this.menuList.forEach((function(t){var o=t.childList.findIndex((function(t){return t.id===e.pid}));-1!==o&&(a=1===t.childList[o].childList.length?"确定删除该三级菜单的配置吗?删除后请及时将对应的一级菜单做商品分类关联,请知悉!":"确定删除该三级菜单的配置吗?删除后不可撤回,请谨慎操作!")}));this.$confirm(a,"删除提醒",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(){Object(l["h"])(e.id).then((function(){t.getList(),t.$message.success("删除成功!")}))}))}}},w=_,x=(a("68ba"),Object(f["a"])(w,o,i,!1,null,"68c5fbce",null));t["default"]=x.exports}}]);