|
|
@@ -2,19 +2,35 @@
|
|
|
<div class="box">
|
|
|
<template v-for="boxItem in [doorUpList, undefined, stationDown]">
|
|
|
<div v-if="!boxItem" class="station-body">
|
|
|
- <div>
|
|
|
- <el-table :data="tableData" border style="width: 100%">
|
|
|
- <el-table-column prop="date" label="状态" />
|
|
|
- <el-table-column prop="name" label="上行" width="60" />
|
|
|
- <el-table-column prop="address" label="下行" width="60">
|
|
|
+ <div v-for="(stateData, index) in [tableData1, tableData2, tableData3]" :key="index">
|
|
|
+ <el-table :data="stateData" border style="width: 100%" :span-method="arraySpanMethod">
|
|
|
+ <el-table-column prop="name" label="状态" />
|
|
|
+ <el-table-column prop="stateUp" label="上行" width="45" align="center">
|
|
|
<template #default="scope">
|
|
|
- <el-switch v-model="scope.row.date" />
|
|
|
+ <div :class="[scope.row.stateUp || 'state-invalid']"></div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="stateDown" label="下行" width="45">
|
|
|
+ <template #default="scope">
|
|
|
+ <div :class="[scope.row.stateDown]"></div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
</div>
|
|
|
- <div> </div>
|
|
|
- <div> </div>
|
|
|
+ <div>
|
|
|
+ <div>
|
|
|
+ <div>{{ '图例' }}</div>
|
|
|
+ <div>
|
|
|
+ <div class="state-valid"></div>{{ '正常/有效' }}
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ <div class="state-alarm"></div>{{ '报警' }}
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ <div class="state-invalid"></div>{{ '无效' }}
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
<div v-else class="station-box">
|
|
|
<div class="station-title">{{ boxItem.name }}</div>
|
|
|
@@ -176,8 +192,40 @@ const stationDown = ref<StationItem>({
|
|
|
]
|
|
|
});
|
|
|
// 表格
|
|
|
-const tableData = []
|
|
|
+interface StateItem {
|
|
|
+ name: string;
|
|
|
+ stateUp?: "state-valid" | "state-alarm" | "state-invalid";
|
|
|
+ stateDown?: "state-valid" | "state-alarm" | "state-invalid";
|
|
|
+}
|
|
|
+const tableData1 = ref<StateItem[]>([
|
|
|
+ { name: "所有门关闭并锁定", stateUp: 'state-valid', stateDown: 'state-invalid' },
|
|
|
+ { name: "SIG自动开门命令", stateUp: 'state-valid', stateDown: 'state-alarm' },
|
|
|
+ { name: "SIG自动关门命令", stateUp: 'state-valid', stateDown: 'state-alarm' },
|
|
|
+ { name: "IBP操作允许", stateUp: 'state-valid', stateDown: 'state-invalid' },
|
|
|
+ { name: "PSL操作允许", stateUp: 'state-valid', stateDown: 'state-invalid' },
|
|
|
+]);
|
|
|
+const tableData2 = ref<StateItem[]>([
|
|
|
+ { name: "IBP开门命令", stateUp: 'state-valid', stateDown: 'state-invalid' },
|
|
|
+ { name: "IBP关门命令", stateUp: 'state-valid', stateDown: 'state-invalid' },
|
|
|
+ { name: "PSL开门命令", stateUp: 'state-valid', stateDown: 'state-invalid' },
|
|
|
+ { name: "PSL关闭命令", stateUp: 'state-valid', stateDown: 'state-invalid' },
|
|
|
+]);
|
|
|
+const tableData3 = ref<StateItem[]>([
|
|
|
+ { name: "互锁接触报警", stateUp: 'state-valid', stateDown: 'state-invalid' },
|
|
|
+ { name: "控制故障报警", stateUp: 'state-valid', stateDown: 'state-invalid' },
|
|
|
+ { name: "健康系统故障报警", stateUp: 'state-valid' },
|
|
|
+ { name: "控制电源故障报警", stateUp: 'state-valid' },
|
|
|
+ { name: "驱动电源故障报警", stateUp: 'state-valid' },
|
|
|
+]);
|
|
|
|
|
|
+const arraySpanMethod = ({ row, columnIndex }: any) => {
|
|
|
+ if (!row.stateDown) {
|
|
|
+ if (columnIndex === 1 || columnIndex === 2) {
|
|
|
+ // 合并第二列和第三列,只合并一行
|
|
|
+ return { colspan: 2, rowspan: 1 };
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
</script>
|
|
|
<style scoped lang="scss">
|
|
|
.box {
|
|
|
@@ -217,15 +265,68 @@ const tableData = []
|
|
|
|
|
|
.station-body {
|
|
|
width: 100%;
|
|
|
- height: 35vh;
|
|
|
- margin: 5vh 0;
|
|
|
+ max-height: 260px;
|
|
|
+ margin: 60px 0;
|
|
|
display: flex;
|
|
|
justify-content: space-evenly;
|
|
|
|
|
|
- >div {
|
|
|
- width: 30vh;
|
|
|
- border: 1px solid rgba(0, 0, 0, 0.98);
|
|
|
+ >:not(:last-child) {
|
|
|
+ width: 280px;
|
|
|
+ border: 1px solid rgba(206, 188, 188, 0.98);
|
|
|
}
|
|
|
+
|
|
|
+ >:last-child {
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ justify-content: flex-end;
|
|
|
+ align-items: flex-start;
|
|
|
+
|
|
|
+ >div {
|
|
|
+ border: 3px solid #AED8B0;
|
|
|
+ padding: 10px;
|
|
|
+
|
|
|
+ >div {
|
|
|
+ display: flex;
|
|
|
+ margin: 2px 0;
|
|
|
+
|
|
|
+ >:first-child {
|
|
|
+ margin-right: 8px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .state-valid {
|
|
|
+ width: 20px;
|
|
|
+ height: 20px;
|
|
|
+ border-radius: 50%;
|
|
|
+ background-color: #43BE03;
|
|
|
+ box-shadow: 0 0 20px rgba(248, 245, 245, 0.8);
|
|
|
+ opacity: 0.8;
|
|
|
+ }
|
|
|
+
|
|
|
+ .state-alarm {
|
|
|
+ width: 20px;
|
|
|
+ height: 20px;
|
|
|
+ border-radius: 50%;
|
|
|
+ background-color: #DC060B;
|
|
|
+ box-shadow: 0 0 20px rgba(248, 245, 245, 0.8);
|
|
|
+ opacity: 0.8;
|
|
|
+ }
|
|
|
+
|
|
|
+ .state-invalid {
|
|
|
+ width: 20px;
|
|
|
+ height: 20px;
|
|
|
+ border-radius: 50%;
|
|
|
+ background-color: #E3E5E9;
|
|
|
+ box-shadow: 0 0 20px rgba(248, 245, 245, 0.8);
|
|
|
+ opacity: 0.8;
|
|
|
+ }
|
|
|
+
|
|
|
+ ::v-deep .cell {
|
|
|
+ display: flex;
|
|
|
+ justify-content: center;
|
|
|
}
|
|
|
}
|
|
|
</style>
|