diff --git a/src/views/charts/Chart.vue b/src/views/charts/Chart.vue index a3da178b..6ce29805 100644 --- a/src/views/charts/Chart.vue +++ b/src/views/charts/Chart.vue @@ -6,6 +6,7 @@ @@ -14,6 +15,7 @@ v-else-if="isMap && !isIpBasicInfo" :chart-info="chartInfo" :chart-data="chartData" + :time-filter="timeFilter" :query-params="queryParams" :entity="entity" @getChartData="getChartData" @@ -24,14 +26,16 @@ v-else-if="isSingleValue" :chart-info="chartInfo" :chart-data="chartData" + :time-filter="timeFilter" :query-params="queryParams" @showLoading="showLoading" > @@ -66,6 +74,7 @@ :chart-info="chartInfo" :chart-data="chartData" :result-type="resultType" + :time-filter="timeFilter" :query-params="queryParams" @showLoading="showLoading" > @@ -75,6 +84,7 @@ :chart-info="chartInfo" :chart-data="chartData" :result-type="resultType" + :time-filter="timeFilter" :query-params="queryParams" @showLoading="showLoading" > @@ -84,6 +94,7 @@ :chart-info="chartInfo" :chart-data="chartData" :table="table" + :time-filter="timeFilter" :query-params="queryParams" @showLoading="showLoading" > @@ -93,6 +104,7 @@ :chart-info="chartInfo" :chart-data="chartData" :table="table" + :time-filter="timeFilter" :query-params="queryParams" > @@ -100,6 +112,7 @@ v-else-if="isAppBasicInfo" :chart-info="chartInfo" :chart-data="chartData" + :time-filter="timeFilter" :query-params="queryParams" > @@ -107,6 +120,7 @@ v-else-if="isDomainWhois" :chart-info="chartInfo" :chart-data="chartData" + :time-filter="timeFilter" :query-params="queryParams" > @@ -114,6 +128,7 @@ v-else-if="isDomainDnsRecord" :chart-info="chartInfo" :chart-data="chartData" + :time-filter="timeFilter" :query-params="queryParams" > @@ -121,6 +136,7 @@ v-else-if="isCryptocurrencyEventList" :chart-info="chartInfo" :chart-data="chartData" + :time-filter="timeFilter" :query-params="queryParams" > @@ -128,6 +144,7 @@ v-else-if="isRelationShip" :chart-info="chartInfo" :chart-data="chartData" + :time-filter="timeFilter" :query-params="queryParams" > @@ -135,6 +152,7 @@ v-else-if="isSankey" :chart-info="chartInfo" :chart-data="chartData" + :time-filter="timeFilter" :query-params="queryParams" :entity="entity" > @@ -144,6 +162,8 @@ :chart-info="chartInfo" :chart-data="chartData" :result-type="resultType" + :time-filter="timeFilter" + :query-params="queryParams" @showLoading="showLoading" > @@ -152,6 +172,8 @@ :chart-info="chartInfo" :chart-data="chartData" :result-type="resultType" + :time-filter="timeFilter" + :query-params="queryParams" @showLoading="showLoading" > @@ -160,6 +182,7 @@ :chart-info="chartInfo" :chart-data="chartData" :query-params="queryParams" + :time-filter="timeFilter" :result-type="resultType" :order-pie-table="orderPieTable" @showLoading="showLoading" @@ -167,8 +190,10 @@ @@ -179,6 +204,8 @@ :chart-data="chartData" @showLoading="showLoading" :entity="entity" + :time-filter="timeFilter" + :query-params="queryParams" > @@ -337,8 +369,9 @@ export default { entity: Object, isError: Boolean, table: Object, + timeFilter: Object, orderPieTable: Object, - tabHandleClickType: String, + tabHandleClickType: String }, computed: { isNoData() { @@ -389,19 +422,12 @@ export default { }, }, watch: { - chartData: { - deep: true, - handler(n) {}, - }, tabHandleClickType: { deep: true, handler(n) { this.tabHandleClickType = n }, - }, - queryParams: { - deep: true, - }, + } }, setup(props) { return { diff --git a/src/views/charts/ChartHeader.vue b/src/views/charts/ChartHeader.vue index 6e034e90..0e56634a 100644 --- a/src/views/charts/ChartHeader.vue +++ b/src/views/charts/ChartHeader.vue @@ -311,11 +311,12 @@ export default { this.$emit('refresh') }, timeRefreshChange() { + // 不是自选时间 if (!this.$refs.dateTimeRange.isCustom) { const value = this.chartTimeFilter.dateRangeValue this.$refs.dateTimeRange.quickChange(value) } else { - this.$emit('refresh') + this.$emit('refresh', this.chartTimeFilter) } }, reload(s, e, v) { @@ -326,7 +327,6 @@ export default { }, dateTimeRangeChange(s, e, v) { this.chartTimeFilter = { startTime: s, endTime: e, dateRangeValue: v } - console.log(this.chartTimeFilter) this.$emit('refresh', this.chartTimeFilter) }, tableLimitChange() { diff --git a/src/views/charts/Panel.vue b/src/views/charts/Panel.vue index e2d278df..bf3b3579 100644 --- a/src/views/charts/Panel.vue +++ b/src/views/charts/Panel.vue @@ -146,6 +146,7 @@ export default { callback({ startTime: myStartTime, endTime: myEndTime }) }, timeRefreshChange () { + // 不是自选时间 if (!this.$refs.dateTimeRange.isCustom) { const value = this.timeFilter.dateRangeValue this.$refs.dateTimeRange.quickChange(value) diff --git a/src/views/charts/PanelChart.vue b/src/views/charts/PanelChart.vue index 0d92ba55..649af453 100644 --- a/src/views/charts/PanelChart.vue +++ b/src/views/charts/PanelChart.vue @@ -38,6 +38,7 @@ :table="table" :is-fullscreen="isFullscreen" :order-pie-table="orderPieTable" + :time-filter="timeFilter" @getChartData="getChartData" @showLoading="showLoading" :tabHandleClickType="tabHandleClickType" @@ -191,7 +192,7 @@ export default { ...this.handleQueryParams(), ...this.queryTimeRange, ...this.entity, - + ...extraParams } const requestUrl = url || (chartParams && chartParams.url) @@ -288,13 +289,20 @@ export default { this.$refs.chart.resize() }, refresh (chartTimeFilter) { - const myEndTime = window.$dayJs.tz().valueOf() - const myStartTime = myEndTime - this.chartTimeFilter.dateRangeValue * 60 * 1000 - this.standaloneTimeRange.use = true - this.standaloneTimeRange.startTime = myStartTime - this.standaloneTimeRange.endTime = myEndTime - this.emitter.emit('chart-pageNo') - this.getChartData(null, {}, true, chartTimeFilter) + if (chartTimeFilter) { + this.timeFilter.startTime = chartTimeFilter.startTime + this.timeFilter.endTime = chartTimeFilter.endTime + this.timeFilter.dateRangeValue = chartTimeFilter.dateRangeValue + this.getChartData(null, {}, true, chartTimeFilter) + } else { + const myEndTime = window.$dayJs.tz().valueOf() + const myStartTime = myEndTime - this.timeFilter.dateRangeValue * 60 * 1000 + this.standaloneTimeRange.use = true + this.standaloneTimeRange.startTime = myStartTime + this.standaloneTimeRange.endTime = myEndTime + this.emitter.emit('chart-pageNo') + this.getChartData(null, {}, true) + } }, tabHandleClick (value) { this.tabHandleClickType = value @@ -371,9 +379,6 @@ export default { mounted () { this.showLoading(true) this.getChartData() - // setTimeout(() => { - // this.getChartData() - // }, 200) }, setup (props) { const dateRangeValue = 60 diff --git a/src/views/charts/charts/ChartBlock.vue b/src/views/charts/charts/ChartBlock.vue index b5c38a5e..b1171777 100644 --- a/src/views/charts/charts/ChartBlock.vue +++ b/src/views/charts/charts/ChartBlock.vue @@ -14,9 +14,6 @@ import chartMixin from '@/views/charts/charts/chart-mixin' export default { name: 'ChartBlock', mixins: [chartMixin], - props: { - timeFilter: Object - }, data () { return { dataList: [], @@ -26,14 +23,11 @@ export default { }, mounted () { this.dataList = JSON.parse(JSON.stringify(this.chartInfo.children)) - // this.time = JSON.parse(JSON.stringify(this.timeFilter)) this.firstShow = true }, methods: { reload () { - console.log(123132) this.dataList = JSON.parse(JSON.stringify(this.chartInfo.children)) - // this.time = JSON.parse(JSON.stringify(this.timeFilter)) } } } diff --git a/src/views/charts/charts/ChartGroup.vue b/src/views/charts/charts/ChartGroup.vue index 84cca306..987f0bfb 100644 --- a/src/views/charts/charts/ChartGroup.vue +++ b/src/views/charts/charts/ChartGroup.vue @@ -1,6 +1,7 @@