继电器增加批量操作
This commit is contained in:
parent
71f0346bf0
commit
d4c5e5a4a8
@ -34,6 +34,9 @@
|
||||
></signalFaultAlarm-property>
|
||||
</q-card-section>
|
||||
</template>
|
||||
<template v-else-if="relayCabinetStore.selectedGraphics.length > 1">
|
||||
<relay-multiple-select-property />
|
||||
</template>
|
||||
</q-card>
|
||||
</div>
|
||||
</template>
|
||||
@ -49,6 +52,7 @@ import { PhaseFailureProtector } from 'src/graphics/phaseFailureProtector/PhaseF
|
||||
import SignalFaultAlarmProperty from './properties/SignalFaultAlarmProperty.vue';
|
||||
import { SignalFaultAlarm } from 'src/graphics/signalFaultAlarm/SignalFaultAlarm';
|
||||
import { useRelayCabinetStore } from 'src/stores/relayCabinet-store';
|
||||
import RelayMultipleSelectProperty from './properties/RelayMultipleSelectProperty.vue';
|
||||
|
||||
const relayCabinetStore = useRelayCabinetStore();
|
||||
</script>
|
||||
|
@ -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>
|
@ -59,7 +59,7 @@ export const useRelayCabinetStore = defineStore('relayCabinet', {
|
||||
).description;
|
||||
return name || '';
|
||||
}
|
||||
return '多选';
|
||||
return '批量设置';
|
||||
}
|
||||
return '';
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user