@arim-aisdc/public-components 2.3.71 → 2.3.72
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.
- package/dist/components/BaseInfo/BaseInfo.d.ts +1 -1
- package/dist/components/ConditionExpression/index.d.ts +2 -0
- package/dist/components/ConditionExpression/index.js +8 -5
- package/dist/components/TableMax/TableBody/VirtualRow.js +1 -1
- package/dist/components/TableMax/components/Export/useTableExport.js +13 -12
- package/package.json +1 -1
|
@@ -17,7 +17,7 @@ export declare const foramtBaseInfoField: (data: any, dataField: BaseInfoFieldTy
|
|
|
17
17
|
value: any;
|
|
18
18
|
field: string;
|
|
19
19
|
label?: string;
|
|
20
|
-
text: string |
|
|
20
|
+
text: string | Element | JSX.Element;
|
|
21
21
|
units?: string;
|
|
22
22
|
width?: string;
|
|
23
23
|
labelWidth?: string;
|
|
@@ -31,6 +31,8 @@ export interface ConditionExpressionPropsType {
|
|
|
31
31
|
labelInValue?: boolean;
|
|
32
32
|
/** 是否支持前端筛选 */
|
|
33
33
|
canFrontFilter?: boolean;
|
|
34
|
+
/** 前端筛选函数 */
|
|
35
|
+
frontendFilterOptionFun?: (input: any, option: any) => boolean;
|
|
34
36
|
}
|
|
35
37
|
declare const _default: React.NamedExoticComponent<ConditionExpressionPropsType>;
|
|
36
38
|
export default _default;
|
|
@@ -68,7 +68,8 @@ var ConditionExpression = function ConditionExpression(_ref) {
|
|
|
68
68
|
showParameter = _ref$showParameter === void 0 ? true : _ref$showParameter,
|
|
69
69
|
parameterOptions = _ref.parameterOptions,
|
|
70
70
|
labelInValue = _ref.labelInValue,
|
|
71
|
-
canFrontFilter = _ref.canFrontFilter
|
|
71
|
+
canFrontFilter = _ref.canFrontFilter,
|
|
72
|
+
frontendFilterOptionFun = _ref.frontendFilterOptionFun;
|
|
72
73
|
/** 添加条件触发 */
|
|
73
74
|
var addExpression = function addExpression(index) {
|
|
74
75
|
var _conditionExpressionItem = value.map(function (e, i) {
|
|
@@ -167,6 +168,11 @@ var ConditionExpression = function ConditionExpression(_ref) {
|
|
|
167
168
|
className: 'condition-all-undelete',
|
|
168
169
|
children: [item === null || item === void 0 ? void 0 : item.map(function (e, i) {
|
|
169
170
|
var _value$index$, _value$index$2, _value$index$3, _value$index$4;
|
|
171
|
+
// 前端筛选逻辑
|
|
172
|
+
var frontendFilterOption = function frontendFilterOption(input, option) {
|
|
173
|
+
var _option$label;
|
|
174
|
+
return ((_option$label = option === null || option === void 0 ? void 0 : option.label) !== null && _option$label !== void 0 ? _option$label : '').toLowerCase().includes(input.toLowerCase());
|
|
175
|
+
};
|
|
170
176
|
return /*#__PURE__*/_jsxs("div", {
|
|
171
177
|
style: {
|
|
172
178
|
display: 'flex',
|
|
@@ -188,10 +194,7 @@ var ConditionExpression = function ConditionExpression(_ref) {
|
|
|
188
194
|
return dataChange('arguments', data, [index[0], i]);
|
|
189
195
|
},
|
|
190
196
|
showSearch: canFrontFilter,
|
|
191
|
-
filterOption: canFrontFilter ?
|
|
192
|
-
var _option$label;
|
|
193
|
-
return ((_option$label = option === null || option === void 0 ? void 0 : option.label) !== null && _option$label !== void 0 ? _option$label : '').toLowerCase().includes(input.toLowerCase());
|
|
194
|
-
} : true
|
|
197
|
+
filterOption: canFrontFilter || frontendFilterOptionFun ? frontendFilterOptionFun || frontendFilterOption : true
|
|
195
198
|
})
|
|
196
199
|
}), /*#__PURE__*/_jsx("div", {
|
|
197
200
|
className: 'condition-select-middle',
|
|
@@ -373,7 +373,7 @@ var VirtualRow = function VirtualRow(_ref) {
|
|
|
373
373
|
}
|
|
374
374
|
}, [
|
|
375
375
|
// 依赖项保持不变
|
|
376
|
-
row, row.id, rowEditing, tableId, editting, canRowDrag, disableDragRowIds, isDragging, selectedRowDragging, rowStyle, handleRowClick, rowMouseEnter, rowMouseLeave, rowClassNames, cellClassName, theme, table, handleCellRightClick, getCellProps, tableTooltip, onEditValueChange, dateFormat, row.getVisibleCells(), row.getIsSelected(), rowStyles]);
|
|
376
|
+
row, row.id, rowEditing, tableId, editting, canRowDrag, disableDragRowIds, isDragging, selectedRowDragging, rowStyle, handleRowClick, rowMouseEnter, rowMouseLeave, rowClassNames, cellClassName, theme, table, handleCellRightClick, getCellProps, tableTooltip, onEditValueChange, dateFormat, row.getVisibleCells(), row.getIsSelected(), rowStyles, table.getState().columnSizing]);
|
|
377
377
|
var rowCom = function rowCom() {
|
|
378
378
|
var renderCell = function renderCell(cell) {
|
|
379
379
|
var _cellClassName2;
|
|
@@ -22,6 +22,11 @@ import { useCallback, useState } from 'react';
|
|
|
22
22
|
import * as XLSX from 'xlsx';
|
|
23
23
|
import { message } from 'antd';
|
|
24
24
|
import { ColumnType } from "../../TableMax";
|
|
25
|
+
var DefaultPageParams = {
|
|
26
|
+
skipCount: 0,
|
|
27
|
+
maxResultCount: 1000
|
|
28
|
+
};
|
|
29
|
+
|
|
25
30
|
/**
|
|
26
31
|
* 默认的单元格逻辑转换函数
|
|
27
32
|
*/
|
|
@@ -85,7 +90,6 @@ export var useTableExport = function useTableExport(
|
|
|
85
90
|
_useState2 = _slicedToArray(_useState, 2),
|
|
86
91
|
exporting = _useState2[0],
|
|
87
92
|
setExporting = _useState2[1];
|
|
88
|
-
|
|
89
93
|
/**
|
|
90
94
|
* 根据列配置处理数据
|
|
91
95
|
*/
|
|
@@ -130,7 +134,6 @@ export var useTableExport = function useTableExport(
|
|
|
130
134
|
return processedItem;
|
|
131
135
|
});
|
|
132
136
|
}, []);
|
|
133
|
-
|
|
134
137
|
/**
|
|
135
138
|
* 设置列宽
|
|
136
139
|
*/
|
|
@@ -143,7 +146,6 @@ export var useTableExport = function useTableExport(
|
|
|
143
146
|
};
|
|
144
147
|
});
|
|
145
148
|
}, []);
|
|
146
|
-
|
|
147
149
|
/**
|
|
148
150
|
* 计算列宽
|
|
149
151
|
*/
|
|
@@ -153,7 +155,6 @@ export var useTableExport = function useTableExport(
|
|
|
153
155
|
var width = chineseCharCount * 2 + otherCharCount * 1.1 + 4;
|
|
154
156
|
return Math.min(Math.max(width, 12), 50);
|
|
155
157
|
};
|
|
156
|
-
|
|
157
158
|
/**
|
|
158
159
|
* 主导出函数
|
|
159
160
|
*/
|
|
@@ -174,28 +175,28 @@ export var useTableExport = function useTableExport(
|
|
|
174
175
|
case 5:
|
|
175
176
|
setExporting(true);
|
|
176
177
|
if (!customOptions.getExportDataList) {
|
|
177
|
-
_context.next =
|
|
178
|
+
_context.next = 11;
|
|
178
179
|
break;
|
|
179
180
|
}
|
|
180
181
|
_context.next = 9;
|
|
181
|
-
return customOptions.getExportDataList();
|
|
182
|
+
return customOptions.getExportDataList(DefaultPageParams);
|
|
182
183
|
case 9:
|
|
183
184
|
exportData = _context.sent;
|
|
184
|
-
|
|
185
|
+
if (!(Array.isArray(exportData) && exportData.length > 0)) {
|
|
186
|
+
message.warning('未获取到导出数据');
|
|
187
|
+
}
|
|
188
|
+
case 11:
|
|
185
189
|
if (isIncludeTotalRow && hasTotalRow) {
|
|
186
190
|
exportData = [].concat(_toConsumableArray(exportData), [totalDatas]);
|
|
187
191
|
}
|
|
188
192
|
try {
|
|
189
193
|
finalOptions = _objectSpread({}, customOptions); // 处理数据
|
|
190
|
-
processedData = processDataWithColumns(columns, exportData, isIncludeTotalRow && hasTotalRow); //
|
|
191
|
-
// 创建工作簿
|
|
194
|
+
processedData = processDataWithColumns(columns, exportData, isIncludeTotalRow && hasTotalRow); // 创建工作簿
|
|
192
195
|
workbook = XLSX.utils.book_new();
|
|
193
196
|
worksheet = XLSX.utils.json_to_sheet(processedData); // 设置列宽
|
|
194
197
|
setColumnWidths(columns, worksheet);
|
|
195
|
-
|
|
196
198
|
// 添加到工作簿
|
|
197
199
|
XLSX.utils.book_append_sheet(workbook, worksheet, finalOptions.sheetName);
|
|
198
|
-
|
|
199
200
|
// 生成文件名
|
|
200
201
|
timestamp = new Date().toISOString().slice(0, 10).replace(/-/g, '');
|
|
201
202
|
exportFilename = "".concat(finalOptions.fileName, "_").concat(timestamp, ".xlsx"); // 导出文件
|
|
@@ -207,7 +208,7 @@ export var useTableExport = function useTableExport(
|
|
|
207
208
|
} finally {
|
|
208
209
|
setExporting(false);
|
|
209
210
|
}
|
|
210
|
-
case
|
|
211
|
+
case 13:
|
|
211
212
|
case "end":
|
|
212
213
|
return _context.stop();
|
|
213
214
|
}
|