cpop_nftmeta_sdm/web/admin-web/static/js/chunk-63cf1723.8d37787b.js
2024-10-25 16:17:26 +08:00

1 line
3.1 KiB
JavaScript

(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-63cf1723"],{"4eb4":function(e,t,n){},"7a51":function(e,t,n){"use strict";n("4eb4")},ba23:function(e,t,n){"use strict";n.r(t);var i=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("el-dialog",{attrs:{title:"权限列表",visible:e.show,width:"800px"},on:{"update:visible":function(t){e.show=t}}},[n("div",{staticClass:"permission-list"},[e._l(e.treeData,(function(t){return[n("el-tree",{key:t.id,ref:"menuTree",refInFor:!0,staticClass:"permission-item",attrs:{"node-key":"id","check-strictly":e.checkStrict,data:[t],props:e.props,"default-checked-keys":e.checkedKeys,"show-checkbox":"","default-expand-all":""}})]}))],2),e._v(" "),n("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[n("el-button",{directives:[{name:"loading",rawName:"v-loading",value:e.saving,expression:"saving"}],attrs:{type:"primary"},on:{click:e.saveHandler}},[e._v("更新")]),e._v(" "),n("el-button",{on:{click:e.close}},[e._v("取消")])],1)])},r=[],o=n("1f27"),c=n("cc5e"),a={name:"role-permission",data:function(){return{saving:!1,loading:!1,show:!1,checkStrict:!1,role:{},treeData:[],checkedKeys:[],props:{label:"name",children:"children"}}},mounted:function(){this.initPermission()},methods:{open:function(e){e&&(this.role=Object.assign({},e),this.initChecked()),this.show=!0},close:function(){this.show=!1},initPermission:function(){var e=this;this.loading=!0,Object(o["e"])().then((function(t){e.treeData=t.data})).finally((function(){e.loading=!1}))},initChecked:function(){var e=this;Object(o["d"])(this.role.roleId).then((function(t){e.checkStrict=!0,t.data&&(e.checkedKeys=t.data.map((function(e){return e.menuId})),e.$nextTick((function(){e.checkStrict=!1})))}))},saveHandler:function(){var e=this;this.saving=!0;var t=[];for(var n in this.$refs.menuTree)if(n){var i=this.$refs.menuTree[n].getCheckedKeys();if(0!=i.length){t=t.concat(i);var r=this.$refs.menuTree[n].getHalfCheckedKeys();0!=r.length&&(t=t.concat(r))}}Object(c["e"])(this.role.roleId,t.join(",")).then((function(t){e.saving=!1,"success"===t.code?(e.close(),e.$notify({title:"成功",message:"权限修改成功",type:"success",duration:2e3})):e.$$notify({title:"失败",message:"权限更新失败",type:"error",duration:2e3})}))}}},s=a,u=(n("7a51"),n("2877")),l=Object(u["a"])(s,i,r,!1,null,"dae1dae4",null);t["default"]=l.exports},cc5e:function(e,t,n){"use strict";n.d(t,"d",(function(){return r})),n.d(t,"c",(function(){return o})),n.d(t,"a",(function(){return c})),n.d(t,"f",(function(){return a})),n.d(t,"b",(function(){return s})),n.d(t,"e",(function(){return u}));var i=n("b775");function r(){return Object(i["a"])({url:"/admin/role/list",method:"get"})}function o(e){return Object(i["a"])({url:"/admin/role/page",method:"get",params:e})}function c(e){return Object(i["a"])({url:"/admin/role",method:"post",data:e})}function a(e){return Object(i["a"])({url:"/admin/role",method:"put",data:e})}function s(e){return Object(i["a"])({url:"/admin/role/"+e,method:"delete"})}function u(e,t){return Object(i["a"])({url:"/admin/role/menu",method:"put",params:{roleId:e,menuIds:t}})}}}]);