diff --git a/src/components/RealtimeChart.vue b/src/components/RealtimeChart.vue index 4d06959..378d484 100644 --- a/src/components/RealtimeChart.vue +++ b/src/components/RealtimeChart.vue @@ -98,9 +98,9 @@ function updateChartOption(product, scrap) { chart.value.setOption(options); } -const productAmount = ref(0); -const scrapAmount = ref(0); const store = useWsStore(); +const productAmount = ref(store.data1.realTimeData?.product || 0); +const scrapAmount = ref(store.data1.realTimeData?.scrap || 0); store.$subscribe((mutation, state) => { productAmount.value = state.data1.realTimeData?.product || 0; scrapAmount.value = state.data1.realTimeData?.scrap || 0; diff --git a/src/pages/AlertListPage.vue b/src/pages/AlertListPage.vue index f4b0a11..f38be78 100644 --- a/src/pages/AlertListPage.vue +++ b/src/pages/AlertListPage.vue @@ -4,12 +4,22 @@ import { ref } from "vue"; import { useWsStore } from "../store"; const alarmList = ref([]); const store = useWsStore(); + +alarmList.value = (store.data1.alarmArrList ?? []).map((item, index) => ({ + id: item.id, + eqName: item.equipmentName, + eqIndex: index + 1, + alarmGrade: item.alarmLevel, + alarmDetail: item.alarmDetails, + position: `${item.productLine} - ${item.segment}`, +})); + store.$subscribe((mutation, state) => { -// console.log("====state====\n"); -// console.log(state.data1); -// console.log(state.data2); -// console.log(state.data3); -// console.log("====state end====\n"); + // console.log("====state====\n"); + // console.log(state.data1); + // console.log(state.data2); + // console.log(state.data3); + // console.log("====state end====\n"); alarmList.value = state.data1.alarmArrList.map((item, index) => ({ id: item.id, eqName: item.equipmentName, diff --git a/src/pages/AnnouncementPage.vue b/src/pages/AnnouncementPage.vue index ea4d7d6..410e27d 100644 --- a/src/pages/AnnouncementPage.vue +++ b/src/pages/AnnouncementPage.vue @@ -5,9 +5,18 @@ import { useWsStore } from "../store"; const emit = defineEmits(["home"]); // load 公告 -const vertical_content = ref("公告加载中..."); -const horizontal_content = ref("公告加载中..."); const store = useWsStore(); +const vertical_content = ref( + (store.data3.deliveryNotification || []) + .map((item) => item.deliveryContent || "") + .join("") + .replaceAll(//g, "") || "暂无公告" +); +const horizontal_content = ref( + (store.data2.deliveryMsg || []) + .map((item) => item.deliveryContent || "") + .join("\t") || "暂无公告" +); store.$subscribe((mutation, state) => { vertical_content.value = (state.data3.deliveryNotification || [])