删除继电器柜图的组件挂载代码

This commit is contained in:
joylink_zhaoerwei 2023-11-13 17:41:42 +08:00
parent 91984105e5
commit fa35538841
4 changed files with 3 additions and 33 deletions

View File

@ -20,7 +20,7 @@
<script setup lang="ts">
import { PhaseFailureProtectorData } from 'src/drawApp/relayCabinetGraphics/PhaseFailureProtectorInteraction';
import { useRelayCabinetStore } from 'src/stores/relayCabinet-store';
import { useFormData } from 'src/components/relayCabinetAppFormUtils';
import { useFormData } from 'src/components/DrawAppFormUtils';
const relayCabinetStore = useRelayCabinetStore();
const { data: phaseFailureProtectorModel, onUpdate } = useFormData(

View File

@ -25,7 +25,7 @@
<script setup lang="ts">
import { RelayData } from 'src/drawApp/relayCabinetGraphics/RelayInteraction';
import { useRelayCabinetStore } from 'src/stores/relayCabinet-store';
import { useFormData } from 'src/components/relayCabinetAppFormUtils';
import { useFormData } from 'src/components/DrawAppFormUtils';
import { relayCabinetGraphicData } from 'src/protos/relayCabinetLayoutGraphics';
const relayCabinetStore = useRelayCabinetStore();

View File

@ -15,7 +15,7 @@
<script setup lang="ts">
import { SignalFaultAlarmData } from 'src/drawApp/relayCabinetGraphics/SignalFaultAlarmInteraction';
import { useRelayCabinetStore } from 'src/stores/relayCabinet-store';
import { useFormData } from 'src/components/relayCabinetAppFormUtils';
import { useFormData } from 'src/components/DrawAppFormUtils';
const relayCabinetStore = useRelayCabinetStore();
const { data: signalFaultAlarmModel, onUpdate } = useFormData(

View File

@ -1,30 +0,0 @@
import { type GraphicDataBase } from 'src/drawApp/graphics/GraphicDataBase';
import { IDrawApp, JlGraphic } from 'src/jl-graphic';
import { useRelayCabinetStore } from 'src/stores/relayCabinet-store';
import { onMounted, onUnmounted, reactive } from 'vue';
const drawStore = useRelayCabinetStore();
export function useFormData<T extends GraphicDataBase>(
source: T,
app: IDrawApp
) {
const data = reactive<T>(source);
onMounted(() => {
app.bindFormData(data);
});
onUnmounted(() => {
app.unbindFormData(data);
});
function onUpdate() {
const graphic = drawStore.selectedGraphic as JlGraphic;
if (graphic) {
app.updateGraphicAndRecord(graphic, data);
}
}
return { data, onUpdate };
}