From 1720fc979c7ed8db26b7ab969d2973df07442892 Mon Sep 17 00:00:00 2001 From: chenjinsong <523037378@qq.com> Date: Mon, 26 Sep 2022 16:58:33 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=88=A0=E9=99=A4npm=20event=E7=9B=B8?= =?UTF-8?q?=E5=85=B3=E6=97=A0=E7=94=A8=E5=86=85=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/charts2/Chart.vue | 55 +------------------------------------ 1 file changed, 1 insertion(+), 54 deletions(-) diff --git a/src/views/charts2/Chart.vue b/src/views/charts2/Chart.vue index b243e139..4d8918bf 100644 --- a/src/views/charts2/Chart.vue +++ b/src/views/charts2/Chart.vue @@ -27,7 +27,7 @@ :ref="`tab${chart.id}`" @toggleLoading="toggleLoading" > - -1 } }, - mounted () { - this.getChartData() - }, setup (props) { const dateRangeValue = 60 const { startTime, endTime } = getNowTime(dateRangeValue) @@ -259,56 +256,6 @@ export default { npmTabChange (index) { this.$emit('npmTabChange', index) }, - reload () { - this.getChartData() - }, - /* 参数 extraParams 额外请求参数 */ - getChartData (url, extraParams = {}, chartTimeFilter) { - try { - if (chartTimeFilter) { - // 图表自带timeFilter刷新时 - this.queryTimeRange = { - startTime: getSecond(chartTimeFilter.startTime), - endTime: getSecond(chartTimeFilter.endTime) - } - } else if (this.timeFilter) { - this.queryTimeRange = { - startTime: getSecond(this.timeFilter.startTime), - endTime: getSecond(this.timeFilter.endTime) - } - } else { - this.queryTimeRange = { - startTime: getSecond(this.chartTimeFilter.startTime), - endTime: getSecond(this.chartTimeFilter.endTime) - } - } - const chartParams = this.chart.params - // 接口查询参数 - this.queryParams = { - ...this.queryTimeRange, - ...extraParams - } - let requestUrl = url || chartParams.url - - if (this.chart.type === typeMapping.networkOverview.table) { - const chartObj = this.$refs['tab' + this.chart.id] - requestUrl = url || chartObj.getCurUrl() - this.queryParams = { - ...chartObj.handleQueryParams(extraParams), - ...this.queryTimeRange - } - } - if (requestUrl) { - get(requestUrl, this.queryParams).then(response => { - if (response.code === 200) { - this.chartData = response.data.result - } - }) - } - } catch (e) { - console.error(e) - } - }, resizeLine () { this.$nextTick(function () { setTimeout(() => {