cloud-web-corejs 1.0.54-dev.551 → 1.0.54-dev.552

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,57 @@
1
+ // 测试边框处理功能的修复
2
+ import { generateExcelBlob } from './export.js'
3
+
4
+ // 模拟测试数据
5
+ const testData = [{
6
+ name: '测试工作表',
7
+ data: [
8
+ [{ v: 'A1', bl: 1 }, { v: 'B1' }],
9
+ [{ v: 'A2' }, { v: 'B2' }]
10
+ ],
11
+ config: {
12
+ borderInfo: [
13
+ {
14
+ rangeType: 'cell',
15
+ value: {
16
+ col_index: 0,
17
+ row_index: 0,
18
+ t: { color: '#ff0000', style: 1 }
19
+ }
20
+ },
21
+ // 测试无效边框数据
22
+ {
23
+ rangeType: 'cell',
24
+ value: {
25
+ col_index: 1,
26
+ row_index: 0
27
+ // 缺少边框定义
28
+ }
29
+ },
30
+ // 测试undefined边框数据
31
+ {
32
+ rangeType: 'cell',
33
+ value: {
34
+ col_index: 0,
35
+ row_index: 1,
36
+ t: undefined
37
+ }
38
+ }
39
+ ]
40
+ }
41
+ }]
42
+
43
+ // 测试函数
44
+ export async function testBorderHandling() {
45
+ try {
46
+ console.log('开始测试边框处理...')
47
+ const blob = await generateExcelBlob(testData, 'border-test')
48
+ console.log('测试成功!生成的Blob大小:', blob.size)
49
+ return true
50
+ } catch (error) {
51
+ console.error('测试失败:', error)
52
+ return false
53
+ }
54
+ }
55
+
56
+ // 导出测试函数
57
+ export default { testBorderHandling }