修改bug
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
<!--
|
||||
* @Author: zwq
|
||||
* @Date: 2022-01-21 14:43:06
|
||||
* @LastEditors: DY
|
||||
* @LastEditTime: 2024-07-01 16:54:41
|
||||
* @LastEditors: zhp
|
||||
* @LastEditTime: 2024-07-04 09:37:49
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
@@ -73,7 +73,7 @@ export default {
|
||||
this.chart = null
|
||||
},
|
||||
methods: {
|
||||
initChart(xAxis, seriesList) {
|
||||
initChart(xAxis, seriesList,arr) {
|
||||
if (xAxis.length === 0) {
|
||||
this.chart.clear()
|
||||
}
|
||||
@@ -103,18 +103,23 @@ export default {
|
||||
type: 'shadow',
|
||||
color: "rgba(237,237,237,0.5)"
|
||||
},
|
||||
formatter: function(params) {
|
||||
formatter: function (params) {
|
||||
// console.log(params)
|
||||
let str = ''
|
||||
arr.forEach(ele => {
|
||||
str += `<div style="width: 60px; text-align: right">${ele.name.substring(0, 2) }</div>`
|
||||
})
|
||||
console.log(str);
|
||||
let result = `
|
||||
<div style="width: 270px; display: flex">
|
||||
<div style="width: 150px">${params[0].name}</div>
|
||||
<div style="width: 60px; text-align: right">${factoryListabbr[0]}</div>
|
||||
<div style="width: 60px; text-align: right">${factoryListabbr[1]}</div>
|
||||
${str}
|
||||
</div>`
|
||||
const newArray = params.map(p => {
|
||||
console.log(factoryListabbr[p.seriesName.split('-')[1]], p.seriesName.split('-')[0])
|
||||
return {
|
||||
glass: p.seriesName.split('-')[0], // 玻璃类型
|
||||
factoryName: factoryListabbr[p.seriesName.split('-')[1]], // 工厂名称
|
||||
factoryName: arr[p.seriesName.split('-')[1]], // 工厂名称
|
||||
value: p.value,
|
||||
name: p.name,
|
||||
marker: p.marker,
|
||||
@@ -128,7 +133,7 @@ export default {
|
||||
<div style="width: 150px; display: flex; align-items: center">
|
||||
<div style="background-color: ${analyzeList[g][0].color}; width: 10px; height: 10px; margin-right: 5px"></div>
|
||||
<div>${g}</div></div>`
|
||||
for (let fac of factoryListabbr) {
|
||||
for (let fac of arr) {
|
||||
let goodNum = 0
|
||||
for (let ana of analyzeList[g]) {
|
||||
if (ana.factoryName === fac && ana.value !== 0) {
|
||||
@@ -139,6 +144,7 @@ export default {
|
||||
}
|
||||
result = result + oneData + '</div>'
|
||||
}
|
||||
// console.log('result', result);
|
||||
return result
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user