diff --git a/src/drawApp/graphics/TrainInteraction.ts b/src/drawApp/graphics/TrainInteraction.ts index d218621..bea826b 100644 --- a/src/drawApp/graphics/TrainInteraction.ts +++ b/src/drawApp/graphics/TrainInteraction.ts @@ -448,7 +448,12 @@ class TrainHoverLabel extends Container { fill: labelConsts.textColor, fontSize: labelConsts.codeFontSize, }; - const text = `列车类型:计划车\n来 源:人工标记\n车 组 号:${states.groupId}\n表 号:${states.trainId}\n车 次 号:${states.globalId}`; + let codeA = states.groupId; + const firstChar = codeA.substring(0, 1); // 获取首字符 + if (+firstChar == states.lineId) { + codeA = codeA.substring(1); // 删除首字符是线路号的字符 + } + const text = `列车类型:计划车\n来 源:人工标记\n车 组 号:${codeA}\n表 号:${states.trainId}\n车 次 号:${states.globalId}\n线 路 号:${states.lineId}`; this.sText.text = text; this.sText.style = style; const { width: codeWidth, height: codeHeight } = diff --git a/src/graphics/train/Train.ts b/src/graphics/train/Train.ts index c4caea4..fabc7da 100644 --- a/src/graphics/train/Train.ts +++ b/src/graphics/train/Train.ts @@ -252,6 +252,10 @@ export class TrainBody extends Container { const codeBGraph = this.codeBGraph; // const codeRact = this.codeRact; let codeA = states?.groupId; + const firstChar = codeA.substring(0, 1); // 获取首字符 + if (+firstChar == states.lineId) { + codeA = codeA.substring(1); // 删除首字符是线路号的字符 + } const fillAColor = BBBColorEnum.schedule; let fillBColor = BBBColorEnum.schedule; if (states.mode?.ipModeTrainTypeSchedule) {