绑定form表单对象后切换类型后报错问题

This commit is contained in:
dong 2023-09-18 17:12:07 +08:00
parent e301c68687
commit c152c29051

View File

@ -523,8 +523,12 @@ export class JlDrawApp extends GraphicApp implements IDrawApp {
*/
bindFormData(form: GraphicData): void {
this.formData = form;
if (this.selectedGraphics.length == 1) {
this.formData.copyFrom(this.selectedGraphics[0].saveData());
if (this.formData && this.selectedGraphics.length == 1) {
if (this.formData.graphicType == this.selectedGraphics[0].type) {
this.formData.copyFrom(this.selectedGraphics[0].saveData());
} else {
this.formData = undefined;
}
}
}