1 line
7.8 KiB
JavaScript
1 line
7.8 KiB
JavaScript
|
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-176ca70f"],{"6f40":function(e,t,n){},a30d:function(e,t,n){"use strict";var r=n("6f40"),i=n.n(r);i.a},d78e: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",{staticClass:"app-container"},[n("el-button",{attrs:{type:"primary"},on:{click:e.handleAddRole}},[e._v(" "+e._s(e.$t("permission.addRole"))+" ")]),n("el-table",{staticStyle:{width:"100%","margin-top":"30px"},attrs:{data:e.rolesList,border:""}},[n("el-table-column",{attrs:{align:"center",label:"Role Key",width:"220"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(" "+e._s(t.row.key)+" ")]}}])}),n("el-table-column",{attrs:{align:"center",label:"Role Name",width:"220"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(" "+e._s(t.row.name)+" ")]}}])}),n("el-table-column",{attrs:{align:"header-center",label:"Description"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(" "+e._s(t.row.description)+" ")]}}])}),n("el-table-column",{attrs:{align:"center",label:"Operations"},scopedSlots:e._u([{key:"default",fn:function(t){return[n("el-button",{attrs:{type:"primary",size:"small"},on:{click:function(n){return e.handleEdit(t)}}},[e._v(" "+e._s(e.$t("permission.editPermission"))+" ")]),n("el-button",{attrs:{type:"danger",size:"small"},on:{click:function(n){return e.handleDelete(t)}}},[e._v(" "+e._s(e.$t("permission.delete"))+" ")])]}}])})],1),n("el-dialog",{attrs:{visible:e.dialogVisible,title:"edit"===e.dialogType?"Edit Role":"New Role"},on:{"update:visible":function(t){e.dialogVisible=t}}},[n("el-form",{attrs:{model:e.role,"label-width":"80px","label-position":"left"}},[n("el-form-item",{attrs:{label:"Name"}},[n("el-input",{attrs:{placeholder:"Role Name"},model:{value:e.role.name,callback:function(t){e.$set(e.role,"name",t)},expression:"role.name"}})],1),n("el-form-item",{attrs:{label:"Desc"}},[n("el-input",{attrs:{autosize:{minRows:2,maxRows:4},type:"textarea",placeholder:"Role Description"},model:{value:e.role.description,callback:function(t){e.$set(e.role,"description",t)},expression:"role.description"}})],1),n("el-form-item",{attrs:{label:"Menus"}},[n("el-tree",{ref:"tree",staticClass:"permission-tree",attrs:{"check-strictly":e.checkStrictly,data:e.routesData,props:e.defaultProps,"show-checkbox":"","node-key":"path"}})],1)],1),n("div",{staticStyle:{"text-align":"right"}},[n("el-button",{attrs:{type:"danger"},on:{click:function(t){e.dialogVisible=!1}}},[e._v(" "+e._s(e.$t("permission.cancel"))+" ")]),n("el-button",{attrs:{type:"primary"},on:{click:e.confirmRole}},[e._v(" "+e._s(e.$t("permission.confirm"))+" ")])],1)],1)],1)},i=[],a=(n("a4d3"),n("e01a"),n("99af"),n("4de4"),n("4160"),n("caad"),n("d81d"),n("a434"),n("b0c0"),n("2532"),n("159b"),n("5530")),o=n("2909"),l=n("b85c"),s=(n("96cf"),n("1da1")),c=n("df7c"),u=n.n(c),d=n("ed08"),h=n("b775");function f(){return Object(h["a"])({url:"/vue-element-admin/routes",method:"get"})}function p(){return Object(h["a"])({url:"/vue-element-admin/roles",method:"get"})}function m(e){return Object(h["a"])({url:"/vue-element-admin/role",method:"post",data:e})}function g(e,t){return Object(h["a"])({url:"/vue-element-admin/role/".concat(e),method:"put",data:t})}function b(e){return Object(h["a"])({url:"/vue-element-admin/role/".concat(e),method:"delete"})}var v=n("9923"),y={key:"",name:"",description:"",routes:[]},k={data:function(){return{role:Object.assign({},y),routes:[],rolesList:[],dialogVisible:!1,dialogType:"new",checkStrictly:!1,defaultProps:{children:"children",label:"title"}}},computed:{routesData:function(){return this.routes}},created:function(){this.getRoutes(),this.getRoles()},methods:{getRoutes:function(){var e=this;return Object(s["a"])(regeneratorRuntime.mark((function t(){var n,r;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,f();case 2:n=t.sent,e.serviceRoutes=n.data,r=e.generateRoutes(n.data),e.routes=e.i18n(r);case 6:case"end":return t.stop()}}),t)})))()},getRoles:function(){var e=this;return Object(s["a"])(regen
|