|
@@ -51,7 +51,6 @@ export default {
|
|
|
data() {
|
|
|
let domainUrl = process.env.VUE_APP_BASE_API
|
|
|
const token = window.sessionStorage.getItem('fp_token')
|
|
|
- const imagesArr = this.$dictData.estate_photo
|
|
|
return {
|
|
|
domainUrl,
|
|
|
token,
|
|
@@ -59,25 +58,26 @@ export default {
|
|
|
formData: [],
|
|
|
cObj: {},
|
|
|
isShowMap: false,
|
|
|
- imagesArr,
|
|
|
+ imagesArr: [],
|
|
|
curIndex: 0,
|
|
|
}
|
|
|
},
|
|
|
watch: {
|
|
|
isShow: function(val) {
|
|
|
if (val) {
|
|
|
+ let imagesArr = JSON.parse(JSON.stringify(this.$dictData.estate_photo))
|
|
|
if (this.curObj.id) {
|
|
|
this.loading = true
|
|
|
this.$api.house.admestatephotolist({estate_id: this.curObj.id}).then(res => {
|
|
|
- let curArr = res ? JSON.parse(res) : []
|
|
|
+ let curArr = res.data ? JSON.parse(res.data) : []
|
|
|
curArr.forEach(item => {
|
|
|
- this.imagesArr.map(one => {
|
|
|
+ imagesArr.map(one => {
|
|
|
if (item.val === one.val) {
|
|
|
one.urls = item.urls
|
|
|
}
|
|
|
})
|
|
|
})
|
|
|
- this.imagesArr = [...this.imagesArr]
|
|
|
+ this.imagesArr = [...imagesArr]
|
|
|
this.loading = false
|
|
|
}).catch(err => {
|
|
|
this.loading = false
|
|
@@ -133,12 +133,10 @@ export default {
|
|
|
this.$api.house[apiStr](newForm).then(data => {
|
|
|
this.$msgs(newForm.id ? '编辑成功' : '新增成功')
|
|
|
this.$emit('close', newForm)
|
|
|
- this.imagesArr = this.$dictData.estate_photo
|
|
|
this.curIndex = 0
|
|
|
})
|
|
|
} else {
|
|
|
this.$emit('close')
|
|
|
- this.imagesArr = this.$dictData.estate_photo
|
|
|
this.curIndex = 0
|
|
|
}
|
|
|
},
|