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