Skip to content

Build your own AI office with Univer Office SDK. Bring editing, calculation, collaboration, and file processing into your product for people and AI agents. Built on an extensible open-source core.

xiugai

tonytonychopper123915e097eff3e
diff --git a/examples/univer-sheet-ts/local/index.html b/examples/univer-sheet-ts/local/index.html
index a168e6c434..5a7332fa9e 100644
--- a/examples/univer-sheet-ts/local/index.html
+++ b/examples/univer-sheet-ts/local/index.html
@@ -27,10 +27,7 @@
<body>
<div id="app" style="z-index: 1; position: fixed; font-size: 20px; color: green;"></div>
-<<<<<<< Updated upstream
-=======
<!-- <div id="universheet" style="height: 225px;width: 400px;"></div> -->
->>>>>>> Stashed changes
<div id="universheet" style="height: 100%;"></div>
<script src="./main.js"></script>
diff --git a/examples/univer-sheet-ts/public/index.html b/examples/univer-sheet-ts/public/index.html
index f95cc85769..5a7332fa9e 100644
--- a/examples/univer-sheet-ts/public/index.html
+++ b/examples/univer-sheet-ts/public/index.html
@@ -27,8 +27,8 @@
<body>
<div id="app" style="z-index: 1; position: fixed; font-size: 20px; color: green;"></div>
- <div id="universheet" style="height: 225px;width: 400px;"></div>
- <!-- <div id="universheet" style="height: 100%;"></div> -->
+ <!-- <div id="universheet" style="height: 225px;width: 400px;"></div> -->
+ <div id="universheet" style="height: 100%;"></div>
<script src="./main.js"></script>
</body>
diff --git a/packages/base-docs/src/DocPlugin.tsx b/packages/base-docs/src/DocPlugin.tsx
index 9070443138..d0ce078850 100644
--- a/packages/base-docs/src/DocPlugin.tsx
+++ b/packages/base-docs/src/DocPlugin.tsx
@@ -113,6 +113,18 @@ export class DocPlugin extends Plugin<DocPluginObserve, DocContext> {
onDestroy(): void {}
calculatePagePosition() {
- (this.getCanvasView().getDocsView() as DocsView).getDocs().calculatePagePosition();
+ const DocsView = this.getCanvasView().getDocsView() as DocsView;
+ const { docsLeft, docsTop } = DocsView.getDocs().calculatePagePosition()!;
+
+ const pages = DocsView.getDocumentSkeleton().getSkeletonData().pages;
+ const marginLeft = DocsView.getDocs().pageMarginLeft;
+ const marginTop = DocsView.getDocs().pageMarginTop;
+
+ for (let i = 0; i < pages.length; i++) {
+ for (let k of pages[i].skeDrawings.keys()) {
+ const obj = DocsView.getScene().getObject(k);
+ obj?.translate(obj.left + docsLeft - marginLeft, obj.top + docsTop - marginTop);
+ }
+ }
}
}
diff --git a/packages/base-render/src/Component/Docs/Document.ts b/packages/base-render/src/Component/Docs/Document.ts
index 4ef2318d21..e0f5172304 100644
--- a/packages/base-render/src/Component/Docs/Document.ts
+++ b/packages/base-render/src/Component/Docs/Document.ts
@@ -128,6 +128,12 @@ export class Documents extends DocComponent {
scene.resize(sceneWidth, sceneHeight + 200);
this.translate(docsLeft, docsTop);
+
+ // 为了demo改动,后续删除
+ return {
+ docsLeft,
+ docsTop,
+ };
}
getFirstViewport() {
diff --git a/packages/base-slides/src/View/Render/Adaptors/DocsAdaptor.ts b/packages/base-slides/src/View/Render/Adaptors/DocsAdaptor.ts
index a6c842d060..8f6da6203d 100644
--- a/packages/base-slides/src/View/Render/Adaptors/DocsAdaptor.ts
+++ b/packages/base-slides/src/View/Render/Adaptors/DocsAdaptor.ts
@@ -25,6 +25,7 @@ export enum DOCS_VIEW_KEY {
export class DocsAdaptor extends ObjectAdaptor {
zIndex = 5;
+
viewKey = PageElementType.DOCUMENT;
private _liquid = new Liquid();
@@ -153,8 +154,8 @@ export class DocsAdaptor extends ObjectAdaptor {
url: objectProperties.imageProperties?.contentUrl || '',
left: aLeft + docsLeft + this._liquid.x,
top: aTop + docsTop + this._liquid.y,
- width: width,
- height: height,
+ width,
+ height,
zIndex: 11,
isTransformer: true,
});
diff --git a/packages/base-ui/src/Helpers/Cell.ts b/packages/base-ui/src/Helpers/Cell.ts
index ef7018068a..ed760d1206 100644
--- a/packages/base-ui/src/Helpers/Cell.ts
+++ b/packages/base-ui/src/Helpers/Cell.ts
@@ -1,4 +1,4 @@
-import { BlockType, ICellData, IDocumentData, IElement, IRangeData, IStyleData, ITextDecoration, Tools } from '@univerjs/core';
+import { BlockType, getBorderStyleType, ICellData, IDocumentData, IElement, IRangeData, IStyleData, ITextDecoration, Tools } from '@univerjs/core';
import { pxToPt } from '@univerjs/base-render';
import { textTrim } from '../Utils';
@@ -331,6 +331,65 @@ export function handleStringToStyle($dom: HTMLElement) {
}
}
+ if (key === 'border-color') {
+ if (!styleList.bd) {
+ styleList.bd = {
+ b: {
+ cl: {
+ rgb: value,
+ },
+ s: 0,
+ },
+ t: {
+ cl: {
+ rgb: value,
+ },
+ s: 0,
+ },
+ l: {
+ cl: {
+ rgb: value,
+ },
+ s: 0,
+ },
+ r: {
+ cl: {
+ rgb: value,
+ },
+ s: 0,
+ },
+ };
+ }
+ styleList.bd.b!.cl.rgb = value;
+ styleList.bd.t!.cl.rgb = value;
+ styleList.bd.l!.cl.rgb = value;
+ styleList.bd.r!.cl.rgb = value;
+ }
+
+ if (key === 'border-bottom' || key === 'border-top' || key === 'border-left' || key === 'border-right') {
+ if (!styleList.bd) {
+ styleList.bd = {};
+ }
+ const arr = value.split(' ');
+ const color = arr.splice(0, -1)[0];
+ const type = arr.join();
+ const obj = {
+ cl: {
+ rgb: color,
+ },
+ s: getBorderStyleType(type),
+ };
+ if (key === 'border-bottom') {
+ styleList.bd.b = obj;
+ } else if (key === 'border-top') {
+ styleList.bd.t = obj;
+ } else if (key === 'border-left') {
+ styleList.bd.l = obj;
+ } else if (key === 'border-right') {
+ styleList.bd.r = obj;
+ }
+ }
+
// if (style.tb === WrapStrategy.CLIP) {
// str += `text-overflow: clip; `;
// } else if (style.tb === WrapStrategy.OVERFLOW) {
diff --git a/packages/common-plugin-data/src/Docs/DEFAULT_DOCUMENT_DATA_EN.ts b/packages/common-plugin-data/src/Docs/DEFAULT_DOCUMENT_DATA_EN.ts
index 1a579b0fff..ce7a2f226f 100644
--- a/packages/common-plugin-data/src/Docs/DEFAULT_DOCUMENT_DATA_EN.ts
+++ b/packages/common-plugin-data/src/Docs/DEFAULT_DOCUMENT_DATA_EN.ts
@@ -33,9 +33,9 @@ export const DEFAULT_DOCUMENT_DATA_EN: IDocumentData = {
posOffset: 510,
},
angle: 0,
- // imageProperties: {
- // contentUrl: 'https://gcore.jsdelivr.net/gh/dream-num/static@main/univer/slide/gartner-tech-2022.png',
- // },
+ imageProperties: {
+ contentUrl: 'https://gcore.jsdelivr.net/gh/dream-num/static@main/univer/slide/gartner-tech-2022.png',
+ },
},
layoutType: PositionedObjectLayoutType.WRAP_SQUARE,
behindDoc: BooleanNumber.FALSE,
@@ -59,9 +59,9 @@ export const DEFAULT_DOCUMENT_DATA_EN: IDocumentData = {
posOffset: 200,
},
angle: 0,
- // imageProperties: {
- // contentUrl: 'https://gcore.jsdelivr.net/gh/dream-num/static@main/univer/slide/hype-cycle-for-emerging-tech-2022.png',
- // },
+ imageProperties: {
+ contentUrl: 'https://gcore.jsdelivr.net/gh/dream-num/static@main/univer/slide/hype-cycle-for-emerging-tech-2022.png',
+ },
},
layoutType: PositionedObjectLayoutType.WRAP_SQUARE,
behindDoc: BooleanNumber.FALSE,
diff --git a/packages/core/src/Shared/Common.ts b/packages/core/src/Shared/Common.ts
index a263dbdaf6..528b9ff194 100644
--- a/packages/core/src/Shared/Common.ts
+++ b/packages/core/src/Shared/Common.ts
@@ -464,3 +464,27 @@ function getBorderStyle(type: BorderStyleTypes) {
}
return str;
}
+
+export function getBorderStyleType(type: string) {
+ let str = 0;
+ if (type === 'none') {
+ str = BorderStyleTypes.NONE;
+ } else if (type === '0.5pt solid') {
+ str = BorderStyleTypes.THIN;
+ } else if (type === '0.5pt double') {
+ str = BorderStyleTypes.HAIR;
+ } else if (type === '0.5pt dotted') {
+ str = BorderStyleTypes.DOTTED;
+ } else if (type === '0.5pt dashed') {
+ str = BorderStyleTypes.DASHED;
+ } else if (type === '1pt solid') {
+ str = BorderStyleTypes.MEDIUM;
+ } else if (type === '1pt dashed') {
+ str = BorderStyleTypes.MEDIUM_DASHED;
+ } else if (type === '1pt dotted') {
+ str = BorderStyleTypes.MEDIUM_DASH_DOT_DOT;
+ } else if (type === '1.5pt solid') {
+ str = BorderStyleTypes.THICK;
+ }
+ return str;
+}
diff --git a/packages/sheets-plugin-clipboard/src/Domain/Copy.ts b/packages/sheets-plugin-clipboard/src/Domain/Copy.ts
index 76241aa69b..8e83fafff2 100644
--- a/packages/sheets-plugin-clipboard/src/Domain/Copy.ts
+++ b/packages/sheets-plugin-clipboard/src/Domain/Copy.ts
@@ -55,7 +55,7 @@ export class UniverCopy extends Copy {
constructor(context: SheetContext) {
const copyList = [
{
- locale: ['rightClick.copy'],
+ locale: 'rightClick.copy',
onClick: () => this.copyTo(),
},
{
diff --git a/packages/sheets-plugin-clipboard/src/Domain/Paste.ts b/packages/sheets-plugin-clipboard/src/Domain/Paste.ts
index 87069b936b..5562d36510 100644
--- a/packages/sheets-plugin-clipboard/src/Domain/Paste.ts
+++ b/packages/sheets-plugin-clipboard/src/Domain/Paste.ts
@@ -1,7 +1,8 @@
import { SelectionControl } from '@univerjs/base-sheets/src/Controller/Selection/SelectionController';
import { SheetContext, PLUGIN_NAMES } from '@univerjs/core';
-import { RightMenuProps, SelectionModel, SheetPlugin } from '@univerjs/base-sheets';
+import { SelectionModel, SheetPlugin } from '@univerjs/base-sheets';
import { handleTableMergeData } from '@univerjs/base-ui';
+import { RightMenuProps } from '@univerjs/ui-plugin-sheets';
export interface PasteType {
type: string;
@@ -13,16 +14,6 @@ export abstract class Paste {
constructor(context: SheetContext, pasteList: RightMenuProps[]) {
this._context = context;
- const SheetPlugin = this._context.getPluginManager().getRequirePluginByName<SheetPlugin>(PLUGIN_NAMES.SPREADSHEET);
- // SheetPlugin.addRightMenu(pasteList);
-
- // SheetPlugin.getCellEditorController().isEditMode
- // const manager = this._context.getObserverManager();
- // manager.requiredObserver<ClipboardEvent>('onSpreadsheetKeyPasteObservable', PLUGIN_NAMES.SPREADSHEET).add((e) => {
- // this.paste(e);
- // });
-
- // TODO 注册机制 Paste, PasteManager.handle() 匹配 WpsPaste/GooglePaste/OfficePaste
}
getContext() {
@@ -36,7 +27,7 @@ export class UniverPaste extends Paste {
constructor(context: SheetContext) {
const pasteList = [
{
- locale: ['rightClick.paste'],
+ label: 'rightClick.paste',
onClick: () => {
// this.pasteTo();
},
@@ -45,130 +36,7 @@ export class UniverPaste extends Paste {
super(context, pasteList);
}
- // async pasteResolver(e?: ClipboardEvent) {
- // const file: Array<PasteType | null> | null = await Clipboard.read(e);
- // if (!file) return [];
- // const HtmlIndex = file.findIndex((item: PasteType | null, index: number) => item && item.type === 'text/html');
- // const PlainIndex = file.findIndex((item: PasteType | null, index: number) => item && item.type === 'text/plain');
- // // let data: any[] = [];
- // // const content = document.createElement('DIV');
-
- // if (HtmlIndex > -1) {
- // const html = file[HtmlIndex]?.result as string;
-
- // // content.innerHTML = html;
- // // data = new Array(content.querySelectorAll('table tr').length);
- // // if (!data.length) return [];
- // // let colLen = 0;
- // // const trs = content.querySelectorAll('table tr');
- // // const firstTds = trs[0].querySelectorAll('td');
- // // firstTds.forEach((item: HTMLTableCellElement) => {
- // // let colSpan = 0;
- // // const attr = item.getAttribute('colSpan');
- // // if (attr !== null) {
- // // colSpan = +attr;
- // // } else {
- // // colSpan = 1;
- // // }
- // // colLen += colSpan;
- // // });
- // // for (let i = 0; i < data.length; i++) {
- // // data[i] = new Array(colLen);
- // // }
- // // let r = 0;
- // // trs.forEach((item: any) => {
- // // let c = 0;
- // // item.querySelectorAll('td').forEach((td: HTMLTableCellElement) => {
- // // let cell: ICellData = {};
- // // if (td.querySelectorAll('span').length || td.querySelectorAll('font').length) {
- // // const spanStyle = handleDomToJson(td);
- // // if (typeof spanStyle !== 'string') {
- // // cell.p = spanStyle;
- // // }
- // // }
- // // let txt = td.innerText;
- // // if (txt.trim().length === 0) {
- // // cell.v = null;
- // // cell.m = null;
- // // } else {
- // // // Todo,处理格式
- // // cell.v = txt;
- // // cell.m = txt;
- // // }
- // // const style = handleStringToStyle(td);
- // // if (Tools.isPlainObject(style)) {
- // // cell.s = style;
- // // }
- // // while (c < colLen && data[r][c] != null) {
- // // c++;
- // // }
- // // if (c === colLen) {
- // // return;
- // // }
- // // if (data[r][c] == null) {
- // // data[r][c] = cell;
- // // let rowSpan = Number(td.getAttribute('rowSpan'));
- // // let colSpan = Number(td.getAttribute('colSpan'));
- // // if (Number.isNaN(rowSpan)) {
- // // rowSpan = 1;
- // // }
- // // if (Number.isNaN(colSpan)) {
- // // colSpan = 1;
- // // }
- // // if (rowSpan > 1 || colSpan > 1) {
- // // let first = { rs: rowSpan - 1, cs: colSpan - 1, r, c };
- // // data[r][c].mc = first;
- // // for (let rp = 0; rp < rowSpan; rp++) {
- // // for (let cp = 0; cp < colSpan; cp++) {
- // // if (rp === 0 && cp === 0) {
- // // continue;
- // // }
- // // data[r + rp][c + cp] = { mc: null };
- // // }
- // // }
- // // }
- // // }
- // // c++;
- // // });
- // // r++;
- // // });
-
- // return handelTableToJson(html);
- // }
- // if (PlainIndex > -1) {
- // const html = file[PlainIndex]?.result as string;
-
- // // content.innerHTML = html;
- // // let dataChe = html.replace(/\r/g, '');
- // // let che = dataChe.split('\n');
- // // let colCheLen = che[0].split('\t').length;
- // // for (let i = 0; i < che.length; i++) {
- // // if (che[i].split('\t').length < colCheLen) {
- // // continue;
- // // }
- // // data.push(che[i].split('\t'));
- // // }
- // // for (let i = 0; i < data.length; i++) {
- // // for (let j = 0; j < data[i].length; j++) {
- // // if (data[i][j].length) {
- // // data[i][j] = {
- // // v: data[i][j],
- // // m: data[i][j],
- // // };
- // // } else {
- // // data[i][j] = null;
- // // }
- // // }
- // // }
-
- // return handlePlainToJson(html);
- // }
-
- // // return data;
- // }
-
- pasteTo(data) {
- debugger
+ pasteTo(data: any) {
// const data = await this.pasteResolver(e);
// if (data.length === 0) return;
@@ -200,41 +68,6 @@ export class UniverPaste extends Paste {
const selection = selections[0];
- // let copyH = data.length;
- // let copyC = data[0].length;
-
- // let minH = selection.startRow; //应用范围首尾行
- // let maxH = minH + copyH - 1;
- // let minC = selection.startColumn; //应用范围首尾列
- // let maxC = minC + copyC - 1;
-
- // const isMerge = sheet.getMerges().getByRowColumn(minH, maxH, minC, maxC);
- // if (isMerge) {
- // return;
- // }
-
- // // Todo: 若应用范围超过最大行或最大列,增加行列
- // for (let i = 0; i < data.length; i++) {
- // for (let j = 0; j < data[i].length; j++) {
- // if (data[i][j] && typeof data[i][j] === 'object' && 'mc' in data[i][j]) {
- // if (data[i][j].mc) {
- // const mc = data[i][j].mc;
- // const startRow = mc.r + minH;
- // const endRow = startRow + mc.rs;
- // const startColumn = mc.c + minC;
- // const endColumn = startColumn + mc.cs;
-
- // sheet.getMerges().add({ startRow, endRow, startColumn, endColumn });
- // delete data[i][j].mc;
- // } else {
- // data[i][j] = null;
- // }
- // }
- // }
- // }
-
- // sheet.getRange(minH, minC, maxH, maxC).setRangeDatas(data);
-
let copyH = data.length;
let copyC = data[0].length;
diff --git a/test.html b/test.html
index 161d822c5b..79bad1d15f 100644
--- a/test.html
+++ b/test.html
@@ -9,18 +9,161 @@
</head>
<body>
+ <table data-type="universheet_copy_action_table">
+ <colgroup width="72px"></colgroup>
+ <colgroup width="72px"></colgroup>
+ <colgroup width="72px"></colgroup>
+ <colgroup width="72px"></colgroup>
+ <colgroup width="72px"></colgroup>
+ <colgroup width="72px"></colgroup>
+ <colgroup width="72px"></colgroup>
+ <tr>
+ <td rowSpan="1" colSpan="7"
+ style="height:19px;width:72px;vertical-align: middle; text-align: center; border-bottom: 0.5pt solid #000; border-top: 0.5pt solid #000; border-right: 0.5pt solid #000; border-left: 0.5pt solid #000; background: rgba(177,166,223); ">
+ 一月</td>
+ </tr>
+ <tr>
+ <td
+ style="height:19px;width:72px;border-bottom: 0.5pt solid #000; border-right: 0.5pt solid #000; border-left: 0.5pt solid #000; text-align: center; vertical-align: middle; background: rgba(177,166,223); ">
+ 日</td>
+ <td
+ style="height:19px;width:72px;text-align: center; vertical-align: middle; border-bottom: 0.5pt solid #000; border-right: 0.5pt solid #000; background: rgba(177,166,223); ">
+ 一</td>
+ <td
+ style="height:19px;width:72px;text-align: center; vertical-align: middle; border-bottom: 0.5pt solid #000; border-right: 0.5pt solid #000; background: rgba(177,166,223); ">
+ 二</td>
+ <td
+ style="height:19px;width:72px;text-align: center; vertical-align: middle; border-bottom: 0.5pt solid #000; border-right: 0.5pt solid #000; background: rgba(177,166,223); ">
+ 三</td>
+ <td
+ style="height:19px;width:72px;text-align: center; vertical-align: middle; border-bottom: 0.5pt solid #000; border-right: 0.5pt solid #000; background: rgba(177,166,223); ">
+ 四</td>
+ <td
+ style="height:19px;width:72px;text-align: center; vertical-align: middle; border-bottom: 0.5pt solid #000; border-right: 0.5pt solid #000; background: rgba(177,166,223); ">
+ 五</td>
+ <td
+ style="height:19px;width:72px;text-align: center; vertical-align: middle; border-bottom: 0.5pt solid #000; border-right: 0.5pt solid #000; background: rgba(177,166,223); ">
+ 六</td>
+ </tr>
+ <tr>
+ <td
+ style="height:19px;width:72px;border-bottom: 0.5pt solid #000; border-right: 0.5pt solid #000; border-left: 0.5pt solid #000; text-align: center; vertical-align: middle; color: #ccc; ">
+ 27</td>
+ <td
+ style="height:19px;width:72px;text-align: center; vertical-align: middle; border-bottom: 0.5pt solid #000; border-right: 0.5pt solid #000; color: #ccc; ">
+ 28</td>
+ <td
+ style="height:19px;width:72px;text-align: center; vertical-align: middle; border-bottom: 0.5pt solid #000; border-right: 0.5pt solid #000; color: #ccc; ">
+ 29</td>
+ <td
+ style="height:19px;width:72px;text-align: center; vertical-align: middle; border-bottom: 0.5pt solid #000; border-right: 0.5pt solid #000; color: #ccc; ">
+ 30</td>
+ <td
+ style="height:19px;width:72px;text-align: center; vertical-align: middle; border-bottom: 0.5pt solid #000; border-right: 0.5pt solid #000; color: #ccc; ">
+ 31</td>
+ <td
+ style="height:19px;width:72px;text-align: center; vertical-align: middle; border-bottom: 0.5pt solid #000; border-right: 0.5pt solid #000; ">
+ 1</td>
+ <td
+ style="height:19px;width:72px;text-align: center; vertical-align: middle; border-bottom: 0.5pt solid #000; border-right: 0.5pt solid #000; ">
+ 2</td>
+ </tr>
+ <tr>
+ <td
+ style="height:19px;width:72px;border-bottom: 0.5pt solid #000; border-right: 0.5pt solid #000; border-left: 0.5pt solid #000; text-align: center; vertical-align: middle; ">
+ 3</td>
+ <td
+ style="height:19px;width:72px;text-align: center; vertical-align: middle; border-bottom: 0.5pt solid #000; border-right: 0.5pt solid #000; ">
+ 4</td>
+ <td
+ style="height:19px;width:72px;text-align: center; vertical-align: middle; border-bottom: 0.5pt solid #000; border-right: 0.5pt solid #000; ">
+ 5</td>
+ <td
+ style="height:19px;width:72px;text-align: center; vertical-align: middle; border-bottom: 0.5pt solid #000; border-right: 0.5pt solid #000; ">
+ 6</td>
+ <td
+ style="height:19px;width:72px;text-align: center; vertical-align: middle; border-bottom: 0.5pt solid #000; border-right: 0.5pt solid #000; ">
+ 7</td>
+ <td
+ style="height:19px;width:72px;text-align: center; vertical-align: middle; border-bottom: 0.5pt solid #000; border-right: 0.5pt solid #000; ">
+ 8</td>
+ <td
+ style="height:19px;width:72px;text-align: center; vertical-align: middle; border-bottom: 0.5pt solid #000; border-right: 0.5pt solid #000; ">
+ 9</td>
+ </tr>
+ <tr>
+ <td
+ style="height:19px;width:72px;border-bottom: 0.5pt solid #000; border-right: 0.5pt solid #000; border-left: 0.5pt solid #000; text-align: center; vertical-align: middle; ">
+ 10</td>
+ <td
+ style="height:19px;width:72px;text-align: center; vertical-align: middle; border-bottom: 0.5pt solid #000; border-right: 0.5pt solid #000; ">
+ 11</td>
+ <td
+ style="height:19px;width:72px;text-align: center; vertical-align: middle; border-bottom: 0.5pt solid #000; border-right: 0.5pt solid #000; ">
+ 12</td>
+ <td
+ style="height:19px;width:72px;text-align: center; vertical-align: middle; border-bottom: 0.5pt solid #000; border-right: 0.5pt solid #000; ">
+ 13</td>
+ <td
+ style="height:19px;width:72px;text-align: center; vertical-align: middle; border-bottom: 0.5pt solid #000; border-right: 0.5pt solid #000; ">
+ 14</td>
+ <td
+ style="height:19px;width:72px;text-align: center; vertical-align: middle; border-bottom: 0.5pt solid #000; border-right: 0.5pt solid #000; ">
+ 15</td>
+ <td
+ style="height:19px;width:72px;text-align: center; vertical-align: middle; border-bottom: 0.5pt solid #000; border-right: 0.5pt solid #000; ">
+ 16</td>
+ </tr>
+ <tr>
+ <td
+ style="height:19px;width:72px;border-bottom: 0.5pt solid #000; border-right: 0.5pt solid #000; border-left: 0.5pt solid #000; text-align: center; vertical-align: middle; ">
+ 17</td>
+ <td
+ style="height:19px;width:72px;text-align: center; vertical-align: middle; border-bottom: 0.5pt solid #000; border-right: 0.5pt solid #000; ">
+ 18</td>
+ <td
+ style="height:19px;width:72px;text-align: center; vertical-align: middle; border-bottom: 0.5pt solid #000; border-right: 0.5pt solid #000; ">
+ 19</td>
+ <td
+ style="height:19px;width:72px;text-align: center; vertical-align: middle; border-bottom: 0.5pt solid #000; border-right: 0.5pt solid #000; ">
+ 20</td>
+ <td
+ style="height:19px;width:72px;text-align: center; vertical-align: middle; border-bottom: 0.5pt solid #000; border-right: 0.5pt solid #000; ">
+ 21</td>
+ <td
+ style="height:19px;width:72px;text-align: center; vertical-align: middle; border-bottom: 0.5pt solid #000; border-right: 0.5pt solid #000; ">
+ 22</td>
+ <td
+ style="height:19px;width:72px;text-align: center; vertical-align: middle; border-bottom: 0.5pt solid #000; border-right: 0.5pt solid #000; ">
+ 23</td>
+ </tr>
+ <tr>
+ <td
+ style="height:19px;width:72px;border-bottom: 0.5pt solid #000; border-right: 0.5pt solid #000; border-left: 0.5pt solid #000; text-align: center; vertical-align: middle; ">
+ 24</td>
+ <td
+ style="height:19px;width:72px;text-align: center; vertical-align: middle; border-bottom: 0.5pt solid #000; border-right: 0.5pt solid #000; ">
+ 25</td>
+ <td
+ style="height:19px;width:72px;text-align: center; vertical-align: middle; border-bottom: 0.5pt solid #000; border-right: 0.5pt solid #000; ">
+ 26</td>
+ <td
+ style="height:19px;width:72px;text-align: center; vertical-align: middle; border-bottom: 0.5pt solid #000; border-right: 0.5pt solid #000; ">
+ 27</td>
+ <td
+ style="height:19px;width:72px;text-align: center; vertical-align: middle; border-bottom: 0.5pt solid #000; border-right: 0.5pt solid #000; ">
+ 28</td>
+ <td
+ style="height:19px;width:72px;text-align: center; vertical-align: middle; border-bottom: 0.5pt solid #000; border-right: 0.5pt solid #000; ">
+ 29</td>
+ <td
+ style="height:19px;width:72px;text-align: center; vertical-align: middle; border-bottom: 0.5pt solid #000; border-right: 0.5pt solid #000; ">
+ 30</td>
+ </tr>
+ </table>
</body>
<script>
- // let reg = new RegExp('1', 'ig')
- let reg = /1/gi
- let arr = ['11', '15', '13', '5', '6', '15']
- arr.forEach(a => {
-
- // console.dir(reg.test(a))
- // reg.lastIndex = 0
- console.dir(reg.test(a))
- })
</script>
</html>
\ No newline at end of file