生成继电器增加展示编号配置

This commit is contained in:
joylink_zhaoerwei 2024-06-24 21:08:58 +08:00
parent ad7a1a8451
commit 059a333370
6 changed files with 149 additions and 37 deletions

View File

@ -10,6 +10,15 @@
label="编号"
lazy-rules
/>
<q-input
outlined
v-model="relayModel.showCode"
@blur="onUpdate"
:emit-value="true"
@update:model-value="onUpdate"
label="展示的编号"
lazy-rules
/>
<q-select
outlined
v-model="relayModel.newModel"

View File

@ -46,6 +46,12 @@ export class RelayData extends GraphicDataBase implements IRelayData {
set newModel(v: relayCabinetGraphicData.Relay.ModelType) {
this.data.newModel = v;
}
get showCode(): string {
return this.data.showCode;
}
set showCode(v: string) {
this.data.showCode = v;
}
clone(): RelayData {
return new RelayData(this.data.cloneMessage());
}

View File

@ -12,6 +12,8 @@ export interface IRelayData extends GraphicData {
set code(v: string);
get newModel(): relayCabinetGraphicData.Relay.ModelType; // 型号
set newModel(v: relayCabinetGraphicData.Relay.ModelType);
get showCode(): string; // 展示的编号
set showCode(v: string);
clone(): IRelayData;
copyFrom(data: IRelayData): void;
eq(other: IRelayData): boolean;
@ -57,7 +59,11 @@ export class Relay extends JlGraphic {
}
doRepaint(): void {
if (this.datas.showCode) {
this.labelGraphic.text = this.datas.showCode;
} else {
this.labelGraphic.text = this.datas.code;
}
this.labelGraphic.position.set(0, 20);
this.refDevice.position.set(0, -20);
const relayGraphic = this.relayGraphic;

View File

@ -24,6 +24,7 @@ export interface GenerateRelaysCongig {
combinationCode: string;
type?: GenerateDeviceType;
deviceCode?: string;
showCode?: string;
}
export function generateRelayCabinet(
@ -79,6 +80,9 @@ export function generateRelays(
generateDevice.id = relaysInfo.id;
generateDevice.datas.code = relaysInfo.code;
generateDevice.datas.newModel = relaysInfo.model;
if (relaysInfo.showCode) {
generateDevice.datas.showCode = relaysInfo.showCode;
}
relaysInfos.shift();
}
} else {
@ -122,6 +126,9 @@ function generateRelaysFormat(
generateDevice.id = relaysInfo.id;
generateDevice.datas.code = relaysInfo.code;
generateDevice.datas.newModel = relaysInfo.model;
if (relaysInfo.showCode) {
generateDevice.datas.showCode = relaysInfo.showCode;
}
}
generateDevice.position.set(
relayCabinet.x -

View File

@ -4,50 +4,23 @@ import { ref, watch } from 'vue';
export const RelayModelType = relayCabinetGraphicData.Relay.ModelType;
export type GenerateDeviceType = 'Relay' | 'PhaseFailureProtector';
export enum ShowCodeType {
NO,
zhonghe,
}
export interface Combinationtype {
code: string;
refDeviceCodesAndModel: {
code: string;
model: relayCabinetGraphicData.Relay.ModelType;
type?: GenerateDeviceType;
showCode?: {
zhonghe?: string;
};
}[];
}
//道岔组合类型
const turoutRefDeviceCodesAndModel = [
{
code: '1DQJ',
model: RelayModelType.JWJXC_H125_80,
},
{
code: '1DQJF',
model: RelayModelType.JWJXC_480,
},
{
code: '2DQJ',
model: RelayModelType.JYJXC_160_260,
},
{
code: 'BHJ',
model: RelayModelType.JWXC_1700,
},
{
code: 'DBJ',
model: RelayModelType.JPXC_1000,
},
{
code: 'FBJ',
model: RelayModelType.JPXC_1000,
},
{
code: 'QDJ',
model: RelayModelType.JWXC_1700,
},
{
code: 'ZBHJ',
model: RelayModelType.JWXC_1700,
},
];
const singleTuroutCombinations = [
{
code: 'moban',
@ -89,7 +62,44 @@ const doubleTuroutCombinations = [
{
code: 'TDFJ1',
refDeviceCodesAndModel: [
...turoutRefDeviceCodesAndModel,
{
code: '1DQJ',
model: RelayModelType.JWJXC_H125_80,
},
{
code: '1DQJF',
model: RelayModelType.JWJXC_480,
},
{
code: '2DQJ',
model: RelayModelType.JYJXC_160_260,
},
{
code: 'BHJ',
model: RelayModelType.JWXC_1700,
},
{
code: 'DBJ',
model: RelayModelType.JPXC_1000,
showCode: {
zhonghe: 'DBJ1',
},
},
{
code: 'FBJ',
model: RelayModelType.JPXC_1000,
showCode: {
zhonghe: 'FBJ1',
},
},
{
code: 'QDJ',
model: RelayModelType.JWXC_1700,
},
{
code: 'ZBHJ',
model: RelayModelType.JWXC_1700,
},
{
code: 'DBQ',
model: RelayModelType.Unknown,
@ -100,7 +110,36 @@ const doubleTuroutCombinations = [
{
code: 'TDFJ2',
refDeviceCodesAndModel: [
...turoutRefDeviceCodesAndModel.slice(0, 6),
{
code: '1DQJ',
model: RelayModelType.JWJXC_H125_80,
},
{
code: '1DQJF',
model: RelayModelType.JWJXC_480,
},
{
code: '2DQJ',
model: RelayModelType.JYJXC_160_260,
},
{
code: 'BHJ',
model: RelayModelType.JWXC_1700,
},
{
code: 'DBJ',
model: RelayModelType.JPXC_1000,
showCode: {
zhonghe: 'DBJ2',
},
},
{
code: 'FBJ',
model: RelayModelType.JPXC_1000,
showCode: {
zhonghe: 'FBJ2',
},
},
{
code: 'DBQ',
model: RelayModelType.Unknown,
@ -127,6 +166,9 @@ const signalRefDeviceCodesAndModel = [
{
code: 'LXJ',
model: RelayModelType.JWXC_1700,
showCode: {
zhonghe: 'LJ',
},
},
{
code: 'YXJ',
@ -135,6 +177,9 @@ const signalRefDeviceCodesAndModel = [
{
code: 'ZXJ',
model: RelayModelType.JWXC_1700,
showCode: {
zhonghe: 'UJ',
},
},
];
@ -288,10 +333,16 @@ const PSDRefDeviceCodesAndModel = [
{
code: 'XMGJ',
model: RelayModelType.JWXC_1700,
showCode: {
zhonghe: 'GSJ',
},
},
{
code: 'XMPLJ',
model: RelayModelType.JWXC_1700,
showCode: {
zhonghe: 'PLJ',
},
},
];
const downScreenDoorCombinations = [
@ -303,6 +354,9 @@ const downScreenDoorCombinations = [
code: string;
model: relayCabinetGraphicData.Relay.ModelType;
type?: GenerateDeviceType;
showCode?: {
zhonghe?: string;
};
}[],
},
{
@ -376,6 +430,7 @@ watch(changeScreenDoorGroup, (group) => {
return {
code: item.code.replace('X', 'S'),
model: item.model,
showCode: item.showCode,
};
});
});

View File

@ -197,6 +197,14 @@
label="集中站"
:rules="[(val) => val != '' || '集中站不能为空']"
></q-select>
<q-select
outlined
v-model="generaterRelayLayout.showCodeType"
:options="showCodeTypeOption"
emitValue
mapOptions
label="展示编号的类型"
/>
<q-toggle
v-model="generaterRelayLayout.generateCJQD"
label="是否覆盖采集驱动数据"
@ -268,6 +276,7 @@ import {
combinationsMap,
RelayModelType,
changeScreenDoorGroup,
ShowCodeType,
} from './GeneraterRelayLayoutConfig';
import { generateRelayLayout, GenerateRelaysCongig } from './GeneraterDevice';
import { getPublishMapInfoById, pageQuery } from 'src/api/PublishApi';
@ -483,12 +492,14 @@ const generaterRelayLayout = ref<{
generateCJQD: boolean;
generateSectionRelay: boolean;
generateIKCJRelay: boolean;
showCodeType: ShowCodeType;
}>({
publishId: '',
centralizedStation: 0,
generateCJQD: true,
generateSectionRelay: false,
generateIKCJRelay: false,
showCodeType: ShowCodeType.NO,
});
let publishIdOption = ref<{ label: string; value: number }[]>();
@ -496,6 +507,17 @@ let centralizedStationsOption = ref<{ label: string; value: number }[]>([
{ label: '', value: 0 },
]);
let showCodeTypeOption = [
{
label: '无',
value: ShowCodeType.NO,
},
{
label: '众合',
value: ShowCodeType.zhonghe,
},
];
async function openGeneraterRelayLayoutDialog() {
generaterRelayLayoutDialog.value = true;
const response = await pageQuery({
@ -1054,6 +1076,12 @@ function oneClickGeneraterRelayLayout() {
combinationtype.refDeviceCodesAndModel.forEach((relay) => {
const id = GraphicIdGenerator.next();
refRelayIds.push(id);
let showCode = undefined;
if (
generaterRelayLayout.value.showCodeType == ShowCodeType.zhonghe
) {
showCode = relay.showCode?.zhonghe;
}
generateRelays.push({
id,
code: relay.code,
@ -1061,6 +1089,7 @@ function oneClickGeneraterRelayLayout() {
type: relay.type,
deviceCode,
combinationCode: combinationtype.code,
showCode,
});
if (deviceCode) {
generateRelaysMap.set(