|
|
@@ -47,6 +47,9 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
<script setup lang="ts">
|
|
|
+import { StoreDevices } from '@/store/modules/devices.ts'
|
|
|
+import { StoreDoor } from '@/store/modules/door.ts'
|
|
|
+import { DoorItem, DoorStatusEnum } from '@/types/train-travel'
|
|
|
|
|
|
interface StationItem {
|
|
|
name: string;
|
|
|
@@ -62,7 +65,7 @@ interface StationItem {
|
|
|
}>
|
|
|
}>
|
|
|
}
|
|
|
-const doorUpList = ref<StationItem>({
|
|
|
+const doorUpList = reactive<StationItem>({
|
|
|
name: "上行",
|
|
|
carriage: [
|
|
|
{
|
|
|
@@ -127,7 +130,7 @@ const doorUpList = ref<StationItem>({
|
|
|
}
|
|
|
]
|
|
|
})
|
|
|
-const stationDown = ref<StationItem>({
|
|
|
+const stationDown = reactive<StationItem>({
|
|
|
name: "下行",
|
|
|
carriage: [
|
|
|
{
|
|
|
@@ -192,26 +195,27 @@ const stationDown = ref<StationItem>({
|
|
|
}
|
|
|
]
|
|
|
});
|
|
|
+
|
|
|
// 表格
|
|
|
interface StateItem {
|
|
|
name: string;
|
|
|
stateUp?: "state-valid" | "state-alarm" | "state-invalid";
|
|
|
stateDown?: "state-valid" | "state-alarm" | "state-invalid";
|
|
|
}
|
|
|
-const tableData1 = ref<StateItem[]>([
|
|
|
+const tableData1 = reactive<StateItem[]>([
|
|
|
{ name: "所有门关闭并锁定", stateUp: 'state-valid', stateDown: 'state-valid' },
|
|
|
{ name: "SIG自动开门命令", stateUp: 'state-valid', stateDown: 'state-valid' },
|
|
|
{ name: "SIG自动关门命令", stateUp: 'state-valid', stateDown: 'state-valid' },
|
|
|
{ name: "IBP操作允许", stateUp: 'state-valid', stateDown: 'state-valid' },
|
|
|
{ name: "PSL操作允许", stateUp: 'state-valid', stateDown: 'state-valid' },
|
|
|
]);
|
|
|
-const tableData2 = ref<StateItem[]>([
|
|
|
+const tableData2 = reactive<StateItem[]>([
|
|
|
{ name: "IBP开门命令", stateUp: 'state-valid', stateDown: 'state-valid' },
|
|
|
{ name: "IBP关门命令", stateUp: 'state-valid', stateDown: 'state-valid' },
|
|
|
{ name: "PSL开门命令", stateUp: 'state-valid', stateDown: 'state-valid' },
|
|
|
{ name: "PSL关闭命令", stateUp: 'state-valid', stateDown: 'state-valid' },
|
|
|
]);
|
|
|
-const tableData3 = ref<StateItem[]>([
|
|
|
+const tableData3 = reactive<StateItem[]>([
|
|
|
{ name: "互锁接触报警", stateUp: 'state-valid', stateDown: 'state-valid' },
|
|
|
{ name: "控制故障报警", stateUp: 'state-valid', stateDown: 'state-valid' },
|
|
|
{ name: "健康系统故障报警", stateUp: 'state-valid' },
|
|
|
@@ -227,6 +231,54 @@ const arraySpanMethod = ({ row, columnIndex }: any) => {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+// 屏蔽门状态动态处理
|
|
|
+const updateStation = function () {
|
|
|
+ const list: DoorItem[] = StoreDoor().getDoorList;
|
|
|
+ console.log(list);
|
|
|
+ const array: StationItem[] = [doorUpList, stationDown];
|
|
|
+ for (let index = 0; index < array.length; index++) {
|
|
|
+ const element: StationItem = array[index];
|
|
|
+ for (let i = 0; i < element.carriage.length; i++) {
|
|
|
+ const carriage = element.carriage[i];
|
|
|
+ for (let j = 0; j < carriage.doors.length; j++) {
|
|
|
+ const door = carriage.doors[j];
|
|
|
+ const item = list.find((item) => item.id == door.code);
|
|
|
+ if (item) {
|
|
|
+ switch (item.status) {
|
|
|
+ case DoorStatusEnum.OPEN:
|
|
|
+ door.icon = '屏蔽门';
|
|
|
+ door.color = '#FFFFFF';
|
|
|
+ break;
|
|
|
+ case DoorStatusEnum.CLOSE:
|
|
|
+ door.icon = '屏蔽门';
|
|
|
+ door.color = '#42BF01';
|
|
|
+ break;
|
|
|
+ case DoorStatusEnum.DISABLE:
|
|
|
+ door.icon = '屏蔽门';
|
|
|
+ door.color = '#870102';
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+const updateDevice = function () {
|
|
|
+
|
|
|
+}
|
|
|
+onMounted(function () {
|
|
|
+ StoreDoor().loadDoorAll();
|
|
|
+ updateStation();
|
|
|
+ updateDevice();
|
|
|
+ console.log("---doorUpList---:", doorUpList);
|
|
|
+});
|
|
|
+watch(() => StoreDoor().getDoorList, () => { updateStation(); })
|
|
|
+watch(() => StoreDevices().getDeviceArray, () => { updateDevice(); })
|
|
|
+
|
|
|
</script>
|
|
|
<style scoped lang="scss">
|
|
|
.box {
|