|
|
@@ -270,10 +270,17 @@ export default { |
|
|
|
submitzjd(){ |
|
|
|
this.$refs.form.validate().then(() => { |
|
|
|
if(this.form.id == null){ |
|
|
|
this.$set(this.form, 'theGeomJson', JSON.parse( this.form.theGeomJson)); |
|
|
|
if(this.form.theGeomJson.hasOwnProperty('coordinates')) // 从后台获取的 |
|
|
|
this.$set(this.form, 'theGeomJson',this.form.theGeomJson.coordinates); |
|
|
|
this.$set(this.form, 'theGeomJson', JSON.stringify( this.form.theGeomJson)); |
|
|
|
// this.$set(this.form, 'theGeomJson', JSON.parse( this.form.theGeomJson)); |
|
|
|
// if(this.form.theGeomJson.hasOwnProperty('coordinates')) // 从后台获取的 |
|
|
|
// this.$set(this.form, 'theGeomJson',this.form.theGeomJson.coordinates); |
|
|
|
// this.$set(this.form, 'theGeomJson', JSON.stringify( this.form.theGeomJson)); |
|
|
|
if(this.form.theGeomJson instanceof Array){ |
|
|
|
this.$set(this.form, 'theGeomJson', JSON.stringify( this.form.theGeomJson)); |
|
|
|
}else if(typeof this.form.theGeomJson === 'string'){ |
|
|
|
let theGeometry = JSON.parse( this.form.theGeomJson); |
|
|
|
if(theGeometry.hasOwnProperty('coordinates')) // 从后台获取的 |
|
|
|
this.$set(this.form, 'theGeomJson', JSON.stringify(theGeometry.coordinates)); |
|
|
|
} |
|
|
|
addZrz(this.form).then(response => { |
|
|
|
let _this =this |
|
|
|
this.$toast({ |
|
|
@@ -332,7 +339,7 @@ export default { |
|
|
|
onMapDrawFinished(data) { |
|
|
|
console.info(data); |
|
|
|
this.drawInsert = data; |
|
|
|
this.form.theGeomJson = JSON.stringify(this.drawInsert); |
|
|
|
this.form.theGeomJson = this.drawInsert; |
|
|
|
}, |
|
|
|
// 当申请地图被重置时 |
|
|
|
onMapDrawReseted() { |
|
|
|