webpackJsonp([24],{EkV8:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=a("mvHQ"),o=a.n(r),s=(a("ftAF"),{created:function(){var e=this;this.$route.query.id&&this.$http.get({url:"/houseImage/getOne",data:{id:this.$route.query.id}}).then(function(t){t.success&&(t.data.imageType=String(t.data.imageType),e.formData=t.data)})},data:function(){return{saving:!1,formData:{houseId:this.$route.query.houseId,imageType:"0"},rules:{houseId:[{required:!0,message:"请输入房源ID",trigger:"blur"}],imageUrl:[{required:!0,message:"请上传图片",trigger:"blur"}]}}},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(o()(this.formData));this.$http.post({url:this.formData.id?"/houseImage/update":"/houseImage/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:"/houseImage/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("删除失败")})}}}),i={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:"houseId",label:"房源id"}},[a("el-input",{model:{value:e.formData.houseId,callback:function(t){e.$set(e.formData,"houseId",t)},expression:"formData.houseId"}})],1),e._v(" "),a("el-form-item",{attrs:{prop:"imageType",label:"类型"}},[a("el-select",{staticClass:"filter-item",attrs:{placeholder:"类型",size:"small"},model:{value:e.formData.imageType,callback:function(t){e.$set(e.formData,"imageType",t)},expression:"formData.imageType"}},[a("el-option",{attrs:{label:"图片",value:"0"}}),e._v(" "),a("el-option",{attrs:{label:"封面",value:"1"}})],1)],1),e._v(" "),a("el-form-item",{attrs:{prop:"imageName",label:"名称"}},[a("el-input",{model:{value:e.formData.imageName,callback:function(t){e.$set(e.formData,"imageName",t)},expression:"formData.imageName"}})],1),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",[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 l=a("VU/8")(s,i,!1,function(e){a("X9Vk")},"data-v-834c392a",null);t.default=l.exports},X9Vk:function(e,t){}});
//# sourceMappingURL=24.757cb2e95cedd704832c.js.map