1 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-7e23b9c4","chunk-2d0b1e33"],{2285:function(e,t,a){"use strict";a.r(t);var s=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,s){return t("a-col",{key:"dr"+s,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)},n=[],i=a("290c"),c=a("da05"),l=a("0fea"),r={name:"RoleDataruleModal",components:{ACol:c["b"],ARow:i["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(l["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(l["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=[]}}},o=r,d=a("2877"),u=Object(d["a"])(o,s,n,!1,null,"5fa38486",null);t["default"]=u.exports},8944:function(e,t,a){},"9acd":function(e,t,a){"use strict";a("8944")},ee18:function(e,t,a){"use strict";a.r(t);var s=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 s=a.slotTitle,n=a.ruleFlag;return t("span",{},[e._v("\n "+e._s(s)),n?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)},n=[],i=a("4ec3"),c=a("2285");function l(e){return u(e)||d(e)||o(e)||r()}function r(){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 o(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,s=new Array(t);a<t;a++)s[a]=e[a];return s}var f={name:"RoleModal",components:{RoleDataruleModal:c["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,s={roleId:a.roleId,permissionIds:a.checkedKeys.join(","),lastpermissionIds:a.defaultCheckedKeys.join(",")};a.loading=!0,Object(i["S"])(s).then((function(s){s.success?(a.$message.success(s.message),a.loading=!1,e&&a.close()):(a.$message.error(s.message),a.loading=!1,e&&a.close()),t.loadData()}))},loadData:function(){var e=this;Object(i["M"])().then((function(t){e.treeData=t.result.treeList,e.allTreeKeys=t.result.ids,Object(i["J"])({roleId:e.roleId}).then((function(t){e.checkedKeys=l(t.result),e.defaultCheckedKeys=l(t.result),e.expandedKeysss=e.allTreeKeys}))}))}},watch:{visible:function(){this.visible&&this.loadData()}}},y=f,k=(a("9acd"),a("2877")),m=Object(k["a"])(y,s,n,!1,null,"f27b1d7c",null);t["default"]=m.exports}}]);
|