fix: 走马灯快速点击单独刷新 加载错误的问题
This commit is contained in:
@@ -2,11 +2,12 @@
|
|||||||
<div v-my-loading="topologyLoading" class="overview">
|
<div v-my-loading="topologyLoading" class="overview">
|
||||||
<transition name = "el-zoom-in-center">
|
<transition name = "el-zoom-in-center">
|
||||||
<div v-if="allProject&&allProject.length>0" style="width: 100%;height: 100%;position: relative">
|
<div v-if="allProject&&allProject.length>0" style="width: 100%;height: 100%;position: relative">
|
||||||
<el-carousel :interval="5000" :trigger="'click'" :autoplay="true" arrow="hover">
|
<el-carousel :interval="5000" :trigger="'click'" :autoplay="true" arrow="hover" @change="carouselChange">
|
||||||
<el-carousel-item v-for="(item,index) in allProject" :key="index" style="min-height: 10px;min-width: 10px">
|
<el-carousel-item v-for="(item,index) in allProject" :key="index" style="min-height: 10px;min-width: 10px">
|
||||||
<div class="maskLayer" @click="toProject(item)"></div>
|
<div class="maskLayer" @click="toProject(item)"></div>
|
||||||
<!-- <span class="project-name">{{item.name}}</span>-->
|
<!-- <span class="project-name">{{item.name}}</span>-->
|
||||||
<meta2dMain
|
<meta2dMain
|
||||||
|
v-if="item.isLoad"
|
||||||
:meta2dId="'autoTopology' + item.id + (isFullscreen ? 'screen' : '')"
|
:meta2dId="'autoTopology' + item.id + (isFullscreen ? 'screen' : '')"
|
||||||
:topoData="item.topoData"
|
:topoData="item.topoData"
|
||||||
:isPreview="true"
|
:isPreview="true"
|
||||||
@@ -47,11 +48,18 @@ export default {
|
|||||||
initChart () {
|
initChart () {
|
||||||
this.queryAllProjectData()
|
this.queryAllProjectData()
|
||||||
},
|
},
|
||||||
|
carouselChange (index) {
|
||||||
|
this.allProject.forEach(item => {
|
||||||
|
item.isLoad = false
|
||||||
|
})
|
||||||
|
this.allProject[index].isLoad = true
|
||||||
|
},
|
||||||
queryAllProjectData () {
|
queryAllProjectData () {
|
||||||
this.isInit = false
|
this.isInit = false
|
||||||
this.$get('monitor/project', { pageSize: -1 }).then(res => {
|
this.$get('monitor/project', { pageSize: -1 }).then(res => {
|
||||||
this.topologyLoading = true
|
this.topologyLoading = true
|
||||||
this.allProject = []
|
this.allProject = []
|
||||||
|
this.timeArray = []
|
||||||
let axiosAll = []
|
let axiosAll = []
|
||||||
let temp = []
|
let temp = []
|
||||||
if (res.data.list.length === 0) {
|
if (res.data.list.length === 0) {
|
||||||
@@ -77,10 +85,15 @@ export default {
|
|||||||
item.params = {
|
item.params = {
|
||||||
timeType: item.topo.timeType || 5
|
timeType: item.topo.timeType || 5
|
||||||
}
|
}
|
||||||
// temp.push(item)
|
if (index === 0) {
|
||||||
setTimeout(() => {
|
item.isLoad = true
|
||||||
this.allProject.push(item)
|
} else {
|
||||||
}, index * 200)
|
item.isLoad = false
|
||||||
|
}
|
||||||
|
this.allProject.push(item)
|
||||||
|
// setTimeout(() => {
|
||||||
|
// item.isLoad = true
|
||||||
|
// }, index * 200)
|
||||||
})
|
})
|
||||||
// temp.push(res2[2])
|
// temp.push(res2[2])
|
||||||
// this.allProject = JSON.parse(JSON.stringify(temp))
|
// this.allProject = JSON.parse(JSON.stringify(temp))
|
||||||
|
|||||||
@@ -16,6 +16,9 @@
|
|||||||
<li v-for="i in $CONSTANTS.intervalList" :key="i.value + i.label" :style="{color:interval === i.value || interval.value === i.value ? theme.themeColor : ''}" class="el-dropdown-menu__item dropdown-content" @click="selectInterval(i,true)">
|
<li v-for="i in $CONSTANTS.intervalList" :key="i.value + i.label" :style="{color:interval === i.value || interval.value === i.value ? theme.themeColor : ''}" class="el-dropdown-menu__item dropdown-content" @click="selectInterval(i,true)">
|
||||||
{{$t(i.label)}}
|
{{$t(i.label)}}
|
||||||
</li>
|
</li>
|
||||||
|
<li :key="-1" style="display: none" class="el-dropdown-menu__item dropdown-content" @click="selectInterval({label: 10, value: 10},true)">
|
||||||
|
{{$t(10)}}
|
||||||
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</transition>
|
</transition>
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { Meta2d, registerNode, s8 } from '@meta2d/core'
|
import { registerNode, s8 } from '@meta2d/core'
|
||||||
import { flowPens } from '@meta2d/flow-diagram'
|
import { flowPens } from '@meta2d/flow-diagram'
|
||||||
import { activityDiagram } from '@meta2d/activity-diagram'
|
import { activityDiagram } from '@meta2d/activity-diagram'
|
||||||
import { classPens } from '@meta2d/class-diagram'
|
import { classPens } from '@meta2d/class-diagram'
|
||||||
@@ -84,7 +84,7 @@ export default {
|
|||||||
maxScale: 2,
|
maxScale: 2,
|
||||||
autoAnchor: false
|
autoAnchor: false
|
||||||
}
|
}
|
||||||
const meta2d = new Meta2d(this.meta2dId, meta2dOptions)
|
const meta2d = new window.Meta2d(this.meta2dId, meta2dOptions)
|
||||||
meta2d.register(flowPens())
|
meta2d.register(flowPens())
|
||||||
meta2d.register(activityDiagram())
|
meta2d.register(activityDiagram())
|
||||||
meta2d.register(classPens())
|
meta2d.register(classPens())
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ import plTable from 'pl-table'
|
|||||||
import VueClipboard from 'vue-clipboard2'
|
import VueClipboard from 'vue-clipboard2'
|
||||||
import 'pl-table/themes/index.css'
|
import 'pl-table/themes/index.css'
|
||||||
import { post, get, put, del } from '@/http.js'
|
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 { 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 tools from '@/components/common/js/tools.js'
|
||||||
import * as constants from '@/components/common/js/constants.js'
|
import * as constants from '@/components/common/js/constants.js'
|
||||||
@@ -65,6 +66,7 @@ Pace.options = {
|
|||||||
ghostTime: 0.1,
|
ghostTime: 0.1,
|
||||||
restartOnRequestAfter: 0.1
|
restartOnRequestAfter: 0.1
|
||||||
}
|
}
|
||||||
|
window.Meta2d = Meta2d
|
||||||
Vue.use(VMdPreview)
|
Vue.use(VMdPreview)
|
||||||
Vue.use(Pace)
|
Vue.use(Pace)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user