@ticatec/batch-data-uploader 0.0.3 → 0.0.9

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.
@@ -13,9 +13,14 @@ declare const langRes: {
13
13
  upload: string;
14
14
  save: string;
15
15
  open: string;
16
+ confirm: string;
16
17
  };
17
18
  errorTitle: string;
18
19
  sheetName: string;
20
+ labelStatus: string;
21
+ labelValid: string;
22
+ textValid: string;
23
+ textInvalid: string;
19
24
  };
20
25
  };
21
26
  export default langRes;
@@ -1,21 +1,26 @@
1
1
  const langRes = {
2
2
  batchUploading: {
3
3
  status: {
4
- pending: 'To upload',
4
+ pending: "To upload",
5
5
  uploading: "Uploading...",
6
- successful: 'Success',
7
- fail: 'Failure'
6
+ successful: "Success",
7
+ fail: "Failure"
8
8
  },
9
- parsing: 'Parsing file...',
10
- parseFailure: 'Cannot parse file: {{name}}',
11
- waitUploading: 'Cannot exit on uploading!',
9
+ parsing: "Parsing file...",
10
+ parseFailure: "Cannot parse file: {{name}}",
11
+ waitUploading: "Cannot exit during uploading!",
12
12
  button: {
13
- upload: 'Upload',
14
- save: 'Error data',
15
- open: 'File'
13
+ upload: "Upload",
14
+ save: "Save error data",
15
+ open: "Open",
16
+ confirm: "Confirm"
16
17
  },
17
- errorTitle: 'Error',
18
- sheetName: 'Abnormal data'
18
+ errorTitle: "Error",
19
+ sheetName: "Abnormal data",
20
+ labelStatus: "Status",
21
+ labelValid: "Validity",
22
+ textValid: "Yes",
23
+ textInvalid: "No"
19
24
  }
20
25
  };
21
26
  export default langRes;
@@ -17,6 +17,14 @@ declare const i18nKeys: {
17
17
  text: string;
18
18
  };
19
19
  };
20
+ labelValid: {
21
+ key: string;
22
+ text: string;
23
+ };
24
+ labelStatus: {
25
+ key: string;
26
+ text: string;
27
+ };
20
28
  parsing: {
21
29
  key: string;
22
30
  text: string;
@@ -42,6 +50,10 @@ declare const i18nKeys: {
42
50
  key: string;
43
51
  text: string;
44
52
  };
53
+ confirm: {
54
+ key: string;
55
+ text: string;
56
+ };
45
57
  };
46
58
  errorTitle: {
47
59
  key: string;
@@ -51,5 +63,13 @@ declare const i18nKeys: {
51
63
  key: string;
52
64
  text: string;
53
65
  };
66
+ textValid: {
67
+ key: string;
68
+ text: string;
69
+ };
70
+ textInvalid: {
71
+ key: string;
72
+ text: string;
73
+ };
54
74
  };
55
75
  export default i18nKeys;
@@ -18,6 +18,14 @@ const i18nKeys = {
18
18
  text: langRes.batchUploading.status.fail
19
19
  }
20
20
  },
