bug修复

This commit is contained in:
joylink_zhaoerwei 2023-08-24 18:24:49 +08:00
parent 6df6aa6b3a
commit 3fbc2f20f0

View File

@ -129,7 +129,7 @@ const optionsAlertType = [
];
enum DeviceType {
Station = 'DEVICE_TYPE_RTU',
station = 'DEVICE_TYPE_RTU',
Turnout = 'DEVICE_TYPE_SWITCH',
LogicSection = 'DEVICE_TYPE_TRACK',
Platform = 'DEVICE_TYPE_PLATFORM',
@ -146,13 +146,25 @@ watch(
() => lineStore.selectedGraphics,
(val) => {
if (val && val.length > 0) {
const deviceFilter = lineStore.selectedGraphics?.filter(
(g) =>
g.type == rangeConfig.deviceType ||
const deviceFilter = lineStore.selectedGraphics?.filter((g) => {
let select = false;
if (
g.type == Station.Type &&
rangeConfig.deviceType == Station.Type &&
(g as Station).datas.hasControl
) {
select = true;
}
if (
(g.type == rangeConfig.deviceType && g.type !== Station.Type) ||
(g.type == Section.Type &&
(g as Section).datas.sectionType === SectionType.TurnoutPhysical &&
rangeConfig.deviceType == LogicSection.Type)
) as JlGraphic[];
) {
select = true;
}
return select;
}) as JlGraphic[];
selectGraphic.push(...deviceFilter);
selectGraphic = Array.from(new Set(selectGraphic));
lineStore.getLineApp().updateSelected(...selectGraphic);
@ -196,6 +208,7 @@ async function onSubmit() {
type: 'positive',
message: handle.value,
});
onReset();
} catch (err) {
$q.notify({
type: 'negative',