This commit is contained in:
Yuan 2023-09-05 16:30:41 +08:00
parent dba7d34f1a
commit 67c8eb8dfb
3 changed files with 8 additions and 7 deletions

View File

@ -123,6 +123,7 @@ export function initLineNetApp(): IGraphicApp {
}); });
lineNetApp.subscribe({ lineNetApp.subscribe({
destination: '/queue/lineNet', destination: '/queue/lineNet',
messageConverter: (message: Uint8Array) => { messageConverter: (message: Uint8Array) => {
const storage = state.WsLineNetMessage.deserialize(message); const storage = state.WsLineNetMessage.deserialize(message);
const states: GraphicState[] = []; const states: GraphicState[] = [];

View File

@ -485,10 +485,11 @@ export class SectionPointEditPlugin extends GraphicInteractionPlugin<Section> {
} }
points.forEach((ps, i) => { points.forEach((ps, i) => {
const data = new LogicSectionData(); const data = new LogicSectionData();
const logicSectionDA = this.drawAssistant.app.drawAssistants.find( const logicSectionDraw =
(da) => da instanceof LogicSectionDraw this.drawAssistant.app.getDrawAssistant<LogicSectionDraw>(
) as LogicSectionDraw; LogicSection.Type
data.id = logicSectionDA.nextId(); );
data.id = logicSectionDraw.nextId();
data.code = `${sectionData.code}-${codeAppend.charAt(i % 26)}`; data.code = `${sectionData.code}-${codeAppend.charAt(i % 26)}`;
data.points = ps.map( data.points = ps.map(
(p) => new graphicData.Point({ x: p.x, y: p.y }) (p) => new graphicData.Point({ x: p.x, y: p.y })
@ -512,9 +513,9 @@ export class SectionPointEditPlugin extends GraphicInteractionPlugin<Section> {
) )
), ),
]; ];
const g = logicSectionDA.graphicTemplate.new(); const g = logicSectionDraw.graphicTemplate.new();
g.loadData(data); g.loadData(data);
logicSectionDA.storeGraphic(g); logicSectionDraw.storeGraphic(g);
children.push(g); children.push(g);
}); });
sectionData.children = children.map((g) => g.datas.id); sectionData.children = children.map((g) => g.datas.id);

View File

@ -16,7 +16,6 @@ import { useLineStore } from 'src/stores/line-store';
import { useRoute } from 'vue-router'; import { useRoute } from 'vue-router';
import { useLineNetStore } from 'src/stores/line-net-store'; import { useLineNetStore } from 'src/stores/line-net-store';
import StateProperties from 'src/components/state-app/StateProperties.vue'; import StateProperties from 'src/components/state-app/StateProperties.vue';
import { JlGraphic } from 'src/jl-graphic';
const props = withDefaults( const props = withDefaults(
defineProps<{ defineProps<{