修改app配置-是否支持删除判断逻辑
This commit is contained in:
parent
f89c8eb48d
commit
3612e0fc16
@ -114,17 +114,17 @@ export function initDrawApp(dom: HTMLElement): JlDrawApp {
|
||||
return new TrainData();
|
||||
}),
|
||||
],
|
||||
isSupportDeletion: (g): boolean => {
|
||||
if (g.type === Signal.Type) {
|
||||
Notify.create({
|
||||
type: 'warning',
|
||||
message: '信号机不支持删除',
|
||||
timeout: 1000,
|
||||
});
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
},
|
||||
// isSupportDeletion: (g): boolean => {
|
||||
// if (g.type === Signal.Type) {
|
||||
// Notify.create({
|
||||
// type: 'warning',
|
||||
// message: '信号机不支持删除',
|
||||
// timeout: 1000,
|
||||
// });
|
||||
// return false;
|
||||
// }
|
||||
// return true;
|
||||
// },
|
||||
});
|
||||
|
||||
// 画布右键菜单
|
||||
|
@ -737,7 +737,7 @@ export class GraphicApp extends EventEmitter<GraphicAppEvents> {
|
||||
deleteGraphics(...graphics: JlGraphic[]): JlGraphic[] {
|
||||
const dels = graphics.filter((g) => {
|
||||
if (
|
||||
this._options?.isSupportDeletion &&
|
||||
this._options?.isSupportDeletion == undefined ||
|
||||
this._options.isSupportDeletion(g)
|
||||
) {
|
||||
this.doDeleteGraphics(g);
|
||||
|
Loading…
Reference in New Issue
Block a user