update data fetch
This commit is contained in:
@@ -2,8 +2,21 @@
|
||||
import { ref, onMounted } from 'vue';
|
||||
import * as echarts from 'echarts';
|
||||
import Container from './Base/Container.vue';
|
||||
|
||||
import { useWsStore } from '../store'
|
||||
const store = useWsStore();
|
||||
const chartChart = ref(null);
|
||||
// 小时数据
|
||||
const hourData = ref([]);
|
||||
// store.$subscribe((mutation, state) => {
|
||||
// hourData.value = state.data2.lineDetailData.map((item, index) => ({
|
||||
// id: item.id,
|
||||
// eqName: item.equipmentName,
|
||||
// eqIndex: index + 1,
|
||||
// alarmGrade: item.alarmLevel,
|
||||
// alarmDetail: item.alarmDetails,
|
||||
// position: `${item.productLine} - ${item.segment}`,
|
||||
// }));
|
||||
// });
|
||||
|
||||
onMounted(() => {
|
||||
chartChart.value.classList.add('h-full');
|
||||
|
||||
@@ -1,5 +1,29 @@
|
||||
<!-- 实时数据表格 -->
|
||||
<script setup>
|
||||
import { ref } from 'vue';
|
||||
import { useWsStore } from '../store';
|
||||
|
||||
const listData = ref([]);
|
||||
const store = useWsStore();
|
||||
store.$subscribe((mutation, state) => {
|
||||
listData.value = state.data2.lineDetailData.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,
|
||||
}));
|
||||
});
|
||||
|
||||
const tableData = [
|
||||
{ productLine: '00A', mbt: '---', mbb: '---', dkt: '---', dkb: '---', dmt: '---', dmb: '---', syt: '---', syb: '---', ght: '---', ghb: '---', gh1: '---', gh2: '---', bzt: '---', bzb: '---' },
|
||||
@@ -13,7 +37,7 @@ const tableData = [
|
||||
|
||||
<template>
|
||||
<div class="realtime-table">
|
||||
<el-table class="dark-table" :data="tableData" :show-overflow-tooltip="true" row-class-name="dark-row"
|
||||
<el-table class="dark-table" :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="mbt" label="磨边上"></el-table-column>
|
||||
|
||||
Reference in New Issue
Block a user