diff --git a/package-lock.json b/package-lock.json index 71cde541..ea57fbd7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4281,7 +4281,7 @@ "fastclick": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/fastclick/-/fastclick-1.0.6.tgz", - "integrity": "sha512-cXyDBT4g0uWl/Xe75QspBDAgAWQ0lkPi/zgp6YFEUHj6WV6VIZl7R6TiDZhdOVU3W4ehp/8tG61Jev1jit+ztQ==", + "integrity": "sha1-FhYlsnsaWAZAWTa9qaLBkm0Gvmo=", "dev": true }, "fastparse": { @@ -4436,7 +4436,7 @@ "font-awesome.css": { "version": "4.7.2", "resolved": "https://registry.npmjs.org/font-awesome.css/-/font-awesome.css-4.7.2.tgz", - "integrity": "sha512-FIyRbig4PDY15NGzejM3b8OQ/lWvId8PHnE4CnuDtc8/YYs07cvnqLCyfvIJPwJl5SA/Rq+9jAe9W+Fr1pv0DA==" + "integrity": "sha1-B1pCARQo8gJyVO9phgx1ergWyVI=" }, "for-in": { "version": "1.0.2", @@ -12350,7 +12350,7 @@ "vue-html5-editor": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/vue-html5-editor/-/vue-html5-editor-1.1.1.tgz", - "integrity": "sha512-Ckmb8djta+XQMUQaxRcCUNBXEzjPF5p6c2nQ5ICcIuR8eYz4b0HAGzXlSDfL3ZxkrVHO2Hx0VrUORLu2Lwem4g==", + "integrity": "sha1-WRAhCoMNjI00eaHx/shHMZKqA7M=", "dev": true }, "vue-lazyload": { diff --git a/src/views/homesteadSurvey/add.vue b/src/views/homesteadSurvey/add.vue index 22f58a05..419f4f26 100644 --- a/src/views/homesteadSurvey/add.vue +++ b/src/views/homesteadSurvey/add.vue @@ -852,10 +852,13 @@ export default { if(this.form.id == null){ let surveyItem = JSON.parse(localStorage.getItem("surveyItem")); - 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)); + } this.$set(this.form, 'surveyId', surveyItem.id) addZjdzd(this.form).then(response => { let _this =this; diff --git a/src/views/homesteadSurvey/fsssAdd.vue b/src/views/homesteadSurvey/fsssAdd.vue index b768c4f9..daf1039c 100644 --- a/src/views/homesteadSurvey/fsssAdd.vue +++ b/src/views/homesteadSurvey/fsssAdd.vue @@ -44,7 +44,7 @@ - +

附属设施信息

diff --git a/src/views/homesteadSurvey/zrzAdd.vue b/src/views/homesteadSurvey/zrzAdd.vue index c090134f..9213441b 100644 --- a/src/views/homesteadSurvey/zrzAdd.vue +++ b/src/views/homesteadSurvey/zrzAdd.vue @@ -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() {