2 lines
14 KiB
JavaScript
2 lines
14 KiB
JavaScript
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-259f2063"],{"1f27":function(e,t,n){"use strict";n.d(t,"h",(function(){return o})),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 m})),n.d(t,"a",(function(){return p})),n.d(t,"c",(function(){return d}));n("e9c4");var i=n("b775"),s=n("4328"),a=n.n(s);function o(){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 m(e){var t=a.a.stringify(e);return Object(i["a"])({url:"user-service/appPermission/updatePermission",method:"post",data:t})}function p(e){var t=a.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})}},3439: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","max-height":"680","header-row-class-name":"table-header","row-class-name":"table-row","highlight-current-row":"","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(),3===t.row.permissionType?n("span",[e._v(e._s(e.$t("permissionType.joggle")))]):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")}}),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:"center",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.operate")},on:{click:function(n){return e.handleUpdate(t)}}},[n("i",{staticClass:"iconfont icon-bianji"}),e._v(e._s(e.$t("table.operate")))]),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)],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),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),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),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),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)],1)],1),n("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[n("span",{staticClass:"btn-item",on:{click:function(t){e.addDialog=!1}}},[e._v(e._s(e.$t("btn.cancel")))]),n("span",{staticClass:"btn-item",on:{click:function(t){"create"===e.dialogStatus?e.createData():e.updateData()}}},[e._v(e._s(e.$t("btn.save")))])])],1)],1)},s=[],a=n("1f27"),o=n("4381"),r={directives:{permission:o["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,listLoading:!1,createStatus:!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")},{value:3,label:this.$t("permissionType.joggle")}],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:"",permissionType:"",title:"",titleCh:"",permissionId:"",permissionName:"",permissionPid:""},addDialog:!1,currentRow:null,data:[]}},created:function(){this.getList()},methods:{getList:function(){var e=this;this.listLoading=!0,console.log("????"),Object(a["g"])().then((function(t){e.listLoading=!1,e.data=t.data,console.log(t)}))},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,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&&Object(a["e"])(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("title.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(a["a"])(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(){Object(a["c"])(e.row.permissionId).then((function(e){200==e.status&&(t.getList(),t.$notify({title:t.$t("title.success"),message:t.$t("title.deleteSuccess"),type:"success",duration:3e3}))}))}))},handleCurrentChange:function(e){console.log(e),this.currentRow=e||null}}},l=r,c=(n("8843"),n("2877")),u=Object(c["a"])(l,i,s,!1,null,"f7da74f0",null);t["default"]=u.exports},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 a=n,o=s.some((function(e){return a.includes(e)}));if(console.log(o,"hasPermission"),o)i["a"].state.user.permissionFlag[a]=!1;else{i["a"].state.user.permissionFlag[a]=!0,console.log(i["a"].state.user.permissionFlag[a],"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")}}},a=function(e){e.directive("permission",s)};window.Vue&&(window["permission"]=s,Vue.use(a)),s.install=a;t["a"]=s},8843:function(e,t,n){"use strict";n("e133")},e133:function(e,t,n){},e9c4:function(e,t,n){var i=n("23e7"),s=n("da84"),a=n("d066"),o=n("2ba4"),r=n("e330"),l=n("d039"),c=s.Array,u=a("JSON","stringify"),m=r(/./.exec),p=r("".charAt),d=r("".charCodeAt),f=r("".replace),h=r(1..toString),b=/[\uD800-\uDFFF]/g,$=/^[\uD800-\uDBFF]$/,v=/^[\uDC00-\uDFFF]$/,g=function(e,t,n){var i=p(n,t-1),s=p(n,t+1);return m($,e)&&!m(v,s)||m(v,e)&&!m($,i)?"\\u"+h(d(e,0),16):e},y=l((function(){return'"\\udf06\\ud834"'!==u("\udf06\ud834")||'"\\udead"'!==u("\udead")}));u&&i({target:"JSON",stat:!0,forced:y},{stringify:function(e,t,n){for(var i=0,s=arguments.length,a=c(s);i<s;i++)a[i]=arguments[i];var r=o(u,null,a);return"string"==typeof r?f(r,b,g):r}})}}]);
|
|
//# sourceMappingURL=chunk-259f2063.59c8a86f.js.map
|