2 lines
17 KiB
JavaScript
2 lines
17 KiB
JavaScript
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-79a19055"],{1276:function(e,t,n){"use strict";var i=n("2ba4"),s=n("c65b"),o=n("e330"),a=n("d784"),r=n("44e7"),l=n("825a"),c=n("1d80"),u=n("4840"),p=n("8aa5"),m=n("50c4"),d=n("577e"),h=n("dc4a"),f=n("4dae"),b=n("14c3"),g=n("9263"),v=n("9f7f"),w=n("d039"),$=v.UNSUPPORTED_Y,y=4294967295,C=Math.min,S=[].push,x=o(/./.exec),_=o(S),k=o("".slice),T=!w((function(){var e=/(?:)/,t=e.exec;e.exec=function(){return t.apply(this,arguments)};var n="ab".split(e);return 2!==n.length||"a"!==n[0]||"b"!==n[1]}));a("split",(function(e,t,n){var o;return o="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length?function(e,n){var o=d(c(this)),a=void 0===n?y:n>>>0;if(0===a)return[];if(void 0===e)return[o];if(!r(e))return s(t,o,e,a);var l,u,p,m=[],h=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),b=0,v=new RegExp(e.source,h+"g");while(l=s(g,v,o)){if(u=v.lastIndex,u>b&&(_(m,k(o,b,l.index)),l.length>1&&l.index<o.length&&i(S,m,f(l,1)),p=l[0].length,b=u,m.length>=a))break;v.lastIndex===l.index&&v.lastIndex++}return b===o.length?!p&&x(v,"")||_(m,""):_(m,k(o,b)),m.length>a?f(m,0,a):m}:"0".split(void 0,0).length?function(e,n){return void 0===e&&0===n?[]:s(t,this,e,n)}:t,[function(t,n){var i=c(this),a=void 0==t?void 0:h(t,e);return a?s(a,t,i,n):s(o,d(i),t,n)},function(e,i){var s=l(this),a=d(e),r=n(o,s,a,i,o!==t);if(r.done)return r.value;var c=u(s,RegExp),h=s.unicode,f=(s.ignoreCase?"i":"")+(s.multiline?"m":"")+(s.unicode?"u":"")+($?"g":"y"),g=new c($?"^(?:"+s.source+")":s,f),v=void 0===i?y:i>>>0;if(0===v)return[];if(0===a.length)return null===b(g,a)?[a]:[];var w=0,S=0,x=[];while(S<a.length){g.lastIndex=$?0:S;var T,P=b(g,$?k(a,S):a);if(null===P||(T=C(m(g.lastIndex+($?S:0)),a.length))===w)S=p(a,S,h);else{if(_(x,k(a,w,S)),x.length===v)return x;for(var D=1;D<=P.length-1;D++)if(_(x,P[D]),x.length===v)return x;S=w=T}}return _(x,k(a,w)),x}]}),!T,$)},"1f27":function(e,t,n){"use strict";n.d(t,"h",(function(){return a})),n.d(t,"f",(function(){return r})),n.d(t,"b",(function(){return l})),n.d(t,"d",(function(){return c})),n.d(t,"g",(function(){return u})),n.d(t,"e",(function(){return p})),n.d(t,"a",(function(){return m})),n.d(t,"c",(function(){return d}));n("e9c4");var i=n("b775"),s=n("4328"),o=n.n(s);function a(){return Object(i["a"])({url:"user-service/permission/getDeptPermissionTree",method:"get"})}function r(e){var t=JSON.stringify(e);return Object(i["a"])({headers:{"Content-Type":"application/json"},url:"user-service/permission/updatePermission",method:"post",data:t})}function l(e){var t=JSON.stringify(e);return Object(i["a"])({headers:{"Content-Type":"application/json"},url:"user-service/permission/savePermission",method:"post",data:t})}function c(e){var t={permissionIds:e};return Object(i["a"])({url:"user-service/permission/removePermission",method:"get",params:t})}function u(){return Object(i["a"])({url:"user-service/appPermission/getAppDeptPermissionTree",method:"get"})}function p(e){var t=o.a.stringify(e);return Object(i["a"])({url:"user-service/appPermission/updatePermission",method:"post",data:t})}function m(e){var t=o.a.stringify(e);return Object(i["a"])({url:"user-service/appPermission/savePermission",method:"post",data:t})}function d(e){var t={permissionIds:e};return Object(i["a"])({headers:{"Content-Type":"application/json"},url:"user-service/appPermission/removePermission",method:"get",params:t})}},"2a07":function(e,t,n){"use strict";n("ccc9")},4381:function(e,t,n){"use strict";n("d3b7"),n("caad"),n("2532"),n("d9e2");var i=n("4360"),s={inserted:function(e,t){var n=t.value,s=i["a"].getters&&i["a"].getters.butPermission;if(console.log(s,"roles"),!(n&&n instanceof Array&&n.length>0))throw new Error("need roles! Like v-permission=\"['admin','editor']\"");var o=n,a=s.some((function(e){return o.includes(e)}));if(console.log(a,"hasPermission"),a)i["a"].state.user.permissionFlag[o]=!1;else{i["a"].state.user.permissionFlag[o]=!0,console.log(i["a"].state.user.permissionFlag[o],"permissionRoles");var r=document.createElement("div");r.style.cursor="not-allowed",r.style.display="inline-block",e.style.pointerEvents="none",e.parentNode.insertBefore(r,e),e.parentNode&&e.parentNode.removeChild(e),r.appendChild(e),console.log(e,"permissionRoles")}}},o=function(e){e.directive("permission",s)};window.Vue&&(window["permission"]=s,Vue.use(o)),s.install=o;t["a"]=s},6221: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("div",{staticClass:"app-container"},[n("div",{staticClass:"decorate"}),n("div",{staticClass:"filter-container"},[e._t("default"),n("div",{staticClass:"btn-box"},[n("span",{staticClass:"btn-item long",on:{click:function(t){return e.handleCreate(0)}}},[n("i",{staticClass:"iconfont icon-a-"}),e._v(e._s(e.$t("menu.addToplevel")))]),n("span",{staticClass:"btn-item long",on:{click:function(t){return e.handleCreate(1)}}},[n("i",{staticClass:"iconfont icon-a-"}),e._v(e._s(e.$t("menu.addChild")))])])],2),n("div",{staticClass:"table-container"},[n("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.listLoading,expression:"listLoading"}],attrs:{"default-expand-all":!1,data:e.data,"row-key":"permissionId","header-row-class-name":"table-header","row-class-name":"table-row","highlight-current-row":"","max-height":"680","tree-props":{children:"children",hasChildren:"hasChildren"}},on:{"current-change":e.handleCurrentChange}},[n("el-table-column",{attrs:{prop:"permissionName",align:"left",label:e.$t("menu.permissionName")}}),n("el-table-column",{attrs:{label:e.$t("menu.permissionType"),align:"center"},scopedSlots:e._u([{key:"default",fn:function(t){return[0===t.row.permissionType?n("span",[e._v(e._s(e.$t("permissionType.list")))]):e._e(),1===t.row.permissionType?n("span",[e._v(e._s(e.$t("permissionType.menu")))]):e._e(),2===t.row.permissionType?n("span",[e._v(e._s(e.$t("permissionType.button")))]):e._e()]}}])}),n("el-table-column",{attrs:{prop:"title",align:"left",label:e.$t("menu.permissionNameEn")}}),n("el-table-column",{attrs:{prop:"path",align:"left",label:e.$t("menu.path"),"show-overflow-tooltip":""}}),n("el-table-column",{attrs:{prop:"component",align:"left",label:e.$t("menu.component")}}),n("el-table-column",{attrs:{prop:"icon",align:"left",label:e.$t("menu.icon"),width:"120"}}),n("el-table-column",{attrs:{prop:"buttonCode",align:"left",label:e.$t("menu.buttonCode")}}),n("el-table-column",{attrs:{prop:"",label:e.$t("menu.alwaysShow"),align:"center",width:"100"},scopedSlots:e._u([{key:"default",fn:function(t){return[n("span",{staticClass:"btn",class:{red:1!==t.row.alwaysShow}},[e._v(" "+e._s(e._f("showStatusFilter")(t.row.alwaysShow,e.that)))])]}}])}),n("el-table-column",{attrs:{prop:"",label:e.$t("menu.noCache"),align:"center",width:"100"},scopedSlots:e._u([{key:"default",fn:function(t){return[n("span",{staticClass:"btn",class:{red:1!==t.row.noCache}},[e._v(e._s(e._f("cacheStatusFilter")(t.row.noCache,e.that)))])]}}])}),n("el-table-column",{attrs:{align:"left",width:"230",label:e.$t("table.operate")},scopedSlots:e._u([{key:"default",fn:function(t){return[n("span",{staticClass:"btnCancel",attrs:{title:e.$t("table.update")},on:{click:function(n){return e.handleUpdate(t)}}},[n("i",{staticClass:"iconfont icon-bianji"}),e._v(e._s(e.$t("table.update")))]),n("span",{staticClass:"btnCancel delete",attrs:{title:e.$t("table.delete")},on:{click:function(n){return e.handleDelete(t)}}},[n("i",{staticClass:"iconfont icon-a--"}),e._v(e._s(e.$t("table.delete")))])]}}])})],1),n("el-dialog",{attrs:{"close-on-click-modal":!1,title:e.textMap[e.dialogStatus],top:"10vh",visible:e.addDialog},on:{"update:visible":function(t){e.addDialog=t}}},[n("el-scrollbar",{staticStyle:{height:"100%"},attrs:{vertical:!0}},[n("el-form",{ref:"form",staticStyle:{"margin-left":"30px"},attrs:{rules:e.rules,model:e.form,inline:"","label-width":"140px"}},["create"===e.dialogStatus?n("el-form-item",{attrs:{label:e.$t("menu.route")}},[n("el-select",{attrs:{disabled:"",placeholder:e.$t("pSelect")},model:{value:e.form.permissionPid,callback:function(t){e.$set(e.form,"permissionPid",t)},expression:"form.permissionPid"}},e._l(e.permissionPidBox,(function(e){return n("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1)],1):e._e(),n("el-form-item",{attrs:{label:e.$t("menu.alwaysShow")}},[n("el-select",{attrs:{placeholder:e.$t("pSelect")},model:{value:e.form.alwaysShow,callback:function(t){e.$set(e.form,"alwaysShow",t)},expression:"form.alwaysShow"}},e._l(e.alwaysShowBox,(function(e){return n("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1)],1),2==e.form.permissionType?n("el-form-item",{attrs:{label:e.$t("menu.code")}},[n("el-input",{attrs:{placeholder:e.$t("pEnter")+e.$t("menu.code")},model:{value:e.form.buttonCode,callback:function(t){e.$set(e.form,"buttonCode",t)},expression:"form.buttonCode"}})],1):e._e(),2!==e.form.permissionType?n("el-form-item",{attrs:{label:e.$t("menu.component")}},[n("el-input",{attrs:{placeholder:e.$t("pEnter")+e.$t("menu.component")},model:{value:e.form.component,callback:function(t){e.$set(e.form,"component",t)},expression:"form.component"}})],1):e._e(),2!==e.form.permissionType?n("el-form-item",{attrs:{label:e.$t("menu.icon")}},[n("el-input",{attrs:{placeholder:e.$t("pEnter")+e.$t("menu.icon")},model:{value:e.form.icon,callback:function(t){e.$set(e.form,"icon",t)},expression:"form.icon"}})],1):e._e(),n("el-form-item",{attrs:{label:e.$t("menu.noCache")}},[n("el-select",{attrs:{placeholder:e.$t("pSelect")},model:{value:e.form.noCache,callback:function(t){e.$set(e.form,"noCache",t)},expression:"form.noCache"}},e._l(e.noCacheBox,(function(e){return n("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1)],1),n("el-form-item",{attrs:{label:e.$t("menu.path")}},[n("el-input",{attrs:{placeholder:e.$t("pEnter")+e.$t("menu.path")},model:{value:e.form.path,callback:function(t){e.$set(e.form,"path",t)},expression:"form.path"}})],1),n("el-form-item",{attrs:{label:e.$t("menu.permissionType")}},[n("el-select",{attrs:{placeholder:e.$t("pSelect")},model:{value:e.form.permissionType,callback:function(t){e.$set(e.form,"permissionType",t)},expression:"form.permissionType"}},e._l(e.permissionTypeBox,(function(e){return n("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1)],1),n("el-form-item",{attrs:{label:e.$t("menu.permissionNameEn"),prop:"title"}},[n("el-input",{attrs:{placeholder:e.$t("pEnter")+e.$t("menu.permissionNameEn")},model:{value:e.form.title,callback:function(t){e.$set(e.form,"title",t)},expression:"form.title"}})],1),n("el-form-item",{attrs:{label:e.$t("menu.permissionName"),prop:"permissionName"}},[n("el-input",{attrs:{placeholder:e.$t("pEnter")+e.$t("menu.permissionName")},model:{value:e.form.permissionName,callback:function(t){e.$set(e.form,"permissionName",t)},expression:"form.permissionName"}})],1),n("el-form-item",{attrs:{label:e.$t("menu.sort"),prop:"sort"}},[n("el-input",{attrs:{placeholder:e.$t("pEnter")+e.$t("menu.sort")},model:{value:e.form.sort,callback:function(t){e.$set(e.form,"sort",t)},expression:"form.sort"}})],1)],1)],1),n("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[n("span",{staticClass:"btn-item long",on:{click:function(t){e.addDialog=!1}}},[e._v(e._s(e.$t("btn.cancel")))]),n("span",{staticClass:"btn-item long",on:{click:function(t){"create"===e.dialogStatus?e.createData():e.updateData()}}},[e._v(e._s(e.$t("btn.save")))])])],1)],1)])},s=[],o=(n("d81d"),n("e9c4"),n("4e82"),n("ac1f"),n("1276"),n("1f27")),a=n("4381"),r={directives:{permission:a["a"]},filters:{showStatusFilter:function(e,t){return 0===e?t.$t("type.no"):t.$t("type.yes")},cacheStatusFilter:function(e,t){return 0===e?t.$t("type.noCache"):t.$t("type.cache")}},data:function(){return{that:this,createStatus:!1,listLoading:!1,permissionPidBox:[{value:1,label:this.$t("type.fu")},{value:0,label:this.$t("type.zi")}],alwaysShowBox:[{value:1,label:this.$t("type.yes")},{value:0,label:this.$t("type.no")}],noCacheBox:[{value:1,label:this.$t("type.cache")},{value:0,label:this.$t("type.noCache")}],permissionTypeBox:[{value:0,label:this.$t("permissionType.list")},{value:1,label:this.$t("permissionType.menu")},{value:2,label:this.$t("permissionType.button")}],textMap:{update:this.$t("table.update"),create:this.$t("table.create")},dialogStatus:"",rules:{title:[{required:!0,message:this.$t("pEnter")+this.$t("menu.nameKey"),trigger:"blur"}],permissionName:[{required:!0,message:this.$t("pEnter")+this.$t("menu.permissionName"),trigger:"blur"}]},form:{alwaysShow:"",buttonCode:"",component:"",icon:"",noCache:"",path:"",sort:"",permissionType:"",title:"",titleCh:"",permissionId:"",permissionName:"",permissionPid:""},addDialog:!1,currentRow:null,data:[],allData:[]}},created:function(){this.getList()},methods:{isShow:function(e){return e.children.length>0&&(e.isShow=!0,e.children&&e.children.map(this.isShow)),e},getList:function(){var e=this;this.listLoading=!0,Object(o["h"])().then((function(t){e.listLoading=!1,console.log(t),e.total=t.data.totalRow||1,e.data=t.data.map(e.isShow),e.allData=JSON.stringify(e.data)}))},handleUpdate:function(e){var t=this;this.form={alwaysShow:e.row.alwaysShow,buttonCode:e.row.buttonCode,component:e.row.component,icon:e.row.icon,noCache:e.row.noCache,path:e.row.path,sort:e.row.sort,permissionType:e.row.permissionType,title:e.row.title,titleCh:e.row.titleCh,permissionId:e.row.permissionId,permissionName:e.row.permissionName,permissionPid:e.row.permissionPid},this.dialogStatus="update",this.addDialog=!0,this.$nextTick((function(){t.$refs["form"].clearValidate()}))},updateData:function(){var e=this;this.$refs.form.validate((function(t){t&&(console.log(111,e.form),Object(o["f"])(e.form).then((function(t){200==t.status&&(e.$notify({title:e.$t("title.success"),message:e.$t("title.updateSuccess"),type:"success",duration:3e3}),e.getList(),e.addDialog=!1)})))}))},resetForm:function(){for(var e in this.form)this.form[e]=null;this.form.alwaysShow=0,this.form.noCache=1,this.form.permissionType=0,this.form.permissionPid=0},handleCreate:function(e){var t=this;0===e?(this.resetForm(),this.addDialog=!0,this.dialogStatus="create",this.form.permissionPid=1,this.$nextTick((function(){t.$refs["form"].clearValidate()}))):this.currentRow?(this.resetForm(),this.addDialog=!0,this.dialogStatus="create",this.form.permissionPid=0,this.$nextTick((function(){t.$refs["form"].clearValidate()}))):this.$notify({title:this.$t("title.pointOut"),message:this.$t("pSelect")+this.$t("menu.oneData"),type:"warning",duration:3e3})},createData:function(){var e=this;this.createStatus||this.$refs.form.validate((function(t){t&&(e.createStatus=!0,1===e.form.permissionPid?e.form.permissionPid=0:e.form.permissionPid=e.currentRow.permissionId,Object(o["b"])(e.form).then((function(t){200==t.status&&(e.createStatus=!1,e.$notify({title:e.$t("title.success"),message:e.$t("table.create")+e.$t("title.success"),type:"success",duration:3e3}),e.currentRow=null,e.getList(),e.addDialog=!1)})).catch((function(){e.createStatus=!1})))}))},handleDelete:function(e){var t=this;this.$confirm(this.$t("title.delPointOut"),this.$t("title.pointOut"),{confirmButtonText:this.$t("title.delete"),cancelButtonText:this.$t("title.cancel"),type:"warning"}).then((function(){console.log(111,e.row.permissionId),Object(o["d"])(e.row.permissionId).then((function(e){200==e.status&&(t.$notify({title:t.$t("title.success"),message:t.$t("title.deleteSuccess"),type:"success",duration:3e3}),t.currentRow=null,t.getList(),t.addDialog=!1)}))}))},handleCurrentChange:function(e){this.currentRow=e||null},handleShow:function(e){var t=e.row,n=t._id.split("-"),i=JSON.parse(this.allData);if(console.log(e,n),n.length<=1){var s=i[parseInt(t._id)].children;t.isShow?(e.row.children=[],e.row.isShow=!1):(e.row.children=s,e.row.isShow=!0)}else if(n.length<=2){var o=i[parseInt(n[0])].children[parseInt(n[1])].children;t.isShow?(e.row.children=[],e.row.isShow=!1):(e.row.children=o,e.row.isShow=!0)}else if(n.length<=3){var a=i[parseInt(n[0])].children[parseInt(n[1])].children[parseInt(n[2])].children;t.isShow?(e.row.children=[],e.row.isShow=!1):(e.row.children=a,e.row.isShow=!0)}}}},l=r,c=(n("2a07"),n("2877")),u=Object(c["a"])(l,i,s,!1,null,"a961c1e0",null);t["default"]=u.exports},ccc9:function(e,t,n){},e9c4:function(e,t,n){var i=n("23e7"),s=n("da84"),o=n("d066"),a=n("2ba4"),r=n("e330"),l=n("d039"),c=s.Array,u=o("JSON","stringify"),p=r(/./.exec),m=r("".charAt),d=r("".charCodeAt),h=r("".replace),f=r(1..toString),b=/[\uD800-\uDFFF]/g,g=/^[\uD800-\uDBFF]$/,v=/^[\uDC00-\uDFFF]$/,w=function(e,t,n){var i=m(n,t-1),s=m(n,t+1);return p(g,e)&&!p(v,s)||p(v,e)&&!p(g,i)?"\\u"+f(d(e,0),16):e},$=l((function(){return'"\\udf06\\ud834"'!==u("\udf06\ud834")||'"\\udead"'!==u("\udead")}));u&&i({target:"JSON",stat:!0,forced:$},{stringify:function(e,t,n){for(var i=0,s=arguments.length,o=c(s);i<s;i++)o[i]=arguments[i];var r=a(u,null,o);return"string"==typeof r?h(r,b,w):r}})}}]);
|
|
//# sourceMappingURL=chunk-79a19055.9bbb45d9.js.map
|