webpackJsonp([44],{G2CJ:function(e,t){},"T+Rh":function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=a("mvHQ"),o=a.n(r),l=(a("ftAF"),{created:function(){var e=this;this.$route.query.id&&this.$http.get({url:"/metroInfo/getOne",data:{id:this.$route.query.id}}).then(function(t){t.success&&(e.formData=t.data)})},data:function(){return{saving:!1,formData:{},rules:{metroName:[{required:!0,message:"请输入 简称",trigger:"blur"}],code:[{required:!0,message:"请输入 code",trigger:"blur"}],cityCode:[{required:!0,message:"请输入 城市CODE",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?"/metroInfo/update":"/metroInfo/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:"/metroInfo/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("删除失败")})}}}),n={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":"120px","label-position":"right",size:"small"}},[a("el-form-item",{attrs:{prop:"metroName",label:"简称"}},[a("el-input",{model:{value:e.formData.metroName,callback:function(t){e.$set(e.formData,"metroName",t)},expression:"formData.metroName"}})],1),e._v(" "),a("el-form-item",{attrs:{prop:"code",label:"code"}},[a("el-input",{model:{value:e.formData.code,callback:function(t){e.$set(e.formData,"code",t)},expression:"formData.code"}})],1),e._v(" "),a("el-form-item",{attrs:{prop:"lat",label:"纬度"}},[a("el-input",{attrs:{type:"number"},model:{value:e.formData.lat,callback:function(t){e.$set(e.formData,"lat",t)},expression:"formData.lat"}})],1),e._v(" "),a("el-form-item",{attrs:{prop:"lng",label:"经度"}},[a("el-input",{attrs:{type:"number"},model:{value:e.formData.lng,callback:function(t){e.$set(e.formData,"lng",t)},expression:"formData.lng"}})],1),e._v(" "),a("el-form-item",{attrs:{prop:"remark",label:"备注"}},[a("el-input",{model:{value:e.formData.remark,callback:function(t){e.$set(e.formData,"remark",t)},expression:"formData.remark"}})],1),e._v(" "),a("el-form-item",{attrs:{prop:"cityCode",label:"城市CODE"}},[a("el-select",{staticClass:"filter-item",attrs:{placeholder:"市",size:"small",filterable:""},model:{value:e.formData.cityCode,callback:function(t){e.$set(e.formData,"cityCode",t)},expression:"formData.cityCode"}},[a("el-option",{attrs:{label:"南京",value:"320100"}}),e._v(" "),a("el-option",{attrs:{label:"无锡",value:"320200"}}),e._v(" "),a("el-option",{attrs:{label:"上海",value:"310100"}})],1)],1),e._v(" "),a("el-form-item",{attrs:{prop:"rank",label:"排序"}},[a("el-input",{attrs:{type:"number"},model:{value:e.formData.rank,callback:function(t){e.$set(e.formData,"rank",t)},expression:"formData.rank"}})],1),e._v(" "),a("el-form-item",{attrs:{prop:"hot",label:"热度"}},[a("el-input",{attrs:{type:"number"},model:{value:e.formData.hot,callback:function(t){e.$set(e.formData,"hot",t)},expression:"formData.hot"}})],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 s=a("VU/8")(l,n,!1,function(e){a("G2CJ")},"data-v-3b892db4",null);t.default=s.exports}});
//# sourceMappingURL=44.5e7045a1a9db7a53755e.js.map