zmdms-webui 2.1.1 → 2.1.3
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/es/table/table.js
CHANGED
|
@@ -41,7 +41,7 @@ import { DndProvider } from '../node_modules/react-dnd/dist/core/DndProvider.js'
|
|
|
41
41
|
// completed: 实现从execl复制到表格中的功能
|
|
42
42
|
var Table = function (props) {
|
|
43
43
|
// console.log("表格渲染");
|
|
44
|
-
var className = props.className, _a = props.bordered, bordered = _a === void 0 ? true : _a, _b = props.pagination, pagination = _b === void 0 ? false : _b, isFlex = props.isFlex; props.tablePreferences; var dynamicKey = props.dynamicKey, dynamicVersion = props.dynamicVersion, customDynamicListHandle = props.customDynamicListHandle, isRemeberFilter = props.isRemeberFilter, _c = props.isOrderUpdateData, isOrderUpdateData = _c === void 0 ? true : _c, hiddenDynamicIcon = props.hiddenDynamicIcon, _columns = props.columns, dataSource = props.dataSource, onTableChange = props.onTableChange, isEdit = props.isEdit, isMove = props.isMove, isAdd = props.isAdd, hiddenAddBtnHandle = props.hiddenAddBtnHandle, _d = props.isTheadTitleAdd, isTheadTitleAdd = _d === void 0 ? true : _d, addMode = props.addMode, addCallback = props.addCallback, isDel = props.isDel, delPopTitle = props.delPopTitle, hiddenDelBtnHandle = props.hiddenDelBtnHandle, _e = props.isDelAll, isDelAll = _e === void 0 ? true : _e, isAddAndDelAuto = props.isAddAndDelAuto, summaryConfig = props.summaryConfig, _f = props.summaryFixed, summaryFixed = _f === void 0 ? true : _f, isInnerPagination = props.isInnerPagination, _g = props.innerPaginationPageSize, innerPaginationPageSize = _g === void 0 ? 30 : _g, _h = props.innerPaginationPosition, innerPaginationPosition = _h === void 0 ? INNER_TABLE_PAGINATION_POSITION : _h, _j = props.innerPaginationPageSizeOptions, innerPaginationPageSizeOptions = _j === void 0 ? INNER_TABLE_PAGINATION_PAGESIZEOPTIONS : _j, innerPaginationConfig = props.innerPaginationConfig, tableRefHandle = props.tableRefHandle, tableName = props.tableName, serviceOrder = props.serviceOrder, differences = props.differences, virtualKey = props.virtualKey, _k = props.isResizableColumn, isResizableColumn = _k === void 0 ? true : _k, _l = props.isResizableTitleEllipsis, isResizableTitleEllipsis = _l === void 0 ? true : _l, _m = props.isRealTimeValidate, isRealTimeValidate = _m === void 0 ? true : _m, isMarginTop = props.isMarginTop, isMarginBottom = props.isMarginBottom, scroll = props.scroll, addAndDelProps = props.addAndDelProps, _o = props.autoScrollYMarginBottom, autoScrollYMarginBottom = _o === void 0 ? 65 : _o, _p = props.isAutoScrollY, isAutoScrollY = _p === void 0 ? false : _p, tableId = props.tableId, extraOnRow = props.onRow, fixedRowsCount = props.fixedRowsCount, fixedRowsConfig = props.fixedRowsConfig, headerAlign = props.headerAlign, isDimensionDynamic = props.isDimensionDynamic, dimensionCustomSumKeys = props.dimensionCustomSumKeys, isAutoMerge = props.isAutoMerge, mode = props.mode, rowSelection = props.rowSelection, isContextMenu = props.isContextMenu, isFullscreenHandle = props.isFullscreenHandle, resetProps = __rest(props, ["className", "bordered", "pagination", "isFlex", "tablePreferences", "dynamicKey", "dynamicVersion", "customDynamicListHandle", "isRemeberFilter", "isOrderUpdateData", "hiddenDynamicIcon", "columns", "dataSource", "onTableChange", "isEdit", "isMove", "isAdd", "hiddenAddBtnHandle", "isTheadTitleAdd", "addMode", "addCallback", "isDel", "delPopTitle", "hiddenDelBtnHandle", "isDelAll", "isAddAndDelAuto", "summaryConfig", "summaryFixed", "isInnerPagination", "innerPaginationPageSize", "innerPaginationPosition", "innerPaginationPageSizeOptions", "innerPaginationConfig", "tableRefHandle", "tableName", "serviceOrder", "differences", "virtualKey", "isResizableColumn", "isResizableTitleEllipsis", "isRealTimeValidate", "isMarginTop", "isMarginBottom", "scroll", "addAndDelProps", "autoScrollYMarginBottom", "isAutoScrollY", "tableId", "onRow", "fixedRowsCount", "fixedRowsConfig", "headerAlign", "isDimensionDynamic", "dimensionCustomSumKeys", "isAutoMerge", "mode", "rowSelection", "isContextMenu", "isFullscreenHandle"]);
|
|
44
|
+
var className = props.className, _a = props.bordered, bordered = _a === void 0 ? true : _a, _b = props.pagination, pagination = _b === void 0 ? false : _b, isFlex = props.isFlex; props.tablePreferences; var dynamicKey = props.dynamicKey, dynamicVersion = props.dynamicVersion, customDynamicListHandle = props.customDynamicListHandle, isRemeberFilter = props.isRemeberFilter, _c = props.isOrderUpdateData, isOrderUpdateData = _c === void 0 ? true : _c, hiddenDynamicIcon = props.hiddenDynamicIcon, _columns = props.columns, dataSource = props.dataSource, onTableChange = props.onTableChange, isEdit = props.isEdit, isMove = props.isMove, isAdd = props.isAdd, hiddenAddBtnHandle = props.hiddenAddBtnHandle, _d = props.isTheadTitleAdd, isTheadTitleAdd = _d === void 0 ? true : _d, addMode = props.addMode, addCallback = props.addCallback, isDel = props.isDel, delPopTitle = props.delPopTitle, hiddenDelBtnHandle = props.hiddenDelBtnHandle, _e = props.isDelAll, isDelAll = _e === void 0 ? true : _e, isAddAndDelAuto = props.isAddAndDelAuto, summaryConfig = props.summaryConfig, _f = props.summaryFixed, summaryFixed = _f === void 0 ? true : _f, isInnerPagination = props.isInnerPagination, _g = props.innerPaginationPageSize, innerPaginationPageSize = _g === void 0 ? 30 : _g, _h = props.innerPaginationPosition, innerPaginationPosition = _h === void 0 ? INNER_TABLE_PAGINATION_POSITION : _h, _j = props.innerPaginationPageSizeOptions, innerPaginationPageSizeOptions = _j === void 0 ? INNER_TABLE_PAGINATION_PAGESIZEOPTIONS : _j, innerPaginationConfig = props.innerPaginationConfig, tableRefHandle = props.tableRefHandle, tableName = props.tableName, serviceOrder = props.serviceOrder, differences = props.differences, virtualKey = props.virtualKey, _k = props.isResizableColumn, isResizableColumn = _k === void 0 ? true : _k, _l = props.isResizableTitleEllipsis, isResizableTitleEllipsis = _l === void 0 ? true : _l, _m = props.isRealTimeValidate, isRealTimeValidate = _m === void 0 ? true : _m, isMarginTop = props.isMarginTop, isMarginBottom = props.isMarginBottom, scroll = props.scroll, addAndDelProps = props.addAndDelProps, _o = props.autoScrollYMarginBottom, autoScrollYMarginBottom = _o === void 0 ? 65 : _o, _p = props.isAutoScrollY, isAutoScrollY = _p === void 0 ? false : _p, tableId = props.tableId, extraOnRow = props.onRow, fixedRowsCount = props.fixedRowsCount, fixedRowsConfig = props.fixedRowsConfig, headerAlign = props.headerAlign, isDimensionDynamic = props.isDimensionDynamic, dimensionCustomSumKeys = props.dimensionCustomSumKeys, isAutoMerge = props.isAutoMerge, mode = props.mode, rowSelection = props.rowSelection, isContextMenu = props.isContextMenu, isFullscreenHandle = props.isFullscreenHandle, _q = props.isExportSummary, isExportSummary = _q === void 0 ? true : _q, resetProps = __rest(props, ["className", "bordered", "pagination", "isFlex", "tablePreferences", "dynamicKey", "dynamicVersion", "customDynamicListHandle", "isRemeberFilter", "isOrderUpdateData", "hiddenDynamicIcon", "columns", "dataSource", "onTableChange", "isEdit", "isMove", "isAdd", "hiddenAddBtnHandle", "isTheadTitleAdd", "addMode", "addCallback", "isDel", "delPopTitle", "hiddenDelBtnHandle", "isDelAll", "isAddAndDelAuto", "summaryConfig", "summaryFixed", "isInnerPagination", "innerPaginationPageSize", "innerPaginationPosition", "innerPaginationPageSizeOptions", "innerPaginationConfig", "tableRefHandle", "tableName", "serviceOrder", "differences", "virtualKey", "isResizableColumn", "isResizableTitleEllipsis", "isRealTimeValidate", "isMarginTop", "isMarginBottom", "scroll", "addAndDelProps", "autoScrollYMarginBottom", "isAutoScrollY", "tableId", "onRow", "fixedRowsCount", "fixedRowsConfig", "headerAlign", "isDimensionDynamic", "dimensionCustomSumKeys", "isAutoMerge", "mode", "rowSelection", "isContextMenu", "isFullscreenHandle", "isExportSummary"]);
|
|
45
45
|
var classes = classNames("ztxk-table", className, {
|
|
46
46
|
"ztxk-table--flex": isFlex,
|
|
47
47
|
});
|
|
@@ -53,24 +53,24 @@ var Table = function (props) {
|
|
|
53
53
|
id: menuId,
|
|
54
54
|
}).show;
|
|
55
55
|
// 针对SCU和增减行 做特殊处理
|
|
56
|
-
var
|
|
56
|
+
var _r = useScuRfresh(), refreshScuCell = _r.refreshScuCell, getRefreshScuCell = _r.getRefreshScuCell;
|
|
57
57
|
// 做一些前置处理
|
|
58
58
|
// 比如过滤某些列 不做展示
|
|
59
59
|
var columns = useParseColumns(_columns);
|
|
60
60
|
// 得到动态列配置信息
|
|
61
|
-
var
|
|
61
|
+
var _s = useDynamicListByColumns(columns, {
|
|
62
62
|
dynamicKey: dynamicKey,
|
|
63
63
|
dynamicVersion: dynamicVersion,
|
|
64
64
|
customDynamicListHandle: customDynamicListHandle,
|
|
65
|
-
}), defaultDynamicList =
|
|
65
|
+
}), defaultDynamicList = _s.defaultDynamicList, onCurrentListChange = _s.onCurrentListChange, currentDynamicList = _s.currentDynamicList, dynamicSettingRef = _s.dynamicSettingRef;
|
|
66
66
|
// 因为内部分页需要知晓当前页面的数据展示,要不然数据排序就跟内部分页没关系了
|
|
67
67
|
// 自定义排序方法
|
|
68
|
-
var
|
|
68
|
+
var _t = useCustomSort(dataSource, onTableChange, {
|
|
69
69
|
refreshScuCell: refreshScuCell,
|
|
70
70
|
rowKey: props === null || props === void 0 ? void 0 : props.rowKey,
|
|
71
71
|
serviceOrder: serviceOrder,
|
|
72
72
|
isOrderUpdateData: isOrderUpdateData,
|
|
73
|
-
}), order =
|
|
73
|
+
}), order = _t.order, setOrder = _t.setOrder, customSortHandle = _t.customSortHandle, sortDataSource = _t.sortDataSource;
|
|
74
74
|
// 当前表格展示的数据
|
|
75
75
|
// 如果开启了前端排序的话,排序后的数据,可能会影响到很多地方。
|
|
76
76
|
// 所以后续操作的数据 应该用
|
|
@@ -97,12 +97,12 @@ var Table = function (props) {
|
|
|
97
97
|
return scroll || {};
|
|
98
98
|
}, [scroll, currentTableDataSource, virtualKey, scrolly, isAutoScrollY]);
|
|
99
99
|
// 内部分页相关配置
|
|
100
|
-
var
|
|
100
|
+
var _u = useInnerPagination(isInnerPagination, innerPaginationPageSize, {
|
|
101
101
|
innerPaginationPosition: innerPaginationPosition,
|
|
102
102
|
innerPaginationPageSizeOptions: innerPaginationPageSizeOptions,
|
|
103
103
|
innerPaginationConfig: innerPaginationConfig,
|
|
104
104
|
dataSource: currentTableDataSource,
|
|
105
|
-
}), paginationConfig =
|
|
105
|
+
}), paginationConfig = _u.paginationConfig, currentPage = _u.currentPage, setCurrent = _u.setCurrent, pageSize = _u.pageSize;
|
|
106
106
|
// 内部表格编辑事件
|
|
107
107
|
var onEditableSave = useEditChange(dataSourceRef, onTableChange);
|
|
108
108
|
// 记录表头过滤的一些配置(通过ref记录,key => filter) 复制整列、过滤后修改数据,需要先走过滤
|
|
@@ -130,9 +130,9 @@ var Table = function (props) {
|
|
|
130
130
|
filterConfigRef: filterConfigRef,
|
|
131
131
|
});
|
|
132
132
|
// 表格内部自定义处理过滤,不走antd内部
|
|
133
|
-
var
|
|
133
|
+
var _v = useCustomFilter(currentTableDataSource), filterDataSource = _v[0], handleFilterConfigChange = _v[1];
|
|
134
134
|
// 处理列配置信息 得到新的列配置信息
|
|
135
|
-
var
|
|
135
|
+
var _w = useColumns(columns, {
|
|
136
136
|
// 动态列配置相关信息
|
|
137
137
|
dynamicKey: dynamicKey,
|
|
138
138
|
isRemeberFilter: isRemeberFilter,
|
|
@@ -174,14 +174,14 @@ var Table = function (props) {
|
|
|
174
174
|
mode: mode,
|
|
175
175
|
isAutoMerge: isAutoMerge,
|
|
176
176
|
handleFilterConfigChange: handleFilterConfigChange,
|
|
177
|
-
}), _newColumns =
|
|
177
|
+
}), _newColumns = _w.newColumns, newRowSelection = _w.rowSelection;
|
|
178
178
|
// 处理表格合并和维度
|
|
179
|
-
var
|
|
179
|
+
var _x = useAutoMerge(filterDataSource, _newColumns, {
|
|
180
180
|
isAutoMerge: isAutoMerge,
|
|
181
181
|
isDimensionDynamic: isDimensionDynamic,
|
|
182
182
|
order: order,
|
|
183
183
|
dimensionCustomSumKeys: dimensionCustomSumKeys,
|
|
184
|
-
}), newDataSource =
|
|
184
|
+
}), newDataSource = _x[0], newColumns = _x[1];
|
|
185
185
|
// 内部表格总结栏
|
|
186
186
|
var getSummaryHandle = useSummary(summaryConfig, newColumns, {
|
|
187
187
|
summaryFixed: summaryFixed,
|
|
@@ -191,7 +191,7 @@ var Table = function (props) {
|
|
|
191
191
|
isDel: isDel,
|
|
192
192
|
});
|
|
193
193
|
// 表格验证
|
|
194
|
-
var
|
|
194
|
+
var _y = useTableValidate(), tableRef = _y.tableRef, getCurrentTable = _y.getCurrentTable, clearErrorClass = _y.clearErrorClass;
|
|
195
195
|
// 虚拟滚动选项
|
|
196
196
|
var vComponents = useMemo(function () {
|
|
197
197
|
if (virtualKey) {
|
|
@@ -266,7 +266,7 @@ var Table = function (props) {
|
|
|
266
266
|
var exportExcel = useExcelExport(newDataSource, {
|
|
267
267
|
columns: newColumns,
|
|
268
268
|
isAutoMerge: isAutoMerge,
|
|
269
|
-
summaryConfig: summaryConfig,
|
|
269
|
+
summaryConfig: isExportSummary ? summaryConfig : undefined,
|
|
270
270
|
});
|
|
271
271
|
// 暴露给外部一些方法
|
|
272
272
|
useImperativeHandle(tableRefHandle, function () {
|
|
@@ -10,7 +10,7 @@ function useSummary(summaryConfig, columns, options) {
|
|
|
10
10
|
// 是否存在选择项
|
|
11
11
|
var isRowSelection = rowSelection ? true : false;
|
|
12
12
|
// 是否存在可展开
|
|
13
|
-
var isExpandable = expandable ? true : false;
|
|
13
|
+
var isExpandable = (expandable === null || expandable === void 0 ? void 0 : expandable.expandedRowRender) ? true : false;
|
|
14
14
|
// 增减 体现再cloumns里面 所以需要额外处理
|
|
15
15
|
var isAddOrDel = isAdd || isDel ? true : false;
|
|
16
16
|
var fillNumber = Number(isRowSelection) + Number(isExpandable);
|
package/dist/es/table/utils.js
CHANGED
|
@@ -855,7 +855,6 @@ summaryKeys, dimensionCustomSumKeys) {
|
|
|
855
855
|
var summaryKey = summaryKeys_2[_d];
|
|
856
856
|
_loop_7(summaryKey);
|
|
857
857
|
}
|
|
858
|
-
console.log("dimensionCustomSumKeys", dimensionCustomSumKeys);
|
|
859
858
|
// 处理dimensionCustomSumKeys的额外合并计算逻辑
|
|
860
859
|
if (dimensionCustomSumKeys && Array.isArray(dimensionCustomSumKeys)) {
|
|
861
860
|
var _loop_8 = function (customSumKey) {
|