diff --git a/src/components/charts/PieTable.vue b/src/components/charts/PieTable.vue index 1223ff93..bec659d3 100644 --- a/src/components/charts/PieTable.vue +++ b/src/components/charts/PieTable.vue @@ -117,7 +117,7 @@ export default { expandRowKeys: [], tableTitles: [ { - label: this.$t('common.domain'), + label: this.$t('overall.domain'), prop: 'domain', width: '20%' }, @@ -127,44 +127,44 @@ export default { width: '22%' }, { - label: this.$t('common.sessions'), + label: this.$t('overall.sessions'), prop: 'sessions', width: '18%' }, { - label: this.$t('common.packets'), + label: this.$t('overall.packets'), prop: 'packets', width: '18%' }, { - label: this.$t('common.bytes'), + label: this.$t('overall.bytes'), prop: 'bytes', width: '18%' } ], tableTitlesOther: [ { - label: this.$t('common.serverIp'), + label: this.$t('overall.serverIp'), prop: 'serverIp', width: '20%' }, { - label: this.$t('common.reputation'), + label: this.$t('overall.reputation'), prop: 'nameColumn', width: '22%' }, { - label: this.$t('common.sessions'), + label: this.$t('overall.sessions'), prop: 'sessions', width: '18%' }, { - label: this.$t('common.packets'), + label: this.$t('overall.packets'), prop: 'packets', width: '18%' }, { - label: this.$t('common.bytes'), + label: this.$t('overall.bytes'), prop: 'bytes', width: '18%' } diff --git a/src/components/charts/StatisticsLegend.vue b/src/components/charts/StatisticsLegend.vue index b4e342e1..e6661b0d 100644 --- a/src/components/charts/StatisticsLegend.vue +++ b/src/components/charts/StatisticsLegend.vue @@ -7,7 +7,7 @@
Max
-
+
{{item.legend}}
{{unitConvert(item.aggregation.avg, chartInfo.params.unitType).join(' ')}}
@@ -27,6 +27,11 @@ export default { data: Array, chartInfo: Object }, + methods: { + toggleLegend (index) { + this.$emit('toggleLegend', index) + } + }, setup () { return { getChartColor, @@ -99,4 +104,13 @@ export default { text-overflow: ellipsis; white-space: nowrap; } +.table-below-box:not(.chart__table-top) { + cursor: pointer; +} +.table-below-box.table-below-box--inactivated { + color: #ccc; + .table__below-color div { + background-color: #ccc !important; + } +} diff --git a/src/components/charts/chart-table-title.js b/src/components/charts/chart-table-title.js index b408c969..852907a7 100644 --- a/src/components/charts/chart-table-title.js +++ b/src/components/charts/chart-table-title.js @@ -2,73 +2,73 @@ import i18n from '@/i18n' export const allTableTitle = { tableTitles10: [ { - label: i18n.global.t('common.clientIp'), + label: i18n.global.t('overall.clientIp'), prop: 'clientIp' }, { - label: i18n.global.t('common.sessions'), + label: i18n.global.t('overall.sessions'), prop: 'sessions' }, { - label: i18n.global.t('common.bytes'), + label: i18n.global.t('overall.bytes'), prop: 'bytes' }, { - label: i18n.global.t('common.packets'), + label: i18n.global.t('overall.packets'), prop: 'packets' } ], tableTitles13: [ { - label: i18n.global.t('common.serverIp'), + label: i18n.global.t('overall.serverIp'), prop: 'serverIp' }, { - label: i18n.global.t('common.sessions'), + label: i18n.global.t('overall.sessions'), prop: 'sessions' }, { - label: i18n.global.t('common.bytes'), + label: i18n.global.t('overall.bytes'), prop: 'bytes' }, { - label: i18n.global.t('common.packets'), + label: i18n.global.t('overall.packets'), prop: 'packets' } ], tableTitles14: [ { - label: i18n.global.t('common.domain'), + label: i18n.global.t('overall.domain'), prop: 'domain' }, { - label: i18n.global.t('common.sessions'), + label: i18n.global.t('overall.sessions'), prop: 'sessions' }, { - label: i18n.global.t('common.bytes'), + label: i18n.global.t('overall.bytes'), prop: 'bytes' }, { - label: i18n.global.t('common.packets'), + label: i18n.global.t('overall.packets'), prop: 'packets' } ], tableTitles15: [ { - label: i18n.global.t('common.appName'), + label: i18n.global.t('overall.appName'), prop: 'appName' }, { - label: i18n.global.t('common.sessions'), + label: i18n.global.t('overall.sessions'), prop: 'sessions' }, { - label: i18n.global.t('common.bytes'), + label: i18n.global.t('overall.bytes'), prop: 'bytes' }, { - label: i18n.global.t('common.packets'), + label: i18n.global.t('overall.packets'), prop: 'packets' } ] diff --git a/src/components/entities/EntityList.vue b/src/components/entities/EntityList.vue index 79aada4b..57200043 100644 --- a/src/components/entities/EntityList.vue +++ b/src/components/entities/EntityList.vue @@ -25,18 +25,18 @@
diff --git a/src/components/entities/LeftFilter.vue b/src/components/entities/LeftFilter.vue index e0b1d518..43bbbd83 100644 --- a/src/components/entities/LeftFilter.vue +++ b/src/components/entities/LeftFilter.vue @@ -26,7 +26,7 @@
-
{{$t('common.showMore')}}
+
{{$t('overall.showMore')}}
diff --git a/src/views/charts/Chart.vue b/src/views/charts/Chart.vue index 7fb117ec..80a35865 100644 --- a/src/views/charts/Chart.vue +++ b/src/views/charts/Chart.vue @@ -72,7 +72,7 @@ @@ -119,7 +119,7 @@ size="mini" v-model="table.orderBy" class="option__select select-column" - :placeholder="$t('common.field')" + :placeholder="$t('overall.field')" popper-class="option-popper" @change="tableLimitChange" > @@ -416,6 +416,22 @@ export default { getTargetPageData (pageNum, pageSize, tableData) { return this.$_.slice(tableData, (pageNum - 1) * pageSize, pageNum * pageSize) }, + toggleStatisticsLegend (index) { + this.statisticsData[index].active = !this.statisticsData[index].active + this.statisticsData.forEach((d, i) => { + if (d.active) { + this.myChart.dispatchAction({ + type: 'legendSelect', + name: d.legend + }) + } else { + this.myChart.dispatchAction({ + type: 'legendUnSelect', + name: d.legend + }) + } + }) + }, orderPieTableChange () { if (this.chart.type === 31) { const chartParams = this.chartInfo.params || null // 图表参数 @@ -452,7 +468,12 @@ export default { const queryParams = { startTime: parseInt(this.timeFilter.startTime / 1000), endTime: parseInt(this.timeFilter.endTime / 1000) } get(replaceUrlPlaceholder(chartParams.url, queryParams)).then(response => { if (response.code === 200) { - this.statisticsData = response.data.result + this.statisticsData = response.data.result.map(d => { + return { + ...d, + active: true + } + }) const seriesTemplate = this.chartOption.series[0] this.chartOption.series = response.data.result.map((r, i) => { return {