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
34 KiB

(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-287daaa6"],{"09f4":function(e,t,i){"use strict";i.d(t,"a",(function(){return o})),Math.easeInOutQuad=function(e,t,i,s){return e/=s/2,e<1?i/2*e*e+t:(e--,-i/2*(e*(e-2)-1)+t)};var s=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(e){window.setTimeout(e,1e3/60)}}();function r(e){document.documentElement.scrollTop=e,document.body.parentNode.scrollTop=e,document.body.scrollTop=e}function a(){return document.documentElement.scrollTop||document.body.parentNode.scrollTop||document.body.scrollTop}function o(e,t,i){var o=a(),n=e-o,l=20,c=0;t="undefined"===typeof t?500:t;var u=function e(){c+=l;var a=Math.easeInOutQuad(c,o,n,t);r(a),c<t?s(e):i&&"function"===typeof i&&i()};u()}},"1f9a":function(e,t,i){"use strict";i.r(t);var s=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"app-container"},[i("div",{staticClass:"filter-container"},[i("el-input",{staticClass:"filter-item search-item",attrs:{placeholder:e.$t("table.role.code")},model:{value:e.queryParams.model.code,callback:function(t){e.$set(e.queryParams.model,"code",t)},expression:"queryParams.model.code"}}),i("el-input",{staticClass:"filter-item search-item",attrs:{placeholder:e.$t("table.role.name")},model:{value:e.queryParams.model.name,callback:function(t){e.$set(e.queryParams.model,"name",t)},expression:"queryParams.model.name"}}),i("el-date-picker",{staticClass:"filter-item search-item date-range-item",attrs:{"range-separator":null,"end-placeholder":"结束日期",format:"yyyy-MM-dd HH:mm:ss","start-placeholder":"开始日期",type:"daterange","value-format":"yyyy-MM-dd HH:mm:ss"},model:{value:e.queryParams.timeRange,callback:function(t){e.$set(e.queryParams,"timeRange",t)},expression:"queryParams.timeRange"}}),i("el-button",{staticClass:"filter-item",attrs:{plain:"",type:"primary"},on:{click:e.search}},[e._v(" "+e._s(e.$t("table.search"))+" ")]),i("el-button",{staticClass:"filter-item",attrs:{plain:"",type:"warning"},on:{click:e.reset}},[e._v(" "+e._s(e.$t("table.reset"))+" ")]),i("el-button",{directives:[{name:"has-permission",rawName:"v-has-permission",value:["user:add"],expression:"['user:add']"}],staticClass:"filter-item",attrs:{plain:"",type:"danger"},on:{click:e.add}},[e._v(" "+e._s(e.$t("table.add"))+" ")]),i("el-dropdown",{directives:[{name:"has-any-permission",rawName:"v-has-any-permission",value:["role:delete","role:export","role:import"],expression:"[ 'role:delete', 'role:export', 'role:import']"}],staticClass:"filter-item",attrs:{trigger:"click"}},[i("el-button",[e._v(" "+e._s(e.$t("table.more"))+" "),i("i",{staticClass:"el-icon-arrow-down el-icon--right"})]),i("el-dropdown-menu",{attrs:{slot:"dropdown"},slot:"dropdown"},[i("el-dropdown-item",{directives:[{name:"has-permission",rawName:"v-has-permission",value:["role:delete"],expression:"['role:delete']"}],nativeOn:{click:function(t){return e.batchDelete(t)}}},[e._v(" "+e._s(e.$t("table.delete"))+" ")]),i("el-dropdown-item",{directives:[{name:"has-permission",rawName:"v-has-permission",value:["role:export"],expression:"['role:export']"}],nativeOn:{click:function(t){return e.exportExcel(t)}}},[e._v(" "+e._s(e.$t("table.export"))+" ")]),i("el-dropdown-item",{directives:[{name:"has-permission",rawName:"v-has-permission",value:["role:export"],expression:"['role:export']"}],nativeOn:{click:function(t){return e.exportExcelPreview(t)}}},[e._v(" "+e._s(e.$t("table.exportPreview"))+" ")]),i("el-dropdown-item",{directives:[{name:"has-permission",rawName:"v-has-permission",value:["role:import"],expression:"['role:import']"}],nativeOn:{click:function(t){return e.importExcel(t)}}},[e._v(" "+e._s(e.$t("table.import"))+" ")])],1)],1)],1),i("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],key:e.tableKey,ref:"table",staticStyle:{width:"100%"},attrs:{data:e.tableData.records,border:"",fit:"","row-key":"id"},on:{"filter-change":e.filterChange,"selection-change":e.onSelectChange,"sort-change":e.sortChange,"cell-click":e.cellClick}},[i("el-table-column",{attrs:{align:"center",type:"selection",width:"40px","reserve-selection":!0}}),i("el-table-column",{attrs:{label:e.$t("table.role.code"),align:"center",prop:"code",width:"200px"},scopedSlots:e._u([{key:"default",fn:function(t){return[i("span",[e._v(e._s(t.row.code))])]}}])}),i("el-table-column",{attrs:{label:e.$t("table.role.name"),"show-overflow-tooltip":!0,align:"center",prop:"name"},scopedSlots:e._u([{key:"default",fn:function(t){return[i("span",[e._v(e._s(t.row.name))])]}}])}),i("el-table-column",{attrs:{label:e.$t("table.role.describe"),"show-overflow-tooltip":!0,align:"center",prop:"describe"},scopedSlots:e._u([{key:"default",fn:function(t){return[i("span",[e._v(e._s(t.row.describe))])]}}])}),i("el-table-column",{attrs:{"filter-multiple":!1,filters:e.dsTypeList,"column-key":"dsType.code",label:e.$t("table.role.dsType"),align:"center",width:"100px"},scopedSlots:e._u([{key:"default",fn:function(t){return[i("span",[e._v(e._s(t.row.dsType?t.row.dsType.desc:""))])]}}])}),i("el-table-column",{attrs:{"filter-multiple":!1,"column-key":"readonly",filters:[{text:e.$t("common.yes"),value:!0},{text:e.$t("common.no"),value:!1}],label:e.$t("table.role.readonly"),align:"center",width:"80px"},scopedSlots:e._u([{key:"default",fn:function(t){return[i("span",[e._v(e._s(t.row.readonly?e.$t("common.yes"):e.$t("common.no")))])]}}])}),i("el-table-column",{attrs:{"filter-multiple":!1,"column-key":"status",filters:[{text:e.$t("common.status.valid"),value:!0},{text:e.$t("common.status.invalid"),value:!1}],label:e.$t("table.role.status"),"class-name":"status-col",width:"70px"},scopedSlots:e._u([{key:"default",fn:function(t){var s=t.row;return[i("el-tag",{attrs:{type:e._f("statusFilter")(s.status)}},[e._v(e._s(s.status?e.$t("common.status.valid"):e.$t("common.status.invalid"))+" ")])]}}])}),i("el-table-column",{attrs:{label:e.$t("table.createTime"),align:"center",prop:"createTime",sortable:"custom",width:"170px"},scopedSlots:e._u([{key:"default",fn:function(t){return[i("span",[e._v(e._s(t.row.createTime))])]}}])}),i("el-table-column",{attrs:{label:e.$t("table.operation"),align:"center","column-key":"operation","class-name":"small-padding fixed-width",width:"140px"},scopedSlots:e._u([{key:"default",fn:function(t){var s=t.row;return[i("i",{directives:[{name:"hasPermission",rawName:"v-hasPermission",value:["role:update"],expression:"['role:update']"}],staticClass:"el-icon-edit table-operation",staticStyle:{color:"#2db7f5"},attrs:{title:"修改"},on:{click:function(t){return e.edit(s)}}}),i("i",{directives:[{name:"hasPermission",rawName:"v-hasPermission",value:["role:delete"],expression:"['role:delete']"}],staticClass:"el-icon-delete table-operation",staticStyle:{color:"#f50"},attrs:{title:"删除"},on:{click:function(t){return e.singleDelete(s)}}}),i("i",{directives:[{name:"hasPermission",rawName:"v-hasPermission",value:["role:auth"],expression:"['role:auth']"}],staticClass:"el-icon-user table-operation",staticStyle:{color:"#87d068"},attrs:{title:"授权用户"},on:{click:function(t){return e.authUser(s)}}}),i("i",{directives:[{name:"hasPermission",rawName:"v-hasPermission",value:["role:config"],expression:"['role:config']"}],staticClass:"el-icon-setting table-operation",staticStyle:{color:"#E6A23C"},attrs:{title:"分配权限"},on:{click:function(t){return e.authResource(s)}}}),i("el-link",{directives:[{name:"has-no-permission",rawName:"v-has-no-permission",value:["role:update","role:delete","role:auth","role:config"],expression:"[\n 'role:update',\n 'role:delete',\n 'role:auth',\n 'role:config'\n ]"}],staticClass:"no-perm"},[e._v(e._s(e.$t("tips.noPermission"))+" ")])]}}])})],1),i("pagination",{directives:[{name:"show",rawName:"v-show",value:e.tableData.total>0,expression:"tableData.total > 0"}],attrs:{limit:e.queryParams.size,page:e.queryParams.current,total:Number(e.tableData.total)},on:{"update:limit":function(t){return e.$set(e.queryParams,"size",t)},"update:page":function(t){return e.$set(e.queryParams,"current",t)},pagination:e.fetch}}),i("role-edit",{ref:"edit",attrs:{"dialog-visible":e.dialog.isVisible,type:e.dialog.type},on:{close:e.editClose,success:e.editSuccess}}),i("user-role",{ref:"userRole",attrs:{"dialog-visible":e.userRoleDialog.isVisible},on:{close:e.userRoleClose,success:e.userRoleSuccess}}),i("role-authority",{ref:"roleAuthority",attrs:{"dialog-visible":e.roleAuthorityDialog.isVisible},on:{close:e.roleAuthorityClose,success:e.roleAuthoritySuccess}}),i("file-import",{ref:"import",attrs:{"dialog-visible":e.fileImport.isVisible,type:e.fileImport.type,action:e.fileImport.action,accept:".xls,.xlsx"},on:{close:e.importClose,success:e.importSuccess}}),i("el-dialog",{directives:[{name:"el-drag-dialog",rawName:"v-el-drag-dialog"}],attrs:{"close-on-click-modal":!1,"close-on-press-escape":!0,title:"预览",width:"80%",top:"50px",visible:e.preview.isVisible},on:{"update:visible":function(t){return e.$set(e.preview,"isVisible",t)}}},[i("el-scrollbar",[i("div",{domProps:{innerHTML:e._s(e.preview.context)}})])],1)],1)},r=[],a=(i("4160"),i("caad"),i("d81d"),i("d3b7"),i("ac1f"),i("2532"),i("841c"),i("1276"),i("159b"),i("5530")),o=i("333d"),n=i("a888"),l=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("el-dialog",{attrs:{"close-on-click-modal":!1,title:e.title,type:e.type,visible:e.isVisible,width:e.width,top:"50px"},on:{"update:visible":function(t){e.isVisible=t}}},[i("el-form",{ref:"form",attrs:{model:e.role,rules:e.rules,"label-position":"right","label-width":"100px"}},[i("el-form-item",{attrs:{label:e.$t("table.role.code"),prop:"code"}},[i("el-input",{attrs:{disabled:"edit"===e.type},model:{value:e.role.code,callback:function(t){e.$set(e.role,"code",t)},expression:"role.code"}})],1),i("el-form-item",{attrs:{label:e.$t("table.role.name"),prop:"name"}},[i("el-input",{model:{value:e.role.name,callback:function(t){e.$set(e.role,"name",t)},expression:"role.name"}})],1),i("el-form-item",{attrs:{label:e.$t("table.role.status"),prop:"status"}},[i("el-radio-group",{model:{value:e.role.status,callback:function(t){e.$set(e.role,"status",t)},expression:"role.status"}},[i("el-radio-button",{attrs:{label:!0}},[e._v(e._s(e.$t("common.status.valid")))]),i("el-radio-button",{attrs:{label:!1}},[e._v(e._s(e.$t("common.status.invalid")))])],1)],1),i("el-form-item",{attrs:{label:e.$t("table.role.describe"),prop:"describe"}},[i("el-input",{model:{value:e.role.describe,callback:function(t){e.$set(e.role,"describe",t)},expression:"role.describe"}})],1),i("el-form-item",{attrs:{label:e.$t("table.role.dsType"),prop:"dsType"}},[i("el-radio-group",{on:{change:e.dsTypeChange},model:{value:e.role.dsType.code,callback:function(t){e.$set(e.role.dsType,"code",t)},expression:"role.dsType.code"}},e._l(e.enums.DataScopeType,(function(t,s,r){return i("el-radio-button",{key:r,attrs:{label:s,value:s}},[e._v(" "+e._s(t)+" ")])})),1)],1),i("el-form-item",{attrs:{hidden:e.orgHidden,label:e.$t("table.role.orgList"),prop:"orgList"}},[i("el-tree",{ref:"orgTree",attrs:{"check-strictly":!0,data:e.orgList,"default-checked-keys":e.role.orgList,"default-expanded-keys":e.role.orgList,"expand-on-click-node":!1,"highlight-current":"","node-key":"id","show-checkbox":""}})],1)],1),i("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[i("el-button",{attrs:{plain:"",type:"warning"},on:{click:function(t){e.isVisible=!1}}},[e._v(e._s(e.$t("common.cancel")))]),i("el-button",{attrs:{plain:"",type:"primary"},on:{click:e.submitForm}},[e._v(e._s(e.$t("common.confirm")))])],1)],1)},c=[],u=(i("498a"),i("61d9")),d=i("c38b"),m={name:"RoleEdit",components:{},props:{dialogVisible:{type:Boolean,default:!1},type:{type:String,default:"add"}},data:function(){var e=this;return{role:this.initRole(),screenWidth:0,width:this.initWidth(),orgList:[],orgHidden:!0,enums:{DataScopeType:{}},rules:{name:[{required:!0,message:this.$t("rules.require"),trigger:"blur"},{min:1,max:255,message:this.$t("rules.range4to10"),trigger:"blur"},{validator:function(t,i,s){"add"===!e.type&&i.trim().length>0?u["a"].check(i).then((function(e){var t=e.data;t.data?s("编码重复"):s()})):s(),s()},trigger:"blur"}],status:{required:!0,message:this.$t("rules.require"),trigger:"blur"},orgList:{validator:function(t,i,s){"CUSTOMIZE"===e.role.dsType.code?e.$refs.orgTree.getCheckedKeys().length>0?s():s("请至少选择一个单位或部门"):s()}}}}},computed:{isVisible:{get:function(){return this.dialogVisible},set:function(){this.close(),this.reset()}},title:function(){return"add"===this.type?this.$t("common.add"):this.$t("common.edit")}},watch:{},mounted:function(){var e=this;this.initOrg(),window.onresize=function(){return function(){e.width=e.initWidth()}()}},methods:{initRole:function(){return{id:"",code:"",name:"",orgList:[],status:!0,describe:"",dsType:{code:"SELF",desc:""}}},initWidth:function(){return this.screenWidth=document.body.clientWidth,this.screenWidth<991?"90%":this.screenWidth<1400?"45%":"800px"},initOrg:function(){var e=this;d["a"].allTree({status:!0}).then((function(t){var i=t.data;e.orgList=i.data}))},loadListOptions:function(e){var t=e.callback;t()},setRole:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=this;t["enums"]&&(i.enums=t["enums"]),t["row"]&&(i.role=Object(a["a"])({},t["row"]),this.orgHidden="CUSTOMIZE"!==i.role.dsType.code,this.orgHidden||u["a"].getDetails(i.role.id).then((function(t){var i=t.data;i.isSuccess&&(e.role.orgList=i.data.orgList,e.$refs.orgTree.setCheckedKeys(i.data.orgList))})))},close:function(){this.$emit("close")},reset:function(){this.$refs.form.clearValidate(),this.$refs.form.resetFields(),this.role=this.initRole(),this.orgHidden=!0,this.$refs.orgTree.setCheckedKeys([])},submitForm:function(){var e=this;this.$refs.form.validate((function(t){if(!t)return!1;e.editSubmit()}))},editSubmit:function(){var e=this;this.orgHidden&&this.role.orgList?this.role.orgList.length=0:this.role.orgList=this.$refs.orgTree.getCheckedKeys(),"add"===e.type?e.save():e.update()},save:function(){var e=this;u["a"].save(this.role).then((function(t){var i=t.data;i.isSuccess&&(e.isVisible=!1,e.$message({message:e.$t("tips.createSuccess"),type:"success"}),e.$emit("success"))}))},update:function(){var e=this;u["a"].update(this.role).then((function(t){var i=t.data;i.isSuccess&&(e.isVisible=!1,e.$message({message:e.$t("tips.updateSuccess"),type:"success"}),e.$emit("success"))}))},dsTypeChange:function(e){this.orgHidden="CUSTOMIZE"!==e}}},h=m,f=i("2877"),p=Object(f["a"])(h,l,c,!1,null,"2e9ba526",null),b=p.exports,v=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("el-dialog",{attrs:{"close-on-click-modal":!1,title:e.title,visible:e.isVisible,width:e.width,top:"50px"},on:{"update:visible":function(t){e.isVisible=t}}},[i("el-form",{ref:"form",attrs:{model:e.userRole,rules:e.rules,"label-position":"right","label-width":"100px"}},[i("el-form-item",{attrs:{label:"用户",prop:"userIdList"}},[i("el-transfer",{staticStyle:{"text-align":"left",display:"inline-block"},attrs:{data:e.userList,"filter-method":e.filterMethod,props:{key:"id",label:"name"},"render-content":e.renderFunc,"right-default-checked":e.userRole.userIdList,titles:["全部用户","已选用户"],"filter-placeholder":"用户名",filterable:""},model:{value:e.userRole.userIdList,callback:function(t){e.$set(e.userRole,"userIdList",t)},expression:"userRole.userIdList"}})],1)],1),i("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[i("el-button",{attrs:{plain:"",type:"warning"},on:{click:function(t){e.isVisible=!1}}},[e._v(e._s(e.$t("common.cancel")))]),i("el-button",{attrs:{disabled:e.disabled,plain:"",type:"primary"},on:{click:e.submitForm}},[e._v(e._s(e.$t("common.confirm")))])],1)],1)},g=[],y=(i("c975"),i("b0c0"),i("9fb8")),O={name:"UserRoleEdit",components:{},props:{dialogVisible:{type:Boolean,default:!1}},data:function(){return{userRole:this.initUserRole(),screenWidth:0,width:this.initWidth(),userList:[],userIdList:[],disabled:!1,rules:{},renderFunc:function(e,t){return e("span",{attrs:{title:t.account+" - "+t.name}},[t.account," - ",t.name])}}},computed:{isVisible:{get:function(){return this.dialogVisible},set:function(){this.close(),this.reset()}},title:function(){return"分配角色成员"}},watch:{},mounted:function(){var e=this;this.initUserList(),window.onresize=function(){return function(){e.width=e.initWidth()}()}},methods:{initUserRole:function(){return{roleId:"",userIdList:[]}},initWidth:function(){return this.screenWidth=document.body.clientWidth,this.screenWidth<991?"90%":this.screenWidth<1400?"45%":"800px"},initUserList:function(){var e=this;y["a"].page({current:1,size:1e5,model:{status:!0}}).then((function(t){var i=t.data;e.userList=i.data.records})).catch((function(){e.$message({message:e.$t("tips.getDataFail"),type:"error"})}))},setUserRole:function(e){var t=this;t.userRole.roleId=e.id,u["a"].findUserIdByRoleId(e.id).then((function(e){var i=e.data;t.userRole.userIdList=i.data}))},close:function(){this.$emit("close")},reset:function(){this.$refs.form.clearValidate(),this.$refs.form.resetFields(),this.userRole=this.initUserRole(),this.disabled=!1},submitForm:function(){var e=this;this.$refs.form.validate((function(t){if(!t)return!1;e.editSubmit()}))},editSubmit:function(){var e=this;console.log(this.userRole),u["a"].saveUserRole(this.userRole).then((function(t){var i=t.data;i.isSuccess&&(e.isVisible=!1,e.$message({message:e.$t("tips.createSuccess"),type:"success"}),e.$emit("success"))}))},filterMethod:function(e,t){return t.name.indexOf(e)>-1||t.account.indexOf(e)>-1}}},w=O,$=Object(f["a"])(w,v,g,!1,null,"78e0e180",null),k=$.exports,T=i("6188"),j=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("el-dialog",{attrs:{"close-on-click-modal":!1,title:e.title,visible:e.isVisible,width:e.width,top:"50px"},on:{"update:visible":function(t){e.isVisible=t}}},[i("el-form",{ref:"form",attrs:{model:e.roleAuthority,rules:e.rules,"label-position":"top","label-width":"100px"}},[i("el-scrollbar",{staticStyle:{height:"800px"}},[i("el-row",{attrs:{gutter:12}},[i("el-col",{attrs:{span:8}},[i("el-card",{staticClass:"box-card"},[i("el-form-item",{attrs:{label:"菜单",prop:"menuIdList"}},[i("div",{staticStyle:{"margin-left":"24px"},attrs:{align:"left"}},[i("el-checkbox",{attrs:{indeterminate:e.isIndeterminate},on:{change:e.checkedAll},model:{value:e.checkedMenu,callback:function(t){e.checkedMenu=t},expression:"checkedMenu"}}),e._v(" 全选/反选 ")],1),i("el-tree",{ref:"menuTree",attrs:{"check-strictly":!0,data:e.menuTree,"default-checked-keys":e.roleAuthority.menuIdList,"default-expanded-keys":e.roleAuthority.menuIdList,disabled:e.disabled,"expand-on-click-node":!1,"default-expand-all":"","highlight-current":"","node-key":"id","show-checkbox":""},on:{check:e.checkMenu,"node-click":e.nodeClick}})],1)],1)],1),i("el-col",{attrs:{span:16}},[i("el-card",{staticClass:"box-card"},[i("el-form-item",{attrs:{label:"资源",prop:"resourceIdList"}},[i("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],key:e.tableKey,ref:"table",staticStyle:{width:"100%"},attrs:{data:e.tableData.records,border:"",fit:"","row-key":"id"},on:{select:e.onSelect,"select-all":e.onAllSelect}},[i("el-table-column",{attrs:{"reserve-selection":!0,align:"center",type:"selection",width:"40px"}}),i("el-table-column",{attrs:{label:e.$t("table.resource.code"),"show-overflow-tooltip":!0,align:"center",prop:"code"},scopedSlots:e._u([{key:"default",fn:function(t){return[i("span",[e._v(e._s(t.row.code))])]}}])}),i("el-table-column",{attrs:{label:e.$t("table.resource.name"),"show-overflow-tooltip":!0,align:"center",prop:"name"},scopedSlots:e._u([{key:"default",fn:function(t){return[i("span",[e._v(e._s(t.row.name))])]}}])})],1)],1)],1)],1)],1)],1)],1),i("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[i("el-button",{attrs:{plain:"",type:"warning"},on:{click:function(t){e.isVisible=!1}}},[e._v(e._s(e.$t("common.cancel"))+" ")]),i("el-button",{attrs:{disabled:e.disabled,plain:"",type:"primary"},on:{click:e.submitForm}},[e._v(e._s(e.$t("common.confirm"))+" ")])],1)],1)},x=[],S=(i("99af"),i("c740"),i("a630"),i("a434"),i("6062b"),i("3ca3"),i("ddb0"),i("2909")),P=i("81ee"),_=i("20db"),R={name:"RoleAuthorityEdit",components:{},props:{dialogVisible:{type:Boolean,default:!1}},data:function(){return{roleAuthority:this.initRoleAuthority(),screenWidth:0,width:this.initWidth(),menuTree:[],resourceList:[],echoResourceIdList:[],rules:{},tableKey:0,loading:!1,tableData:{total:0},selection:[],disabled:!1,isIndeterminate:!1,checkedMenu:!1}},computed:{isVisible:{get:function(){return this.dialogVisible},set:function(){this.close(),this.reset()}},title:function(){return"配置菜单资源"}},watch:{},mounted:function(){var e=this;this.initMenuTree(),window.onresize=function(){return function(){e.width=e.initWidth()}()}},methods:{allMenuIdList:function(){var e=[];return this.getMenuIdList(this.menuTree,e),e},getMenuIdList:function(e,t){var i=this;e&&e.forEach((function(e){t.push(e.id),e.children&&e.children.length>0&&i.getMenuIdList(e.children,t)}))},checkedAll:function(){this.checkedMenu?(this.$refs.menuTree.setCheckedKeys(this.allMenuIdList()),this.isIndeterminate=!1):(this.$refs.menuTree.setCheckedKeys([]),this.isIndeterminate=!1)},nodeClick:function(e){var t=this;t.loading=!0,_["a"].page({current:1,size:1e4,model:{menuId:e.id}}).then((function(e){var i=e.data;t.tableData=i.data,t.loading=!1,t.displayTable()}))},displayTable:function(){var e=this;e.tableData.records.forEach((function(t){e.roleAuthority.resourceIdList.forEach((function(i){t.id===i&&e.$refs.table.toggleRowSelection(t,!0)}))}))},onAllSelect:function(e){this.onSelect(e)},onSelect:function(e,t){var i=this;this.mergeResourceIdList(e,t),this.selection=e;var s=this.$refs.menuTree.getCheckedKeys(),r=e.map((function(e){return e.menuId})),a=Array.from(new Set([].concat(Object(S["a"])(s),Object(S["a"])(r))));this.$refs.menuTree.setCheckedKeys(a),a.forEach((function(e){i.selectedParent(e)}))},mergeResourceIdList:function(e,t){var i=!0;i=t?e.length&&-1!==e.indexOf(t):e.length>0;var s=e.map((function(e){return e.id})),r=this.echoResourceIdList;if(!i&&t){var a=r.findIndex((function(e){if(e==t.id)return!0}));r.splice(a,1)}this.roleAuthority.resourceIdList=Object(S["a"])(new Set([].concat(Object(S["a"])(s),Object(S["a"])(r))))},initMenuTree:function(){var e=this;P["a"].allTree().then((function(t){var i=t.data;e.menuTree=i.data}))},initRoleAuthority:function(){return{roleId:"",menuIdList:[],resourceIdList:[]}},initWidth:function(){return this.screenWidth=document.body.clientWidth,this.screenWidth<991?"90%":this.screenWidth<1400?"45%":"1000px"},setRoleAuthority:function(e){var t=this;t.roleAuthority.roleId=e.id,u["a"].findAuthorityIdByRoleId(e.id).then((function(e){var i=e.data;t.roleAuthority.menuIdList=i.data.menuIdList,t.roleAuthority.resourceIdList=i.data.resourceIdList,t.echoResourceIdList=i.data.resourceIdList,t.$refs.menuTree.setCheckedKeys(i.data.menuIdList),i.data.menuIdList.forEach((function(e){t.selectedParent(e)}))}))},close:function(){this.$emit("close")},reset:function(){this.$refs.form.clearValidate(),this.$refs.form.resetFields(),this.roleAuthority=this.initRoleAuthority(),this.$refs.menuTree.setCheckedKeys([]),this.$refs.table.clearSelection()},submitForm:function(){var e=this;this.$refs.form.validate((function(t){if(!t)return!1;e.editSubmit()}))},editSubmit:function(){var e=this;this.roleAuthority.menuIdList=e.$refs.menuTree.getHalfCheckedKeys().concat(e.$refs.menuTree.getCheckedKeys()),u["a"].saveRoleAuthority(this.roleAuthority).then((function(t){var i=t.data;i.isSuccess&&(e.isVisible=!1,e.$message({message:e.$t("tips.createSuccess"),type:"success"}),e.$emit("success"))}))},checkMenu:function(e,t){0===t.checkedKeys.length?(this.checkedMenu=!1,this.isIndeterminate=!1):t.checkedKeys.length===this.allMenuIdList().length?(this.checkedMenu=!0,this.isIndeterminate=!1):(this.checkedMenu=!1,this.isIndeterminate=!0);var i=t.checkedKeys.indexOf(e.id);-1!==i?(this.selectedParent(e),this.uniteChildSame(e,!0)):e.children&&0!==e.children.length&&this.uniteChildSame(e,!1)},uniteChildSame:function(e,t){if(this.$refs.menuTree.setChecked(e.id,t),e.children)for(var i=0;i<e.children.length;i++)this.uniteChildSame(e.children[i],t)},selectedParent:function(e){var t=this.$refs.menuTree.getNode(e);void 0!==t.parent.key&&(this.$refs.menuTree.setChecked(t.parent,!0),this.selectedParent(t.parent))}}},I=R,L=Object(f["a"])(I,j,x,!1,null,"19b4a4e1",null),C=L.exports,q=i("fa7d"),E=i("1771"),V={name:"RoleManage",directives:{elDragDialog:n["a"]},components:{Pagination:o["a"],RoleEdit:b,UserRole:k,RoleAuthority:C,FileImport:T["a"]},filters:{statusFilter:function(e){var t={false:"danger",true:"success"};return t[e]||"success"}},data:function(){return{dialog:{isVisible:!1,type:"add"},preview:{isVisible:!1,context:""},fileImport:{isVisible:!1,type:"import",action:"".concat("https://pos.admin.api.lotus-wallet.com","/role/import")},userRoleDialog:{isVisible:!1},roleAuthorityDialog:{isVisible:!1},tableKey:0,queryParams:Object(E["e"])({model:{dsType:{code:null}}}),selection:[],loading:!1,tableData:{total:0},enums:{DataScopeType:{}},dicts:{}}},computed:{dsTypeList:function(){return Object(q["a"])(this.enums.DataScopeType)}},mounted:function(){Object(E["c"])("DataScopeType",this.enums),this.fetch()},methods:{editClose:function(){this.dialog.isVisible=!1},userRoleClose:function(){this.userRoleDialog.isVisible=!1},roleAuthorityClose:function(){this.roleAuthorityDialog.isVisible=!1},editSuccess:function(){this.search()},userRoleSuccess:function(){this.search()},roleAuthoritySuccess:function(){this.search()},onSelectChange:function(e){this.selection=e},search:function(){this.fetch(Object(a["a"])({},this.queryParams))},reset:function(){this.queryParams=Object(E["e"])({model:{dsType:{code:null}}}),this.$refs.table.clearSort(),this.$refs.table.clearFilter(),this.search()},exportExcelPreview:function(){var e=this;this.queryParams.timeRange&&(this.queryParams.map.createTime_st=this.queryParams.timeRange[0],this.queryParams.map.createTime_ed=this.queryParams.timeRange[1]),this.queryParams.map.fileName="导出角色数据",u["a"].preview(this.queryParams).then((function(t){var i=t.data;e.preview.isVisible=!0,e.preview.context=i.data}))},exportExcel:function(){this.queryParams.timeRange&&(this.queryParams.map.createTime_st=this.queryParams.timeRange[0],this.queryParams.map.createTime_ed=this.queryParams.timeRange[1]),this.queryParams.map.fileName="导出角色数据",u["a"].export(this.queryParams).then((function(e){Object(E["a"])(e)}))},importExcel:function(){this.fileImport.type="upload",this.fileImport.isVisible=!0,this.$refs.import.setModel(!1)},importSuccess:function(){this.search()},importClose:function(){this.fileImport.isVisible=!1},singleDelete:function(e){this.$refs.table.clearSelection(),this.$refs.table.toggleRowSelection(e,!0),this.batchDelete()},batchDelete:function(){var e=this;this.selection.length?this.$confirm(this.$t("tips.confirmDelete"),this.$t("common.tips"),{confirmButtonText:this.$t("common.confirm"),cancelButtonText:this.$t("common.cancel"),type:"warning"}).then((function(){var t=[];e.selection.forEach((function(e){t.push(e.id)})),e.delete(t)})).catch((function(){e.clearSelections()})):this.$message({message:this.$t("tips.noDataSelected"),type:"warning"})},clearSelections:function(){this.$refs.table.clearSelection()},delete:function(e){var t=this;u["a"].delete({ids:e}).then((function(e){var i=e.data;i.isSuccess&&t.$message({message:t.$t("tips.deleteSuccess"),type:"success"}),t.search()}))},add:function(){this.dialog.type="add",this.dialog.isVisible=!0,this.$refs.edit.setRole({enums:this.enums})},edit:function(e){this.$refs.edit.setRole({row:e,enums:this.enums}),this.dialog.type="edit",this.dialog.isVisible=!0},fetch:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.loading=!0,this.queryParams.timeRange&&(this.queryParams.map.createTime_st=this.queryParams.timeRange[0],this.queryParams.map.createTime_ed=this.queryParams.timeRange[1]),this.queryParams.current=t.current?t.current:this.queryParams.current,this.queryParams.size=t.size?t.size:this.queryParams.size,u["a"].page(this.queryParams).then((function(t){var i=t.data;i.isSuccess&&(e.tableData=i.data)})).finally((function(){e.loading=!1}))},sortChange:function(e){this.queryParams.sort=e.prop,this.queryParams.order=e.order,this.queryParams.sort&&this.search()},filterChange:function(e){for(var t in e)if(t.includes(".")){var i={};i[t.split(".")[1]]=e[t][0],this.queryParams.model[t.split(".")[0]]=i}else this.queryParams.model[t]=e[t][0];this.search()},cellClick:function(e,t){var i=this;if("operation"!==t["columnKey"]){var s=!1;this.selection.forEach((function(t){t.id===e.id&&(s=!0,i.$refs.table.toggleRowSelection(e))})),s||this.$refs.table.toggleRowSelection(e,!0)}},authResource:function(e){this.roleAuthorityDialog.isVisible=!0,this.$refs.roleAuthority.setRoleAuthority(e)},authUser:function(e){this.userRoleDialog.isVisible=!0,this.$refs.userRole.setUserRole(e)}}},A=V,D=Object(f["a"])(A,s,r,!1,null,"cf8544cc",null);t["default"]=D.exports},"20db":function(e,t,i){"use strict";var s=i("5530"),r=i("9256"),a={page:{method:"POST",url:"/resource/page"},save:{method:"POST",url:"/resource"},update:{method:"PUT",url:"/resource"},delete:{method:"DELETE",url:"/resource"}};t["a"]={page:function(e){return Object(r["a"])(Object(s["a"])(Object(s["a"])({},a.page),{},{data:e}))},save:function(e){return Object(r["a"])(Object(s["a"])(Object(s["a"])({},a.save),{},{data:e}))},update:function(e){return Object(r["a"])(Object(s["a"])(Object(s["a"])({},a.update),{},{data:e}))},delete:function(e){return Object(r["a"])(Object(s["a"])(Object(s["a"])({},a.delete),{},{data:e}))}}},"61d9":function(e,t,i){"use strict";var s=i("5530"),r=i("9256"),a={page:{url:"/role/page",method:"POST"},save:{url:"/role",method:"POST"},update:{url:"/role",method:"PUT"},delete:{url:"/role",method:"DELETE"},saveUserRole:{url:"/role/user",method:"POST"},saveRoleAuthority:{url:"/role/authority",method:"POST"},preview:{method:"POST",url:"/user/preview"},export:{method:"POST",url:"/user/export"},import:{method:"POST",url:"/role/import"}};t["a"]={page:function(e){return Object(r["a"])(Object(s["a"])(Object(s["a"])({},a.page),{},{data:e}))},save:function(e){return Object(r["a"])(Object(s["a"])(Object(s["a"])({},a.save),{},{data:e}))},update:function(e){return Object(r["a"])(Object(s["a"])(Object(s["a"])({},a.update),{},{data:e}))},delete:function(e){return Object(r["a"])(Object(s["a"])(Object(s["a"])({},a.delete),{},{data:e}))},get:function(e){return Object(r["a"])({url:"/role/".concat(e),method:"GET"})},getDetails:function(e){return Object(r["a"])({url:"/role/details/".concat(e),method:"GET"})},check:function(e){return Object(r["a"])({url:"/role/check/".concat(e),method:"GET"})},saveUserRole:function(e){return Object(r["a"])(Object(s["a"])(Object(s["a"])({},a.saveUserRole),{},{data:e}))},findUserIdByRoleId:function(e){return Object(r["a"])({url:"/role/user/".concat(e),method:"GET"})},findAuthorityIdByRoleId:function(e){return Object(r["a"])({url:"/role/authority/".concat(e),method:"GET"})},saveRoleAuthority:function(e){return Object(r["a"])(Object(s["a"])(Object(s["a"])({},a.saveRoleAuthority),{},{data:e}))},preview:function(e){return Object(r["a"])(Object(s["a"])(Object(s["a"])({},a.preview),{},{data:e}))},export:function(e){return Object(r["a"])(Object(s["a"])(Object(s["a"])({},a.export),{},{responseType:"blob",data:e}))},import:function(e){return Object(r["a"])(Object(s["a"])(Object(s["a"])({},a.import),{},{data:e}))}}},"81ee":function(e,t,i){"use strict";var s=i("5530"),r=i("9256"),a={allTree:{method:"GET",url:"/menu/tree"},save:{method:"POST",url:"/menu"},update:{method:"PUT",url:"/menu"},delete:{method:"DELETE",url:"/menu"}};t["a"]={allTree:function(e){return Object(r["a"])(Object(s["a"])(Object(s["a"])({},a.allTree),{},{data:e}))},save:function(e){return Object(r["a"])(Object(s["a"])(Object(s["a"])({},a.save),{},{data:e}))},update:function(e){return Object(r["a"])(Object(s["a"])(Object(s["a"])({},a.update),{},{data:e}))},delete:function(e){return Object(r["a"])(Object(s["a"])(Object(s["a"])({},a.delete),{},{data:e}))}}},"9fb8":function(e,t,i){"use strict";var s=i("5530"),r=i("9256"),a={page:{method:"POST",url:"/user/page"},save:{method:"POST",url:"/user"},update:{method:"PUT",url:"/user"},updateBaseInfo:{method:"PUT",url:"/user/base"},avatar:{method:"PUT",url:"/user/avatar"},delete:{method:"DELETE",url:"/user"},reset:{method:"GET",url:"/user/reset"},updatePassword:{method:"PUT",url:"/user/password"},reload:{method:"POST",url:"/user/reload"},preview:{method:"POST",url:"/user/preview"},export:{method:"POST",url:"/user/export"},import:{method:"POST",url:"/user/import"}};t["a"]={page:function(e){return Object(r["a"])(Object(s["a"])(Object(s["a"])({},a.page),{},{data:e}))},save:function(e){return Object(r["a"])(Object(s["a"])(Object(s["a"])({},a.save),{},{data:e}))},update:function(e){return Object(r["a"])(Object(s["a"])(Object(s["a"])({},a.update),{},{data:e}))},updateBaseInfo:function(e){return Object(r["a"])(Object(s["a"])(Object(s["a"])({},a.updateBaseInfo),{},{data:e}))},updatePassword:function(e){return Object(r["a"])(Object(s["a"])(Object(s["a"])({},a.updatePassword),{},{data:e}))},delete:function(e){return Object(r["a"])(Object(s["a"])(Object(s["a"])({},a.delete),{},{data:e}))},get:function(e){return Object(r["a"])({method:"GET",url:"/user/".concat(e)})},reset:function(e){return Object(r["a"])(Object(s["a"])(Object(s["a"])({},a.reset),{},{data:e}))},avatar:function(e){return Object(r["a"])(Object(s["a"])(Object(s["a"])({},a.avatar),{},{data:e}))},reload:function(e){return Object(r["a"])(Object(s["a"])(Object(s["a"])({},a.reload),{},{formData:!0,data:{userId:e}}))},preview:function(e){return Object(r["a"])(Object(s["a"])(Object(s["a"])({},a.preview),{},{data:e}))},export:function(e){return Object(r["a"])(Object(s["a"])(Object(s["a"])({},a.export),{},{responseType:"blob",data:e}))},import:function(e){return Object(r["a"])(Object(s["a"])(Object(s["a"])({},a.import),{},{data:e}))}}}}]);