(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-0c44bfd0"],{1139:function(e,t,i){"use strict";var a=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",[[i("div",{staticClass:"divBox"},[i("el-card",{staticClass:"box-card"},[i("div",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["platform:product:category:add","platform:article:category:add"],expression:"['platform:product:category:add', 'platform:article:category:add']"}],staticClass:"clearfix acea-row",attrs:{slot:"header"},slot:"header"},[i("el-button",{attrs:{size:"mini",type:"primary"},on:{click:function(t){return e.handleAddMenu({id:0,name:"顶层目录"})}}},[e._v("新增"+e._s(e.biztype.name)+"\n ")]),e._v(" "),i("el-alert",{directives:[{name:"show",rawName:"v-show",value:1===e.biztype.value,expression:"biztype.value === 1"}],staticClass:"alert_title",attrs:{title:"平台分类必须要设置三级分类",type:"warning",effect:"dark"}})],1),e._v(" "),i("el-table",{ref:"treeList",staticClass:"table",attrs:{data:e.dataList,size:"mini","highlight-current-row":"","row-key":"id","tree-props":{children:"children",hasChildren:"hasChildren"}}},[i("el-table-column",{attrs:{prop:"name",label:"名称","min-width":"240"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(" "+e._s(t.row.name)+" | "+e._s(t.row.id))]}}])}),e._v(" "),i("el-table-column",{attrs:{label:"对应终端","min-width":"240"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(e._s(e.dealWithTerminal(t.row)))]}}])}),e._v(" "),e.selectModel?e._e():[i("el-table-column",{attrs:{label:"分类图标","min-width":"80"},scopedSlots:e._u([{key:"default",fn:function(t){return[i("div",{staticClass:"demo-image__preview"},[t.row.icon?i("el-image",{staticStyle:{width:"36px",height:"36px"},attrs:{src:t.row.icon,"preview-src-list":[t.row.icon]}}):i("img",{staticStyle:{width:"36px",height:"36px"},attrs:{src:e.defaultImg,alt:""}})],1)]}}],null,!1,2354360158)}),e._v(" "),5===e.biztype.value?i("el-table-column",{key:"2",attrs:{label:"Url","min-width":"250"},scopedSlots:e._u([{key:"default",fn:function(t){return[i("span",[e._v(e._s(t.row.url))])]}}],null,!1,3700262509)}):e._e(),e._v(" "),i("el-table-column",{attrs:{label:"排序",prop:"sort","min-width":"150"}}),e._v(" "),2===e.biztype.value?i("el-table-column",{attrs:{label:"状态","min-width":"150",fixed:"right"},scopedSlots:e._u([{key:"default",fn:function(t){return[e.checkPermi(["platform:product:category:show:status"])?i("el-switch",{attrs:{"active-value":!0,"inactive-value":!1,"active-text":"显示","inactive-text":"隐藏"},on:{change:function(i){return e.onchangeIsShow(t.row)}},model:{value:t.row.status,callback:function(i){e.$set(t.row,"status",i)},expression:"scope.row.status"}}):i("div",[e._v(e._s(t.row.status?"显示":"隐藏"))])]}}],null,!1,3103931800)}):e._e(),e._v(" "),1===e.biztype.value?i("el-table-column",{attrs:{label:"状态","min-width":"150",fixed:"right"},scopedSlots:e._u([{key:"default",fn:function(t){return[e.checkPermi(["platform:article:category:switch"])?i("el-switch",{attrs:{"active-value":!0,"inactive-value":!1,"active-text":"显示","inactive-text":"隐藏"},on:{change:function(i){return e.onchangeIsShow(t.row)}},model:{value:t.row.isShow,callback:function(i){e.$set(t.row,"isShow",i)},expression:"scope.row.isShow"}}):i("div",[e._v(e._s(t.row.isShow?"显示":"隐藏"))])]}}],null,!1,3134645576)}):e._e(),e._v(" "),i("el-table-column",{attrs:{label:"操作","min-width":"200",fixed:"right",align:"center"},scopedSlots:e._u([{key:"default",fn:function(t){return[1===e.biztype.value&&t.row.level<3&&e.checkPermi(["platform:product:category:add","platform:article:category:add"])?i("el-button",{attrs:{type:"text",size:"small"},on:{click:function(i){return e.handleAddMenu(t.row)}}},[e._v("添加子目录\n ")]):e._e(),e._v(" "),i("el-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["platform:product:category:update","platform:article:category:update"],expression:"['platform:product:category:update', 'platform:article:category:update']"}],attrs:{type:"text",size:"small"},on:{click:function(i){return e.handleEditMenu(t.row)}}},[e._v("编辑\n ")]),e._v(" "),i("el-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["platform:product:category:delete","platform:article:category:delete"],expression:"['platform:product:category:delete', 'platform:article:category:delete']"}],attrs:{type:"text",size:"small"},on:{click:function(i){return e.handleDelete(t.row)}}},[e._v("删除\n ")])]}}],null,!1,283309269)})]],2)],1)],1)],e._v(" "),i("el-dialog",{attrs:{title:0===e.editDialogConfig.isCreate?"创建"+e.biztype.name:"编辑"+e.biztype.name,visible:e.editDialogConfig.visible,"destroy-on-close":"","close-on-click-modal":!1},on:{"update:visible":function(t){return e.$set(e.editDialogConfig,"visible",t)}}},[e.editDialogConfig.visible?i("edit",{attrs:{prent:e.editDialogConfig.prent,"is-create":e.editDialogConfig.isCreate,"edit-data":e.editDialogConfig.data,biztype:e.editDialogConfig.biztype,"all-tree-list":e.dataList},on:{hideEditDialog:e.hideEditDialog}}):e._e()],1)],2)},r=[],l=i("2423"),n=i("c4c8"),s=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",[i("el-tree",{attrs:{data:e.ddd,props:e.defaultProps},on:{"node-click":e.handleNodeClick}})],1)},o=[],d=i("651a"),c={props:{id:{type:Number,required:!0}},data:function(){return{defaultProps:{children:"children",label:"label"},ddd:[{label:"一级 1",children:[{label:"二级 1-1",children:[{label:"三级 1-1-1"}]}]},{label:"一级 2",children:[{label:"二级 2-1",children:[{label:"三级 2-1-1"}]},{label:"二级 2-2",children:[{label:"三级 2-2-1"}]}]},{label:"一级 3",children:[{label:"二级 3-1",children:[{label:"三级 3-1-1"}]},{label:"二级 3-2",children:[{label:"三级 3-2-1"}]}]}],dataList:{page:0,limit:0,totalPage:0,total:0,list:[]}}},mounted:function(){this.handlerGetTreeList(this.id)},methods:{handlerGetTreeList:function(e){var t=this;e?d["d"]({pid:e}).then((function(e){t.dataList=e})):this.$message.error("当前数据id不正确")},handleNodeClick:function(e){console.log("data:",e)}}},u=c,h=i("2877"),m=Object(h["a"])(u,s,o,!1,null,"68b6177c",null),p=m.exports,f=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",[i("el-form",{ref:"editPram",attrs:{model:e.editPram,"label-width":"130px"}},[i("el-form-item",{attrs:{label:"分类名称",prop:"name",rules:[{required:!0,message:"请输入分类名称",trigger:["blur","change"]}]}},[i("el-input",{attrs:{maxlength:1===e.biztype.value?8:20,placeholder:"分类名称"},model:{value:e.editPram.name,callback:function(t){e.$set(e.editPram,"name","string"===typeof t?t.trim():t)},expression:"editPram.name"}})],1),e._v(" "),2!==e.biztype.value?i("el-form-item",{attrs:{label:"父级"}},[i("el-cascader",{ref:"cascader",staticStyle:{width:"100%"},attrs:{disabled:1===e.isCreate,options:e.allTreeList,filterable:"",props:e.categoryProps},on:{change:e.handleChange},model:{value:e.editPram.pid,callback:function(t){e.$set(e.editPram,"pid",t)},expression:"editPram.pid"}})],1):e._e(),e._v(" "),i("el-form-item",{attrs:{label:"对应终端"}},[i("el-checkbox-group",{model:{value:e.terminalList,callback:function(t){e.terminalList=t},expression:"terminalList"}},[i("el-checkbox",{attrs:{label:"商城市场"}}),e._v(" "),i("el-checkbox",{attrs:{label:"e站风评"}})],1)],1),e._v(" "),i("el-form-item",{attrs:{label:"分类图标(180*180)"}},[i("div",{staticClass:"upLoadPicBox",on:{click:function(t){return e.modalPicTap("1")}}},[e.editPram.icon?i("div",{staticClass:"pictrue"},[i("img",{attrs:{src:e.editPram.icon}})]):i("div",{staticClass:"upLoad"},[i("i",{staticClass:"el-icon-camera cameraIconfont"})])])]),e._v(" "),i("el-form-item",{attrs:{label:"排序"}},[i("el-input-number",{attrs:{min:0},model:{value:e.editPram.sort,callback:function(t){e.$set(e.editPram,"sort","string"===typeof t?t.trim():t)},expression:"editPram.sort"}})],1),e._v(" "),1!==e.biztype.value&&3!==e.biztype.value&&5!==e.biztype.value?i("el-form-item",{attrs:{label:"扩展字段"}},[i("el-input",{attrs:{type:"textarea",placeholder:"扩展字段"},model:{value:e.editPram.extra,callback:function(t){e.$set(e.editPram,"extra","string"===typeof t?t.trim():t)},expression:"editPram.extra"}})],1):e._e(),e._v(" "),i("el-form-item",[i("el-button",{directives:[{name:"debounceClick",rawName:"v-debounceClick",value:function(){e.handlerSubmit("editPram")},expression:"\n () => {\n handlerSubmit('editPram');\n }\n "},{name:"hasPermi",rawName:"v-hasPermi",value:["platform:product:category:add","platform:product:category:update","platform:category:update","platform:category:save"],expression:"[\n 'platform:product:category:add',\n 'platform:product:category:update',\n 'platform:category:update',\n 'platform:category:save',\n ]"}],attrs:{type:"primary",loading:e.loadingBtn}},[e._v("确定")]),e._v(" "),i("el-button",{on:{click:e.close}},[e._v("取消")])],1)],1)],1)},v=[];function g(e){return P(e)||w(e)||y(e)||b()}function b(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function y(e,t){if(e){if("string"===typeof e)return C(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?C(e,t):void 0}}function w(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function P(e){if(Array.isArray(e))return C(e)}function C(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,a=new Array(t);i=3?e.disabled=!0:t.treeListCheckLevelLT3ForDisabled(e.children)}))},handlerSubmit:function(e){var t=this;this.terminalList.indexOf("商城市场")>=0?this.editPram.pcMall=1:this.editPram.pcMall=0,this.terminalList.indexOf("e站风评")>=0?this.editPram.wxMiniRisk=1:this.editPram.wxMiniRisk=0,this.$refs[e].validate((function(e){e&&t.handlerSaveOrUpdate(0===t.isCreate)}))},handlerSaveOrUpdate:function(e){var t=this;if(e)this.loadingBtn=!0,2!==this.biztype.value?(0===this.editPram.pid&&(this.editPram.level=1),this.editPram.level||(this.editPram.level=parseInt(this.prent.level)+1),n["s"](this.editPram).then((function(e){t.$emit("hideEditDialog"),t.$message.success("创建目录成功"),t.$store.commit("product/SET_AdminProductClassify",[]),t.loadingBtn=!1})).catch((function(){t.loadingBtn=!1}))):l["f"](this.editPram).then((function(e){t.$emit("hideEditDialog"),t.$message.success("创建目录成功"),localStorage.clear("articleClass"),t.loadingBtn=!1})).catch((function(){t.loadingBtn=!1}));else if(this.loadingBtn=!0,2!==this.biztype.value){if(this.editPram.pid===this.editData.id)return this.$message.warning("父级不能选当前分类");n["x"](this.editPram).then((function(e){t.$emit("hideEditDialog"),t.$message.success("更新目录成功"),t.$store.commit("product/SET_AdminProductClassify",[]),t.loadingBtn=!1})).catch((function(){t.loadingBtn=!1}))}else this.editPram.pid=Array.isArray(this.editPram.pid)?this.editPram.pid[0]:this.editPram.pid,l["j"](this.editPram).then((function(e){t.$emit("hideEditDialog"),t.$message.success("更新目录成功"),localStorage.clear("articleClass"),t.loadingBtn=!1})).catch((function(){t.loadingBtn=!1}))}}},k=_,x=Object(h["a"])(k,f,v,!1,null,"f0c1598a",null),S=x.exports,L=i("fca7"),$=i("e350"),D={components:{info:p,edit:S},props:{biztype:{type:Object,default:{value:-1},validator:function(e){return e.value>0}},pid:{type:Number,default:0,validator:function(e){return e>=0}},selectModel:{type:Boolean,default:!1},selectModelKeys:{type:Array},rowSelect:{}},data:function(){return{selectModelKeysNew:this.selectModelKeys,loading:!1,constants:this.$constants,treeProps:{label:"name",children:"child"},multipleSelection:[],editDialogConfig:{visible:!1,isCreate:0,prent:{},data:{},biztype:this.biztype},dataList:[],listPram:{pid:this.pid,type:this.biztype.value,status:-1,name:"",page:this.$constants.page.page,limit:this.$constants.page.limit[0]},viewInfoConfig:{data:null,visible:!1},defaultImg:i("cf6b")}},mounted:function(){2===this.biztype.value?Object($["a"])(["platform:article:category:list"])&&this.handlerGetList():Object($["a"])(["platform:product:page:list"])&&this.handlerGetTreeList()},methods:{checkPermi:$["a"],onchangeIsShow:function(e){var t=this;2===this.biztype.value?l["i"](e.id).then((function(){t.$message.success("修改成功"),localStorage.clear("articleClass"),t.handlerGetList()})).catch((function(){e.status=!e.status})):n["w"](e.id).then((function(){t.$message.success("修改成功"),t.$store.commit("product/SET_AdminProductClassify",[]),t.handlerGetTreeList()})).catch((function(){e.isShow=!e.isShow}))},handleEditMenu:function(e){this.editDialogConfig.isCreate=1,this.editDialogConfig.data=e,this.editDialogConfig.prent=e,this.editDialogConfig.visible=!0},handleAddMenu:function(e){this.editDialogConfig.isCreate=0,this.editDialogConfig.prent=e,this.editDialogConfig.data={},this.editDialogConfig.biztype=this.biztype,this.editDialogConfig.visible=!0},getCurrentNode:function(e){var t=this.$refs.tree.getNode(e);this.childNodes(t),this.$emit("rulesSelect",this.$refs.tree.getCheckedKeys())},childNodes:function(e){for(var t=e.childNodes.length,i=0;i