From fde1edb0a61b411ad236177c7ee6bf94337362a1 Mon Sep 17 00:00:00 2001
From: loulijun2021 <1694218219@qq.com>
Date: 星期一, 10 十月 2022 14:31:04 +0800
Subject: [PATCH] 1.综合看板修改
---
src/views/kb/zhkb.vue | 507 ++++++++++++++++++++++++++++++++++++++++---------------
1 files changed, 364 insertions(+), 143 deletions(-)
diff --git a/src/views/kb/zhkb.vue b/src/views/kb/zhkb.vue
index 288c494..4e47f08 100644
--- a/src/views/kb/zhkb.vue
+++ b/src/views/kb/zhkb.vue
@@ -238,7 +238,7 @@
this.getzhkb02()
setInterval(() => {
this.getzhkb02()
- }, 1000 * 18)
+ }, 1000 * 16)
this.getzhkb12()
setInterval(() => {
@@ -248,23 +248,241 @@
this.getzhkb13()
setInterval(() => {
this.getzhkb13()
- }, 1000 * 50)
+ }, 1000 * 19)
+
+ // this.getzhkb11()
},
methods: {
+ // 娴嬭瘯鑷姩鎾斁tooltip
+ getzhkb11() {
+ const option = {
+ backgroundColor: 'transparent',
+ // title: {
+ // text: '鏃舵-杩涘嚭娓祦閲�',
+ // left: '5%',
+ // top: '5%',
+ // textStyle: {
+ // color: '#fff',
+ // fontSize: '18px'
+ // }
+ // },
+ tooltip: {
+ trigger: 'axis',
+ axisPointer: {
+ type: 'shadow'
+ }
+ },
+ legend: [
+ {
+ icon: 'react',
+ right: '0%',
+ top: '0%',
+ textStyle: {
+ color: '#fff',
+ fontSize: 14
+ },
+ itemGap: 30,
+ itemWidth: 30,
+ itemHeight: 4,
+ data: ['璁惧鍒╃敤鐜�', '璁惧寮�鏈虹巼']
+ }
+ ],
+ grid: {
+ top: '10%',
+ right: '5%',
+ left: '1%',
+ bottom: '0%',
+ containLabel: true
+ },
+ yAxis: [
+ {
+ type: 'category',
+ data: ['鍐烽暒杞﹂棿', '鐑ⅸ杞﹂棿', '杈惧厠缃楄溅闂�', '纾峰寲杞﹂棿', '娉ㄥ杞﹂棿'],
+ axisLine: {
+ lineStyle: {
+ color: '#4E84AC'
+ // width: 2
+ }
+ },
+ axisTick: {
+ show: false
+ },
+ axisLabel: {
+ // margin: 10,
+ color: '#09d8f2',
+ textStyle: {
+ fontSize: 16
+ }
+ }
+ }
+ ],
+ xAxis: [
+ {
+ axisLabel: {
+ formatter: '{value}',
+ color: '#6895CA',
+ textStyle: {
+ fontSize: 16,
+ color: this.colorX
+ }
+ },
+ axisLine: {
+ show: true,
+ lineStyle: {
+ width: 2,
+ color: '#4E84AC'
+ }
+ },
+ axisTick: {
+ show: false
+ },
+ splitLine: {
+ lineStyle: {
+ type: 'dashed',
+ // 浣跨敤娣辨祬鐨勯棿闅旇壊
+ color: '#184D9A'
+ }
+ }
+ }
+ ],
+ series: [
+ {
+ name: '璁惧鍒╃敤鐜�',
+ type: 'bar',
+ barGap: '70%',
+ data: [Math.ceil(30 + Math.random() * 20), Math.ceil(75 - Math.random() * 20), Math.ceil(77 - Math.random() * 20), Math.ceil(39 + Math.random() * 20), Math.ceil(85 - Math.random() * 20)],
+ barWidth: 12,
+ itemStyle: {
+ normal: {
+ color: {
+ type: 'linear',
+ x: 0,
+ y: 0,
+ x2: 1,
+ y2: 0,
+ colorStops: [
+ {
+ offset: 0,
+ color: '#00FFFF' // 0% 澶勭殑棰滆壊
+ },
+ {
+ offset: 1,
+ color: '#00FF00' // 100% 澶勭殑棰滆壊
+ }
+ ],
+ global: false // 缂虹渷涓� false
+ },
+ barBorderRadius: [30, 30, 30, 30],
+ shadowColor: 'rgba(0,160,221,1)',
+ shadowBlur: 4
+ }
+ },
+ label: {
+ normal: {
+ show: true,
+ // lineHeight: 20,
+ // width: 80,
+ // height: 20,
+ verticalAlign: 'center',
+ borderRadius: 200,
+ position: 'right',
+ color: '#00FF00',
+ fontSize: 16
+ }
+ }
+ },
+ {
+ name: '璁惧寮�鏈虹巼',
+ type: 'bar',
+ data: [Math.ceil(90 - Math.random() * 20), 45 + Math.ceil(Math.random() * 20), Math.ceil(27 + Math.random() * 20), Math.ceil(20 + Math.random() * 60), Math.ceil(85 - Math.random() * 20)],
+ barWidth: 12,
+ itemStyle: {
+ normal: {
+ color: {
+ type: 'linear',
+ x: 0,
+ y: 0,
+ x2: 1,
+ y2: 0,
+ colorStops: [
+ {
+ offset: 0,
+ color: '#00FFFF' // 0% 澶勭殑棰滆壊
+ },
+ {
+ offset: 1,
+ color: '#FFFF00' // 100% 澶勭殑棰滆壊
+ }
+ ],
+ global: false // 缂虹渷涓� false
+ },
+ barBorderRadius: [30, 30, 30, 30],
+ shadowColor: 'rgba(0,160,221,1)',
+ shadowBlur: 4
+ }
+ },
+ label: {
+ normal: {
+ show: true,
+ // lineHeight: 20,
+ // width: 80,
+ // height: 20,
+ borderRadius: 200,
+ verticalAlign: 'center',
+ // position: ['-0', '-20'],
+ position: 'right',
+ color: '#FFFF00',
+ fontSize: 16
+ }
+ }
+ }
+ ]
+ }
+
+ const myChart = echarts.init(document.getElementById('zhkb11'))
+
+ if (option.textStyle == null) {
+ option.textStyle = {
+ fontFamily: 'Microsoft YaHei',
+ color: '#ffffff'
+ }
+ }
+
+ // 浣跨敤鍒氭寚瀹氱殑閰嶇疆椤瑰拰鏁版嵁鏄剧ず鍥捐〃銆�
+ myChart.clear()
+ myChart.setOption(option, true)
+
+ window.addEventListener('resize', function() {
+ myChart.resize()
+ })
+
+ let index = 0
+ setInterval(function() {
+ myChart.dispatchAction({
+ type: 'showTip',
+ seriesIndex: 0,
+ dataIndex: index
+ })
+ index++
+ if (index > 4) {
+ index = 0
+ }
+ }, 2000)
+ },
getAllEcharts() {
loadEcharts('zhkb01', zhkb01())
- loadEcharts('zhkb03', zhkb03())
- loadEcharts('zhkb03_2', zhkb03())
+ loadEcharts('zhkb03', zhkb03('铻烘瘝鎶曞叆浜у嚭鐜�'))
+ loadEcharts('zhkb03_2', zhkb03('铻烘潌鎶曞叆浜у嚭鐜�'))
loadEcharts('zhkb04', zhkb04())
loadEcharts('zhkb05', zhkb05())
- loadEcharts('zhkb06', zhkb06())
- loadEcharts('zhkb06_2', zhkb06())
- loadEcharts('zhkb07_1', zhkb07())
- loadEcharts('zhkb07_2', zhkb07())
- loadEcharts('zhkb07_3', zhkb07())
- loadEcharts('zhkb07_4', zhkb07())
- loadEcharts('zhkb07_5', zhkb07())
- loadEcharts('zhkb07_6', zhkb07())
+ loadEcharts('zhkb06', zhkb06('妫�楠屽強鏃剁巼'))
+ loadEcharts('zhkb06_2', zhkb06('鎴愬搧鍚堟牸鐜�'))
+ loadEcharts('zhkb07_1', zhkb07('閽㈡潗鏁呴殰', 96))
+ loadEcharts('zhkb07_2', zhkb07('鍐烽暒', 96))
+ loadEcharts('zhkb07_3', zhkb07('鐑ⅸ', 96))
+ loadEcharts('zhkb07_4', zhkb07('鐑鐞�', 95))
+ loadEcharts('zhkb07_5', zhkb07('杈惧厠缃�', 95))
+ loadEcharts('zhkb07_6', zhkb07('闀�閿�', 95))
loadEcharts('zhkb08', zhkb08())
loadEcharts('zhkb09', zhkb09())
loadEcharts('zhkb10', zhkb10())
@@ -272,21 +490,21 @@
setInterval(() => {
loadEcharts('zhkb01', zhkb01())
- }, 1000 * 13)
+ }, 1000 * 10)
setInterval(() => {
- loadEcharts('zhkb03', zhkb03())
- loadEcharts('zhkb03_2', zhkb03())
- }, 1000 * 14)
+ loadEcharts('zhkb03', zhkb03('铻烘瘝鎶曞叆浜у嚭鐜�'))
+ loadEcharts('zhkb03_2', zhkb03('铻烘潌鎶曞叆浜у嚭鐜�'))
+ }, 1000 * 12)
setInterval(() => {
loadEcharts('zhkb04', zhkb04())
- }, 1000 * 15)
+ }, 1000 * 14)
setInterval(() => {
loadEcharts('zhkb05', zhkb05())
- }, 1000 * 9)
+ }, 1000 * 16)
setInterval(() => {
- loadEcharts('zhkb06', zhkb06())
- loadEcharts('zhkb06_2', zhkb06())
- }, 1000 * 8)
+ loadEcharts('zhkb06', zhkb06('妫�楠屽強鏃剁巼'))
+ loadEcharts('zhkb06_2', zhkb06('鎴愬搧鍚堟牸鐜�'))
+ }, 1000 * 18)
// setInterval(() => {
// loadEcharts('zhkb07_1', zhkb07())
// loadEcharts('zhkb07_2', zhkb07())
@@ -297,32 +515,32 @@
// }, 1000 * 5)
setInterval(() => {
loadEcharts('zhkb08', zhkb08())
- }, 1000 * 9.5)
+ }, 1000 * 20)
setInterval(() => {
loadEcharts('zhkb09', zhkb09())
- }, 1000 * 10.5)
+ }, 1000 * 22)
setInterval(() => {
loadEcharts('zhkb10', zhkb10())
- }, 1000 * 7.5)
+ }, 1000 * 24)
setInterval(() => {
loadEcharts('zhkb11', zhkb11())
- }, 1000 * 11.5)
+ }, 1000 * 26)
},
getzhkb13() {
const colorList = ['#47A2FF ', '#53C8D1', '#59CB74', '#FBD444', '#7F6AAD', '#585247', '#00FFFF', '#ff00ff', '#00ff00', '#ffff00', '#ff0000', '#0000ff']
const data = [
- { name: '浜у搧1', value: 100 },
- { name: '浜у搧2', value: 200 },
- { name: '浜у搧3', value: 300 },
- { name: '浜у搧4', value: 400 },
- { name: '浜у搧5', value: 500 },
- { name: '浜у搧6', value: 550 },
- { name: '浜у搧7', value: 570 },
- { name: '浜у搧8', value: 570 },
- { name: '浜у搧9', value: 570 },
- { name: '浜у搧10', value: 570 },
- { name: '浜у搧11', value: 570 },
- { name: '浜у搧12', value: 570 }
+ { name: 'LB01 100', value: 100 },
+ { name: 'LB02 200', value: 200 },
+ { name: 'LB03 300', value: 300 },
+ { name: 'LB04 400', value: 400 },
+ { name: 'LB05 500', value: 500 },
+ { name: 'LB06 550', value: 550 },
+ { name: 'LB07 570', value: 570 },
+ { name: 'LB08 570', value: 570 },
+ { name: 'LB09 570', value: 570 },
+ { name: 'LB10 570', value: 570 },
+ { name: 'LB11 570', value: 570 },
+ { name: 'LB12 570', value: 570 }
]
const option = {
backgroundColor: 'transparent',
@@ -334,7 +552,7 @@
containLabel: true
},
title: {
- text: '38%',
+ text: 80 + Math.ceil(Math.random() * 10) + '%',
// subtext: '3',
textStyle: {
fontSize: 26,
@@ -358,7 +576,7 @@
left: '4%',
top: '20%',
itemGap: 20,
- // selectedMode: false,
+ selectedMode: false,
// icon: 'pin',
icon: 'roundRect',
data: data.map(r => r.name),
@@ -422,59 +640,59 @@
myChart.resize()
})
- var index = 0 // 鎾斁鎵�鍦ㄤ笅鏍�
- var mTime = setInterval(function() {
- myChart.dispatchAction({
- type: 'showTip',
- seriesIndex: 0,
- dataIndex: index
- })
- index++
- if (index > data.length - 1) {
- index = 0
- }
- }, 2000)
+ // var index = 0 // 鎾斁鎵�鍦ㄤ笅鏍�
+ // var mTime = setInterval(function() {
+ // myChart.dispatchAction({
+ // type: 'showTip',
+ // seriesIndex: 0,
+ // dataIndex: index
+ // })
+ // index++
+ // if (index > data.length - 1) {
+ // index = 0
+ // }
+ // }, 2000)
- var currentIndex = -1 // 褰撳墠楂樹寒鍥惧舰鍦ㄩゼ鍥炬暟鎹腑鐨勪笅鏍�
- var changePieInterval = setInterval(selectPie, 2000) // 璁剧疆鑷姩鍒囨崲楂樹寒鍥惧舰鐨勫畾鏃跺櫒
-
- function highlightPie() { // 鍙栨秷鎵�鏈夐珮浜苟楂樹寒褰撳墠鍥惧舰
- // 閬嶅巻楗煎浘鏁版嵁锛屽彇娑堟墍鏈夊浘褰㈢殑楂樹寒鏁堟灉
- option.series[0].data.forEach((item, index) => {
- myChart.dispatchAction({
- type: 'downplay',
- // type: 'showTip',
- seriesIndex: 0,
- dataIndex: index
- })
- })
-
- // // 楂樹寒褰撳墠鍥惧舰
- myChart.dispatchAction({
- type: 'highlight',
- seriesIndex: 0,
- dataIndex: currentIndex
- })
- }
-
- myChart.on('mouseover', (params) => { // 鐢ㄦ埛榧犳爣鎮诞鍒版煇涓�鍥惧舰鏃讹紝鍋滄鑷姩鍒囨崲骞堕珮浜紶鏍囨偓娴殑鍥惧舰
- clearInterval(changePieInterval)
- currentIndex = params.dataIndex
- highlightPie()
- })
-
- myChart.on('mouseout', (params) => { // 鐢ㄦ埛榧犳爣绉诲嚭鏃讹紝閲嶆柊寮�濮嬭嚜鍔ㄥ垏鎹�
- if (changePieInterval) {
- clearInterval(changePieInterval)
- }
- changePieInterval = setInterval(selectPie, 1000)
- })
-
- function selectPie() { // 楂樹寒鏁堟灉鍒囨崲鍒颁笅涓�涓浘褰�
- var dataLen = option.series[0].data.length
- currentIndex = (currentIndex + 1) % dataLen
- highlightPie()
- }
+ // var currentIndex = -1 // 褰撳墠楂樹寒鍥惧舰鍦ㄩゼ鍥炬暟鎹腑鐨勪笅鏍�
+ // var changePieInterval = setInterval(selectPie, 2000) // 璁剧疆鑷姩鍒囨崲楂樹寒鍥惧舰鐨勫畾鏃跺櫒
+ //
+ // function highlightPie() { // 鍙栨秷鎵�鏈夐珮浜苟楂樹寒褰撳墠鍥惧舰
+ // // 閬嶅巻楗煎浘鏁版嵁锛屽彇娑堟墍鏈夊浘褰㈢殑楂樹寒鏁堟灉
+ // option.series[0].data.forEach((item, index) => {
+ // myChart.dispatchAction({
+ // type: 'downplay',
+ // // type: 'showTip',
+ // seriesIndex: 0,
+ // dataIndex: index
+ // })
+ // })
+ //
+ // // // 楂樹寒褰撳墠鍥惧舰
+ // myChart.dispatchAction({
+ // type: 'highlight',
+ // seriesIndex: 0,
+ // dataIndex: currentIndex
+ // })
+ // }
+ //
+ // myChart.on('mouseover', (params) => { // 鐢ㄦ埛榧犳爣鎮诞鍒版煇涓�鍥惧舰鏃讹紝鍋滄鑷姩鍒囨崲骞堕珮浜紶鏍囨偓娴殑鍥惧舰
+ // clearInterval(changePieInterval)
+ // currentIndex = params.dataIndex
+ // highlightPie()
+ // })
+ //
+ // myChart.on('mouseout', (params) => { // 鐢ㄦ埛榧犳爣绉诲嚭鏃讹紝閲嶆柊寮�濮嬭嚜鍔ㄥ垏鎹�
+ // if (changePieInterval) {
+ // clearInterval(changePieInterval)
+ // }
+ // changePieInterval = setInterval(selectPie, 1000)
+ // })
+ //
+ // function selectPie() { // 楂樹寒鏁堟灉鍒囨崲鍒颁笅涓�涓浘褰�
+ // var dataLen = option.series[0].data.length
+ // currentIndex = (currentIndex + 1) % dataLen
+ // highlightPie()
+ // }
},
getzhkb12() {
const value1 = Math.ceil(Math.random() * 10 + 60)
@@ -851,6 +1069,7 @@
orient: 'vertical',
top: '30%',
left: '5%',
+ selectedMode: false,
textStyle: {
color: colorArr.map(r => r),
fontSize: 16
@@ -984,53 +1203,53 @@
myChart.resize()
})
- let currentIndex = -1 // 褰撳墠楂樹寒鍥惧舰鍦ㄩゼ鍥炬暟鎹腑鐨勪笅鏍�
- var changePieInterval = setInterval(selectPie, 2000) // 璁剧疆鑷姩鍒囨崲楂樹寒鍥惧舰鐨勫畾鏃跺櫒
-
- function highlightPie() { // 鍙栨秷鎵�鏈夐珮浜苟楂樹寒褰撳墠鍥惧舰
- // for (var idx in option.series[0].data) {
- // // 閬嶅巻楗煎浘鏁版嵁锛屽彇娑堟墍鏈夊浘褰㈢殑楂樹寒鏁堟灉
- // myChart.dispatchAction({
- // type: 'downplay',
- // seriesIndex: 0,
- // dataIndex: idx
- // })
- // }
- // 閬嶅巻楗煎浘鏁版嵁锛屽彇娑堟墍鏈夊浘褰㈢殑楂樹寒鏁堟灉
- option.series[0].data.forEach((item, index) => {
- myChart.dispatchAction({
- type: 'downplay',
- seriesIndex: 0,
- dataIndex: index
- })
- })
-
- // 楂樹寒褰撳墠鍥惧舰
- myChart.dispatchAction({
- type: 'highlight',
- seriesIndex: 0,
- dataIndex: currentIndex
- })
- }
-
- myChart.on('mouseover', (params) => { // 鐢ㄦ埛榧犳爣鎮诞鍒版煇涓�鍥惧舰鏃讹紝鍋滄鑷姩鍒囨崲骞堕珮浜紶鏍囨偓娴殑鍥惧舰
- clearInterval(changePieInterval)
- currentIndex = params.dataIndex
- highlightPie()
- })
-
- myChart.on('mouseout', (params) => { // 鐢ㄦ埛榧犳爣绉诲嚭鏃讹紝閲嶆柊寮�濮嬭嚜鍔ㄥ垏鎹�
- if (changePieInterval) {
- clearInterval(changePieInterval)
- }
- changePieInterval = setInterval(selectPie, 1000)
- })
-
- function selectPie() { // 楂樹寒鏁堟灉鍒囨崲鍒颁笅涓�涓浘褰�
- var dataLen = option.series[0].data.length
- currentIndex = (currentIndex + 1) % dataLen
- highlightPie()
- }
+ // let currentIndex = -1 // 褰撳墠楂樹寒鍥惧舰鍦ㄩゼ鍥炬暟鎹腑鐨勪笅鏍�
+ // var changePieInterval = setInterval(selectPie, 2000) // 璁剧疆鑷姩鍒囨崲楂樹寒鍥惧舰鐨勫畾鏃跺櫒
+ //
+ // function highlightPie() { // 鍙栨秷鎵�鏈夐珮浜苟楂樹寒褰撳墠鍥惧舰
+ // // for (var idx in option.series[0].data) {
+ // // // 閬嶅巻楗煎浘鏁版嵁锛屽彇娑堟墍鏈夊浘褰㈢殑楂樹寒鏁堟灉
+ // // myChart.dispatchAction({
+ // // type: 'downplay',
+ // // seriesIndex: 0,
+ // // dataIndex: idx
+ // // })
+ // // }
+ // // 閬嶅巻楗煎浘鏁版嵁锛屽彇娑堟墍鏈夊浘褰㈢殑楂樹寒鏁堟灉
+ // option.series[0].data.forEach((item, index) => {
+ // myChart.dispatchAction({
+ // type: 'downplay',
+ // seriesIndex: 0,
+ // dataIndex: index
+ // })
+ // })
+ //
+ // // 楂樹寒褰撳墠鍥惧舰
+ // myChart.dispatchAction({
+ // type: 'highlight',
+ // seriesIndex: 0,
+ // dataIndex: currentIndex
+ // })
+ // }
+ //
+ // myChart.on('mouseover', (params) => { // 鐢ㄦ埛榧犳爣鎮诞鍒版煇涓�鍥惧舰鏃讹紝鍋滄鑷姩鍒囨崲骞堕珮浜紶鏍囨偓娴殑鍥惧舰
+ // clearInterval(changePieInterval)
+ // currentIndex = params.dataIndex
+ // highlightPie()
+ // })
+ //
+ // myChart.on('mouseout', (params) => { // 鐢ㄦ埛榧犳爣绉诲嚭鏃讹紝閲嶆柊寮�濮嬭嚜鍔ㄥ垏鎹�
+ // if (changePieInterval) {
+ // clearInterval(changePieInterval)
+ // }
+ // changePieInterval = setInterval(selectPie, 1000)
+ // })
+ //
+ // function selectPie() { // 楂樹寒鏁堟灉鍒囨崲鍒颁笅涓�涓浘褰�
+ // var dataLen = option.series[0].data.length
+ // currentIndex = (currentIndex + 1) % dataLen
+ // highlightPie()
+ // }
// return myChart
}
@@ -1051,7 +1270,8 @@
flex-direction: column;
//color: #09d8f2;
color: $color01;
- //background-color: 'transparent';
+ //background: repeating-radial-gradient(circle, #000000, #444444 100%, #666666 100%);
+
}
.kb_background {
@@ -1060,8 +1280,8 @@
width: 1920px;
height: 887px;
background: url('../../assets/images/body.jpg') no-repeat;
- z-index: -1;
- //opacity: 0.9;
+ //z-index: -1;
+ //opacity: 0.4;
}
.kb_background2 {
@@ -1070,8 +1290,8 @@
width: 1920px;
height: 887px;
background: url('../../assets/images/body.jpg') no-repeat;
- z-index: -1;
- //opacity: 0.9;
+ //z-index: -1;
+ //opacity: 0.4;
}
.kb_flex {
@@ -1115,6 +1335,7 @@
display: flex;
//padding: 20px;
padding: 0 20px 20px 20px;
+ z-index: 2;
}
.kb_content_left {
--
Gitblit v1.9.3