功能升级2

master
zhaoxiaolin 8 months ago
parent 3a825cd6a1
commit 4a40f20612

@ -23,7 +23,7 @@ export default {
};
},
watch: {
xAxisdata1: function (newVal, oldVal) {
xAxis1data: function (newVal, oldVal) {
this.initChart();
},
colorlist: function (newVal, oldVal) {},
@ -192,7 +192,7 @@ export default {
],
series: [
{
name: "理论数量",
//name: "",
type: "bar",
barWidth: "12px",
itemStyle: {
@ -213,7 +213,7 @@ export default {
data: this.series1data1,
},
{
name: "实际产量",
//name: "",
type: "bar",
barWidth: "12px",
itemStyle: {
@ -234,7 +234,7 @@ export default {
data: this.series1data2,
},
{
name: "达成率",
//name: "",
type: "line",
yAxisIndex: 1, //使 y index y
smooth: false, //线

@ -463,6 +463,95 @@ export default {
_this.yAxis1seriesMAX1 = MAX2;
}
_this.yAxis1seriesMAX2 = Math.max(..._this.series1data3);
let numberlist = [];
let dataoption = [];
let totalArr = [];
let barWidth1 = 20;
let barWidth2 = 30;
_this.optionDatalist1 = [];
if (response.data.totalNum.length > 0) {
_this.number1 = response.data.totalNum[0].totalNum;
}
if (response.data.everyNum.length > 0) {
response.data.everyNum.forEach((item) => {
let a = {};
a.name = item.equName;
a.value = item.totalNum;
a.code = item.equCode;
_this.optionDatalist1.push(a);
dataoption.push(a);
numberlist.push(item.totalNum);
});
dataoption.sort((a, b) => {
return a.value - b.value;
});
let max = Math.max(...numberlist);
max = max + 100;
dataoption.forEach((item) => {
totalArr.push(max);
});
if (dataoption.length > 10) {
barWidth1 = "";
barWidth2 = "";
}
option1 = {
yAxis: [
{
data: dataoption,
},
],
series: [
{
data: dataoption,
itemStyle: {
normal: {
color: function (params) {
var index_num = params.value;
for (var i = 0; i < dataoption.length; i++) {
//1
if (index_num > 1131) {
//var colorList = ['#ff7f50', '#87cefa', '#da70d6', '#32cd32', '#6495ed', '#ff69b4', '#ba55d3', '#cd5c5c', '#ffa500', '#40e0d0'];
//return colorList[params.dataIndex];
return new echarts.graphic.LinearGradient(
0,
0,
1,
0,
[
{ offset: 0, color: "#FFB742" },
{ offset: 1, color: "#FFB742" },
]
);
} else {
//var colorList = ['blue'];
//return colorList[params.dataIndex];
return new echarts.graphic.LinearGradient(
0,
0,
1,
0,
[
{ offset: 0, color: "#005954" },
{ offset: 1, color: "#66E1DF" },
]
);
}
}
},
},
},
barWidth: barWidth1,
},
{
data: totalArr,
barWidth: barWidth2,
},
],
};
myChart1.setOption(option1);
}
}
}
});
@ -576,9 +665,6 @@ export default {
}).then((response) => {
if (response) {
if (response.data) {
let numberlist = [];
let dataoption = [];
let totalArr = [];
_this.xAxis2data = response.data.dayNames;
_this.series2data1 = response.data.plans;
_this.series2data2 = response.data.acts;
@ -593,6 +679,86 @@ export default {
_this.yAxis2seriesMAX1 = MAX2;
}
_this.yAxis2seriesMAX2 = Math.max(..._this.series2data3);
let numberlist = [];
let dataoption = [];
let totalArr = [];
_this.optionDatalist2 = [];
if (response.data.totalNum.length > 0) {
_this.number2 = response.data.totalNum[0].totalNum;
}
if (response.data.everyNum.length > 0) {
response.data.everyNum.forEach((item) => {
let a = {};
a.name = item.equName;
a.value = item.totalNum;
a.code = item.equCode;
_this.optionDatalist2.push(a);
dataoption.push(a);
numberlist.push(item.totalNum);
});
dataoption.sort((a, b) => {
return a.value - b.value;
});
let max = Math.max(...numberlist);
max = max + 100;
dataoption.forEach((item) => {
totalArr.push(max);
});
option2 = {
yAxis: [
{
data: dataoption,
},
],
series: [
{
data: dataoption,
itemStyle: {
normal: {
color: function (params) {
var index_num = params.value;
for (var i = 0; i < dataoption.length; i++) {
//1
if (index_num > 1131) {
//var colorList = ['#ff7f50', '#87cefa', '#da70d6', '#32cd32', '#6495ed', '#ff69b4', '#ba55d3', '#cd5c5c', '#ffa500', '#40e0d0'];
//return colorList[params.dataIndex];
return new echarts.graphic.LinearGradient(
0,
0,
1,
0,
[
{ offset: 0, color: "#FFB742" },
{ offset: 1, color: "#FFB742" },
]
);
} else {
//var colorList = ['blue'];
//return colorList[params.dataIndex];
return new echarts.graphic.LinearGradient(
0,
0,
1,
0,
[
{ offset: 0, color: "#005954" },
{ offset: 1, color: "#66E1DF" },
]
);
}
}
},
},
},
},
{
data: totalArr,
},
],
};
myChart2.setOption(option2);
}
}
}
});
@ -720,7 +886,89 @@ export default {
_this.yAxis3seriesMAX1 = MAX2;
}
_this.yAxis3seriesMAX2 = Math.max(..._this.series3data3);
let numberlist = [];
let dataoption = [];
let totalArr = [];
_this.optionDatalist3 = [];
if (response.data.totalNum.length > 0) {
_this.number3 = response.data.totalNum[0].totalNum;
}
if (response.data.everyNum.length > 0) {
response.data.everyNum.forEach((item) => {
let a = {};
a.name = item.equName;
a.value = item.totalNum;
a.code = item.equCode;
_this.optionDatalist3.push(a);
dataoption.push(a);
numberlist.push(item.totalNum);
});
dataoption.sort((a, b) => {
return a.value - b.value;
});
let max = Math.max(...numberlist);
max = max + 100;
dataoption.forEach((item) => {
totalArr.push(max);
});
option3 = {
yAxis: [
{
data: dataoption,
},
],
series: [
{
data: dataoption,
itemStyle: {
normal: {
color: function (params) {
var index_num = params.value;
for (var i = 0; i < dataoption.length; i++) {
//1
if (index_num > 1131) {
//var colorList = ['#ff7f50', '#87cefa', '#da70d6', '#32cd32', '#6495ed', '#ff69b4', '#ba55d3', '#cd5c5c', '#ffa500', '#40e0d0'];
//return colorList[params.dataIndex];
return new echarts.graphic.LinearGradient(
0,
0,
1,
0,
[
{ offset: 0, color: "#FFB742" },
{ offset: 1, color: "#FFB742" },
]
);
} else {
//var colorList = ['blue'];
//return colorList[params.dataIndex];
return new echarts.graphic.LinearGradient(
0,
0,
1,
0,
[
{ offset: 0, color: "#005954" },
{ offset: 1, color: "#66E1DF" },
]
);
}
}
},
},
},
},
{
data: totalArr,
},
],
};
myChart3.setOption(option3);
}
}
}
});
var myChart4 = echarts.init(document.querySelector("#echart4"));
@ -825,7 +1073,7 @@ export default {
],
};
myChart4.setOption(option4);
getWhiteBoardEquPro7Days({
getMesBoardEquProductionToday({
factory: _this.selectxt,
shiftId: _this.selectxtclasses,
ymd: _this.datetime,

Loading…
Cancel
Save