webpackJsonp([72],{TGuW:function(a,e,t){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=t("aA9S"),r=t.n(o),n=t("4YfN"),i=t.n(n),l=(t("uAC3"),t("E4LH"),t("9rMa")),d={data:function(){return{visible:!1,uploadUrl:"",dataForm:{id:0,cname:"",ename:"",domain:"",remark:"",desc:"",enable:"1"},dataRule:{cname:[{required:!0,message:"必填项不能为空",trigger:"blur"}],domain:[{required:!0,message:"必填项不能为空",trigger:"blur"}]}}},computed:i()({},Object(l.c)({ss:function(a){return a.shopDomain.ss}})),methods:{init:function(){var a=this;this.visible=!0,this.$nextTick(function(){a.$refs.dataForm.resetFields(),a.dataForm.id&&a.getDomainInfo()})},getDomainInfo:function(){var a=this,e=r()({},{id:this.dataForm.id});this.$store.dispatch("shop/domain/id",e).then(function(e){console.log(e),a.dataForm.cname=e.dt.list.cname,a.dataForm.ename=e.dt.list.ename,a.dataForm.domain=e.dt.list.domainStr,a.dataForm.remark=e.dt.list.remark,a.dataForm.desc=e.dt.list.desc,a.dataForm.enable=e.dt.list.enable.toString()})},dataFormSubmit:function(){var a=this;this.$refs.dataForm.validate(function(e){if(e){var t={cname:a.dataForm.cname,ename:a.dataForm.ename,domainStr:a.dataForm.domain,remark:a.dataForm.remark,desc:a.dataForm.desc,enable:a.dataForm.enable};a.dataForm.id?a.$store.dispatch("shop/domain/edit",i()({},t,{id:a.dataForm.id})).then(function(a){console.log(a)}):a.$store.dispatch("shop/domain/add",t).then(function(a){console.log(a)})}})},success:function(){var a=this;data&&0===data.code&&this.$message({message:"操作成功",type:"success",duration:1500,onClose:function(){a.visible=!1,a.$emit("refreshDataList")}})}}},s={render:function(){var a=this,e=a.$createElement,t=a._self._c||e;return t("el-dialog",{attrs:{title:a.dataForm.id?"修改":"新增","close-on-click-modal":!1,visible:a.visible},on:{"update:visible":function(e){a.visible=e}}},[t("el-form",{ref:"dataForm",attrs:{model:a.dataForm,rules:a.dataRule,"label-width":"80px"},nativeOn:{keyup:function(e){if(!("button"in e)&&a._k(e.keyCode,"enter",13,e.key,"Enter"))return null;a.dataFormSubmit()}}},[t("el-form-item",{attrs:{label:"中文名",prop:"cname"}},[t("el-input",{attrs:{placeholder:"请输入中文名"},model:{value:a.dataForm.cname,callback:function(e){a.$set(a.dataForm,"cname",e)},expression:"dataForm.cname"}})],1),a._v(" "),t("el-form-item",{attrs:{label:"英文名",prop:"ename"}},[t("el-input",{attrs:{placeholder:"请输入英文名"},model:{value:a.dataForm.ename,callback:function(e){a.$set(a.dataForm,"ename",e)},expression:"dataForm.ename"}})],1),a._v(" "),t("el-form-item",{attrs:{label:"域名",prop:"domain"}},[t("el-input",{attrs:{placeholder:"请输入可正常使用的域名"},model:{value:a.dataForm.domain,callback:function(e){a.$set(a.dataForm,"domain",e)},expression:"dataForm.domain"}})],1),a._v(" "),t("el-form-item",{attrs:{label:"备注",prop:"remark"}},[t("el-input",{attrs:{placeholder:"选填"},model:{value:a.dataForm.remark,callback:function(e){a.$set(a.dataForm,"remark",e)},expression:"dataForm.remark"}})],1),a._v(" "),t("el-form-item",{attrs:{label:"描述",prop:"desc"}},[t("el-input",{attrs:{placeholder:"选填"},model:{value:a.dataForm.desc,callback:function(e){a.$set(a.dataForm,"desc",e)},expression:"dataForm.desc"}})],1),a._v(" "),t("el-form-item",{attrs:{label:"是否可用",size:"mini",prop:"enable"}},[t("el-radio-group",{model:{value:a.dataForm.enable,callback:function(e){a.$set(a.dataForm,"enable",e)},expression:"dataForm.enable"}},[t("el-radio",{attrs:{label:"0"}},[a._v("禁用")]),a._v(" "),t("el-radio",{attrs:{label:"1"}},[a._v("正常")])],1)],1)],1),a._v(" "),t("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[t("el-button",{on:{click:function(e){a.visible=!1}}},[a._v("取消")]),a._v(" "),t("el-button",{attrs:{type:"primary"},on:{click:function(e){a.dataFormSubmit()}}},[a._v("确定")])],1)],1)},staticRenderFns:[]},m=t("C7Lr")(d,s,!1,null,null,null);e.default=m.exports}});