chunk-2d21f07b.c6665f0d.js 7.1 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d21f07b"],{d7a3:function(t,e,a){"use strict";a.r(e);var r=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[a("el-dialog",{attrs:{title:t.title,visible:t.tagDialogVisible,width:"700px","close-on-press-escape":!1,"close-on-click-modal":!1,"before-close":t.beforeClose},on:{"update:visible":function(e){t.tagDialogVisible=e},close:t.beforeClose}},[a("el-button",{staticStyle:{"margin-bottom":"10px"},on:{click:t.add}},[t._v("新增")]),a("el-table",{staticStyle:{width:"100%","max-height":"65vh",overflow:"auto"},attrs:{data:t.tableData}},[a("el-table-column",{attrs:{label:"标签名称",align:"center","show-overflow-tooltip":""},scopedSlots:t._u([{key:"default",fn:function(e){return[a("span",[t._v(" "+t._s(e.row.dictName?e.row.dictName:"-")+" ")])]}}])}),a("el-table-column",{attrs:{label:"标签值",align:"center","show-overflow-tooltip":""},scopedSlots:t._u([{key:"default",fn:function(e){return[a("span",[t._v(" "+t._s(e.row.dictValue?e.row.dictValue:"-")+" ")])]}}])}),a("el-table-column",{attrs:{label:"排序",align:"center","show-overflow-tooltip":""},scopedSlots:t._u([{key:"default",fn:function(e){return[a("span",[t._v(" "+t._s(e.row.dictSort)+" ")])]}}])}),a("el-table-column",{attrs:{label:"状态",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("el-switch",{attrs:{"active-value":1,"inactive-value":0,"active-color":"#13ce66","inactive-color":"#ff4949"},on:{change:function(a){return t.changeStatus(e.row)}},model:{value:e.row.dictStatus,callback:function(a){t.$set(e.row,"dictStatus",a)},expression:"scope.row.dictStatus"}})]}}])}),a("el-table-column",{attrs:{label:"操作",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.edit(e.row)}}},[t._v("编辑")]),a("el-button",{attrs:{type:"text",size:"small"},on:{click:function(a){return t.del(e.row)}}},[t._v("删除")])]}}])})],1)],1),t.SamllDialogVisible?a("el-dialog",{attrs:{title:t.titleSamll,visible:t.SamllDialogVisible,width:"700px","close-on-press-escape":!1,"close-on-click-modal":!1,"before-close":t.cancel},on:{"update:visible":function(e){t.SamllDialogVisible=e},close:t.cancel}},[a("el-form",{ref:"formRef",attrs:{model:t.form,rules:t.rules,"label-position":"right","label-width":"100px"}},[a("el-form-item",{attrs:{prop:"dictName",label:"标签名称"}},[a("el-input",{attrs:{placeholder:"请输入标签名称"},model:{value:t.form.dictName,callback:function(e){t.$set(t.form,"dictName",e)},expression:"form.dictName"}})],1),a("el-form-item",{attrs:{prop:"dictValue",label:"标签值"}},[a("el-input",{attrs:{placeholder:"请输入标签值"},model:{value:t.form.dictValue,callback:function(e){t.$set(t.form,"dictValue",e)},expression:"form.dictValue"}})],1),a("el-form-item",{attrs:{prop:"dictSort",label:"排序"}},[a("el-input-number",{attrs:{min:0,placeholder:"请输入排序"},model:{value:t.form.dictSort,callback:function(e){t.$set(t.form,"dictSort",e)},expression:"form.dictSort"}})],1),a("el-form-item",{attrs:{prop:"dictStatus",label:"状态"}},[a("el-switch",{attrs:{"active-value":1,"inactive-value":0,"active-color":"#13ce66","inactive-color":"#ff4949"},model:{value:t.form.dictStatus,callback:function(e){t.$set(t.form,"dictStatus",e)},expression:"form.dictStatus"}})],1)],1),a("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{on:{click:t.cancel}},[t._v("取 消")]),a("el-button",{attrs:{type:"primary"},on:{click:t.submitForm}},[t._v("确 认")])],1)],1):t._e()],1)},i=[],l=a("5530"),o=a("c7eb"),c=a("1da1"),s=a("943d"),n={name:"EitcErmPcTagDialog",props:{title:{type:String,default:""},dictType:{type:String,default:""},tagDialogVisible:{type:Boolean,default:""}},data:function(){return{tableData:[],titleSamll:"",SamllDialogVisible:!1,form:{dictName:"",dictValue:"",dictSort:"",dictStatus:!1},rules:{dictName:[{required:!0,message:"标签名称不能为空",trigger:"blur"}],dictValue:[{required:!0,message:"标签值不能为空",trigger:"blur"}],dictSort:[{required:!0,message:"排序不能为空",trigger:"blur"}],dictStatus:[{required:!0,message:"请选择状态",trigger:"blur"}]}}},mounted:function(){},methods:{initList:function(){var t=this;return Object(c["a"])(Object(o["a"])().mark((function e(){var a;return Object(o["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,Object(s["j"])(t.dictType);case 2:a=e.sent,t.tableData=a.data;case 4:case"end":return e.stop()}}),e)})))()},beforeClose:function(){this.tableData=[],this.$emit("closeDialog")},add:function(){this.titleSamll="新增",this.form={dictName:"",dictValue:"",dictSort:"",dictStatus:1},this.form.dictSort=this.tableData.length+1,this.SamllDialogVisible=!0},edit:function(t){this.titleSamll="编辑",this.form=Object(l["a"])({},t),this.SamllDialogVisible=!0},del:function(t){var e=this;this.$confirm("此操作将永久删除该项, 是否继续?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(Object(c["a"])(Object(o["a"])().mark((function a(){var r;return Object(o["a"])().wrap((function(a){while(1)switch(a.prev=a.next){case 0:return a.next=2,Object(s["lb"])(t.id);case 2:if(r=a.sent,200===r.code){a.next=5;break}return a.abrupt("return",e.$message.error(r.msg));case 5:e.initList(),e.$message({type:"success",message:"删除成功!"});case 7:case"end":return a.stop()}}),a)})))).catch((function(){e.$message({type:"info",message:"已取消删除"})}))},cancel:function(){this.SamllDialogVisible=!1},changeStatus:function(t){var e=this;return Object(c["a"])(Object(o["a"])().mark((function a(){var r;return Object(o["a"])().wrap((function(a){while(1)switch(a.prev=a.next){case 0:return e.form=Object(l["a"])({},t),e.form.dictStatus?e.form.dictStatus=1:e.form.dictStatus=0,e.form.dictType=e.dictType,a.next=5,Object(s["l"])(e.form);case 5:if(r=a.sent,200===r.code){a.next=8;break}return a.abrupt("return",e.$message.error(r.msg));case 8:e.$message.success("修改成功!"),e.initList();case 10:case"end":return a.stop()}}),a)})))()},submitForm:function(){var t=this;this.$refs.formRef.validate(function(){var e=Object(c["a"])(Object(o["a"])().mark((function e(a){var r,i;return Object(o["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(!a){e.next=21;break}if(t.form.dictStatus?t.form.dictStatus=1:t.form.dictStatus=0,t.form.dictType=t.dictType,"新增"!=t.titleSamll){e.next=11;break}return e.next=6,Object(s["k"])(t.form);case 6:if(r=e.sent,200===r.code){e.next=9;break}return e.abrupt("return",t.$message.error(r.msg));case 9:e.next=16;break;case 11:return e.next=13,Object(s["l"])(t.form);case 13:if(i=e.sent,200===i.code){e.next=16;break}return e.abrupt("return",t.$message.error(i.msg));case 16:t.SamllDialogVisible=!1,t.$message.success("".concat(t.titleSamll,"成功!")),t.initList(),e.next=23;break;case 21:return console.log("error submit!!"),e.abrupt("return",!1);case 23:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}())},resetForm:function(t){this.$refs.formRef.resetFields()}}},u=n,f=a("2877"),m=Object(f["a"])(u,r,i,!1,null,null,null);e["default"]=m.exports}}]);