修改大屏

new-map
ihzero 2022-11-14 10:13:48 +08:00
parent 9f974c8976
commit 88971f7c42
3 changed files with 83 additions and 25 deletions

View File

@ -141,33 +141,61 @@
let timer: any = null let timer: any = null
function chartAmi() { function chartAmi() {
let index = 0 let index = 0
const timerNumber = 3000
let sleep = 1
timer && clearInterval(timer) timer && clearInterval(timer)
timer = setInterval(() => { timer = setInterval(() => {
const currentIndex = index % legendData.length const currentIndex = index % 4
// getInstance()?.dispatchAction({ sleep = index % (4 * 2)
// type: 'legendUnSelect',
// name: legendData[currentIndex],
// })
// getInstance()?.dispatchAction({
// type: 'legendSelect',
// name: legendData[currentIndex],
// })
getInstance()?.dispatchAction({ getInstance()?.dispatchAction({
type: 'showTip', type: 'showTip',
seriesIndex: 0, seriesIndex: 0,
dataIndex: currentIndex, dataIndex: currentIndex,
}) })
if (sleep == 7) {
chartLineAmi()
}
index++ index++
}, 3000) }, timerNumber)
}
function chartLineAmi() {
const timerNumber = 3000
timer && clearInterval(timer)
let legendIndex = legendData.length
let sleep = 6000 / 3000
timer = setInterval(() => {
getInstance()?.dispatchAction({
type: 'hideTip',
})
if (legendIndex == legendData.length) {
legendData.forEach((_, index) => {
getInstance()?.dispatchAction({
type: 'legendUnSelect',
name: legendData[index],
})
})
}
if (legendIndex >= 0) {
getInstance()?.dispatchAction({
type: 'legendSelect',
name: legendData[legendIndex - 1],
})
}
if (legendIndex <= 0) {
if (sleep <= 0) getData()
sleep--
}
legendIndex--
}, timerNumber)
} }
onBeforeMount(() => { onBeforeMount(() => {
getData() getData()
rootEmitter.on('interval:auto', () => { rootEmitter.on('interval:auto', () => {
getData() // getData()
}) })
}) })

View File

@ -191,18 +191,12 @@
let timer: any = null let timer: any = null
function chartAmi() { function chartAmi() {
let index = 0 let index = 0
const timerNumber = 3000
let sleep = 1
timer && clearInterval(timer) timer && clearInterval(timer)
timer = setInterval(() => { timer = setInterval(() => {
const currentIndex = index % legendData.length const currentIndex = index % 4
// getInstance()?.dispatchAction({ sleep = index % (4 * 2)
// type: 'legendUnSelect',
// name: legendData[currentIndex],
// })
// getInstance()?.dispatchAction({
// type: 'legendSelect',
// name: legendData[currentIndex],
// })
getInstance()?.dispatchAction({ getInstance()?.dispatchAction({
type: 'showTip', type: 'showTip',
@ -210,8 +204,43 @@
dataIndex: currentIndex, dataIndex: currentIndex,
}) })
if (sleep == 7) {
chartLineAmi()
}
index++ index++
}, 3000) }, timerNumber)
}
function chartLineAmi() {
const timerNumber = 3000
timer && clearInterval(timer)
let legendIndex = legendData.length
let sleep = 6000 / 3000
timer = setInterval(() => {
getInstance()?.dispatchAction({
type: 'hideTip',
})
if (legendIndex == legendData.length) {
legendData.forEach((_, index) => {
getInstance()?.dispatchAction({
type: 'legendUnSelect',
name: legendData[index],
})
})
}
if (legendIndex >= 0) {
getInstance()?.dispatchAction({
type: 'legendSelect',
name: legendData[legendIndex - 1],
})
}
if (legendIndex <= 0) {
if (sleep <= 0) getData()
sleep--
}
legendIndex--
}, timerNumber)
} }
watch( watch(
@ -224,7 +253,7 @@
onBeforeMount(() => { onBeforeMount(() => {
getData() getData()
rootEmitter.on('interval:auto', () => { rootEmitter.on('interval:auto', () => {
getData() // getData()
}) })
}) })

View File

@ -1,7 +1,8 @@
<template> <template>
<ScaleScreen :boxStyle="{ background: '#020603' }" :width="3120" :height="760" :autoScale="true"> <ScaleScreen :boxStyle="{ background: '#020603' }" :width="3120" :height="760" :autoScale="true">
<!-- <div class="overflow-y-scroll"> --> <!-- <div class="overflow-y-scroll"> -->
<div class="flex flex-col h-full bg-img relative w-3120px h-760px"> <!-- w-3120px h-760px -->
<div class="flex flex-col h-full bg-img relative">
<canvas <canvas
class="absolute left-0 top-0 w-full h-full overflow-hidden" class="absolute left-0 top-0 w-full h-full overflow-hidden"
ref="cavsRef" ref="cavsRef"