chunk-5a4a.63883a50.js 10 KB

1
  1. (window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-5a4a"],{JfR4:function(t,e,a){"use strict";a.r(e);var i=a("fhNW"),n={name:"Dict",data:function(){return{loading:!0,ids:[],single:!0,multiple:!0,total:0,typeList:[],title:"",open:!1,statusOptions:[],dateRange:[],queryParams:{page:1,limit:10,dictName:void 0,dictType:void 0,status:void 0},form:{},rules:{dictName:[{required:!0,message:"字典名称不能为空",trigger:"blur"}],dictType:[{required:!0,message:"字典类型不能为空",trigger:"blur"}]}}},created:function(){var t=this;this.getList(),this.getDicts("sys_normal_disable").then(function(e){t.statusOptions=e.data.data})},methods:{getList:function(){var t=this;this.loading=!0,Object(i.d)(this.addDateRange(this.queryParams,this.dateRange)).then(function(e){t.typeList=e.data.data.items,t.total=e.data.data.count,t.loading=!1})},statusFormat:function(t,e){return this.selectDictLabel(this.statusOptions,t.status)},cancel:function(){this.open=!1,this.reset()},reset:function(){this.form={dictId:void 0,dictName:void 0,dictType:void 0,status:"0",remark:void 0},this.resetForm("form")},handleQuery:function(){this.queryParams.pageNum=1,this.getList()},resetQuery:function(){this.dateRange=[],this.resetForm("queryForm"),this.handleQuery()},handleAdd:function(){this.reset(),this.open=!0,this.title="添加字典类型"},handleSelectionChange:function(t){this.ids=t.map(function(t){return t.dictId}),this.single=1!==t.length,this.multiple=!t.length},handleUpdate:function(t){var e=this;this.reset();var a=t.dictId||this.ids.join(",");Object(i.c)(a).then(function(t){e.form=t.data.data,e.open=!0,e.title="修改字典类型"})},submitForm:function(){var t=this;this.$refs.form.validate(function(e){e&&(void 0!==t.form.dictId?Object(i.f)(t.form).then(function(e){e.data?(t.msgSuccess("修改成功"),t.open=!1,t.getList()):t.msgError(e.msg)}):Object(i.a)(t.form).then(function(e){e.data?(t.msgSuccess("新增成功"),t.open=!1,t.getList()):t.msgError(e.msg)}))})},handleDelete:function(t){var e=this,a=t.dictId||this.ids.join(",");this.$confirm('是否确认删除字典编号为"'+a+'"的数据项?',"警告",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(function(){return Object(i.b)(a)}).then(function(){e.getList(),e.msgSuccess("删除成功")}).catch(function(){})}}},r=a("KHd+"),s=Object(r.a)(n,function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"app-container"},[a("el-form",{ref:"queryForm",attrs:{model:t.queryParams,inline:!0,"label-width":"68px"}},[a("el-form-item",{attrs:{label:"字典名称",prop:"dictName"}},[a("el-input",{staticStyle:{width:"240px"},attrs:{placeholder:"请输入字典名称",clearable:"",size:"small"},nativeOn:{keyup:function(e){return"button"in e||!t._k(e.keyCode,"enter",13,e.key,"Enter")?t.handleQuery(e):null}},model:{value:t.queryParams.dictName,callback:function(e){t.$set(t.queryParams,"dictName",e)},expression:"queryParams.dictName"}})],1),t._v(" "),a("el-form-item",{attrs:{label:"字典类型",prop:"dictType"}},[a("el-input",{staticStyle:{width:"240px"},attrs:{placeholder:"请输入字典类型",clearable:"",size:"small"},nativeOn:{keyup:function(e){return"button"in e||!t._k(e.keyCode,"enter",13,e.key,"Enter")?t.handleQuery(e):null}},model:{value:t.queryParams.dictType,callback:function(e){t.$set(t.queryParams,"dictType",e)},expression:"queryParams.dictType"}})],1),t._v(" "),a("el-form-item",{attrs:{label:"状态",prop:"status"}},[a("el-select",{staticStyle:{width:"240px"},attrs:{placeholder:"字典状态",clearable:"",size:"small"},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.dictValue,attrs:{label:t.dictLabel,value:t.dictValue}})}))],1),t._v(" "),a("el-form-item",{attrs:{label:"创建时间"}},[a("el-date-picker",{staticStyle:{width:"240px"},attrs:{size:"small","value-format":"yyyy-MM-dd",type:"daterange","range-separator":"-","start-placeholder":"开始日期","end-placeholder":"结束日期"},model:{value:t.dateRange,callback:function(e){t.dateRange=e},expression:"dateRange"}})],1),t._v(" "),a("el-form-item",[a("el-button",{attrs:{type:"primary",icon:"el-icon-search",size:"mini"},on:{click:t.handleQuery}},[t._v("搜索")]),t._v(" "),a("el-button",{attrs:{icon:"el-icon-refresh",size:"mini"},on:{click:t.resetQuery}},[t._v("重置")])],1)],1),t._v(" "),a("el-row",{staticClass:"mb8",attrs:{gutter:10}},[a("el-col",{attrs:{span:1.5}},[a("el-button",{directives:[{name:"permission",rawName:"v-permission",value:["admin:dictType:add"],expression:"['admin:dictType:add']"}],attrs:{type:"primary",icon:"el-icon-plus",size:"mini"},on:{click:t.handleAdd}},[t._v("新增")])],1),t._v(" "),a("el-col",{attrs:{span:1.5}},[a("el-button",{directives:[{name:"permission",rawName:"v-permission",value:["admin:dictType:update"],expression:"['admin:dictType:update']"}],attrs:{disabled:t.single,type:"success",icon:"el-icon-edit",size:"mini"},on:{click:t.handleUpdate}},[t._v("修改")])],1),t._v(" "),a("el-col",{attrs:{span:1.5}},[a("el-button",{directives:[{name:"permission",rawName:"v-permission",value:["admin:dictType:delete"],expression:"['admin:dictType:delete']"}],attrs:{disabled:t.multiple,type:"danger",icon:"el-icon-delete",size:"mini"},on:{click:t.handleDelete}},[t._v("删除")])],1)],1),t._v(" "),a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],attrs:{data:t.typeList},on:{"selection-change":t.handleSelectionChange}},[a("el-table-column",{attrs:{type:"selection",width:"55",align:"center"}}),t._v(" "),a("el-table-column",{attrs:{label:"字典编号",align:"center",prop:"dictId"}}),t._v(" "),a("el-table-column",{attrs:{"show-overflow-tooltip":!0,label:"字典名称",align:"center",prop:"dictName"}}),t._v(" "),a("el-table-column",{attrs:{"show-overflow-tooltip":!0,label:"字典类型",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("router-link",{staticClass:"link-type",attrs:{to:"/sys/dictData/"+e.row.dictId}},[a("span",[t._v(t._s(e.row.dictType))])])]}}])}),t._v(" "),a("el-table-column",{attrs:{formatter:t.statusFormat,label:"状态",align:"center",prop:"status"}}),t._v(" "),a("el-table-column",{attrs:{"show-overflow-tooltip":!0,label:"备注",align:"center",prop:"remark"}}),t._v(" "),a("el-table-column",{attrs:{label:"创建时间",align:"center",prop:"createTime",width:"180"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("span",[t._v(t._s(t.parseTime(e.row.createTime)))])]}}])}),t._v(" "),a("el-table-column",{attrs:{label:"操作",align:"center","class-name":"small-padding fixed-width"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("el-button",{directives:[{name:"permission",rawName:"v-permission",value:["admin:dictType:update"],expression:"['admin:dictType:update']"}],attrs:{size:"mini",type:"text",icon:"el-icon-edit"},on:{click:function(a){t.handleUpdate(e.row)}}},[t._v("修改")]),t._v(" "),a("el-button",{directives:[{name:"permission",rawName:"v-permission",value:["admin:dictType:delete"],expression:"['admin:dictType:delete']"}],attrs:{size:"mini",type:"text",icon:"el-icon-delete"},on:{click:function(a){t.handleDelete(e.row)}}},[t._v("删除")])]}}])})],1),t._v(" "),a("pagination",{directives:[{name:"show",rawName:"v-show",value:t.total>0,expression:"total>0"}],attrs:{total:t.total,page:t.queryParams.page,limit:t.queryParams.limit},on:{"update:page":function(e){t.$set(t.queryParams,"page",e)},"update:limit":function(e){t.$set(t.queryParams,"limit",e)},pagination:t.getList}}),t._v(" "),a("el-dialog",{attrs:{title:t.title,visible:t.open,width:"500px"},on:{"update:visible":function(e){t.open=e}}},[a("el-form",{ref:"form",attrs:{model:t.form,rules:t.rules,"label-width":"80px"}},[a("el-form-item",{attrs:{label:"字典名称",prop:"dictName"}},[a("el-input",{attrs:{placeholder:"请输入字典名称"},model:{value:t.form.dictName,callback:function(e){t.$set(t.form,"dictName",e)},expression:"form.dictName"}})],1),t._v(" "),a("el-form-item",{attrs:{label:"字典类型",prop:"dictType"}},[a("el-input",{attrs:{placeholder:"请输入字典类型"},model:{value:t.form.dictType,callback:function(e){t.$set(t.form,"dictType",e)},expression:"form.dictType"}})],1),t._v(" "),a("el-form-item",{attrs:{label:"状态",prop:"status"}},[a("el-radio-group",{model:{value:t.form.status,callback:function(e){t.$set(t.form,"status",e)},expression:"form.status"}},t._l(t.statusOptions,function(e){return a("el-radio",{key:e.dictValue,attrs:{label:e.dictValue}},[t._v(t._s(e.dictLabel))])}))],1),t._v(" "),a("el-form-item",{attrs:{label:"备注",prop:"remark"}},[a("el-input",{attrs:{type:"textarea",placeholder:"请输入内容"},model:{value:t.form.remark,callback:function(e){t.$set(t.form,"remark",e)},expression:"form.remark"}})],1)],1),t._v(" "),a("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{attrs:{type:"primary"},on:{click:t.submitForm}},[t._v("确 定")]),t._v(" "),a("el-button",{on:{click:t.cancel}},[t._v("取 消")])],1)],1)],1)},[],!1,null,null,null);s.options.__file="dictType.vue";e.default=s.exports},fhNW:function(t,e,a){"use strict";a.d(e,"d",function(){return o}),a.d(e,"c",function(){return c}),a.d(e,"a",function(){return d}),a.d(e,"f",function(){return u}),a.d(e,"b",function(){return m}),a.d(e,"e",function(){return p});var i=a("gDS+"),n=a.n(i),r=a("QbLZ"),s=a.n(r),l=a("t3Un");function o(t){return Object(l.a)({method:"get",params:s()({_gp:"admin.dictType",_mt:"list"},t)})}function c(t){return Object(l.a)({method:"get",params:{_gp:"admin.dictType",_mt:"get",dictId:t}})}function d(t){return Object(l.a)({method:"post",params:{_gp:"admin.dictType",_mt:"add",dictType:n()(t)}})}function u(t){return Object(l.a)({method:"post",params:{_gp:"admin.dictType",_mt:"update",dictType:n()(t)}})}function m(t){return Object(l.a)({method:"post",params:{_gp:"admin.dictType",_mt:"delete",dictIds:t}})}function p(){return Object(l.a)({method:"get",params:{_gp:"admin.dictType",_mt:"optionselect"}})}},"gDS+":function(t,e,a){t.exports={default:a("oh+g"),__esModule:!0}},"oh+g":function(t,e,a){var i=a("WEpk"),n=i.JSON||(i.JSON={stringify:JSON.stringify});t.exports=function(t){return n.stringify.apply(n,arguments)}}}]);