mirror of
https://gitee.com/baidu/amis.git
synced 2024-12-02 03:58:07 +08:00
4b8dd7a9ca
* feat: Office viewer 支持 Excel * 修复类型报错 * 修复类型报错
40 lines
1.2 KiB
TypeScript
40 lines
1.2 KiB
TypeScript
/**
|
|
* 本地测试例子
|
|
*/
|
|
import {HitTestResult} from '../src/excel/render/selection/hitTest';
|
|
import {App} from './common';
|
|
import fileLists from './excelFileList';
|
|
|
|
const viewerElement = document.getElementById('viewer') as HTMLElement;
|
|
|
|
const testDir = '/__tests__/xlsx';
|
|
|
|
const data = {};
|
|
|
|
const renderOptions = {
|
|
height: 700,
|
|
debug: true,
|
|
editable: true,
|
|
fontURL: {
|
|
等线: '/examples/static/font/DengXian.ttf',
|
|
仿宋: '/examples/static/font/STFANGSO.TTF',
|
|
黑体: '/examples/static/font/simhei.ttf'
|
|
},
|
|
data,
|
|
mousePositionTracker: (
|
|
x: number,
|
|
y: number,
|
|
hitTestResult: HitTestResult | null
|
|
) => {
|
|
document.getElementById('mousePosition')!.innerText = `x${x}, y${y}`;
|
|
if (hitTestResult) {
|
|
document.getElementById(
|
|
'hitTestResult'
|
|
)!.innerHTML = `${hitTestResult.type}<br/>row: ${hitTestResult.startRow}<br/>col: ${hitTestResult.startCol}<br/>endRow: ${hitTestResult.endRow}<br/>endCol: ${hitTestResult.endCol}<br/>r: ${hitTestResult.region}<br/>width: ${hitTestResult.width}<br/>height: ${hitTestResult.height}`;
|
|
}
|
|
},
|
|
enableVar: true
|
|
};
|
|
|
|
new App(testDir, fileLists, viewerElement, renderOptions);
|