修改bug
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
* @Author: zwq
|
||||
* @Date: 2022-01-21 14:43:06
|
||||
* @LastEditors: zhp
|
||||
* @LastEditTime: 2024-03-28 16:45:24
|
||||
* @LastEditTime: 2024-03-29 14:50:50
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
@@ -158,6 +158,9 @@ export default {
|
||||
methods: {
|
||||
initChart() {
|
||||
this.chart = echarts.init(document.getElementById(this.id))
|
||||
this.$nextTick(() => {
|
||||
this.chart.resize();
|
||||
});
|
||||
this.chart.setOption({
|
||||
title: this.showCenterTitle
|
||||
? {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: gtz
|
||||
* @Date: 2022-01-19 15:58:17
|
||||
* @LastEditors: zhp
|
||||
* @LastEditTime: 2024-03-27 10:26:35
|
||||
* @LastEditTime: 2024-03-29 14:47:29
|
||||
* @Description: file content
|
||||
* @FilePath: \mt-bus-fe\src\views\OperationalOverview\components\baseContainer\index.vue
|
||||
-->
|
||||
@@ -164,7 +164,7 @@ export default {
|
||||
width: 100%;
|
||||
// background-color: rgba($color: #061027, $alpha: 0.15);
|
||||
position: relative;
|
||||
opacity: calc(.8);
|
||||
// opacity: calc(.8);
|
||||
// border: 2px solid;
|
||||
// background: url('../../../../assets/img/energy.png') no-repeat;
|
||||
// background-size: 100% 100%;
|
||||
@@ -274,6 +274,8 @@ export default {
|
||||
width: 100%;
|
||||
color: #ffffff;
|
||||
font-size: 24px;
|
||||
font-weight: normal;
|
||||
letter-spacing: .8px;
|
||||
padding: 0.67em 0.67em 0.3em 0.67em;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<!--
|
||||
* @Author: zhp
|
||||
* @Date: 2023-09-21 09:06:28
|
||||
* @LastEditTime: 2024-03-25 18:34:58
|
||||
* @LastEditTime: 2024-03-29 16:25:59
|
||||
* @LastEditors: zhp
|
||||
* @Description:
|
||||
-->
|
||||
@@ -71,9 +71,9 @@ export default {
|
||||
mounted() {
|
||||
console.log('mounted')
|
||||
console.log('borderRadius: ', this.borderRadius)
|
||||
// this.$nextTick(() => {
|
||||
// this.initChart()
|
||||
// })
|
||||
this.$el.addEventListener('resize', () => {
|
||||
console.log('resziing.....');
|
||||
});
|
||||
},
|
||||
beforeDestroy() {
|
||||
if (!this.chart) {
|
||||
@@ -114,6 +114,7 @@ export default {
|
||||
name: '产线良品率',
|
||||
symbol: 'circle', //变为实心圆
|
||||
type: 'line',
|
||||
// symbolSize: 7,
|
||||
yAxisIndex: 0,
|
||||
areaStyle: {
|
||||
opacity: 0.8,
|
||||
@@ -141,6 +142,16 @@ export default {
|
||||
]
|
||||
// const colors = ['#5470C6', '#91CC75', '#EE6666']
|
||||
this.chart = echarts.init(document.getElementById(this.id))
|
||||
let isFinished = false //标记 isFinished
|
||||
this.chart.on('finished', _ => {
|
||||
if (!isFinished) {
|
||||
console.log('我只执行一次')
|
||||
isFinished = true
|
||||
// this.isLoading = false //关闭loading
|
||||
this.chart.resize() //重新渲染charts大小
|
||||
}
|
||||
console.log(113, 'finished')
|
||||
})
|
||||
this.chart.setOption({
|
||||
// color: colors,
|
||||
tooltip: {
|
||||
@@ -151,22 +162,33 @@ export default {
|
||||
},
|
||||
grid: {
|
||||
left: "3%",
|
||||
right: "5%",
|
||||
right: "10%",
|
||||
bottom: "3%",
|
||||
containLabel: true
|
||||
},
|
||||
legend: {
|
||||
itemWidth: 10,
|
||||
itemHeight: 10,
|
||||
top: '20',
|
||||
// right: '20px',
|
||||
data: ['产线产量', '产线良品率'],
|
||||
top: '5',
|
||||
right: '20px',
|
||||
data: [
|
||||
// { icon: 'rect', name: '直接访问' },
|
||||
{ icon: 'roundRect', name: '产线产量' },
|
||||
{
|
||||
icon: 'circle', name: '产线良品率',
|
||||
itemWidth: 7,
|
||||
itemHeight: 7,
|
||||
},
|
||||
],
|
||||
textStyle: {
|
||||
fontSize: 12 * this.beilv,
|
||||
color: '#ced1d5'
|
||||
}
|
||||
},
|
||||
xAxis: {
|
||||
axisTick: {
|
||||
show: false
|
||||
},
|
||||
type: 'category',
|
||||
axisLine: {
|
||||
lineStyle: {
|
||||
@@ -202,7 +224,7 @@ export default {
|
||||
type: 'value',
|
||||
name: '良品率/%',
|
||||
nameTextStyle: {// y轴上方单位的颜色
|
||||
color: '#fff',
|
||||
color: 'rgba(255,255,255,0.5)', // 坐标值得具体的颜色
|
||||
align: "left",
|
||||
},
|
||||
position: 'right',
|
||||
@@ -245,7 +267,7 @@ export default {
|
||||
type: 'value',
|
||||
name: '产量/㎡', // y轴上方的单位
|
||||
nameTextStyle: {
|
||||
color: "#fff",
|
||||
color: 'rgba(255,255,255,0.5)', // 坐标值得具体的颜色
|
||||
// fontSize: 10,
|
||||
align: "right",
|
||||
},
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<!--
|
||||
* @Author: zhp
|
||||
* @Date: 2023-09-21 09:06:28
|
||||
* @LastEditTime: 2024-03-28 16:31:20
|
||||
* @LastEditTime: 2024-03-29 16:26:28
|
||||
* @LastEditors: zhp
|
||||
* @Description:
|
||||
-->
|
||||
@@ -106,7 +106,8 @@ export default {
|
||||
position: 'top', //在上方显示
|
||||
textStyle: { //数值样式
|
||||
color: '#ced1d5',
|
||||
fontSize: 12
|
||||
fontSize: 12,
|
||||
fontWight:'bolder'
|
||||
}
|
||||
},
|
||||
}
|
||||
@@ -142,7 +143,7 @@ export default {
|
||||
}
|
||||
},
|
||||
// data: passRateList
|
||||
data: []
|
||||
data: passRateList
|
||||
}
|
||||
]
|
||||
// const colors = ['#5470C6', '#91CC75', '#EE6666']
|
||||
@@ -166,7 +167,7 @@ export default {
|
||||
type: 'cross'
|
||||
}
|
||||
},
|
||||
grid: { top: 90, right: 60, bottom: 20, left: 20, containLabel: true },
|
||||
grid: { top: 90, right: 70, bottom: 20, left: 20, containLabel: true },
|
||||
legend: {
|
||||
itemWidth: 10,
|
||||
itemHeight: 10,
|
||||
@@ -175,10 +176,14 @@ export default {
|
||||
data: ['产线产量', '产线良品率'],
|
||||
textStyle: {
|
||||
fontSize: 12 * this.beilv,
|
||||
color: '#ced1d5'
|
||||
color: '#ced1d5',
|
||||
fontWight: 'bolder'
|
||||
}
|
||||
},
|
||||
xAxis: {
|
||||
axisTick: {
|
||||
show: false
|
||||
},
|
||||
type: 'category',
|
||||
axisLine: {
|
||||
lineStyle: {
|
||||
@@ -187,8 +192,11 @@ export default {
|
||||
width: '1' // 坐标线的宽度
|
||||
}
|
||||
},
|
||||
textStyle: {
|
||||
fontWight: 'bolder'
|
||||
},
|
||||
axisLabel: {
|
||||
color: "#fff",
|
||||
color: 'rgba(255,255,255,0.5)', // 坐标值得具体的颜色
|
||||
fontSize: 12,
|
||||
// formatter: '{value}'
|
||||
// textStyle: {
|
||||
@@ -217,7 +225,7 @@ export default {
|
||||
type: 'value',
|
||||
name: '良品率/%',
|
||||
nameTextStyle: {// y轴上方单位的颜色
|
||||
color: '#fff',
|
||||
color: 'rgba(255,255,255,0.5)', // 坐标值得具体的颜色
|
||||
align: "left",
|
||||
},
|
||||
position: 'right',
|
||||
@@ -231,7 +239,7 @@ export default {
|
||||
}
|
||||
},
|
||||
axisLabel: {
|
||||
color: "#fff",
|
||||
color: 'rgba(255,255,255,0.5)', // 坐标值得具体的颜色
|
||||
fontSize: 12,
|
||||
// formatter: '{value}'
|
||||
formatter: '{value}%'
|
||||
@@ -261,7 +269,7 @@ export default {
|
||||
type: 'value',
|
||||
name: '产量/片', // y轴上方的单位
|
||||
nameTextStyle: {
|
||||
color: "#fff",
|
||||
color: 'rgba(255,255,255,0.5)', // 坐标值得具体的颜色
|
||||
// fontSize: 10,
|
||||
align: "right",
|
||||
},
|
||||
@@ -278,7 +286,7 @@ export default {
|
||||
axisLabel: {
|
||||
// textStyle: {
|
||||
// color: 'rgba(255,255,255,0.5)', // 坐标值得具体的颜色
|
||||
color: "#fff",
|
||||
color: 'rgba(255,255,255,0.5)', // 坐标值得具体的颜色
|
||||
// show: true,
|
||||
lineStyle: {
|
||||
color: "#25528f",
|
||||
|
||||
@@ -111,8 +111,9 @@ export default {
|
||||
show: true, //开启显示
|
||||
position: 'top', //在上方显示
|
||||
textStyle: { //数值样式
|
||||
color: '#ced1d5',
|
||||
fontSize: 12
|
||||
color: 'rgba(255,255,255,0.5)', // 坐标值得具体的颜色
|
||||
fontSize: 12,
|
||||
fontWeight: 'bolder'
|
||||
}
|
||||
},
|
||||
}
|
||||
@@ -144,6 +145,9 @@ export default {
|
||||
// }
|
||||
// },
|
||||
xAxis: {
|
||||
axisTick: {
|
||||
show: false
|
||||
},
|
||||
type: 'category',
|
||||
axisLine: {
|
||||
lineStyle: {
|
||||
@@ -152,8 +156,11 @@ export default {
|
||||
width: '1' // 坐标线的宽度
|
||||
}
|
||||
},
|
||||
textStyle: {
|
||||
fontWeight: 'bolder'
|
||||
},
|
||||
axisLabel: {
|
||||
color: "#fff",
|
||||
color: 'rgba(255,255,255,0.5)', // 坐标值得具体的颜色
|
||||
fontSize: 12,
|
||||
// formatter: '{value}'
|
||||
},
|
||||
@@ -167,13 +174,13 @@ export default {
|
||||
yAxis: {
|
||||
name: '单位kwh',
|
||||
nameTextStyle: {
|
||||
color: '#fff',
|
||||
color: 'rgba(255,255,255,0.5)', // 坐标值得具体的颜色
|
||||
fontSize: 10,
|
||||
align: 'right',
|
||||
},
|
||||
type: 'value',
|
||||
axisLabel: {
|
||||
color: "#fff",
|
||||
color: 'rgba(255,255,255,0.5)', // 坐标值得具体的颜色
|
||||
fontSize: 12,
|
||||
// formatter: '{value}/kwh'
|
||||
},
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
<!--
|
||||
* @Author: zhp
|
||||
* @Date: 2023-12-27 13:54:52
|
||||
* @LastEditTime: 2024-03-28 16:30:14
|
||||
* @LastEditTime: 2024-03-29 16:50:47
|
||||
* @LastEditors: zhp
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<div>
|
||||
<div :id="id" class="productChart" :style="{ height: height + 'px', width: width }" />
|
||||
<div :id="id" class="productChart" :style="{ height:'80px', width: width }" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -106,7 +106,6 @@ export default {
|
||||
}
|
||||
// }
|
||||
console.log('total', totalData)
|
||||
this.chart = echarts.init(document.getElementById(this.id))
|
||||
const series = [
|
||||
'良品',
|
||||
'废品',
|
||||
@@ -137,6 +136,17 @@ export default {
|
||||
// width,
|
||||
// height
|
||||
// })
|
||||
this.chart = echarts.init(document.getElementById(this.id))
|
||||
let isFinished = false //标记 isFinished
|
||||
this.chart.on('finished', _ => {
|
||||
if (!isFinished) {
|
||||
console.log('我只执行一次')
|
||||
isFinished = true
|
||||
// this.isLoading = false //关闭loading
|
||||
this.chart.resize() //重新渲染charts大小
|
||||
}
|
||||
console.log(113, 'finished')
|
||||
})
|
||||
this.chart.setOption({
|
||||
legend: {
|
||||
formatter: function (name) {
|
||||
@@ -152,7 +162,8 @@ export default {
|
||||
left: '20',
|
||||
icon: 'rect',
|
||||
textStyle: {
|
||||
color: '#ffffff'
|
||||
color: 'rgba(255,255,255,.6)',
|
||||
fontSize:12,
|
||||
}
|
||||
},
|
||||
grid: {
|
||||
@@ -184,9 +195,9 @@ export default {
|
||||
splitNumber: 50,
|
||||
// boundaryGap: [20, 20],
|
||||
textStyle: {
|
||||
color: '#ffffff',
|
||||
color: 'rgba(255,255,255,.6)',
|
||||
verticalAlign: 'bottom',
|
||||
fontSize: 12,
|
||||
fontSize: 16,
|
||||
align: 'left',
|
||||
padding: [0, 0, 10, -5]
|
||||
}
|
||||
@@ -212,9 +223,9 @@ export default {
|
||||
splitNumber: 50,
|
||||
// boundaryGap: [20, 20],
|
||||
textStyle: {
|
||||
color: '#ffffff',
|
||||
color: 'rgba(255,255,255,.6)',
|
||||
verticalAlign: 'bottom',
|
||||
fontSize: 12,
|
||||
fontSize: 16,
|
||||
align: 'right',
|
||||
padding: [0, 0, 10, -5]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user