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

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="编号" label="编号"
lazy-rules lazy-rules
/> />
<q-input
outlined
v-model="relayModel.showCode"
@blur="onUpdate"
:emit-value="true"
@update:model-value="onUpdate"
label="展示的编号"
lazy-rules
/>
<q-select <q-select
outlined outlined
v-model="relayModel.newModel" v-model="relayModel.newModel"

View File

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

View File

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

View File

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

View File

@ -4,50 +4,23 @@ import { ref, watch } from 'vue';
export const RelayModelType = relayCabinetGraphicData.Relay.ModelType; export const RelayModelType = relayCabinetGraphicData.Relay.ModelType;
export type GenerateDeviceType = 'Relay' | 'PhaseFailureProtector'; export type GenerateDeviceType = 'Relay' | 'PhaseFailureProtector';
export enum ShowCodeType {
NO,
zhonghe,
}
export interface Combinationtype { export interface Combinationtype {
code: string; code: string;
refDeviceCodesAndModel: { refDeviceCodesAndModel: {
code: string; code: string;
model: relayCabinetGraphicData.Relay.ModelType; model: relayCabinetGraphicData.Relay.ModelType;
type?: GenerateDeviceType; 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 = [ const singleTuroutCombinations = [
{ {
code: 'moban', code: 'moban',
@ -89,7 +62,44 @@ const doubleTuroutCombinations = [
{ {
code: 'TDFJ1', code: 'TDFJ1',
refDeviceCodesAndModel: [ 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', code: 'DBQ',
model: RelayModelType.Unknown, model: RelayModelType.Unknown,
@ -100,7 +110,36 @@ const doubleTuroutCombinations = [
{ {
code: 'TDFJ2', code: 'TDFJ2',
refDeviceCodesAndModel: [ 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', code: 'DBQ',
model: RelayModelType.Unknown, model: RelayModelType.Unknown,
@ -127,6 +166,9 @@ const signalRefDeviceCodesAndModel = [
{ {
code: 'LXJ', code: 'LXJ',
model: RelayModelType.JWXC_1700, model: RelayModelType.JWXC_1700,
showCode: {
zhonghe: 'LJ',
},
}, },
{ {
code: 'YXJ', code: 'YXJ',
@ -135,6 +177,9 @@ const signalRefDeviceCodesAndModel = [
{ {
code: 'ZXJ', code: 'ZXJ',
model: RelayModelType.JWXC_1700, model: RelayModelType.JWXC_1700,
showCode: {
zhonghe: 'UJ',
},
}, },
]; ];
@ -288,10 +333,16 @@ const PSDRefDeviceCodesAndModel = [
{ {
code: 'XMGJ', code: 'XMGJ',
model: RelayModelType.JWXC_1700, model: RelayModelType.JWXC_1700,
showCode: {
zhonghe: 'GSJ',
},
}, },
{ {
code: 'XMPLJ', code: 'XMPLJ',
model: RelayModelType.JWXC_1700, model: RelayModelType.JWXC_1700,
showCode: {
zhonghe: 'PLJ',
},
}, },
]; ];
const downScreenDoorCombinations = [ const downScreenDoorCombinations = [
@ -303,6 +354,9 @@ const downScreenDoorCombinations = [
code: string; code: string;
model: relayCabinetGraphicData.Relay.ModelType; model: relayCabinetGraphicData.Relay.ModelType;
type?: GenerateDeviceType; type?: GenerateDeviceType;
showCode?: {
zhonghe?: string;
};
}[], }[],
}, },
{ {
@ -376,6 +430,7 @@ watch(changeScreenDoorGroup, (group) => {
return { return {
code: item.code.replace('X', 'S'), code: item.code.replace('X', 'S'),
model: item.model, model: item.model,
showCode: item.showCode,
}; };
}); });
}); });

View File

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