webpackJsonp([25],{LXMB:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var l=a("mvHQ"),r=a.n(l),s=(a("ftAF"),{created:function(){var e=this;this.$route.query.id&&this.$http.get({url:"/testAaa/getOne",data:{id:this.$route.query.id}}).then(function(t){t.success&&(t.data.multiSelect?t.data.multiSelect=t.data.multiSelect.split(","):t.data.multiSelect=[],e.formData=t.data)}),this.$http.get({url:"/testBbb/all"}).then(function(t){t.success&&t.data.length>0&&t.data.forEach(function(t){e.remarkOptions.push({label:t.nameAaa,value:t.nameAaa})})}),this.$http.get({url:"/testBbb/all"}).then(function(t){t.success&&t.data.length>0&&t.data.forEach(function(t){e.multiSelectOptions.push({label:t.nameCcc,value:t.nameCcc})})})},data:function(){return{saving:!1,formData:{},rules:{testName:[{required:!0,message:"请输入 名称",trigger:"blur"}],remark:[{required:!0,message:"请输入 嗯嗯",trigger:"blur"}],multiSelect:[{required:!0,message:"请输入 多选",trigger:"blur"}]},testNameOptions:[{label:"??",value:"??"},{label:"??",value:"??"},{label:"??",value:"??"}],remarkOptions:[],multiSelectOptions:[]}},methods:{onSave:function(){var e=this;this.$refs.form.validate(function(t){if(!t)return!1;e.submit()})},submit:function(){var e=this,t=JSON.parse(r()(this.formData));this.$http.post({url:this.formData.id?"/testAaa/update":"/testAaa/save",data:t}).then(function(t){t.success?(e.$message.success("成功"),e.$router.go(-1)):e.$message.warning("失败")})},onDelete:function(){var e=this;this.$alert("删除将无法恢复，确认要删除么？","警告",{type:"error"}).then(function(){return e.$http.post({url:"/testAaa/del",data:{id:e.formData.id}})}).then(function(){e.$message.success("删除成功"),e.$router.go(-1)}).catch(function(t){"cancel"===t?e.$message.info("删除取消"):e.$message.error("删除失败")})}}}),o={render:function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",[a("el-form",{ref:"form",staticStyle:{"max-width":"500px"},attrs:{model:e.formData,rules:e.rules,"label-width":"80px","label-position":"right",size:"small"}},[a("el-form-item",{attrs:{prop:"testName",label:"名称"}},[[a("el-select",{attrs:{clearable:"",placeholder:"请选择"},model:{value:e.formData.testName,callback:function(t){e.$set(e.formData,"testName",t)},expression:"formData.testName"}},e._l(e.testNameOptions,function(e){return a("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})}))]],2),e._v(" "),a("el-form-item",{attrs:{prop:"remark",label:"嗯嗯"}},[[a("el-select",{attrs:{clearable:"",placeholder:"请选择"},model:{value:e.formData.remark,callback:function(t){e.$set(e.formData,"remark",t)},expression:"formData.remark"}},e._l(e.remarkOptions,function(e){return a("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})}))]],2),e._v(" "),a("el-form-item",{attrs:{prop:"imageUrl",label:"图片"}},[a("single-upload",{model:{value:e.formData.imageUrl,callback:function(t){e.$set(e.formData,"imageUrl",t)},expression:"formData.imageUrl"}})],1),e._v(" "),a("el-form-item",{attrs:{prop:"testTime",label:"时间"}},[[a("div",{staticClass:"block"},[a("el-date-picker",{attrs:{type:"date","value-format":"timestamp",placeholder:"选择日期"},model:{value:e.formData.testTime,callback:function(t){e.$set(e.formData,"testTime",t)},expression:"formData.testTime"}})],1)]],2),e._v(" "),a("el-form-item",{attrs:{prop:"multiSelect",label:"多选"}},[[a("el-select",{attrs:{multiple:"",clearable:"",placeholder:"请选择"},model:{value:e.formData.multiSelect,callback:function(t){e.$set(e.formData,"multiSelect",t)},expression:"formData.multiSelect"}},e._l(e.multiSelectOptions,function(e){return a("el-option",{key:e.value,attrs:{label:e.label,value:e.value}})}))]],2),e._v(" "),a("el-form-item",[a("el-button",{attrs:{loading:e.$store.state.fetchingData,type:"primary"},on:{click:e.onSave}},[e._v("保存")]),e._v(" "),e.formData.id?a("el-button",{attrs:{type:"danger"},on:{click:e.onDelete}},[e._v("删除")]):e._e(),e._v(" "),a("el-button",{on:{click:function(t){e.$router.go(-1)}}},[e._v("取消")])],1)],1)],1)},staticRenderFns:[]};var i=a("VU/8")(s,o,!1,function(e){a("z/vC")},"data-v-680779e7",null);t.default=i.exports},"z/vC":function(e,t){}});
//# sourceMappingURL=25.76e8cdb9c51881566245.js.map