update 改进数据初次加载有延时问题
This commit is contained in:
vanhempi
1a5749bab2
commit
e4637944bb
@ -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;
|
||||
|
@ -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,
|
||||
|
@ -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(/<br(\s?)\/>/g, "") || "暂无公告"
|
||||
);
|
||||
const horizontal_content = ref(
|
||||
(store.data2.deliveryMsg || [])
|
||||
.map((item) => item.deliveryContent || "")
|
||||
.join("\t") || "暂无公告"
|
||||
);
|
||||
store.$subscribe((mutation, state) => {
|
||||
vertical_content.value =
|
||||
(state.data3.deliveryNotification || [])
|
||||
|
Ladataan…
Viittaa uudesa ongelmassa
Block a user