(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-22af8244"],{"3a0f":function(t,e,i){"use strict";i.r(e);var a=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("el-form",{ref:"dictData",staticStyle:{"padding-top":"20px"},attrs:{model:t.dictData,rules:t.dictRule,"label-width":"165px"}},[i("el-form-item",{attrs:{label:"字典名称",prop:"dictName"}},[i("el-input",{staticStyle:{width:"400px"},attrs:{placeholder:"请输入内容",maxlength:"20","show-word-limit":""},model:{value:t.dictData.dictName,callback:function(e){t.$set(t.dictData,"dictName","string"===typeof e?e.trim():e)},expression:"dictData.dictName"}})],1),i("el-form-item",{attrs:{label:"key",prop:"dictKey"}},[i("el-input",{staticStyle:{width:"400px"},attrs:{placeholder:"请输入内容",maxlength:"50","show-word-limit":""},model:{value:t.dictData.dictKey,callback:function(e){t.$set(t.dictData,"dictKey","string"===typeof e?e.trim():e)},expression:"dictData.dictKey"}})],1),i("el-form-item",{attrs:{label:"字段描述"}},[i("el-input",{staticStyle:{width:"400px"},attrs:{placeholder:"请输入内容",type:"textarea",maxlength:"50",rows:"4","show-word-limit":""},model:{value:t.dictData.dictDesc,callback:function(e){t.$set(t.dictData,"dictDesc","string"===typeof e?e.trim():e)},expression:"dictData.dictDesc"}})],1),i("el-form-item",{attrs:{label:"内容",prop:"dictContent"}},[i("dm-editor",{attrs:{value:t.dictData.dictContent,width:"575px",height:"326px"},on:{change:function(e){return t.dictData.dictContent=e}}})],1),i("el-form-item",{staticStyle:{"margin-top":"50px"}},[i("el-button",{attrs:{type:"primary",loading:t.loading},on:{click:t.onSave}},[t._v(t._s(t.dictData.dictId?"保存":"确认新建"))])],1)],1)},c=[],d=i("e56e"),n=i("365c"),r=d["a"].saveDict,s=d["a"].dictDetail,o=n["a"].getUserInfo,l={name:"CreateDictionary",data:function(){return{bread:[{name:"业务字典",path:"/dictionary-list"}],loading:!1,dictData:{dictName:"",dictKey:"",dictDesc:"",dictContent:"",dictId:"",optUserId:"",optUserName:""},dictRule:{dictName:[{required:!0,message:"请输入字典名称",trigger:"blur"}],dictKey:[{required:!0,message:"请输入字典key",trigger:"blur"}],dictContent:[{required:!0,message:"请输入内容",trigger:"blur"}]}}},mounted:function(){this.$emit("showTab","/dictionary-list");var t=this.$route.query.dictId;t?(this.getDictDetail(t),this.bread.push({name:"编辑字典"})):this.bread.push({name:"新建字典"}),this.getUserInfo(),this.$emit("updateBread",this.bread)},methods:{getUserInfo:function(){var t=this;o().then((function(e){var i=e.result,a=i.id,c=i.realName;Object.assign(t.dictData,{optUserId:a,optUserName:c})}))},getDictDetail:function(t){var e=this;s({dictId:t}).then((function(t){var i=t.result,a=i.dictName,c=i.dictKey,d=i.dictDesc,n=i.dictContent,r=i.dictId;Object.assign(e.dictData,{dictName:a,dictKey:c,dictDesc:d,dictContent:n,dictId:r})}))},onSave:function(){var t=this;this.$refs.dictData.validate((function(e){if(e){var i=t.dictData,a=i.dictName,c=i.dictKey,d=i.dictDesc,n=i.dictContent,s=i.dictId,o=i.optUserId,l=i.optUserName,m={dictName:a,dictKey:c,dictDesc:d,dictContent:n,optUserId:o,optUserName:l};t.loading=!0,s&&Object.assign(m,{dictId:s}),r(m).then((function(e){t.$message.success(s?"保存成功！":"新建成功！"),t.$router.go(-1)})).finally((function(){return t.loading=!1}))}}))}}},m=l,u=i("2877"),p=Object(u["a"])(m,a,c,!1,null,null,null);e["default"]=p.exports},e56e:function(t,e,i){"use strict";var a=i("71f6"),c={getDictList:"/dict-list",saveDict:"/save-dict",delDict:"/del-dict",dictDetail:"/dict-detail"};c=Object(a["a"])(c,"/hb-manage-operation-web"),e["a"]=c}}]);