@nokecy/qc-ui 1.0.44 → 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.
@@ -57,6 +57,21 @@ interface AgGridColumnPropsClone extends ColDef {
57
57
  * 是否文本缩略显示,并使用tooltip
58
58
  */
59
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
+ }>;
60
75
  searchComponent?: ReactNode | JSX.Element | ((props: any) => JSX.Element);
61
76
  searchComponentProps?: any;
62
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"
@@ -57,6 +57,21 @@ interface AgGridColumnPropsClone extends ColDef {
57
57
  * 是否文本缩略显示,并使用tooltip
58
58
  */
59
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
+ }>;
60
75
  searchComponent?: ReactNode | JSX.Element | ((props: any) => JSX.Element);
61
76
  searchComponentProps?: any;
62
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"