This commit is contained in:
DESKTOP-FUDKNA8\znjsz 2024-01-23 10:12:39 +08:00
parent 112730b52a
commit bc96f76d7f
2 changed files with 29 additions and 17 deletions

View File

@ -3,8 +3,26 @@
import { ref } from "vue"; import { ref } from "vue";
import { useWsStore } from "../store"; import { useWsStore } from "../store";
const listData = ref([]);
const store = useWsStore(); const store = useWsStore();
const listData = ref((store.data2.lineDetailData || Array(3).fill({})).map(
(item, index) => ({
productLine: item.productLine || "---",
mbt: item.edgingInput || "---",
mbb: item.edgingOutput || "---",
dkt: item.drillingInput || "---",
dkb: item.drillingOutput || "---",
dmt: item.coatingInput || "---",
dmb: item.coatingOutput || "---",
syt: item.silkInput || "---",
syb: item.silkOutput || "---",
ght: item.solidificationInput || "---",
ghb: item.solidificationOutput || "---",
gh1: item.temperingInput || "---",
gh2: item.temperingOutput || "---",
bzt: item.finalInput || "---",
bzb: item.finalOutput || "---",
})
));
store.$subscribe((mutation, state) => { store.$subscribe((mutation, state) => {
listData.value = (state.data2.lineDetailData || Array(3).fill({})).map( listData.value = (state.data2.lineDetailData || Array(3).fill({})).map(
(item, index) => ({ (item, index) => ({
@ -30,13 +48,8 @@ store.$subscribe((mutation, state) => {
<template> <template>
<div class="realtime-table"> <div class="realtime-table">
<el-table <el-table class="dark-table" :data="listData" :show-overflow-tooltip="true" row-class-name="dark-row"
class="dark-table" header-row-class-name="dark-header">
:data="listData"
:show-overflow-tooltip="true"
row-class-name="dark-row"
header-row-class-name="dark-header"
>
<el-table-column prop="productLine" label="产线"></el-table-column> <el-table-column prop="productLine" label="产线"></el-table-column>
<el-table-column prop="mbt" label="磨边上"></el-table-column> <el-table-column prop="mbt" label="磨边上"></el-table-column>
<el-table-column prop="mbb" label="磨边下"></el-table-column> <el-table-column prop="mbb" label="磨边下"></el-table-column>

View File

@ -8,18 +8,15 @@ import Icon from '../assets/svg/IconStatus.vue';
const { settings } = useSettings(); const { settings } = useSettings();
const store = useWsStore(); const store = useWsStore();
const lines = ref({ const lines = ref({
g1: null, g1: store.data2.lineDetailData?.[0] || null,
g2: null, g2: store.data2.lineDetailData?.[1] || null,
g3: 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]
console.log('g1: ', lines.value.g1)
console.log('g2: ', lines.value.g2)
console.log('g3: ', lines.value.g3)
} }
}) })
@ -537,7 +534,8 @@ const status = ref({
</div> </div>
<div class="info"> <div class="info">
<h1> <h1>
<Icon :color="status['S6后储片台'] == 'error' ? '#ff3737' : status['S6后储片台'] == 'warn' ? '#ffb524' : '#24ff5e'" />B3下片 <Icon :color="status['S6后储片台'] == 'error' ? '#ff3737' : status['S6后储片台'] == 'warn' ? '#ffb524' : '#24ff5e'" />
B3下片
</h1> </h1>
</div> </div>
<div class="info"> <div class="info">
@ -1056,4 +1054,5 @@ const status = ref({
background: url(../assets/model/F12.png) no-repeat; background: url(../assets/model/F12.png) no-repeat;
background-size: 1920px 1080px; background-size: 1920px 1080px;
background-position: 0 -80px; background-position: 0 -80px;
}</style> }
</style>