fix: 修改 type类型字段 跟接口一直 修改misc 显示错误的问题

This commit is contained in:
zhangyu
2021-12-17 14:47:21 +08:00
parent 8cec356014
commit b91fed6f83
7 changed files with 32 additions and 23 deletions

View File

@@ -29,7 +29,7 @@
></chart-bar> ></chart-bar>
<chartHexagon <chartHexagon
:ref="'chart'+chartInfo.id" :ref="'chart'+chartInfo.id"
v-if="isHexagonFigure(chartInfo.type)" v-if="isHexagon(chartInfo.type)"
:chart-data="chartData" :chart-data="chartData"
:chart-info="chartInfo" :chart-info="chartInfo"
:chart-option="chartOption" :chart-option="chartOption"
@@ -83,14 +83,14 @@
:is-fullscreen="isFullscreen" :is-fullscreen="isFullscreen"
:chart-option="chartOption" :chart-option="chartOption"
></chart-diagram> ></chart-diagram>
<chartAutoCarousel <chartAutotopology
:ref="'chart' + chartInfo.id" :ref="'chart' + chartInfo.id"
v-if="isAutoCarousel(chartInfo.type)" v-if="isAutotopology(chartInfo.type)"
:chart-data="chartData" :chart-data="chartData"
:chart-info="chartInfo" :chart-info="chartInfo"
:chart-option="chartOption" :chart-option="chartOption"
:is-fullscreen="isFullscreen" :is-fullscreen="isFullscreen"
></chartAutoCarousel> ></chartAutotopology>
<chartMap <chartMap
:ref="'chart' + chartInfo.id" :ref="'chart' + chartInfo.id"
v-if="isMap(chartInfo.type)" v-if="isMap(chartInfo.type)"
@@ -140,7 +140,7 @@
<script> <script>
import loading from '@/components/common/loading' import loading from '@/components/common/loading'
import chartAssetInfo from './chart/chartAssetInfo' import chartAssetInfo from './chart/chartAssetInfo'
import chartAutoCarousel from './chart/chartAutoCarousel' import chartAutotopology from './chart/chartAutotopology'
import chartBar from './chart/chartBar' import chartBar from './chart/chartBar'
import chartClock from './chart/chartClock' import chartClock from './chart/chartClock'
import chartDiagram from './chart/chartDiagram' import chartDiagram from './chart/chartDiagram'
@@ -159,7 +159,7 @@ import chartUrl from './chart/chartUrl'
import chartValue from './chart/chartValue' import chartValue from './chart/chartValue'
import chartHexagon from './chart/chartHexagon' import chartHexagon from './chart/chartHexagon'
import chartMap from './chart/chartMap' 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' import lodash from 'lodash'
export default { export default {
@@ -167,7 +167,7 @@ export default {
components: { components: {
loading, loading,
chartAssetInfo, chartAssetInfo,
chartAutoCarousel, chartAutotopology,
chartBar, chartBar,
chartClock, chartClock,
chartDiagram, chartDiagram,
@@ -211,7 +211,7 @@ export default {
}, },
methods: { methods: {
isTimeSeries, isTimeSeries,
isHexagonFigure, isHexagon,
isChartPie, isChartPie,
isChartBar, isChartBar,
isUrl, isUrl,
@@ -221,7 +221,7 @@ export default {
isStat, isStat,
isDiagram, isDiagram,
isGroup, isGroup,
isAutoCarousel, isAutotopology,
isAssetInfo, isAssetInfo,
isEndpointInfo, isEndpointInfo,
isMap, isMap,

View File

@@ -26,7 +26,7 @@ import topology from '@/components/common/project/topologyL5'
import chartMixin from '@/components/chart/chartMixin' import chartMixin from '@/components/chart/chartMixin'
import bus from '@/libs/bus' import bus from '@/libs/bus'
export default { export default {
name: 'chartAutoCarousel', name: 'chartAutotopology',
data () { data () {
return { return {
topologyLoading: false, topologyLoading: false,

View File

@@ -51,8 +51,8 @@ export function isTimeSeries (type) {
return type === chartType.line || type === chartType.area || type === chartType.point return type === chartType.line || type === chartType.area || type === chartType.point
} }
export function isHexagonFigure (type) { export function isHexagon (type) {
return type === chartType.hexagonFigure return type === chartType.hexagon
} }
export function isChartPie (type) { export function isChartPie (type) {
return type === chartType.pie return type === chartType.pie
@@ -82,8 +82,8 @@ export function isDiagram (type) {
export function isGroup (type) { export function isGroup (type) {
return type === chartType.group return type === chartType.group
} }
export function isAutoCarousel (type) { export function isAutotopology (type) {
return type === chartType.carousel return type === chartType.topology
} }
export function isAssetInfo (type) { export function isAssetInfo (type) {
return type === chartType.assetInfo return type === chartType.assetInfo

View File

@@ -188,7 +188,7 @@ export default {
break break
} }
case 'misc': { case 'misc': {
if (this.chartInfo.type === 'hexagonFigure') { if (this.chartInfo.type === 'hexagon') {
this.getHexagonFigureData().then(res => { this.getHexagonFigureData().then(res => {
this.chartData = res this.chartData = res
}).finally(() => { }).finally(() => {
@@ -207,8 +207,8 @@ export default {
this.chartData = [...this.chartInfo.children] this.chartData = [...this.chartInfo.children]
this.groupInit() this.groupInit()
} }
if (this.chartInfo.type === 'carousel') { if (this.chartInfo.type === 'topology') {
this.chartData = ['carousel'] this.chartData = ['topology']
} }
if (this.chartInfo.type === 'map') { if (this.chartInfo.type === 'map') {
this.chartData = ['map'] this.chartData = ['map']

View File

@@ -405,8 +405,7 @@ export const chartType = {
endpointInfo: 'endpointInfo', endpointInfo: 'endpointInfo',
topology: 'topology', topology: 'topology',
map: 'map', map: 'map',
hexagonFigure: 'hexagonFigure', hexagon: 'hexagon'
carousel: 'carousel'
} }
export const chartLegendPlacement = { export const chartLegendPlacement = {

View File

@@ -138,6 +138,16 @@ export default {
return false return false
default: return false default: return false
} }
},
contentShow (type) {
switch (type) {
case 'group' :
case 'map' :
case 'topology' :
case 'hexagon' :
return false
default: return true
}
} }
} }
} }

View File

@@ -101,7 +101,7 @@
</el-form-item> </el-form-item>
</div> </div>
<!--content--> <!--content-->
<div v-if="!isGroup(chartConfig.type)" class="form__sub-title"> <div v-if="contentShow(chartConfig.type)" class="form__sub-title">
<span>{{$t('dashboard.panel.chartForm.content')}}</span> <span>{{$t('dashboard.panel.chartForm.content')}}</span>
<span style="cursor: pointer" v-if="isDiagram(chartConfig.type)"><i class="nz-icon nz-icon-edit" @click="topologyDialogChange(true)"></i></span> <span style="cursor: pointer" v-if="isDiagram(chartConfig.type)"><i class="nz-icon nz-icon-edit" @click="topologyDialogChange(true)"></i></span>
</div> </div>
@@ -171,11 +171,11 @@ export default {
name: this.$t('dashboard.panel.chartForm.typeVal.map.label') name: this.$t('dashboard.panel.chartForm.typeVal.map.label')
}, },
{ {
id: 'carousel', id: 'topology',
name: this.$t('dashboard.panel.chartForm.typeVal.carousel.label') name: this.$t('dashboard.panel.chartForm.typeVal.topology.label')
}, },
{ {
id: 'hexagonFigure', id: 'hexagon',
name: this.$t('dashboard.panel.chartForm.typeVal.hexagonFigure.label') name: this.$t('dashboard.panel.chartForm.typeVal.hexagonFigure.label')
} }
] ]