增加空的枚举,生成的时候是空

This commit is contained in:
joylink_zhaoerwei 2024-06-27 14:40:05 +08:00
parent 9bbbe7b3e2
commit 71f0346bf0
4 changed files with 13 additions and 1 deletions

View File

@ -99,5 +99,9 @@ const defaultInitialPositionModel = [
label: 'H',
value: relayCabinetGraphicData.CjDataItem.PostionType.H,
},
{
label: 'NONE',
value: relayCabinetGraphicData.CjDataItem.PostionType.NONE,
},
];
</script>

View File

@ -9,6 +9,7 @@ import {
} from 'jl-graphic';
import { IRelayData, Relay, RelayTemplate } from './Relay';
import { relayCabinetGraphicData } from 'src/protos/relayCabinetLayoutGraphics';
export interface IRelayDrawOptions {
newData: () => IRelayData;
@ -39,6 +40,8 @@ export class RelayDraw extends GraphicDrawAssistant<RelayTemplate, IRelayData> {
}
prepareData(data: IRelayData): boolean {
data.transform = this.container.saveTransform();
data.defaultInitialPosition =
relayCabinetGraphicData.CjDataItem.PostionType.NONE;
return true;
}
}

View File

@ -83,6 +83,8 @@ export function generateRelays(
if (relaysInfo.showCode) {
generateDevice.datas.showCode = relaysInfo.showCode;
}
generateDevice.datas.defaultInitialPosition =
relayCabinetGraphicData.CjDataItem.PostionType.NONE;
relaysInfos.shift();
}
} else {
@ -129,6 +131,8 @@ function generateRelaysFormat(
if (relaysInfo.showCode) {
generateDevice.datas.showCode = relaysInfo.showCode;
}
generateDevice.datas.defaultInitialPosition =
relayCabinetGraphicData.CjDataItem.PostionType.NONE;
}
generateDevice.position.set(
relayCabinet.x -

View File

@ -1379,7 +1379,8 @@ export namespace relayCabinetGraphicData {
export namespace CjDataItem {
export enum PostionType {
Q = 0,
H = 1
H = 1,
NONE = 2
}
}
export class CiQd extends pb_1.Message {