webpackJsonp([37],{"1QrE":function(t,e){},"8lJj":function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=a("mvHQ"),o=a.n(r),l=(a("ftAF"),{created:function(){var t=this;this.$route.query.id&&this.$http.get({url:"/metroStation/getOne",data:{id:this.$route.query.id}}).then(function(e){e.success&&(t.formData=e.data)}),this.$http.get({url:"/districtInfo/all",data:{useFlag:"Y"}}).then(function(e){e.success&&(t.cityCodeOptions=e.data)}),this.$http.get({url:"/metroInfo/all"}).then(function(e){e.success&&(t.metroInfos=e.data)})},data:function(){return{saving:!1,formData:{metroCode:this.$route.query.metroCode,cityCode:this.$route.query.cityCode},rules:{stationName:[{required:!0,message:"请输入 简称",trigger:"blur"}],code:[{required:!0,message:"请输入 code",trigger:"blur"}],cityCode:[{required:!0,message:"请输入 城市CODE",trigger:"blur"}],metroCode:[{required:!0,message:"请输入 地铁CODE",trigger:"blur"}]},metroInfos:[],cityCodeOptions:[]}},methods:{onSave:function(){var t=this;this.$refs.form.validate(function(e){if(!e)return!1;t.submit()})},submit:function(){var t=this,e=JSON.parse(o()(this.formData));this.$http.post({url:this.formData.id?"/metroStation/update":"/metroStation/save",data:e}).then(function(e){e.success?(t.$message.success("成功"),t.$router.go(-1)):t.$message.warning("失败")})},onDelete:function(){var t=this;this.$alert("删除将无法恢复，确认要删除么？","警告",{type:"error"}).then(function(){return t.$http.post({url:"/metroStation/del",data:{id:t.formData.id}})}).then(function(){t.$message.success("删除成功"),t.$router.go(-1)}).catch(function(e){"cancel"===e?t.$message.info("删除取消"):t.$message.error("删除失败")})}}}),s={render:function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[a("el-form",{ref:"form",staticStyle:{"max-width":"500px"},attrs:{model:t.formData,rules:t.rules,"label-width":"80px","label-position":"right",size:"small"}},[a("el-form-item",{attrs:{prop:"cityCode",label:"城市"}},[a("el-select",{staticClass:"filter-item",attrs:{placeholder:"市",size:"small",filterable:""},model:{value:t.formData.cityCode,callback:function(e){t.$set(t.formData,"cityCode",e)},expression:"formData.cityCode"}},t._l(t.cityCodeOptions,function(t){return a("el-option",{key:t.code,attrs:{label:t.shortName,value:t.code}})}))],1),t._v(" "),a("el-form-item",{attrs:{prop:"metroCode",label:"地铁线"}},[a("el-select",{attrs:{filterable:"",placeholder:"请选择",size:"small"},model:{value:t.formData.metroCode,callback:function(e){t.$set(t.formData,"metroCode",e)},expression:"formData.metroCode"}},t._l(t.metroInfos,function(t){return a("el-option",{key:t.code,attrs:{label:t.metroName,value:t.code}})}))],1),t._v(" "),a("el-form-item",{attrs:{prop:"stationName",label:"简称"}},[a("el-input",{model:{value:t.formData.stationName,callback:function(e){t.$set(t.formData,"stationName",e)},expression:"formData.stationName"}})],1),t._v(" "),a("el-form-item",{attrs:{prop:"code",label:"code"}},[a("el-input",{model:{value:t.formData.code,callback:function(e){t.$set(t.formData,"code",e)},expression:"formData.code"}})],1),t._v(" "),a("el-form-item",{attrs:{prop:"lat",label:"纬度"}},[a("el-input",{attrs:{type:"number"},model:{value:t.formData.lat,callback:function(e){t.$set(t.formData,"lat",e)},expression:"formData.lat"}})],1),t._v(" "),a("el-form-item",{attrs:{prop:"lng",label:"经度"}},[a("el-input",{attrs:{type:"number"},model:{value:t.formData.lng,callback:function(e){t.$set(t.formData,"lng",e)},expression:"formData.lng"}})],1),t._v(" "),a("el-form-item",{attrs:{prop:"remark",label:"备注"}},[a("el-input",{model:{value:t.formData.remark,callback:function(e){t.$set(t.formData,"remark",e)},expression:"formData.remark"}})],1),t._v(" "),a("el-form-item",{attrs:{prop:"rank",label:"排序"}},[a("el-input",{attrs:{type:"number"},model:{value:t.formData.rank,callback:function(e){t.$set(t.formData,"rank",e)},expression:"formData.rank"}})],1),t._v(" "),a("el-form-item",{attrs:{prop:"hot",label:"热度"}},[a("el-input",{attrs:{type:"number"},model:{value:t.formData.hot,callback:function(e){t.$set(t.formData,"hot",e)},expression:"formData.hot"}})],1),t._v(" "),a("el-form-item",[a("el-button",{attrs:{loading:t.$store.state.fetchingData,type:"primary"},on:{click:t.onSave}},[t._v("保存")]),t._v(" "),t.formData.id?a("el-button",{attrs:{type:"danger"},on:{click:t.onDelete}},[t._v("删除")]):t._e(),t._v(" "),a("el-button",{on:{click:function(e){t.$router.go(-1)}}},[t._v("取消")])],1)],1)],1)},staticRenderFns:[]};var n=a("VU/8")(l,s,!1,function(t){a("1QrE")},"data-v-62e35ebc",null);e.default=n.exports}});
//# sourceMappingURL=37.dc38d7959088906d86b9.js.map