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

View File

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

View File

@@ -326,6 +326,10 @@ export default {
title: titleArr, title: titleArr,
series: seriesArr 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')) let echart = this.$echarts.init(document.getElementById('new_home_echart_6'))
echart.setOption(option) echart.setOption(option)
window.addEventListener('resize', () => { window.addEventListener('resize', () => {
@@ -393,6 +397,10 @@ export default {
data: seriesData 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')) let echart = this.$echarts.init(document.getElementById('new_home_echart_7'))
echart.setOption(option) echart.setOption(option)
let bu = 0 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')) let echart = this.$echarts.init(document.getElementById('new_home_echart_8'))
echart.setOption(option) echart.setOption(option)
window.addEventListener('resize', () => { 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')) let echart = this.$echarts.init(document.getElementById('new_home_echart_9'))
echart.setOption(option) echart.setOption(option)
this.chart9Timer = setInterval(() => { this.chart9Timer = setInterval(() => {