(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-e1607410","chunk-d7a91332","chunk-b70d73a0","chunk-9916031a","chunk-78e1f4a0"],{"0e97":function(e,t,a){"use strict";a.r(t);a("4e82");var n=function(){var e=this,t=e._self._c;return t("a-drawer",{attrs:{width:"35%",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}},[t("a-spin",{attrs:{spinning:e.spinning,delay:e.delayTime,tip:"Loading..."}},[t("a-form-model-item",{attrs:{label:"角色名称",prop:"roleName"}},[t("a-input",{attrs:{placeholder:"请输入"},model:{value:e.form.roleName,callback:function(t){e.$set(e.form,"roleName",t)},expression:"form.roleName"}})],1),t("a-form-model-item",{attrs:{label:"角色编码",prop:"roleKey"}},[t("a-input",{attrs:{placeholder:"请输入"},model:{value:e.form.roleKey,callback:function(t){e.$set(e.form,"roleKey",t)},expression:"form.roleKey"}})],1),t("a-form-model-item",{attrs:{label:"排序",prop:"sort"}},[t("a-input-number",{staticStyle:{width:"100%"},attrs:{placeholder:"请输入",min:0},model:{value:e.form.sort,callback:function(t){e.$set(e.form,"sort",t)},expression:"form.sort"}})],1),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,n){return t("a-radio-button",{key:n,attrs:{value:a.dictValue}},[e._v(e._s(a.dictLabel))])})),1)],1),t("a-form-model-item",{attrs:{label:"菜单权限"}},[t("a-checkbox",{attrs:{checked:e.menuExpand},on:{change:function(t){return e.handleCheckedTreeExpand(t)}}},[e._v(" 展开/折叠 ")]),t("a-checkbox",{attrs:{checked:e.menuNodeAll},on:{change:function(t){return e.handleCheckedTreeNodeAll(t)}}},[e._v(" 全选/全不选 ")]),t("a-checkbox",{attrs:{checked:e.form.menuCheckStrictly},on:{change:function(t){return e.handleCheckedTreeConnect(t)}}},[e._v(" 父子联动 ")]),t("a-tree",{attrs:{checkable:"",checkStrictly:!e.form.menuCheckStrictly,"expanded-keys":e.menuExpandedKeys,"auto-expand-parent":e.autoExpandParent,"tree-data":e.menuOptions,replaceFields:e.defaultProps},on:{check:e.onCheck,expand:e.onExpandMenu},model:{value:e.menuCheckedKeys,callback:function(t){e.menuCheckedKeys=t},expression:"menuCheckedKeys"}})],1),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",{attrs:{type:"dashed"},on:{click:e.cancel}},[e._v(" 取消 ")])],1)],1)],1)],1)},r=[],o=a("5530"),s=a("6f75"),i=Object(o["a"])({},s["default"]),l=i,c=a("2877"),d=Object(c["a"])(l,n,r,!1,null,null,null);t["default"]=d.exports},"271c":function(e,t,a){"use strict";a.r(t);a("99af");var n=function(){var e=this,t=e._self._c;return t("div",[t("a-card",{staticStyle:{"margin-bottom":"10px"},attrs:{bordered:!1}},[t("div",{ref:"search",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":""},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.handleQuery.apply(null,arguments)}},model:{value:e.queryParam.roleName,callback:function(t){e.$set(e.queryParam,"roleName",t)},expression:"queryParam.roleName"}})],1)],1),t("a-col",{attrs:{md:6,sm:24}},[t("a-form-item",{attrs:{label:"角色编码"}},[t("a-input",{attrs:{placeholder:"请输入","allow-clear":""},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.handleQuery.apply(null,arguments)}},model:{value:e.queryParam.roleKey,callback:function(t){e.$set(e.queryParam,"roleKey",t)},expression:"queryParam.roleKey"}})],1)],1),t("a-col",{attrs:{md:6,sm:24}},[t("a-form-item",{attrs:{label:"状态"}},[t("a-select",{staticStyle:{width:"100%"},attrs:{placeholder:"请选择","allow-clear":""},model:{value:e.queryParam.status,callback:function(t){e.$set(e.queryParam,"status",t)},expression:"queryParam.status"}},e._l(e.statusOptions,(function(a,n){return t("a-select-option",{key:n,attrs:{value:a.dictValue}},[e._v(e._s(a.dictLabel))])})),1)],1)],1),e.advanced?t("a-col",{attrs:{md:6,sm:24}},[t("a-form-item",{attrs:{label:"状态"}},[t("a-select",{staticStyle:{width:"100%"},attrs:{placeholder:"请选择","allow-clear":""},model:{value:e.queryParam.status,callback:function(t){e.$set(e.queryParam,"status",t)},expression:"queryParam.status"}},e._l(e.statusOptions,(function(a,n){return t("a-select-option",{key:n,attrs:{value:a.dictValue}},[e._v(e._s(a.dictLabel))])})),1)],1)],1):e._e(),e.advanced?t("a-col",{attrs:{md:6,sm:24}},[t("a-form-item",{attrs:{label:"状态"}},[t("a-select",{staticStyle:{width:"100%"},attrs:{placeholder:"请选择","allow-clear":""},model:{value:e.queryParam.status,callback:function(t){e.$set(e.queryParam,"status",t)},expression:"queryParam.status"}},e._l(e.statusOptions,(function(a,n){return t("a-select-option",{key:n,attrs:{value:a.dictValue}},[e._v(e._s(a.dictLabel))])})),1)],1)],1):e._e(),e.advanced?t("a-col",{attrs:{md:6,sm:24}},[t("a-form-item",{attrs:{label:"创建时间"}},[t("a-range-picker",{staticStyle:{width:"100%"},attrs:{valueFormat:"YYYY-MM-DD",format:"YYYY-MM-DD","allow-clear":""},model:{value:e.dateRange,callback:function(t){e.dateRange=t},expression:"dateRange"}})],1)],1):e._e(),e.advanced?t("a-col",{attrs:{md:12,sm:24}},[t("a-form-item",{attrs:{label:"创建时间"}},[t("a-range-picker",{staticStyle:{width:"100%"},attrs:{valueFormat:"YYYY-MM-DD",format:"YYYY-MM-DD","allow-clear":""},model:{value:e.dateRange,callback:function(t){e.dateRange=t},expression:"dateRange"}})],1)],1):e._e(),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),t("a",{staticStyle:{"margin-left":"8px"},on:{click:e.toggleAdvanced}},[e._v(" "+e._s(e.advanced?"收起":"展开")+" "),t("a-icon",{attrs:{type:e.advanced?"up":"down"}})],1)],1)])],1)],1)],1)]),t("a-card",{staticClass:"table-card",attrs:{bordered:!1}},[e.showAddModal?t("sys-role-add-form",{ref:"sysRoleAddForm",attrs:{statusOptions:e.statusOptions},on:{ok:e.getList,close:function(t){e.showAddModal=!1}}}):e._e(),e.showEditModal?t("sys-role-edit-form",{ref:"sysRoleEditForm",attrs:{statusOptions:e.statusOptions},on:{ok:e.getList,close:function(t){e.showEditModal=!1}}}):e._e(),e.showDataScopeModal?t("create-data-scope-form",{ref:"createDataScopeForm",on:{ok:e.getList,close:function(t){e.showDataScopeModal=!1}}}):e._e(),t("advance-table",{attrs:{columns:e.columns,"data-source":e.list,title:"角色管理",loading:e.loading,rowKey:"id",size:"middle",tableKey:"system-role-SysRoleIndex-table","format-conditions":!0,"row-selection":{selectedRowKeys:e.selectedRowKeys,onChange:e.onSelectChange},pagination:{current:e.queryParam.pageNum,pageSize:e.queryParam.pageSize,total:e.total,showSizeChanger:!0,showLessItems:!0,showQuickJumper:!0,showTotal:function(e,t){return"第 ".concat(t[0],"-").concat(t[1]," 条，总计 ").concat(e," 条")},onChange:e.changeSize,onShowSizeChange:e.onShowSizeChange}},on:{refresh:e.getList},scopedSlots:e._u([{key:"status",fn:function(a){var n=a.record;return t("span",{},[t("a-badge",{attrs:{status:"processing",text:e.statusFormat(n)}})],1)}},{key:"roleKey",fn:function(a){var n=a.text;return t("span",{},[t("a-tag",{attrs:{color:"blue"}},[e._v(" "+e._s(n)+" ")])],1)}},{key:"operation",fn:function(a){a.text;var n=a.record;return t("span",{},[t("a",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["system:role:edit"],expression:"['system:role:edit']"}],on:{click:function(t){return t.stopPropagation(),e.handleUpdate(n)}}},[e._v(" 修改 ")]),t("a-divider",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["system:role:edit"],expression:"['system:role:edit']"}],attrs:{type:"vertical"}}),t("a",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["system:role:edit"],expression:"['system:role:edit']"}],on:{click:function(t){return t.stopPropagation(),e.handleDataScope(n)}}},[e._v(" 数据权限 ")]),t("a-divider",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["system:role:remove"],expression:"['system:role:remove']"}],attrs:{type:"vertical"}}),t("a",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["system:role:remove"],expression:"['system:role:remove']"}],on:{click:function(t){return t.stopPropagation(),e.handleDelete(n)}}},[e._v(" 删除 ")])],1)}}])},[t("div",{staticClass:"table-operations",attrs:{slot:"button"},slot:"button"},[t("a-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["system:role:add"],expression:"['system:role:add']"}],attrs:{type:"primary",size:"small"},on:{click:function(t){return e.handleAdd()}}},[t("a-icon",{attrs:{type:"plus"}}),e._v("新增 ")],1),e.multiple?e._e():t("a-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["system:role:remove"],expression:"['system:role:remove']"}],attrs:{type:"danger"},on:{click:e.handleDelete}},[t("a-icon",{attrs:{type:"delete"}}),e._v("删除 ")],1),t("a-button",{directives:[{name:"hasPermi",rawName:"v-hasPermi",value:["system:role:export"],expression:"['system:role:export']"}],attrs:{type:""},on:{click:e.handleExport}},[t("a-icon",{attrs:{type:"download"}}),e._v("导出 ")],1)],1)])],1)],1)},r=[],o=(a("d81d"),a("3528")),s=a("29c8"),i=a("0e97"),l=a("fc7a"),c=a("5d9e"),d={name:"Role",components:{SysRoleAddForm:s["default"],SysRoleEditForm:i["default"],CreateDataScopeForm:l["default"],AdvanceTable:c["a"]},data:function(){return{showAddModal:!1,showEditModal:!1,showDataScopeModal:!1,list:[],selectedRowKeys:[],selectedRows:[],advanced:!1,single:!0,multiple:!0,ids:[],loading:!1,total:0,statusOptions:[],dateRange:[],labelCol:{span:6},wrapperCol:{span:18},queryParam:{pageNum:1,pageSize:10,roleName:void 0,roleKey:void 0,status:void 0},addModalRefName:"addModal",columns:[{title:"角色名",dataIndex:"roleName",ellipsis:!0},{title:"角色编码",dataIndex:"roleKey",ellipsis:!0,scopedSlots:{customRender:"roleKey"}},{title:"排序",dataIndex:"sort",align:"center"},{title:"状态",dataIndex:"status",scopedSlots:{customRender:"status"},align:"center"},{title:"创建时间",dataIndex:"createTime",scopedSlots:{customRender:"createTime"},align:"center"},{title:"操作",dataIndex:"operation",width:"20%",scopedSlots:{customRender:"operation"}}]}},filters:{},created:function(){var e=this;this.getList(),this.getDicts("sys_normal_disable").then((function(t){e.statusOptions=t.data}))},computed:{},watch:{},methods:{statusFormat:function(e){return this.selectDictLabel(this.statusOptions,e.status)},getList:function(){var e=this;this.showAddModal=!1,this.showEditModal=!1,this.showDataScopeModal=!1,this.loading=!0,Object(o["l"])(this.addDateRange(this.queryParam,this.dateRange)).then((function(t){e.list=t.data.list,e.list.map((function(e){e.operation=e.remark})),e.total=t.data.total,e.loading=!1}))},handleQuery:function(){this.queryParam.pageNum=1,this.getList()},handleAdd:function(e){var t=this;this.showAddModal=!0,this.$nextTick((function(){return t.$refs.sysRoleAddForm.handleAdd(e)}))},handleUpdate:function(e){var t=this;this.showEditModal=!0,this.$nextTick((function(){return t.$refs.sysRoleEditForm.handleUpdate(e)}))},handleDataScope:function(e){var t=this;this.showDataScopeModal=!0,this.$nextTick((function(){return t.$refs.createDataScopeForm.handleDataScope(e)}))},resetQuery:function(){this.dateRange=[],this.queryParam={pageNum:1,pageSize:10,roleName:void 0,roleKey:void 0,status:void 0},this.handleQuery()},onShowSizeChange:function(e,t){this.queryParam.pageSize=t,this.getList()},onSizeChange:function(e,t){this.queryParam.pageNum=1,this.queryParam.pageSize=t,this.getList()},changeSize:function(e,t){this.queryParam.pageNum=e,this.queryParam.pageSize=t,this.getList()},onSelectChange:function(e,t){this.selectedRowKeys=e,this.selectedRows=t,this.ids=this.selectedRows.map((function(e){return e.id})),this.single=1!==e.length,this.multiple=!e.length},toggleAdvanced:function(){this.advanced=!this.advanced},handleDelete:function(e){var t=this,a=e.id||this.ids;this.$confirm({title:"确认删除所选中数据?",onOk:function(){return Object(o["g"])(a).then((function(){t.onSelectChange([],[]),t.getList(),t.$message.success("删除成功",3)}))},onCancel:function(){}})},handleExport:function(){var e=this;this.$confirm({title:"是否确认导出?",content:"此操作将导出当前条件下所有数据而非选中数据",onOk:function(){return Object(o["i"])(e.queryParam).then((function(t){e.download(t.msg),e.$message.success("导出成功",3)}))},onCancel:function(){}})}}},u=d,m=a("2877"),h=Object(m["a"])(u,n,r,!1,null,null,null);t["default"]=h.exports},"29c8":function(e,t,a){"use strict";a.r(t);a("4e82");var n=function(){var e=this,t=e._self._c;return t("ant-modal",{attrs:{visible:e.open,"modal-title":e.formTitle,"adjust-size":!0,"modal-cut-height":108},on:{cancel:e.cancel}},[t("a-form-model",{ref:"form",attrs:{slot:"content",model:e.form,rules:e.rules},slot:"content"},[t("a-row",{attrs:{gutter:48}},[t("a-col",{attrs:{span:8}},[t("a-form-model-item",{attrs:{label:"角色名称",prop:"roleName"}},[t("a-input",{attrs:{placeholder:"请输入"},model:{value:e.form.roleName,callback:function(t){e.$set(e.form,"roleName",t)},expression:"form.roleName"}})],1)],1),t("a-col",{attrs:{span:8}},[t("a-form-model-item",{attrs:{label:"角色编码",prop:"roleKey"}},[t("a-input",{attrs:{placeholder:"请输入"},model:{value:e.form.roleKey,callback:function(t){e.$set(e.form,"roleKey",t)},expression:"form.roleKey"}})],1)],1),t("a-col",{attrs:{span:8}},[t("a-form-model-item",{attrs:{label:"排序",prop:"sort"}},[t("a-input-number",{staticStyle:{width:"100%"},attrs:{placeholder:"请输入",min:0},model:{value:e.form.sort,callback:function(t){e.$set(e.form,"sort",t)},expression:"form.sort"}})],1)],1)],1),t("a-row",{attrs:{gutter:48}},[t("a-col",{attrs:{span:8}},[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,n){return t("a-radio-button",{key:n,attrs:{value:a.dictValue}},[e._v(e._s(a.dictLabel))])})),1)],1)],1),t("a-col",{attrs:{span:16}},[t("a-form-model-item",{attrs:{label:"菜单权限"}},[t("a-checkbox",{on:{change:function(t){return e.handleCheckedTreeExpand(t)}}},[e._v(" 展开/折叠 ")]),t("a-checkbox",{on:{change:function(t){return e.handleCheckedTreeNodeAll(t)}}},[e._v(" 全选/全不选 ")]),t("a-checkbox",{attrs:{checked:e.form.menuCheckStrictly},on:{change:function(t){return e.handleCheckedTreeConnect(t)}}},[e._v(" 父子联动 ")]),t("a-tree",{attrs:{checkable:"",checkStrictly:!e.form.menuCheckStrictly,"expanded-keys":e.menuExpandedKeys,"auto-expand-parent":e.autoExpandParent,"tree-data":e.menuOptions,replaceFields:e.defaultProps},on:{check:e.onCheck,expand:e.onExpandMenu},model:{value:e.menuCheckedKeys,callback:function(t){e.menuCheckedKeys=t},expression:"menuCheckedKeys"}})],1)],1),t("a-col",{attrs:{span:24}},[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)],1)],1),t("template",{slot:"footer"},[t("a-button",{attrs:{type:"primary"},on:{click:e.submitForm}},[e._v(" 保存 ")]),t("a-button",{attrs:{type:"dashed"},on:{click:e.cancel}},[e._v(" 取消 ")])],1)],2)},r=[],o=a("5530"),s=a("6f75"),i=Object(o["a"])({},s["default"]),l=i,c=a("2877"),d=Object(c["a"])(l,n,r,!1,null,null,null);t["default"]=d.exports},3528:function(e,t,a){"use strict";a.d(t,"l",(function(){return r})),a.d(t,"k",(function(){return o})),a.d(t,"a",(function(){return s})),a.d(t,"m",(function(){return i})),a.d(t,"f",(function(){return l})),a.d(t,"c",(function(){return c})),a.d(t,"g",(function(){return d})),a.d(t,"i",(function(){return u})),a.d(t,"e",(function(){return m})),a.d(t,"d",(function(){return h})),a.d(t,"j",(function(){return p})),a.d(t,"b",(function(){return f})),a.d(t,"h",(function(){return y}));var n=a("b775");function r(e){return Object(n["b"])({url:"/system/role/list",method:"get",params:e})}function o(e){return Object(n["b"])({url:"/system/role/"+e,method:"get"})}function s(e){return Object(n["b"])({url:"/system/role",method:"post",data:e})}function i(e){return Object(n["b"])({url:"/system/role/edit",method:"post",data:e})}function l(e){return Object(n["b"])({url:"/system/role/dataScope/edit",method:"post",data:e})}function c(e,t){var a={id:e,status:t};return Object(n["b"])({url:"/system/role/changeStatus/edit",method:"post",data:a})}function d(e){return Object(n["b"])({url:"/system/role/"+e,method:"post"})}function u(e){return Object(n["b"])({url:"/system/role/export",method:"get",params:e})}function m(e){return Object(n["b"])({url:"/system/role/checkRoleNameUnique",method:"get",params:e})}function h(e){return Object(n["b"])({url:"/system/role/checkRoleKeyUnique",method:"get",params:e})}function p(){return Object(n["b"])({url:"/system/role/findMaxSort",method:"get"})}function f(e){return Object(n["b"])({url:"/system/role/batchSave",method:"post",data:e})}function y(e,t){return Object(n["b"])({url:"/system/role/deleteRoleUser/"+e+"/"+t,method:"post"})}},"6f75":function(e,t,a){"use strict";a.r(t);a("99af"),a("a630"),a("4e82"),a("d3b7"),a("6062"),a("3ca3"),a("159b"),a("ddb0");var n=a("3528"),r=a("a6dc"),o=a("2dd7");t["default"]={name:"CreateForm",props:{statusOptions:{type:Array,required:!0}},components:{AntModal:o["a"]},data:function(){return{loading:!1,spinning:!1,delayTime:200,menuExpandedKeys:[],autoExpandParent:!1,menuCheckedKeys:[],halfCheckedKeys:[],menuOptions:[],formTitle:"",form:{roleId:void 0,roleName:void 0,roleKey:void 0,sort:0,status:"0",menuIds:[],menuCheckStrictly:!0,remark:void 0},open:!1,menuExpand:!1,menuNodeAll:!1,rules:{roleName:[{required:!0,message:"角色名称不能为空",trigger:"blur"},{validator:this.checkRoleNameUnique}],roleKey:[{required:!0,message:"角色编码不能为空",trigger:"blur"},{validator:this.checkRoleKeyUnique}],sort:[{required:!0,message:"显示顺序不能为空",trigger:"blur"}]},defaultProps:{children:"children",title:"label",key:"id"}}},filters:{},created:function(){},computed:{},watch:{},methods:{onExpandMenu:function(e){this.menuExpandedKeys=e,this.autoExpandParent=!1},getMenuTreeselect:function(){return Object(r["j"])(0,10).then((function(e){return e}))},getMenuAllCheckedKeys:function(){return Array.from(new Set(this.menuCheckedKeys.concat(this.halfCheckedKeys)))},getAllMenuNode:function(e){var t=this;if(!e||0===e.length)return[];e.forEach((function(e){return t.menuCheckedKeys.push(e.id),t.getAllMenuNode(e.children)}))},selectNodefilter:function(e,t){var a=this;if(!e||0===e.length)return[];e.forEach((function(e){var n=a.menuCheckedKeys.indexOf(e.id);-1!==n&&(t.forEach((function(e){-1===a.halfCheckedKeys.indexOf(e)&&a.halfCheckedKeys.push(e)})),t=[]);var r=a.halfCheckedKeys.indexOf(e.id),o=t.indexOf(e.id);return-1===r&&-1===o&&-1===n&&t.push(e.id),a.selectNodefilter(e.children,t)}))},handleCheckedTreeNodeAll:function(e){this.menuNodeAll=!this.menuNodeAll,e.target.checked?this.getAllMenuNode(this.menuOptions):(this.menuCheckedKeys=[],this.halfCheckedKeys=[])},handleCheckedTreeExpand:function(e){if(this.menuExpand=!this.menuExpand,e.target.checked){var t=this.menuOptions;this.treeExpandWithLevel(t,-1)}else this.menuExpandedKeys=[],this.treeExpandWithLevel(this.menuOptions,1)},treeExpandWithLevel:function(e,t){var a=this;t--,0!==t&&e.forEach((function(e){a.menuExpandedKeys.push(e.id),e.children&&a.treeExpandWithLevel(e.children,t)}))},handleCheckedTreeConnect:function(e){this.form.menuCheckStrictly=!this.form.menuCheckStrictly},getRoleMenuTreeselect:function(e){return Object(r["g"])(e).then((function(e){return e}))},onCheck:function(e,t){if(this.form.menuCheckStrictly)this.halfCheckedKeys=t.halfCheckedKeys,this.menuCheckedKeys=e;else{var a=[];this.menuCheckedKeys.checked&&(a=Array.from(new Set(a.concat(this.menuCheckedKeys.checked)))),this.menuCheckedKeys.halfChecked&&(a=Array.from(new Set(a.concat(this.menuCheckedKeys.halfChecked)))),this.menuCheckedKeys=a}},cancel:function(){this.open=!1,this.reset(),this.$emit("close")},reset:function(){},handleAdd:function(){var e=this;this.reset(),Object(n["j"])().then((function(t){e.form.sort=t.data}));var t=this.getMenuTreeselect();t.then((function(t){e.menuOptions=t.data,e.treeExpandWithLevel(e.menuOptions,1)})),this.open=!0,this.formTitle="添加角色"},handleUpdate:function(e,t){var a=this;this.open=!0,this.spinning=!this.spinning,this.reset(),this.menuExpand=!1,this.menuNodeAll=!1;var r=e?e.id:t,o=this.getRoleMenuTreeselect(r);Object(n["k"])(r).then((function(e){a.form=e.data})),o.then((function(e){a.menuOptions=e.data.menus,a.menuCheckedKeys=e.data.checkedKeys,a.form.menuCheckStrictly&&a.selectNodefilter(a.menuOptions,[]),a.treeExpandWithLevel(a.menuOptions,1)})),this.formTitle="修改角色",this.spinning=!this.spinning},submitForm:function(){var e=this;this.$refs.form.validate((function(t){if(!t)return!1;void 0!==e.form.id?(e.form.menuIds=e.getMenuAllCheckedKeys(),Object(n["m"])(e.form).then((function(t){e.$message.success("修改成功",3),e.open=!1,e.$emit("ok")}))):(e.form.menuIds=e.getMenuAllCheckedKeys(),Object(n["a"])(e.form).then((function(t){e.$message.success("新增成功",3),e.open=!1,e.$emit("ok")})))}))},checkRoleNameUnique:function(e,t,a){var r="角色名称已存在";if(""===t)a();else{var o={roleName:t,id:void 0!==this.form.id?this.form.id:""};Object(n["e"])(o).then((function(e){"1"===e.data.code?a():a(r)}))}},checkRoleKeyUnique:function(e,t,a){var r="角色编码已存在";if(""===t)a();else{var o={roleKey:t,id:void 0!==this.form.id?this.form.id:""};Object(n["d"])(o).then((function(e){"1"===e.data.code?a():a(r)}))}}}}},a6dc:function(e,t,a){"use strict";a.d(t,"f",(function(){return r})),a.d(t,"e",(function(){return o})),a.d(t,"j",(function(){return s})),a.d(t,"g",(function(){return i})),a.d(t,"h",(function(){return l})),a.d(t,"c",(function(){return c})),a.d(t,"i",(function(){return d})),a.d(t,"b",(function(){return u})),a.d(t,"a",(function(){return m})),a.d(t,"d",(function(){return h}));var n=a("b775");function r(e,t,a){return null!=t&&""!==t||(t="0"),null!=a&&""!==a||(a="2"),Object(n["b"])({url:"/system/menu/list/"+a+"/"+t,method:"get",params:e})}function o(e){return Object(n["b"])({url:"/system/menu/"+e,method:"get"})}function s(e,t){return null!=e&&""!==e||(e="0"),null!=t&&""!==t||(t="2"),Object(n["b"])({url:"/system/menu/treeselect/"+t+"/"+e,method:"get"})}function i(e){return Object(n["b"])({url:"/system/menu/roleMenuTreeselect/"+e,method:"get"})}function l(e){return Object(n["b"])({url:"/system/menu",method:"post",data:e})}function c(e){return Object(n["b"])({url:"/system/menu/"+e,method:"post"})}function d(e){return Object(n["b"])({url:"/system/menu/searchMenuList",method:"get",params:e})}function u(e){return Object(n["b"])({url:"/system/menu/checkMenuNameUnique",method:"get",params:e})}function m(e){return Object(n["b"])({url:"/system/menu/checkMenuCodeUnique",method:"get",params:e})}function h(e){return Object(n["b"])({url:"/system/menu/findMaxSort/"+e,method:"get"})}},fc7a:function(e,t,a){"use strict";a.r(t);var n=function(){var e=this,t=e._self._c;return t("a-drawer",{attrs:{width:"35%","label-col":4,title:e.formTitle,"wrapper-col":14,visible:e.openDataScope,"body-style":{height:"calc(100vh - 100px)",overflow:"auto"}},on:{close:e.cancel}},[t("a-form-model",{ref:"form",attrs:{model:e.form}},[t("a-form-model-item",{attrs:{label:"角色名称",prop:"roleName"}},[t("a-input",{attrs:{disabled:!0},model:{value:e.form.roleName,callback:function(t){e.$set(e.form,"roleName",t)},expression:"form.roleName"}})],1),t("a-form-model-item",{attrs:{label:"角色标识",prop:"roleKey"}},[t("a-input",{attrs:{disabled:!0},model:{value:e.form.roleKey,callback:function(t){e.$set(e.form,"roleKey",t)},expression:"form.roleKey"}})],1),t("a-form-model-item",{attrs:{label:"权限范围",prop:"dataScope"}},[t("a-select",{staticStyle:{width:"100%"},attrs:{placeholder:"请选择"},model:{value:e.form.dataScope,callback:function(t){e.$set(e.form,"dataScope",t)},expression:"form.dataScope"}},e._l(e.dataScopeOptions,(function(a,n){return t("a-select-option",{key:n,attrs:{value:a.value}},[e._v(e._s(a.label))])})),1)],1),t("a-form-model-item",{directives:[{name:"show",rawName:"v-show",value:2==e.form.dataScope,expression:"form.dataScope == 2"}],attrs:{label:"数据权限"}},[t("a-checkbox",{attrs:{checked:e.menuExpand},on:{change:function(t){return e.handleCheckedTreeExpand(t)}}},[e._v(" 展开/折叠 ")]),t("a-checkbox",{attrs:{checked:e.menuNodeAll},on:{change:function(t){return e.handleCheckedTreeNodeAll(t)}}},[e._v(" 全选/全不选 ")]),t("a-checkbox",{attrs:{checked:e.form.deptCheckStrictly},on:{change:function(t){return e.handleCheckedTreeConnect(t)}}},[e._v(" 父子联动 ")]),t("a-tree",{attrs:{checkable:"",checkStrictly:!e.form.deptCheckStrictly,"expanded-keys":e.deptExpandedKeys,"auto-expand-parent":e.autoExpandParent,"tree-data":e.deptOptions,replaceFields:e.defaultProps},on:{expand:e.onExpandDept},model:{value:e.deptCheckedKeys,callback:function(t){e.deptCheckedKeys=t},expression:"deptCheckedKeys"}})],1),t("div",{staticClass:"bottom-control"},[t("a-space",[t("a-button",{attrs:{type:"primary"},on:{click:e.submitDataScope}},[e._v(" 保存 ")]),t("a-button",{on:{click:e.cancel}},[e._v(" 取消 ")])],1)],1)],1)],1)},r=[],o=(a("99af"),a("a630"),a("d3b7"),a("6062"),a("3ca3"),a("159b"),a("ddb0"),a("3528")),s=a("fcb7"),i={name:"CreateDataScopeForm",components:{},data:function(){return{loading:!1,dataScopeOptions:[{value:"1",label:"全部数据权限"},{value:"2",label:"自定义数据权限"},{value:"3",label:"本部门数据权限"},{value:"4",label:"本部门及以下数据权限"},{value:"5",label:"仅本人数据权限"}],deptExpandedKeys:[],autoExpandParent:!1,deptCheckedKeys:[],halfCheckedKeys:[],deptOptions:[],formTitle:"",menuExpand:!1,menuNodeAll:!1,form:{id:void 0,roleName:void 0,roleKey:void 0,sort:0,status:"0",deptIds:[],deptCheckStrictly:!0,remark:void 0},openDataScope:!1,deptExpand:!0,deptNodeAll:!1,defaultProps:{children:"children",title:"label",key:"id"}}},filters:{},created:function(){},computed:{},watch:{},methods:{onExpandDept:function(e){this.deptExpandedKeys=e,this.autoExpandParent=!1},getDeptTreeselect:function(){var e=this;Object(s["i"])().then((function(t){e.deptOptions=t.data}))},getDeptAllCheckedKeys:function(){return void 0!==this.deptCheckedKeys.checked?Array.from(new Set(this.deptCheckedKeys.checked.concat(this.halfCheckedKeys))):Array.from(new Set(this.deptCheckedKeys.concat(this.halfCheckedKeys)))},getAllDeptNode:function(e){var t=this;if(!e||0===e.length)return[];e.forEach((function(e){return e.disableCheckbox||t.deptCheckedKeys.push(e.id),t.getAllDeptNode(e.children)}))},selectNodefilter:function(e,t){var a=this;if(!e||0===e.length)return[];e.forEach((function(e){var n=a.deptCheckedKeys.indexOf(e.id);-1!==n&&(t.forEach((function(e){-1===a.halfCheckedKeys.indexOf(e)&&a.halfCheckedKeys.push(e)})),t=[]);var r=a.halfCheckedKeys.indexOf(e.id),o=t.indexOf(e.id);return-1===r&&-1===o&&-1===n&&t.push(e.id),a.selectNodefilter(e.children,t)}))},handleCheckedTreeNodeAll:function(e){this.menuNodeAll=!this.menuNodeAll,e.target.checked?this.getAllDeptNode(this.deptOptions):(this.deptCheckedKeys=[],this.halfCheckedKeys=[])},handleCheckedTreeExpand:function(e){if(this.menuExpand=!this.menuExpand,e.target.checked){var t=this.deptOptions;this.treeExpandWithLevel(t,-1)}else this.deptExpandedKeys=[],this.treeExpandWithLevel(this.deptOptions,2)},treeExpandWithLevel:function(e,t){var a=this;t--,0!==t&&e.forEach((function(e){a.deptExpandedKeys.push(e.id),e.children&&a.treeExpandWithLevel(e.children,t)}))},handleCheckedTreeConnect:function(e){this.form.deptCheckStrictly=!this.form.deptCheckStrictly},getRoleDeptTreeselect:function(e){return Object(s["j"])(e).then((function(e){return e}))},onCheck:function(e,t){if(this.form.deptCheckStrictly)this.halfCheckedKeys=t.halfCheckedKeys,this.deptCheckedKeys=e;else{var a=[];this.deptCheckedKeys.checked&&(a=Array.from(new Set(a.concat(this.deptCheckedKeys.checked)))),this.deptCheckedKeys.halfChecked&&(a=Array.from(new Set(a.concat(this.deptCheckedKeys.halfChecked)))),this.deptCheckedKeys=a}},onClose:function(){this.openDataScope=!1},cancel:function(){this.openDataScope=!1,this.reset(),this.$emit("close")},reset:function(){},handleDataScope:function(e){var t=this;this.reset(),this.menuExpand=!1,this.menuNodeAll=!1;var a=this.getRoleDeptTreeselect(e.id);Object(o["k"])(e.id).then((function(e){t.form=e.data,t.openDataScope=!0,t.formTitle="分配数据权限"})),a.then((function(e){t.deptOptions=e.data.depts,t.deptCheckedKeys=e.data.checkedKeys,t.form.deptCheckStrictly&&t.selectNodefilter(t.deptOptions,[]),t.treeExpandWithLevel(t.deptOptions,2)}))},submitDataScope:function(){var e=this;void 0!==this.form.id&&(this.form.deptIds=this.getDeptAllCheckedKeys(),Object(o["f"])(this.form).then((function(t){e.$message.success("修改成功",3),e.openDataScope=!1,e.$emit("ok")})))}}},l=i,c=a("2877"),d=Object(c["a"])(l,n,r,!1,null,null,null);t["default"]=d.exports},fcb7:function(e,t,a){"use strict";a.d(t,"g",(function(){return r})),a.d(t,"h",(function(){return o})),a.d(t,"i",(function(){return s})),a.d(t,"e",(function(){return i})),a.d(t,"j",(function(){return l})),a.d(t,"a",(function(){return c})),a.d(t,"o",(function(){return d})),a.d(t,"b",(function(){return u})),a.d(t,"d",(function(){return m})),a.d(t,"k",(function(){return h})),a.d(t,"l",(function(){return p})),a.d(t,"p",(function(){return f})),a.d(t,"m",(function(){return y})),a.d(t,"f",(function(){return b})),a.d(t,"n",(function(){return k})),a.d(t,"c",(function(){return v}));a("d3b7");var n=a("b775");function r(e,t,a){return null!=t&&""!==t||(t="0"),null!=a&&""!==a||(a="1"),Object(n["b"])({url:"/system/dept/list/"+a+"/"+t,method:"get",params:e})}function o(e){return Object(n["b"])({url:"/system/dept/listTreeExcludeChild/10/0/"+e,method:"get"})}function s(e,t){return null!=e&&""!==e||(e="0"),null!=t&&""!==t||(t="1"),Object(n["b"])({url:"/system/dept/listTree/"+t+"/"+e,method:"get"})}function i(e){return Object(n["b"])({url:"/system/dept/"+e,method:"get"})}function l(e){return Object(n["b"])({url:"/system/dept/roleDeptTreeselect/"+e,method:"get"})}function c(e){return Object(n["b"])({url:"/system/dept",method:"post",data:e})}function d(e){return Object(n["b"])({url:"/system/dept/edit",method:"post",data:e})}function u(e){return Object(n["b"])({url:"/system/dept/"+e,method:"post"})}function m(e){return Object(n["b"])({url:"/system/dept/findMaxSort/"+e,method:"get"})}function h(e){return Object(n["b"])({url:"/system/dept/search",method:"get",params:e})}function p(e){return Object(n["b"])({url:"/system/dept/searchDeptList",method:"get",params:e})}function f(e,t){return null!=e&&""!==e||(e="0"),null!=t&&""!==t||(t="1"),Object(n["b"])({url:"/system/dept/userSelectList/"+t+"/"+e,method:"get"})}function y(e){return Object(n["b"])({url:"/system/dept/searchDeptUserList",method:"get",params:e})}function b(e){return Object(n["b"])({url:"/system/dept/getDeptInfoByIds",method:"post",data:e})}function k(){return new Promise((function(e,t){e({code:200,msg:"",data:[]})}))}function v(e){return Object(n["b"])({url:"/system/dept/export",method:"get",params:e})}}}]);