当日设备产量看板修改

master
lijing 9 months ago
parent 553b0152f7
commit 4822573b69

@ -16,6 +16,14 @@ export function getMesBoardEquProductionToday(data) {
data: data
});
}
// 获取产量数据
export function getWhiteBoardEquPro7Days(data) {
return request({
url: '/mes/wcsInterface/getWhiteBoardEquPro7Days',
method: 'post',
data: data
});
}
// 获取班次
export function getBoardShifts(data) {
return request({

@ -0,0 +1,258 @@
<template>
<div class="chart-container">
<div class="chart" :class="{ activehide: isActive }" ref="chart"></div>
<!-- 底座背景 -->
</div>
</template>
<script>
import { getPie3D, getParametricEquation } from "../../../utils/echart.js"; //js
const color = ["#005aff", "#f8b551"];
import * as echarts from "echarts";
export default {
name: "chart",
props: ["xAxis4data", "yAxis4seriesMAX1", "yAxis4seriesMAX2", "series4data"],
data() {
return {
optionData: [],
statusChart: null,
option: {},
isActive: false,
// color:["#005aff", "#f8b551",'#7CDCAC'],
};
},
watch: {
xAxis4data: function (newVal, oldVal) {
this.initChart();
},
colorlist: function (newVal, oldVal) {},
},
created() {
// console.log(this.list);
// this.color = this.colorlist
},
mounted() {
// this.setLabel();
// this.initChart();
//
const that = this;
window.onresize = function () {
that.changeSize();
};
},
methods: {
// label
setLabel() {
const that = this;
this.optionData = this.list;
this.optionData.forEach((item, index) => {
// item.itemStyle = {
// color: that.color[index],
// };
item.label = {
normal: {
show: true,
// color: that.color[index],
formatter: ["{b|{b}}:", "{d|{d}%}"].join(""), // \n
rich: {
b: {
color: "#fff",
lineHeight: 25,
align: "left",
},
c: {
fontSize: 22,
color: "#fff",
textShadowColor: "#1c90a6",
textShadowOffsetX: 0,
textShadowOffsetY: 2,
textShadowBlur: 5,
},
d: {
color: "#fff",
align: "left",
textShadowOffsetX: 0,
textShadowOffsetY: 2,
textShadowBlur: 5,
},
},
},
};
item.labelLine = {
normal: {
lineStyle: {
width: 1,
color: "rgba(255,255,255,0.7)",
},
},
};
});
},
//
initChart() {
console.log(this.xAxisdata1,'w222111')
this.statusChart = echarts.init(this.$refs.chart);
// option, 3d,
this.option = {
tooltip: {
trigger: "item",
axisPointer: {
//
type: "shadow", // 线'line' | 'shadow'
},
},
grid: {
left: "4%",
right: "4%",
bottom: "2%",
top: "6%",
containLabel: true,
},
legend: {
// data: ["", "", "", ""],
// left: "7%",
// top: "5%",
// textStyle: {
// color: "#ffffff",
// },
// itemWidth: 15,
// itemHeight: 10,
// itemGap: 25,
},
xAxis: {
type: "category",
data: this.xAxis4data,
axisLine: {
lineStyle: {
color: "#cdd5e2",
},
},
axisLabel: {
textStyle: {
color: "#666666",
},
},
axisLabel: {
//show:false,
color: "#7785D9",
fontSize: 12,
rotate: "45",
},
},
yAxis: [
{
type: "value",
splitLine: {
show: false,
},
axisLabel: {
textStyle: {
color: "#ffffff",
},
},
axisLine: {
lineStyle: {
color: "#cdd5e2",
},
},
axisLine: {
show: false,
lineStyle: {
color: "#e0e7ff",
},
},
max: this.yAxis4seriesMAX1,
},
// {
// type: "value",
// name: "",
// nameTextStyle: {
// color: "#ffffff",
// },
// position: "right",
// axisLine: {
// lineStyle: {
// color: "#cdd5e2",
// },
// },
// splitLine: {
// show: false,
// },
// axisLabel: {
// show: true,
// formatter: "{value} %", //Y
// textStyle: {
// color: "#ffffff",
// },
// },
// max: this.yAxis2seriesMAX,
// },
],
series: [
{
name: "",
type: "bar",
barWidth: "12px",
itemStyle: {
normal: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: "#29acff",
},
{
offset: 1,
color: "#4bdfff",
},
]),
barBorderRadius: 6,
},
},
data: this.series4data,
},
],
};
this.statusChart.setOption(this.option);
},
//
// optionNameoptionopiton
//
changeSize() {
this.statusChart.resize();
},
},
};
</script>
<style lang='scss' scoped>
.chart-container {
position: relative;
width: 100%;
height: 100%;
.chart,
.bg {
width: 100%;
height: 100%;
}
.bg {
position: absolute;
bottom: 50px;
left: 50%;
z-index: -1;
width: 180px;
height: 73px;
background: no-repeat center;
background-image: url("https://ks3-cn-beijing.ksyun.com/sxjg-elevator/datav-platform-2.0/images/chart_opacity_bg.png");
background-size: 100% 100%;
transform: translateX(-50%);
}
}
.activehide {
display: none;
}
</style>

