屏蔽门状态显示

This commit is contained in:
fan 2023-11-03 11:25:15 +08:00
parent 4ac281cc78
commit 2f5851fee1
4 changed files with 74 additions and 29 deletions

@ -1 +1 @@
Subproject commit 92c5696b7eb3b47b387f48e094f5c8644ddb7da8
Subproject commit 280219a91abaa9c58fd9979ad7340fe5d85caad1

View File

@ -33,25 +33,64 @@
v-model.number="screenDoorState.code"
label="名称"
/>
<q-input
outlined
readonly
style="margin-top: 10px"
v-model="screenDoorState.openAsdCodesString"
label="开启的滑动门的编号"
:disable="true"
type="textarea"
autogrow
/>
<q-checkbox
dense
style="margin-top: 10px"
v-model="screenDoorState.close"
v-model="screenDoorState.mgj"
outlined
label="屏蔽门整体的关闭(继电器)状态"
label="屏蔽门关闭"
:disable="true"
/>
<template :key="item" v-for="item in screenDoorState.asdStates">
<q-list dense bordered padding class="rounded-borders q-my-sm">
<q-item>
<q-item-section>
<q-input
outlined
readonly
v-model.number="item.code"
label="门名称"
:disable="true"
/>
</q-item-section>
</q-item>
<q-item>
<q-item-section>
<q-checkbox
dense
v-model="item.kmdw"
outlined
label="开门到位(实际)"
:disable="true"
/>
</q-item-section>
</q-item>
<q-item>
<q-item-section>
<q-checkbox
dense
v-model="item.gmdw"
outlined
label="关门到位(实际)"
:disable="true"
/>
</q-item-section>
</q-item>
<q-item>
<q-item-section>
<q-checkbox
dense
v-model="item.mgj"
outlined
label="关闭(表示)"
:disable="true"
/>
</q-item-section>
</q-item>
</q-list>
</template>
</q-card-section>
<!-- <q-card-actions align="center">
<q-btn label="修改" type="submit" color="primary" @click="submitState" />
<q-btn
@ -74,20 +113,28 @@ import { request } from 'src/protos/request';
import { screenDoorOperate } from 'src/api/Simulation';
import { errorNotify } from 'src/utils/CommonNotify';
// string code = 1; //
// bool kmdw = 2; //
// bool gmdw = 3; //
// bool mgj = 4; //
const lineStore = useLineStore();
interface asdState {
code: string;
kmdw: boolean;
gmdw: boolean;
mgj: boolean;
}
interface psdState {
id: string;
code: string;
openAsdCodes: number[];
close: boolean;
openAsdCodesString: string;
asdStates: asdState[];
mgj: boolean;
}
const psdStateData: psdState = {
id: '',
code: '',
openAsdCodes: [],
close: false,
openAsdCodesString: '',
asdStates: [],
mgj: false,
};
const screenDoorState = ref(psdStateData);
@ -139,9 +186,8 @@ watch(
screenDoorState.value = {
id: '',
code: '',
openAsdCodes: [],
close: false,
openAsdCodesString: '',
asdStates: [],
mgj: false,
};
}
}
@ -150,9 +196,8 @@ function initScreenDoorState(screenDoor: ScreenDoor) {
screenDoorState.value = {
id: screenDoor.datas.id,
code: screenDoor.datas.code,
openAsdCodes: screenDoor.states.openAsdCodes,
close: screenDoor.states.close,
openAsdCodesString: screenDoor.states.openAsdCodes.join('、'),
asdStates: screenDoor.states.asdStates,
mgj: screenDoor.states.mgj,
};
}
// function submitState() {

View File

@ -90,10 +90,10 @@ export class ScreenDoorState
set asdStates(v: state.AsdState[]) {
this.states.asdStates = v;
}
get close() {
get mgj() {
return this.states.mgj;
}
set close(v: boolean) {
set mgj(v: boolean) {
this.states.mgj = v;
}
get states(): state.PsdState {

View File

@ -28,8 +28,8 @@ export interface IScreenDoorData extends GraphicData {
export interface IScreenDoorState extends GraphicState {
get asdStates(): state.AsdState[]; //所有子门的状态
set asdStates(v: state.AsdState[]);
get close(): boolean; //屏蔽门整体的关闭(继电器)状态
set close(v: boolean);
get mgj(): boolean; //屏蔽门整体的关闭(继电器)状态
set mgj(v: boolean);
}
const screenDoorConsts = {