fix :修改 chartDiagram
This commit is contained in:
@@ -1,31 +1,56 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="chart-diagram" v-if="chartInfo.loaded">
|
<div class="chart-diagram" v-if="chartInfo.loaded">
|
||||||
<diagram
|
<!-- <diagram-->
|
||||||
style="height: 100%;width: 100%"
|
<!-- style="height: 100%;width: 100%"-->
|
||||||
:topoData="chartInfo.param.topo"
|
<!-- :topoData="chartInfo.param.topo"-->
|
||||||
:fromChart="true"
|
<!-- :fromChart="true"-->
|
||||||
:isScreen="isFullscreen"
|
<!-- :isScreen="isFullscreen"-->
|
||||||
:topologyIndexF="isFullscreen ? (chartInfo.id + '-' + 'isFullscreen') : chartInfo.id"
|
<!-- :topologyIndexF="isFullscreen ? (chartInfo.id + '-' + 'isFullscreen') : chartInfo.id"-->
|
||||||
:isPanel="true"
|
<!-- :isPanel="true"-->
|
||||||
ref="diagram"
|
<!-- ref="diagram"-->
|
||||||
:chartInfo="chartInfo" />
|
<!-- :chartInfo="chartInfo" />-->
|
||||||
|
<meta2dMain :meta2dId="chartInfo.id + '-' + isFullscreen" :topoData="chartInfo.param.topo" :querysArray="querysArray" :params="params" :iconArray="iconArray" :isChart="true"/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import diagram from '@/components/common/ChartDiagram/diagram'
|
import beforeMeta2d from '@/components/common/mixin/beforeMeta2d'
|
||||||
|
import meta2dMain from '@/components/common/project/meta2d/meta2dMain'
|
||||||
|
import { clearTopology } from '@/components/common/js/common'
|
||||||
import chartMixin from '@/components/chart/chartMixin'
|
import chartMixin from '@/components/chart/chartMixin'
|
||||||
import chartFormat from '@/components/chart/chartFormat'
|
import chartFormat from '@/components/chart/chartFormat'
|
||||||
|
import bus from '@/libs/bus'
|
||||||
export default {
|
export default {
|
||||||
name: 'chart-diagram',
|
name: 'chart-diagram',
|
||||||
mixins: [chartMixin, chartFormat],
|
mixins: [chartMixin, chartFormat, beforeMeta2d],
|
||||||
components: {
|
components: {
|
||||||
diagram
|
meta2dMain
|
||||||
|
},
|
||||||
|
data () {
|
||||||
|
return {
|
||||||
|
isPreview: {
|
||||||
|
show: false,
|
||||||
|
topoData: {},
|
||||||
|
querysArray: {},
|
||||||
|
currentProject: {},
|
||||||
|
params: {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted () {
|
||||||
|
bus.$on('showMeta2dPreview', (params) => {
|
||||||
|
this.isPreview = params
|
||||||
|
})
|
||||||
|
console.log(JSON.stringify(this.chartInfo.param.topo))
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
resize () {
|
resize () {
|
||||||
this.$refs.diagram.winResize()
|
this.$refs.diagram.winResize()
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
destroyed () {
|
||||||
|
bus.$off('showMeta2dPreview')
|
||||||
|
clearTopology()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -137,6 +137,7 @@ export const chartTimeSeriesLineOption = {
|
|||||||
],
|
],
|
||||||
series: [{
|
series: [{
|
||||||
name: '',
|
name: '',
|
||||||
|
cursor: 'pointer',
|
||||||
type: 'line',
|
type: 'line',
|
||||||
symbol: 'emptyCircle', // 去掉点
|
symbol: 'emptyCircle', // 去掉点
|
||||||
connectNulls: true,
|
connectNulls: true,
|
||||||
|
|||||||
@@ -18,9 +18,9 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
reload () {
|
reload () {
|
||||||
|
console.log(123213)
|
||||||
if (this.currentProject.id) {
|
if (this.currentProject.id) {
|
||||||
this.$get('monitor/project/topo', { projectId: this.currentProject.id }).then(res => {
|
this.$get('monitor/project/topo', { projectId: this.currentProject.id }).then(res => {
|
||||||
|
|
||||||
if (res.data && res.data.topo) {
|
if (res.data && res.data.topo) {
|
||||||
this.topoData = res.data.topo || {}
|
this.topoData = res.data.topo || {}
|
||||||
if (res.data.topo.topo) {
|
if (res.data.topo.topo) {
|
||||||
@@ -38,6 +38,26 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
} else if (this.isChart) {
|
||||||
|
const res = {
|
||||||
|
data: this.chartInfo.param
|
||||||
|
}
|
||||||
|
if (res.data && res.data.topo) {
|
||||||
|
this.topoData = res.data.topo || {}
|
||||||
|
if (res.data.topo.topo) {
|
||||||
|
this.topoData = res.data.topo.topo || {}
|
||||||
|
}
|
||||||
|
this.querysArray = res.data.topo.elements || []
|
||||||
|
this.params = {
|
||||||
|
timeType: res.data.topo.timeType || 5
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.topoData = {}
|
||||||
|
this.querysArray = []
|
||||||
|
this.params = {
|
||||||
|
timeType: 5
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -127,11 +127,13 @@ export default {
|
|||||||
const endTime = new Date().getTime()
|
const endTime = new Date().getTime()
|
||||||
const startTime = endTime - 60 * this.params.timeType * 1000
|
const startTime = endTime - 60 * this.params.timeType * 1000
|
||||||
this.getQueryValues(this.querysArray, startTime, endTime).then((arr) => {
|
this.getQueryValues(this.querysArray, startTime, endTime).then((arr) => {
|
||||||
this.clacTopoData(this.topoData, arr).then((data) => {
|
this.clacTopoData(this.$loadsh.cloneDeep(this.topoData), arr).then((data) => {
|
||||||
if (!getTopology(this.meta2dId)) {
|
if (!getTopology(this.meta2dId)) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
this.getModule()
|
if (this.project) {
|
||||||
|
this.getModule()
|
||||||
|
}
|
||||||
getTopology(this.meta2dId).resize()
|
getTopology(this.meta2dId).resize()
|
||||||
getTopology(this.meta2dId).open(data)
|
getTopology(this.meta2dId).open(data)
|
||||||
if (this.isChart) {
|
if (this.isChart) {
|
||||||
@@ -140,7 +142,7 @@ export default {
|
|||||||
getTopology(this.meta2dId).centerView()
|
getTopology(this.meta2dId).centerView()
|
||||||
}
|
}
|
||||||
getTopology(this.meta2dId).lock(1)
|
getTopology(this.meta2dId).lock(1)
|
||||||
this.getNodesArr()
|
// this.getNodesArr()
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
@@ -9,7 +9,7 @@
|
|||||||
>
|
>
|
||||||
</topology-top-tool>
|
</topology-top-tool>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="!editFlag" class="top-tool-right">
|
<div v-if="!isChart && !editFlag" class="top-tool-right">
|
||||||
<pick-time
|
<pick-time
|
||||||
v-show="!editFlag"
|
v-show="!editFlag"
|
||||||
ref="pickTime"
|
ref="pickTime"
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
@getNodesArr="getNodesArr"
|
@getNodesArr="getNodesArr"
|
||||||
/>
|
/>
|
||||||
<div class="meta2d-main" :class="isChart ? 'meta2d-chart': 'meta2d-project'" @contextmenu="onContextMenu($event)" style="position: relative">
|
<div class="meta2d-main" :class="isChart ? 'meta2d-chart': 'meta2d-project'" @contextmenu="onContextMenu($event)" style="position: relative">
|
||||||
<div v-for="(item,index) in nodesArr" v-if="!editFlag"
|
<div v-for="(item,index) in nodesArr" v-if="!editFlag && project"
|
||||||
:key="index"
|
:key="index"
|
||||||
v-show="(item.y + offsetY - 48 > -20) && (item.x + item.width/2 + offsetX - 24 > - 20)"
|
v-show="(item.y + offsetY - 48 > -20) && (item.x + item.width/2 + offsetX - 24 > - 20)"
|
||||||
:style="{position: 'absolute',top:item.y + offsetY - 48 + 'px',left:item.x + item.width/2 + offsetX - 24 +'px', 'z-index': 10}"
|
:style="{position: 'absolute',top:item.y + offsetY - 48 + 'px',left:item.x + item.width/2 + offsetX - 24 +'px', 'z-index': 10}"
|
||||||
@@ -110,7 +110,7 @@
|
|||||||
<script>
|
<script>
|
||||||
import meta2dHeader from '@/components/common/project/meta2d/meta2dHeader'
|
import meta2dHeader from '@/components/common/project/meta2d/meta2dHeader'
|
||||||
import meta2dProps from '@/components/common/project/meta2d/meta2dProps'
|
import meta2dProps from '@/components/common/project/meta2d/meta2dProps'
|
||||||
import meta2dMain from '@/components/common/project/meta2d/js/meta2dMain'
|
import meta2dMainCalc from '@/components/common/project/meta2d/js/meta2dMainCalc'
|
||||||
import meta2dTooltip from '@/components/common/project/meta2d/meta2dTooltip'
|
import meta2dTooltip from '@/components/common/project/meta2d/meta2dTooltip'
|
||||||
import CanvasContextMenu from '@/components/common/project/meta2d/CanvasContextMenu'
|
import CanvasContextMenu from '@/components/common/project/meta2d/CanvasContextMenu'
|
||||||
import popDataMain from '@/components/common/project/popData/Main'
|
import popDataMain from '@/components/common/project/popData/Main'
|
||||||
@@ -124,7 +124,7 @@ import bus from '@/libs/bus'
|
|||||||
import { globalStore } from '@meta2d/core'
|
import { globalStore } from '@meta2d/core'
|
||||||
export default {
|
export default {
|
||||||
name: 'meta2dMain',
|
name: 'meta2dMain',
|
||||||
mixins: [meta2dMain, topoUtil],
|
mixins: [meta2dMainCalc, topoUtil],
|
||||||
props: {
|
props: {
|
||||||
meta2dId: {}, // 唯一id 不可重复
|
meta2dId: {}, // 唯一id 不可重复
|
||||||
iconArray: {
|
iconArray: {
|
||||||
@@ -167,6 +167,7 @@ export default {
|
|||||||
topoData: {
|
topoData: {
|
||||||
immediate: false,
|
immediate: false,
|
||||||
handler () {
|
handler () {
|
||||||
|
console.log(123213)
|
||||||
if (!this.isChart) {
|
if (!this.isChart) {
|
||||||
this.reload()
|
this.reload()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -141,7 +141,8 @@
|
|||||||
<el-form-item v-if="isDiagram(chartConfig.type)" >
|
<el-form-item v-if="isDiagram(chartConfig.type)" >
|
||||||
<div class="topology-box">
|
<div class="topology-box">
|
||||||
<div class="topology-mc"></div>
|
<div class="topology-mc"></div>
|
||||||
<diagram :topoData="chartConfig.param.topo" :fromChartBox="true" :topologyIndexF="-1"/>
|
<!-- <diagram :topoData="chartConfig.param.topo" :fromChartBox="true" :topologyIndexF="-1"/>-->
|
||||||
|
<meta2dMain :meta2dId="'rightBoxChart'" :topoData="chartConfig.param.topo" :querysArray="[]" :params="params" :iconArray="iconArray" @reload="reload"/>
|
||||||
</div>
|
</div>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<!--topplogy-->
|
<!--topplogy-->
|
||||||
@@ -298,9 +299,12 @@ import publicConfig from '@/components/common/rightBox/chart/publicConfig'
|
|||||||
import chartTypeShow from '@/components/common/rightBox/chart/chartTypeShow'
|
import chartTypeShow from '@/components/common/rightBox/chart/chartTypeShow'
|
||||||
import diagram from '@/components/common/ChartDiagram/diagram'
|
import diagram from '@/components/common/ChartDiagram/diagram'
|
||||||
import richTextEditor from '@/components/chart/richTextEditor'
|
import richTextEditor from '@/components/chart/richTextEditor'
|
||||||
|
import beforeMeta2d from '@/components/common/mixin/beforeMeta2d'
|
||||||
|
import meta2dMain from '@/components/common/project/meta2d/meta2dMain'
|
||||||
|
import { clearTopology } from '@/components/common/js/common'
|
||||||
export default {
|
export default {
|
||||||
name: 'otherChartConfig',
|
name: 'otherChartConfig',
|
||||||
mixins: [publicConfig, chartTypeShow],
|
mixins: [publicConfig, chartTypeShow, beforeMeta2d],
|
||||||
components: {
|
components: {
|
||||||
diagram,
|
diagram,
|
||||||
richTextEditor
|
richTextEditor
|
||||||
|
|||||||
Reference in New Issue
Block a user