diff --git a/src/components/draw-app/properties/AxleCountingConfig.vue b/src/components/draw-app/properties/AxleCountingConfig.vue index a43fc81..4ba7eec 100644 --- a/src/components/draw-app/properties/AxleCountingConfig.vue +++ b/src/components/draw-app/properties/AxleCountingConfig.vue @@ -5,16 +5,30 @@ -
- - +
+ +
+
+ + + +
@@ -32,6 +46,7 @@ import { } from 'src/drawApp/commonApp'; import SelectConfigUtils from 'src/components/common/SelectConfigUtils.vue'; import { OneClickGenerate } from 'src/graphics/trainWindow/oneClickDrawAssistant'; +import { AxleCounting } from 'src/graphics/axleCounting/AxleCounting'; //供公共选择组件使用 const filterSelect = (g: JlGraphic) => g instanceof Turnout; @@ -125,4 +140,49 @@ function generateAxleCounting() { drawStore.oneClickType = 'AxleCounting'; drawStore.getDrawApp().interactionPlugin(OneClickGenerate.Type).resume(); } + +const selectConfig = ref< + { + axleCountingId: string; + axleCountingCode: string; + }[] +>([]); +function showErrorAxleCounting() { + showCheck.value = true; + const axleCountings = drawStore + .getDrawApp() + .queryStore.queryByType(AxleCounting.Type); + const erroeAxleCountings = axleCountings + .filter( + (g) => + g.datas.type == + graphicData.AxleCounting.TypeDetectionPoint.AxleCounting && + g.datas.axleCountingRef.length < 2 + ) + .sort((a, b) => a.position.x - b.position.x); + erroeAxleCountings.forEach((axleCounting) => { + selectConfig.value.push({ + axleCountingId: axleCounting.id, + axleCountingCode: axleCounting.datas.code, + }); + }); +} + +const currentIndex = ref(-1); +const showCheck = ref(false); +function clickSelectCenter(add: number) { + if ( + currentIndex.value + add < 0 || + currentIndex.value + add >= selectConfig.value.length + ) + return; + currentIndex.value = currentIndex.value + add; + const target = drawStore + .getDrawApp() + .queryStore.queryById( + selectConfig.value[currentIndex.value].axleCountingId + ); + drawStore.getDrawApp().makeGraphicCenterShow(target); + drawStore.getDrawApp().updateSelected(target); +}