diff --git a/epmet-oper-web/src/views/modules/customer/customize/MiniHome.vue b/epmet-oper-web/src/views/modules/customer/customize/MiniHome.vue index 6ca1920..edd22d5 100644 --- a/epmet-oper-web/src/views/modules/customer/customize/MiniHome.vue +++ b/epmet-oper-web/src/views/modules/customer/customize/MiniHome.vue @@ -135,8 +135,8 @@ :is-focused="focusedCpt.tempOnlyId===item.tempOnlyId" @del="delCpt" @sort="changeCptDisplayOrder" - @focus="focusCpt" - v-for="item in cntCptList"> + @focus="focusCpt($event, index)" + v-for="(item, index) in cntCptList"> @@ -526,7 +526,8 @@ export default { focusedCpt: { tempOnlyId: '' }, - uploadUlr: window.SITE_CONFIG['apiURL'] + '/oss/file/customerlogo/upload' + uploadUlr: window.SITE_CONFIG['apiURL'] + '/oss/file/customerlogo/upload', + globalIndex: 0 } }, @@ -841,8 +842,9 @@ export default { this.focusedCpt = { tempOnlyId: '' } }, // 聚焦实例组件 - focusCpt (item) { + focusCpt (item, index) { console.log('聚焦实例组件') + this.globalIndex = index if (this.isInPreview) return if (this.focusedCpt.tempOnlyId === item.tempOnlyId) { this.cleanFocusCpt() @@ -931,7 +933,9 @@ export default { this.focusedCpt.configuration = { url: res.data.url } + this.cntCptList[this.globalIndex].demoData.pic = res.data.url this.focusedCpt.configuration = JSON.stringify(this.focusedCpt.configuration) + this.focusedCpt.demoData = JSON.stringify(this.cntCptList[this.globalIndex].demoData) } } } diff --git a/epmet-oper-web/src/views/modules/productConfig/homeCustom/index.vue b/epmet-oper-web/src/views/modules/productConfig/homeCustom/index.vue index d9e6501..9a9c363 100644 --- a/epmet-oper-web/src/views/modules/productConfig/homeCustom/index.vue +++ b/epmet-oper-web/src/views/modules/productConfig/homeCustom/index.vue @@ -144,8 +144,8 @@ :is-focused="focusedCpt.tempOnlyId===item.tempOnlyId" @del="delCpt" @sort="changeCptDisplayOrder" - @focus="focusCpt" - v-for="item in cntCptList"> + @focus="focusCpt($event, index)" + v-for="(item, index) in cntCptList"> @@ -533,7 +533,8 @@ export default { focusedCpt: { tempOnlyId: '' }, - uploadUlr: window.SITE_CONFIG['apiURL'] + '/oss/file/customerlogo/upload' + uploadUlr: window.SITE_CONFIG['apiURL'] + '/oss/file/customerlogo/upload', + globalIndex: 0 } }, @@ -833,8 +834,9 @@ export default { this.focusedCpt = { tempOnlyId: '' } }, // 聚焦实例组件 - focusCpt (item) { - console.log('聚焦实例组件', item) + focusCpt (item, index) { + console.log('聚焦实例组件', item, index) + this.globalIndex = index if (this.isInPreview) return if (this.focusedCpt.tempOnlyId === item.tempOnlyId) { this.cleanFocusCpt() @@ -908,7 +910,9 @@ export default { this.focusedCpt.configuration = { url: res.data.url } + this.cntCptList[this.globalIndex].demoData.pic = res.data.url this.focusedCpt.configuration = JSON.stringify(this.focusedCpt.configuration) + this.focusedCpt.demoData = JSON.stringify(this.cntCptList[this.globalIndex].demoData) } } }