21
+ labelValid: {
22
+ key: 'batchUploading.labelValid',
23
+ text: langRes.batchUploading.labelValid
24
+ },
25
+ labelStatus: {
26
+ key: 'batchUploading.labelStatus',
27
+ text: langRes.batchUploading.labelStatus
28
+ },
21
29
  parsing: {
22
30
  key: 'batchUploading.parsing',
23
31
  text: langRes.batchUploading.parsing
@@ -42,6 +50,10 @@ const i18nKeys = {
42
50
  open: {
43
51
  key: 'batchUploading.button.open',
44
52
  text: langRes.batchUploading.button.open
53
+ },
54
+ confirm: {
55
+ key: 'batchUploading.button.confirm',
56
+ text: langRes.batchUploading.button.confirm
45
57
  }
46
58
  },
47
59
  errorTitle: {
@@ -51,6 +63,14 @@ const i18nKeys = {
51
63
  sheetName: {
52
64
  key: 'batchUploading.sheetName',
53
65
  text: langRes.batchUploading.sheetName
66
+ },
67
+ textValid: {
68
+ key: 'batchUploading.textValid',
69
+ text: langRes.batchUploading.textValid
70
+ },
71
+ textInvalid: {
72
+ key: 'batchUploading.textInvalid',
73
+ text: langRes.batchUploading.textInvalid
54
74
  }
55
75
  };
56
76
  export default i18nKeys;
@@ -0,0 +1,156 @@
1
+ # BaseEncodingTemplate Class
2
+
3
+ An abstract base class for parsing Excel files, encoding data, and performing validation, extending `BaseTemplate`, with support for data validity checks and column expansion.
4
+
5
+ ## [BaseTemplate](./BaseTemplate.md)
6
+
7
+ ## Overview
8
+
9
+ The `BaseEncodingTemplate` class extends `BaseTemplate`, adding data validity verification and encoding functionality. It supports parsing Excel files, validating the legitimacy of each row of data, and implementing custom data encoding logic through subclasses. The class adds a column to display data validity (showing "Valid" or "Invalid" status).
10
+
11
+ ## Usage
12
+
13
+ To use `BaseEncodingTemplate`, you must extend the class and implement the `isRowValid`, `encodeData` methods, and the `valid` property. Below is an example:
14
+
15
+ ```typescript
16
+ import BaseEncodingTemplate from './BaseEncodingTemplate';
17
+ import type { DataColumn } from './DataColumn';
18
+
19
+ const columns: DataColumn[] = [
20
+ {
21
+ field: 'user.name',
22
+ text: 'Name',
23
+ width: 150,
24
+ parser: (value) => String(value).trim()
25
+ },
26
+ {
27
+ field: 'user.age',
28
+ text: 'Age',
29
+ width: 100,
30
+ parser: (value) => Number(value) || 0
31
+ }
32
+ ];
33
+
34
+ class MyEncodingTemplate extends BaseEncodingTemplate {
35
+ constructor() {
36
+ super(columns, rowOffset);
37
+ }
38
+
39
+ protected isRowValid(row: any): boolean {
40
+ return row.id != null;
41
+ }
42
+
43
+ protected async encodeData(rows: Array<any>): Promise<Array<any>> {
44
+ // Implement data encoding logic, e.g., calling an API and replacing or merging with local data
45
+ return rows.map(item => ({ ...item, encoded: true }));
46
+ }
47
+
48
+ get valid(): boolean {
49
+ // Check if the entire dataset is valid
50
+ return this._list.filter(item => item.id == null).length > 0;
51
+ }
52
+ }
53
+ ```
54
+
55
+ ### Parsing Excel Files
56
+
57
+ ```typescript
58
+ const file: File = // ... Obtain the file (e.g., from an input element)
59
+ const template = new MyEncodingTemplate();
60
+ await template.parseExcelFile(file); // Parse and encode data
61
+ console.log(template.list); // Access processed data
62
+ console.log(template.valid); // Check data validity
63
+ ```
64
+
65
+ ## Class Details
66
+
67
+ ### Constructor
68
+
69
+ ```typescript
70
+ protected constructor(columns: Array<DataColumn>, rowOffset: number = 1)
71
+ ```
72
+
73
+ - **Parameters**:
74
+ - `columns`: An array of `DataColumn` objects defining the data structure (field names, display text, and optional parsers).
75
+ - `rowOffset`: The number of starting rows to skip in the Excel sheet (default: 1, e.g., to skip the header row).
76
+ - **Description**: Initializes the template, setting column definitions and row offset.
77
+
78
+ ### Methods
79
+
80
+ #### `isRowValid` (Abstract Method)
81
+
82
+ ```typescript
83
+ protected abstract isRowValid(row: any): boolean
84
+ ```
85
+
86
+ - **Parameters**:
87
+ - `row`: A single row data object.
88
+ - **Description**: Subclasses must implement this method to validate the legitimacy of a single row of data, returning `true` for valid and `false` for invalid.
89
+ - **Override**: Subclasses must implement specific validation logic.
90
+
91
+ #### `encodeData` (Abstract Method)
92
+
93
+ ```typescript
94
+ protected abstract encodeData(rows: Array<any>): Promise<Array<any>>
95
+ ```
96
+
97
+ - **Parameters**:
98
+ - `rows`: An array of data to be encoded.
99
+ - **Description**: Subclasses must implement this method to define data encoding logic (e.g., calling a server API for data processing). Returns the encoded data array.
100
+ - **Override**: Subclasses must implement specific encoding logic.
101
+
102
+ #### `valid` (Abstract Getter)
103
+
104
+ ```typescript
105
+ abstract get valid(): boolean
106
+ ```
107
+
108
+ - **Returns**: A boolean indicating whether the entire dataset is valid.
109
+ - **Description**: Subclasses must implement this getter to check the validity of all data.
110
+ - **Override**: Subclasses must implement specific logic.
111
+
112
+ #### `consolidateData`
113
+
114
+ ```typescript
115
+ protected async consolidateData(rows: Array<any>): Promise<Array<any>>
116
+ ```
117
+
118
+ - **Parameters**:
119
+ - `rows`: An array of raw row objects parsed from the Excel file.
120
+ - **Description**: Overrides the `BaseTemplate` method, calling `encodeData` to encode data and merge the encoded results with the original rows.
121
+ - **Logic**: Iterates through each row, merging encoded results with the original data.
122
+
123
+ #### `columns` (Getter)
124
+
125
+ ```typescript
126
+ get columns(): Array<TableColumn>
127
+ ```
128
+
129
+ - **Returns**: An array of `TableColumn` objects representing column definitions, including data columns and a match status column.
130
+ - **Description**: Extends `BaseTemplate`'s `columns`, adding a match status column (`validColumn`) to display the validity of each row ("Valid" or "Invalid").
131
+
132
+ ### Match Status Column
133
+
134
+ Defines an additional `validColumn` to display the validity of each row:
135
+
136
+ ```typescript
137
+ private validColumn: TableColumn = {
138
+ text: getI18nText(i18nKeys.labelMatch),
139
+ width: 90,
140
+ align: 'center',
141
+ escapeHTML: true,
142
+ formatter: row => this.isRowValid(row) ? ValidData : InvalidData
143
+ }
144
+ ```
145
+
146
+ - **Display**:
147
+ - `ValidData`: `<span style="color: #76FF03">Valid</span>` (green text).
148
+ - `InvalidData`: `<span style="color: #ff3e00">Invalid</span>` (red text).
149
+ - **Internationalization**: Uses `getI18nText` to retrieve column titles and status text.
150
+
151
+ ## Notes
152
+
153
+ - This class is abstract and must be extended with implementations of `isRowValid`, `encodeData`, and the `valid` property.
154
+ - `rowOffset` can be used to skip header rows in Excel files.
155
+ - The match status column visually displays data validation results with green (valid) and red (invalid) text.
156
+ - Data encoding typically involves server interaction, and subclasses must ensure `encodeData` handles asynchronous operations.
@@ -0,0 +1,156 @@
1
+ # BaseEncodingTemplate 类
2
+
3
+ 一个用于解析 Excel 文件并进行数据编码和验证的抽象基类,继承自 `BaseTemplate`,支持数据有效性检查和列扩展。
4
+
5
+ ## [BaseTemplate](./BaseTemplate_cn.md)
6
+
7
+ ## 概述
8
+
9
+ `BaseEncodingTemplate` 类扩展了 `BaseTemplate`,增加了数据有效性验证和编码功能。它支持解析 Excel 文件、验证每行数据的合法性,并通过子类实现自定义的数据编码逻辑。类中添加了一个用于显示数据有效性的列(显示“有效”或“无效”状态)。
10
+
11
+ ## 使用方法
12
+
13
+ 要使用 `BaseEncodingTemplate`,需继承该类并实现 `isRowValid`、`encodeData` 方法以及 `valid` 属性。以下是一个示例:
14
+
15
+ ```typescript
16
+ import BaseEncodingTemplate from './BaseEncodingTemplate';
17
+ import type { DataColumn } from './DataColumn';
18
+
19
+ const columns: DataColumn[] = [
20
+ {
21
+ field: 'user.name',
22
+ text: '姓名',
23
+ width: 150,
24
+ parser: (value) => String(value).trim()
25
+ },
26
+ {
27
+ field: 'user.age',
28
+ text: '年龄',
29
+ width: 100,
30
+ parser: (value) => Number(value) || 0
31
+ }
32
+ ];
33
+
34
+ class MyEncodingTemplate extends BaseEncodingTemplate {
35
+ constructor() {
36
+ super(columns, rowOffset);
37
+ }
38
+
39
+ protected isRowValid(row: any): boolean {
40
+ return row.id != null;
41
+ }
42
+
43
+ protected async encodeData(rows: Array<any>): Promise<Array<any>> {
44
+ // 实现数据编码逻辑,例如调用 API,然后将返回的数据取代本地数据或者和本地数据融合
45
+ return rows.map(item => ({ ...item, encoded: true }));
46
+ }
47
+
48
+ get valid(): boolean {
49
+ // 检查整个数据集是否有效
50
+ return this._list.filter(iem=>item.id==null).length > 0;
51
+ }
52
+ }
53
+ ```
54
+
55
+ ### 解析 Excel 文件
56
+
57
+ ```typescript
58
+ const file: File = // ... 获取文件(例如,从输入元素获取)
59
+ const template = new MyEncodingTemplate();
60
+ await template.parseExcelFile(file); // 解析并编码数据
61
+ console.log(template.list); // 访问处理后的数据
62
+ console.log(template.valid); // 检查数据有效性
63
+ ```
64
+
65
+ ## 类详情
66
+
67
+ ### 构造函数
68
+
69
+ ```typescript
70
+ protected constructor(columns: Array<DataColumn>, rowOffset: number = 1)
71
+ ```
72
+
73
+ - **参数**:
74
+ - `columns`:定义数据结构(字段名、显示文本和可选解析器)的 `DataColumn` 对象数组。
75
+ - `rowOffset`:Excel 表中要跳过的起始行数(默认:1,例如跳过标题行)。
76
+ - **描述**:初始化模板,设置列定义和行偏移。
77
+
78
+ ### 方法
79
+
80
+ #### `isRowValid` (抽象方法)
81
+
82
+ ```typescript
83
+ protected abstract isRowValid(row: any): boolean
84
+ ```
85
+
86
+ - **参数**:
87
+ - `row`:单行数据对象。
88
+ - **描述**:子类必须实现此方法以验证单行数据的合法性,返回 `true` 表示有效,`false` 表示无效。
89
+ - **重写**:子类需实现具体验证逻辑。
90
+
91
+ #### `encodeData` (抽象方法)
92
+
93
+ ```typescript
94
+ protected abstract encodeData(rows: Array<any>): Promise<Array<any>>
95
+ ```
96
+
97
+ - **参数**:
98
+ - `rows`:要编码的数据数组。
99
+ - **描述**:子类必须实现此方法以定义数据编码逻辑(例如,调用服务器 API 进行数据处理)。返回编码后的数据数组。
100
+ - **重写**:子类需实现具体编码逻辑。
101
+
102
+ #### `valid` (抽象获取器)
103
+
104
+ ```typescript
105
+ abstract get valid(): boolean
106
+ ```
107
+
108
+ - **返回**:布尔值,表示整个数据集是否有效。
109
+ - **描述**:子类必须实现此获取器以检查所有数据的有效性。
110
+ - **重写**:子类需实现具体逻辑。
111
+
112
+ #### `consolidateData`
113
+
114
+ ```typescript
115
+ protected async consolidateData(rows: Array<any>): Promise<Array<any>>
116
+ ```
117
+
118
+ - **参数**:
119
+ - `rows`:从 Excel 文件解析出的原始行对象数组。
120
+ - **描述**:重写 `BaseTemplate` 的方法,调用 `encodeData` 对数据进行编码,并将编码结果合并到原始行中。
121
+ - **逻辑**:遍历每行数据,将编码结果与原始数据合并。
122
+
123
+ #### `columns`(获取器)
124
+
125
+ ```typescript
126
+ get columns(): Array<TableColumn>
127
+ ```
128
+
129
+ - **返回**:`TableColumn` 对象的数组,表示列定义,包含数据列和匹配状态列。
130
+ - **描述**:扩展 `BaseTemplate` 的 `columns`,添加一个匹配状态列(`validColumn`),用于显示每行数据的有效性(“有效”或“无效”)。
131
+
132
+ ### 匹配状态列
133
+
134
+ 定义了一个额外的 `validColumn` 用于显示每行数据的有效性:
135
+
136
+ ```typescript
137
+ private validColumn: TableColumn = {
138
+ text: getI18nText(i18nKeys.labelMatch),
139
+ width: 90,
140
+ align: 'center',
141
+ escapeHTML: true,
142
+ formatter: row => this.isRowValid(row) ? ValidData : InvalidData
143
+ }
144
+ ```
145
+
146
+ - **显示**:
147
+ - `ValidData`:`<span style="color: #76FF03">有效</span>`(绿色文本)。
148
+ - `InvalidData`:`<span style="color: #ff3e00">无效</span>`(红色文本)。
149
+ - **国际化**:使用 `getI18nText` 获取列标题和状态文本。
150
+
151
+ ## 注意事项
152
+
153
+ - 该类为抽象类,必须继承并实现 `isDataValid`、`encodeData` 方法和 `valid` 属性。
154
+ - `rowOffset` 可用于跳过 Excel 文件中的标题行。
155
+ - 匹配状态列通过绿色(有效)和红色(无效)文本直观显示数据验证结果。
156
+ - 数据编码通常涉及与服务器交互,子类需确保 `encodeData` 方法处理异步操作。
@@ -0,0 +1,222 @@
1
+ # BaseTemplate Class
2
+
3
+ An abstract base class for parsing Excel files and handling data with customizable column definitions.
4
+
5
+ ## Overview
6
+
7
+ The `BaseTemplate` class provides a foundation for processing Excel files using the `xlsx` library. It supports parsing Excel data into a structured format and enables custom column definitions and data transformations through subclassing. The class is designed to be extensible for specific use cases.
8
+ Typically, there is no need to directly inherit from `BaseTemplate`; instead, you can use its subclasses `BaseEncodingTemplate` or `BaseUploadTemplate` based on business requirements.
9
+
10
+ ## Usage
11
+
12
+ To use `BaseTemplate`, you must extend the class and implement the necessary custom data processing logic. Below is an example:
13
+
14
+ ```typescript
15
+ import BaseTemplate from './BaseTemplate';
16
+ import type { DataColumn } from './DataColumn';
17
+
18
+ class MyTemplate extends BaseTemplate {
19
+ constructor(columns: DataColumn[], rowOffset: number = 1) {
20
+ super(columns, rowOffset);
21
+ }
22
+
23
+ // Optionally override consolidateData for custom data processing
24
+ protected async consolidateData(rows: Array<any>): Promise<Array<any>> {
25
+ // Add custom logic here
26
+ return rows;
27
+ }
28
+ }
29
+ ```
30
+
31
+ ### Parsing Excel Files
32
+
33
+ To parse an Excel file, call the `parseExcelFile` method with a `File` object:
34
+
35
+ ```typescript
36
+ const file: File = // ... Obtain the file (e.g., from an input element)
37
+ const columns: DataColumn[] = [
38
+ { field: 'name', parser: (value) => String(value) },
39
+ { field: 'age', parser: (value) => Number(value) }
40
+ ];
41
+ const template = new MyTemplate(columns);
42
+ await template.parseExcelFile(file);
43
+ console.log(template.list); // Access parsed data
44
+ ```
45
+
46
+ ## Class Details
47
+
48
+ ### Constructor
49
+
50
+ ```typescript
51
+ protected constructor(columns: Array<DataColumn>, rowOffset: number = 1)
52
+ ```
53
+
54
+ - **Parameters**:
55
+ - `columns`: An array of `DataColumn` objects defining the data structure (field names and optional parsers).
56
+ - `rowOffset`: The number of starting rows to skip in the Excel sheet (default: 1, e.g., to skip the header row).
57
+ - **Description**: Initializes the template with column definitions and row offset.
58
+
59
+ ### Methods
60
+
61
+ #### `parseExcelFile`
62
+
63
+ ```typescript
64
+ async parseExcelFile(file: File): Promise<void>
65
+ ```
66
+
67
+ - **Parameters**:
68
+ - `file`: The Excel file to parse.
69
+ - **Description**: Reads and parses the Excel file, processes each row based on column definitions, and stores the result in the internal `_list` after applying `consolidateData`.
70
+ - **Dependencies**: Uses `xlsx` for reading Excel files and `utils` for nested value operations.
71
+
72
+ #### `consolidateData`
73
+
74
+ ```typescript
75
+ protected async consolidateData(rows: Array<any>): Promise<Array<any>>
76
+ ```
77
+
78
+ - **Parameters**:
79
+ - `rows`: An array of raw row objects parsed from the Excel file.
80
+ - **Description**: A hook method that subclasses can override for additional data processing. By default, it returns the unchanged rows.
81
+ - **Override**: Subclasses can override this method to implement custom data transformation logic.
82
+
83
+ #### `extractData`
84
+
85
+ ```typescript
86
+ protected extractData(arr: Array<any>): Array<any>
87
+ ```
88
+
89
+ - **Parameters**:
90
+ - `arr`: An array of data objects to process.
91
+ - **Description**: Filters and maps input data to include only visible and non-ignored columns, returning a new array of processed objects.
92
+ - **Purpose**: Used internally to prepare data for upload or further processing.
93
+
94
+ #### `wrapData`
95
+
96
+ ```typescript
97
+ protected wrapData(data: any): any
98
+ ```
99
+
100
+ - **Parameters**:
101
+ - `data`: A single row object.
102
+ - **Description**: A hook method for wrapping or transforming a single row of data. By default, it returns the unchanged data.
103
+ - **Override**: Subclasses can override this method to wrap data into a specific structure.
104
+
105
+ #### `columns` (Getter)
106
+
107
+ ```typescript
108
+ get columns(): Array<TableColumn>
109
+ ```
110
+
111
+ - **Returns**: An array of `TableColumn` objects representing column definitions.
112
+ - **Description**: Provides a copy of the column definitions for use in data tables or other UI components.
113
+
114
+ #### `list` (Getter)
115
+
116
+ ```typescript
117
+ get list(): Array<any>
118
+ ```
119
+
120
+ - **Returns**: A copy of the parsed and processed data list.
121
+ - **Description**: Provides external access to the processed data.
122
+
123
+ ## DataColumn Interface
124
+
125
+ A TypeScript interface that defines the structure and behavior of data table columns, used to describe column metadata and support features like column display, data parsing, and formatting.
126
+ The `DataColumn` interface defines the properties and behavior of columns in a data table, including column titles, field mappings, formatting, alignment, and specific fields for data parsing and upload control. It is suitable for scenarios involving table data processing and Excel file parsing.
127
+
128
+ ### Usage
129
+
130
+ The `DataColumn` interface is used to define the column structure of a data table, typically in conjunction with `BaseTemplate` or its derived classes (e.g., `BaseUploadTemplate`, `BaseEncodingTemplate`). Below is an example:
131
+
132
+ ```typescript
133
+ import type { DataColumn } from './DataColumn';
134
+
135
+ const columns: DataColumn[] = [
136
+ {
137
+ field: 'user.name',
138
+ text: 'Name',
139
+ width: 150,
140
+ align: 'left',
141
+ parser: (value) => String(value).trim(),
142
+ visible: true,
143
+ ignore: false
144
+ },
145
+ {
146
+ field: 'user.age',
147
+ text: 'Age',
148
+ width: 100,
149
+ align: 'center',
150
+ parser: (value) => Number(value) || 0,
151
+ visible: true,
152
+ ignore: false,
153
+ formatter: (row) => `${row['user.age']} years`
154
+ }
155
+ ];
156
+ ```
157
+
158
+ ### Properties
159
+
160
+ - **field**: `string`
161
+ - The field name used to map properties in the data object, supporting nested paths with dot notation (e.g., `user.name`).
162
+ - **text**: `string`
163
+ - The column header text displayed in the data table.
164
+ - **frozen?**: `boolean`
165
+ - Whether the column is frozen (fixed to the left side of the table), effective only if preceding columns are also `frozen`.
166
+ - **align?**: `'left' | 'center' | 'right'`
167
+ - The alignment of cell content, defaults to unspecified (determined by the renderer).
168
+ - **width**: `number`
169
+ - The column width in pixels.
170
+ - **minWidth?**: `number`
171
+ - The minimum column width in pixels (optional).
172
+ - **formatter?**: `FormatCell`
173
+ - A function for customizing cell display content.
174
+ - **escapeHTML?**: `boolean`
175
+ - Whether to escape HTML characters to prevent XSS attacks (default: unspecified).
176
+ - **visible?**: `boolean`
177
+ - Whether the column is visible, controlling its display in the table (default: unspecified).
178
+ - **resizable?**: `boolean`
179
+ - Whether the column width can be resized (default: unspecified).
180
+ - **ignore?**: `boolean`
181
+ - Whether to ignore the column; if `true`, the column is used only for frontend display and not included in data uploads (default: `false`).
182
+ - **parser?**: `ParserText`
183
+ - A data parsing function defined as `(text: string) => any`, used to convert raw Excel cell values to the target format (e.g., converting strings to numbers).
184
+
185
+ #### Types
186
+
187
+ - **ParserText**: `(text: string) => any`
188
+ - A parsing function type that takes a string input and returns a value of any type, used to process cell data from Excel files.
189
+ - **FormatCell**: A custom type (defined in `./FormatCell`) used for formatting cell display content.
190
+
191
+ #### Notes
192
+
193
+ - The `field` property is required in `DataColumn` to ensure correct data mapping.
194
+ - The `parser` function is critical for processing Excel data and should be defined based on the field type (e.g., string, number, date).
195
+ - The `ignore` property is useful for columns that should be displayed on the frontend but not included in uploads (e.g., auxiliary information columns).
196
+ - Ensure that dependent types (e.g., `FormatCell`) are properly defined and imported.
197
+
198
+ #### Example Column Definition
199
+
200
+ ```typescript
201
+ const columns: DataColumn[] = [
202
+ {
203
+ field: 'user.name',
204
+ parser: (value) => String(value).trim(),
205
+ visible: true,
206
+ ignore: false
207
+ },
208
+ {
209
+ field: 'user.age',
210
+ parser: (value) => Number(value) || 0,
211
+ visible: true,
212
+ ignore: false
213
+ }
214
+ ];
215
+ ```
216
+
217
+ ## Notes
218
+
219
+ - This class is abstract and must be extended for use.
220
+ - Ensure that `xlsx` and `@ticatec/uniface-element/DataTable` are installed and configured.
221
+ - The `rowOffset` can be used to skip header rows in Excel files.
222
+ - The `parser` function in `DataColumn` allows custom parsing of cell values (e.g., converting strings to numbers).