2 lines
12 KiB
JavaScript
2 lines
12 KiB
JavaScript
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-4e877659"],{"038f":function(e,t,a){"use strict";a.r(t);var l=function(){var e=this,t=e.$createElement,a=e._self._c||t;return"web"===e.value?a("web-menu",[a("el-select",{staticClass:"filter-item",attrs:{placeholder:e.$t("pSelect")},model:{value:e.value,callback:function(t){e.value=t},expression:"value"}},e._l(e.options,(function(e){return a("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1)],1):a("app-menu",[a("el-select",{staticClass:"filter-item",attrs:{placeholder:e.$t("pSelect")},model:{value:e.value,callback:function(t){e.value=t},expression:"value"}},e._l(e.options,(function(e){return a("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1)],1)},n=[],i=a("6221"),s=a("3439"),o={name:"Menu",components:{WebMenu:i["default"],AppMenu:s["default"]},data:function(){return{options:[{value:"web",label:"web菜单管理"},{value:"app",label:"app菜单管理"}],value:"web"}}},r=o,c=a("2877"),u=Object(c["a"])(r,l,n,!1,null,null,null);t["default"]=u.exports},3439:function(e,t,a){"use strict";a.r(t);var l=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"app-container"},[a("div",{staticClass:"decorate"}),a("div",{staticClass:"filter-container"},[e._t("default"),a("div",{staticClass:"btn-box"},[a("span",{staticClass:"btn-item long",on:{click:function(t){return e.handleCreate(0)}}},[a("i",{staticClass:"iconfont icon-a-"}),e._v(e._s(e.$t("menu.addToplevel")))]),a("span",{staticClass:"btn-item long",on:{click:function(t){return e.handleCreate(1)}}},[a("i",{staticClass:"iconfont icon-a-"}),e._v(e._s(e.$t("menu.addChild")))])])],2),a("div",{staticClass:"table-container"},[a("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}},[a("el-table-column",{attrs:{prop:"permissionName",align:"left",label:e.$t("menu.permissionName")}}),a("el-table-column",{attrs:{label:e.$t("menu.permissionType"),align:"center"},scopedSlots:e._u([{key:"default",fn:function(t){return[0===t.row.permissionType?a("span",[e._v(e._s(e.$t("permissionType.list")))]):e._e(),1===t.row.permissionType?a("span",[e._v(e._s(e.$t("permissionType.menu")))]):e._e(),2===t.row.permissionType?a("span",[e._v(e._s(e.$t("permissionType.button")))]):e._e(),3===t.row.permissionType?a("span",[e._v(e._s(e.$t("permissionType.joggle")))]):e._e()]}}])}),a("el-table-column",{attrs:{prop:"title",align:"left",label:e.$t("menu.permissionNameEn")}}),a("el-table-column",{attrs:{prop:"path",align:"left",label:e.$t("menu.path")}}),a("el-table-column",{attrs:{prop:"component",align:"left",label:e.$t("menu.component")}}),a("el-table-column",{attrs:{prop:"icon",align:"left",label:e.$t("menu.icon"),width:"120"}}),a("el-table-column",{attrs:{prop:"buttonCode",align:"left",label:e.$t("menu.buttonCode")}}),a("el-table-column",{attrs:{prop:"",label:e.$t("menu.alwaysShow"),align:"center",width:"100"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("span",{staticClass:"btn",class:{red:1!==t.row.alwaysShow}},[e._v(" "+e._s(e._f("showStatusFilter")(t.row.alwaysShow,e.that)))])]}}])}),a("el-table-column",{attrs:{prop:"",label:e.$t("menu.noCache"),align:"center",width:"100"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("span",{staticClass:"btn",class:{red:1!==t.row.noCache}},[e._v(e._s(e._f("cacheStatusFilter")(t.row.noCache,e.that)))])]}}])}),a("el-table-column",{attrs:{align:"center",width:"230",label:e.$t("table.operate")},scopedSlots:e._u([{key:"default",fn:function(t){return[a("span",{staticClass:"btnCancel",attrs:{title:e.$t("table.operate")},on:{click:function(a){return e.handleUpdate(t)}}},[a("i",{staticClass:"iconfont icon-bianji"}),e._v(e._s(e.$t("table.operate")))]),a("span",{staticClass:"btnCancel delete",attrs:{title:e.$t("table.delete")},on:{click:function(a){return e.handleDelete(t)}}},[a("i",{staticClass:"iconfont icon-a--"}),e._v(e._s(e.$t("table.delete")))])]}}])})],1)],1),a("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}}},[a("el-scrollbar",{staticStyle:{height:"100%"},attrs:{vertical:!0}},[a("el-form",{ref:"form",staticStyle:{"margin-left":"30px"},attrs:{rules:e.rules,model:e.form,inline:"","label-width":"140px"}},["create"===e.dialogStatus?a("el-form-item",{attrs:{label:e.$t("menu.route")}},[a("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 a("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1)],1):e._e(),a("el-form-item",{attrs:{label:e.$t("menu.alwaysShow")}},[a("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 a("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1)],1),a("el-form-item",{attrs:{label:e.$t("menu.code")}},[a("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),a("el-form-item",{attrs:{label:e.$t("menu.component")}},[a("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),a("el-form-item",{attrs:{label:e.$t("menu.icon")}},[a("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),a("el-form-item",{attrs:{label:e.$t("menu.noCache")}},[a("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 a("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1)],1),a("el-form-item",{attrs:{label:e.$t("menu.path")}},[a("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),a("el-form-item",{attrs:{label:e.$t("menu.permissionType")}},[a("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 a("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})})),1)],1),a("el-form-item",{attrs:{label:e.$t("menu.permissionNameEn"),prop:"title"}},[a("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),a("el-form-item",{attrs:{label:e.$t("menu.permissionName"),prop:"permissionName"}},[a("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),a("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("span",{staticClass:"btn-item",on:{click:function(t){e.addDialog=!1}}},[e._v(e._s(e.$t("btn.cancel")))]),a("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)},n=[],i=a("1f27"),s=a("4381"),o={directives:{permission:s["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(i["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(i["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(i["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(i["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}}},r=o,c=(a("8843"),a("2877")),u=Object(c["a"])(r,l,n,!1,null,"f7da74f0",null);t["default"]=u.exports},8843:function(e,t,a){"use strict";a("e133")},e133:function(e,t,a){}}]);
|
|
//# sourceMappingURL=chunk-4e877659.8488e3e2.js.map
|