This commit is contained in:
2024-01-08 10:53:10 +08:00
parent fed1db7abe
commit 6b0ee6b02f
3 changed files with 67 additions and 42 deletions

View File

@@ -185,39 +185,39 @@ export const homepageDataLeft = () => {
'history': [
{
// 日期
'date': '2023-10-25',
'date': '12月31日',
// 成品
'sort': 0,
// 压制
'press': 1890
},
{
'date': '2023-10-26',
'date': '12月31日',
'sort': 0,
'press': 2640
},
{
'date': '2023-10-27',
'date': '12月31日',
'sort': 0,
'press': 5364
},
{
'date': '2023-10-28',
'date': '12月31日',
'sort': 720,
'press': 4962
},
{
'date': '2023-10-29',
'date': '12月31日',
'sort': 1584,
'press': 1260
},
{
'date': '2023-10-30',
'date': '12月31日',
'sort': 1872,
'press': 2400
},
{
'date': '2023-10-31',
'date': '12月31',
'sort': 576,
'press': 630
}
@@ -317,7 +317,7 @@ export const homepageDataRight = () => {
'top10Of30Days': [
{
'deviceName': '压机1',
'count': 100
'count': 10
},
{
'deviceName': '压机2',

View File

@@ -280,17 +280,10 @@ export default {
data: [1]
}]
}
// let echart = document.getElementById('new_home_echart_1')
// if (this.myCharts1 !== '') {
// this.myCharts1.dispose()
// }
// if (echart !== null) {
// this.myCharts1 = this.$echarts.init(echart)
// this.myCharts1.setOption(option)
// window.addEventListener('resize', () => {
// this.myCharts1.resize()
// })
// }
if (document.getElementById('new_home_echart_1') == null) {
return
}
this.$echarts.dispose(document.getElementById('new_home_echart_1'))
let echart = this.$echarts.init(document.getElementById('new_home_echart_1'))
echart.setOption(option)
window.addEventListener('resize', () => {
@@ -426,6 +419,10 @@ export default {
}
]
}
if (document.getElementById('new_home_echart_2') == null) {
return
}
this.$echarts.dispose(document.getElementById('new_home_echart_2'))
let echart = this.$echarts.init(document.getElementById('new_home_echart_2'))
echart.setOption(option)
this.chart2Timer = setInterval(() => {
@@ -620,6 +617,10 @@ export default {
}
]
}
if (document.getElementById('new_home_echart_3') == null) {
return
}
this.$echarts.dispose(document.getElementById('new_home_echart_3'))
let echart = this.$echarts.init(document.getElementById('new_home_echart_3'))
echart.setOption(option)
this.chart3Timer = setInterval(() => {
@@ -764,6 +765,10 @@ export default {
data: seriesData
}]
}
if (document.getElementById('new_home_echart_4') == null) {
return
}
this.$echarts.dispose(document.getElementById('new_home_echart_4'))
let echart = this.$echarts.init(document.getElementById('new_home_echart_4'))
echart.setOption(option)
let bu = 0
@@ -875,29 +880,29 @@ export default {
lineHeight: 12,
// align: 'right',
fontFamily: 'SourceHanSansCN-Regular',
margin: 10,
formatter: (value) => {
let str = ''
let num = 5
let valLength = value.length
let rowNum = Math.ceil(valLength / num)
if (rowNum > 1) {
for (let i = 0; i < rowNum; i++) {
let temp = ''
let start = i * num
let end = start + num
if (i === rowNum - 1) {
temp = value.substring(start, end)
} else {
temp = value.substring(start, end) + '\n'
}
str += temp
}
return str
} else {
return value
}
}
margin: 10
// formatter: (value) => {
// let str = ''
// let num = 5
// let valLength = value.length
// let rowNum = Math.ceil(valLength / num)
// if (rowNum > 1) {
// for (let i = 0; i < rowNum; i++) {
// let temp = ''
// let start = i * num
// let end = start + num
// if (i === rowNum - 1) {
// temp = value.substring(start, end)
// } else {
// temp = value.substring(start, end) + '\n'
// }
// str += temp
// }
// return str
// } else {
// return value
// }
// }
},
data: barName
},
@@ -992,6 +997,10 @@ export default {
}
]
}
if (document.getElementById('new_home_echart_5') == null) {
return
}
this.$echarts.dispose(document.getElementById('new_home_echart_5'))
let echart = this.$echarts.init(document.getElementById('new_home_echart_5'))
echart.setOption(option)
let len = 0

View File

@@ -326,6 +326,10 @@ export default {
title: titleArr,
series: seriesArr
}
if (document.getElementById('new_home_echart_6') == null) {
return
}
this.$echarts.dispose(document.getElementById('new_home_echart_6'))
let echart = this.$echarts.init(document.getElementById('new_home_echart_6'))
echart.setOption(option)
window.addEventListener('resize', () => {
@@ -393,6 +397,10 @@ export default {
data: seriesData
}]
}
if (document.getElementById('new_home_echart_7') == null) {
return
}
this.$echarts.dispose(document.getElementById('new_home_echart_7'))
let echart = this.$echarts.init(document.getElementById('new_home_echart_7'))
echart.setOption(option)
let bu = 0
@@ -553,6 +561,10 @@ export default {
}
]
}
if (document.getElementById('new_home_echart_8') == null) {
return
}
this.$echarts.dispose(document.getElementById('new_home_echart_8'))
let echart = this.$echarts.init(document.getElementById('new_home_echart_8'))
echart.setOption(option)
window.addEventListener('resize', () => {
@@ -815,6 +827,10 @@ export default {
}
]
}
if (document.getElementById('new_home_echart_9') == null) {
return
}
this.$echarts.dispose(document.getElementById('new_home_echart_9'))
let echart = this.$echarts.init(document.getElementById('new_home_echart_9'))
echart.setOption(option)
this.chart9Timer = setInterval(() => {