1 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-1b858b49"],{"685b":function(t,e,a){},8178: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:"dashboard-container"},[a("div",{staticClass:"search-content"},[a("el-input",{staticStyle:{width:"220px"},attrs:{placeholder:"请输入字典名称"},model:{value:t.queryParams.dictName,callback:function(e){t.$set(t.queryParams,"dictName",e)},expression:"queryParams.dictName"}}),a("el-select",{attrs:{clearable:"",placeholder:"请选择状态"},model:{value:t.queryParams.status,callback:function(e){t.$set(t.queryParams,"status",e)},expression:"queryParams.status"}},t._l(t.statusOptions,(function(t){return a("el-option",{key:t.value,attrs:{label:t.label,value:t.value}})})),1),a("div",{staticClass:"search-btn"},[a("div",{staticClass:"search",on:{click:t.handleSearch}},[t._v("查询")]),a("div",{staticClass:"reset",on:{click:t.reset}},[t._v("重置")])])],1),a("div",{staticClass:"table-content"},[a("div",{staticStyle:{width:"100%",height:"30px"}},[a("div",{staticClass:"btn",on:{click:t.addDepartMenDict}},[a("span",{staticClass:"icon font_family"},[t._v("")]),t._v(" 新增 ")]),a("div",{staticClass:"btn",on:{click:t.handleDelete}},[a("span",{staticClass:"icon font_family"},[t._v("")]),t._v(" 批量删除 ")]),a("div",{staticClass:"btn",on:{click:t.exportOut}},[a("span",{staticClass:"icon font_family"},[t._v("")]),t._v(" 导出 ")])]),a("el-table",{ref:"multipleTable",staticStyle:{width:"100%"},attrs:{data:t.departMentData,"tooltip-effect":"dark"},on:{"selection-change":t.handleSelectionChange}},[a("el-table-column",{attrs:{type:"selection",width:"55"}}),a("el-table-column",{attrs:{prop:"dictId",label:"字典编号",align:"center",width:"160"}}),a("el-table-column",{attrs:{prop:"dictName",label:"字典名称",align:"center",width:"200"}}),a("el-table-column",{attrs:{prop:"dictType",label:"字典类型",align:"center",width:"190"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("span",{staticStyle:{color:"blue",cursor:"pointer"},on:{click:function(a){return t.toTypeDetail(e)}}},[t._v(t._s(e.row.dictType))])]}}])}),a("el-table-column",{attrs:{prop:"status",label:"状态",align:"center",width:"160"},scopedSlots:t._u([{key:"default",fn:function(e){return[1==e.row.status?a("div",{staticClass:"startUsing"},[t._v("启用")]):a("div",{staticClass:"Deactivate"},[t._v("停用")])]}}])}),a("el-table-column",{attrs:{prop:"remark",label:"备注",align:"center"}}),a("el-table-column",{attrs:{prop:"createTime",label:"创建时间",align:"center",width:"170"}}),a("el-table-column",{attrs:{label:"操作",align:"center",width:"200"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("div",{staticClass:"operateBtn",staticStyle:{display:"flex"}},[a("div",{staticStyle:{width:"100px","margin-left":"50px","font-size":"16px",color:"#2766DD",cursor:"pointer"},on:{click:function(a){return t.updateDepart(e.row)}}},[t._v("修改")]),a("div",{staticStyle:{width:"100px","margin-right":"50px","font-size":"16px",color:"#2766DD",cursor:"pointer"},on:{click:function(a){return t.deleteDepartType(e.row)}}},[t._v("删除")])])]}}])})],1),a("el-row",{staticStyle:{"margin-top":"10px"},attrs:{type:"flex",justify:"end"}},[a("div",{staticClass:"pagination"},[a("el-pagination",{attrs:{"page-sizes":[10,15,20],"page-size":t.searchData.pageSize,layout:"total, sizes, prev, pager, next, jumper",total:t.total},on:{"size-change":t.handleSizeChange,"current-change":t.handleCurrentChange}})],1)])],1),a("el-dialog",{attrs:{center:"",width:"636px",title:t.title,visible:t.dialogFormVisible},on:{"update:visible":function(e){t.dialogFormVisible=e}}},[a("el-form",{ref:"form",attrs:{model:t.form,rules:t.rules}},[a("el-form-item",{attrs:{label:"字典名称","label-width":"80px",prop:"dictName"}},[a("el-input",{attrs:{autocomplete:"off",placeholder:"请输入字典名称"},model:{value:t.form.dictName,callback:function(e){t.$set(t.form,"dictName",e)},expression:"form.dictName"}})],1),a("el-form-item",{attrs:{label:"字典类型","label-width":"80px",prop:"dictType"}},[a("el-input",{attrs:{autocomplete:"off",placeholder:"请输入字典类型"},model:{value:t.form.dictType,callback:function(e){t.$set(t.form,"dictType",e)},expression:"form.dictType"}})],1),a("el-form-item",{attrs:{label:"状态","label-width":"80px",prop:"status"}},[a("el-radio-group",{model:{value:t.form.status,callback:function(e){t.$set(t.form,"status",e)},expression:"form.status"}},[a("el-radio",{attrs:{label:1}},[t._v("启用")]),a("el-radio",{attrs:{label:2}},[t._v("停用")])],1)],1),a("el-form-item",{attrs:{label:"备注","label-width":"80px",prop:"remark"}},[a("el-input",{attrs:{autocomplete:"off",placeholder:"请输入备注"},model:{value:t.form.remark,callback:function(e){t.$set(t.form,"remark",e)},expression:"form.remark"}})],1)],1),a("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("div",{staticClass:"search",on:{click:t.submitForm}},[t._v("保 存")]),a("div",{staticClass:"reset",on:{click:t.closeDia}},[t._v("取 消")])])],1)],1)},i=[],r=a("5530"),n=(a("d81d"),a("14d9"),a("e9c4"),a("b64b"),a("d3b7"),a("3ca3"),a("ddb0"),a("2b3d"),a("bf19"),a("9861"),a("88a7"),a("271a"),a("5494"),a("f5e6")),o=a("2f62"),l={name:"",computed:Object(r["a"])({},Object(o["b"])(["name"])),data:function(){return{rules:{dictName:[{required:!0,message:"请输入字典名称",trigger:"blur"}],dictType:[{required:!0,message:"请输入字典类型",trigger:"blur"}],status:[{required:!0,message:"请选择状态",trigger:"blur"}]},departMentData:[],queryParams:{pageSize:"10",pageNum:"1",dictName:"",status:""},form:{dictName:"",dictType:"",status:"",remark:"",dataType:"1"},statusOptions:[{label:"启用",value:"1"},{label:"停用",value:"2"}],searchData:{},tableData:[],ids:[],total:0,title:"",dialogFormVisible:!1,doType:""}},created:function(){this.getList()},methods:{toTypeDetail:function(t){this.$router.push({name:"type",query:{testQuery:t.row.dictType}})},updateDepart:function(t){this.doType=2,this.dialogFormVisible=!0,this.title="修改部门字典",this.form=JSON.parse(JSON.stringify(t))},handleSelectionChange:function(t){this.ids=t.map((function(t){return t.dictId}))},handleDelete:function(){var t=this;0==this.ids.length?this.$message({type:"error",message:"请选择要删除的字典数据!"}):this.$confirm("确定要删除吗?","信息提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(){Object(n["d"])(t.ids).then((function(e){200==e.code?(t.getList(t.data),t.$message({type:"success",message:"删除成功!"})):t.$message({type:"error",message:e.msg})}))})).catch((function(){t.$message({type:"info",message:"已取消删除"})}))},deleteDepartType:function(t){var e=this;this.$confirm("确定要删除吗?","信息提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(){Object(n["d"])(t.dictId).then((function(t){200==t.code?(e.getList(e.data),e.$message({type:"success",message:"删除成功!"})):e.$message({type:"error",message:t.msg})}))})).catch((function(){e.$message({type:"info",message:"已取消删除"})}))},handleCurrentChange:function(t){this.queryParams.pageNum=t,this.getList()},handleSizeChange:function(t){this.queryParams.pageSize=t,this.getList()},exportOut:function(){var t=this;Object(n["f"])({ids:this.ids}).then((function(e){if("application/json"==e.type){var a=new FileReader;a.readAsText(e,"utf-8"),a.onload=function(){var t=JSON.parse(a.result);200==t.code?this.exportFile(e,"系统字典数据信息"):Message({type:"error",message:t.msg})}}else t.exportFile(e,"系统字典数据信息")}))},exportFile:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Date.now(),a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"xlsx",s=window.URL.createObjectURL(new Blob([t],{type:"application/vnd.ms-excel"})),i=document.createElement("a");i.style.display="none",i.href=s;var r=e+"."+a;i.setAttribute("download",r),document.body.appendChild(i),i.click(),document.body.removeChild(i)},reset:function(){this.queryParams.status="",this.queryParams.dictName="",this.getList()},handleSearch:function(){this.queryParams.pageNum=1,this.getList()},getList:function(){var t=this;Object(n["h"])(this.queryParams).then((function(e){t.departMentData=e.data.records,t.total=e.data.total}))},submitForm:function(){var t=this;this.$refs.form.validate((function(e){e&&(1==t.doType?Object(n["b"])(t.form).then((function(e){200==e.code?(t.dialogFormVisible=!1,t.$message({message:"新增成功",type:"success"}),t.getList(),t.$refs.form.resetFields()):t.$message({message:e.msg,type:"error"})})):2==t.doType&&Object(n["l"])(t.form).then((function(e){200==e.code?(t.dialogFormVisible=!1,t.$message({message:"修改成功",type:"success"}),t.getList(),t.$refs.form.resetFields()):t.$message({message:e.msg,type:"error"})})))}))},addDepartMenDict:function(){this.dialogFormVisible=!0,this.title="新增部门字典",this.doType=1,this.$refs.form.resetFields()},closeDia:function(){this.dialogFormVisible=!1,this.$refs.form.resetFields()}}},c=l,d=(a("98a8"),a("2877")),u=Object(d["a"])(c,s,i,!1,null,"3c6775cd",null);e["default"]=u.exports},"98a8":function(t,e,a){"use strict";a("685b")},f5e6:function(t,e,a){"use strict";a.d(e,"h",(function(){return i})),a.d(e,"b",(function(){return r})),a.d(e,"l",(function(){return n})),a.d(e,"d",(function(){return o})),a.d(e,"f",(function(){return l})),a.d(e,"e",(function(){return c})),a.d(e,"j",(function(){return d})),a.d(e,"a",(function(){return u})),a.d(e,"k",(function(){return p})),a.d(e,"c",(function(){return m})),a.d(e,"g",(function(){return f})),a.d(e,"i",(function(){return h}));var s=a("b775");function i(t){return Object(s["a"])({url:"/system/dict/type/list",method:"post",data:t})}function r(t){return Object(s["a"])({url:"/system/dict/type",method:"post",data:t})}function n(t){return Object(s["a"])({url:"/system/dict/type/update",method:"post",data:t})}function o(t){return Object(s["a"])({url:"/system/dict/type/remove/".concat(t),method:"get"})}function l(t){return Object(s["a"])({url:"/system/dict/type/export",method:"post",data:t,responseType:"blob"})}function c(t){return Object(s["a"])({url:"/system/dict/type/export",method:"post",data:t,responseType:"blob"})}function d(t){return Object(s["a"])({url:"/system/dict/data/list",method:"post",data:t})}function u(t){return Object(s["a"])({url:"/system/dict/data",method:"post",data:t})}function p(t){return Object(s["a"])({url:"/system/dict/data/edit",method:"post",data:t})}function m(t){return Object(s["a"])({url:"/system/dict/data/remove/".concat(t),method:"get"})}function f(t){return Object(s["a"])({url:"/system/dict/data/export",method:"post",data:t,responseType:"blob"})}function h(t){return Object(s["a"])({url:"/system/dict/type/optionselect",method:"get",params:t})}}}]);
|