@arim-aisdc/public-components 2.3.35 → 2.3.37
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/TableMax/TableBody/Row.js +6 -4
- package/dist/components/TableMax/TableBody/index.d.ts +0 -1
- package/dist/components/TableMax/TableBody/index.js +4 -3
- package/dist/components/TableMax/components/ColumnFilterV2/Filter.js +7 -10
- package/dist/components/TableMax/components/ColumnFilterV2/MultipleSelect/index.d.ts +5 -2
- package/dist/components/TableMax/components/ColumnFilterV2/MultipleSelect/index.js +63 -19
- package/dist/components/TableMax/components/ColumnFilterV2/SingleSelect/index.js +4 -2
- package/dist/components/TableMax/components/ColumnFilterV2/customFilterFns.js +2 -1
- package/dist/components/TableMax/components/ColumnFilterV2/index.d.ts +1 -0
- package/dist/components/TableMax/components/ColumnFilterV2/index.js +5 -0
- package/dist/components/TableMax/components/ColumnSort/customSortFns.d.ts +8 -8
- package/dist/components/TableMax/utils.js +2 -2
- 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;
|
|
@@ -327,7 +327,7 @@ var Row = function Row(_ref) {
|
|
|
327
327
|
}, []);
|
|
328
328
|
|
|
329
329
|
// 优化:将行渲染逻辑提取为useMemo
|
|
330
|
-
var rowComMemo =
|
|
330
|
+
var rowComMemo = useCallback(function (row) {
|
|
331
331
|
var renderCell = function renderCell(cell) {
|
|
332
332
|
var _cellClassName;
|
|
333
333
|
var _cell$column$columnDe = cell.column.columnDef,
|
|
@@ -392,7 +392,9 @@ var Row = function Row(_ref) {
|
|
|
392
392
|
className: rowClassNames,
|
|
393
393
|
children: row.getVisibleCells().map(renderCell)
|
|
394
394
|
});
|
|
395
|
-
}, [
|
|
395
|
+
}, [rowEditing, tableId, editting, canRowDrag, disableDragRowIds, isDragging, selectedRowDragging, rowStyle, handleRowClick, rowMouseEnter, rowMouseLeave, rowClassNames, leftLastColumnId, rightFirstColumnId, cellClassName, theme, rowHeight, table, handleCellRightClick, getCellProps, tableTooltip, onEditValueChange, dateFormat
|
|
396
|
+
// row, row.getVisibleCells(), row.getIsSelected(), row.getValue(), row.renderValue()
|
|
397
|
+
]);
|
|
396
398
|
var rowCom = function rowCom() {
|
|
397
399
|
var renderCell = function renderCell(cell) {
|
|
398
400
|
var _cellClassName2;
|
|
@@ -469,8 +471,8 @@ var Row = function Row(_ref) {
|
|
|
469
471
|
getPopupContainer: function getPopupContainer() {
|
|
470
472
|
return tableBodyRef.current || document.body;
|
|
471
473
|
},
|
|
472
|
-
children: openMemo ? rowComMemo : rowCom()
|
|
473
|
-
})) : openMemo ? rowComMemo : rowCom(), row.getIsExpanded() && /*#__PURE__*/_jsx("tr", {
|
|
474
|
+
children: openMemo ? rowComMemo(row) : rowCom()
|
|
475
|
+
})) : openMemo ? rowComMemo(row) : rowCom(), row.getIsExpanded() && /*#__PURE__*/_jsx("tr", {
|
|
474
476
|
className: "tbody-tr-subrow",
|
|
475
477
|
children: /*#__PURE__*/_jsx("td", {
|
|
476
478
|
colSpan: row.getVisibleCells().length,
|
|
@@ -78,4 +78,3 @@ type TableBodyPropsType = {
|
|
|
78
78
|
};
|
|
79
79
|
declare const TableBody: ({ tableBodyRef, table, tableId, theme, reorderRow, rowSelectedId, setRowSelectedId, rowHighLightId, setRowHighLightId, selectedRowChange, onSelectChange, canSelection, selectionWithoutChecked, tableContainerWidth, selectedRowDragging, setSelectedRowDragging, canRowDrag, rowKey, loading, rowClassName, cellClassName, rowStyle, getCellProps, rowHeight, renderSubComponent, onRowMouseEnter, onRowMouseLeave, onRowMouseClick, onRowMouseDoubleClick, disableDragRowIds, selectRowWhenClick, datas, canEditRowWhenDClick, editingRowId, handleEditRowWhenDClick, dragBeforeStart, shadowColumnInfo, getContextMenu, onClickContextMenu, getRowHoverTipConfig, tableTooltip, compactMode, onEditValueChange, hasTotalRow, totalDatas, setRowSelection, openMemo }: TableBodyPropsType) => import("react/jsx-runtime").JSX.Element;
|
|
80
80
|
export default TableBody;
|
|
81
|
-
export declare const MemoizedTableBody: ({ tableBodyRef, table, tableId, theme, reorderRow, rowSelectedId, setRowSelectedId, rowHighLightId, setRowHighLightId, selectedRowChange, onSelectChange, canSelection, selectionWithoutChecked, tableContainerWidth, selectedRowDragging, setSelectedRowDragging, canRowDrag, rowKey, loading, rowClassName, cellClassName, rowStyle, getCellProps, rowHeight, renderSubComponent, onRowMouseEnter, onRowMouseLeave, onRowMouseClick, onRowMouseDoubleClick, disableDragRowIds, selectRowWhenClick, datas, canEditRowWhenDClick, editingRowId, handleEditRowWhenDClick, dragBeforeStart, shadowColumnInfo, getContextMenu, onClickContextMenu, getRowHoverTipConfig, tableTooltip, compactMode, onEditValueChange, hasTotalRow, totalDatas, setRowSelection, openMemo }: TableBodyPropsType) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -517,6 +517,7 @@ var TableBody = function TableBody(_ref) {
|
|
|
517
517
|
export default TableBody;
|
|
518
518
|
// export default React.memo(TableBody, (prev, next) => prev.table.getState() !== next.table.getState() );
|
|
519
519
|
|
|
520
|
-
export
|
|
521
|
-
|
|
522
|
-
|
|
520
|
+
// export const MemoizedTableBody = React.memo(
|
|
521
|
+
// TableBody,
|
|
522
|
+
// (prev, next) => prev.table.options.data === next.table.options.data
|
|
523
|
+
// ) as typeof TableBody
|
|
@@ -13,7 +13,7 @@ import { AutoComplete, DatePicker, Input, InputNumber } from 'antd';
|
|
|
13
13
|
import dayjs from 'dayjs';
|
|
14
14
|
import { debounce } from 'lodash';
|
|
15
15
|
import React, { useCallback, useEffect, useMemo, useState } from 'react';
|
|
16
|
-
import { FilterType, defaultDateFormat } from '.';
|
|
16
|
+
import { FilterType, defaultDateFormat, isEmpty } from '.';
|
|
17
17
|
import { DateRange } from "./DateRange";
|
|
18
18
|
import MultipleSelect from "./MultipleSelect";
|
|
19
19
|
import NumberRange from "./NumberRange";
|
|
@@ -57,19 +57,19 @@ var Filter = function Filter(_ref) {
|
|
|
57
57
|
setColumnFilterValue(newValue);
|
|
58
58
|
column.setFilterValue(newValue);
|
|
59
59
|
};
|
|
60
|
-
// 修改表格SingleSelect 筛选参数
|
|
60
|
+
// 修改表格SingleSelect MutiSelect 筛选参数
|
|
61
61
|
var handleChangeSelectFilterValue = function handleChangeSelectFilterValue(value, inputSearchValue) {
|
|
62
62
|
var newValue = value;
|
|
63
|
-
if (value === null || Array.isArray(value) && value.length === 0) {
|
|
63
|
+
if (value === null || value === undefined || Array.isArray(value) && value.length === 0) {
|
|
64
64
|
// 值为null或空数组时,清除过滤条件。
|
|
65
65
|
newValue = undefined;
|
|
66
66
|
}
|
|
67
67
|
// console.log('handleChangeFilterValue :>> ', newValue);
|
|
68
|
-
setColumnFilterValue(
|
|
68
|
+
setColumnFilterValue(isEmpty(newValue) ? undefined : {
|
|
69
69
|
filterValue: newValue,
|
|
70
70
|
optionsParam: inputSearchValue
|
|
71
71
|
});
|
|
72
|
-
column.setFilterValue(
|
|
72
|
+
column.setFilterValue(isEmpty(newValue) ? undefined : {
|
|
73
73
|
filterValue: newValue,
|
|
74
74
|
optionsParam: inputSearchValue
|
|
75
75
|
});
|
|
@@ -163,10 +163,7 @@ var Filter = function Filter(_ref) {
|
|
|
163
163
|
fetchOptions(value);
|
|
164
164
|
}, 500), [fetchOptions]);
|
|
165
165
|
useEffect(function () {
|
|
166
|
-
if ([FilterType.MultiSelect].includes(filterType)) {
|
|
167
|
-
// 打开后自动获取可选值
|
|
168
|
-
fetchOptions(columnFilterValue);
|
|
169
|
-
} else if ([FilterType.SingleSelect].includes(filterType)) {
|
|
166
|
+
if ([FilterType.SingleSelect, FilterType.MultiSelect].includes(filterType)) {
|
|
170
167
|
// 打开后自动获取可选值
|
|
171
168
|
var _ref3 = columnFilterValue || {},
|
|
172
169
|
optionsParam = _ref3.optionsParam;
|
|
@@ -285,7 +282,7 @@ var Filter = function Filter(_ref) {
|
|
|
285
282
|
default:
|
|
286
283
|
return /*#__PURE__*/_jsx(MultipleSelect, {
|
|
287
284
|
value: columnFilterValue,
|
|
288
|
-
onChange:
|
|
285
|
+
onChange: handleChangeSelectFilterValue,
|
|
289
286
|
onSearch: onSearch,
|
|
290
287
|
options: options,
|
|
291
288
|
loading: apiLoading,
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import './index.less';
|
|
2
2
|
interface IProps {
|
|
3
|
-
value:
|
|
3
|
+
value: {
|
|
4
|
+
filterValue?: any[];
|
|
5
|
+
optionsParam?: string;
|
|
6
|
+
} | undefined;
|
|
4
7
|
options: any[];
|
|
5
|
-
onChange: (value: any[]) => void;
|
|
8
|
+
onChange: (value: any[], inputValue?: string) => void;
|
|
6
9
|
onSearch: (value: string) => void;
|
|
7
10
|
isFrontSearch: boolean;
|
|
8
11
|
loading: boolean;
|
|
@@ -15,7 +15,10 @@ import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
15
15
|
var CheckboxGroup = Checkbox.Group;
|
|
16
16
|
var MultipleSelect = function MultipleSelect(_ref) {
|
|
17
17
|
var _ref$value = _ref.value,
|
|
18
|
-
value = _ref$value === void 0 ?
|
|
18
|
+
value = _ref$value === void 0 ? {
|
|
19
|
+
filterValue: [],
|
|
20
|
+
optionsParam: ''
|
|
21
|
+
} : _ref$value,
|
|
19
22
|
onChange = _ref.onChange,
|
|
20
23
|
options = _ref.options,
|
|
21
24
|
onSearch = _ref.onSearch,
|
|
@@ -23,37 +26,55 @@ var MultipleSelect = function MultipleSelect(_ref) {
|
|
|
23
26
|
loading = _ref.loading,
|
|
24
27
|
onCloseFilterPanel = _ref.onCloseFilterPanel;
|
|
25
28
|
// 内部state
|
|
26
|
-
|
|
27
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
28
|
-
innerValue = _useState2[0],
|
|
29
|
-
setInnerValue = _useState2[1];
|
|
29
|
+
// const [innerValue, setInnerValue] = useState(Array.isArray(value) ? value : [value]);
|
|
30
30
|
var _useTranslation = useTranslation(),
|
|
31
31
|
_useTranslation2 = _slicedToArray(_useTranslation, 1),
|
|
32
32
|
t = _useTranslation2[0];
|
|
33
|
+
var _ref2 = value || {},
|
|
34
|
+
filterValue = _ref2.filterValue,
|
|
35
|
+
optionsParam = _ref2.optionsParam;
|
|
33
36
|
|
|
34
|
-
//
|
|
35
|
-
var
|
|
37
|
+
// 列筛选 最终筛选值
|
|
38
|
+
var _useState = useState(Array.isArray(filterValue) ? filterValue : filterValue ? [filterValue] : []),
|
|
39
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
40
|
+
innerValue = _useState2[0],
|
|
41
|
+
setInnerValue = _useState2[1];
|
|
42
|
+
// 列筛选可选值列表的筛选参数
|
|
43
|
+
var _useState3 = useState(optionsParam),
|
|
36
44
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
37
|
-
|
|
38
|
-
|
|
45
|
+
inputSearchValue = _useState4[0],
|
|
46
|
+
setInputSearchValue = _useState4[1];
|
|
47
|
+
// 列筛选-前端筛选可选值列表
|
|
48
|
+
var _useState5 = useState([]),
|
|
49
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
50
|
+
frontendOptions = _useState6[0],
|
|
51
|
+
setFrontendOptions = _useState6[1];
|
|
39
52
|
var checkAll = options.length === innerValue.length;
|
|
40
53
|
var indeterminate = innerValue.length > 0 && innerValue.length < options.length;
|
|
41
54
|
var handleCheckBoxChange = function handleCheckBoxChange(changedValue) {
|
|
42
55
|
console.log('changedValue :>> ', changedValue);
|
|
43
56
|
setInnerValue(changedValue);
|
|
44
57
|
};
|
|
58
|
+
|
|
59
|
+
// const handleConfirm = () => {
|
|
60
|
+
// onChange(innerValue);
|
|
61
|
+
// onCloseFilterPanel();
|
|
62
|
+
// };
|
|
63
|
+
|
|
64
|
+
// const handleReset = () => {
|
|
65
|
+
// setInnerValue([]);
|
|
66
|
+
// onChange([]);
|
|
67
|
+
// };
|
|
68
|
+
|
|
45
69
|
var handleConfirm = function handleConfirm() {
|
|
46
|
-
onChange(innerValue);
|
|
70
|
+
onChange(innerValue, inputSearchValue);
|
|
47
71
|
onCloseFilterPanel();
|
|
48
72
|
};
|
|
49
73
|
var handleReset = function handleReset() {
|
|
50
74
|
setInnerValue([]);
|
|
51
|
-
|
|
75
|
+
setInputSearchValue(undefined);
|
|
76
|
+
onChange([], undefined);
|
|
52
77
|
};
|
|
53
|
-
useUpdateEffect(function () {
|
|
54
|
-
// console.log('value :>> ', value);
|
|
55
|
-
setInnerValue(Array.isArray(value) ? value : [value]);
|
|
56
|
-
}, [value.toString()]);
|
|
57
78
|
var onCheckAllChange = function onCheckAllChange(e) {
|
|
58
79
|
console.log('checkAll :>> ', e.target.checked);
|
|
59
80
|
var checkAll = e.target.checked;
|
|
@@ -65,12 +86,20 @@ var MultipleSelect = function MultipleSelect(_ref) {
|
|
|
65
86
|
setInnerValue([]);
|
|
66
87
|
}
|
|
67
88
|
};
|
|
89
|
+
useUpdateEffect(function () {
|
|
90
|
+
var _ref3 = value || {},
|
|
91
|
+
_ref3$filterValue = _ref3.filterValue,
|
|
92
|
+
filterValue = _ref3$filterValue === void 0 ? [] : _ref3$filterValue,
|
|
93
|
+
optionsParam = _ref3.optionsParam;
|
|
94
|
+
setInnerValue(Array.isArray(filterValue) ? filterValue : filterValue ? [filterValue] : []);
|
|
95
|
+
console.log('value :>> ', value);
|
|
96
|
+
setInputSearchValue(optionsParam);
|
|
97
|
+
}, [JSON.stringify(filterValue), optionsParam]);
|
|
68
98
|
var handleInputChange = function handleInputChange(e) {
|
|
69
99
|
var value = e.target.value;
|
|
100
|
+
setInputSearchValue(value);
|
|
70
101
|
if (!isFrontSearch) {
|
|
71
102
|
onSearch(value);
|
|
72
|
-
} else {
|
|
73
|
-
setFrontendSearchValue(value);
|
|
74
103
|
}
|
|
75
104
|
};
|
|
76
105
|
|
|
@@ -79,18 +108,33 @@ var MultipleSelect = function MultipleSelect(_ref) {
|
|
|
79
108
|
if (!isFrontSearch) {
|
|
80
109
|
return options;
|
|
81
110
|
}
|
|
82
|
-
var input = (
|
|
111
|
+
var input = (inputSearchValue !== null && inputSearchValue !== void 0 ? inputSearchValue : '').toUpperCase().trim();
|
|
83
112
|
return options.filter(function (option) {
|
|
84
113
|
var _option$label;
|
|
85
114
|
var optionFilterString = ('' + ((_option$label = option.label) !== null && _option$label !== void 0 ? _option$label : option.children)).toUpperCase().trim();
|
|
86
115
|
return optionFilterString.indexOf(input) !== -1;
|
|
87
116
|
});
|
|
88
|
-
}, [options,
|
|
117
|
+
}, [options, inputSearchValue]);
|
|
118
|
+
|
|
119
|
+
// // 最终的可选值
|
|
120
|
+
// const finalOptions = useMemo(() => {
|
|
121
|
+
// if (!isFrontSearch) {
|
|
122
|
+
// return options;
|
|
123
|
+
// }
|
|
124
|
+
// const input = (frontendSearchValue ?? '').toUpperCase().trim();
|
|
125
|
+
// return options.filter(option => {
|
|
126
|
+
// const optionFilterString = ('' + (option.label ?? option.children)).toUpperCase().trim();
|
|
127
|
+
// return optionFilterString.indexOf(input) !== -1;
|
|
128
|
+
// });
|
|
129
|
+
// }, [options, frontendSearchValue]);
|
|
130
|
+
|
|
89
131
|
return /*#__PURE__*/_jsxs("div", {
|
|
90
132
|
className: "tableMax-filter-multipleSelect",
|
|
91
133
|
children: [/*#__PURE__*/_jsx("div", {
|
|
92
134
|
className: "tableMax-filter-multipleSelect-header",
|
|
93
135
|
children: /*#__PURE__*/_jsx(Input, {
|
|
136
|
+
defaultValue: inputSearchValue,
|
|
137
|
+
value: inputSearchValue,
|
|
94
138
|
placeholder: t('global.placeholder.input'),
|
|
95
139
|
onChange: handleInputChange,
|
|
96
140
|
allowClear: true
|
|
@@ -5,9 +5,11 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
5
5
|
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
6
6
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
7
|
import { useTranslation } from "../../../../../hooks/useTranslation";
|
|
8
|
+
import { useUpdateEffect } from 'ahooks';
|
|
8
9
|
import { Button, Input, Spin } from 'antd';
|
|
9
10
|
import { useEffect, useMemo, useRef, useState } from 'react';
|
|
10
11
|
import "./index.less";
|
|
12
|
+
import { isEmpty } from '..';
|
|
11
13
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
14
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
15
|
var SingleSelect = function SingleSelect(_ref) {
|
|
@@ -54,7 +56,7 @@ var SingleSelect = function SingleSelect(_ref) {
|
|
|
54
56
|
setInputSearchValue(undefined);
|
|
55
57
|
onChange(undefined, undefined);
|
|
56
58
|
};
|
|
57
|
-
|
|
59
|
+
useUpdateEffect(function () {
|
|
58
60
|
console.log('value :>> ', value);
|
|
59
61
|
var _ref3 = value || {},
|
|
60
62
|
filterValue = _ref3.filterValue,
|
|
@@ -75,7 +77,7 @@ var SingleSelect = function SingleSelect(_ref) {
|
|
|
75
77
|
};
|
|
76
78
|
// 首次加载,已选item滚动到可视区
|
|
77
79
|
useEffect(function () {
|
|
78
|
-
if (
|
|
80
|
+
if (isEmpty(value) || isEmpty(value === null || value === void 0 ? void 0 : value.filterValue) || Array.isArray(options) && options.length === 0 || !isFirstScroll.current) return;
|
|
79
81
|
// 滚动到选中的项目
|
|
80
82
|
function scrollToSelectedItem() {
|
|
81
83
|
var selectedElement = document.querySelector(".item[data-id=".concat(value.filterValue, "]"));
|
|
@@ -27,8 +27,9 @@ var singleSelectFilter = function singleSelectFilter(row, columnId, filterValue)
|
|
|
27
27
|
|
|
28
28
|
// 多选筛选
|
|
29
29
|
var multiSelectFilter = function multiSelectFilter(row, columnId, filterValue) {
|
|
30
|
+
var value = filterValue.filterValue;
|
|
30
31
|
var rowValue = row.getValue(columnId);
|
|
31
|
-
return
|
|
32
|
+
return value === null || value === void 0 ? void 0 : value.includes(rowValue + '');
|
|
32
33
|
};
|
|
33
34
|
|
|
34
35
|
// 数字范围筛选
|
|
@@ -155,4 +155,9 @@ export function ColumnFilter(_ref) {
|
|
|
155
155
|
})
|
|
156
156
|
}), root ? document.querySelector(root) : document.body) : null]
|
|
157
157
|
});
|
|
158
|
+
}
|
|
159
|
+
export function isEmpty(value) {
|
|
160
|
+
if (value) return false;
|
|
161
|
+
if (value === false || value === 0) return false;
|
|
162
|
+
return true;
|
|
158
163
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { TableMaxColumnType } from "../../type";
|
|
2
|
-
export declare const numberSortFn: (rowA: any, rowB: any, columnId: string) =>
|
|
3
|
-
export declare const stringSortFn: (rowA: any, rowB: any, columnId: string) =>
|
|
4
|
-
export declare const numberOrStringSortFn: (rowA: any, rowB: any, columnId: string) =>
|
|
5
|
-
export declare const timeSortFn: (rowA: any, rowB: any, columnId: string) =>
|
|
2
|
+
export declare const numberSortFn: (rowA: any, rowB: any, columnId: string) => 0 | 1 | -1;
|
|
3
|
+
export declare const stringSortFn: (rowA: any, rowB: any, columnId: string) => 0 | 1 | -1;
|
|
4
|
+
export declare const numberOrStringSortFn: (rowA: any, rowB: any, columnId: string) => 0 | 1 | -1;
|
|
5
|
+
export declare const timeSortFn: (rowA: any, rowB: any, columnId: string) => 0 | 1 | -1;
|
|
6
6
|
declare const customSortFns: {
|
|
7
|
-
numberSortFn: (rowA: any, rowB: any, columnId: string) =>
|
|
8
|
-
stringSortFn: (rowA: any, rowB: any, columnId: string) =>
|
|
9
|
-
timeSortFn: (rowA: any, rowB: any, columnId: string) =>
|
|
10
|
-
numberOrStringSortFn: (rowA: any, rowB: any, columnId: string) =>
|
|
7
|
+
numberSortFn: (rowA: any, rowB: any, columnId: string) => 0 | 1 | -1;
|
|
8
|
+
stringSortFn: (rowA: any, rowB: any, columnId: string) => 0 | 1 | -1;
|
|
9
|
+
timeSortFn: (rowA: any, rowB: any, columnId: string) => 0 | 1 | -1;
|
|
10
|
+
numberOrStringSortFn: (rowA: any, rowB: any, columnId: string) => 0 | 1 | -1;
|
|
11
11
|
};
|
|
12
12
|
export default customSortFns;
|
|
13
13
|
export type SortFnType = keyof typeof customSortFns | undefined;
|
|
@@ -124,7 +124,7 @@ export var getFormatFilters = function getFormatFilters(columns, originFilters)
|
|
|
124
124
|
formatFilters["".concat(formatKey, "To")] = value === null || value === void 0 ? void 0 : value[1];
|
|
125
125
|
} else if (filterType === FilterType.MultiSelect || !filterType) {
|
|
126
126
|
// 多选组件
|
|
127
|
-
formatFilters["".concat(formatKey, "List")] = value;
|
|
127
|
+
formatFilters["".concat(formatKey, "List")] = value.filterValue;
|
|
128
128
|
// formatFilters[formatKey] = value;
|
|
129
129
|
} else if (filterType === FilterType.SingleSelect) {
|
|
130
130
|
// 单选组件
|
|
@@ -196,7 +196,7 @@ export var getFormatFiltersV2 = function getFormatFiltersV2(columns, originFilte
|
|
|
196
196
|
} else if (filterType === FilterType.MultiSelect || !filterType) {
|
|
197
197
|
// 多选组件
|
|
198
198
|
res.operator = FilterOperator.In;
|
|
199
|
-
res.value = value;
|
|
199
|
+
res.value = value.filterValue;
|
|
200
200
|
} else if (filterType === FilterType.Input || filterType === FilterType.AutoComplete) {
|
|
201
201
|
// Input组件
|
|
202
202
|
res.operator = FilterOperator.Contains;
|