(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-fadd6bf0"],{9585:function(e,t,s){"use strict";var n=s("af53"),i=s.n(n);i.a},af53:function(e,t,s){},d791:function(e,t,s){"use strict";s.r(t);var n=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",[s("a-drawer",{staticStyle:{overflow:"auto","padding-bottom":"53px"},attrs:{title:e.title,maskClosable:!0,width:"650",placement:"right",closable:!0,visible:e.visible},on:{close:e.close}},[s("a-form",[s("a-form-item",{attrs:{label:"所拥有的权限"}},[s("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(t){var n=t.slotTitle,i=t.ruleFlag;return s("span",{},[e._v("\n "+e._s(n)),i?s("a-icon",{staticStyle:{"margin-left":"5px",color:"red"},attrs:{type:"align-left"}}):e._e()],1)}}])})],1)],1)],1)],1)},i=[],a=s("0fea");function r(e){return d(e)||l(e)||o(e)||c()}function c(){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 s=Object.prototype.toString.call(e).slice(8,-1);return"Object"===s&&e.constructor&&(s=e.constructor.name),"Map"===s||"Set"===s?Array.from(e):"Arguments"===s||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(s)?h(e,t):void 0}}function l(e){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}function d(e){if(Array.isArray(e))return h(e)}function h(e,t){(null==t||t>e.length)&&(t=e.length);for(var s=0,n=new Array(t);s<t;s++)n[s]=e[s];return n}var u={name:"DeviceCalendarAddTree",components:{},data:function(){return{roleId:"",treeData:[],defaultCheckedKeys:[],checkedKeys:[],expandedKeysss:[],allTreeKeys:[],autoExpandParent:!0,checkStrictly:!0,title:"角色权限配置",visible:!1,loading:!1,selectedKeys:[],url:{getBaseTree:"/mdc/mdcequipment/loadTree",deleteBatch:"/mdc/mdcequipment/deleteBatch"}}},created:function(){this.queryTreeData()},methods:{queryTreeData:function(){var e=this;this.loading=!0,this.cardLoading=!0,Object(a["c"])(this.url.getBaseTree).then((function(t){t.success?(e.dataList=[],e.allTreeKeys=[],e.treeDataSource=t.result,e.generateList(t.result)):e.$notification.warning({message:"消息",description:t.message})})).finally((function(){e.loading=!1,e.cardLoading=!1}))},generateList:function(e){for(var t=0;t<e.length;t++){var s=e[t],n=s.key,i=s.title;this.dataList.push({key:n,title:i}),this.allTreeKeys.push(n),s.children&&this.generateList(s.children)}},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,s=this,n={roleId:s.roleId,permissionIds:s.checkedKeys.join(","),lastpermissionIds:s.defaultCheckedKeys.join(",")};s.loading=!0,saveRolePermission(n).then((function(n){n.success?(s.$notification.warning({message:"消息",description:n.message}),s.loading=!1,e&&s.close()):(s.$notification.error({message:"消息",description:n.message}),s.loading=!1,e&&s.close()),t.loadData()}))},loadData:function(){var e=this;queryTreeListForRole().then((function(t){e.treeData=t.result.treeList,e.allTreeKeys=t.result.ids,queryRolePermission({roleId:e.roleId}).then((function(t){e.checkedKeys=r(t.result),e.defaultCheckedKeys=r(t.result),e.expandedKeysss=e.allTreeKeys}))}))}},watch:{visible:function(){this.visible&&this.loadData()}}},f=u,y=(s("9585"),s("2877")),p=Object(y["a"])(f,n,i,!1,null,"7ddff5b6",null);t["default"]=p.exports}}]);
|