diff --git a/nezha-fronted/.gitignore b/nezha-fronted/.gitignore index 541a820f6..722b02965 100644 --- a/nezha-fronted/.gitignore +++ b/nezha-fronted/.gitignore @@ -1,6 +1,7 @@ .DS_Store node_modules/ /dist/ +/static/ npm-debug.log* yarn-debug.log* yarn-error.log* diff --git a/nezha-fronted/src/components/charts/chart-list.vue b/nezha-fronted/src/components/charts/chart-list.vue index 657db9b2a..8de506cc7 100644 --- a/nezha-fronted/src/components/charts/chart-list.vue +++ b/nezha-fronted/src/components/charts/chart-list.vue @@ -352,7 +352,7 @@ export default { newWeights.push({ id: chart.id, groupId: item.id, weight: this.dataList.length + i }) }) } else { - item.children= [] + item.children = [] } }) const panelId = this.pagePanelId @@ -1467,24 +1467,31 @@ export default { chartInfo.name = this.$t('asset.assetInfo') const detail = [] if (!this.isModel) { - this.$refs['editChart' + chartInfo.id][0].showLoad() const assetId = this.additionalInfo.assetId ? this.additionalInfo.assetId : this.additionalInfo.id - this.$get('/asset/info?id=' + assetId).then(response => { - if (response.code == 200) { - response.data && (function () { - response.data.Basic && detail.push({ - title: vm.$t('project.chart.basicTitle'), - type: 'basic', - data: response.data.Basic - }) - response.data.Attribute && detail.push({ - title: vm.$t('asset.featureTitle'), - type: 'attribute', - data: response.data.Attribute - }) - }()) - } - this.$refs['editChart' + chartInfo.id][0].setData(chartInfo, detail, this.filter.panelId, this.filter) + const arr = [] + arr.push(this.$get(`/asset/asset/${assetId}`)) + arr.push(this.$get(`/asset/asset/feature/${assetId}`)) + this.$refs['editChart' + chartInfo.id][0].showLoad() + + // this.$get('/asset/info?id=' + assetId).then(response => { + // if (response.code == 200) { + // response.data && (function () { + // response.data.Basic && detail.push({ + // title: vm.$t('project.chart.basicTitle'), + // type: 'basic', + // data: response.data.Basic + // }) + // response.data.Attribute && detail.push({ + // title: vm.$t('asset.featureTitle'), + // type: 'attribute', + // data: response.data.Attribute + // }) + // }()) + // } + // }) + Promise.all(arr).then(res => { + console.log(res) + // this.$refs['editChart' + chartInfo.id][0].setData(chartInfo, detail, this.filter.panelId, this.filter) }) } else { detail.push({ diff --git a/nezha-fronted/src/components/common/popBox/topToolMoreOptions.vue b/nezha-fronted/src/components/common/popBox/topToolMoreOptions.vue index 7eb3db24e..7c3431d7c 100644 --- a/nezha-fronted/src/components/common/popBox/topToolMoreOptions.vue +++ b/nezha-fronted/src/components/common/popBox/topToolMoreOptions.vue @@ -245,6 +245,13 @@ export default { }, exportCur () { const params = Object.assign({}, this.params) + if (this.exportUrl.indexOf('panel') > -1) { + params.pageSize = -1 + delete params.start_time + delete params.end_time + delete params.id + delete params.searchName + } params.language = localStorage.getItem('nz-language') || 'en' this.exportExcel(this.exportUrl, params, this.exportFileName + '-' + this.getTimeString() + '.xlsx') this.closeDialog() @@ -252,6 +259,12 @@ export default { exportAll () { const params = JSON.parse(JSON.stringify(this.params)) params.pageSize = -1 + if (this.exportUrl.indexOf('panel') > -1) { + delete params.start_time + delete params.end_time + delete params.id + delete params.searchName + } if (this.importUrl.indexOf('panel') > -1) { delete params.panelId }