bugfix - 公里标数据更新问题

This commit is contained in:
Yuan 2023-11-13 17:04:10 +08:00
parent 003557a2fa
commit 4ddcb5cccc
4 changed files with 8 additions and 8 deletions

View File

@ -1,6 +1,6 @@
import { type GraphicDataBase } from 'src/drawApp/graphics/GraphicDataBase';
import { IDrawApp } from 'src/jl-graphic';
import { onMounted, onUnmounted, reactive } from 'vue';
import { onMounted, onUnmounted, reactive, toRaw } from 'vue';
export function useFormData<T extends GraphicDataBase>(
source: T,
@ -19,7 +19,7 @@ export function useFormData<T extends GraphicDataBase>(
function onUpdate() {
const graphic = app.selectedGraphics[0];
if (graphic) {
app.updateGraphicAndRecord(graphic, data);
app.updateGraphicAndRecord(graphic, toRaw(data));
}
}

View File

@ -33,12 +33,12 @@ export class CurvatureKiloMarkerData
}
get kilometerSystem(): KilometerSystem {
if (!this.data.kilometerSystem[0]) {
this.data.kilometerSystem[0] = new graphicData.KilometerSystem();
this.data.kilometerSystem = [new graphicData.KilometerSystem()];
}
return this.data.kilometerSystem[0];
}
set kilometerSystem(v: KilometerSystem) {
this.data.kilometerSystem[0] = new graphicData.KilometerSystem(v);
this.data.kilometerSystem = [new graphicData.KilometerSystem(v)];
}
clone(): CurvatureKiloMarkerData {

View File

@ -33,12 +33,12 @@ export class SlopeKiloMarkerData
}
get kilometerSystem(): KilometerSystem {
if (!this.data.kilometerSystem[0]) {
this.data.kilometerSystem[0] = new graphicData.KilometerSystem();
this.data.kilometerSystem = [new graphicData.KilometerSystem()];
}
return this.data.kilometerSystem[0];
}
set kilometerSystem(v: KilometerSystem) {
this.data.kilometerSystem[0] = new graphicData.KilometerSystem(v);
this.data.kilometerSystem = [new graphicData.KilometerSystem(v)];
}
clone(): SlopeKiloMarkerData {

View File

@ -242,12 +242,12 @@ export class TurnoutData extends GraphicDataBase implements ITurnoutData {
}
get kilometerSystem(): KilometerSystem {
if (!this.data.kilometerSystem[0]) {
this.data.kilometerSystem[0] = new graphicData.KilometerSystem();
this.data.kilometerSystem = [new graphicData.KilometerSystem()];
}
return this.data.kilometerSystem[0];
}
set kilometerSystem(v: KilometerSystem) {
this.data.kilometerSystem[0] = new graphicData.KilometerSystem(v);
this.data.kilometerSystem = [new graphicData.KilometerSystem(v)];
}
get index(): number {
return this.data.index;