|
|
|
@ -130,6 +130,7 @@ import { equipmentRecordApi } from 'src/api/equipmentRecord/equipmentRecordApi';
|
|
|
|
|
// import screen1 from 'src/json/screen1.json'
|
|
|
|
|
import { Vue3SeamlessScroll } from "vue3-seamless-scroll"; // 循环滚动
|
|
|
|
|
import { useScreenStore } from 'src/stores/useScreenStore'
|
|
|
|
|
import lodash from 'lodash'
|
|
|
|
|
|
|
|
|
|
//公共
|
|
|
|
|
const screenStore = useScreenStore();
|
|
|
|
@ -421,25 +422,31 @@ const EquipmentRecordStateMonthTotal = () => {
|
|
|
|
|
let totalAlarmTime: any = []; // 报警
|
|
|
|
|
let totalStopTime: any = []; // 待机
|
|
|
|
|
let month: any = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12];
|
|
|
|
|
let result: Array<object> = [];
|
|
|
|
|
|
|
|
|
|
// 获取设备记录开炉次数月统计
|
|
|
|
|
equipmentRecordApi.getEquipmentRecordStateMonthTotal().then((res: any) => {
|
|
|
|
|
month.forEach((m: any) => {
|
|
|
|
|
res.forEach((item: any) => {
|
|
|
|
|
// let isMonth = month.filter((m: any) => m === item.totalMonth)
|
|
|
|
|
if (item.totalMonth == m) {
|
|
|
|
|
totalRunningTime.push(item.totalRunningTime);
|
|
|
|
|
totalStopTime.push(item.totalStopTime);
|
|
|
|
|
totalAlarmTime.push(item.totalAlarmTime);
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
totalRunningTime.push(0);
|
|
|
|
|
totalStopTime.push(0);
|
|
|
|
|
totalAlarmTime.push(0);
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
res.forEach((item: any) => {
|
|
|
|
|
result.push({ product: item.totalMonth + '月', ...item })
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
// month.forEach((m: any) => {
|
|
|
|
|
// res.forEach((item: any) => {
|
|
|
|
|
// // let isMonth = month.filter((m: any) => m === item.totalMonth)
|
|
|
|
|
// if (item.totalMonth == m) {
|
|
|
|
|
// totalRunningTime.push(item.totalRunningTime);
|
|
|
|
|
// totalStopTime.push(item.totalStopTime);
|
|
|
|
|
// totalAlarmTime.push(item.totalAlarmTime);
|
|
|
|
|
// }
|
|
|
|
|
// else {
|
|
|
|
|
// totalRunningTime.push(0);
|
|
|
|
|
// totalStopTime.push(0);
|
|
|
|
|
// totalAlarmTime.push(0);
|
|
|
|
|
// }
|
|
|
|
|
// })
|
|
|
|
|
// })
|
|
|
|
|
|
|
|
|
|
// 指定图表的配置项和数据
|
|
|
|
|
let equipmentRecordStateMonthTotalOption = {
|
|
|
|
|
title: {
|
|
|
|
@ -492,7 +499,8 @@ const EquipmentRecordStateMonthTotal = () => {
|
|
|
|
|
xAxis: [
|
|
|
|
|
{
|
|
|
|
|
type: 'category',
|
|
|
|
|
data: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'],
|
|
|
|
|
// data: month,
|
|
|
|
|
// data: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'],
|
|
|
|
|
axisPointer: {
|
|
|
|
|
type: 'shadow'
|
|
|
|
|
}
|
|
|
|
@ -522,11 +530,15 @@ const EquipmentRecordStateMonthTotal = () => {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
dataset: {
|
|
|
|
|
dimensions: ['product', 'totalRunningTime', 'totalAlarmTime', 'totalStopTime'],
|
|
|
|
|
source: result
|
|
|
|
|
},
|
|
|
|
|
series: [
|
|
|
|
|
{
|
|
|
|
|
name: '运行时间',
|
|
|
|
|
type: 'bar',
|
|
|
|
|
data: totalRunningTime,
|
|
|
|
|
// data: totalRunningTime,
|
|
|
|
|
itemStyle: {
|
|
|
|
|
normal: {
|
|
|
|
|
label: {
|
|
|
|
@ -545,7 +557,7 @@ const EquipmentRecordStateMonthTotal = () => {
|
|
|
|
|
{
|
|
|
|
|
name: '待机时间',
|
|
|
|
|
type: 'bar',
|
|
|
|
|
data: totalStopTime,
|
|
|
|
|
// data: totalStopTime,
|
|
|
|
|
itemStyle: {
|
|
|
|
|
normal: {
|
|
|
|
|
label: {
|
|
|
|
@ -564,7 +576,7 @@ const EquipmentRecordStateMonthTotal = () => {
|
|
|
|
|
{
|
|
|
|
|
name: '报警时间',
|
|
|
|
|
type: 'bar',
|
|
|
|
|
data: totalAlarmTime,
|
|
|
|
|
// data: totalAlarmTime,
|
|
|
|
|
itemStyle: {
|
|
|
|
|
normal: {
|
|
|
|
|
label: {
|
|
|
|
@ -592,18 +604,23 @@ const EquipmentRecordStateMonthTotal = () => {
|
|
|
|
|
const EquipmentRecordOEEMonthTotal = () => {
|
|
|
|
|
let oeeData: any = []; // 运行
|
|
|
|
|
let month: any = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12];
|
|
|
|
|
let result: Array<object> = [];
|
|
|
|
|
|
|
|
|
|
// 获取设备记录OEE月度统计
|
|
|
|
|
equipmentRecordApi.getEquipmentRecordOEEMonthTotal().then((res: any) => {
|
|
|
|
|
month.forEach((m: any) => {
|
|
|
|
|
res.forEach((item: any) => {
|
|
|
|
|
if (item.totalMonth == m) {
|
|
|
|
|
oeeData.push(item.oee);
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
oeeData.push(0);
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
// month.forEach((m: any) => {
|
|
|
|
|
// res.forEach((item: any) => {
|
|
|
|
|
// if (item.totalMonth == m) {
|
|
|
|
|
// oeeData.push(item.oee);
|
|
|
|
|
// }
|
|
|
|
|
// else {
|
|
|
|
|
// oeeData.push(0);
|
|
|
|
|
// }
|
|
|
|
|
// })
|
|
|
|
|
// })
|
|
|
|
|
|
|
|
|
|
res.forEach((item: any) => {
|
|
|
|
|
result.push({ product: item.totalMonth + '月', ...item })
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
// 指定图表的配置项和数据
|
|
|
|
@ -655,10 +672,14 @@ const EquipmentRecordOEEMonthTotal = () => {
|
|
|
|
|
right: '2%',
|
|
|
|
|
data: ['OEE数据']
|
|
|
|
|
},
|
|
|
|
|
dataset: {
|
|
|
|
|
dimensions: ['product', 'oee'],
|
|
|
|
|
source: result
|
|
|
|
|
},
|
|
|
|
|
xAxis: [
|
|
|
|
|
{
|
|
|
|
|
type: 'category',
|
|
|
|
|
data: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'],
|
|
|
|
|
// data: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'],
|
|
|
|
|
// axisPointer: {
|
|
|
|
|
// type: 'shadow'
|
|
|
|
|
// }
|
|
|
|
@ -692,7 +713,7 @@ const EquipmentRecordOEEMonthTotal = () => {
|
|
|
|
|
{
|
|
|
|
|
name: 'OEE数据',
|
|
|
|
|
type: 'line',
|
|
|
|
|
data: oeeData,
|
|
|
|
|
// data: oeeData,
|
|
|
|
|
itemStyle: {
|
|
|
|
|
normal: {
|
|
|
|
|
label: {
|
|
|
|
@ -743,32 +764,68 @@ const EquipmentRecordFurnaceMonthTotal = () => {
|
|
|
|
|
let CemeCon: any = [];
|
|
|
|
|
let Ionbond: any = [];
|
|
|
|
|
let month: any = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12];
|
|
|
|
|
let result: Array<object> = [];
|
|
|
|
|
|
|
|
|
|
// 获取设备记录开炉次数月统计
|
|
|
|
|
equipmentRecordApi.getEquipmentRecordFurnaceMonthTotal().then((res: any) => {
|
|
|
|
|
month.forEach((m: any) => {
|
|
|
|
|
res.forEach((item: any) => {
|
|
|
|
|
if (item.totalMonth == m) {
|
|
|
|
|
if (item.equipmentType == 'Balzers') {
|
|
|
|
|
Balzers.push(item.furnaceNum);
|
|
|
|
|
}
|
|
|
|
|
if (item.equipmentType == 'CemeCon') {
|
|
|
|
|
CemeCon.push(item.furnaceNum);
|
|
|
|
|
}
|
|
|
|
|
if (item.equipmentType == 'Ionbond') {
|
|
|
|
|
Ionbond.push(item.furnaceNum);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
if (item.equipmentType == 'Balzers') {
|
|
|
|
|
Balzers.push(0);
|
|
|
|
|
}
|
|
|
|
|
if (item.equipmentType == 'CemeCon') {
|
|
|
|
|
CemeCon.push(0);
|
|
|
|
|
}
|
|
|
|
|
if (item.equipmentType == 'Ionbond') {
|
|
|
|
|
Ionbond.push(0);
|
|
|
|
|
// month.forEach((m: any) => {
|
|
|
|
|
// res.forEach((item: any) => {
|
|
|
|
|
// if (item.totalMonth == m) {
|
|
|
|
|
// if (item.equipmentType == 'Balzers') {
|
|
|
|
|
// Balzers.push(item.furnaceNum);
|
|
|
|
|
// }
|
|
|
|
|
// if (item.equipmentType == 'CemeCon') {
|
|
|
|
|
// CemeCon.push(item.furnaceNum);
|
|
|
|
|
// }
|
|
|
|
|
// if (item.equipmentType == 'Ionbond') {
|
|
|
|
|
// Ionbond.push(item.furnaceNum);
|
|
|
|
|
// }
|
|
|
|
|
// } else {
|
|
|
|
|
// if (item.equipmentType == 'Balzers') {
|
|
|
|
|
// Balzers.push(0);
|
|
|
|
|
// }
|
|
|
|
|
// if (item.equipmentType == 'CemeCon') {
|
|
|
|
|
// CemeCon.push(0);
|
|
|
|
|
// }
|
|
|
|
|
// if (item.equipmentType == 'Ionbond') {
|
|
|
|
|
// Ionbond.push(0);
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// })
|
|
|
|
|
// })
|
|
|
|
|
|
|
|
|
|
// let grouped_data = lodash.groupBy(res, 'totalMonth');
|
|
|
|
|
// console.log(grouped_data);
|
|
|
|
|
|
|
|
|
|
var obj = {}, newArr = [];
|
|
|
|
|
res.forEach(function (item, suffix) {
|
|
|
|
|
//根据对象的属性是唯一的,将值作为对象的属性名
|
|
|
|
|
if (!obj[item.totalMonth]) {
|
|
|
|
|
var arr = [];
|
|
|
|
|
arr.push(item);
|
|
|
|
|
newArr.push(arr);
|
|
|
|
|
obj[item.totalMonth] = item;
|
|
|
|
|
} else {
|
|
|
|
|
newArr.forEach(function (value, index) {
|
|
|
|
|
//如果已经存在 就循环新组的值将值插入属性相同的数组里 为了防止重复添加 只要和第一个比较就可以了
|
|
|
|
|
if (value[0].totalMonth == item.totalMonth) {
|
|
|
|
|
value.push(item)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
newArr.forEach((item: any) => {
|
|
|
|
|
let CemeCon = item.filter(c => {
|
|
|
|
|
return c.equipmentType == 'CemeCon'
|
|
|
|
|
})
|
|
|
|
|
let Balzers = item.filter(b => { return b.equipmentType == 'Balzers' })
|
|
|
|
|
let Ionbond = item.filter(i => { return i.equipmentType == 'Ionbond' })
|
|
|
|
|
result.push({
|
|
|
|
|
product: item[0].totalMonth + '月',
|
|
|
|
|
CemeCon: CemeCon[0].furnaceNum,
|
|
|
|
|
Balzers: Balzers[0].furnaceNum,
|
|
|
|
|
Ionbond: Ionbond[0].furnaceNum,
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
@ -815,7 +872,7 @@ const EquipmentRecordFurnaceMonthTotal = () => {
|
|
|
|
|
},
|
|
|
|
|
xAxis: {
|
|
|
|
|
type: 'category',
|
|
|
|
|
data: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'],
|
|
|
|
|
// data: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'],
|
|
|
|
|
axisLine: {
|
|
|
|
|
show: true,
|
|
|
|
|
lineStyle: {
|
|
|
|
@ -849,11 +906,15 @@ const EquipmentRecordFurnaceMonthTotal = () => {
|
|
|
|
|
show: true //显示分隔线
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
dataset: {
|
|
|
|
|
dimensions: ['product', 'Balzers', 'CemeCon', 'Ionbond'],
|
|
|
|
|
source: result
|
|
|
|
|
},
|
|
|
|
|
series: [
|
|
|
|
|
{
|
|
|
|
|
name: 'Balzers',
|
|
|
|
|
type: 'bar',
|
|
|
|
|
data: Balzers,
|
|
|
|
|
// data: Balzers,
|
|
|
|
|
itemStyle: {
|
|
|
|
|
normal: {
|
|
|
|
|
label: {
|
|
|
|
@ -872,7 +933,7 @@ const EquipmentRecordFurnaceMonthTotal = () => {
|
|
|
|
|
{
|
|
|
|
|
name: 'CemeCon',
|
|
|
|
|
type: 'bar',
|
|
|
|
|
data: CemeCon,
|
|
|
|
|
// data: CemeCon,
|
|
|
|
|
itemStyle: {
|
|
|
|
|
normal: {
|
|
|
|
|
label: {
|
|
|
|
@ -891,7 +952,7 @@ const EquipmentRecordFurnaceMonthTotal = () => {
|
|
|
|
|
{
|
|
|
|
|
name: 'Ionbond',
|
|
|
|
|
type: 'bar',
|
|
|
|
|
data: Ionbond,
|
|
|
|
|
// data: Ionbond,
|
|
|
|
|
itemStyle: {
|
|
|
|
|
normal: {
|
|
|
|
|
label: {
|
|
|
|
|