@ -0,0 +1,299 @@
<template>
<div class="chart-container">
<div class="chart" :class="{ activehide: isActive }" ref="chart"></div>
<!-- 底座背景 -->
</div>
</template>
<script>
import { getPie3D, getParametricEquation } from "../../../utils/echart.js"; //js
const color = ["#005aff", "#f8b551"];
import * as echarts from "echarts";
export default {
name: "chart",
props: ["xAxis1data", "yAxis1seriesMAX1", "yAxis1seriesMAX2", "series1data1", "series1data2", "series1data3"],
data() {
return {
optionData: [],
statusChart: null,
option: {},
isActive: false,
// color:["#005aff", "#f8b551",'#7CDCAC'],
};
},
watch: {
xAxisdata1: function (newVal, oldVal) {
this.initChart();
},
colorlist: function (newVal, oldVal) {},
},
created() {
// console.log(this.list);
// this.color = this.colorlist
},
mounted() {
// this.setLabel();
// this.initChart();
//
const that = this;
window.onresize = function () {
that.changeSize();
};
},
methods: {
// label
setLabel() {
const that = this;
this.optionData = this.list;
this.optionData.forEach((item, index) => {
// item.itemStyle = {
// color: that.color[index],
// };
item.label = {
normal: {
show: true,
// color: that.color[index],
formatter: ["{b|{b}}:", "{d|{d}%}"].join(""), // \n
rich: {
b: {
color: "#fff",
lineHeight: 25,
align: "left",
},
c: {
fontSize: 22,
color: "#fff",
textShadowColor: "#1c90a6",
textShadowOffsetX: 0,
textShadowOffsetY: 2,
textShadowBlur: 5,
},
d: {
color: "#fff",
align: "left",
textShadowOffsetX: 0,
textShadowOffsetY: 2,
textShadowBlur: 5,
},
},
},
};
item.labelLine = {
normal: {
lineStyle: {
width: 1,
color: "rgba(255,255,255,0.7)",
},
},
};
});
},
//
initChart() {
console.log(this.xAxisdata1,'w222111')
this.statusChart = echarts.init(this.$refs.chart);
// option, 3d,
this.option = {
tooltip: {
trigger: "item",
axisPointer: {
//
type: "shadow", // 线'line' | 'shadow'
},
},
grid: {
left: "4%",
right: "4%",
bottom: "2%",
top: "6%",
containLabel: true,
},
legend: {
// data: ["", "", "", ""],
// left: "7%",
// top: "5%",
// textStyle: {
// color: "#ffffff",
// },
// itemWidth: 15,
// itemHeight: 10,
// itemGap: 25,
},
xAxis: {
type: "category",
data: this.xAxis1data,
axisLine: {
lineStyle: {
color: "#cdd5e2",
},
},
axisLabel: {
textStyle: {
color: "#666666",
},
},
axisLabel: {
//show:false,
color: "#7785D9",
fontSize: 12,
rotate: "45",
},
},
yAxis: [
{
type: "value",
splitLine: {
show: false,
},
axisLabel: {
textStyle: {
color: "#ffffff",
},
},
axisLine: {
lineStyle: {
color: "#cdd5e2",
},
},
axisLine: {
show: false,
lineStyle: {
color: "#e0e7ff",
},
},
max: this.yAxis1seriesMAX1,
},
{
type: "value",
name: "百分比",
nameTextStyle: {
color: "#ffffff",
},
position: "right",
axisLine: {
lineStyle: {
color: "#cdd5e2",
},
},
splitLine: {
show: false,
},
axisLabel: {
show: true,
formatter: "{value} %", //Y
textStyle: {
color: "#ffffff",
},
},
max: this.yAxis1seriesMAX2,
},
],
series: [
{
name: "理论数量",
type: "bar",
barWidth: "12px",
itemStyle: {
normal: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: "#29acff",
},
{
offset: 1,
color: "#4bdfff",
},
]),
barBorderRadius: 6,
},
},
data: this.series1data1,
},
{
name: "实际产量",
type: "bar",
barWidth: "12px",
itemStyle: {
normal: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: "#3d93f2",
},
{
offset: 1,
color: "#5dc1fd",
},
]),
barBorderRadius: 6,
},
},
data: this.series1data2,
},
{
name: "达成率",
type: "line",
yAxisIndex: 1, //使 y index y
smooth: false, //线
symbol: "circle", //
symbolSize: 8, //
itemStyle: {
normal: {
color: "#ffa43a",
borderColor: "rgba(255, 234, 0, 0.5)", //
borderWidth: 5,
},
},
lineStyle: {
color: "#ffa43a",
},
data: this.series1data3,
},
],
};
this.statusChart.setOption(this.option);
},
//
// optionNameoptionopiton
//
changeSize() {
this.statusChart.resize();
},
},
};
</script>
<style lang='scss' scoped>
.chart-container {
position: relative;
width: 100%;
height: 100%;
.chart,
.bg {
width: 100%;
height: 100%;
}
.bg {
position: absolute;
bottom: 50px;
left: 50%;
z-index: -1;
width: 180px;
height: 73px;
background: no-repeat center;
background-image: url("https://ks3-cn-beijing.ksyun.com/sxjg-elevator/datav-platform-2.0/images/chart_opacity_bg.png");
background-size: 100% 100%;
transform: translateX(-50%);
}
}
.activehide {
display: none;
}
</style>

