异步数据导致渲染过早无法加载监控
This commit is contained in:
@@ -90,7 +90,7 @@ export default {
|
|||||||
this.dashboard = JSON.parse(res.data.config).dashboard
|
this.dashboard = JSON.parse(res.data.config).dashboard
|
||||||
Promise.all(layers.map(item => Promise.resolve().then(() => {
|
Promise.all(layers.map(item => Promise.resolve().then(() => {
|
||||||
if (item.dataType !== 'staticData' && ((item.type.indexOf('Chart') > -1) || ['display', 'table', 'map', 'summary', 'AiRanking', 'AiDvTable'].includes(item.type))) {
|
if (item.dataType !== 'staticData' && ((item.type.indexOf('Chart') > -1) || ['display', 'table', 'map', 'summary', 'AiRanking', 'AiDvTable'].includes(item.type))) {
|
||||||
return this.getSourceData(item, index)
|
return this.getSourceData(item)
|
||||||
}
|
}
|
||||||
if (item.type === 'monitor' && item.monitorType === 'cmcc') {
|
if (item.type === 'monitor' && item.monitorType === 'cmcc') {
|
||||||
return item.moniterId && this.instance.post(`${this.urlPrefix}/appzyvideoequipment/getWebSdkUrl?deviceId=${item.moniterId}`).then(res => {
|
return item.moniterId && this.instance.post(`${this.urlPrefix}/appzyvideoequipment/getWebSdkUrl?deviceId=${item.moniterId}`).then(res => {
|
||||||
@@ -113,7 +113,7 @@ export default {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
getSourceData(item, index) {
|
getSourceData(item) {
|
||||||
const api = item.dataType === 'apiData' ? item.api : `${this.urlPrefix}/appdiylargescreen/statisticsByLsid?id=${item.sourceDataId}`
|
const api = item.dataType === 'apiData' ? item.api : `${this.urlPrefix}/appdiylargescreen/statisticsByLsid?id=${item.sourceDataId}`
|
||||||
return this.instance.post(api).then(res => {
|
return this.instance.post(api).then(res => {
|
||||||
if (res?.data) {
|
if (res?.data) {
|
||||||
|
|||||||
Reference in New Issue
Block a user