/** * @description table 菜单 panel tab 配置 * @author lichunlin */ import Editor from '../../editor/index' import { PanelConf, PanelTabConf } from '../menu-constructors/Panel' import { getRandom } from '../../utils/util' import $ from '../../utils/dom-core' import '../../assets/style/create-panel-conf.less' import CreateTable from './create-table' /** * 判断一个数值是否为正整数 * @param { number } n 被验证的值 */ function isPositiveInteger(n: number): boolean { //是否为正整数 return n > 0 && Number.isInteger(n) } export default function (editor: Editor): PanelConf { const createTable = new CreateTable(editor) // panel 中需要用到的id const colId = getRandom('w-col-id') const rowId = getRandom('w-row-id') const insertBtnId = getRandom('btn-link') const i18nPrefix = 'menus.panelMenus.table.' const t = (text: string): string => { return editor.i18next.t(text) } // tabs 配置 ----------------------------------------- const tabsConf: PanelTabConf[] = [ { title: t(`${i18nPrefix}插入表格`), tpl: `