2 lines
11 KiB
JavaScript
2 lines
11 KiB
JavaScript
webpackJsonp([23],{"85Kt":function(t,e){},V74S:function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=a("mvHQ"),l=a.n(i),o={data:function(){return{queryInfo:{dictValue:"",pageNum:1,pageSize:10},dataDictList:[],managerDataDictList:[],dictOptions:[],editForm:{},operatorPerson:JSON.parse(localStorage.getItem("userInfo")).nick,addSubDataDictDefaultFatherId:"",currpage:1,total:0,addDialogVisible:!1,editDialogVisible:!1,managerDialogVisible:!1,addForm:{dictValue:"",comments:""},addFormRules:{dictCode:[{required:!0,message:"请输入字典值",trigger:"blur"},{min:1,max:20,message:"长度在 1 到 20 个字符",trigger:"blur"}],subDictCode:[{required:!1,message:"请输入字典值",trigger:"blur"},{min:1,max:20,message:"长度在 1 到 20 个字符",trigger:"blur"}],dictValue:[{required:!0,message:"请输入字典名称",trigger:"blur"},{min:1,max:50,message:"长度在 1 到 50 个字符",trigger:"blur"}],comments:[{required:!1,message:"请输入密码",trigger:"blur"},{min:0,max:200,message:"长度在 0 到 200 个字符",trigger:"blur"}]},managerFormRules:{}}},mounted:function(){},created:function(){this.getDataDictList()},methods:{selectDataDictList:function(){this.queryInfo.pageNum=1,this.total=0,this.getDataDictList()},getDataDictList:function(){var t=this;this.loading=!0,this.$api.dict.queryAllFatherDataDict(l()(this.queryInfo)).then(function(e){t.loading=!1,t.dataDictList=e.data.data,t.total=e.data.count,t.queryInfo.pageNum=1}).catch(function(){t.loading=!1})},addSubDataDict:function(){var t={fatherId:this.addSubDataDictDefaultFatherId};this.managerDataDictList.push(t)},updateSubDataDict:function(){var t=this;if(this.managerDataDictList.length<=0)this.$notify({type:"warning",message:"至少添加一个字典"});else{var e=!1;document.querySelectorAll(".manager-dictName-input .el-input__inner").forEach(function(t){""==t.value?(t.style.border="1px solid red",e=!0):(t.style.border="1px solid #DCDFE6",e=!1)}),e||this.$api.dict.updateSubDataDict(l()(this.managerDataDictList)).then(function(e){t.$notify({type:"success",message:e.data.msg}),t.managerDialogClose(),t.getDataDictList()}).catch(function(){})}},delSubDataDict:function(t){this.managerDataDictList.splice(t.$index,1)},managerDialogClose:function(){this.managerDialogVisible=!1},showManagerDialog:function(t){var e=this;this.addSubDataDictDefaultFatherId=t.dictCode,this.managerDialogVisible=!0,this.$api.dict.queryAllSubDataDictByFatherId(t.dictCode).then(function(t){e.loading=!1,e.managerDataDictList=t.data.data}).catch(function(){e.loading=!1})},editDialogClose:function(){this.editDialogVisible=!1,this.$refs.editFormRef.resetFields()},showEditDialog:function(t){var e=this;this.editDialogVisible=!0,this.$api.dict.queryFatherDataDictById(t.id).then(function(t){e.loading=!1,e.editForm=t.data.data}).catch(function(){e.loading=!1})},editDataDict:function(){var t=this;this.$refs.editFormRef.validate(function(e){e&&t.$api.dict.updateFatherDataDict(l()(t.editForm)).then(function(e){t.$notify({message:e.data.msg,type:"success"}),t.editDialogVisible=!1,t.getDataDictList()}).catch(function(){t.loading=!1})})},addDialogClose:function(){this.$refs.addFormRef.resetFields()},addDataDict:function(){var t=this;this.$refs.addFormRef.validate(function(e){e&&t.$api.dict.addFatherDataDict(l()(t.addForm)).then(function(e){t.$notify({message:e.data.msg,type:"success"}),t.addDialogVisible=!1,t.getDataDictList()}).catch(function(){t.loading=!1})})},delDataDict:function(t){var e=this;this.$confirm("确定删除该字典吗?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(function(){e.$api.dict.deleteFatherDataDictByDictCode(t.dictCode).then(function(t){e.$notify({message:t.data.msg,type:"success"}),e.getDataDictList()}).catch(function(){e.loading=!1})}).catch(function(){})},handleSizeChange:function(t){this.queryInfo.pageSize=t,this.getDataDictList()},handleCurrentChange:function(t){this.queryInfo.pageNum=t,this.getDataDictList()}}},n={render:function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"dict-box"},[a("el-form",{staticClass:"dict-form-inline",attrs:{inline:!0}},[a("el-form-item",{attrs:{label:"字典名称"}},[a("el-input",{attrs:{type:"text",clearable:"",placeholder:"请输入字典名称"},model:{value:t.queryInfo.dictValue,callback:function(e){t.$set(t.queryInfo,"dictValue",e)},expression:"queryInfo.dictValue"}})],1),t._v(" "),a("el-form-item",[a("el-button",{attrs:{type:"primary"},on:{click:t.selectDataDictList}},[t._v("查询")])],1),t._v(" "),a("el-row",[a("el-col",{attrs:{span:2}},[a("el-form-item",[a("el-button",{attrs:{type:"primary"},on:{click:function(e){t.addDialogVisible=!0}}},[t._v("添加")])],1)],1)],1)],1),t._v(" "),a("el-table",{attrs:{data:t.dataDictList.slice((t.currpage-1)*t.queryInfo.pageSize,t.currpage*t.queryInfo.pageSize),border:"",fit:!0}},[a("el-table-column",{attrs:{label:"序号",type:"index",align:"center",width:"100"}}),t._v(" "),a("el-table-column",{attrs:{label:"字典名称",prop:"dictValue"}}),t._v(" "),t._e(),t._v(" "),t._e(),t._v(" "),a("el-table-column",{attrs:{label:"字典数量",prop:"dictNum"}}),t._v(" "),a("el-table-column",{attrs:{label:"创建时间",prop:"createTime"}}),t._v(" "),a("el-table-column",{attrs:{label:"更新时间",prop:"updateTime"}}),t._v(" "),a("el-table-column",{attrs:{label:"备注",prop:"comments","show-overflow-tooltip":""}}),t._v(" "),a("el-table-column",{attrs:{label:"操作",fixed:"right",width:"200",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("el-button",{attrs:{type:"text",size:"small"},on:{click:function(a){return t.showManagerDialog(e.row)}}},[t._v("管理")]),t._v(" "),a("el-button",{attrs:{type:"text",size:"small"},on:{click:function(a){return t.showEditDialog(e.row)}}},[t._v("编辑")]),t._v(" "),a("el-button",{attrs:{type:"text",size:"small"},on:{click:function(a){return t.delDataDict(e.row)}}},[t._v("删除")])]}}])})],1),t._v(" "),a("el-pagination",{attrs:{"current-page":t.currpage,"page-sizes":[5,10,20,30],"page-size":t.queryInfo.pageSize,layout:"prev, pager, next, sizes, total, jumper",total:t.total},on:{"size-change":t.handleSizeChange,"current-change":t.handleCurrentChange}}),t._v(" "),a("el-dialog",{attrs:{title:"添加",visible:t.addDialogVisible,"close-on-click-modal":!1,width:"30%"},on:{"update:visible":function(e){t.addDialogVisible=e},close:t.addDialogClose}},[a("el-form",{ref:"addFormRef",attrs:{model:t.addForm,rules:t.addFormRules,"label-width":"100px"}},[a("el-form-item",{attrs:{label:"字典值",prop:"dictCode"}},[a("el-input",{attrs:{placeholder:"请输入字典值"},model:{value:t.addForm.dictCode,callback:function(e){t.$set(t.addForm,"dictCode",e)},expression:"addForm.dictCode"}})],1),t._v(" "),a("el-form-item",{attrs:{label:"字典名称",prop:"dictValue"}},[a("el-input",{attrs:{placeholder:"请输入字典名称"},model:{value:t.addForm.dictValue,callback:function(e){t.$set(t.addForm,"dictValue",e)},expression:"addForm.dictValue"}})],1),t._v(" "),a("el-form-item",{attrs:{label:"备注",prop:"comments"}},[a("el-input",{attrs:{type:"textarea",placeholder:"请输入备注信息"},model:{value:t.addForm.comments,callback:function(e){t.$set(t.addForm,"comments",e)},expression:"addForm.comments"}})],1)],1),t._v(" "),a("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{on:{click:function(e){t.addDialogVisible=!1}}},[t._v("取 消")]),t._v(" "),a("el-button",{attrs:{type:"primary"},on:{click:t.addDataDict}},[t._v("确 定")])],1)],1),t._v(" "),a("el-dialog",{attrs:{title:"修改",visible:t.editDialogVisible,"close-on-click-modal":!1,width:"30%"},on:{"update:visible":function(e){t.editDialogVisible=e},close:t.editDialogClose}},[a("el-form",{ref:"editFormRef",attrs:{model:t.editForm,rules:t.addFormRules,"label-width":"100px"}},[a("el-form-item",{attrs:{label:"字典值",prop:"dictCode"}},[a("el-input",{attrs:{placeholder:"请输入字典值",disabled:""},model:{value:t.editForm.dictCode,callback:function(e){t.$set(t.editForm,"dictCode",e)},expression:"editForm.dictCode"}})],1),t._v(" "),a("el-form-item",{attrs:{label:"字典名称",prop:"dictValue"}},[a("el-input",{attrs:{placeholder:"请输入字典名称"},model:{value:t.editForm.dictValue,callback:function(e){t.$set(t.editForm,"dictValue",e)},expression:"editForm.dictValue"}})],1),t._v(" "),a("el-form-item",{attrs:{label:"备注",prop:"comments",placeholder:"请输入备注信息"}},[a("el-input",{attrs:{type:"textarea"},model:{value:t.editForm.comments,callback:function(e){t.$set(t.editForm,"comments",e)},expression:"editForm.comments"}})],1)],1),t._v(" "),a("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{on:{click:function(e){t.editDialogVisible=!1}}},[t._v("取 消")]),t._v(" "),a("el-button",{attrs:{type:"primary"},on:{click:t.editDataDict}},[t._v("确 定")])],1)],1),t._v(" "),a("el-dialog",{attrs:{title:"管理",visible:t.managerDialogVisible,"close-on-click-modal":!1,width:"50%"},on:{"update:visible":function(e){t.managerDialogVisible=e},close:t.managerDialogClose}},[a("el-row",[a("el-col",{attrs:{span:2}},[a("el-button",{attrs:{size:"mini",type:"primary"},on:{click:t.addSubDataDict}},[t._v("添加字典")])],1)],1),t._v(" "),a("el-table",{ref:"managerFormRef",attrs:{data:t.managerDataDictList,fit:!0,rules:t.addFormRules}},[a("el-table-column",{attrs:{label:"序号",type:"index",align:"center",width:"100"}}),t._v(" "),t._e(),t._v(" "),a("el-table-column",{attrs:{label:"字典值",prop:"subDictCode"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("el-input",{staticClass:"manager-dictCode-input",attrs:{placeholder:"请输入字典值"},model:{value:e.row.dictCode,callback:function(a){t.$set(e.row,"dictCode",a)},expression:"scope.row.dictCode"}})]}}],null,!1,3844381911)}),t._v(" "),a("el-table-column",{attrs:{label:"字典名称",width:"180"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("el-input",{staticClass:"manager-dictName-input",attrs:{placeholder:"请输入字典名称"},model:{value:e.row.dictValue,callback:function(a){t.$set(e.row,"dictValue",a)},expression:"scope.row.dictValue"}})]}}])}),t._v(" "),t._e(),t._v(" "),a("el-table-column",{attrs:{label:"备注"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("el-input",{staticStyle:{width:"100%"},attrs:{placeholder:"请输入备注信息"},model:{value:e.row.comments,callback:function(a){t.$set(e.row,"comments",a)},expression:"scope.row.comments"}})]}}])}),t._v(" "),a("el-table-column",{attrs:{label:"操作",fixed:"right",width:"100",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("el-button",{staticClass:"dict-add-button",attrs:{type:"text",size:"small"},on:{click:t.addSubDataDict}},[t._v(" + ")]),t._v(" "),a("el-button",{staticClass:"dict-add-button",attrs:{type:"text",size:"small"},on:{click:function(a){return t.delSubDataDict(e)}}},[t._v(" - ")])]}}])})],1),t._v(" "),a("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{on:{click:t.managerDialogClose}},[t._v("取 消")]),t._v(" "),a("el-button",{attrs:{type:"primary"},on:{click:t.updateSubDataDict}},[t._v("确 定")])],1)],1)],1)},staticRenderFns:[]};var r=a("VU/8")(o,n,!1,function(t){a("85Kt")},"data-v-028117ca",null);e.default=r.exports}});
|
|
//# sourceMappingURL=23.caeda2a4cd8d7bdb8b60.js.map
|