update status

This commit is contained in:
DESKTOP-FUDKNA8\znjsz 2024-01-23 11:23:36 +08:00
parent 7bf5a24cda
commit 0d96fec181
2 changed files with 184 additions and 86 deletions

View File

@ -4,7 +4,17 @@ import { useSettings } from '../store/settings';
import { useWsStore } from "../store"; import { useWsStore } from "../store";
import { ref, computed } from 'vue'; import { ref, computed } from 'vue';
import Icon from '../assets/svg/IconStatus.vue'; import Icon from '../assets/svg/IconStatus.vue';
import { eqMap, statusMap, initState } from './eqMaps'
const props = defineProps({
line: {
type: Number,
default: 1,
},
});
const eqStatus = computed(() => settings.eqStatus);
const status = ref(initState)
const { settings } = useSettings(); const { settings } = useSettings();
const store = useWsStore(); const store = useWsStore();
const lines = ref({ const lines = ref({
@ -13,98 +23,20 @@ const lines = ref({
g3: store.data2.lineDetailData?.[2] || null, // 3线 g3: store.data2.lineDetailData?.[2] || null, // 3线
}); });
store.$subscribe((mutation, state) => { store.$subscribe((mutation, state) => {
//
if (state.data2.lineDetailData && state.data2.lineDetailData.length == 3) { if (state.data2.lineDetailData && state.data2.lineDetailData.length == 3) {
lines.value.g1 = state.data2.lineDetailData[0] lines.value.g1 = state.data2.lineDetailData[0]
lines.value.g2 = state.data2.lineDetailData[1] lines.value.g2 = state.data2.lineDetailData[1]
lines.value.g3 = state.data2.lineDetailData[2] lines.value.g3 = state.data2.lineDetailData[2]
} }
//
if (state.data1.EquipmentsArrayList && Array.isArray(state.data1.EquipmentsArrayList)) {
state.data1.EquipmentsArrayList.map(item => {
const { equipmentName, status: itemStatus } = item;
status.value[eqMap[equipmentName]] = statusMap[itemStatus];
}) })
}
const props = defineProps({
line: {
type: Number,
default: 1,
},
}); });
const eqStatus = computed(() => settings.eqStatus);
const status = ref({
// 线
'M1上片': '',
'M2上片': '',
'M1磨边机': '',
'M2磨边机': '',
'M1清洗机': '',
'M1清洗机': '',
'S1丝印机': '',
'S2丝印机': '',
'S1前储片台': '',
'S2前储片台': '',
'S1清洗机': '',
'S2清洗机': '',
'Z1钻孔机': '',
'Z2钻孔机': '',
'B1前储片台': '',
'B1后储片台': '',
'B1下片': '',
'B1清洗机': '',
//
'M3清洗机': '',
'M4清洗机': '',
'M5清洗机': '',
'M3磨边机': '',
'M4磨边机': '',
'M5磨边机': '',
'M3上片': '',
'M4上片': '',
'M5上片': '',
'Z3钻孔机': '',
'Z4钻孔机': '',
'Z5钻孔机': '',
'S3清洗机': '',
'S4清洗机': '',
'S5清洗机': '',
'S3前储片台': '',
'S4前储片台': '',
'S5前储片台': '',
'S3丝印机': '',
'S4丝印机': '',
'S5丝印机': '',
'S3固化机': '',
'S4固化机': '',
'S5固化机': '',
'S3后储片台': '',
'S4后储片台': '',
'S5后储片台': '',
'B2前储片台': '',
'B2后储片台': '',
'B2下片': '',
'B2清洗机': '',
//
'M6上片': '',
'M7上片': '',
'M6磨边机': '',
'M7磨边机': '',
'M6清洗机': '',
'M7清洗机': '',
'Z6钻孔机': '',
'Z7钻孔机': '',
'S6清洗机': '',
'S7清洗机': '',
'S6前储片台': '',
'S7前储片台': '',
'S6丝印机': '',
'S7丝印机': '',
'S6固化炉': '',
'S7固化炉': '',
'S6后储片台': '',
'S7后储片台': '',
'B3前储片台': '',
'B3后储片台': '',
'B3清洗机': '',
'B3下片': '',
})
</script> </script>
<template> <template>

166
src/pages/eqMaps.js Normal file
View File

@ -0,0 +1,166 @@
export const initState = {
// 钢一线
M1上片: "",
M2上片: "",
M1磨边机: "",
M2磨边机: "",
M1清洗机: "",
M1清洗机: "",
S1丝印机: "",
S2丝印机: "",
S1前储片台: "",
S2前储片台: "",
S1清洗机: "",
S2清洗机: "",
Z1钻孔机: "",
Z2钻孔机: "",
B1前储片台: "",
B1后储片台: "",
B1下片: "",
B1清洗机: "",
//
M3清洗机: "",
M4清洗机: "",
M5清洗机: "",
M3磨边机: "",
M4磨边机: "",
M5磨边机: "",
M3上片: "",
M4上片: "",
M5上片: "",
Z3钻孔机: "",
Z4钻孔机: "",
Z5钻孔机: "",
S3清洗机: "",
S4清洗机: "",
S5清洗机: "",
S3前储片台: "",
S4前储片台: "",
S5前储片台: "",
S3丝印机: "",
S4丝印机: "",
S5丝印机: "",
S3固化机: "",
S4固化机: "",
S5固化机: "",
S3后储片台: "",
S4后储片台: "",
S5后储片台: "",
B2前储片台: "",
B2后储片台: "",
B2下片: "",
B2清洗机: "",
//
M6上片: "",
M7上片: "",
M6磨边机: "",
M7磨边机: "",
M6清洗机: "",
M7清洗机: "",
Z6钻孔机: "",
Z7钻孔机: "",
S6清洗机: "",
S7清洗机: "",
S6前储片台: "",
S7前储片台: "",
S6丝印机: "",
S7丝印机: "",
S6固化炉: "",
S7固化炉: "",
S6后储片台: "",
S7后储片台: "",
B3前储片台: "",
B3后储片台: "",
B3清洗机: "",
B3下片: "",
};
export const statusMap = [
"error", // 关机
"work", // 工作
"warn", // 未工作
"error", // 错误
];
export const eqMap = {
// 钢一线
C1LR1: "M1上片",
C1LR2: "M2上片",
C1MM1: "M1磨边机",
C1MM2: "M2磨边机",
C1ECM1: "M1清洗机",
C1ECM2: "M2清洗机",
"s1--": "S1丝印机",
"s2--": "S2丝印机",
C1ST1: "S1前储片台",
C1ST2: "S2前储片台",
C1SCM1: "S1清洗机",
C1SCM2: "S2清洗机",
C1HP1: "Z1钻孔机",
C1HP2: "Z2钻孔机",
C3ST1: "B1前储片台",
C3ST2: "B1后储片台",
C3UL1: "B1下片",
C3UL1: "B1下片1",
C3UL2: "B1下片2",
C3UCM1: "B1清洗机",
//
B1ECM1: "M3清洗机",
B1ECM2: "M4清洗机",
B1ECM3: "M5清洗机",
B1MM1: "M3磨边机",
B1MM2: "M4磨边机",
B1MM3: "M5磨边机",
B1LR1: "M3上片",
B1LR2: "M4上片",
B1LR3: "M5上片",
B1HP1: "Z3钻孔机",
B1HP2: "Z4钻孔机",
B1HP3: "Z5钻孔机",
B1SCM1: "S3清洗机",
B1SCM2: "S4清洗机",
B1SCM3: "S5清洗机",
B1ST1: "S3前储片台",
B1ST2: "S4前储片台",
B1ST3: "S5前储片台",
B1SP1: "S3丝印机",
B1SP2: "S4丝印机",
B1SP3: "S5丝印机",
B2CO1: "S3固化炉",
B2CO2: "S4固化炉",
B2CO3: "S5固化炉",
B2ST1: "S3后储片台",
B2ST2: "S4后储片台",
B2ST3: "S5后储片台",
B3ST1: "B2前储片台",
B3ST2: "B2后储片台",
B3UL1: "B2下片",
B3UL1: "B2下片1",
B3UL2: "B2下片2",
B3UCM1: "B2清洗机",
//
A1LR1: "M6上片",
A1LR2: "M7上片",
A1MM1: "M6磨边机",
A1MM2: "M7磨边机",
A1ECM1: "M6清洗机",
A1ECM2: "M7清洗机",
A1HP1: "Z6钻孔机",
A1HP2: "Z7钻孔机",
A1SCM1: "S6清洗机",
A1SCM2: "S7清洗机",
A1ST1: "S6前储片台",
A1ST2: "S7前储片台",
A1SP1: "S6丝印机",
A1SP2: "S7丝印机",
A2CO1: "S6固化炉",
A2CO2: "S7固化炉",
A2ST1: "S6后储片台",
A2ST2: "S7后储片台",
A3ST1: "B3前储片台",
A3ST2: "B3后储片台",
A3UCM1: "B3清洗机",
A3UL1: "B3下片",
A3UL1: "B3下片1",
A3UL2: "B3下片2",
};