(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-b35885bc"],{b419:function(e,t,a){"use strict";a.r(t);var n=function(){var e=this,t=e._self._c;return t("a-drawer",{attrs:{width:"480",title:e.formTitle,"label-col":4,"wrapper-col":14,visible:e.open,"body-style":{height:"calc(100vh - 100px)",overflow:"auto"}},on:{close:e.cancel}},[t("a-form-model",{ref:"form",attrs:{model:e.form,rules:e.rules,layout:"vertical"}},[t("a-spin",{attrs:{spinning:e.spinning,delay:e.delayTime,tip:"Loading..."}},[t("a-form-model-item",{attrs:{label:"上级菜单",prop:"parentId"}},[t("a-tree-select",{staticStyle:{width:"100%"},attrs:{"dropdown-style":{maxHeight:"400px",overflow:"auto"},"tree-data":e.menuOptions,placeholder:"请选择",replaceFields:{children:"children",title:"menuName",key:"id",value:"id"},"tree-default-expand-all":""},on:{change:e.onMenuTreeChange},model:{value:e.form.parentId,callback:function(t){e.$set(e.form,"parentId",t)},expression:"form.parentId"}})],1),t("a-form-model-item",{attrs:{label:"菜单类型",prop:"menuType"}},[t("a-radio-group",{attrs:{"button-style":"solid"},model:{value:e.form.menuType,callback:function(t){e.$set(e.form,"menuType",t)},expression:"form.menuType"}},e._l(e.menuTypeOptions,(function(a,n){return t("a-radio-button",{key:n,attrs:{disabled:-1===e.menuTypeEnableValue.indexOf(a.menuTypeValue),value:a.menuTypeValue}},[e._v(e._s(a.menuTypeLabel))])})),1)],1),t("a-form-model-item",{attrs:{label:"图标",prop:"icon"}},[t("a-space",{staticClass:"selectIconBox",attrs:{size:"large"}},[e.allIcon[e.form.icon+"Icon"]?t("a-icon",{staticClass:"selectIcon",attrs:{component:e.allIcon[e.form.icon+"Icon"]}}):e._e(),e.allIcon[e.form.icon+"Icon"]?e._e():t("a-icon",{attrs:{type:e.form.icon}}),t("a",{staticClass:"selectup",on:{click:e.selectIcon}},[t("a-icon",{attrs:{type:e.SelectIcon}})],1)],1),e.iconVisible?t("a-card",{attrs:{bordered:!1}},[t("icon-selector",{attrs:{svgIcons:e.iconList,allIcon:e.allIcon},on:{change:e.handleIconChange},model:{value:e.form.icon,callback:function(t){e.$set(e.form,"icon",t)},expression:"form.icon"}})],1):e._e()],1),t("a-form-model-item",{attrs:{label:"菜单编码",prop:"menuCode"}},[t("a-input",{attrs:{placeholder:"请输入"},model:{value:e.form.menuCode,callback:function(t){e.$set(e.form,"menuCode",t)},expression:"form.menuCode"}})],1),t("a-form-model-item",{attrs:{label:"菜单名称",prop:"menuName"}},[t("a-input",{attrs:{placeholder:"请输入"},model:{value:e.form.menuName,callback:function(t){e.$set(e.form,"menuName",t)},expression:"form.menuName"}})],1),t("a-form-model-item",{attrs:{label:"排序",prop:"treeSort"}},[t("a-input-number",{staticStyle:{width:"100%"},attrs:{min:0},model:{value:e.form.treeSort,callback:function(t){e.$set(e.form,"treeSort",t)},expression:"form.treeSort"}})],1),"F"!=e.form.menuType?t("a-form-model-item",{attrs:{label:"是否外链",prop:"isFrame"}},[t("a-radio-group",{attrs:{"button-style":"solid"},model:{value:e.form.isFrame,callback:function(t){e.$set(e.form,"isFrame",t)},expression:"form.isFrame"}},[t("a-radio-button",{attrs:{value:"0"}},[e._v("是")]),t("a-radio-button",{attrs:{value:"1"}},[e._v("否")])],1)],1):e._e(),"F"!=e.form.menuType?t("a-form-model-item",{attrs:{label:"路由地址",prop:"path"}},[t("a-input",{attrs:{placeholder:"请输入"},model:{value:e.form.path,callback:function(t){e.$set(e.form,"path",t)},expression:"form.path"}})],1):e._e(),"C"==e.form.menuType?t("a-form-model-item",{attrs:{label:"组件路径",prop:"component"}},[t("a-input",{attrs:{placeholder:"请输入"},model:{value:e.form.component,callback:function(t){e.$set(e.form,"component",t)},expression:"form.component"}})],1):e._e(),"M"!=e.form.menuType?t("a-form-model-item",{attrs:{label:"权限标识",prop:"perms"}},[t("a-input",{attrs:{placeholder:"请输入"},model:{value:e.form.perms,callback:function(t){e.$set(e.form,"perms",t)},expression:"form.perms"}})],1):e._e(),"F"!=e.form.menuType?t("a-form-model-item",{attrs:{label:"是否显示",prop:"visible"}},[t("a-radio-group",{attrs:{"button-style":"solid"},model:{value:e.form.visible,callback:function(t){e.$set(e.form,"visible",t)},expression:"form.visible"}},e._l(e.visibleOptions,(function(a,n){return t("a-radio-button",{key:n,attrs:{value:a.dictValue}},[e._v(e._s(a.dictLabel))])})),1)],1):e._e(),"F"!=e.form.menuType?t("a-form-model-item",{attrs:{label:"状态",prop:"status"}},[t("a-radio-group",{attrs:{"button-style":"solid"},model:{value:e.form.status,callback:function(t){e.$set(e.form,"status",t)},expression:"form.status"}},e._l(e.statusOptions,(function(a,n){return t("a-radio-button",{key:n,attrs:{value:a.dictValue}},[e._v(e._s(a.dictLabel))])})),1)],1):e._e(),"C"==e.form.menuType?t("a-form-model-item",{attrs:{label:"是否缓存",prop:"isCache"}},[t("a-radio-group",{attrs:{"button-style":"solid"},model:{value:e.form.isCache,callback:function(t){e.$set(e.form,"isCache",t)},expression:"form.isCache"}},[t("a-radio-button",{attrs:{value:"0"}},[e._v("缓存")]),t("a-radio-button",{attrs:{value:"1"}},[e._v("不缓存")])],1)],1):e._e(),t("a-form-model-item",{attrs:{label:"备注",prop:"remark"}},[t("a-input",{attrs:{placeholder:"请输入",type:"textarea","allow-clear":""},model:{value:e.form.remark,callback:function(t){e.$set(e.form,"remark",t)},expression:"form.remark"}})],1)],1),t("div",{staticClass:"bottom-control"},[t("a-space",[t("a-button",{attrs:{type:"primary"},on:{click:e.submitForm}},[e._v(" 保存 ")]),t("a-button",{on:{click:e.cancel}},[e._v(" 取消 ")])],1)],1)],1)],1)},o=[],s=a("5530"),r=a("cdba"),i=Object(s["a"])({},r["default"]),l=i,d=a("2877"),c=Object(d["a"])(l,n,o,!1,null,null,null);t["default"]=c.exports},ba35:function(e,t,a){"use strict";a.r(t);var n=function(){var e=this,t=e._self._c;return t("div",[t("a-card",{staticStyle:{"margin-bottom":"10px"},attrs:{bordered:!1}},[t("div",{staticClass:"table-page-search-wrapper"},[t("a-form",{attrs:{labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[t("a-row",{attrs:{gutter:48}},[t("a-col",{attrs:{md:6,sm:24}},[t("a-form-item",{attrs:{label:"菜单名称"}},[t("a-input",{attrs:{placeholder:"请输入菜单名称","allow-clear":""},model:{value:e.queryParam.menuName,callback:function(t){e.$set(e.queryParam,"menuName",t)},expression:"queryParam.menuName"}})],1)],1),t("a-col",{attrs:{md:6,sm:24}},[t("a-form-item",{attrs:{label:"状态"}},[t("a-select",{staticStyle:{width:"100%"},attrs:{placeholder:"请选择","allow-clear":""},model:{value:e.queryParam.status,callback:function(t){e.$set(e.queryParam,"status",t)},expression:"queryParam.status"}},e._l(e.statusOptions,(function(a,n){return t("a-select-option",{key:n,attrs:{value:a.dictValue}},[e._v(e._s(a.dictLabel))])})),1)],1)],1),t("a-col",[t("span",{staticClass:"table-page-search-submitButtons",staticStyle:{float:"right"}},[t("a-button",{attrs:{type:"primary"},on:{click:e.handleQuery}},[t("a-icon",{attrs:{type:"search"}}),e._v("查询")],1),t("a-button",{staticStyle:{"margin-left":"8px"},on:{click:e.resetQuery}},[t("a-icon",{attrs:{type:"redo"}}),e._v("重置")],1)],1)])],1)],1)],1)]),t("a-card",{staticClass:"table-card",attrs:{bordered:!1}},[e.showAddModal?t("menu-add-form",{ref:"menuAddForm",attrs:{menuOptions:e.menuOptions,menuTypeOptions:e.menuTypeOptions,statusOptions:e.statusOptions,visibleOptions:e.visibleOptions},on:{ok:e.getList,"select-tree":e.getTreeselect,close:function(t){e.showAddModal=!1}}}):e._e(),e.showEditModal?t("menu-edit-form",{ref:"menuEditForm",attrs:{menuOptions:e.menuOptions,menuTypeOptions:e.menuTypeOptions,statusOptions:e.statusOptions,visibleOptions:e.visibleOptions},on:{ok:e.getList,"select-tree":e.getTreeselect,close:function(t){e.showEditModal=!1}}}):e._e(),t("advance-table",{attrs:{loading:e.loading,title:"菜单管理",rowKey:"id",expandIconColumnIndex:1,columns:e.columns,"data-source":e.list,pagination:!1,size:"middle",tableKey:"system-menu-MenuIndex-table",defaultExpandedRowKeys:e.expandedRowKeys,expandedRowKeys:e.expandedRowKeys,expandIcon:e.expandIcon,indentSize:16,"row-selection":{selectedRowKeys:e.selectedRowKeys,onChange:e.onSelectChange}},on:{refresh:e.getList,expand:e.expandNode},scopedSlots:e._u([{key:"menuName",fn:function(a){var n=a.text,o=a.record;return t("span",{},[t("a-icon",{staticClass:"depIcon",style:{fontSize:"16px",marginTop:"0px"},attrs:{component:e.allIcon[o.icon+"Icon"],type:o.icon}}),n.indexOf(e.queryParam.menuName)>-1?t("span",[e._v(" "+e._s(n.substr(0,n.indexOf(e.queryParam.menuName)))+" "),t("span",{staticStyle:{color:"#f50"}},[e._v(e._s(e.queryParam.menuName))]),e._v(" "+e._s(n.substr(n.indexOf(e.queryParam.menuName)+e.queryParam.menuName.length))+" ")]):t("span",[e._v(e._s(n))])],1)}},{key:"treeSort",fn:function(a){var n=a.text;return t("span",{},[t("a-tag",{staticStyle:{width:"50px"}},[e._v(" "+e._s(n)+" ")])],1)}},{key:"menuType",fn:function(a){var n=a.text,o=a.record;return t("span",{},[t("a-tag",{attrs:{color:e._f("menuTypeFilter")(n)}},[e._v(" "+e._s(e.menuTypeFormat(o))+" ")])],1)}},{key:"status",fn:function(a){a.text;var n=a.record;return t("span",{},[t("a-badge",{attrs:{status:"0"==n.status?"processing":"error",text:e.statusFormat(n)}})],1)}},{key:"visible",fn:function(a){var n=a.text,o=a.record;return t("span",{},[t("span",{style:{color:"1"===n?"red":"#000;"}},[e._v(e._s(e.visibleFormat(o)))])])}},{key:"operation",fn:function(a){a.text;var n=a.record;return t("span",{},[t("a",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["system:dept:edit"],expression:"['system:dept:edit']"}],on:{click:function(t){return e.handleUpdate(n)}}},[e._v(" 修改 ")]),"0"==n.status&&"F"!==n.menuType?t("a-divider",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["system:dept:add"],expression:"['system:dept:add']"}],attrs:{type:"vertical"}}):e._e(),"0"==n.status&&"F"!==n.menuType?t("a",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["system:dept:add"],expression:"['system:dept:add']"}],on:{click:function(t){return e.handleAdd(n)}}},[e._v(" 添加子菜单 ")]):e._e(),"y"==n.treeLeaf?t("a-divider",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["system:dept:remove"],expression:"['system:dept:remove']"}],attrs:{type:"vertical"}}):e._e(),"y"==n.treeLeaf?t("a",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["system:dept:remove"],expression:"['system:dept:remove']"}],on:{click:function(t){return e.handleDelete(n)}}},[e._v(" 删除 ")]):e._e()],1)}}])},[t("div",{staticClass:"table-operations",attrs:{slot:"button"},slot:"button"},[t("a-space",{attrs:{align:"center"}},[t("a-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["system:dept:add"],expression:"['system:dept:add']"}],attrs:{type:"primary"},on:{click:function(t){return e.handleAdd()}}},[t("a-icon",{attrs:{type:"plus"}}),e._v("新增 ")],1)],1)],1)])],1)],1)},o=[],s=(a("4de4"),a("d81d"),a("d3b7"),a("159b"),a("a6dc")),r=a("b419"),i=a("e1e4"),l=a("5d9e"),d=a("04b3"),c={name:"Menu",components:{AdvanceTable:l["a"],MenuEditForm:r["default"],MenuAddForm:i["default"],allIcon:d["a"]},data:function(){return{showAddModal:!1,showEditModal:!1,allIcon:d["a"],iconVisible:!1,list:[],selectedRowKeys:[],selectedRows:[],ids:[],menuOptions:[],expandedRowKeys:[],menuTypeOptions:[],loading:!1,statusOptions:[],visibleOptions:[],labelCol:{span:6},wrapperCol:{span:18},queryParam:{menuName:void 0,visible:void 0},columns:[{title:"菜单名称",dataIndex:"menuName",width:"20%",scopedSlots:{customRender:"menuName"}},{title:"菜单编码",dataIndex:"menuCode",width:"150px",scopedSlots:{customRender:"menuCode"}},{title:"排序",dataIndex:"treeSort",align:"center",width:"50px",scopedSlots:{customRender:"treeSort"}},{title:"菜单类型",dataIndex:"menuType",width:"80px",scopedSlots:{customRender:"menuType"},align:"center"},{title:"可见",dataIndex:"visible",width:"50px",scopedSlots:{customRender:"visible"},align:"center"},{title:"权限标识",dataIndex:"perms",ellipsis:!0,align:"center"},{title:"组件路径",dataIndex:"component",ellipsis:!0,scopedSlots:{customRender:"component"},align:"center"},{title:"状态",dataIndex:"status",width:"80px",scopedSlots:{customRender:"status"},align:"center"},{title:"操作",dataIndex:"operation",width:"210px",scopedSlots:{customRender:"operation"}}]}},filters:{menuTypeFilter:function(e){var t="#108ee9";return"M"===e?t="#2db7f5":"C"===e&&(t="#87d068"),t}},created:function(){var e=this;this.getList(),this.getDicts("sys_normal_disable").then((function(t){e.statusOptions=t.data})),this.getDicts("sys_show_hide").then((function(t){e.visibleOptions=t.data})),this.menuTypeOptions=[{menuTypeValue:"M",menuTypeLabel:"目录"},{menuTypeValue:"C",menuTypeLabel:"菜单"},{menuTypeValue:"F",menuTypeLabel:"按钮"}]},computed:{},watch:{},methods:{expandNode:function(e,t){var a=this;e?this.expandedRowKeys.push(t.id):this.expandedRowKeys=this.expandedRowKeys.filter((function(e){return e!==t.id})),e&&0===t.children.length&&(this.loading=!0,Object(s["f"])(this.queryParam,t.id,1).then((function(e){t.children=e.data,a.loading=!1})))},onSelectChange:function(e,t,a){this.selectedRowKeys=e,this.selectedRows=t,this.ids=this.selectedRows.map((function(e){return e.id})),this.multiple=!e.length},getList:function(){var e=this;this.expandedRowKeys=[],this.loading=!0,Object(s["f"])(this.queryParam,"",1).then((function(t){e.expandTree(t.data,1,e.expandedRowKeys),e.list=t.data,e.loading=!1}))},visibleFormat:function(e){return this.selectDictLabel(this.visibleOptions,e.visible)},statusFormat:function(e){return this.selectDictLabel(this.statusOptions,e.status)},menuTypeFormat:function(e){return"M"===e.menuType?"目录":"C"===e.menuType?"菜单":"F"===e.menuType?"按钮":void 0},handleQuery:function(){var e=this;void 0===this.queryParam.menuName&&void 0===this.queryParam.status||""===this.queryParam.menuName&&""===this.queryParam.status?(this.expandedRowKeys=[],this.getList()):(this.loading=!0,Object(s["i"])(this.queryParam).then((function(t){e.expandedRowKeys=[],0!==t.data.length?(e.getAllMenuNode(t.data),e.list=t.data):e.list=[],e.loading=!1})))},handleAdd:function(e){var t=this;this.showAddModal=!0,this.$nextTick((function(){return t.$refs.menuAddForm.handleAdd(e)}))},handleUpdate:function(e){var t=this;this.showEditModal=!0,this.$nextTick((function(){return t.$refs.menuEditForm.handleUpdate(e)}))},getAllMenuNode:function(e){var t=this;if(!e||0===e.length)return[];e.forEach((function(e){return 0!==e.children.length&&t.expandedRowKeys.push(e.id),t.getAllMenuNode(e.children)}))},resetQuery:function(){this.queryParam={deptName:void 0,status:void 0},this.handleQuery()},getTreeselect:function(){var e=this;Object(s["f"])().then((function(t){e.menuOptions=[];var a={id:0,menuName:"主目录",children:[]};a.children=t.data,e.menuOptions.push(a)}))},handleDelete:function(e){var t=this,a=e.id||this.ids;this.$confirm({title:"确认删除所选中数据?",content:"当前选中的数据",onOk:function(){return Object(s["c"])(a).then((function(){null!==e?t.removeTreeNode(t.list,e):(t.onSelectChange([],[],[]),t.getList()),t.$message.success("删除成功",3)}))},onCancel:function(){}})},expandIcon:function(e){var t=this.$createElement;return"y"===e.record.treeLeaf?t("span",{style:"margin-right:22px"}):e.expanded?t("a",{style:"color: 'black',margin-right:0px",on:{click:function(t){e.onExpand(e.record,t)}}},[t("a-icon",{attrs:{type:"caret-down"}})]):t("a",{style:"color: 'black' ,margin-right:0px",on:{click:function(t){e.onExpand(e.record,t)}}},[t("a-icon",{attrs:{type:"caret-right"}})])}}},m=c,u=a("2877"),p=Object(u["a"])(m,n,o,!1,null,null,null);t["default"]=p.exports}}]);