cbma_expert/ce_server/vuedist/static/js/chunk-99c1f3fe.7470566d.js

1 line
10 KiB
JavaScript

(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-99c1f3fe"],{"18ed":function(e,t,r){},"24fd":function(e,t,r){"use strict";r.d(t,"c",(function(){return a})),r.d(t,"a",(function(){return i})),r.d(t,"d",(function(){return s})),r.d(t,"b",(function(){return o}));var n=r("b775");function a(){return Object(n["a"])({url:"/system/organization/",method:"get"})}function i(e){return Object(n["a"])({url:"/system/organization/",method:"post",data:e})}function s(e,t){return Object(n["a"])({url:"/system/organization/".concat(e,"/"),method:"put",data:t})}function o(e){return Object(n["a"])({url:"/system/organization/".concat(e,"/"),method:"delete"})}},"386d":function(e,t,r){"use strict";var n=r("cb7c"),a=r("83a1"),i=r("5f1b");r("214f")("search",1,(function(e,t,r,s){return[function(r){var n=e(this),a=void 0==r?void 0:r[t];return void 0!==a?a.call(r,n):new RegExp(r)[t](String(n))},function(e){var t=s(r,e,this);if(t.done)return t.value;var o=n(e),l=String(this),c=o.lastIndex;a(c,0)||(o.lastIndex=0);var u=i(o,l);return a(o.lastIndex,c)||(o.lastIndex=c),null===u?-1:u.index}]}))},"83a1":function(e,t){e.exports=Object.is||function(e,t){return e===t?0!==e||1/e===1/t:e!=e&&t!=t}},a0a9:function(e,t,r){"use strict";r("18ed")},cc5e:function(e,t,r){"use strict";r.d(t,"d",(function(){return a})),r.d(t,"c",(function(){return i})),r.d(t,"a",(function(){return s})),r.d(t,"e",(function(){return o})),r.d(t,"b",(function(){return l}));var n=r("b775");function a(){return Object(n["a"])({url:"/system/permission/",method:"get"})}function i(){return Object(n["a"])({url:"/system/role/",method:"get"})}function s(e){return Object(n["a"])({url:"/system/role/",method:"post",data:e})}function o(e,t){return Object(n["a"])({url:"/system/role/".concat(e,"/"),method:"put",data:t})}function l(e){return Object(n["a"])({url:"/system/role/".concat(e,"/"),method:"delete"})}},e350:function(e,t,r){"use strict";r.d(t,"a",(function(){return a}));r("6762"),r("2fdb");var n=r("4360");function a(e){if(e&&e instanceof Array&&e.length>0){var t=n["a"].getters&&n["a"].getters.perms,r=e;if(t.includes("admin"))return!0;var a=t.some((function(e){return r.includes(e)}));return!!a}return console.error("need perms! Like v-permission=\"['admin','editor']\""),!1}},f982:function(e,t,r){"use strict";r.r(t);var n=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{staticClass:"app-container"},[r("div",[r("el-input",{staticClass:"filter-item",staticStyle:{width:"200px"},attrs:{placeholder:"输入角色名称进行搜索"},nativeOn:{keyup:function(t){return e.handleFilter(t)}},model:{value:e.search,callback:function(t){e.search=t},expression:"search"}}),e._v(" "),e.checkPermission(["role_create"])?r("el-button",{attrs:{type:"primary",icon:"el-icon-plus",size:"small"},on:{click:e.handleAdd}},[e._v("新增")]):e._e()],1),e._v(" "),r("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.listLoading,expression:"listLoading"},{name:"el-height-adaptive-table",rawName:"v-el-height-adaptive-table",value:{bottomOffset:50},expression:"{ bottomOffset: 50 }"}],staticStyle:{width:"100%","margin-top":"10px"},attrs:{data:e.tableData,"highlight-current-row":"","row-key":"id",height:"100",stripe:"",border:""}},[r("el-table-column",{attrs:{align:"center",label:"角色名称",width:"220"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(e._s(t.row.name))]}}])}),e._v(" "),r("el-table-column",{attrs:{align:"header-center",label:"角色描述"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(e._s(t.row.description))]}}])}),e._v(" "),r("el-table-column",{attrs:{align:"center",label:"操作"},scopedSlots:e._u([{key:"default",fn:function(t){return[r("el-button",{attrs:{type:"primary",size:"small",icon:"el-icon-edit",disabled:!e.checkPermission(["role_update"])},on:{click:function(r){return e.handleEdit(t)}}}),e._v(" "),r("el-button",{attrs:{type:"danger",size:"small",icon:"el-icon-delete",disabled:!e.checkPermission(["role_delete"])},on:{click:function(r){return e.handleDelete(t)}}})]}}])})],1),e._v(" "),r("el-dialog",{attrs:{visible:e.dialogVisible,title:"edit"===e.dialogType?"编辑角色":"新增角色"},on:{"update:visible":function(t){e.dialogVisible=t}}},[r("el-form",{attrs:{model:e.role,"label-width":"80px","label-position":"left"}},[r("el-form-item",{attrs:{label:"名称"}},[r("el-input",{attrs:{placeholder:"角色名称"},model:{value:e.role.name,callback:function(t){e.$set(e.role,"name",t)},expression:"role.name"}})],1),e._v(" "),r("el-form-item",{attrs:{label:"描述"}},[r("el-input",{attrs:{autosize:{minRows:2,maxRows:4},type:"textarea",placeholder:"角色描述"},model:{value:e.role.description,callback:function(t){e.$set(e.role,"description",t)},expression:"role.description"}})],1),e._v(" "),r("el-row",[r("el-col",{attrs:{span:12}},[r("el-form-item",{attrs:{label:"数据权限"}},[r("el-select",{staticStyle:{width:"90%"},attrs:{placeholder:"请选择"},model:{value:e.role.datas,callback:function(t){e.$set(e.role,"datas",t)},expression:"role.datas"}},e._l(e.dataOptions,(function(e){return r("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1)],1),e._v(" "),r("el-form-item",{directives:[{name:"show",rawName:"v-show",value:"自定义"==e.role.datas,expression:"role.datas == '自定义'"}],attrs:{label:"权限范围"}},[r("el-tree",{ref:"depts_tree",staticClass:"filter-tree",attrs:{data:e.orgData,"show-checkbox":"","node-key":"id","default-expand-all":"","highlight-current":"","expand-on-click-node":!1},model:{value:e.role.depts,callback:function(t){e.$set(e.role,"depts",t)},expression:"role.depts"}})],1)],1),e._v(" "),r("el-col",{attrs:{span:12}},[r("el-form-item",{attrs:{label:"功能权限"}},[r("el-tree",{ref:"tree",staticClass:"permission-tree",attrs:{"check-strictly":e.checkStrictly,data:e.routes,"show-checkbox":"","node-key":"id"},model:{value:e.role.perms,callback:function(t){e.$set(e.role,"perms",t)},expression:"role.perms"}})],1)],1)],1)],1),e._v(" "),r("span",{attrs:{slot:"footer"},slot:"footer"},[r("el-button",{attrs:{type:"danger"},on:{click:function(t){e.dialogVisible=!1}}},[e._v("取消")]),e._v(" "),r("el-button",{attrs:{type:"primary"},on:{click:e.confirmRole}},[e._v("确认")])],1)],1)],1)},a=[],i=(r("96cf"),r("1da1")),s=(r("7f7f"),r("6762"),r("2fdb"),r("386d"),r("ed08")),o=r("e350"),l=r("cc5e"),c=r("24fd"),u={id:"",name:"",description:"",perms:[],datas:"本级及以下",depts:[]},d={data:function(){return{search:"",role:Object.assign({},u),routes:[],tableData:[],rolesList:[],dialogVisible:!1,dialogType:"new",checkStrictly:!0,listLoading:!0,orgData:[],dataOptions:[{value:"全部",label:"全部"},{value:"自定义",label:"自定义"},{value:"同级及以下",label:"同级及以下"},{value:"本级及以下",label:"本级及以下"},{value:"本级",label:"本级"},{value:"仅本人",label:"仅本人"}]}},computed:{},created:function(){this.getRoutes(),this.getOrgAll(),this.getRoleAll()},methods:{checkPermission:o["a"],handleFilter:function(){var e=this,t=this.rolesList.filter((function(t){return!e.search||t.name.toLowerCase().includes(e.search.toLowerCase())}));this.tableData=Object(s["b"])(t)},getRoutes:function(){var e=Object(i["a"])(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,Object(l["d"])();case 2:t=e.sent,this.routes=Object(s["b"])(t.data);case 4:case"end":return e.stop()}}),e,this)})));function t(){return e.apply(this,arguments)}return t}(),getOrgAll:function(){var e=Object(i["a"])(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,Object(c["c"])();case 2:t=e.sent,this.orgData=Object(s["b"])(t.data);case 4:case"end":return e.stop()}}),e,this)})));function t(){return e.apply(this,arguments)}return t}(),getRoleAll:function(){var e=Object(i["a"])(regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return this.listLoading=!0,e.next=3,Object(l["c"])();case 3:t=e.sent,this.tableData=t.data,this.rolesList=t.data,this.listLoading=!1;case 7:case"end":return e.stop()}}),e,this)})));function t(){return e.apply(this,arguments)}return t}(),handleAdd:function(){this.role=Object.assign({},u),this.$refs.tree&&this.$refs.tree.setCheckedNodes([]),this.dialogType="new",this.dialogVisible=!0},handleEdit:function(e){var t=this;this.dialogType="edit",this.dialogVisible=!0,this.role=Object(s["a"])(e.row),this.$nextTick((function(){t.$refs.tree.setCheckedKeys(t.role.perms),t.$refs.depts_tree.setCheckedKeys(t.role.depts)}))},handleDelete:function(e){var t=this,r=e.$index,n=e.row;this.$confirm("确认删除?","警告",{confirmButtonText:"确认",cancelButtonText:"取消",type:"warning"}).then(Object(i["a"])(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,Object(l["b"])(n.id);case 2:t.tableData.splice(r,1),t.$message.success("成功");case 4:case"end":return e.stop()}}),e)})))).catch((function(e){console.error(e)}))},confirmRole:function(){var e=Object(i["a"])(regeneratorRuntime.mark((function e(){var t,r,n;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(t="edit"===this.dialogType,this.role.perms=this.$refs.tree.getCheckedKeys(),"自定义"===this.role.datas?this.role.depts=this.$refs.depts_tree.getCheckedKeys():this.role.depts=[],!t){e.next=16;break}return e.next=6,Object(l["e"])(this.role.id,this.role);case 6:r=0;case 7:if(!(r<this.tableData.length)){e.next=14;break}if(this.tableData[r].id!==this.role.id){e.next=11;break}return this.tableData.splice(r,1,Object.assign({},this.role)),e.abrupt("break",14);case 11:r++,e.next=7;break;case 14:e.next=20;break;case 16:return this.role.perms=this.$refs.tree.getCheckedKeys(),e.next=19,Object(l["a"])(this.role);case 19:this.getRoleAll();case 20:n=this.role,n.description,n.name,this.dialogVisible=!1,this.$message.success("成功");case 23:case"end":return e.stop()}}),e,this)})));function t(){return e.apply(this,arguments)}return t}()}},h=d,f=(r("a0a9"),r("2877")),p=Object(f["a"])(h,n,a,!1,null,"12715922",null);t["default"]=p.exports}}]);