diff --git a/src/pages/3D.vue b/src/pages/3D.vue index 0500501..1be4372 100644 --- a/src/pages/3D.vue +++ b/src/pages/3D.vue @@ -4,7 +4,17 @@ import { useSettings } from '../store/settings'; import { useWsStore } from "../store"; import { ref, computed } from '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 store = useWsStore(); const lines = ref({ @@ -13,98 +23,20 @@ const lines = ref({ g3: store.data2.lineDetailData?.[2] || null, // 钢3线 }); store.$subscribe((mutation, state) => { + // 进储片信息 if (state.data2.lineDetailData && state.data2.lineDetailData.length == 3) { lines.value.g1 = state.data2.lineDetailData[0] lines.value.g2 = state.data2.lineDetailData[1] lines.value.g3 = state.data2.lineDetailData[2] } -}) - - -const props = defineProps({ - line: { - type: Number, - default: 1, - }, + // 故障信息 + 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 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下片': '', -})