(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d22d462"],{f794:function(e,t,n){"use strict";n.r(t);var r=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("cl-crud",{on:{load:e.onLoad},scopedSlots:e._u([{key:"table-column-icon",fn:function(e){var t=e.scope;return[n("icon-svg",{attrs:{name:t.row.icon,size:"20px"}})]}},{key:"table-column-perms",fn:function(t){var r=t.scope;return e._l(r.row.permList,(function(t,r){return n("el-tag",{key:r,staticStyle:{margin:"2px"},attrs:{size:"medium"}},[e._v(e._s(t))])}))}},{key:"table-column-router",fn:function(t){var r=t.scope;return[1==r.row.type?n("el-link",{attrs:{type:"primary",href:r.row.router}},[e._v(e._s(r.row.router))]):n("span",[e._v(e._s(r.row.router))])]}},{key:"table-column-keepAlive",fn:function(t){var r=t.scope;return[1==r.row.type?[r.row.keepAlive?n("i",{staticClass:"el-icon-check"}):n("i",{staticClass:"el-icon-close"})]:e._e()]}},{key:"slot-column-op",fn:function(t){var r=t.scope;return[2!=r.row.type?n("el-button",{attrs:{type:"text",size:"mini"},on:{click:function(t){return e.upsertAppend(r.row)}}},[e._v("新增")]):e._e()]}}])}),n("cl-context-menu",{ref:"context-menu"})],1)},o=[],p=(n("ea51"),n("104d"),n("57dd"),n("8bc2")),l={data:function(){return{crud:null}},methods:{onLoad:function(e){var t=this,n=e.ctx,r=e.app;this.crud=r,n.service(this.$service.system.menu).set("dict",{api:{page:"list"}}).set("table",{columns:[{prop:"name",label:"名称",width:200},{prop:"icon",label:"图标",align:"center",width:80},{prop:"type",label:"类型",align:"center",width:100,dict:[{label:"目录",value:0},{label:"菜单",value:1},{label:"权限",value:2}]},{prop:"router",label:"节点路由",align:"center","min-width":160},{prop:"keepAlive",label:"路由缓存",align:"center",width:100},{prop:"viewPath",label:"文件路径",align:"center","min-width":200,"show-overflow-tooltip":!0},{prop:"perms",label:"权限","header-align":"center","min-width":300},{prop:"orderNum",label:"排序号",align:"center",width:100},{prop:"updateTime",label:"更新时间",align:"center",sortable:!0,width:180}],props:{"row-key":"id"},on:{"row-click":function(e,t){t.property&&e.children&&r.refs("table").toggleRowExpansion(e)},"row-contextmenu":function(e,n,o){var p=[{label:"编辑",callback:function(t,n){r.edit(e),n()}},{label:"删除",callback:function(t,n){r.delete(e),n()}}];2!=e.type&&p.unshift({label:"新增",callback:function(n,r){t.upsertAppend(e),r()}}),1==e.type&&p.push({label:"权限",callback:function(n,r){t.setPermission(e),r()}}),t.$refs["context-menu"].open(o,{list:p}),o.preventDefault()}},op:{props:{width:"200"},layout:["slot-column-op","edit","delete"]}}).set("upsert",{props:{width:"600px"},items:[{prop:"type",value:0,label:"节点类型",span:24,component:{name:"el-radio-group",options:[{label:"目录",value:0},{label:"菜单",value:1},{label:"权限",value:2}],on:{change:function(e){t.changeType(e)}}}},{prop:"name",label:"节点名称",span:24,component:{name:"el-input",attrs:{placeholder:"请输入节点名称"}},rules:{required:!0,message:"名称不能为空"}},{prop:"parentId",label:"上级节点",span:24,component:{name:"cl-menu-tree"}},{prop:"router",label:"节点路由",span:24,hidden:!0,component:{name:"el-input",attrs:{placeholder:"请输入节点路由"}}},{prop:"keepAlive",value:!0,label:"路由缓存",span:24,component:{name:"el-radio-group",options:[{label:"开启",value:!0},{label:"关闭",value:!1}]}},{prop:"viewPath",label:"文件路径",span:24,hidden:!0,component:{name:"cl-menu-file-path"}},{prop:"icon",label:"节点图标",span:24,component:{name:"cl-menu-icons"}},{prop:"orderNum",label:"排序号",span:24,component:{name:"el-input-number",props:{placeholder:"请填写排序号",min:0,max:99,"controls-position":"right"}}},{prop:"perms",label:"权限",span:24,hidden:!0,component:{name:"cl-menu-perms"}}]}).set("layout",[["refresh-btn","add-btn"],["data-table"]]).on("refresh",(function(e,n){var r=n.render;t.$service.system.menu.list().then((function(e){e.map((function(e){e.permList=e.perms?e.perms.split(","):[]})),r(Object(p["deepTree"])(e)),t.$store.dispatch("permMenu")}))})).on("open",(function(e,n){t.changeType(n?n.type:0)})).done(),r.refresh()},changeType:function(e){this.crud.setData("upsert.items[prop:router].hidden",1!=e),this.crud.setData("upsert.items[prop:icon].hidden",2==e),this.crud.setData("upsert.items[prop:viewPath].hidden",1!=e),this.crud.setData("upsert.items[prop:keepAlive].hidden",1!=e),this.crud.setData("upsert.items[prop:perms].hidden",2!=e)},upsertAppend:function(e){var t=e.type,n=e.id;this.crud.append({parentId:n,type:t+1})},setPermission:function(e){var t=e.id;this.crud.append({parentId:t,type:2})},toUrl:function(e){this.$router.push(e)}}},a=l,i=n("5511"),s=Object(i["a"])(a,r,o,!1,null,null,null);t["default"]=s.exports}}]);