feat: add title deletable property #670
This commit is contained in:
@@ -154,7 +154,10 @@ interface IElement {
|
|||||||
};
|
};
|
||||||
// title
|
// title
|
||||||
level?: TitleLevel;
|
level?: TitleLevel;
|
||||||
title?: ITitle;
|
title?: {
|
||||||
|
conceptId?: string;
|
||||||
|
deletable?: boolean;
|
||||||
|
};
|
||||||
// list
|
// list
|
||||||
listType?: ListType;
|
listType?: ListType;
|
||||||
listStyle?: ListStyle;
|
listStyle?: ListStyle;
|
||||||
|
|||||||
@@ -154,7 +154,10 @@ interface IElement {
|
|||||||
};
|
};
|
||||||
// 标题
|
// 标题
|
||||||
level?: TitleLevel;
|
level?: TitleLevel;
|
||||||
title?: ITitle;
|
title?: {
|
||||||
|
conceptId?: string;
|
||||||
|
deletable?: boolean;
|
||||||
|
};
|
||||||
// 列表
|
// 列表
|
||||||
listType?: ListType;
|
listType?: ListType;
|
||||||
listStyle?: ListStyle;
|
listStyle?: ListStyle;
|
||||||
|
|||||||
@@ -685,7 +685,11 @@ export class Draw {
|
|||||||
if (!this.control.getActiveControl()) {
|
if (!this.control.getActiveControl()) {
|
||||||
let deleteIndex = endIndex - 1
|
let deleteIndex = endIndex - 1
|
||||||
while (deleteIndex >= start) {
|
while (deleteIndex >= start) {
|
||||||
if (elementList[deleteIndex]?.control?.deletable !== false) {
|
const deleteElement = elementList[deleteIndex]
|
||||||
|
if (
|
||||||
|
deleteElement?.control?.deletable !== false &&
|
||||||
|
deleteElement?.title?.deletable !== false
|
||||||
|
) {
|
||||||
elementList.splice(deleteIndex, 1)
|
elementList.splice(deleteIndex, 1)
|
||||||
}
|
}
|
||||||
deleteIndex--
|
deleteIndex--
|
||||||
|
|||||||
@@ -12,7 +12,11 @@ export interface ITitleSizeOption {
|
|||||||
|
|
||||||
export type ITitleOption = ITitleSizeOption & {}
|
export type ITitleOption = ITitleSizeOption & {}
|
||||||
|
|
||||||
export interface ITitle {
|
export interface ITitleRule {
|
||||||
|
deletable?: boolean
|
||||||
|
}
|
||||||
|
|
||||||
|
export type ITitle = ITitleRule & {
|
||||||
conceptId?: string
|
conceptId?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user