@nokecy/qc-ui 1.0.44 → 1.0.46
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/cjs/ag-grid-plus/ag-gridPlus.js +7 -2
- package/dist/cjs/ag-grid-plus/interface.d.ts +16 -0
- package/dist/cjs/ag-grid-plus/utils.js +3 -1
- package/dist/esm/ag-grid-plus/ag-gridPlus.js +7 -2
- package/dist/esm/ag-grid-plus/interface.d.ts +16 -0
- package/dist/esm/ag-grid-plus/utils.js +3 -1
- package/dist/umd/qc-ui.min.js +1 -1
- package/package.json +1 -1
|
@@ -110,7 +110,7 @@ function AgGridPlus(props) {
|
|
|
110
110
|
sortColumn = _useState16[0],
|
|
111
111
|
setSortColumn = _useState16[1];
|
|
112
112
|
var _useState17 = (0, _react.useState)({
|
|
113
|
-
pageSize: 200,
|
|
113
|
+
pageSize: props.hidePagination ? 10000 : 200,
|
|
114
114
|
current: 1,
|
|
115
115
|
total: dataSource ? dataSource.length : 0
|
|
116
116
|
}),
|
|
@@ -440,6 +440,11 @@ function AgGridPlus(props) {
|
|
|
440
440
|
return /*#__PURE__*/_react.default.createElement(Text, {
|
|
441
441
|
ellipsis: {
|
|
442
442
|
tooltip: value
|
|
443
|
+
},
|
|
444
|
+
style: {
|
|
445
|
+
display: 'flex',
|
|
446
|
+
justifyContent: 'center',
|
|
447
|
+
alignItems: 'center'
|
|
443
448
|
}
|
|
444
449
|
}, value);
|
|
445
450
|
}
|
|
@@ -658,7 +663,7 @@ function AgGridPlus(props) {
|
|
|
658
663
|
display: "flex",
|
|
659
664
|
justifyContent: "flex-end"
|
|
660
665
|
}
|
|
661
|
-
}, /*#__PURE__*/_react.default.createElement(_antd.Pagination, {
|
|
666
|
+
}, !props.hidePagination && /*#__PURE__*/_react.default.createElement(_antd.Pagination, {
|
|
662
667
|
pageSize: pagination.pageSize,
|
|
663
668
|
current: pagination.current,
|
|
664
669
|
total: pagination.total,
|
|
@@ -43,6 +43,7 @@ interface GridProps extends AgGridReactProps {
|
|
|
43
43
|
* 列表分页选择配置
|
|
44
44
|
*/
|
|
45
45
|
pageSizeOptions?: number[];
|
|
46
|
+
hidePagination?: boolean;
|
|
46
47
|
gridRef?: React.Ref<GridRef | undefined>;
|
|
47
48
|
}
|
|
48
49
|
interface AgGridColumnPropsClone extends ColDef {
|
|
@@ -57,6 +58,21 @@ interface AgGridColumnPropsClone extends ColDef {
|
|
|
57
58
|
* 是否文本缩略显示,并使用tooltip
|
|
58
59
|
*/
|
|
59
60
|
ellipsis?: boolean;
|
|
61
|
+
/**
|
|
62
|
+
* 枚举值配置,支持数组形式:
|
|
63
|
+
* [
|
|
64
|
+
* { value: any, label: string, color?: string, default?: boolean }
|
|
65
|
+
* ]
|
|
66
|
+
* - 用于渲染查询下拉、标签、过滤等
|
|
67
|
+
* - 支持设置默认值(default: true)
|
|
68
|
+
* - 支持多选(多个 default: true)
|
|
69
|
+
*/
|
|
70
|
+
valueEnum?: Array<{
|
|
71
|
+
value: any;
|
|
72
|
+
label: string;
|
|
73
|
+
color?: string;
|
|
74
|
+
default?: boolean;
|
|
75
|
+
}>;
|
|
60
76
|
searchComponent?: ReactNode | JSX.Element | ((props: any) => JSX.Element);
|
|
61
77
|
searchComponentProps?: any;
|
|
62
78
|
searchSort?: number;
|
|
@@ -33,13 +33,15 @@ var getFilter = function getFilter(objectKey, value, colDef) {
|
|
|
33
33
|
return "".concat(objectKey, " = ").concat(value);
|
|
34
34
|
}
|
|
35
35
|
if (value instanceof Array) {
|
|
36
|
+
var _colDef$searchCompone;
|
|
37
|
+
var format = (colDef === null || colDef === void 0 || (_colDef$searchCompone = colDef.searchComponentProps) === null || _colDef$searchCompone === void 0 ? void 0 : _colDef$searchCompone.format) || 'YYYY-MM-DD';
|
|
36
38
|
// 处理时间数组
|
|
37
39
|
if (value.length === 2 && (value.every(function (v) {
|
|
38
40
|
return (0, _dayjs.default)(v, 'YYYY-MM-DD').isValid();
|
|
39
41
|
}) || value.every(function (v) {
|
|
40
42
|
return (0, _dayjs.default)(v, 'YYYY-MM-DD HH:mm:ss').isValid();
|
|
41
43
|
}))) {
|
|
42
|
-
return "".concat(objectKey, " >= ").concat((0, _dayjs.default)(value[0]).format(
|
|
44
|
+
return "".concat(objectKey, " >= ").concat((0, _dayjs.default)(value[0]).format(format), " ,") + "".concat(objectKey, " <= ").concat((0, _dayjs.default)(value[1]).add(1, 'days').format(format));
|
|
43
45
|
}
|
|
44
46
|
|
|
45
47
|
// 处理非时间数组(如数字数组),转为 "asnStatus=10|asnStatus=20"
|
|
@@ -101,7 +101,7 @@ function AgGridPlus(props) {
|
|
|
101
101
|
sortColumn = _useState16[0],
|
|
102
102
|
setSortColumn = _useState16[1];
|
|
103
103
|
var _useState17 = useState({
|
|
104
|
-
pageSize: 200,
|
|
104
|
+
pageSize: props.hidePagination ? 10000 : 200,
|
|
105
105
|
current: 1,
|
|
106
106
|
total: dataSource ? dataSource.length : 0
|
|
107
107
|
}),
|
|
@@ -431,6 +431,11 @@ function AgGridPlus(props) {
|
|
|
431
431
|
return /*#__PURE__*/React.createElement(Text, {
|
|
432
432
|
ellipsis: {
|
|
433
433
|
tooltip: value
|
|
434
|
+
},
|
|
435
|
+
style: {
|
|
436
|
+
display: 'flex',
|
|
437
|
+
justifyContent: 'center',
|
|
438
|
+
alignItems: 'center'
|
|
434
439
|
}
|
|
435
440
|
}, value);
|
|
436
441
|
}
|
|
@@ -649,7 +654,7 @@ function AgGridPlus(props) {
|
|
|
649
654
|
display: "flex",
|
|
650
655
|
justifyContent: "flex-end"
|
|
651
656
|
}
|
|
652
|
-
}, /*#__PURE__*/React.createElement(Pagination, {
|
|
657
|
+
}, !props.hidePagination && /*#__PURE__*/React.createElement(Pagination, {
|
|
653
658
|
pageSize: pagination.pageSize,
|
|
654
659
|
current: pagination.current,
|
|
655
660
|
total: pagination.total,
|
|
@@ -43,6 +43,7 @@ interface GridProps extends AgGridReactProps {
|
|
|
43
43
|
* 列表分页选择配置
|
|
44
44
|
*/
|
|
45
45
|
pageSizeOptions?: number[];
|
|
46
|
+
hidePagination?: boolean;
|
|
46
47
|
gridRef?: React.Ref<GridRef | undefined>;
|
|
47
48
|
}
|
|
48
49
|
interface AgGridColumnPropsClone extends ColDef {
|
|
@@ -57,6 +58,21 @@ interface AgGridColumnPropsClone extends ColDef {
|
|
|
57
58
|
* 是否文本缩略显示,并使用tooltip
|
|
58
59
|
*/
|
|
59
60
|
ellipsis?: boolean;
|
|
61
|
+
/**
|
|
62
|
+
* 枚举值配置,支持数组形式:
|
|
63
|
+
* [
|
|
64
|
+
* { value: any, label: string, color?: string, default?: boolean }
|
|
65
|
+
* ]
|
|
66
|
+
* - 用于渲染查询下拉、标签、过滤等
|
|
67
|
+
* - 支持设置默认值(default: true)
|
|
68
|
+
* - 支持多选(多个 default: true)
|
|
69
|
+
*/
|
|
70
|
+
valueEnum?: Array<{
|
|
71
|
+
value: any;
|
|
72
|
+
label: string;
|
|
73
|
+
color?: string;
|
|
74
|
+
default?: boolean;
|
|
75
|
+
}>;
|
|
60
76
|
searchComponent?: ReactNode | JSX.Element | ((props: any) => JSX.Element);
|
|
61
77
|
searchComponentProps?: any;
|
|
62
78
|
searchSort?: number;
|
|
@@ -26,13 +26,15 @@ var getFilter = function getFilter(objectKey, value, colDef) {
|
|
|
26
26
|
return "".concat(objectKey, " = ").concat(value);
|
|
27
27
|
}
|
|
28
28
|
if (value instanceof Array) {
|
|
29
|
+
var _colDef$searchCompone;
|
|
30
|
+
var format = (colDef === null || colDef === void 0 || (_colDef$searchCompone = colDef.searchComponentProps) === null || _colDef$searchCompone === void 0 ? void 0 : _colDef$searchCompone.format) || 'YYYY-MM-DD';
|
|
29
31
|
// 处理时间数组
|
|
30
32
|
if (value.length === 2 && (value.every(function (v) {
|
|
31
33
|
return dayjs(v, 'YYYY-MM-DD').isValid();
|
|
32
34
|
}) || value.every(function (v) {
|
|
33
35
|
return dayjs(v, 'YYYY-MM-DD HH:mm:ss').isValid();
|
|
34
36
|
}))) {
|
|
35
|
-
return "".concat(objectKey, " >= ").concat(dayjs(value[0]).format(
|
|
37
|
+
return "".concat(objectKey, " >= ").concat(dayjs(value[0]).format(format), " ,") + "".concat(objectKey, " <= ").concat(dayjs(value[1]).add(1, 'days').format(format));
|
|
36
38
|
}
|
|
37
39
|
|
|
38
40
|
// 处理非时间数组(如数字数组),转为 "asnStatus=10|asnStatus=20"
|