Squashed commit of the following:
All checks were successful
CI / Docker-Build (push) Successful in 1m59s

commit d4c5e5a4a8
Author: joylink_zhaoerwei <Bob_Engineer@163.com>
Date:   Thu Jun 27 15:41:42 2024 +0800

    继电器增加批量操作
This commit is contained in:
joylink_zhaoerwei 2024-06-27 15:43:33 +08:00
parent d17144cd7e
commit f0cdd8c3b4
3 changed files with 59 additions and 1 deletions

View File

@ -34,6 +34,9 @@
></signalFaultAlarm-property> ></signalFaultAlarm-property>
</q-card-section> </q-card-section>
</template> </template>
<template v-else-if="relayCabinetStore.selectedGraphics.length > 1">
<relay-multiple-select-property />
</template>
</q-card> </q-card>
</div> </div>
</template> </template>
@ -49,6 +52,7 @@ import { PhaseFailureProtector } from 'src/graphics/phaseFailureProtector/PhaseF
import SignalFaultAlarmProperty from './properties/SignalFaultAlarmProperty.vue'; import SignalFaultAlarmProperty from './properties/SignalFaultAlarmProperty.vue';
import { SignalFaultAlarm } from 'src/graphics/signalFaultAlarm/SignalFaultAlarm'; import { SignalFaultAlarm } from 'src/graphics/signalFaultAlarm/SignalFaultAlarm';
import { useRelayCabinetStore } from 'src/stores/relayCabinet-store'; import { useRelayCabinetStore } from 'src/stores/relayCabinet-store';
import RelayMultipleSelectProperty from './properties/RelayMultipleSelectProperty.vue';
const relayCabinetStore = useRelayCabinetStore(); const relayCabinetStore = useRelayCabinetStore();
</script> </script>

View File

@ -0,0 +1,54 @@
<template>
<div class="q-gutter-sm" style="padding: 16px">
<q-select
outlined
v-model="defaultInitialPosition"
:options="defaultInitialPositionModel"
emitValue
mapOptions
label="继电器默认初始位置"
>
<template v-slot:after>
<q-btn label="设置" color="primary" @click="changeRelayPos" />
</template>
</q-select>
</div>
</template>
<script setup lang="ts">
import { Relay } from 'src/graphics/relay/Relay';
import { relayCabinetGraphicData } from 'src/protos/relayCabinetLayoutGraphics';
import { useRelayCabinetStore } from 'src/stores/relayCabinet-store';
import { ref } from 'vue';
const relayCabinetStore = useRelayCabinetStore();
const defaultInitialPosition =
ref<relayCabinetGraphicData.CjDataItem.PostionType>(
relayCabinetGraphicData.CjDataItem.PostionType.NONE
);
const defaultInitialPositionModel = [
{
label: 'Q',
value: relayCabinetGraphicData.CjDataItem.PostionType.Q,
},
{
label: 'H',
value: relayCabinetGraphicData.CjDataItem.PostionType.H,
},
{
label: 'NONE',
value: relayCabinetGraphicData.CjDataItem.PostionType.NONE,
},
];
function changeRelayPos() {
const selectedRelays = relayCabinetStore.selectedGraphics?.filter(
(g) => g instanceof Relay
);
selectedRelays?.forEach(
(relay) =>
((relay as Relay).datas.defaultInitialPosition =
defaultInitialPosition.value)
);
}
</script>

View File

@ -59,7 +59,7 @@ export const useRelayCabinetStore = defineStore('relayCabinet', {
).description; ).description;
return name || ''; return name || '';
} }
return '多选'; return '批量设置';
} }
return ''; return '';
}, },