update alert list screen

This commit is contained in:
DESKTOP-FUDKNA8\znjsz 2024-03-06 10:14:35 +08:00
parent 9c3b9218d2
commit 822732742d
3 changed files with 46 additions and 29 deletions

View File

@ -21,7 +21,7 @@ const store = useWsStore();
connect0(store); connect0(store);
const alarmList = ref( const alarmList = ref(
(store.data1.alarmArrList || []).map((item, index) => ({ (store.mainDataAlarm.alarmArrList || []).map((item, index) => ({
id: item.id, id: item.id,
eqName: item.equipmentName, eqName: item.equipmentName,
eqIndex: index + 1, eqIndex: index + 1,
@ -30,16 +30,16 @@ const alarmList = ref(
position: `${item.productLine} - ${item.segment}`, position: `${item.productLine} - ${item.segment}`,
})) }))
); );
// store.$subscribe((mutation, state) => { store.$subscribe((mutation, state) => {
// alarmList.value = state.data1.alarmArrList.map((item, index) => ({ alarmList.value = state.mainDataAlarm.alarmArrList.map((item, index) => ({
// id: item.id, id: item.id,
// eqName: item.equipmentName, eqName: item.equipmentName,
// eqIndex: index + 1, eqIndex: index + 1,
// alarmGrade: item.alarmLevel, alarmGrade: item.alarmLevel,
// alarmDetail: item.alarmDetails, alarmDetail: item.alarmDetails,
// position: `${item.productLine} - ${item.segment}`, position: `${item.productLine} - ${item.segment}`,
// })); }));
// }); });
// function handleIgnore() { // function handleIgnore() {
// alarmList.value.splice(0) // alarmList.value.splice(0)
@ -65,14 +65,13 @@ function handleResolutionChange(width, height) {
<el-table <el-table
class="dark-table" class="dark-table"
:data="alarmList" :data="alarmList"
:show-overflow-tooltip="true"
row-class-name="dark-row" row-class-name="dark-row"
header-row-class-name="dark-header" header-row-class-name="dark-header"
> >
<el-table-column <el-table-column
prop="eqName" prop="eqName"
label="设备名" label="设备名"
width="80" width="90"
></el-table-column> ></el-table-column>
<el-table-column <el-table-column
prop="eqIndex" prop="eqIndex"
@ -81,15 +80,34 @@ function handleResolutionChange(width, height) {
></el-table-column> ></el-table-column>
<el-table-column <el-table-column
prop="alarmGrade" prop="alarmGrade"
label="报警等级" label="等级"
width="100" width="60"
></el-table-column> ></el-table-column>
<el-table-column prop="alarmDetail" label="报警细节">
<template v-slot="{ row }">
<el-tooltip
class="box-item"
effect="dark"
:content="row.alarmDetail || '---'"
placement="top-start"
>
<span
style="
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
word-break: break-all;
"
>{{ row.alarmDetail || "---" }}</span
>
</el-tooltip>
</template>
</el-table-column>
<el-table-column <el-table-column
prop="alarmDetail" prop="position"
label="报警细节" width="128"
width="144" label="定位"
></el-table-column> ></el-table-column>
<el-table-column prop="position" label="定位"></el-table-column>
</el-table> </el-table>
</div> </div>
<!-- <button @click="handleIgnore" class="alert-btn">忽略</button> --> <!-- <button @click="handleIgnore" class="alert-btn">忽略</button> -->
@ -182,7 +200,7 @@ function handleResolutionChange(width, height) {
.alert-list { .alert-list {
height: calc(100% - 56px); height: calc(100% - 56px);
width: 520px; width: 640px;
position: absolute; position: absolute;
top: 15px; top: 15px;

View File

@ -4,7 +4,6 @@ import * as echarts from "echarts";
import Container from "../Base/Container.vue"; import Container from "../Base/Container.vue";
import { useWsStore } from "../../store"; import { useWsStore } from "../../store";
const setupFn = (chart, datalist = [0.0, 0.0, 0.0, 0.0]) => { const setupFn = (chart, datalist = [0.0, 0.0, 0.0, 0.0]) => {
console.log("datalist", datalist); console.log("datalist", datalist);
const option = { const option = {
@ -79,14 +78,14 @@ function loadData(yieldArray) {
if (yieldArray == undefined || yieldArray?.length == 0) return null; if (yieldArray == undefined || yieldArray?.length == 0) return null;
for (let i = 0; i < yieldArray.length; ++i) { for (let i = 0; i < yieldArray.length; ++i) {
if (yieldArray[i].name == "钢1线") { if (yieldArray[i].name == "钢1线") {
result[0] = parseInt(yieldArray[i].data); result[0] = parseFloat(yieldArray[i].data) || 0;
} else if (yieldArray[i].name == "钢2线") { } else if (yieldArray[i].name == "钢2线") {
result[1] = parseInt(yieldArray[i].data); result[1] = parseFloat(yieldArray[i].data) || 0;
} else if (yieldArray[i].name == "钢3线") { } else if (yieldArray[i].name == "钢3线") {
result[2] = parseInt(yieldArray[i].data); result[2] = parseFloat(yieldArray[i].data) || 0;
} else { } else {
// //
result[3] = parseInt(yieldArray[i].data); result[3] = parseFloat(yieldArray[i].data) || 0;
} }
} }
return result; return result;

View File

@ -79,14 +79,14 @@ function loadData(yieldArray) {
if (yieldArray == undefined || yieldArray?.length == 0) return null; if (yieldArray == undefined || yieldArray?.length == 0) return null;
for (let i = 0; i < yieldArray.length; ++i) { for (let i = 0; i < yieldArray.length; ++i) {
if (yieldArray[i].name == "钢1线") { if (yieldArray[i].name == "钢1线") {
result[0] = parseInt(yieldArray[i].data); result[0] = parseFloat(yieldArray[i].data) || 0;
} else if (yieldArray[i].name == "钢2线") { } else if (yieldArray[i].name == "钢2线") {
result[1] = parseInt(yieldArray[i].data); result[1] = parseFloat(yieldArray[i].data) || 0;
} else if (yieldArray[i].name == "钢3线") { } else if (yieldArray[i].name == "钢3线") {
result[2] = parseInt(yieldArray[i].data); result[2] = parseFloat(yieldArray[i].data) || 0;
} else { } else {
// //
result[3] = parseInt(yieldArray[i].data); result[3] = parseFloat(yieldArray[i].data) || 0;
} }
} }
return result; return result;