@ -79,11 +79,21 @@
<div class="titlename">接料次数占比</div>
</div>
<div class="echartsbox echartspie">
<Echarts3D
<!-- <Echarts3D
:list="optionDatalist4"
:colorlist="colorlist"
style="margin: auto; width: 409.17px; height: 173px"
></Echarts3D>
></Echarts3D> -->
<!-- <div
id="echartbar1"
style="margin: auto; width: 409.17px; height: 173px"
></div> -->
<Echarts3dbar
:xAxis4data="xAxis4data"
:yAxis4seriesMAX1="yAxis4seriesMAX1"
:series4data="series4data"
style="margin: auto; width: 409.17px; height: 173px"
></Echarts3dbar>
</div>
</div>
<div class="item">
@ -107,11 +117,15 @@
<div class="titlename">成型机产量占比</div>
</div>
<div class="echartsbox echartspie">
<Echarts3D
:list="optionDatalist1"
:colorlist="colorlist"
style="margin: auto; width: 439.17px; height: 183px"
></Echarts3D>
<Echarts3dbar2
:xAxis1data="xAxis1data"
:yAxis1seriesMAX1="yAxis1seriesMAX1"
:yAxis1seriesMAX2="yAxis1seriesMAX2"
:series1data1="series1data1"
:series1data2="series1data2"
:series1data3="series1data3"
style="margin: auto; width: 409.17px; height: 173px"
></Echarts3dbar2>
</div>
</div>
<div class="item">
@ -135,11 +149,15 @@
<div class="titlename">烘房产量占比</div>
</div>
<div class="echartsbox echartspie">
<Echarts3D
:list="optionDatalist2"
:colorlist="colorlist"
<Echarts3dbar2
:xAxis1data="xAxis2data"
:yAxis1seriesMAX1="yAxis2seriesMAX1"
:yAxis1seriesMAX2="yAxis2seriesMAX2"
:series1data1="series2data1"
:series1data2="series2data2"
:series1data3="series2data3"
style="margin: auto; width: 409.17px; height: 173px"
></Echarts3D>
></Echarts3dbar2>
</div>
</div>
<div class="item">
@ -163,11 +181,15 @@
<div class="titlename">收坯机产量占比</div>
</div>
<div class="echartsbox echartspie">
<Echarts3D
:list="optionDatalist3"
:colorlist="colorlist"
<Echarts3dbar2
:xAxis1data="xAxis3data"
:yAxis1seriesMAX1="yAxis3seriesMAX1"
:yAxis1seriesMAX2="yAxis3seriesMAX2"
:series1data1="series3data1"
:series1data2="series3data2"
:series1data3="series3data3"
style="margin: auto; width: 409.17px; height: 173px"
></Echarts3D>
></Echarts3dbar2>
</div>
</div>
@ -182,20 +204,23 @@
import {
getBoardFactory,
getMesBoardEquProductionToday,
getWhiteBoardEquPro7Days,
getBoardShifts,
} from "@/api/kanban/dailyoutput";
import {
getDeviceRefreshTime,
} from "@/api/kanban/equipment";
import { getDeviceRefreshTime } from "@/api/kanban/equipment";
import * as echarts from "echarts";
import moment from "moment";
import Echarts3D from "./echarts3d.vue";
import Echarts3D2 from "./echarts3d2.vue";
import Echarts3dbar from "./echarts3dbar.vue";
import Echarts3dbar2 from "./echarts3dbar2.vue";
export default {
name: "Index",
components: {
Echarts3D,
Echarts3D2,
Echarts3dbar,
Echarts3dbar2,
},
data() {
return {
@ -226,10 +251,292 @@ export default {
colorlist: ["#005aff", "#f8b551"],
datetime: null,
time1: null,
RefreshTime:null,
RefreshTime: null,
aitem: [
{
factory: null,
ymd: null,
equCode: "L1",
equName: "湿混机01",
totalNum: 19,
totalNum0: null,
equTypeCode: "equ_type_lg",
equTypeName: null,
shiftId: null,
factoryCode: null,
equipmentTypeCode: null,
planProduction: null,
actProduction: null,
plans: null,
acts: null,
days: null,
startTime: null,
endTime: null,
productName: null,
productCode: null,
workorderCodeSap: null,
workorderCode: null,
unit: null,
taskSampleNum: null,
taskNum: null,
checkList: null,
unitPro: null,
rfid: null,
createTime: null,
isqua: null,
standarMan: null,
actMan: null,
standarXl: null,
actXl: null,
},
{
factory: null,
ymd: null,
equCode: "L2",
equName: "湿混机02",
totalNum: 19,
totalNum0: null,
equTypeCode: "equ_type_lg",
equTypeName: null,
shiftId: null,
factoryCode: null,
equipmentTypeCode: null,
planProduction: null,
actProduction: null,
plans: null,
acts: null,
days: null,
startTime: null,
endTime: null,
productName: null,
productCode: null,
workorderCodeSap: null,
workorderCode: null,
unit: null,
taskSampleNum: null,
taskNum: null,
checkList: null,
unitPro: null,
rfid: null,
createTime: null,
isqua: null,
standarMan: null,
actMan: null,
standarXl: null,
actXl: null,
},
{
factory: null,
ymd: null,
equCode: "L3",
equName: "湿混机03",
totalNum: 19,
totalNum0: null,
equTypeCode: "equ_type_lg",
equTypeName: null,
shiftId: null,
factoryCode: null,
equipmentTypeCode: null,
planProduction: null,
actProduction: null,
plans: null,
acts: null,
days: null,
startTime: null,
endTime: null,
productName: null,
productCode: null,
workorderCodeSap: null,
workorderCode: null,
unit: null,
taskSampleNum: null,
taskNum: null,
checkList: null,
unitPro: null,
rfid: null,
createTime: null,
isqua: null,
standarMan: null,
actMan: null,
standarXl: null,
actXl: null,
},
{
factory: null,
ymd: null,
equCode: "L4",
equName: "湿混机04",
totalNum: 19,
totalNum0: null,
equTypeCode: "equ_type_lg",
equTypeName: null,
shiftId: null,
factoryCode: null,
equipmentTypeCode: null,
planProduction: null,
actProduction: null,
plans: null,
acts: null,
days: null,
startTime: null,
endTime: null,
productName: null,
productCode: null,
workorderCodeSap: null,
workorderCode: null,
unit: null,
taskSampleNum: null,
taskNum: null,
checkList: null,
unitPro: null,
rfid: null,
createTime: null,
isqua: null,
standarMan: null,
actMan: null,
standarXl: null,
actXl: null,
},
{
factory: null,
ymd: null,
equCode: "L6",
equName: "湿混机06",
totalNum: 21,
totalNum0: null,
equTypeCode: "equ_type_lg",
equTypeName: null,
shiftId: null,
factoryCode: null,
equipmentTypeCode: null,
planProduction: null,
actProduction: null,
plans: null,
acts: null,
days: null,
startTime: null,
endTime: null,
productName: null,
productCode: null,
workorderCodeSap: null,
workorderCode: null,
unit: null,
taskSampleNum: null,
taskNum: null,
checkList: null,
unitPro: null,
rfid: null,
createTime: null,
isqua: null,
standarMan: null,
actMan: null,
standarXl: null,
actXl: null,
},
{
factory: null,
ymd: null,
equCode: "L7",
equName: "湿混机07",
totalNum: 18,
totalNum0: null,
equTypeCode: "equ_type_lg",
equTypeName: null,
shiftId: null,
factoryCode: null,
equipmentTypeCode: null,
planProduction: null,
actProduction: null,
plans: null,
acts: null,
days: null,
startTime: null,
endTime: null,
productName: null,
productCode: null,
workorderCodeSap: null,
workorderCode: null,
unit: null,
taskSampleNum: null,
taskNum: null,
checkList: null,
unitPro: null,
rfid: null,
createTime: null,
isqua: null,
standarMan: null,
actMan: null,
standarXl: null,
actXl: null,
},
{
factory: null,
ymd: null,
equCode: "L8",
equName: "湿混机08",
totalNum: 19,
totalNum0: null,
equTypeCode: "equ_type_lg",
equTypeName: null,
shiftId: null,
factoryCode: null,
equipmentTypeCode: null,
planProduction: null,
actProduction: null,
plans: null,
acts: null,
days: null,
startTime: null,
endTime: null,
productName: null,
productCode: null,
workorderCodeSap: null,
workorderCode: null,
unit: null,
taskSampleNum: null,
taskNum: null,
checkList: null,
unitPro: null,
rfid: null,
createTime: null,
isqua: null,
standarMan: null,
actMan: null,
standarXl: null,
actXl: null,
},
],
aitem1: [],
Chart2yAxisMAX1: "",
Chart2yAxisMAX2: 100,
Chart2seriesdata: [],
Chart2seriesMAX: [],
Chart2xAxisname: [],
xAxis1data: [],
yAxis1seriesMAX1: 0,
yAxis1seriesMAX2: 0,
series1data1: [],
series1data2: [],
series1data3: [],
xAxis2data: [],
yAxis2seriesMAX1: 0,
yAxis2seriesMAX2: 0,
series2data1: [],
series2data2: [],
series2data3: [],
xAxis3data: [],
yAxis3seriesMAX1: 0,
yAxis3seriesMAX2: 0,
series3data1: [],
series3data2: [],
series3data3: [],
xAxis4data: [],
yAxis4seriesMAX1: 0,
series4data: [],
};
},
created() {},
destroyed() {
clearInterval(this.time1);
this.time1 = null;
@ -252,23 +559,26 @@ export default {
},
selectFactorylist() {
const _this = this;
getBoardFactory({
factory: null,
}).then((response) => {
if (response.data) {
_this.getLineList = response.data;
_this.selectxt = _this.getLineList[0].parentName;
getBoardShifts({
factory: _this.selectxt,
}).then((response) => {
if (response.data) {
console.log(response.data);
_this.classesList = response.data;
_this.selectxtclasses = _this.classesList[0].shiftId;
_this.initChart1();
_this.getDeviceRefreshTime()
}
});
_this.initChart1();
_this.getDeviceRefreshTime();
// getBoardShifts({
// factory: _this.selectxt,
// }).then((response) => {
// if (response.data) {
// console.log(response.data);
// _this.classesList = response.data;
// _this.selectxtclasses = _this.classesList[0].shiftId;
// _this.initChart1();
// _this.getDeviceRefreshTime();
// }
// });
}
});
},
@ -276,11 +586,11 @@ export default {
const _this = this;
getDeviceRefreshTime().then((response) => {
if (response.data) {
console.log(response.data)
this.RefreshTime = response.data
console.log(response.data);
this.RefreshTime = response.data;
this.time1 = setInterval(() => {
_this.initChart1();
}, 1000*60*this.RefreshTime);
}, 1000 * 60 * this.RefreshTime);
}
});
},
@ -307,7 +617,7 @@ export default {
},
xAxis: {
name: "辆",
max: '100',
max: "100",
splitLine: {
show: false,
},
@ -388,7 +698,7 @@ export default {
],
};
myChart1.setOption(option1);
getMesBoardEquProductionToday({
getWhiteBoardEquPro7Days({
factory: _this.selectxt,
shiftId: _this.selectxtclasses,
ymd: _this.datetime,
@ -396,126 +706,20 @@ export default {
}).then((response) => {
if (response) {
if (response.data) {
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);
});
// response.data.everyNum.forEach((item) => {
// let a = {};
// a.name = item.equName;
// a.value = item.totalNum;
// a.code = item.equCode;
// dataoption.push(a);
// _this.optionDatalist1.push(a);
// });
// response.data.everyNum.forEach((item) => {
// let a = {};
// a.name = item.equName;
// a.value = item.totalNum;
// a.code = item.equCode;
// dataoption.push(a);
// _this.optionDatalist1.push(a);
// });
// response.data.everyNum.forEach((item) => {
// let a = {};
// a.name = item.equName;
// a.value = item.totalNum;
// a.code = item.equCode;
// dataoption.push(a);
// _this.optionDatalist1.push(a);
// });
// response.data.everyNum.forEach((item) => {
// let a = {};
// a.name = item.equName;
// a.value = item.totalNum;
// a.code = item.equCode;
// dataoption.push(a);
// _this.optionDatalist1.push(a);
// });
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);
_this.xAxis1data = response.data.dayNames;
_this.series1data1 = response.data.plans;
_this.series1data2 = response.data.acts;
_this.series1data3 = response.data.finishRatio;
let MAX1 = 0;
let MAX2 = 0;
MAX1 = Math.max(..._this.series1data1);
MAX2 = Math.max(..._this.series1data2);
if (MAX1 > MAX2) {
_this.yAxis1seriesMAX1 = MAX1;
} else {
_this.yAxis1seriesMAX1 = MAX2;
}
_this.yAxis1seriesMAX2 = Math.max(..._this.series1data3);
}
}
});
@ -621,7 +825,7 @@ export default {
],
};
myChart2.setOption(option2);
getMesBoardEquProductionToday({
getWhiteBoardEquPro7Days({
factory: _this.selectxt,
shiftId: _this.selectxtclasses,
ymd: _this.datetime,
@ -632,83 +836,20 @@ export default {
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);
_this.xAxis2data = response.data.dayNames;
_this.series2data1 = response.data.plans;
_this.series2data2 = response.data.acts;
_this.series2data3 = response.data.finishRatio;
let MAX1 = 0;
let MAX2 = 0;
MAX1 = Math.max(..._this.series2data1);
MAX2 = Math.max(..._this.series2data2);
if (MAX1 > MAX2) {
_this.yAxis2seriesMAX1 = MAX1;
} else {
_this.yAxis2seriesMAX1 = MAX2;
}
_this.yAxis2seriesMAX2 = Math.max(..._this.series2data3);
}
}
});
@ -814,7 +955,7 @@ export default {
],
};
myChart3.setOption(option3);
getMesBoardEquProductionToday({
getWhiteBoardEquPro7Days({
factory: _this.selectxt,
shiftId: _this.selectxtclasses,
ymd: _this.datetime,
@ -822,87 +963,20 @@ export default {
}).then((response) => {
if (response) {
if (response.data) {
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);
_this.xAxis3data = response.data.dayNames;
_this.series3data1 = response.data.plans;
_this.series3data2 = response.data.acts;
_this.series3data3 = response.data.finishRatio;
let MAX1 = 0;
let MAX2 = 0;
MAX1 = Math.max(..._this.series3data1);
MAX2 = Math.max(..._this.series3data2);
if (MAX1 > MAX2) {
_this.yAxis3seriesMAX1 = MAX1;
} else {
_this.yAxis3seriesMAX1 = MAX2;
}
_this.yAxis3seriesMAX2 = Math.max(..._this.series3data3);
}
}
});
@ -1008,7 +1082,7 @@ export default {
],
};
myChart4.setOption(option4);
getMesBoardEquProductionToday({
getWhiteBoardEquPro7Days({
factory: _this.selectxt,
shiftId: _this.selectxtclasses,
ymd: _this.datetime,
@ -1020,11 +1094,15 @@ export default {
let dataoption = [];
let totalArr = [];
_this.optionDatalist4 = [];
_this.series4data = [];
_this.xAxis4data = [];
if (response.data.totalNum.length > 0) {
_this.number4 = response.data.totalNum[0].totalNum;
}
if (response.data.everyNum.length > 0) {
response.data.everyNum.forEach((item) => {
this.series4data.push(item.totalNum);
this.xAxis4data.push(item.equName);
let a = {};
a.name = item.equName;
a.value = item.totalNum;
@ -1033,6 +1111,7 @@ export default {
dataoption.push(a);
numberlist.push(item.totalNum);
});
this.yAxis4seriesMAX1 = Math.max(...this.series4data);
dataoption.sort((a, b) => {
return a.value - b.value;
});

Loading…
Cancel
Save