From b91fed6f830679a71c19b8f2b19b95cd5cf9bd7b Mon Sep 17 00:00:00 2001 From: zhangyu Date: Fri, 17 Dec 2021 14:47:21 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9A=20=E4=BF=AE=E6=94=B9=20type?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B=E5=AD=97=E6=AE=B5=20=E8=B7=9F=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E4=B8=80=E7=9B=B4=20=E4=BF=AE=E6=94=B9misc=20?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E9=94=99=E8=AF=AF=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nezha-fronted/src/components/chart/chart.vue | 18 +++++++++--------- ...tAutoCarousel.vue => chartAutotopology.vue} | 2 +- .../src/components/chart/chart/tools.js | 8 ++++---- .../src/components/chart/panelChart.vue | 6 +++--- .../src/components/common/js/constants.js | 3 +-- .../common/rightBox/chart/chartTypeShow.js | 10 ++++++++++ .../common/rightBox/chart/otherChartConfig.vue | 8 ++++---- 7 files changed, 32 insertions(+), 23 deletions(-) rename nezha-fronted/src/components/chart/chart/{chartAutoCarousel.vue => chartAutotopology.vue} (99%) diff --git a/nezha-fronted/src/components/chart/chart.vue b/nezha-fronted/src/components/chart/chart.vue index fa79c4b96..39610a7bf 100644 --- a/nezha-fronted/src/components/chart/chart.vue +++ b/nezha-fronted/src/components/chart/chart.vue @@ -29,7 +29,7 @@ > - + > import loading from '@/components/common/loading' import chartAssetInfo from './chart/chartAssetInfo' -import chartAutoCarousel from './chart/chartAutoCarousel' +import chartAutotopology from './chart/chartAutotopology' import chartBar from './chart/chartBar' import chartClock from './chart/chartClock' import chartDiagram from './chart/chartDiagram' @@ -159,7 +159,7 @@ import chartUrl from './chart/chartUrl' import chartValue from './chart/chartValue' import chartHexagon from './chart/chartHexagon' import chartMap from './chart/chartMap' -import { getOption, isTimeSeries, isHexagonFigure, isUrl, isText, isChartPie, isChartBar, isTreemap, isLog, isStat, isDiagram, isGroup, isAutoCarousel, isMap, isAssetInfo, isEndpointInfo, isTable } from './chart/tools' +import { getOption, isTimeSeries, isHexagon, isUrl, isText, isChartPie, isChartBar, isTreemap, isLog, isStat, isDiagram, isGroup, isAutotopology, isMap, isAssetInfo, isEndpointInfo, isTable } from './chart/tools' import lodash from 'lodash' export default { @@ -167,7 +167,7 @@ export default { components: { loading, chartAssetInfo, - chartAutoCarousel, + chartAutotopology, chartBar, chartClock, chartDiagram, @@ -211,7 +211,7 @@ export default { }, methods: { isTimeSeries, - isHexagonFigure, + isHexagon, isChartPie, isChartBar, isUrl, @@ -221,7 +221,7 @@ export default { isStat, isDiagram, isGroup, - isAutoCarousel, + isAutotopology, isAssetInfo, isEndpointInfo, isMap, diff --git a/nezha-fronted/src/components/chart/chart/chartAutoCarousel.vue b/nezha-fronted/src/components/chart/chart/chartAutotopology.vue similarity index 99% rename from nezha-fronted/src/components/chart/chart/chartAutoCarousel.vue rename to nezha-fronted/src/components/chart/chart/chartAutotopology.vue index bd0196864..48600ba15 100644 --- a/nezha-fronted/src/components/chart/chart/chartAutoCarousel.vue +++ b/nezha-fronted/src/components/chart/chart/chartAutotopology.vue @@ -26,7 +26,7 @@ import topology from '@/components/common/project/topologyL5' import chartMixin from '@/components/chart/chartMixin' import bus from '@/libs/bus' export default { - name: 'chartAutoCarousel', + name: 'chartAutotopology', data () { return { topologyLoading: false, diff --git a/nezha-fronted/src/components/chart/chart/tools.js b/nezha-fronted/src/components/chart/chart/tools.js index 099a49b8a..38f977e73 100644 --- a/nezha-fronted/src/components/chart/chart/tools.js +++ b/nezha-fronted/src/components/chart/chart/tools.js @@ -51,8 +51,8 @@ export function isTimeSeries (type) { return type === chartType.line || type === chartType.area || type === chartType.point } -export function isHexagonFigure (type) { - return type === chartType.hexagonFigure +export function isHexagon (type) { + return type === chartType.hexagon } export function isChartPie (type) { return type === chartType.pie @@ -82,8 +82,8 @@ export function isDiagram (type) { export function isGroup (type) { return type === chartType.group } -export function isAutoCarousel (type) { - return type === chartType.carousel +export function isAutotopology (type) { + return type === chartType.topology } export function isAssetInfo (type) { return type === chartType.assetInfo diff --git a/nezha-fronted/src/components/chart/panelChart.vue b/nezha-fronted/src/components/chart/panelChart.vue index d6c7d6bc7..63e0a1ebc 100644 --- a/nezha-fronted/src/components/chart/panelChart.vue +++ b/nezha-fronted/src/components/chart/panelChart.vue @@ -188,7 +188,7 @@ export default { break } case 'misc': { - if (this.chartInfo.type === 'hexagonFigure') { + if (this.chartInfo.type === 'hexagon') { this.getHexagonFigureData().then(res => { this.chartData = res }).finally(() => { @@ -207,8 +207,8 @@ export default { this.chartData = [...this.chartInfo.children] this.groupInit() } - if (this.chartInfo.type === 'carousel') { - this.chartData = ['carousel'] + if (this.chartInfo.type === 'topology') { + this.chartData = ['topology'] } if (this.chartInfo.type === 'map') { this.chartData = ['map'] diff --git a/nezha-fronted/src/components/common/js/constants.js b/nezha-fronted/src/components/common/js/constants.js index e94ec7450..3a121e4a3 100644 --- a/nezha-fronted/src/components/common/js/constants.js +++ b/nezha-fronted/src/components/common/js/constants.js @@ -405,8 +405,7 @@ export const chartType = { endpointInfo: 'endpointInfo', topology: 'topology', map: 'map', - hexagonFigure: 'hexagonFigure', - carousel: 'carousel' + hexagon: 'hexagon' } export const chartLegendPlacement = { diff --git a/nezha-fronted/src/components/common/rightBox/chart/chartTypeShow.js b/nezha-fronted/src/components/common/rightBox/chart/chartTypeShow.js index cc612b4fd..23901a398 100644 --- a/nezha-fronted/src/components/common/rightBox/chart/chartTypeShow.js +++ b/nezha-fronted/src/components/common/rightBox/chart/chartTypeShow.js @@ -138,6 +138,16 @@ export default { return false default: return false } + }, + contentShow (type) { + switch (type) { + case 'group' : + case 'map' : + case 'topology' : + case 'hexagon' : + return false + default: return true + } } } } diff --git a/nezha-fronted/src/components/common/rightBox/chart/otherChartConfig.vue b/nezha-fronted/src/components/common/rightBox/chart/otherChartConfig.vue index 08538b615..41cf2b946 100644 --- a/nezha-fronted/src/components/common/rightBox/chart/otherChartConfig.vue +++ b/nezha-fronted/src/components/common/rightBox/chart/otherChartConfig.vue @@ -101,7 +101,7 @@ -
+
{{$t('dashboard.panel.chartForm.content')}}
@@ -171,11 +171,11 @@ export default { name: this.$t('dashboard.panel.chartForm.typeVal.map.label') }, { - id: 'carousel', - name: this.$t('dashboard.panel.chartForm.typeVal.carousel.label') + id: 'topology', + name: this.$t('dashboard.panel.chartForm.typeVal.topology.label') }, { - id: 'hexagonFigure', + id: 'hexagon', name: this.$t('dashboard.panel.chartForm.typeVal.hexagonFigure.label') } ]