diff --git a/src/components/rangeConfig.vue b/src/components/rangeConfig.vue index 524b03c..123fe76 100644 --- a/src/components/rangeConfig.vue +++ b/src/components/rangeConfig.vue @@ -40,6 +40,8 @@ square color="primary" text-color="white" + removable + @remove="removeSelect(item)" > {{ item }} @@ -101,7 +103,7 @@ const device = ref([]); const handleState = ref('新建范围配置'); const optionsType = [ - { label: '逻辑区段', value: LogicSection.Type }, + { label: '轨道', value: LogicSection.Type }, { label: '道岔', value: Turnout.Type }, { label: '集中站', value: Station.Type }, { label: '站台', value: Platform.Type }, @@ -223,6 +225,14 @@ async function searchById(id: number) { } } +function removeSelect(code: string) { + const removeIndex = device.value.findIndex((item) => item == code); + selectGraphic.splice(removeIndex, 1); + device.value.splice(removeIndex, 1); + rangeConfig.device.splice(removeIndex, 1); + lineStore.getLineApp().updateSelected(...selectGraphic); +} + function clearSelect() { device.value = []; selectGraphic = [];