From 6dae7ed6e52dc185fa7f7460a2e481b2d3d86d9a Mon Sep 17 00:00:00 2001 From: zhangyu Date: Thu, 6 Apr 2023 16:28:32 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9A=20=E8=B5=B0=E9=A9=AC=E7=81=AF?= =?UTF-8?q?=E5=BF=AB=E9=80=9F=E7=82=B9=E5=87=BB=E5=8D=95=E7=8B=AC=E5=88=B7?= =?UTF-8?q?=E6=96=B0=20=E5=8A=A0=E8=BD=BD=E9=94=99=E8=AF=AF=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../chart/chart/chartAutotopology.vue | 23 +++++++++++++++---- .../src/components/common/pickTime.vue | 3 +++ .../common/project/meta2d/js/meta2dMain.js | 4 ++-- nezha-fronted/src/entrance/app/main.js | 2 ++ 4 files changed, 25 insertions(+), 7 deletions(-) diff --git a/nezha-fronted/src/components/chart/chart/chartAutotopology.vue b/nezha-fronted/src/components/chart/chart/chartAutotopology.vue index 435af3ae9..64194a4d7 100644 --- a/nezha-fronted/src/components/chart/chart/chartAutotopology.vue +++ b/nezha-fronted/src/components/chart/chart/chartAutotopology.vue @@ -2,11 +2,12 @@
- +
{ + item.isLoad = false + }) + this.allProject[index].isLoad = true + }, queryAllProjectData () { this.isInit = false this.$get('monitor/project', { pageSize: -1 }).then(res => { this.topologyLoading = true this.allProject = [] + this.timeArray = [] let axiosAll = [] let temp = [] if (res.data.list.length === 0) { @@ -77,10 +85,15 @@ export default { item.params = { timeType: item.topo.timeType || 5 } - // temp.push(item) - setTimeout(() => { - this.allProject.push(item) - }, index * 200) + if (index === 0) { + item.isLoad = true + } else { + item.isLoad = false + } + this.allProject.push(item) + // setTimeout(() => { + // item.isLoad = true + // }, index * 200) }) // temp.push(res2[2]) // this.allProject = JSON.parse(JSON.stringify(temp)) diff --git a/nezha-fronted/src/components/common/pickTime.vue b/nezha-fronted/src/components/common/pickTime.vue index 6b4e8d00e..bc987fc72 100644 --- a/nezha-fronted/src/components/common/pickTime.vue +++ b/nezha-fronted/src/components/common/pickTime.vue @@ -16,6 +16,9 @@ + diff --git a/nezha-fronted/src/components/common/project/meta2d/js/meta2dMain.js b/nezha-fronted/src/components/common/project/meta2d/js/meta2dMain.js index 7b484f8b9..cba3b49b2 100644 --- a/nezha-fronted/src/components/common/project/meta2d/js/meta2dMain.js +++ b/nezha-fronted/src/components/common/project/meta2d/js/meta2dMain.js @@ -1,4 +1,4 @@ -import { Meta2d, registerNode, s8 } from '@meta2d/core' +import { registerNode, s8 } from '@meta2d/core' import { flowPens } from '@meta2d/flow-diagram' import { activityDiagram } from '@meta2d/activity-diagram' import { classPens } from '@meta2d/class-diagram' @@ -84,7 +84,7 @@ export default { maxScale: 2, autoAnchor: false } - const meta2d = new Meta2d(this.meta2dId, meta2dOptions) + const meta2d = new window.Meta2d(this.meta2dId, meta2dOptions) meta2d.register(flowPens()) meta2d.register(activityDiagram()) meta2d.register(classPens()) diff --git a/nezha-fronted/src/entrance/app/main.js b/nezha-fronted/src/entrance/app/main.js index 640903c02..990e89908 100644 --- a/nezha-fronted/src/entrance/app/main.js +++ b/nezha-fronted/src/entrance/app/main.js @@ -22,6 +22,7 @@ import plTable from 'pl-table' import VueClipboard from 'vue-clipboard2' import 'pl-table/themes/index.css' import { post, get, put, del } from '@/http.js' +import { Meta2d } from '@meta2d/core' import { clickoutside, bottomBoxWindow, stringTimeParseToUnix, unixTimeParseToString, chartResizeTool, tableSet, cancelWithChange, myLoading } from '@/components/common/js/tools.js' import * as tools from '@/components/common/js/tools.js' import * as constants from '@/components/common/js/constants.js' @@ -65,6 +66,7 @@ Pace.options = { ghostTime: 0.1, restartOnRequestAfter: 0.1 } +window.Meta2d = Meta2d Vue.use(VMdPreview) Vue.use(Pace)