This commit is contained in:
fan 2023-11-09 10:20:57 +08:00
commit b3168a62db
34 changed files with 712 additions and 714 deletions

View File

@ -78,3 +78,30 @@ export async function getRunconfigList(): Promise<Array<RunconfigItem>> {
const response = await api.get(`${UriBase}/list`);
return response.data;
}
export enum typeStr {
map = 'map',
array = 'array',
string = 'string',
int = 'int',
bool = 'bool',
}
export interface Description {
fieldName: string;
description: string;
type: typeStr;
itemTypeFields: Description[] | null;
// eslint-disable-next-line
val?: any;
}
/**
*
* @param
* @returns
*/
export async function getRunconfigDescription(): Promise<Description[]> {
const response = await api.get(`${UriBase}/description`);
return response.data;
}

View File

@ -0,0 +1,103 @@
<template>
<div>
<div v-if="menu.itemTypeFields">
<div class="row q-ma-sm" v-if="menu.type == typeStr.array">
<div class="absolute-left z-top">
<q-btn dense flat color="primary" @click="add(menu)">添加</q-btn>
</div>
</div>
<div v-if="menu.type != typeStr.array">
<ConfigData
v-for="(item, index) in menu.itemTypeFields"
:key="index"
:cgData="item"
@val="setVal"
></ConfigData>
</div>
<div
v-else-if="menu.type == typeStr.array && menu.val"
class="q-gutter-xs"
>
<q-card flat bordered v-for="(fs, it) in menu.val" :key="fs">
<q-card-actions align="right" class="q-py-none">
<q-btn dense flat color="red" @click="delFn(it, menu.val)"
>删除</q-btn
>
</q-card-actions>
<q-card-section class="q-pt-none">
<ConfigData
v-for="(item, index) in fs"
:key="index"
:cgData="item"
@val="setVal"
></ConfigData>
</q-card-section>
</q-card>
</div>
</div>
<div v-else>
<q-item class="q-py-none">
<q-item-section>
<q-item-label>{{ menu.description }}</q-item-label>
</q-item-section>
<q-item-section>
<q-input
dense
v-model="menu.val"
v-if="menu.type == typeStr.string"
/>
<q-input
dense
type="number"
v-model.number="menu.val"
v-else-if="menu.type == typeStr.int"
/>
<q-checkbox
v-model="menu.val"
v-else-if="menu.type == typeStr.bool"
/>
</q-item-section>
</q-item>
</div>
</div>
</template>
<script setup lang="ts">
import { Description, typeStr } from 'src/api/RunconfigApi';
import { onMounted, reactive, watch } from 'vue';
const props = defineProps<{
cgData: Description;
}>();
const menu = reactive<Description>({
fieldName: '',
description: '',
type: typeStr.string,
itemTypeFields: null,
});
onMounted(() => {
Object.assign(menu, props.cgData);
});
function add(o: Description) {
if (!o.val) {
o.val = [];
}
o.val.push(JSON.parse(JSON.stringify(o.itemTypeFields)));
emit('val', o.val, props.cgData);
}
function delFn(it: number, val: []) {
val.splice(it, 1);
emit('val', val, props.cgData);
}
const emit = defineEmits(['val']);
watch(
() => menu.val,
(val) => {
emit('val', val, props.cgData);
}
);
function setVal(val: string | number | boolean | [], obj: Description) {
obj.val = val;
}
</script>

View File

