beehole-store-server
Version:
www.bee-hole.com
1 lines • 15.9 kB
JavaScript
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-b35885bc"],{b419:function(e,t,a){"use strict";a.r(t);a("b0c0"),a("4e82");var s=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:"pid"}},[t("a-tree-select",{staticStyle:{width:"100%"},attrs:{"dropdown-style":{maxHeight:"400px",overflow:"auto"},"tree-data":e.menuOptions,placeholder:"请选择",replaceFields:{children:"children",title:"name",key:"id",value:"id"},"tree-default-expand-all":""},on:{change:e.onMenuTreeChange},model:{value:e.form.pid,callback:function(t){e.$set(e.form,"pid",t)},expression:"form.pid"}})],1),t("a-form-model-item",{attrs:{label:"上级菜单",prop:"pid"}},[t("a-input",{attrs:{placeholder:"请输入"},model:{value:e.form.pid,callback:function(t){e.$set(e.form,"pid",t)},expression:"form.pid"}})],1),t("a-form-model-item",{attrs:{label:"菜单类型",prop:"type"}},[t("a-radio-group",{attrs:{"button-style":"solid"},model:{value:e.form.type,callback:function(t){e.$set(e.form,"type",t)},expression:"form.type"}},e._l(e.menuTypeOptions,(function(a,s){return t("a-radio-button",{key:s,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:"code"}},[t("a-input",{attrs:{placeholder:"请输入"},model:{value:e.form.code,callback:function(t){e.$set(e.form,"code",t)},expression:"form.code"}})],1),t("a-form-model-item",{attrs:{label:"菜单名称",prop:"name"}},[t("a-input",{attrs:{placeholder:"请输入"},model:{value:e.form.name,callback:function(t){e.$set(e.form,"name",t)},expression:"form.name"}})],1),t("a-form-model-item",{attrs:{label:"排序",prop:"sort"}},[t("a-input-number",{staticStyle:{width:"100%"},attrs:{min:0},model:{value:e.form.sort,callback:function(t){e.$set(e.form,"sort",t)},expression:"form.sort"}})],1),"F"!==e.form.type?t("a-form-model-item",{attrs:{label:"是否外链",prop:"is_frame"}},[t("a-radio-group",{attrs:{"button-style":"solid"},model:{value:e.form.is_frame,callback:function(t){e.$set(e.form,"is_frame",t)},expression:"form.is_frame"}},[t("a-radio-button",{attrs:{value:"1"}},[e._v("是")]),t("a-radio-button",{attrs:{value:"2"}},[e._v("否")])],1)],1):e._e(),"F"!==e.form.type?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.type?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(),"C"===e.form.type?t("a-form-model-item",{attrs:{label:"资源分组",prop:"res_groups"}},[t("a-select",{attrs:{mode:"multiple",placeholder:"请选择","option-filter-prop":"children"},on:{change:e.groupChange},model:{value:e.res_groups_ids,callback:function(t){e.res_groups_ids=t},expression:"res_groups_ids"}},e._l(e.postOptions,(function(a,s){return t("a-select-option",{key:s,attrs:{value:a.res_group_id}},[e._v(" "+e._s(a.title)+" ")])})),1)],1):e._e(),"M"!==e.form.type?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.type?t("a-form-model-item",{attrs:{label:"是否显示",prop:"is_visible"}},[t("a-radio-group",{attrs:{"button-style":"solid"},model:{value:e.form.is_visible,callback:function(t){e.$set(e.form,"is_visible",t)},expression:"form.is_visible"}},e._l(e.visibleOptions,(function(a,s){return t("a-radio-button",{key:s,attrs:{value:a.value}},[e._v(e._s(a.label))])})),1)],1):e._e(),"F"!==e.form.type?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,s){return t("a-radio-button",{key:s,attrs:{value:a.value}},[e._v(e._s(a.label))])})),1)],1):e._e(),"C"===e.form.type?t("a-form-model-item",{attrs:{label:"是否缓存",prop:"is_cache"}},[t("a-radio-group",{attrs:{"button-style":"solid"},model:{value:e.form.is_cache,callback:function(t){e.$set(e.form,"is_cache",t)},expression:"form.is_cache"}},[t("a-radio-button",{attrs:{value:"1"}},[e._v("缓存")]),t("a-radio-button",{attrs:{value:"2"}},[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=[],n=a("5530"),r=a("cdba"),i=Object(n["a"])({},r["default"]),l=i,c=a("2877"),d=Object(c["a"])(l,s,o,!1,null,null,null);t["default"]=d.exports},ba35:function(e,t,a){"use strict";a.r(t);a("b0c0");var s=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.name,callback:function(t){e.$set(e.queryParam,"name",t)},expression:"queryParam.name"}})],1)],1),t("a-col",{attrs:{md:6,sm:24}},[t("a-form-item",{attrs:{label:"状态"}},[t("a-select",{staticStyle:{width:"100%"},attrs:{placeholder:"状态"},model:{value:e.queryParam.status,callback:function(t){e.$set(e.queryParam,"status",t)},expression:"queryParam.status"}},e._l(e.statusOptions,(function(a,s){return t("a-select-option",{key:s,attrs:{value:a.value}},[e._v(e._s(a.label))])})),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:"name",fn:function(a){var s=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}}),s.indexOf(e.queryParam.name)>-1?t("span",[e._v(" "+e._s(s.substr(0,s.indexOf(e.queryParam.name)))+" "),t("span",{staticStyle:{color:"#f50"}},[e._v(e._s(e.queryParam.name))]),e._v(" "+e._s(s.substr(s.indexOf(e.queryParam.name)+e.queryParam.name.length))+" ")]):t("span",[e._v(e._s(e.$t(s)))])],1)}},{key:"sort",fn:function(a){var s=a.text;return t("span",{},[t("a-tag",{staticStyle:{width:"50px"}},[e._v(" "+e._s(s)+" ")])],1)}},{key:"type",fn:function(a){var s=a.text,o=a.record;return t("span",{},[t("a-tag",{attrs:{color:e._f("menuTypeFilter")(s)}},[e._v(" "+e._s(e.menuTypeFormat(o))+" ")])],1)}},{key:"status",fn:function(a){a.text;var s=a.record;return t("span",{},[t("a-badge",{attrs:{status:"1"==s.status?"processing":"error",text:e.statusFormat(s)}})],1)}},{key:"is_visible",fn:function(a){var s=a.text,o=a.record;return t("span",{},[t("span",{style:{color:"1"===s?"red":"#000;"}},[e._v(e._s(e.visibleFormat(o)))])])}},{key:"operation",fn:function(a){a.text;var s=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(s)}}},[e._v(" 修改 ")]),"1"===s.status&&"F"!==s.type?t("a-divider",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["system:dept:add"],expression:"['system:dept:add']"}],attrs:{type:"vertical"}}):e._e(),"1"===s.status&&"F"!==s.type?t("a",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["system:dept:add"],expression:"['system:dept:add']"}],on:{click:function(t){return e.handleAdd(s)}}},[e._v(" 添加子菜单 ")]):e._e(),t("a-divider",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["system:dept:remove"],expression:"['system:dept:remove']"}],attrs:{type:"vertical"}}),t("a",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["system:dept:remove"],expression:"['system:dept:remove']"}],on:{click:function(t){return e.handleDelete(s)}}},[e._v(" 删除 ")])],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=[],n=(a("4de4"),a("d3b7"),a("d81d"),a("159b"),a("a6dc")),r=a("b419"),i=a("e1e4"),l=a("5d9e"),c=a("04b3"),d={name:"Menu",components:{AdvanceTable:l["a"],MenuEditForm:r["default"],MenuAddForm:i["default"],allIcon:c["a"]},data:function(){return{showAddModal:!1,showEditModal:!1,allIcon:c["a"],iconVisible:!1,list:[],selectedRowKeys:[],selectedRows:[],ids:[],menuOptions:[],expandedRowKeys:[],menuTypeOptions:[],loading:!1,statusOptions:[],visibleOptions:[],labelCol:{span:6},wrapperCol:{span:18},queryParam:{name:void 0,visible:void 0},columns:[{title:"菜单名称",dataIndex:"name",width:"20%",scopedSlots:{customRender:"name"}},{title:"菜单编码",dataIndex:"code",width:"150px",scopedSlots:{customRender:"code"}},{title:"排序",dataIndex:"sort",align:"center",width:"50px",scopedSlots:{customRender:"sort"}},{title:"菜单类型",dataIndex:"type",width:"80px",scopedSlots:{customRender:"type"},align:"center"},{title:"可见",dataIndex:"is_visible",width:"50px",scopedSlots:{customRender:"is_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})),this.getDicts("sys_show_hide").then((function(t){e.visibleOptions=t})),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&&!t.children&&(this.loading=!0,Object(n["f"])(this.queryParam,t.id,1).then((function(e){t.children=e.list,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(n["f"])(this.queryParam,"",1).then((function(t){e.expandTree(t.list,1,e.expandedRowKeys),e.list=t.list,e.loading=!1}))},visibleFormat:function(e){return this.selectDictLabel(this.visibleOptions,e.is_visible)},statusFormat:function(e){return this.selectDictLabel(this.statusOptions,e.status)},menuTypeFormat:function(e){return"M"===e.type?"目录":"C"===e.type?"菜单":"F"===e.type?"按钮":void 0},handleQuery:function(){var e=this;void 0===this.queryParam.name&&void 0===this.queryParam.status||""===this.queryParam.name&&""===this.queryParam.status?(this.expandedRowKeys=[],this.getList()):(this.loading=!0,Object(n["i"])(this.queryParam).then((function(t){e.expandedRowKeys=[],t&&0!==t.length?(e.getAllMenuNode(t),e.list=t):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 e.children&&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(n["i"])().then((function(t){e.menuOptions=[];var a={id:0,name:"主目录",children:[]};a.children=t,e.menuOptions.push(a)}))},handleDelete:function(e){var t=this,a=e.id||this.ids;this.$confirm({title:"确认删除所选中数据?",content:"当前选中的数据",onOk:function(){return Object(n["c"])(a).then((function(){null!==e&&0===e.pid?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"}})])}}},p=d,m=a("2877"),u=Object(m["a"])(p,s,o,!1,null,null,null);t["default"]=u.exports}}]);