1 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-060a14dc"],{"38d5":function(t,e,a){"use strict";a.r(e);var s=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"app-container"},[a("el-tree",{attrs:{data:t.curData,"node-key":"id","default-expand-all":"","expand-on-click-node":!1},scopedSlots:t._u([{key:"default",fn:function(e){var s=e.node,i=e.data;return a("span",{staticClass:"custom-tree-node"},[a("span",[t._v(t._s(s.data.name)+" -- "+t._s(t.pTypeObj[s.data.perm_type])+" ----"+t._s(s.data.path)+" ---- -- "+t._s(t.mhObj[s.data.menu_hidden])+"/"+t._s(t.psObj[s.data.perm_status])+" ----"+t._s(s.data.sort))]),a("span",[a("el-button",{attrs:{type:"text",size:"mini"},on:{click:function(){return t.editMenu(i)}}},[t._v(" 编辑 ")]),a("el-button",{attrs:{type:"text",size:"mini"},on:{click:function(){return t.appendMenu(i)}}},[t._v(" 添加 ")]),a("el-button",{attrs:{type:"text",size:"mini"},on:{click:function(){return t.removeMenu(s,i)}}},[t._v(" 删除 ")])],1)])}}])}),a("popup-edit",{attrs:{isShow:t.isPopupShow,curObj:t.curObj,curType:t.curType},on:{close:t.closePopup}})],1)},i=[],r=a("5530"),n=a("2909"),o=(a("b64b"),a("e9c4"),a("d3b7"),a("159b"),a("b0c0"),a("99af"),a("ed08")),c=a("8147"),l=a("a430"),p=a("4fef"),u={name:"basePublicDictSys",components:{SearchForm:c["default"],PopupEdit:l["default"]},provide:function(){return{parentData:this}},mixins:[p["default"]],created:function(){},data:function(){var t=Object(o["a"])(this.$dictData.perm_type),e=Object(o["a"])(this.$dictData.show_hidden),a=Object(o["a"])(this.$dictData.perm_status);return{defaultProps:{children:"children",label:"name"},curData:[],isPopupShow:!1,curObj:{},curType:"",pTypeObj:t,mhObj:e,psObj:a}},mounted:function(){this.getMenu()},methods:{getMenu:function(){var t=this;this.$api.base.admpermissionslist().then((function(e){var a=e||[];t.curData=Object(n["a"])(t.formatData(a))}))},formatData:function(t,e){var a=this,s=[],i=JSON.parse(JSON.stringify(t));return i.forEach((function(t){var i=Object(r["a"])({},t);"2"===t.perm_type||t.perm_type,i.label=t.name,i.value=t.id,i.ids=e?[].concat(Object(n["a"])(e),[t.id]):[t.id],t.children&&t.children.length>0&&(i.children=a.formatData(t.children,i.ids)),i.children&&0===i.children.length&&delete i.children,s.push(i)})),s},editMenu:function(t){this.openPopup(t,"edit")},appendMenu:function(t){this.openPopup(t,"add")},removeMenu:function(t,e){var a=this,s="确定要删除吗?";this.$msg(s,"confirm",(function(){a.$api.base.admpermissionsdel({id:e.id}).then((function(t){a.$msgs("删除成功!"),a.getMenu()}))}),null,!0)},openPopup:function(t,e){this.curObj=t,this.curType=e,this.isPopupShow=!0},closePopup:function(t){this.isPopupShow=!1,t&&this.getMenu()}}},d=u,h=a("2877"),f=Object(h["a"])(d,s,i,!1,null,null,null);e["default"]=f.exports},"4fef":function(t,e,a){"use strict";a.r(e);var s=a("ade3"),i=a("5530");a("4e82"),a("e9c4"),a("a9e3");e["default"]={data:function(){return{listLoading:!1,tableData:[],currentPage:1,pageSize:10,totalRecords:1,listConfig:{},operations:[]}},created:function(){var t=this;this.$nextTick((function(){t.noCreated||t.fetchData()}))},methods:{searchHandle:function(t){this.currentPage=1,this.searchForm=t,this.fetchData()},sizeChange:function(t){this.pageSize=t,this.currentPage=1,this.fetchData()},pageHandle:function(t){this.currentPage=t,this.fetchData()},sortChange:function(t){this.currentPage=1;var e=Object(i["a"])({},this.searchForm);"ascending"===t.order?e.sort=JSON.stringify(Object(s["a"])({},t.prop,"asc")):e.sort=JSON.stringify(Object(s["a"])({},t.prop,"desc")),this.searchForm=Object(i["a"])({},e),this.fetchData(e)},fetchData:function(t){var e=this;if(this.apiStr){var a={page:this.currentPage,page_size:this.pageSize};t?a=Object(i["a"])(Object(i["a"])({},a),t):this.searchForm&&(a=Object(i["a"])(Object(i["a"])({},a),this.searchForm)),this.getDataBefore&&this.getDataBefore(a),this.listLoading=!0;var s=this.apiStr.split(".");this.$api[s[0]][s[1]](a).then((function(t){return 1===e.currentPage&&(e.pageSize=t.page_size||1),e.totalRecords=t.total?Number(t.total):0,e.tableData=t.list||[],e.listLoading=!1,e.getMoreData&&e.getMoreData(t,a),t})).catch((function(t){e.listLoading=!1}))}}}}},8147:function(t,e,a){"use strict";a.r(e);var s=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("header-collapse",[a("base-form",{ref:"ruleForm",attrs:{slot:"content",data:t.searchData},slot:"content"},[a("div",{attrs:{slot:"footer"},slot:"footer"},[a("el-button",{staticClass:"xl-form-btn bgc1",attrs:{loading:t.listLoading,icon:"el-icon-search"},on:{click:t.searchHandle}},[t._v("查询")]),a("el-button",{staticClass:"xl-form-btn t4",attrs:{loading:t.listLoading},on:{click:t.updateCash}},[t._v("更新缓存")])],1)])],1)},i=[],r=a("5530"),n={props:{listLoading:Boolean},inject:["parentData"],data:function(){return{searchData:[{label:"类型名称",key:"dict_name"},{label:"编号",key:"dict_type"}]}},methods:{searchHandle:function(){var t=this.$refs.ruleForm.baseForm,e=Object(r["a"])({},t);this.$emit("change",e)},updateCash:function(){var t=this;this.$store.dispatch("user/getDict").then().then((function(e){t.$msg("更新成功~")}))}}},o=n,c=a("2877"),l=Object(c["a"])(o,s,i,!1,null,null,null);e["default"]=l.exports},a430:function(t,e,a){"use strict";a.r(e);var s=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("el-dialog",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],attrs:{"show-close":!1,"close-on-click-modal":!1,visible:t.isShow,title:"edit"===this.curType?"编辑节点":"添加节点",fullscreen:!1,width:"470px","custom-class":"xl-dialog",center:""},on:{"update:visible":function(e){t.isShow=e}}},[a("base-form",{ref:"ruleForm",staticStyle:{width:"400px"},attrs:{data:t.formData,isInline:!1,labelWidth:"120px"}},[a("div",{attrs:{slot:"footer"},slot:"footer"},[a("el-button",{staticClass:"xl-form-btn t2",on:{click:t.close}},[t._v("关 闭")]),a("el-button",{staticClass:"xl-form-btn t1",on:{click:function(e){return t.close("confirm")}}},[t._v("确定")])],1)])],1)},i=[],r=a("5530"),n=(a("b64b"),a("e9c4"),a("b0c0"),a("4e82"),{props:{isShow:Boolean,curObj:Object,curType:String},inject:["parentData"],mixins:mixins,data:function(){return{formData:[],loading:!0}},watch:{isShow:function(t){if(t){var e={};if("edit"===this.curType){e=Object(r["a"])({},this.curObj);var a=JSON.parse(JSON.stringify(e.ids));e.ids&&e.ids.length>1&&(a.pop(),e.parentIdArr=a)}"add"===this.curType&&(e={parentName:this.curObj.name,perm_status:"1",perm_type:"2",menu_hidden:"1",parentIdArr:this.curObj.ids}),this.getDef(e)}}},methods:{typeChange:function(){var t=Object(r["a"])({},this.$refs.ruleForm.baseForm);this.getDef(t)},getDef:function(t){var e=Object(r["a"])({},t);e.method||(e.method="POST"),t.perm_type&&"1"===t.perm_type?this.formData=[{label:"上级节点",key:"parentIdArr",type:"cascader",options:this.parentData.curData,props:{checkStrictly:!0}},{label:"节点类型",key:"perm_type",type:"select",options:this.$dictData.perm_type,rules:1,changeHandle:this.typeChange},{label:"目录名称",key:"name",rules:1},{label:"目录路径",key:"path",rules:1},{label:"目录排序",key:"sort"},{label:"状态",key:"perm_status",type:"select",clearable:!1,options:this.$dictData.perm_status}]:t.perm_type&&"2"===t.perm_type?this.formData=[{label:"上级节点",key:"parentIdArr",type:"cascader",options:this.parentData.curData,props:{checkStrictly:!0}},{label:"节点类型",key:"perm_type",type:"select",options:this.$dictData.perm_type,rules:1,changeHandle:this.typeChange},{label:"菜单名称",key:"name",rules:1},{label:"菜单路径",key:"path",rules:1},{label:"菜单排序",key:"sort"},{label:"菜单栏",key:"menu_hidden",type:"select",clearable:!1,options:this.$dictData.show_hidden},{label:"状态",key:"perm_status",type:"select",clearable:!1,options:this.$dictData.perm_status}]:this.formData=[{label:"上级节点",key:"parentIdArr",type:"cascader",options:this.parentData.curData,props:{checkStrictly:!0}},{label:"节点类型",key:"perm_type",type:"select",options:this.$dictData.perm_type,rules:1,changeHandle:this.typeChange},{label:"接口名称",key:"name",rules:1},{label:"接口路径",key:"route",rules:1},{label:"提交方式",key:"method",rules:1},{label:"状态",key:"perm_status",type:"select",clearable:!1,options:this.$dictData.perm_status}],this.setDefaultValue(e)},close:function(t){var e=this;"confirm"===t?this.$refs["ruleForm"].$refs["baseForm"].validate((function(t){if(t){var a=e.$refs.ruleForm.baseForm,s=Object(r["a"])({},a),i="admpermissionsadd";s.p_id=s.parentIdArr[s.parentIdArr.length-1],delete s.parentIdArr,s.sort||delete s.sort,"edit"===e.curType&&(s.id=e.curObj.id,i="admpermissionsedit"),e.$api.base[i](s).then((function(t){e.$msgs("保存成功!"),e.$emit("close",s)}))}})):(this.$emit("close"),this.setDefaultValue())}}}),o=n,c=a("2877"),l=Object(c["a"])(o,s,i,!1,null,null,null);e["default"]=l.exports}}]);
|