chunk-0bdd7280.38c5b939.js 19 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-0bdd7280","chunk-7e23b9c4","chunk-b706c73c","chunk-2d0bdf09","chunk-2d0bdf09","chunk-2d0b1e33","chunk-2d0df437"],{2285:function(e,t,a){"use strict";a.r(t);var n=function(){var e=this,t=e._self._c;return t("a-drawer",{attrs:{title:"数据规则/按钮权限配置",width:"365",closable:!1,visible:e.visible},on:{close:e.onClose}},[t("a-tabs",{attrs:{defaultActiveKey:"1"}},[t("a-tab-pane",{key:"1",attrs:{tab:"数据规则"}},[e.dataruleList.length>0?t("a-checkbox-group",{model:{value:e.dataruleChecked,callback:function(t){e.dataruleChecked=t},expression:"dataruleChecked"}},[t("a-row",[e._l(e.dataruleList,(function(a,n){return t("a-col",{key:"dr"+n,attrs:{span:24}},[t("a-checkbox",{attrs:{value:a.id}},[e._v(e._s(a.ruleName))])],1)})),t("a-col",{attrs:{span:24}},[t("div",{staticStyle:{width:"100%","margin-top":"15px"}},[t("a-button",{attrs:{type:"primary",size:"small",icon:"save"},on:{click:e.saveDataruleForRole}},[e._v("点击保存")])],1)])],2)],1):t("div",[t("h3",[e._v("无配置信息!")])])],1)],1)],1)},r=[],l=a("290c"),o=a("da05"),i=a("0fea"),s={name:"RoleDataruleModal",components:{ACol:o["b"],ARow:l["a"]},data:function(){return{functionId:"",roleId:"",visible:!1,tabList:[{key:"1",tab:"数据规则"},{key:"2",tab:"按钮权限"}],activeTabKey:"1",url:{datarule:"/sys/role/datarule"},dataruleList:[],dataruleChecked:[]}},methods:{loadData:function(){var e=this;Object(i["c"])("".concat(this.url.datarule,"/").concat(this.functionId,"/").concat(this.roleId)).then((function(t){if(t.success){e.dataruleList=t.result.datarule;var a=t.result.drChecked;a&&(e.dataruleChecked=a.split(","))}}))},saveDataruleForRole:function(){var e=this;this.dataruleChecked&&0!=this.dataruleChecked.length||this.$message.warning("请注意,现未勾选任何数据权限!");var t={permissionId:this.functionId,roleId:this.roleId,dataRuleIds:this.dataruleChecked.join(",")};Object(i["j"])(this.url.datarule,t).then((function(t){t.success?e.$message.success(t.message):e.$message.error(t.message)}))},show:function(e,t){this.onReset(),this.functionId=e,this.roleId=t,this.visible=!0,this.loadData()},onClose:function(){this.visible=!1,this.onReset()},onTabChange:function(e){this.activeTabKey=e},onReset:function(){this.functionId="",this.roleId="",this.dataruleList=[],this.dataruleChecked=[]}}},c=s,d=a("2877"),u=Object(d["a"])(c,n,r,!1,null,"5fa38486",null);t["default"]=u.exports},"2a70":function(e,t,a){"use strict";a.r(t);var n=function(){var e=this,t=e._self._c;return t("a-modal",{staticStyle:{top:"5%",height:"85%","overflow-y":"hidden"},attrs:{title:e.title,width:800,visible:e.visible,confirmLoading:e.confirmLoading,cancelText:"关闭",wrapClassName:"ant-modal-cust-warp"},on:{ok:e.handleOk,cancel:e.handleCancel}},[t("a-spin",{attrs:{spinning:e.confirmLoading}},[t("a-form",{attrs:{form:e.form}},[t("a-form-item",{attrs:{labelCol:e.labelCol,wrapperCol:e.wrapperCol,label:"角色名称"}},[t("a-input",{directives:[{name:"decorator",rawName:"v-decorator.trim",value:["role_name",e.validatorRules.roleName],expression:"[ 'role_name', validatorRules.roleName]",modifiers:{trim:!0}}],attrs:{placeholder:"请输入角色名称"}})],1),t("a-form-item",{attrs:{labelCol:e.labelCol,wrapperCol:e.wrapperCol,label:"角色编码"}},[t("a-input",{directives:[{name:"decorator",rawName:"v-decorator.trim",value:["role_code",e.validatorRules.roleCode],expression:"[ 'role_code', validatorRules.roleCode]",modifiers:{trim:!0}}],attrs:{placeholder:"请输入角色编码",disabled:e.roleDisabled}})],1),t("a-form-item",{attrs:{labelCol:e.labelCol,wrapperCol:e.wrapperCol,label:"描述"}},[t("a-textarea",{directives:[{name:"decorator",rawName:"v-decorator",value:["desc",e.validatorRules.description],expression:"[ 'desc', validatorRules.description ]"}],attrs:{rows:5,placeholder:"..."}})],1)],1)],1)],1)},r=[],l=a("88bc"),o=a.n(l),i=a("4ec3"),s={name:"RoleModal",data:function(){return{title:"操作",visible:!1,roleDisabled:!1,model:{},labelCol:{xs:{span:24},sm:{span:5}},wrapperCol:{xs:{span:24},sm:{span:16}},confirmLoading:!1,form:this.$form.createForm(this),validatorRules:{roleName:{rules:[{required:!0,message:"请输入角色名称!"},{min:2,max:30,message:"长度在 2 到 30 个字符",trigger:"blur"}]},roleCode:{rules:[{required:!0,message:"请输入角色名称!"},{min:0,max:64,message:"长度不超过 64 个字符",trigger:"blur"},{validator:this.validateRoleCode}]},description:{rules:[{min:0,max:126,message:"长度不超过 126 个字符",trigger:"blur"}]}}}},created:function(){},methods:{add:function(){this.edit({})},edit:function(e){var t=this;this.form.resetFields(),this.model=Object.assign({},e),this.visible=!0,this.model.id?this.roleDisabled=!0:this.roleDisabled=!1,this.$nextTick((function(){t.form.setFieldsValue(o()(t.model,"role_name","desc","role_code"))}))},close:function(){this.$emit("close"),this.visible=!1},handleOk:function(){var e=this,t=this;this.form.validateFields((function(a,n){if(!a){t.confirmLoading=!0;var r,l=Object.assign(e.model,n);r=e.model.id?Object(i["q"])(l):Object(i["d"])(l),r.then((function(e){e.success?(t.$message.success(e.message),t.$emit("ok")):t.$message.warning(e.message)})).finally((function(){t.confirmLoading=!1,t.close()}))}}))},handleCancel:function(){this.close()},validateRoleCode:function(e,t,a){if(/[\u4E00-\u9FA5]/g.test(t))a("角色编码不可输入汉字!");else{var n={tableName:"admin_role",fieldName:"role_code",fieldVal:t,dataId:this.model.id};Object(i["m"])(n).then((function(e){e.success?a():a(e.message)}))}}}},c=s,d=a("2877"),u=Object(d["a"])(c,n,r,!1,null,"39eea1ec",null);t["default"]=u.exports},"2dab":function(e,t,a){"use strict";a.r(t);var n=function(){var e=this,t=e._self._c;return t("a-date-picker",{attrs:{disabled:e.disabled||e.readOnly,placeholder:e.placeholder,value:e.momVal,showTime:e.showTime,format:e.dateFormat,getCalendarContainer:e.getCalendarContainer},on:{change:e.handleDateChange}})},r=[],l=a("c1df"),o=a.n(l),i={name:"JDate",props:{placeholder:{type:String,default:"",required:!1},value:{type:String,required:!1},dateFormat:{type:String,default:"YYYY-MM-DD",required:!1},triggerChange:{type:Boolean,required:!1,default:!1},readOnly:{type:Boolean,required:!1,default:!1},disabled:{type:Boolean,required:!1,default:!1},showTime:{type:Boolean,required:!1,default:!1},getCalendarContainer:{type:Function,default:function(e){return e.parentNode}}},data:function(){var e=this.value;return{decorator:"",momVal:e?o()(e,this.dateFormat):null}},watch:{value:function(e){this.momVal=e?o()(e,this.dateFormat):null}},methods:{moment:o.a,handleDateChange:function(e,t){this.$emit("change",t)}},model:{prop:"value",event:"change"}},s=i,c=a("2877"),d=Object(c["a"])(s,n,r,!1,null,null,null);t["default"]=d.exports},"4fa6":function(e,t,a){"use strict";a.r(t);var n=function(){var e=this,t=e._self._c;return t("a-card",{staticClass:"card-area",attrs:{bordered:!1}},[t("div",{staticClass:"table-page-search-wrapper"},[t("a-form",{attrs:{layout:"inline"},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.searchQuery.apply(null,arguments)}}},[t("a-row",{attrs:{gutter:24}},[t("a-col",{attrs:{md:6,sm:8}},[t("a-form-item",{attrs:{label:"名称",labelCol:{span:5},wrapperCol:{span:18,offset:1}}},[t("a-input",{attrs:{placeholder:"请输入名称查询"},model:{value:e.queryParam.roleName,callback:function(t){e.$set(e.queryParam,"roleName",t)},expression:"queryParam.roleName"}})],1)],1),t("a-col",{attrs:{md:10,sm:12}},[t("a-form-item",{attrs:{label:"创建时间",labelCol:{span:5},wrapperCol:{span:18,offset:1}}},[t("j-date",{staticStyle:{width:"45%"},attrs:{showTime:!0,"date-format":"YYYY-MM-DD HH:mm:ss",placeholder:"请选择开始时间"},model:{value:e.queryParam.createTime_begin,callback:function(t){e.$set(e.queryParam,"createTime_begin",t)},expression:"queryParam.createTime_begin"}}),t("span",{staticStyle:{width:"10px"}},[e._v("~")]),t("j-date",{staticStyle:{width:"45%"},attrs:{showTime:!0,"date-format":"YYYY-MM-DD HH:mm:ss",placeholder:"请选择结束时间"},model:{value:e.queryParam.createTime_end,callback:function(t){e.$set(e.queryParam,"createTime_end",t)},expression:"queryParam.createTime_end"}})],1)],1),t("span",{staticClass:"table-page-search-submitButtons",staticStyle:{float:"left",overflow:"hidden"}},[t("a-col",{attrs:{md:6,sm:24}},[t("a-button",{attrs:{type:"primary"},on:{click:e.searchQuery}},[e._v("查询")]),t("a-button",{staticStyle:{"margin-left":"8px"},on:{click:e.searchReset}},[e._v("重置")])],1)],1)],1)],1)],1),t("div",{staticClass:"table-operator",staticStyle:{"margin-top":"5px"}},[t("a-button",{attrs:{type:"primary",icon:"plus"},on:{click:e.handleAdd}},[e._v("新增")]),t("a-button",{attrs:{type:"primary",icon:"download"},on:{click:function(t){return e.handleExportXls("角色信息")}}},[e._v("导出")]),t("a-upload",{attrs:{name:"file",showUploadList:!1,multiple:!1,headers:e.tokenHeader,action:e.importExcelUrl},on:{change:e.handleImportExcel}},[t("a-button",{attrs:{type:"primary",icon:"import"}},[e._v("导入")])],1),e.selectedRowKeys.length>0?t("a-dropdown",[t("a-menu",{attrs:{slot:"overlay"},slot:"overlay"},[t("a-menu-item",{key:"1",on:{click:e.batchDel}},[t("a-icon",{attrs:{type:"delete"}}),e._v("删除")],1)],1),t("a-button",{staticStyle:{"margin-left":"8px"}},[e._v("\n 批量操作 "),t("a-icon",{attrs:{type:"down"}})],1)],1):e._e()],1),t("div",[t("div",{staticClass:"ant-alert ant-alert-info",staticStyle:{"margin-bottom":"16px"}},[t("i",{staticClass:"anticon anticon-info-circle ant-alert-icon"}),e._v(" 已选择 "),t("a",{staticStyle:{"font-weight":"600"}},[e._v(e._s(e.selectedRowKeys.length))]),e._v("项  \n "),t("a",{staticStyle:{"margin-left":"24px"},on:{click:e.onClearSelected}},[e._v("清空")])]),t("a-table",{ref:"table",attrs:{size:"middle",bordered:"",rowKey:"id",columns:e.columns,dataSource:e.dataSource,pagination:e.ipagination,loading:e.loading,rowSelection:{selectedRowKeys:e.selectedRowKeys,onChange:e.onSelectChange}},on:{change:e.handleTableChange},scopedSlots:e._u([{key:"action",fn:function(a,n){return t("span",{},[t("a",{on:{click:function(t){return e.handleEdit(n)}}},[e._v("编辑")]),t("a-divider",{attrs:{type:"vertical"}}),t("a-dropdown",[t("a",{staticClass:"ant-dropdown-link"},[e._v("\n 更多 "),t("a-icon",{attrs:{type:"down"}})],1),t("a-menu",{attrs:{slot:"overlay"},slot:"overlay"},[t("a-menu-item",[t("a",{on:{click:function(t){return e.handlePerssion(n.id)}}},[e._v("授权")])]),t("a-menu-item",[t("a-popconfirm",{attrs:{title:"确定删除吗?"},on:{confirm:function(){return e.handleDelete(n.id)}}},[t("a",[e._v("删除")])])],1)],1)],1)],1)}}])})],1),t("role-modal",{ref:"modalForm",on:{ok:e.modalFormOk}}),t("user-role-modal",{ref:"modalUserRole"})],1)},r=[],l=a("2a70"),o=a("ee18"),i=a("b65a"),s=a("2dab"),c={name:"RoleList",mixins:[i["a"]],components:{RoleModal:l["default"],UserRoleModal:o["default"],JDate:s["default"]},data:function(){return{description:"角色管理页面",queryParam:{roleName:""},columns:[{title:"#",dataIndex:"",key:"rowIndex",width:60,align:"center",customRender:function(e,t,a){return parseInt(a)+1}},{title:"角色名称",align:"center",dataIndex:"roleName"},{title:"角色编码",align:"center",dataIndex:"roleCode"},{title:"备注",align:"center",dataIndex:"description"},{title:"创建时间",dataIndex:"createTime",align:"center",sorter:!0},{title:"更新时间",dataIndex:"updateTime",align:"center",sorter:!0},{title:"操作",dataIndex:"action",align:"center",scopedSlots:{customRender:"action"}}],url:{list:"/sys/role/list",delete:"/sys/role/delete",deleteBatch:"/sys/role/deleteBatch",exportXlsUrl:"/sys/role/exportXls",importExcelUrl:"sys/role/importExcel"}}},computed:{importExcelUrl:function(){return"".concat(window._CONFIG["domianURL"],"/").concat(this.url.importExcelUrl)}},methods:{handlePerssion:function(e){this.$refs.modalUserRole.show(e)},onChangeDate:function(e,t){}}},d=c,u=(a("daef"),a("2877")),h=Object(u["a"])(d,n,r,!1,null,"3f3eaa00",null);t["default"]=h.exports},"6a75":function(e,t,a){},"88bc":function(e,t,a){(function(t){var a=1/0,n=9007199254740991,r="[object Arguments]",l="[object Function]",o="[object GeneratorFunction]",i="[object Symbol]",s="object"==typeof t&&t&&t.Object===Object&&t,c="object"==typeof self&&self&&self.Object===Object&&self,d=s||c||Function("return this")();function u(e,t,a){switch(a.length){case 0:return e.call(t);case 1:return e.call(t,a[0]);case 2:return e.call(t,a[0],a[1]);case 3:return e.call(t,a[0],a[1],a[2])}return e.apply(t,a)}function h(e,t){var a=-1,n=e?e.length:0,r=Array(n);while(++a<n)r[a]=t(e[a],a,e);return r}function m(e,t){var a=-1,n=t.length,r=e.length;while(++a<n)e[r+a]=t[a];return e}var f=Object.prototype,p=f.hasOwnProperty,y=f.toString,b=d.Symbol,v=f.propertyIsEnumerable,g=b?b.isConcatSpreadable:void 0,k=Math.max;function w(e,t,a,n,r){var l=-1,o=e.length;a||(a=S),r||(r=[]);while(++l<o){var i=e[l];t>0&&a(i)?t>1?w(i,t-1,a,n,r):m(r,i):n||(r[r.length]=i)}return r}function C(e,t){return e=Object(e),x(e,t,(function(t,a){return a in e}))}function x(e,t,a){var n=-1,r=t.length,l={};while(++n<r){var o=t[n],i=e[o];a(i,o)&&(l[o]=i)}return l}function _(e,t){return t=k(void 0===t?e.length-1:t,0),function(){var a=arguments,n=-1,r=k(a.length-t,0),l=Array(r);while(++n<r)l[n]=a[t+n];n=-1;var o=Array(t+1);while(++n<t)o[n]=a[n];return o[t]=l,u(e,this,o)}}function S(e){return I(e)||j(e)||!!(g&&e&&e[g])}function K(e){if("string"==typeof e||q(e))return e;var t=e+"";return"0"==t&&1/e==-a?"-0":t}function j(e){return O(e)&&p.call(e,"callee")&&(!v.call(e,"callee")||y.call(e)==r)}var I=Array.isArray;function R(e){return null!=e&&T(e.length)&&!D(e)}function O(e){return L(e)&&R(e)}function D(e){var t=A(e)?y.call(e):"";return t==l||t==o}function T(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=n}function A(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function L(e){return!!e&&"object"==typeof e}function q(e){return"symbol"==typeof e||L(e)&&y.call(e)==i}var F=_((function(e,t){return null==e?{}:C(e,h(w(t,1),K))}));e.exports=F}).call(this,a("c8ba"))},8944:function(e,t,a){},"9acd":function(e,t,a){"use strict";a("8944")},daef:function(e,t,a){"use strict";a("6a75")},ee18:function(e,t,a){"use strict";a.r(t);var n=function(){var e=this,t=e._self._c;return t("a-drawer",{staticStyle:{height:"calc(100% - 55px)",overflow:"auto","padding-bottom":"53px"},attrs:{title:e.title,maskClosable:!0,width:"650",placement:"right",closable:!0,visible:e.visible},on:{close:e.close}},[t("a-form",[t("a-form-item",{attrs:{label:"所拥有的权限"}},[t("a-tree",{attrs:{checkable:"",checkedKeys:e.checkedKeys,treeData:e.treeData,selectedKeys:e.selectedKeys,expandedKeys:e.expandedKeysss,checkStrictly:e.checkStrictly},on:{check:e.onCheck,expand:e.onExpand,select:e.onTreeNodeSelect},scopedSlots:e._u([{key:"hasDatarule",fn:function(a){var n=a.slotTitle,r=a.ruleFlag;return t("span",{},[e._v("\n "+e._s(n)),r?t("a-icon",{staticStyle:{"margin-left":"5px",color:"red"},attrs:{type:"align-left"}}):e._e()],1)}}])})],1)],1),t("div",{staticClass:"drawer-bootom-button"},[t("a-dropdown",{staticStyle:{float:"left"},attrs:{trigger:["click"],placement:"topCenter"}},[t("a-menu",{attrs:{slot:"overlay"},slot:"overlay"},[t("a-menu-item",{key:"1",on:{click:function(t){return e.switchCheckStrictly(1)}}},[e._v("父子关联")]),t("a-menu-item",{key:"2",on:{click:function(t){return e.switchCheckStrictly(2)}}},[e._v("取消关联")]),t("a-menu-item",{key:"3",on:{click:e.checkALL}},[e._v("全部勾选")]),t("a-menu-item",{key:"4",on:{click:e.cancelCheckALL}},[e._v("取消全选")]),t("a-menu-item",{key:"5",on:{click:e.expandAll}},[e._v("展开所有")]),t("a-menu-item",{key:"6",on:{click:e.closeAll}},[e._v("合并所有")])],1),t("a-button",[e._v("\n 树操作 "),t("a-icon",{attrs:{type:"up"}})],1)],1),t("a-popconfirm",{attrs:{title:"确定放弃编辑?",okText:"确定",cancelText:"取消"},on:{confirm:e.close}},[t("a-button",{staticStyle:{"margin-right":".8rem"}},[e._v("取消")])],1),t("a-button",{staticStyle:{"margin-right":"0.8rem"},attrs:{type:"primary",loading:e.loading,ghost:""},on:{click:function(t){return e.handleSubmit(!1)}}},[e._v("仅保存")]),t("a-button",{attrs:{type:"primary",loading:e.loading},on:{click:function(t){return e.handleSubmit(!0)}}},[e._v("保存并关闭")])],1),t("role-datarule-modal",{ref:"datarule"})],1)},r=[],l=a("4ec3"),o=a("2285");function i(e){return u(e)||d(e)||c(e)||s()}function s(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function c(e,t){if(e){if("string"===typeof e)return h(e,t);var a=Object.prototype.toString.call(e).slice(8,-1);return"Object"===a&&e.constructor&&(a=e.constructor.name),"Map"===a||"Set"===a?Array.from(e):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?h(e,t):void 0}}function d(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function u(e){if(Array.isArray(e))return h(e)}function h(e,t){(null==t||t>e.length)&&(t=e.length);for(var a=0,n=new Array(t);a<t;a++)n[a]=e[a];return n}var m={name:"RoleModal",components:{RoleDataruleModal:o["default"]},data:function(){return{roleId:"",treeData:[],defaultCheckedKeys:[],checkedKeys:[],expandedKeysss:[],allTreeKeys:[],autoExpandParent:!0,checkStrictly:!0,title:"角色权限配置",visible:!1,loading:!1,selectedKeys:[]}},methods:{onTreeNodeSelect:function(e){e&&e.length>0&&(this.selectedKeys=e),this.$refs.datarule.show(this.selectedKeys[0],this.roleId)},onCheck:function(e){this.checkStrictly?this.checkedKeys=e.checked:this.checkedKeys=e},show:function(e){this.roleId=e,this.visible=!0},close:function(){this.reset(),this.$emit("close"),this.visible=!1},onExpand:function(e){this.expandedKeysss=e,this.autoExpandParent=!1},reset:function(){this.expandedKeysss=[],this.checkedKeys=[],this.defaultCheckedKeys=[],this.loading=!1},expandAll:function(){this.expandedKeysss=this.allTreeKeys},closeAll:function(){this.expandedKeysss=[]},checkALL:function(){this.checkedKeys=this.allTreeKeys},cancelCheckALL:function(){this.checkedKeys=[]},switchCheckStrictly:function(e){1==e?this.checkStrictly=!1:2==e&&(this.checkStrictly=!0)},handleCancel:function(){this.close()},handleSubmit:function(e){var t=this,a=this,n={roleId:a.roleId,permissionIds:a.checkedKeys.join(","),lastpermissionIds:a.defaultCheckedKeys.join(",")};a.loading=!0,Object(l["S"])(n).then((function(n){n.success?(a.$message.success(n.message),a.loading=!1,e&&a.close()):(a.$message.error(n.message),a.loading=!1,e&&a.close()),t.loadData()}))},loadData:function(){var e=this;Object(l["M"])().then((function(t){e.treeData=t.result.treeList,e.allTreeKeys=t.result.ids,Object(l["J"])({roleId:e.roleId}).then((function(t){e.checkedKeys=i(t.result),e.defaultCheckedKeys=i(t.result),e.expandedKeysss=e.allTreeKeys}))}))}},watch:{visible:function(){this.visible&&this.loadData()}}},f=m,p=(a("9acd"),a("2877")),y=Object(p["a"])(f,n,r,!1,null,"f27b1d7c",null);t["default"]=y.exports}}]);