You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 lines
8.7 KiB
1 lines
8.7 KiB
(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-fa8abecc"],{"1a86":function(e,t,a){"use strict";t.a={data:function(){return{isSearch:!1,total:null}},created:function(){},methods:{handleSizeChange:function(e){this.queryInfo.pageSize=e,this.initTable()},handleCurrentChange:function(e){this.queryInfo.pageNum=e,this.initTable()},searchClick:function(){this.isSearch=!this.isSearch}}}},7931:function(e,t,a){},"96ff":function(e,t,a){"use strict";a.r(t);a("99af"),a("b0c0"),a("cca6"),a("96cf");var r=a("1da1"),s=a("2909"),n=a("35cc"),o={mixins:[a("1a86").a],data:function(){return{type:0,queryForm:{},name2:"",dialogFormVisible:!1,treeDialog:!1,queryInfo:{pageSize:10,pageNo:1},editform:{},name:"",options:[],tableData:[],editArr:[],editFormRules:{name:[]},value:"",delArr:[],roleData:[],alreadyRoleList:[],defaultProps:{children:"menu",label:"name"},currentId:null,optionssta:[{value:0,status:"禁用"},{value:1,status:"启用"}]}},mounted:function(){this.initTable()},methods:{closeTreeDialog:function(){this.treeDialog=!1,this.currentId=null,this.$refs.tree.setCheckedKeys([])},getCheckedKeys:function(){var e=this,t=[].concat(Object(s.a)(this.$refs.tree.getCheckedKeys()),Object(s.a)(this.$refs.tree.getHalfCheckedKeys()));Object(n.r)({id:this.currentId,menus:t}).then((function(t){200==t.status?(e.$message.success(t.message),e.closeTreeDialog()):e.$message.error(t.message)})).catch((function(t){e.$message.error(t)}))},confrimAddRole:function(){var e=this;return Object(r.a)(regeneratorRuntime.mark((function t(){var a;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(""!=(a=Object.assign({},e.editform)).name){t.next=4;break}return e.$message.error("请填写角色名"),t.abrupt("return");case 4:if(""!==a.status){t.next=7;break}return e.$message.error("请选择角色的状态"),t.abrupt("return");case 7:if(0!=e.type){t.next=14;break}return t.next=10,Object(n.b)(a);case 10:200==t.sent.status?(e.$message.success("添加角色成功!"),e.initTable(),e.dialogFormVisible=!1):e.$message.error("添加角色失败"),t.next=18;break;case 14:return t.next=16,Object(n.h)(a);case 16:200==t.sent.status?(e.$message.success("修改角色成功!"),e.initTable(),e.dialogFormVisible=!1):e.$message.error("修改角色失败");case 18:case"end":return t.stop()}}),t)})))()},initTable:function(){var e=this;return Object(r.a)(regeneratorRuntime.mark((function t(){var a,r;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return a=Object.assign({},e.queryInfo),t.next=3,Object(n.o)(a);case 3:r=t.sent,e.tableData=r.result.data,e.total=r.result.pagination.total;case 6:case"end":return t.stop()}}),t)})))()},initMenuList:function(e){var t=this;Object(n.l)(e).then((function(e){t.treeDialog=!0,t.$nextTick((function(){t.roleData=e.result.menuTree,t.alreadyRoleList=e.result.idList,t.$refs.tree.setCheckedKeys(e.result.idList)}))}))},delData:function(e){var t=this;return Object(r.a)(regeneratorRuntime.mark((function a(){return regeneratorRuntime.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:return a.prev=0,a.next=3,Object(n.e)(e.id);case 3:if(200!=a.sent.status){a.next=9;break}t.$message.success("删除成功!"),t.initTable(),a.next=10;break;case 9:throw"删除失败";case 10:a.next=15;break;case 12:a.prev=12,a.t0=a.catch(0),t.$message.error("删除失败");case 15:case"end":return a.stop()}}),a,null,[[0,12]])})))()},cancleDialog:function(){this.editform={},this.dialogFormVisible=!1},handleSelectionChange:function(e){this.editArr=e,this.delArr=[]},editDialog:function(e){e.menus=[],this.type=1,this.dialogFormVisible=!0,this.editform=JSON.parse(JSON.stringify(e))},newDialog:function(){this.type=0,this.dialogFormVisible=!0,this.editform={}},resetUpdateRoleForm:function(){this.$refs.editFormRef.resetFields()},routerPush:function(e){this.currentId=e.id,this.initMenuList(e.id)}}},i=(a("fbb1"),a("2877")),l=Object(i.a)(o,(function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"takeDelivery p2"},[a("div",{staticClass:"location"},[a("div",{},[a("div",[a("FeesButton",{attrs:{text:"新增",icon:"el-icon-circle-plus-outline"},on:{buttonClick:e.newDialog}})],1)])]),a("div",{staticClass:"tableContent"},[a("el-table",{ref:"multipleTable",staticStyle:{width:"60%"},attrs:{data:e.tableData,"tooltip-effect":"dark",border:"",stripe:""}},[a("el-table-column",{attrs:{label:"操作",width:"120",align:"center"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("span",{staticClass:"text-color cursor",on:{click:function(a){return e.editDialog(t.row)}}},[e._v(" 编辑 ")]),a("span",{staticClass:"link-text-color m-left-1 cursor c-red",on:{click:function(a){return e.delData(t.row)}}},[e._v(" 删除 ")])]}}])}),a("el-table-column",{attrs:{label:"No.",type:"index"}}),a("el-table-column",{attrs:{label:"角色名"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(e._s(t.row.name))]}}])}),a("el-table-column",{attrs:{label:"角色类型"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(e._s(t.row.roleType))]}}])}),a("el-table-column",{attrs:{label:"首页配置"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(e._s(t.row.homePage))]}}])}),a("el-table-column",{attrs:{label:"状态"},scopedSlots:e._u([{key:"default",fn:function(t){return[0==t.row.status?a("span",[e._v(" 禁用 ")]):a("span",[e._v(" 启用 ")])]}}])}),a("el-table-column",{attrs:{label:"权限"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("span",{staticClass:"cursor",staticStyle:{"text-decoration":"underline"},on:{click:function(a){return e.routerPush(t.row)}}},[e._v("设置权限")])]}}])})],1)],1),a("div",{staticClass:"m-top-1"},[a("el-pagination",{attrs:{background:"","current-page":e.queryInfo.pageNo,"page-size":e.queryInfo.pageSize,"page-sizes":[10,20,30,50],layout:" prev, pager, next,total, sizes, jumper",total:e.total},on:{"size-change":e.handleSizeChange,"current-change":e.handleCurrentChange,"update:currentPage":function(t){return e.$set(e.queryInfo,"pageNo",t)},"update:current-page":function(t){return e.$set(e.queryInfo,"pageNo",t)}}})],1),a("el-dialog",{attrs:{title:"设置权限",visible:e.treeDialog},on:{"update:visible":function(t){e.treeDialog=t},close:e.closeTreeDialog}},[a("div",{staticClass:"d-flex m-top-2"},[a("span",{staticClass:"c-000",staticStyle:{width:"100px","text-align":"right","padding-right":"10px"}},[e._v("菜单列表")]),a("el-tree",{ref:"tree",attrs:{data:e.roleData,"show-checkbox":"","node-key":"id","default-expanded-keys":e.alreadyRoleList,"default-expand-all":!0,props:e.defaultProps},on:{getCheckedKeys:e.getCheckedKeys}})],1),a("div",{staticClass:"dialog-footer d-flex j-fe",attrs:{slot:"footer"},slot:"footer"},[a("FeesButton",{attrs:{text:"取 消",icon:"el-icon-circle-close"},on:{buttonClick:e.closeTreeDialog}}),a("FeesButton",{directives:[{name:"debounce",rawName:"v-debounce",value:{time:500,methods:e.getCheckedKeys},expression:"{ time: 500, methods: getCheckedKeys }"}],attrs:{text:"确 定",icon:"el-icon-circle-check",isActive:!0}})],1)]),a("el-dialog",{attrs:{title:0==e.type?"新增":"编辑",visible:e.dialogFormVisible},on:{"update:visible":function(t){e.dialogFormVisible=t},close:e.resetUpdateRoleForm}},[a("el-form",{ref:"editFormRef",attrs:{model:e.editform,"label-width":"100px",rules:e.editFormRules}},[a("el-form-item",{attrs:{label:"角色名",prop:"name"}},[a("el-input",{attrs:{autocomplete:"off"},model:{value:e.editform.name,callback:function(t){e.$set(e.editform,"name",t)},expression:"editform.name"}})],1),a("el-form-item",{attrs:{label:"角色类型",prop:"roleType"}},[a("el-input",{attrs:{autocomplete:"off"},model:{value:e.editform.roleType,callback:function(t){e.$set(e.editform,"roleType",t)},expression:"editform.roleType"}})],1),a("el-form-item",{attrs:{label:"首页配置",prop:"homePage"}},[a("el-input",{attrs:{autocomplete:"off"},model:{value:e.editform.homePage,callback:function(t){e.$set(e.editform,"homePage",t)},expression:"editform.homePage"}})],1),a("el-form-item",{staticClass:"m-top-2",attrs:{label:"状态",prop:"status"}},[a("el-select",{staticClass:"w100",attrs:{placeholder:"请选择"},model:{value:e.editform.status,callback:function(t){e.$set(e.editform,"status",t)},expression:"editform.status"}},e._l(e.optionssta,(function(e){return a("el-option",{key:e.value,attrs:{label:e.status,value:e.value}})})),1)],1)],1),a("div",{staticClass:"dialog-footer d-flex j-fe",attrs:{slot:"footer"},slot:"footer"},[a("FeesButton",{attrs:{text:"取 消",icon:"el-icon-circle-close"},on:{buttonClick:e.cancleDialog}}),a("FeesButton",{directives:[{name:"debounce",rawName:"v-debounce",value:{time:500,methods:e.confrimAddRole},expression:"{ time: 500, methods: confrimAddRole }"}],attrs:{text:"确 定",icon:"el-icon-circle-check",isActive:!0}})],1)],1)],1)}),[],!1,null,"331cb20f",null);t.default=l.exports},fbb1:function(e,t,a){"use strict";var r=a("7931");a.n(r).a}}]);
|