@nokecy/qc-ui 1.0.43 → 1.0.45

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.
@@ -530,7 +530,11 @@ function AgGridPlus(props) {
530
530
  var rowDataMemo = (0, _react.useMemo)(function () {
531
531
  return props.treeData ? (0, _utils.flatten)((0, _utils.toTree)(rowData, treeKeyName !== null && treeKeyName !== void 0 ? treeKeyName : "id", treeParentName !== null && treeParentName !== void 0 ? treeParentName : "parentId"), treeKeyName !== null && treeKeyName !== void 0 ? treeKeyName : "id") : rowData;
532
532
  }, [rowData, props.treeData]);
533
- var actionDom = toolBarRender && toolBarRender(apiRef.current, (0, _utils.convertFilterModel)(queryFilter, allColDefs), queryFilter);
533
+ var actionDom = toolBarRender && toolBarRender(apiRef.current, (0, _utils.convertFilterModel)(queryFilter, allColDefs), queryFilter, {
534
+ current: pagination.current,
535
+ skipCount: pagination.current == 1 ? 0 : (pagination.current - 1) * pagination.pageSize,
536
+ maxResultCount: pagination.pageSize
537
+ });
534
538
  var autoGroupColumnDef = (0, _react.useMemo)(function () {
535
539
  return _objectSpread(_objectSpread({}, props.autoGroupColumnDef), {}, {
536
540
  cellRenderer: _customGroupCellRenderer.default
@@ -585,6 +589,7 @@ function AgGridPlus(props) {
585
589
  height: "100%"
586
590
  }
587
591
  }, /*#__PURE__*/_react.default.createElement("div", {
592
+ className: "qc-table-container",
588
593
  style: _objectSpread({
589
594
  display: "flex",
590
595
  flexDirection: "column",
@@ -17,7 +17,11 @@ interface GridProps extends AgGridReactProps {
17
17
  search?: boolean;
18
18
  headerTitle?: React.ReactNode;
19
19
  columnDefs?: (AgGridColumnPropsClone | ColGroupDef<any>)[] | null;
20
- toolBarRender?: (gridApi?: GridApi, filter?: string, queryFilter?: any) => React.ReactNode[];
20
+ toolBarRender?: (gridApi?: GridApi, filter?: string, queryFilter?: any, paginationInfo?: {
21
+ current: number;
22
+ skipCount: number;
23
+ maxResultCount: number;
24
+ }) => React.ReactNode[];
21
25
  defaultSearchExpand?: Boolean;
22
26
  /**
23
27
  * 用于标识grid唯一标识,用于保存列方案
@@ -53,6 +57,21 @@ interface AgGridColumnPropsClone extends ColDef {
53
57
  * 是否文本缩略显示,并使用tooltip
54
58
  */
55
59
  ellipsis?: boolean;
60
+ /**
61
+ * 枚举值配置,支持数组形式:
62
+ * [
63
+ * { value: any, label: string, color?: string, default?: boolean }
64
+ * ]
65
+ * - 用于渲染查询下拉、标签、过滤等
66
+ * - 支持设置默认值(default: true)
67
+ * - 支持多选(多个 default: true)
68
+ */
69
+ valueEnum?: Array<{
70
+ value: any;
71
+ label: string;
72
+ color?: string;
73
+ default?: boolean;
74
+ }>;
56
75
  searchComponent?: ReactNode | JSX.Element | ((props: any) => JSX.Element);
57
76
  searchComponentProps?: any;
58
77
  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("YYYY-MM-DD"), " ,") + "".concat(objectKey, " <= ").concat((0, _dayjs.default)(value[1]).add(1, 'days').format("YYYY-MM-DD"));
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"
@@ -521,7 +521,11 @@ function AgGridPlus(props) {
521
521
  var rowDataMemo = useMemo(function () {
522
522
  return props.treeData ? flatten(toTree(rowData, treeKeyName !== null && treeKeyName !== void 0 ? treeKeyName : "id", treeParentName !== null && treeParentName !== void 0 ? treeParentName : "parentId"), treeKeyName !== null && treeKeyName !== void 0 ? treeKeyName : "id") : rowData;
523
523
  }, [rowData, props.treeData]);
524
- var actionDom = toolBarRender && toolBarRender(apiRef.current, convertFilterModel(queryFilter, allColDefs), queryFilter);
524
+ var actionDom = toolBarRender && toolBarRender(apiRef.current, convertFilterModel(queryFilter, allColDefs), queryFilter, {
525
+ current: pagination.current,
526
+ skipCount: pagination.current == 1 ? 0 : (pagination.current - 1) * pagination.pageSize,
527
+ maxResultCount: pagination.pageSize
528
+ });
525
529
  var autoGroupColumnDef = useMemo(function () {
526
530
  return _objectSpread(_objectSpread({}, props.autoGroupColumnDef), {}, {
527
531
  cellRenderer: CustomGroupCellRenderer
@@ -576,6 +580,7 @@ function AgGridPlus(props) {
576
580
  height: "100%"
577
581
  }
578
582
  }, /*#__PURE__*/React.createElement("div", {
583
+ className: "qc-table-container",
579
584
  style: _objectSpread({
580
585
  display: "flex",
581
586
  flexDirection: "column",
@@ -17,7 +17,11 @@ interface GridProps extends AgGridReactProps {
17
17
  search?: boolean;
18
18
  headerTitle?: React.ReactNode;
19
19
  columnDefs?: (AgGridColumnPropsClone | ColGroupDef<any>)[] | null;
20
- toolBarRender?: (gridApi?: GridApi, filter?: string, queryFilter?: any) => React.ReactNode[];
20
+ toolBarRender?: (gridApi?: GridApi, filter?: string, queryFilter?: any, paginationInfo?: {
21
+ current: number;
22
+ skipCount: number;
23
+ maxResultCount: number;
24
+ }) => React.ReactNode[];
21
25
  defaultSearchExpand?: Boolean;
22
26
  /**
23
27
  * 用于标识grid唯一标识,用于保存列方案
@@ -53,6 +57,21 @@ interface AgGridColumnPropsClone extends ColDef {
53
57
  * 是否文本缩略显示,并使用tooltip
54
58
  */
55
59
  ellipsis?: boolean;
60
+ /**
61
+ * 枚举值配置,支持数组形式:
62
+ * [
63
+ * { value: any, label: string, color?: string, default?: boolean }
64
+ * ]
65
+ * - 用于渲染查询下拉、标签、过滤等
66
+ * - 支持设置默认值(default: true)
67
+ * - 支持多选(多个 default: true)
68
+ */
69
+ valueEnum?: Array<{
70
+ value: any;
71
+ label: string;
72
+ color?: string;
73
+ default?: boolean;
74
+ }>;
56
75
  searchComponent?: ReactNode | JSX.Element | ((props: any) => JSX.Element);
57
76
  searchComponentProps?: any;
58
77
  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("YYYY-MM-DD"), " ,") + "".concat(objectKey, " <= ").concat(dayjs(value[1]).add(1, 'days').format("YYYY-MM-DD"));
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"