屏蔽门状态显示

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

View File

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

View File

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