删除继电器柜图的组件挂载代码
This commit is contained in:
parent
91984105e5
commit
fa35538841
@ -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(
|
||||
|
@ -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();
|
||||
|
@ -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(
|
||||
|
@ -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 };
|
||||
}
|
Loading…
Reference in New Issue
Block a user