@ -85,7 +85,6 @@ import {
loadCiCjList,
creatCiCjList,
refRelaysListMap,
combinationListMap,
} from 'src/drawApp/relayCabinetLayoutApp';
import { relayCabinetGraphicData } from 'src/protos/relayCabinetLayoutGraphics';
import { Relay } from 'src/graphics/relay/Relay';
@ -158,7 +157,6 @@ function updateMap() {
cjDataSet.bitList.forEach((cjData, j) => {
const ref = cjData.refRelays.map((refRelay) => {
const refDeviceData = refRelaysListMap.get(refRelay.relayId);
const conbinationData = combinationListMap.get(refRelay.relayId);
const relay = relayCabinetStore
.getDrawApp()
.queryStore.queryById<Relay>(refRelay.relayId);
@ -166,10 +164,10 @@ function updateMap() {
refRelay.position == relayCabinetGraphicData.CjDataItem.PostionType.Q
? 'Q'
: 'H';
if (refDeviceData) {
return `${refDeviceData.device}_${refDeviceData.combinationtype}_${relay.datas.code}_${pos}`;
if (refDeviceData?.device) {
return `${refDeviceData.device}_${refDeviceData?.combinationtype}_${relay.datas.code}_${pos}`;
} else {
return `${conbinationData}_${relay.datas.code}_${pos}`;
return `${refDeviceData?.combinationtype}_${relay.datas.code}_${pos}`;
}
});
map.set(`${j + 1}-${i + 1}`, ref.join('/'));

View File

@ -85,7 +85,6 @@ import {
loadCiQdList,
creatCiQdList,
refRelaysListMap,
combinationListMap,
} from 'src/drawApp/relayCabinetLayoutApp';
import { relayCabinetGraphicData } from 'src/protos/relayCabinetLayoutGraphics';
import { Relay } from 'src/graphics/relay/Relay';
@ -158,14 +157,13 @@ function updateMap() {
cjDataSet.bitList.forEach((cjData, j) => {
const ref = cjData.refRelays.map((refRelay) => {
const refDeviceData = refRelaysListMap.get(refRelay);
const conbinationData = combinationListMap.get(refRelay);
const relay = relayCabinetStore
.getDrawApp()
.queryStore.queryById<Relay>(refRelay);
if (refDeviceData) {
if (refDeviceData?.device) {
return `${refDeviceData.device}_${refDeviceData.combinationtype}_${relay.datas.code}`;
} else {
return `${conbinationData}_${relay.datas.code}`;
return `${refDeviceData?.combinationtype}_${relay.datas.code}`;
}
});
map.set(`${j + 1}-${i + 1}`, ref.join('/'));

View File

@ -1,147 +0,0 @@
<template>
<draggable-dialog
seamless
@show="onDialogShow"
title="组合类型列表"
:width="600"
:height="0"
>
<template v-slot:footer>
<q-table
ref="tableRef"
row-key="id"
v-model:pagination="pagination"
:loading="loading"
:rows="rows"
:columns="columns"
@request="onRequest"
:rows-per-page-options="[5, 10, 20, 50]"
>
<template v-slot:body-cell="props">
<q-td :props="props" class="custom-column">
{{ props.value }}
</q-td>
</template>
<template v-slot:body-cell-operations="props">
<q-td :props="props">
<div class="q-gutter-sm row justify-center">
<q-btn color="primary" label="编辑" @click="onEdit(props.row)" />
<q-btn color="red" label="删除" @click="deleteData(props.row)" />
</div>
</q-td>
</template>
</q-table>
</template>
<template v-slot:titleButton>
<q-btn
color="primary"
label="新建"
style="margin-right: 10px"
@click="creatData"
/>
</template>
</draggable-dialog>
</template>
<script setup lang="ts">
import { ref } from 'vue';
import DraggableDialog from 'src/components/common/DraggableDialog.vue';
import { QTable, useQuasar } from 'quasar';
import { errorNotify, successNotify } from 'src/utils/CommonNotify';
import {
deleteCombinationtype,
loadCombinationtypeList,
CombinationTypeListItem,
} from 'src/drawApp/relayCabinetLayoutApp';
import { useRelayCabinetStore } from 'src/stores/relayCabinet-store';
import { Relay } from 'src/graphics/relay/Relay';
const relayCabinetStore = useRelayCabinetStore();
const $q = useQuasar();
const tableRef = ref<QTable>();
const columns: QTable['columns'] = [
{ name: 'code', label: '组合类型', field: 'code', align: 'center' },
{
name: 'refRelays',
label: '关联的继电器',
field: (row: CombinationTypeListItem) => {
if (row.refRelays) {
const ref = row.refRelays.map(
(id) =>
(relayCabinetStore.getDrawApp().queryStore.queryById(id) as Relay)
.datas.code
);
return ref.join('\\');
}
},
align: 'center',
},
{ name: 'operations', label: '操作', field: 'operations', align: 'center' },
];
const rows = ref<CombinationTypeListItem[]>([]);
const loading = ref(false);
const pagination = ref({
sortBy: 'desc',
descending: false,
page: 1,
rowsPerPage: 10,
rowsNumber: 10,
});
const onRequest: QTable['onRequest'] = async (props) => {
const { page, rowsPerPage } = props.pagination;
loading.value = true;
const refDatas = loadCombinationtypeList();
pagination.value.rowsNumber = refDatas.length;
pagination.value.page = page;
pagination.value.rowsPerPage = rowsPerPage;
rows.value = refDatas.slice((page - 1) * rowsPerPage, page * rowsPerPage);
loading.value = false;
};
const onDialogShow = () => {
tableRef.value?.requestServerInteraction();
relayCabinetStore.tableOfCombinationType = tableRef.value;
};
const props = defineProps<{
onEditClick: (row: CombinationTypeListItem) => void;
}>();
function onEdit(row: CombinationTypeListItem) {
relayCabinetStore.showRelateRelayConfig = false;
relayCabinetStore.showCombinationTypeConfig = true;
setTimeout(() => {
props.onEditClick(row);
}, 0);
}
function creatData() {
relayCabinetStore.showRelateRelayConfig = false;
relayCabinetStore.showCombinationTypeConfig = true;
}
function deleteData(row: CombinationTypeListItem) {
$q.dialog({ message: `确定删除 "${row.code}" 吗?`, cancel: true }).onOk(
async () => {
try {
deleteCombinationtype(row);
successNotify('删除数据成功!');
} catch (err) {
errorNotify('删除失败:', err);
} finally {
tableRef.value?.requestServerInteraction();
}
}
);
}
</script>
<style scoped>
.custom-column {
max-width: 250px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
</style>

View File

@ -64,6 +64,8 @@ const deviceTypeMap = {
6: '车站',
7: '屏蔽门',
8: '信号机故障报警仪',
9: '断路器',
10: '电源屏',
};
const columns: QTable['columns'] = [
{
@ -119,7 +121,6 @@ const props = defineProps<{
}>();
function onEdit(row: RelateRelaylistItem) {
relayCabinetStore.showCombinationTypeConfig = false;
relayCabinetStore.showRelateRelayConfig = true;
setTimeout(() => {
props.onEditClick(row);
@ -127,7 +128,6 @@ function onEdit(row: RelateRelaylistItem) {
}
function creatData() {
relayCabinetStore.showCombinationTypeConfig = false;
relayCabinetStore.showRelateRelayConfig = true;
}

View File

@ -1,220 +0,0 @@
<template>
<div v-if="showRangeConfig">
<q-card class="q-gutter-sm q-pa-sm">
<q-card-section>
<div class="text-h6">{{ handleState }}</div>
</q-card-section>
<q-separator inset></q-separator>
<q-form ref="myForm" @submit="onSubmit" @reset="onReset">
<q-item>
<q-item-section no-wrap class="q-gutter-y-sm column">
<q-input
outlined
v-model="combinationTypeConfig.code"
label="组合类型"
lazy-rules
/>
<q-list bordered separator class="rounded-borders">
<q-item>
<q-item-section no-wrap class="q-gutter-y-sm column">
<q-item-label> 关联的继电器 </q-item-label>
<div class="q-gutter-sm row">
<q-chip
v-for="item in combinationTypeConfig.refRelaysCode"
:key="item"
square
color="primary"
text-color="white"
removable
@remove="removeSelect(item)"
>
{{ item }}
</q-chip>
</div>
</q-item-section>
</q-item>
</q-list>
<div>
<q-btn
v-show="combinationTypeConfig.refRelaysCode.length > 0"
style="width: 130px"
label="清空框选的继电器"
color="red"
class="q-mr-md"
@click="clearAllSelect()"
/>
</div>
</q-item-section>
</q-item>
<div class="q-gutter-sm q-pa-md row justify-center">
<q-btn label="提交" type="submit" color="primary" class="q-mr-md" />
<q-btn label="重置" type="reset" color="primary" class="q-mr-md" />
<q-btn label="返回" color="primary" @click="goBack" />
</div>
</q-form>
</q-card>
</div>
</template>
<script setup lang="ts">
import { onMounted, onUnmounted, ref, watch } from 'vue';
import { QForm, useQuasar } from 'quasar';
import { JlGraphic } from 'src/jl-graphic';
import { useRelayCabinetStore } from 'src/stores/relayCabinet-store';
import { Relay } from 'src/graphics/relay/Relay';
import { relayCabinetGraphicData } from 'src/protos/relayCabinetLayoutGraphics';
import {
creatCombinationtype,
editCombinationtype,
CombinationTypeListItem,
} from 'src/drawApp/relayCabinetLayoutApp';
import { PhaseFailureProtector } from 'src/graphics/phaseFailureProtector/PhaseFailureProtector';
defineExpose({ editRelateRelays });
const relayCabinetStore = useRelayCabinetStore();
const $q = useQuasar();
const showRangeConfig = ref(true);
const combinationTypeConfig = ref<{
code: string;
refRelays: string[];
refRelaysCode: string[];
}>({
code: '',
refRelays: [],
refRelaysCode: [],
});
const handleState = ref('新建组合类型');
let selectGraphic: JlGraphic[] = [];
watch(
() => relayCabinetStore.selectedGraphics,
(val) => {
if (val && val.length > 0) {
const selectFilter = relayCabinetStore.selectedGraphics?.filter(
(g) => g.type == Relay.Type || g.type == PhaseFailureProtector.Type
) as JlGraphic[];
selectGraphic.push(...selectFilter);
selectGraphic = Array.from(new Set(selectGraphic));
relayCabinetStore.getDrawApp().updateSelected(...selectGraphic);
combinationTypeConfig.value.refRelaysCode = selectGraphic.map(
(g) => (g as Relay).datas.code
) as string[];
combinationTypeConfig.value.refRelays = selectGraphic.map(
(g) => g.id
) as string[];
}
}
);
onMounted(() => {
onReset();
});
const myForm = ref<QForm | null>(null);
let editRow: CombinationTypeListItem;
let handle = ref('');
let handleError = ref('');
async function onSubmit() {
myForm.value?.validate().then(async (res) => {
if (res) {
try {
const combinationtypes = new relayCabinetGraphicData.Combinationtype({
code: combinationTypeConfig.value.code,
refRelays: combinationTypeConfig.value.refRelays,
});
if (handleState.value == '新建组合类型') {
handle.value = '创建成功';
handleError.value = '创建失败';
creatCombinationtype(combinationtypes);
} else {
handle.value = '更新成功';
handleError.value = '更新失败';
editCombinationtype(editRow, combinationtypes);
}
relayCabinetStore.tableOfCombinationType?.requestServerInteraction();
$q.notify({
type: 'positive',
message: handle.value,
});
onReset();
showRangeConfig.value = false;
} catch (err) {
$q.notify({
type: 'negative',
message: handleError.value,
});
} finally {
setTimeout(() => {
showRangeConfig.value = true;
}, 0);
}
}
});
}
async function editRelateRelays(row: CombinationTypeListItem) {
try {
const drawApp = relayCabinetStore.getDrawApp();
handleState.value = '编辑组合类型';
selectGraphic = [];
drawApp.updateSelected();
editRow = row;
combinationTypeConfig.value.code = row.code;
combinationTypeConfig.value.refRelays = row.refRelays;
combinationTypeConfig.value.refRelaysCode = [];
const select: JlGraphic[] = [];
row.refRelays.forEach((id) => {
const g = drawApp.queryStore.queryById(id) as Relay;
select.push(g);
combinationTypeConfig.value.refRelaysCode.push(g.datas.code);
});
drawApp.updateSelected(...select);
drawApp.makeGraphicCenterShow(...select);
} catch (err) {
$q.notify({
type: 'negative',
message: '没有需要编辑的详细信息',
});
}
}
function removeSelect(code: string) {
const removeIndex = combinationTypeConfig.value.refRelaysCode.findIndex(
(item) => item == code
);
selectGraphic.splice(removeIndex, 1);
combinationTypeConfig.value.refRelaysCode.splice(removeIndex, 1);
combinationTypeConfig.value.refRelays.splice(removeIndex, 1);
relayCabinetStore.getDrawApp().updateSelected(...selectGraphic);
}
function clearAllSelect() {
combinationTypeConfig.value.refRelays = [];
combinationTypeConfig.value.refRelaysCode = [];
clearAllSelectAtCanvas();
}
function clearAllSelectAtCanvas() {
selectGraphic = [];
relayCabinetStore.getDrawApp().updateSelected();
}
function onReset() {
handleState.value = '新建组合类型';
combinationTypeConfig.value = {
code: '',
refRelays: [],
refRelaysCode: [],
};
clearAllSelectAtCanvas();
}
function goBack() {
onReset();
relayCabinetStore.showCombinationTypeConfig = false;
}
onUnmounted(() => {
relayCabinetStore.showCombinationTypeConfig = false;
});
</script>

View File

@ -16,6 +16,7 @@
:rules="[(val) => val != undefined || '设备类型不能为空']"
/>
<q-input
v-if="!noShowType.includes(relateRelayConfig.deviceType)"
outlined
label="设备编号"
v-model="relateRelayConfig.code"
@ -137,6 +138,14 @@ const optionsType = [
label: '信号机故障报警仪',
value: graphicData.RelatedRef.DeviceType.SignalFaultAlarm,
},
{ label: '断路器', value: graphicData.RelatedRef.DeviceType.Breakers },
{ label: '电源屏', value: graphicData.RelatedRef.DeviceType.PowerScreen },
];
const noShowType = [
graphicData.RelatedRef.DeviceType.SignalFaultAlarm,
graphicData.RelatedRef.DeviceType.Breakers,
graphicData.RelatedRef.DeviceType.PowerScreen,
];
let selectGraphic: JlGraphic[] = [];

View File

@ -0,0 +1,142 @@
<template>
<q-form class="q-gutter-sm q-pa-sm">
<q-card-section>
<div class="text-h6">屏蔽门相关配置</div>
</q-card-section>
<q-input
outlined
v-model.number="screenDoorConfig.sonDoorAmount"
type="number"
label="子屏蔽门的数量"
/>
<q-list bordered separator class="rounded-borders">
<q-expansion-item
default-opened
expand-separator
v-for="screenDoorGroup in screenDoorConfig.screenDoorGroupList"
:key="screenDoorGroup"
:label="'列车编组数量为' + screenDoorGroup.trainGroupAmount"
>
<q-card>
<q-item no-wrap class="q-gutter-y-sm column">
<q-input
outlined
readonly
v-model.number="screenDoorGroup.trainGroupAmount"
type="number"
label="列车编组数量"
/>
<q-input
outlined
v-model.number="screenDoorGroup.startSmallDoor"
type="number"
label="起始的屏蔽门编号"
/>
<q-input
outlined
v-model.number="screenDoorGroup.endSmallDoor"
type="number"
label="结束的屏蔽门编号"
/>
</q-item>
</q-card>
</q-expansion-item>
</q-list>
<div>
<q-btn
label="确认修改"
color="primary"
@click="editScreenDoorConfig"
class="q-mr-md"
/>
<q-btn label="返回" color="primary" @click="goBack" />
</div>
</q-form>
</template>
<script setup lang="ts">
import { useDrawStore } from 'src/stores/draw-store';
import { onMounted, ref } from 'vue';
import { graphicData } from 'src/protos/stationLayoutGraphics';
import {
loadScreenDoorConfig,
setScreenDoorConfig,
} from 'src/drawApp/commonApp';
import { StopPosition } from 'src/graphics/stopPosition/StopPosition';
import { useQuasar } from 'quasar';
const emit = defineEmits(['close']);
const $q = useQuasar();
const drawStore = useDrawStore();
const screenDoorConfig = ref<{
sonDoorAmount: number;
screenDoorGroupList: graphicData.ScreenDoorGroup[];
}>({
sonDoorAmount: 30,
screenDoorGroupList: [],
});
onMounted(() => {
if (loadScreenDoorConfig() == undefined) {
const stopPositions = drawStore
.getDrawApp()
.queryStore.queryByType<StopPosition>(StopPosition.Type);
const coachNum: graphicData.StopPosition.CoachNum[] = [];
stopPositions.forEach((stopPosition) => {
if (!coachNum.includes(stopPosition.datas.coachNum)) {
coachNum.push(stopPosition.datas.coachNum);
}
});
coachNum.sort((a, b) => a - b);
const showCoachNum = coachNum.map((item) => {
let changeItem: number;
switch (item) {
case graphicData.StopPosition.CoachNum.Eight:
changeItem = 8;
break;
case graphicData.StopPosition.CoachNum.Four:
changeItem = 4;
break;
case graphicData.StopPosition.CoachNum.Six:
changeItem = 6;
break;
default:
changeItem = 0;
break;
}
return changeItem;
});
showCoachNum.forEach((coachNum) => {
screenDoorConfig.value.screenDoorGroupList.push(
new graphicData.ScreenDoorGroup({
trainGroupAmount: coachNum,
startSmallDoor: 0,
endSmallDoor: 30,
})
);
});
} else {
screenDoorConfig.value = loadScreenDoorConfig();
}
});
function editScreenDoorConfig() {
const screenDoorGroupList: graphicData.ScreenDoorGroup[] = [];
screenDoorConfig.value.screenDoorGroupList.forEach((screenDoorGroup) => {
screenDoorGroupList.push(new graphicData.ScreenDoorGroup(screenDoorGroup));
});
setScreenDoorConfig(
new graphicData.ScreenDoorConfig({
sonDoorAmount: screenDoorConfig.value.sonDoorAmount,
screenDoorGroupList,
})
);
$q.notify({ type: 'positive', message: '更新成功' });
}
function goBack() {
emit('close');
}
</script>

View File

@ -10,63 +10,6 @@
lazy-rules
autogrow
/>
<q-input
outlined
v-model.number="screenDoorModel.sonDoorAmount"
type="number"
@blur="onUpdate"
label="子屏蔽门的数量"
/>
<q-list bordered separator class="rounded-borders">
<q-expansion-item
expand-separator
v-for="(screenDoorGroup, index) in screenDoorModel.screenDoorGroupList"
:key="screenDoorGroup"
:label="'列车编组数量为' + screenDoorGroup.trainGroupAmount"
>
<q-card>
<q-item no-wrap class="q-gutter-y-sm column">
<q-input
outlined
v-model.number="screenDoorGroup.trainGroupAmount"
type="number"
label="列车编组数量"
/>
<q-input
outlined
v-model.number="screenDoorGroup.startSmallDoor"
type="number"
label="起始的屏蔽门编号"
/>
<q-input
outlined
v-model.number="screenDoorGroup.endSmallDoor"
type="number"
label="结束的屏蔽门编号"
/>
<div>
<q-btn
label="确认修改"
color="secondary"
@click="onUpdate"
class="q-mr-md"
/>
<q-btn
label="删除列车编组"
color="secondary"
@click="deleteScreenDoorGroup(index)"
/>
</div>
</q-item>
</q-card>
</q-expansion-item>
</q-list>
<q-btn
class="q-mt-md"
label="增加列车编组"
color="secondary"
@click="addScreenDoorGroup"
/>
<q-list bordered separator class="rounded-borders">
<q-item>
<q-item-section no-wrap class="q-gutter-y-sm column">
@ -89,7 +32,6 @@ import { useDrawStore } from 'src/stores/draw-store';
import { computed } from 'vue';
import { ScreenDoor } from 'src/graphics/screenDoor/ScreenDoor';
import { Platform } from 'src/graphics/platform/Platform';
import { graphicData } from 'src/protos/stationLayoutGraphics';
const drawStore = useDrawStore();
const { data: screenDoorModel, onUpdate } = useFormData(
@ -110,19 +52,4 @@ const platformRelation = computed(() => {
}
return refStation;
});
function addScreenDoorGroup() {
screenDoorModel.screenDoorGroupList = [
...screenDoorModel.screenDoorGroupList,
new graphicData.ScreenDoorGroup(),
];
}
function deleteScreenDoorGroup(index: number) {
const screenDoor = drawStore.selectedGraphic as ScreenDoor;
const data = screenDoor.datas.clone().screenDoorGroupList;
data.splice(index, 1);
screenDoor.datas.screenDoorGroupList = data;
screenDoorModel.screenDoorGroupList = data;
}
</script>

View File

@ -47,11 +47,14 @@
active-class="bg-teal-1 text-grey-8"
@click.stop="clickSectionId(item)"
>
<q-item-section avatar>
{{ index }}
</q-item-section>
<q-item-section
>{{ getSectionById(item).code }}
</q-item-section>
<q-item-section side v-if="activeId == item">
<div class="q-gutter-md">
<div class="q-gutter-sm">
<q-btn
v-show="index != 0"
flat

View File

@ -54,15 +54,13 @@
</QItemSection>
</QItem>
<QSeparator class="q-mt-sm" />
<QItemLabel header>门控箱继电器状态</QItemLabel>
<QItem>
<QItemSection
v-for="item in platformState.mkxJState"
:key="item.code"
<QItemLabel header
>门控箱继电器状态 ({{ platformState.mkxJState.code }})</QItemLabel
>
<QItemLabel header>{{ item.code }}</QItemLabel>
<QItem>
<QItemSection>
<QCheckbox
v-for="reply in item.replyState"
v-for="reply in platformState.mkxJState.replyState"
v-model="reply.xh"
:label="reply.code"
:key="reply.id"
@ -77,7 +75,7 @@
</template>
<script setup lang="ts">
import { useLineStore } from 'src/stores/line-store';
import { ref, watch, onMounted, watchEffect, onUnmounted } from 'vue';
import { ref, watch, watchEffect, onUnmounted } from 'vue';
import { Platform } from 'src/graphics/platform/Platform';
import { state } from 'src/protos/device_state';
import { PlatformState } from 'src/drawApp/graphics/PlatformInteraction';
@ -89,14 +87,14 @@ const platformState = ref<{
code: string;
empj: boolean;
spksState: state.ReplyState[];
mkxJState: state.MkxJState[];
mkxJState: state.MkxJState;
}>({
id: '',
index: 0,
code: '',
empj: false,
spksState: [],
mkxJState: [],
mkxJState: new state.MkxJState(),
});
const stop = watchEffect(() => {
@ -135,7 +133,7 @@ function setPlatformState(platform: Platform) {
code: platform.datas.code,
empj: platform.states.empj ?? false,
spksState: platform.states.spksState ?? [],
mkxJState: platform.states.mkxJState ?? [],
mkxJState: platform.states.mkxJState ?? new state.MkxJState(),
};
}
</script>

View File

@ -26,11 +26,11 @@
</template>
<script setup lang="ts">
import { useLineStore } from 'src/stores/line-store';
import { ref, watchEffect } from 'vue';
import { ref, watchEffect, watch } from 'vue';
import { setRelayState } from 'src/api/Simulation';
import { useQuasar } from 'quasar';
import { ApiError } from 'src/boot/axios';
import { Relay } from 'src/graphics/relay/Relay';
import { IRelayState, Relay } from 'src/graphics/relay/Relay';
const $q = useQuasar();
const lineStore = useLineStore();
@ -60,6 +60,15 @@ watchEffect(() => {
}
});
watch(
() => lineStore.socketStates,
(val) => {
if (val && relayState.value.id) {
relayState.value = val[0].clone() as IRelayState;
}
}
);
function changePosition(td: boolean) {
if (lineStore.simulationId) {
setRelayState({

View File

@ -277,7 +277,9 @@ watch(
const find = val.find((item) => {
return (
item.graphicType == Turnout.Type &&
(item as ITurnoutState).id == turnoutState.value.id
(item as ITurnoutState).id == turnoutState.value.id &&
lineStore.selectedGraphics &&
lineStore.selectedGraphics[0].updateStates(item)
);
});
if (find) {

View File

@ -9,7 +9,7 @@ function getHost(): string {
// return '192.168.3.37:9091';
// return '192.168.3.15:9091';
// return '192.168.3.5:9091';
return '192.168.3.37:9091'; //卫志宏
// return '192.168.3.37:9091'; //卫志宏
return '192.168.3.233:9091';
}

42
src/drawApp/common.ts Normal file
View File

@ -0,0 +1,42 @@
import { AxleCounting } from 'src/graphics/axleCounting/AxleCounting';
import { Curvature } from 'src/graphics/curvature/Curvature';
import { CurvatureKiloMarker } from 'src/graphics/curvatureKiloMarker/CurvatureKiloMarker';
import { EsbButton } from 'src/graphics/esbButton/EsbButton';
import { GatedBox } from 'src/graphics/gatedBox/GatedBox';
import { Link } from 'src/graphics/link/Link';
import { Platform } from 'src/graphics/platform/Platform';
import { ScreenDoor } from 'src/graphics/screenDoor/ScreenDoor';
import { Section } from 'src/graphics/section/Section';
import { Separator } from 'src/graphics/separator/Separator';
import { Signal } from 'src/graphics/signal/Signal';
import { Slope } from 'src/graphics/slope/Slope';
import { SlopeKiloMarker } from 'src/graphics/slopeKiloMarker/SlopeKiloMarker';
import { SpksSwitch } from 'src/graphics/spksSwitch/SpksSwitch';
import { Station } from 'src/graphics/station/Station';
import { StopPosition } from 'src/graphics/stopPosition/StopPosition';
import { TrainWindow } from 'src/graphics/trainWindow/TrainWindow';
import { Transponder } from 'src/graphics/transponder/Transponder';
import { Turnout } from 'src/graphics/turnout/Turnout';
export const drawCommonLayerList = [
// 图层列表 默认显示的图层defaultShow: true
{ label: '区段', value: Section.Type, defaultShow: true },
{ label: '区段检测点', value: AxleCounting.Type, defaultShow: true },
{ label: '站台', value: Platform.Type, defaultShow: true },
{ label: '屏蔽门', value: ScreenDoor.Type, defaultShow: true },
{ label: '车站', value: Station.Type, defaultShow: true },
{ label: '道岔', value: Turnout.Type, defaultShow: true },
{ label: '信号机', value: Signal.Type, defaultShow: true },
{ label: '分隔符', value: Separator.Type, defaultShow: true },
{ label: '停车位置标', value: StopPosition.Type, defaultShow: true },
{ label: 'Spks开关', value: SpksSwitch.Type, defaultShow: true },
{ label: '门控箱', value: GatedBox.Type, defaultShow: true },
{ label: '紧急关闭按钮', value: EsbButton.Type, defaultShow: true },
{ label: '应答器', value: Transponder.Type, defaultShow: true },
{ label: '车次窗', value: TrainWindow.Type, defaultShow: true },
{ label: 'Link', value: Link.Type, defaultShow: false },
{ label: '坡度公里标', value: SlopeKiloMarker.Type, defaultShow: true },
{ label: '坡度', value: Slope.Type, defaultShow: true },
{ label: '曲度公里标', value: CurvatureKiloMarker.Type, defaultShow: true },
{ label: '曲度', value: Curvature.Type, defaultShow: true },
];

View File

@ -99,7 +99,7 @@ import { SlopeData } from './graphics/SlopeInteraction';
import { Slope, SlopeTemplate } from 'src/graphics/slope/Slope';
import { useLineStore } from 'src/stores/line-store';
import { LinkData } from './graphics/LinkInteraction';
import { Link, LinkTemplate } from 'src/graphics/link/Link';
import { LinkTemplate } from 'src/graphics/link/Link';
import { LinkDraw } from 'src/graphics/link/LinkDrawAssistant';
import {
CurvatureKiloMarker,
@ -144,29 +144,6 @@ export const DefaultCanvasMenu = new ContextMenu({
],
});
export const drawCommonLayerList = [
// 图层列表 默认显示的图层defaultShow: true
{ label: '区段', value: Section.Type, defaultShow: true },
{ label: '区段检测点', value: AxleCounting.Type, defaultShow: true },
{ label: '站台', value: Platform.Type, defaultShow: true },
{ label: '屏蔽门', value: ScreenDoor.Type, defaultShow: true },
{ label: '车站', value: Station.Type, defaultShow: true },
{ label: '道岔', value: Turnout.Type, defaultShow: true },
{ label: '信号机', value: Signal.Type, defaultShow: true },
{ label: '分隔符', value: Separator.Type, defaultShow: true },
{ label: '停车位置标', value: StopPosition.Type, defaultShow: true },
{ label: 'Spks开关', value: SpksSwitch.Type, defaultShow: true },
{ label: '门控箱', value: GatedBox.Type, defaultShow: true },
{ label: '紧急关闭按钮', value: EsbButton.Type, defaultShow: true },
{ label: '应答器', value: Transponder.Type, defaultShow: true },
{ label: '车次窗', value: TrainWindow.Type, defaultShow: true },
{ label: 'Link', value: Link.Type, defaultShow: false },
{ label: '坡度公里标', value: SlopeKiloMarker.Type, defaultShow: true },
{ label: '坡度', value: Slope.Type, defaultShow: true },
{ label: '曲度公里标', value: CurvatureKiloMarker.Type, defaultShow: true },
{ label: '曲度', value: Curvature.Type, defaultShow: true },
];
export function initCommonDrawApp(app: IDrawApp) {
new PlatformDraw(
app,
@ -243,6 +220,7 @@ export function initCommonDrawApp(app: IDrawApp) {
});
app.on('destroy', async () => {
UniqueIdPrefix = new graphicData.UniqueIdOfStationLayout();
screenDoorConfig = new graphicData.ScreenDoorConfig();
kilometerConvertList = [];
sectionCodePointList = [];
});
@ -253,6 +231,7 @@ export function loadCommonDrawDatas(
): GraphicData[] {
const datas: GraphicData[] = [];
UniqueIdPrefix = storage.UniqueIdPrefix;
screenDoorConfig = storage.screenDoorConfig;
kilometerConvertList = storage.kilometerConvertList;
sectionCodePointList = storage.sectionCodePointList;
storage.Platforms.forEach((platform) => {
@ -388,6 +367,7 @@ export function saveCommonDrawDatas(
storage.stationRelateDeviceList = refDevicesList;
}
storage.UniqueIdPrefix = UniqueIdPrefix;
storage.screenDoorConfig = screenDoorConfig;
storage.kilometerConvertList = kilometerConvertList;
storage.sectionCodePointList = sectionCodePointList;
return storage;
@ -499,3 +479,15 @@ export function editSectionCodePoint(row: graphicData.SectionCodePoint) {
export function deleteSectionCodePoint(index: number) {
sectionCodePointList.splice(index, 1);
}
//屏蔽门配置--子门数量和编组列表
let screenDoorConfig = new graphicData.ScreenDoorConfig();
export function loadScreenDoorConfig() {
return screenDoorConfig;
}
export function setScreenDoorConfig(
newScreenDoorConfig: graphicData.ScreenDoorConfig
) {
screenDoorConfig = newScreenDoorConfig;
}

View File

@ -98,13 +98,13 @@ export class PlatformState extends GraphicStateBase implements IPlatformState {
set spksState(v: state.ReplyState[]) {
this.states.spksState = v;
}
get mkxJState(): state.MkxJState[] {
get mkxJState(): state.MkxJState {
if (!this.states.mkxJState) {
this.states.mkxJState = [new state.MkxJState()];
this.states.mkxJState = new state.MkxJState();
}
return this.states.mkxJState;
}
set mkxJState(v: state.MkxJState[]) {
set mkxJState(v: state.MkxJState) {
this.states.mkxJState = v;
}
clone(): PlatformState {

View File

@ -13,6 +13,7 @@ import {
IGraphicScene,
JlGraphic,
} from 'src/jl-graphic';
import { loadScreenDoorConfig } from '../commonApp';
export class ScreenDoorData extends GraphicDataBase implements IScreenDoorData {
constructor(data?: graphicData.ScreenDoor) {
@ -43,18 +44,7 @@ export class ScreenDoorData extends GraphicDataBase implements IScreenDoorData {
this.data.refPlatformId = v;
}
get sonDoorAmount(): number {
return this.data.sonDoorAmount;
}
set sonDoorAmount(v: number) {
this.data.sonDoorAmount = v;
}
get screenDoorGroupList(): graphicData.ScreenDoorGroup[] {
return this.data.screenDoorGroupList.length > 0
? this.data.screenDoorGroupList
: (this.data.screenDoorGroupList = [new graphicData.ScreenDoorGroup()]);
}
set screenDoorGroupList(groupList: graphicData.ScreenDoorGroup[]) {
this.data.screenDoorGroupList = groupList;
return loadScreenDoorConfig()?.sonDoorAmount || 30;
}
clone(): ScreenDoorData {

View File

@ -32,12 +32,12 @@ import { LogicSectionData } from './graphics/LogicSectionInteraction';
import { LinkData } from './graphics/LinkInteraction';
import { Link, LinkTemplate } from 'src/graphics/link/Link';
import {
drawCommonLayerList,
initCommonDrawApp,
saveCommonDrawDatas,
loadCommonDrawDatas,
saveDrawToServer,
} from './commonApp';
import { drawCommonLayerList } from './common';
import { Notify } from 'quasar';
import { generateCalculateLink } from 'src/api/GenerateApi';
import { SignalDraw } from 'src/graphics/signal/SignalDrawAssistant';

View File

@ -69,6 +69,9 @@ export class RelayState extends GraphicStateBase implements IRelayState {
get code(): string {
return this.states.id;
}
get id(): string {
return this.states.id;
}
get xh(): boolean {
return this.states.xh;
}

View File

@ -80,8 +80,6 @@ export const refRelaysListMap = new Map<
{ combinationtype: string; device: string }
>();
export const combinationListMap = new Map<string, string>();
export function initDrawApp(): IDrawApp {
drawApp = newDrawApp({
dataLoader: loadDrawDatas,
@ -137,11 +135,6 @@ export function initDrawApp(): IDrawApp {
});
});
});
combinationTypeList.forEach((combination) => {
combination.refRelays.forEach((relayId) => {
combinationListMap.set(relayId, combination.code);
});
});
const relays = app.queryStore.queryByType<Relay>(Relay.Type);
relays.forEach((relay) => {
relay.refDevice.text = refRelaysListMap
@ -160,9 +153,7 @@ export function initDrawApp(): IDrawApp {
});
app.on('destroy', () => {
refRelaysList = [];
combinationTypeList = [];
refRelaysListMap.clear();
combinationListMap.clear();
});
return drawApp;
}
@ -241,7 +232,6 @@ export function saveDrawDatas(app: IDrawApp) {
}
});
storage.deviceRelateRelayList = refRelaysList;
storage.combinationtypeList = combinationTypeList;
storage.UniqueIdPrefix = UniqueIdPrefix;
storage.ciCjList = ciCjList;
storage.ciQdList = ciQdList;
@ -276,7 +266,6 @@ export async function loadDrawDatas(): Promise<IGraphicStorage> {
datas.push(new SignalFaultAlarmData(signalFaultAlarm));
});
refRelaysList = storage.deviceRelateRelayList;
combinationTypeList = storage.combinationtypeList;
UniqueIdPrefix = storage.UniqueIdPrefix;
ciCjList = storage.ciCjList;
ciQdList = storage.ciQdList;
@ -343,45 +332,6 @@ export function deleteDeviceRelateRelay(row: RelateRelaylistItem) {
}
}
//组合类型列表的增删改查
export interface CombinationTypeListItem {
code: string;
refRelays: string[];
refRelaysCode?: string[];
}
let combinationTypeList: relayCabinetGraphicData.Combinationtype[] = [];
export function loadCombinationtypeList() {
return combinationTypeList;
}
export function creatCombinationtype(
row: relayCabinetGraphicData.Combinationtype
) {
combinationTypeList.push(row);
}
export function editCombinationtype(
editRow: CombinationTypeListItem,
newData: relayCabinetGraphicData.Combinationtype
) {
for (let i = 0; i < combinationTypeList.length; i++) {
if (combinationTypeList[i].code == editRow.code) {
combinationTypeList[i] = newData;
break;
}
}
}
export function deleteCombinationtype(row: CombinationTypeListItem) {
for (let i = 0; i < combinationTypeList.length; i++) {
if (combinationTypeList[i].code == row.code) {
combinationTypeList.splice(i, 1);
break;
}
}
}
//所属集中站
let UniqueIdPrefix: relayCabinetGraphicData.UniqueIdType;
export function loadUniqueIdPrefix() {

View File

@ -87,8 +87,18 @@ function handleSubscribe(relayScene: IGraphicScene) {
}
});
}
if (states && states.length > 0) {
lineStore.setSocketStates(states);
if (states && states.length && app.selectedGraphics.length) {
const selectedGraphic = app.selectedGraphics[0];
const find = states.find((item) => {
return (
item.graphicType == Relay.Type &&
(item as RelayState).id == selectedGraphic.id &&
selectedGraphic.updateStates(item)
);
});
if (find) {
lineStore.setSocketStates([find]);
}
}
return states;
},

View File

@ -23,12 +23,12 @@ import {
} from 'src/graphics/trackLogicSection/TrackLogicSection';
import { TrackLogicSectionData } from './graphics/TrackLogicSectionInteraction';
import {
drawCommonLayerList,
initCommonDrawApp,
saveCommonDrawDatas,
loadCommonDrawDatas,
saveDrawToServer,
} from './commonApp';
import { drawCommonLayerList } from './common';
import { SignalDraw } from 'src/graphics/signal/SignalDrawAssistant';
import { SignalTemplate, Signal } from 'src/graphics/signal/Signal';
import { SignalData, SignalState } from './graphics/SignalInteraction';

View File

@ -28,7 +28,7 @@ export interface IPlatformState extends GraphicState {
id?: string;
empj?: boolean;
spksState?: state.ReplyState[];
mkxJState?: state.MkxJState[];
mkxJState?: state.MkxJState;
}
const platformConsts = {

View File

@ -18,6 +18,7 @@ export interface IRelayData extends GraphicData {
}
export interface IRelayState extends GraphicState {
get id(): string; //继电器id
get xh(): boolean; //继电器吸合
set xh(v: boolean);
}

View File

@ -8,7 +8,6 @@ import {
distance2,
} from 'src/jl-graphic';
import { Platform } from '../platform/Platform';
import { graphicData } from 'src/protos/stationLayoutGraphics';
import { state } from 'src/protos/device_state';
export interface IScreenDoorData extends GraphicData {
@ -17,9 +16,6 @@ export interface IScreenDoorData extends GraphicData {
get refPlatform(): string; // 关联的站台
set refPlatform(v: string);
get sonDoorAmount(): number; //子屏蔽门的数量
set sonDoorAmount(v: number);
get screenDoorGroupList(): graphicData.ScreenDoorGroup[]; //编组列表
set screenDoorGroupList(v: graphicData.ScreenDoorGroup[]);
clone(): IScreenDoorData;
copyFrom(data: IScreenDoorData): void;
eq(other: IScreenDoorData): boolean;
@ -95,7 +91,6 @@ export class ScreenDoor extends JlGraphic {
(g as smallDoorGraphic).smallDoorGraphic.clear();
(g as smallDoorGraphic).labelGraphic.text = '';
});
this.datas.sonDoorAmount = this.datas?.sonDoorAmount || 30;
for (let i = 0; i < this.datas.sonDoorAmount; i++) {
const smallDoor = new smallDoorGraphic();
const smallDoorState = this.states.asdStates.find(

View File

@ -65,20 +65,14 @@
style="margin-right: 10px"
>
<q-list>
<q-item clickable v-close-popup @click="openDeviceRelateList">
<q-item-section>
<q-item-label>关联设备列表</q-item-label>
</q-item-section>
</q-item>
<q-item clickable v-close-popup @click="openkilometerConvertList">
<q-item-section>
<q-item-label>公里标转换</q-item-label>
</q-item-section>
</q-item>
<q-item clickable v-close-popup @click="openSectionCodePointList">
<q-item-section>
<q-item-label>区段码位列表</q-item-label>
</q-item-section>
<q-item
v-for="item in dataManageConfig"
:key="item.label"
clickable
v-close-popup
@click="item.click"
>
<q-item-section>{{ item.label }}</q-item-section>
</q-item>
</q-list>
</q-btn-dropdown>
@ -97,6 +91,10 @@
<SectionCodePointConfig
v-else-if="drawStore.showEditSectionCodePoint"
></SectionCodePointConfig>
<screen-door-config
v-else-if="showScreenDoorConfig"
@close="closeScreenDoorConfig"
/>
<draw-properties
v-else-if="!drawStore.showRelateDeviceConfig"
></draw-properties>
@ -301,6 +299,7 @@ import SectionCodePointList from 'src/components/draw-app/dialogs/SectionCodePoi
import SectionCodePointConfig from 'src/components/draw-app/properties/SectionCodePointConfig.vue';
import StationRelateDeviceConfig from 'src/components/draw-app/properties/StationRelateDeviceConfig.vue';
import StationRelateDeviceList from 'src/components/draw-app/dialogs/StationRelateDeviceList.vue';
import ScreenDoorConfig from 'src/components/draw-app/properties/ScreenDoorConfig.vue';
import { PictureType } from 'src/protos/picture';
const $q = useQuasar();
@ -389,6 +388,18 @@ const leftMenuConfig = [
},
];
//
const showScreenDoorConfig = ref(false);
const closeScreenDoorConfig = () => {
showScreenDoorConfig.value = false;
};
const dataManageConfig = [
{ label: '关联设备列表', click: openDeviceRelateList },
{ label: '公里标转换', click: openkilometerConvertList },
{ label: '区段码位列表', click: openSectionCodePointList },
{ label: '屏蔽门配置', click: () => (showScreenDoorConfig.value = true) },
];
onMounted(() => {
console.log('绘制应用layout mounted');
const dom = document.getElementById('draw-app-container');

View File

@ -86,7 +86,6 @@
<draw-relayCabinetProperties
v-if="
!relayCabinetStore.showRelateRelayConfig &&
!relayCabinetStore.showCombinationTypeConfig &&
!relayCabinetStore.showCiCjConfig &&
!relayCabinetStore.showCiQdConfig
"
@ -95,10 +94,6 @@
v-else-if="relayCabinetStore.showRelateRelayConfig"
ref="relateRelayConfigEdit"
></relate-relay-config>
<combination-type-config
v-else-if="relayCabinetStore.showCombinationTypeConfig"
ref="combinationTypeConfigEdit"
></combination-type-config>
<ciCjConfig v-else-if="relayCabinetStore.showCiCjConfig" />
<ciQdConfig v-else />
</q-drawer>
@ -178,8 +173,6 @@ import DrawRelayCabinetProperties from 'src/components/draw-app/DrawRelayCabinet
import BatchBuildRelayCabinetOrRelay from 'src/components/draw-app/dialogs/BatchBuildRelayCabinetOrRelay.vue';
import DeviceRelateRelayList from 'src/components/draw-app/dialogs/DeviceRelateRelayList.vue';
import RelateRelayConfig from 'src/components/draw-app/properties/RelateRelayConfig.vue';
import CombinationtypeList from 'src/components/draw-app/dialogs/CombinationtypeList.vue';
import CombinationTypeConfig from 'src/components/draw-app/properties/CombinationTypeConfig.vue';
import CiCjList from 'src/components/draw-app/dialogs/CiCjList.vue';
import CiQdList from 'src/components/draw-app/dialogs/CiQdList.vue';
import CiCjConfig from 'src/components/draw-app/properties/CiCjConfig.vue';
@ -189,7 +182,6 @@ import {
saveDrawDatas,
checkDataToServer,
RelateRelaylistItem,
CombinationTypeListItem,
saveDrawToServer,
loadUniqueIdPrefix,
setUniqueIdPrefix,
@ -256,7 +248,6 @@ const leftMenuConfig = [
//
const dataManageConfig = [
{ label: '设备关联继电器列表', click: openDeviceRelateRelayList },
{ label: '组合类型列表', click: openCombinationTypeList },
{ label: '采集列表', click: openCiCjList },
{ label: '驱动列表', click: openCiQdList },
];
@ -425,25 +416,6 @@ function openDeviceRelateRelayList() {
});
}
let combinationTypeDialogInstance: DialogChainObject | null = null;
const combinationTypeConfigEdit =
ref<InstanceType<typeof CombinationTypeConfig>>();
function openCombinationTypeList() {
if (combinationTypeDialogInstance) return;
combinationTypeDialogInstance = $q
.dialog({
component: CombinationtypeList,
componentProps: {
onEditClick: (row: CombinationTypeListItem) => {
combinationTypeConfigEdit.value?.editRelateRelays(row);
},
},
})
.onCancel(() => {
combinationTypeDialogInstance = null;
});
}
let ciCjListDialogInstance: DialogChainObject | null = null;
function openCiCjList() {
if (ciCjListDialogInstance) return;
@ -483,9 +455,6 @@ onUnmounted(() => {
if (relateRelayDialogInstance) {
relateRelayDialogInstance.hide();
}
if (combinationTypeDialogInstance) {
combinationTypeDialogInstance.hide();
}
if (ciCjListDialogInstance) {
ciCjListDialogInstance.hide();
}

View File

@ -22,7 +22,7 @@
label="名称"
></q-input>
<q-btn flat round color="primary" icon="search" />
<q-btn color="primary" label="新建" @click="createFormShow = true" />
<q-btn color="primary" label="新建" @click="createFormFn" />
</template>
<template v-slot:body-cell-operations="props">
@ -51,32 +51,56 @@
transition-show="scale"
transition-hide="scale"
>
<q-card style="width: 300px">
<q-card style="width: 500px">
<q-card-section>
<q-form
ref="myForm"
@submit="onCreate"
@reset="onReset"
class="q-gutter-md"
>
<div class="text-h6">
<q-form ref="myForm" @submit="onCreate" @reset="onReset">
<div class="text-h6 q-my-md">
{{ editInfo.id ? '编辑' : '新建' }}运行环境信息
</div>
<q-input
dense
outlined
label="名称"
v-model="editInfo.name"
lazy-rules
:rules="[(val) => val.length > 0 || '请输入名称!']"
style="width: 300px"
/>
<q-input
outlined
label="配置"
v-model="editInfo.config"
type="textarea"
/>
<q-input outlined label="描述" v-model="editInfo.description" />
<q-tabs
v-model="tab"
dense
active-color="primary"
indicator-color="primary"
align="justify"
narrow-indicator
>
<q-tab
v-for="(item, index) in list"
:key="index"
:name="item.fieldName"
:label="item.description"
/>
</q-tabs>
<q-separator />
<q-tab-panels v-model="tab" animated keep-alive>
<q-tab-panel
v-for="(item, index) in list"
:key="index"
:name="item.fieldName"
>
<div style="height: 350px; overflow-y: auto; padding: 5px">
<ConfigData :cgData="item" @val="setVal"></ConfigData>
</div>
</q-tab-panel>
</q-tab-panels>
<q-input
dense
outlined
class="q-mb-md"
label="描述"
v-model="editInfo.description"
/>
<q-card-actions align="right">
<q-btn color="primary" label="保存" type="submit" />
<q-btn label="取消" type="reset" v-close-popup />
@ -99,8 +123,12 @@ import {
createParams,
RunconfigItem,
getRunconfigInfo,
getRunconfigDescription,
Description,
typeStr,
} from '../api/RunconfigApi';
import { ApiError } from 'src/boot/axios';
import ConfigData from '/src/components/ConfigData.vue';
const $q = useQuasar();
@ -117,6 +145,7 @@ const tableHeight = computed(() => {
onMounted(() => {
tableRef.value.requestServerInteraction();
getDescription();
});
const columnDefs: QTableColumn[] = [
@ -200,10 +229,18 @@ function onCreate() {
if (res) {
operateDisabled.value = true;
try {
const obj = {};
list.forEach((item) => {
getObjData(item, obj);
});
let str = '';
if (Object.keys(obj).length > 0) {
str = JSON.stringify(obj);
}
const params: createParams = {
name: editInfo.name,
description: editInfo.description,
config: editInfo.config,
config: str,
};
if (editInfo.id) {
await saveRunconfigData(+editInfo.id, params);
@ -214,6 +251,7 @@ function onCreate() {
createFormShow.value = false;
tableRef.value.requestServerInteraction(); //
} catch (err) {
console.log(err);
const error = err as ApiError;
$q.notify({
type: 'negative',
@ -273,6 +311,12 @@ function editData(row: RunconfigItem) {
editInfo.config = res.config;
editInfo.description = res.description;
createFormShow.value = true;
const eData = editInfo.config ? JSON.parse(editInfo.config) : '';
if (eData) {
list.forEach((item) => {
setEditVal(eData, item);
});
}
})
.catch((err) => {
const error = err as ApiError;
@ -282,4 +326,96 @@ function editData(row: RunconfigItem) {
});
});
}
function createFormFn() {
list.forEach((ite) => {
setDefaultVal(ite);
});
createFormShow.value = true;
}
const tab = ref('');
let list: Description[] = [];
function getDescription() {
getRunconfigDescription()
.then((res) => {
list = res;
list.forEach((ite) => {
setDefaultVal(ite);
});
tab.value = list[0].fieldName;
})
.catch((err) => {
console.log(err);
});
}
// eslint-disable-next-line
type obj = { [key: string]: any };
const valObj = {
string: '',
int: 0,
bool: false,
};
function getObjData(fieldInfo: Description, obj: obj) {
const key = fieldInfo.fieldName;
if (fieldInfo.type == 'array') {
obj[key] = [];
fieldInfo.val &&
(fieldInfo.val as []).forEach((ii: Description[]) => {
const iiObj = {};
ii.forEach((e: Description) => {
getObjData(e, iiObj);
});
obj[key].push(iiObj);
});
} else if (fieldInfo.type == 'map') {
const value = {};
obj[key] = value;
fieldInfo.itemTypeFields?.forEach((ii) => {
getObjData(ii, value);
});
} else {
obj[key] = fieldInfo.val;
}
}
function setDefaultVal(fieldInfo: Description) {
const arr = ['string', 'int', 'bool'];
if (fieldInfo.itemTypeFields) {
if (fieldInfo.type == typeStr.array) {
delete fieldInfo.val;
}
fieldInfo.itemTypeFields.forEach((ii) => {
setDefaultVal(ii);
});
} else {
if (arr.includes(fieldInfo.type)) {
fieldInfo.val = valObj[fieldInfo.type as keyof typeof valObj];
}
}
}
function setEditVal(eData: obj, item: Description) {
if (item.type == typeStr.map) {
item.itemTypeFields?.forEach((ii) => {
setEditVal(eData[item.fieldName], ii);
});
} else if (item.type == typeStr.array) {
item.val = [];
eData[item.fieldName].forEach((ii: obj) => {
const fs: Description[] = JSON.parse(JSON.stringify(item.itemTypeFields));
fs.forEach((it: Description) => {
setEditVal(ii, it);
});
item.val.push(fs);
});
} else {
let v = valObj[item.type as keyof typeof valObj];
item.val = eData[item.fieldName] || v;
}
}
function setVal(val: string | number | boolean | [], obj: Description) {
obj.val = val;
}
</script>

View File

@ -774,10 +774,10 @@ export namespace state {
id?: string;
empj?: boolean;
spksState?: ReplyState[];
mkxJState?: MkxJState[];
mkxJState?: MkxJState;
}) {
super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [3, 4], this.#one_of_decls);
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [3], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") {
if ("id" in data && data.id != undefined) {
this.id = data.id;
@ -812,16 +812,19 @@ export namespace state {
pb_1.Message.setRepeatedWrapperField(this, 3, value);
}
get mkxJState() {
return pb_1.Message.getRepeatedWrapperField(this, MkxJState, 4) as MkxJState[];
return pb_1.Message.getWrapperField(this, MkxJState, 4) as MkxJState;
}
set mkxJState(value: MkxJState[]) {
pb_1.Message.setRepeatedWrapperField(this, 4, value);
set mkxJState(value: MkxJState) {
pb_1.Message.setWrapperField(this, 4, value);
}
get has_mkxJState() {
return pb_1.Message.getField(this, 4) != null;
}
static fromObject(data: {
id?: string;
empj?: boolean;
spksState?: ReturnType<typeof ReplyState.prototype.toObject>[];
mkxJState?: ReturnType<typeof MkxJState.prototype.toObject>[];
mkxJState?: ReturnType<typeof MkxJState.prototype.toObject>;
}): PlatformState {
const message = new PlatformState({});
if (data.id != null) {
@ -834,7 +837,7 @@ export namespace state {
message.spksState = data.spksState.map(item => ReplyState.fromObject(item));
}
if (data.mkxJState != null) {
message.mkxJState = data.mkxJState.map(item => MkxJState.fromObject(item));
message.mkxJState = MkxJState.fromObject(data.mkxJState);
}
return message;
}
@ -843,7 +846,7 @@ export namespace state {
id?: string;
empj?: boolean;
spksState?: ReturnType<typeof ReplyState.prototype.toObject>[];
mkxJState?: ReturnType<typeof MkxJState.prototype.toObject>[];
mkxJState?: ReturnType<typeof MkxJState.prototype.toObject>;
} = {};
if (this.id != null) {
data.id = this.id;
@ -855,7 +858,7 @@ export namespace state {
data.spksState = this.spksState.map((item: ReplyState) => item.toObject());
}
if (this.mkxJState != null) {
data.mkxJState = this.mkxJState.map((item: MkxJState) => item.toObject());
data.mkxJState = this.mkxJState.toObject();
}
return data;
}
@ -869,8 +872,8 @@ export namespace state {
writer.writeBool(2, this.empj);
if (this.spksState.length)
writer.writeRepeatedMessage(3, this.spksState, (item: ReplyState) => item.serialize(writer));
if (this.mkxJState.length)
writer.writeRepeatedMessage(4, this.mkxJState, (item: MkxJState) => item.serialize(writer));
if (this.has_mkxJState)
writer.writeMessage(4, this.mkxJState, () => this.mkxJState.serialize(writer));
if (!w)
return writer.getResultBuffer();
}
@ -890,7 +893,7 @@ export namespace state {
reader.readMessage(message.spksState, () => pb_1.Message.addToRepeatedWrapperField(message, 3, ReplyState.deserialize(reader), ReplyState));
break;
case 4:
reader.readMessage(message.mkxJState, () => pb_1.Message.addToRepeatedWrapperField(message, 4, MkxJState.deserialize(reader), MkxJState));
reader.readMessage(message.mkxJState, () => message.mkxJState = MkxJState.deserialize(reader));
break;
default: reader.skipField();
}

View File

@ -15,13 +15,12 @@ export namespace relayCabinetGraphicData {
deviceRelateRelayList?: DeviceRelateRelay[];
UniqueIdPrefix?: UniqueIdType;
phaseFailureProtectors?: PhaseFailureProtector[];
combinationtypeList?: Combinationtype[];
signalFaultAlarms?: SignalFaultAlarm[];
ciCjList?: CiCj;
ciQdList?: CiQd;
}) {
super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [2, 3, 4, 7, 8, 9], this.#one_of_decls);
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [2, 3, 4, 7, 9], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") {
if ("canvas" in data && data.canvas != undefined) {
this.canvas = data.canvas;
@ -41,9 +40,6 @@ export namespace relayCabinetGraphicData {
if ("phaseFailureProtectors" in data && data.phaseFailureProtectors != undefined) {
this.phaseFailureProtectors = data.phaseFailureProtectors;
}
if ("combinationtypeList" in data && data.combinationtypeList != undefined) {
this.combinationtypeList = data.combinationtypeList;
}
if ("signalFaultAlarms" in data && data.signalFaultAlarms != undefined) {
this.signalFaultAlarms = data.signalFaultAlarms;
}
@ -97,12 +93,6 @@ export namespace relayCabinetGraphicData {
set phaseFailureProtectors(value: PhaseFailureProtector[]) {
pb_1.Message.setRepeatedWrapperField(this, 7, value);
}
get combinationtypeList() {
return pb_1.Message.getRepeatedWrapperField(this, Combinationtype, 8) as Combinationtype[];
}
set combinationtypeList(value: Combinationtype[]) {
pb_1.Message.setRepeatedWrapperField(this, 8, value);
}
get signalFaultAlarms() {
return pb_1.Message.getRepeatedWrapperField(this, SignalFaultAlarm, 9) as SignalFaultAlarm[];
}
@ -134,7 +124,6 @@ export namespace relayCabinetGraphicData {
deviceRelateRelayList?: ReturnType<typeof DeviceRelateRelay.prototype.toObject>[];
UniqueIdPrefix?: ReturnType<typeof UniqueIdType.prototype.toObject>;
phaseFailureProtectors?: ReturnType<typeof PhaseFailureProtector.prototype.toObject>[];
combinationtypeList?: ReturnType<typeof Combinationtype.prototype.toObject>[];
signalFaultAlarms?: ReturnType<typeof SignalFaultAlarm.prototype.toObject>[];
ciCjList?: ReturnType<typeof CiCj.prototype.toObject>;
ciQdList?: ReturnType<typeof CiQd.prototype.toObject>;
@ -158,9 +147,6 @@ export namespace relayCabinetGraphicData {
if (data.phaseFailureProtectors != null) {
message.phaseFailureProtectors = data.phaseFailureProtectors.map(item => PhaseFailureProtector.fromObject(item));
}
if (data.combinationtypeList != null) {
message.combinationtypeList = data.combinationtypeList.map(item => Combinationtype.fromObject(item));
}
if (data.signalFaultAlarms != null) {
message.signalFaultAlarms = data.signalFaultAlarms.map(item => SignalFaultAlarm.fromObject(item));
}
@ -180,7 +166,6 @@ export namespace relayCabinetGraphicData {
deviceRelateRelayList?: ReturnType<typeof DeviceRelateRelay.prototype.toObject>[];
UniqueIdPrefix?: ReturnType<typeof UniqueIdType.prototype.toObject>;
phaseFailureProtectors?: ReturnType<typeof PhaseFailureProtector.prototype.toObject>[];
combinationtypeList?: ReturnType<typeof Combinationtype.prototype.toObject>[];
signalFaultAlarms?: ReturnType<typeof SignalFaultAlarm.prototype.toObject>[];
ciCjList?: ReturnType<typeof CiCj.prototype.toObject>;
ciQdList?: ReturnType<typeof CiQd.prototype.toObject>;
@ -203,9 +188,6 @@ export namespace relayCabinetGraphicData {
if (this.phaseFailureProtectors != null) {
data.phaseFailureProtectors = this.phaseFailureProtectors.map((item: PhaseFailureProtector) => item.toObject());
}
if (this.combinationtypeList != null) {
data.combinationtypeList = this.combinationtypeList.map((item: Combinationtype) => item.toObject());
}
if (this.signalFaultAlarms != null) {
data.signalFaultAlarms = this.signalFaultAlarms.map((item: SignalFaultAlarm) => item.toObject());
}
@ -233,8 +215,6 @@ export namespace relayCabinetGraphicData {
writer.writeMessage(6, this.UniqueIdPrefix, () => this.UniqueIdPrefix.serialize(writer));
if (this.phaseFailureProtectors.length)
writer.writeRepeatedMessage(7, this.phaseFailureProtectors, (item: PhaseFailureProtector) => item.serialize(writer));
if (this.combinationtypeList.length)
writer.writeRepeatedMessage(8, this.combinationtypeList, (item: Combinationtype) => item.serialize(writer));
if (this.signalFaultAlarms.length)
writer.writeRepeatedMessage(9, this.signalFaultAlarms, (item: SignalFaultAlarm) => item.serialize(writer));
if (this.has_ciCjList)
@ -268,9 +248,6 @@ export namespace relayCabinetGraphicData {
case 7:
reader.readMessage(message.phaseFailureProtectors, () => pb_1.Message.addToRepeatedWrapperField(message, 7, PhaseFailureProtector.deserialize(reader), PhaseFailureProtector));
break;
case 8:
reader.readMessage(message.combinationtypeList, () => pb_1.Message.addToRepeatedWrapperField(message, 8, Combinationtype.deserialize(reader), Combinationtype));
break;
case 9:
reader.readMessage(message.signalFaultAlarms, () => pb_1.Message.addToRepeatedWrapperField(message, 9, SignalFaultAlarm.deserialize(reader), SignalFaultAlarm));
break;

View File

@ -41,6 +41,7 @@ export namespace graphicData {
screenDoors?: ScreenDoor[];
stationRelateDeviceList?: StationRelateDevice[];
sectionCodePointList?: SectionCodePoint[];
screenDoorConfig?: ScreenDoorConfig;
}) {
super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [4, 5, 8, 9, 10, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 32, 33, 34, 35], this.#one_of_decls);
@ -132,6 +133,9 @@ export namespace graphicData {
if ("sectionCodePointList" in data && data.sectionCodePointList != undefined) {
this.sectionCodePointList = data.sectionCodePointList;
}
if ("screenDoorConfig" in data && data.screenDoorConfig != undefined) {
this.screenDoorConfig = data.screenDoorConfig;
}
}
}
get canvas() {
@ -314,6 +318,15 @@ export namespace graphicData {
set sectionCodePointList(value: SectionCodePoint[]) {
pb_1.Message.setRepeatedWrapperField(this, 35, value);
}
get screenDoorConfig() {
return pb_1.Message.getWrapperField(this, ScreenDoorConfig, 36) as ScreenDoorConfig;
}
set screenDoorConfig(value: ScreenDoorConfig) {
pb_1.Message.setWrapperField(this, 36, value);
}
get has_screenDoorConfig() {
return pb_1.Message.getField(this, 36) != null;
}
static fromObject(data: {
canvas?: ReturnType<typeof Canvas.prototype.toObject>;
Platforms?: ReturnType<typeof Platform.prototype.toObject>[];
@ -344,6 +357,7 @@ export namespace graphicData {
screenDoors?: ReturnType<typeof ScreenDoor.prototype.toObject>[];
stationRelateDeviceList?: ReturnType<typeof StationRelateDevice.prototype.toObject>[];
sectionCodePointList?: ReturnType<typeof SectionCodePoint.prototype.toObject>[];
screenDoorConfig?: ReturnType<typeof ScreenDoorConfig.prototype.toObject>;
}): RtssGraphicStorage {
const message = new RtssGraphicStorage({});
if (data.canvas != null) {
@ -433,6 +447,9 @@ export namespace graphicData {
if (data.sectionCodePointList != null) {
message.sectionCodePointList = data.sectionCodePointList.map(item => SectionCodePoint.fromObject(item));
}
if (data.screenDoorConfig != null) {
message.screenDoorConfig = ScreenDoorConfig.fromObject(data.screenDoorConfig);
}
return message;
}
toObject() {
@ -466,6 +483,7 @@ export namespace graphicData {
screenDoors?: ReturnType<typeof ScreenDoor.prototype.toObject>[];
stationRelateDeviceList?: ReturnType<typeof StationRelateDevice.prototype.toObject>[];
sectionCodePointList?: ReturnType<typeof SectionCodePoint.prototype.toObject>[];
screenDoorConfig?: ReturnType<typeof ScreenDoorConfig.prototype.toObject>;
} = {};
if (this.canvas != null) {
data.canvas = this.canvas.toObject();
@ -554,6 +572,9 @@ export namespace graphicData {
if (this.sectionCodePointList != null) {
data.sectionCodePointList = this.sectionCodePointList.map((item: SectionCodePoint) => item.toObject());
}
if (this.screenDoorConfig != null) {
data.screenDoorConfig = this.screenDoorConfig.toObject();
}
return data;
}
serialize(): Uint8Array;
@ -618,6 +639,8 @@ export namespace graphicData {
writer.writeRepeatedMessage(34, this.stationRelateDeviceList, (item: StationRelateDevice) => item.serialize(writer));
if (this.sectionCodePointList.length)
writer.writeRepeatedMessage(35, this.sectionCodePointList, (item: SectionCodePoint) => item.serialize(writer));
if (this.has_screenDoorConfig)
writer.writeMessage(36, this.screenDoorConfig, () => this.screenDoorConfig.serialize(writer));
if (!w)
return writer.getResultBuffer();
}
@ -714,6 +737,9 @@ export namespace graphicData {
case 35:
reader.readMessage(message.sectionCodePointList, () => pb_1.Message.addToRepeatedWrapperField(message, 35, SectionCodePoint.deserialize(reader), SectionCodePoint));
break;
case 36:
reader.readMessage(message.screenDoorConfig, () => message.screenDoorConfig = ScreenDoorConfig.deserialize(reader));
break;
default: reader.skipField();
}
}
@ -1499,12 +1525,10 @@ export namespace graphicData {
constructor(data?: any[] | {
common?: CommonInfo;
code?: string;
sonDoorAmount?: number;
refPlatformId?: string;
screenDoorGroupList?: ScreenDoorGroup[];
}) {
super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [5], this.#one_of_decls);
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") {
if ("common" in data && data.common != undefined) {
this.common = data.common;
@ -1512,15 +1536,9 @@ export namespace graphicData {
if ("code" in data && data.code != undefined) {
this.code = data.code;
}
if ("sonDoorAmount" in data && data.sonDoorAmount != undefined) {
this.sonDoorAmount = data.sonDoorAmount;
}
if ("refPlatformId" in data && data.refPlatformId != undefined) {
this.refPlatformId = data.refPlatformId;
}
if ("screenDoorGroupList" in data && data.screenDoorGroupList != undefined) {
this.screenDoorGroupList = data.screenDoorGroupList;
}
}
}
get common() {
@ -1538,30 +1556,16 @@ export namespace graphicData {
set code(value: string) {
pb_1.Message.setField(this, 2, value);
}
get sonDoorAmount() {
return pb_1.Message.getFieldWithDefault(this, 3, 0) as number;
}
set sonDoorAmount(value: number) {
pb_1.Message.setField(this, 3, value);
}
get refPlatformId() {
return pb_1.Message.getFieldWithDefault(this, 4, "") as string;
}
set refPlatformId(value: string) {
pb_1.Message.setField(this, 4, value);
}
get screenDoorGroupList() {
return pb_1.Message.getRepeatedWrapperField(this, ScreenDoorGroup, 5) as ScreenDoorGroup[];
}
set screenDoorGroupList(value: ScreenDoorGroup[]) {
pb_1.Message.setRepeatedWrapperField(this, 5, value);
}
static fromObject(data: {
common?: ReturnType<typeof CommonInfo.prototype.toObject>;
code?: string;
sonDoorAmount?: number;
refPlatformId?: string;
screenDoorGroupList?: ReturnType<typeof ScreenDoorGroup.prototype.toObject>[];
}): ScreenDoor {
const message = new ScreenDoor({});
if (data.common != null) {
@ -1570,24 +1574,16 @@ export namespace graphicData {
if (data.code != null) {
message.code = data.code;
}
if (data.sonDoorAmount != null) {
message.sonDoorAmount = data.sonDoorAmount;
}
if (data.refPlatformId != null) {
message.refPlatformId = data.refPlatformId;
}
if (data.screenDoorGroupList != null) {
message.screenDoorGroupList = data.screenDoorGroupList.map(item => ScreenDoorGroup.fromObject(item));
}
return message;
}
toObject() {
const data: {
common?: ReturnType<typeof CommonInfo.prototype.toObject>;
code?: string;
sonDoorAmount?: number;
refPlatformId?: string;
screenDoorGroupList?: ReturnType<typeof ScreenDoorGroup.prototype.toObject>[];
} = {};
if (this.common != null) {
data.common = this.common.toObject();
@ -1595,15 +1591,9 @@ export namespace graphicData {
if (this.code != null) {
data.code = this.code;
}
if (this.sonDoorAmount != null) {
data.sonDoorAmount = this.sonDoorAmount;
}
if (this.refPlatformId != null) {
data.refPlatformId = this.refPlatformId;
}
if (this.screenDoorGroupList != null) {
data.screenDoorGroupList = this.screenDoorGroupList.map((item: ScreenDoorGroup) => item.toObject());
}
return data;
}
serialize(): Uint8Array;
@ -1614,12 +1604,8 @@ export namespace graphicData {
writer.writeMessage(1, this.common, () => this.common.serialize(writer));
if (this.code.length)
writer.writeString(2, this.code);
if (this.sonDoorAmount != 0)
writer.writeInt32(3, this.sonDoorAmount);
if (this.refPlatformId.length)
writer.writeString(4, this.refPlatformId);
if (this.screenDoorGroupList.length)
writer.writeRepeatedMessage(5, this.screenDoorGroupList, (item: ScreenDoorGroup) => item.serialize(writer));
if (!w)
return writer.getResultBuffer();
}
@ -1635,15 +1621,9 @@ export namespace graphicData {
case 2:
message.code = reader.readString();
break;
case 3:
message.sonDoorAmount = reader.readInt32();
break;
case 4:
message.refPlatformId = reader.readString();
break;
case 5:
reader.readMessage(message.screenDoorGroupList, () => pb_1.Message.addToRepeatedWrapperField(message, 5, ScreenDoorGroup.deserialize(reader), ScreenDoorGroup));
break;
default: reader.skipField();
}
}
@ -1656,6 +1636,96 @@ export namespace graphicData {
return ScreenDoor.deserialize(bytes);
}
}
export class ScreenDoorConfig extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(data?: any[] | {
sonDoorAmount?: number;
screenDoorGroupList?: ScreenDoorGroup[];
}) {
super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [2], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") {
if ("sonDoorAmount" in data && data.sonDoorAmount != undefined) {
this.sonDoorAmount = data.sonDoorAmount;
}
if ("screenDoorGroupList" in data && data.screenDoorGroupList != undefined) {
this.screenDoorGroupList = data.screenDoorGroupList;
}
}
}
get sonDoorAmount() {
return pb_1.Message.getFieldWithDefault(this, 1, 0) as number;
}
set sonDoorAmount(value: number) {
pb_1.Message.setField(this, 1, value);
}
get screenDoorGroupList() {
return pb_1.Message.getRepeatedWrapperField(this, ScreenDoorGroup, 2) as ScreenDoorGroup[];
}
set screenDoorGroupList(value: ScreenDoorGroup[]) {
pb_1.Message.setRepeatedWrapperField(this, 2, value);
}
static fromObject(data: {
sonDoorAmount?: number;
screenDoorGroupList?: ReturnType<typeof ScreenDoorGroup.prototype.toObject>[];
}): ScreenDoorConfig {
const message = new ScreenDoorConfig({});
if (data.sonDoorAmount != null) {
message.sonDoorAmount = data.sonDoorAmount;
}
if (data.screenDoorGroupList != null) {
message.screenDoorGroupList = data.screenDoorGroupList.map(item => ScreenDoorGroup.fromObject(item));
}
return message;
}
toObject() {
const data: {
sonDoorAmount?: number;
screenDoorGroupList?: ReturnType<typeof ScreenDoorGroup.prototype.toObject>[];
} = {};
if (this.sonDoorAmount != null) {
data.sonDoorAmount = this.sonDoorAmount;
}
if (this.screenDoorGroupList != null) {
data.screenDoorGroupList = this.screenDoorGroupList.map((item: ScreenDoorGroup) => item.toObject());
}
return data;
}
serialize(): Uint8Array;
serialize(w: pb_1.BinaryWriter): void;
serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
const writer = w || new pb_1.BinaryWriter();
if (this.sonDoorAmount != 0)
writer.writeInt32(1, this.sonDoorAmount);
if (this.screenDoorGroupList.length)
writer.writeRepeatedMessage(2, this.screenDoorGroupList, (item: ScreenDoorGroup) => item.serialize(writer));
if (!w)
return writer.getResultBuffer();
}
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): ScreenDoorConfig {
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new ScreenDoorConfig();
while (reader.nextField()) {
if (reader.isEndGroup())
break;
switch (reader.getFieldNumber()) {
case 1:
message.sonDoorAmount = reader.readInt32();
break;
case 2:
reader.readMessage(message.screenDoorGroupList, () => pb_1.Message.addToRepeatedWrapperField(message, 2, ScreenDoorGroup.deserialize(reader), ScreenDoorGroup));
break;
default: reader.skipField();
}
}
return message;
}
serializeBinary(): Uint8Array {
return this.serialize();
}
static deserializeBinary(bytes: Uint8Array): ScreenDoorConfig {
return ScreenDoorConfig.deserialize(bytes);
}
}
export class ScreenDoorGroup extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(data?: any[] | {
@ -3539,7 +3609,9 @@ export namespace graphicData {
signal = 5,
station = 6,
ScreenDoor = 7,
SignalFaultAlarm = 8
SignalFaultAlarm = 8,
Breakers = 9,
PowerScreen = 10
}
export enum DevicePort {
A = 0,

View File

@ -20,8 +20,6 @@ export const useRelayCabinetStore = defineStore('relayCabinet', {
draftId: null as number | null,
showRelateRelayConfig: false,
table: undefined as QTable | undefined,
showCombinationTypeConfig: false,
tableOfCombinationType: undefined as QTable | undefined,
updateCiCjList: false,
editCiCjConfigIndex: null as CiCjConfigCeil | null,
showCiCjConfig: false,