diff --git a/docs/en/guide/schema.md b/docs/en/guide/schema.md index 1dceb011..f60d712a 100644 --- a/docs/en/guide/schema.md +++ b/docs/en/guide/schema.md @@ -77,6 +77,7 @@ interface IElement { }[]; borderType?: TableBorder; borderColor?: string; + tableToolDisabled?: boolean; // Hyperlinks url?: string; // Superscript and subscript diff --git a/docs/guide/schema.md b/docs/guide/schema.md index 338f032a..1babe1e6 100644 --- a/docs/guide/schema.md +++ b/docs/guide/schema.md @@ -77,6 +77,7 @@ interface IElement { }[]; borderType?: TableBorder; borderColor?: string; + tableToolDisabled?: boolean; // 超链接 url?: string; // 上下标 diff --git a/src/editor/core/draw/particle/table/TableTool.ts b/src/editor/core/draw/particle/table/TableTool.ts index aa74279c..0a13b967 100644 --- a/src/editor/core/draw/particle/table/TableTool.ts +++ b/src/editor/core/draw/particle/table/TableTool.ts @@ -87,11 +87,13 @@ export class TableTool { if (!isTable) return // 销毁之前工具 this.dispose() - // 渲染所需数据 - const { scale } = this.options const elementList = this.draw.getOriginalElementList() const positionList = this.position.getOriginalPositionList() const element = elementList[index!] + // 表格工具配置禁用又非设计模式时不渲染 + if (element.tableToolDisabled && !this.draw.isDesignMode()) return + // 渲染所需数据 + const { scale } = this.options const position = positionList[index!] const { colgroup, trList } = element const { diff --git a/src/editor/interface/Element.ts b/src/editor/interface/Element.ts index ba1d89d4..cf6b8df6 100644 --- a/src/editor/interface/Element.ts +++ b/src/editor/interface/Element.ts @@ -66,6 +66,10 @@ export interface ITableAttr { borderColor?: string } +export interface ITableRule { + tableToolDisabled?: boolean +} + export interface ITableElement { tdId?: string trId?: string @@ -75,7 +79,7 @@ export interface ITableElement { pagingIndex?: number // 拆分的表格索引 } -export type ITable = ITableAttr & ITableElement +export type ITable = ITableAttr & ITableRule & ITableElement export interface IHyperlinkElement { valueList?: IElement[]