@nokecy/qc-ui 1.1.34 → 1.1.36

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.
Files changed (29) hide show
  1. package/dist/cjs/ag-grid-plus/ag-gridPlus.js +48 -6
  2. package/dist/cjs/ag-grid-plus/context/gridContext.d.ts +19 -0
  3. package/dist/cjs/ag-grid-plus/context/useSchemeDataFlow.d.ts +8 -0
  4. package/dist/cjs/ag-grid-plus/context/useSchemeDataFlow.js +62 -1
  5. package/dist/cjs/ag-grid-plus/index.d.ts +2 -0
  6. package/dist/cjs/ag-grid-plus/index.js +13 -0
  7. package/dist/cjs/ag-grid-plus/interface.d.ts +9 -0
  8. package/dist/cjs/ag-grid-plus/setting/ColumnSetting.js +8 -2
  9. package/dist/cjs/ag-grid-plus/shared/storage/localStorageAdapter.js +34 -6
  10. package/dist/cjs/ag-grid-plus/shared/storage/schemeStorageAdapter.d.ts +2 -0
  11. package/dist/cjs/ag-grid-plus/types.d.ts +53 -0
  12. package/dist/cjs/ag-grid-plus/utils/entityExtensionColumns.d.ts +22 -0
  13. package/dist/cjs/ag-grid-plus/utils/entityExtensionColumns.js +138 -0
  14. package/dist/esm/ag-grid-plus/ag-gridPlus.js +48 -6
  15. package/dist/esm/ag-grid-plus/context/gridContext.d.ts +19 -0
  16. package/dist/esm/ag-grid-plus/context/useSchemeDataFlow.d.ts +8 -0
  17. package/dist/esm/ag-grid-plus/context/useSchemeDataFlow.js +62 -1
  18. package/dist/esm/ag-grid-plus/index.d.ts +2 -0
  19. package/dist/esm/ag-grid-plus/index.js +5 -0
  20. package/dist/esm/ag-grid-plus/interface.d.ts +9 -0
  21. package/dist/esm/ag-grid-plus/setting/ColumnSetting.js +8 -2
  22. package/dist/esm/ag-grid-plus/shared/storage/localStorageAdapter.js +34 -6
  23. package/dist/esm/ag-grid-plus/shared/storage/schemeStorageAdapter.d.ts +2 -0
  24. package/dist/esm/ag-grid-plus/types.d.ts +53 -0
  25. package/dist/esm/ag-grid-plus/utils/entityExtensionColumns.d.ts +22 -0
  26. package/dist/esm/ag-grid-plus/utils/entityExtensionColumns.js +138 -0
  27. package/dist/esm/standardFormDialog/withStandardForm.d.ts +2 -2
  28. package/dist/umd/qc-ui.min.js +1 -1
  29. package/package.json +1 -1
@@ -35,7 +35,8 @@ var _schemeDataMigration = require("./shared/utils/schemeDataMigration");
35
35
  var _sanitize = require("./utils/sanitize");
36
36
  var _errors = require("./errors");
37
37
  var _logger = require("./utils/logger");
38
- var _excluded = ["style", "loading", "params", "request", "dataSource", "treeKeyName", "treeParentName", "rowData", "gridRef", "headerTitle", "toolBarRender", "search", "hideTool", "onGridReady", "gridKey", "children", "defaultSearchExpand", "overlayNoRowsTemplateText", "queryDefaultRows", "onSelectedRowsChange", "enableClickSelection", "rowSelection", "useNativeTreeFilter"];
38
+ var _entityExtensionColumns = require("./utils/entityExtensionColumns");
39
+ var _excluded = ["style", "loading", "params", "request", "dataSource", "treeKeyName", "treeParentName", "rowData", "gridRef", "headerTitle", "toolBarRender", "search", "hideTool", "onGridReady", "gridKey", "children", "defaultSearchExpand", "overlayNoRowsTemplateText", "queryDefaultRows", "onSelectedRowsChange", "enableClickSelection", "rowSelection", "useNativeTreeFilter", "entityType"];
39
40
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
40
41
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
41
42
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@@ -93,6 +94,7 @@ function AgGridPlus(props) {
93
94
  propsRowSelection = props.rowSelection,
94
95
  _props$useNativeTreeF = props.useNativeTreeFilter,
95
96
  useNativeTreeFilter = _props$useNativeTreeF === void 0 ? false : _props$useNativeTreeF,
97
+ entityType = props.entityType,
96
98
  rest = _objectWithoutProperties(props, _excluded);
97
99
  var _useGridPlusColumnSta = (0, _.useGridPlusColumnState)(),
98
100
  onSaveColumnState = _useGridPlusColumnSta.onSaveColumnState,
@@ -104,7 +106,8 @@ function AgGridPlus(props) {
104
106
  globalConfigPermissions = _useGridPlusColumnSta.globalConfigPermissions,
105
107
  applySchemeToGlobal = _useGridPlusColumnSta.applySchemeToGlobal,
106
108
  resetToGlobal = _useGridPlusColumnSta.resetToGlobal,
107
- resetAllUsers = _useGridPlusColumnSta.resetAllUsers;
109
+ resetAllUsers = _useGridPlusColumnSta.resetAllUsers,
110
+ hostEntityExtensions = _useGridPlusColumnSta.hostEntityExtensions;
108
111
  var gridRef = (0, _react.useRef)();
109
112
  var apiRef = (0, _react.useRef)();
110
113
  var allColDefsRef = (0, _react.useRef)([]);
@@ -282,7 +285,9 @@ function AgGridPlus(props) {
282
285
  currentQuerySchemes = schemeDataFlow.querySchemes,
283
286
  currentQueryScheme = schemeDataFlow.currentQueryScheme,
284
287
  derivedColumnDefs = schemeDataFlow.derivedColumnDefs,
285
- derivedColumnState = schemeDataFlow.derivedColumnState;
288
+ derivedColumnState = schemeDataFlow.derivedColumnState,
289
+ isUsingGlobalFallback = schemeDataFlow.isUsingGlobalFallback,
290
+ isUsingGlobalQueryFallback = schemeDataFlow.isUsingGlobalQueryFallback;
286
291
  (0, _react.useImperativeHandle)(propsGridRef, function () {
287
292
  return gridRef.current;
288
293
  });
@@ -615,6 +620,34 @@ function AgGridPlus(props) {
615
620
  cellRenderer: cellRenderer
616
621
  });
617
622
  });
623
+
624
+ // 【新增】基于 entityType 自动注入扩展列 @author nokecy
625
+ // 从 context 的 hostEntityExtensions 获取对应实体的扩展字段并转换为列定义
626
+ if (entityType && hostEntityExtensions) {
627
+ var extensionCols = (0, _entityExtensionColumns.getEntityExtensionColumns)(entityType, hostEntityExtensions);
628
+ if (extensionCols.length > 0) {
629
+ // 查找操作列位置(pinned='right' 或 field='action')
630
+ var actionIndex = columnDefs.findIndex(function (col) {
631
+ return col.field === 'action' || col.pinned === 'right';
632
+ });
633
+ if (actionIndex === -1) {
634
+ var _columnDefs;
635
+ // 没有操作列,直接追加到末尾
636
+ (_columnDefs = columnDefs).push.apply(_columnDefs, _toConsumableArray(extensionCols));
637
+ } else {
638
+ var _columnDefs2;
639
+ // 插入到操作列之前
640
+ (_columnDefs2 = columnDefs).splice.apply(_columnDefs2, [actionIndex, 0].concat(_toConsumableArray(extensionCols)));
641
+ }
642
+ _logger.logger.debug('[AgGridPlus] 已注入实体扩展列', {
643
+ entityType: entityType,
644
+ extensionColsCount: extensionCols.length,
645
+ extensionCols: extensionCols.map(function (c) {
646
+ return c.field;
647
+ })
648
+ });
649
+ }
650
+ }
618
651
  return columnDefs;
619
652
  };
620
653
 
@@ -641,7 +674,7 @@ function AgGridPlus(props) {
641
674
  });
642
675
  }
643
676
  return cols;
644
- }, [_react.default.Children.count(children), props.columnDefs, extensibleColumns, gridKey]);
677
+ }, [_react.default.Children.count(children), props.columnDefs, extensibleColumns, gridKey, entityType, hostEntityExtensions]);
645
678
 
646
679
  // 稳定化 gridParams 和 sortColumn 的引用
647
680
  var stableGridParams = (0, _react.useMemo)(function () {
@@ -1262,7 +1295,12 @@ function AgGridPlus(props) {
1262
1295
  globalConfigPermissions: globalConfigPermissions,
1263
1296
  applySchemeToGlobal: applySchemeToGlobal,
1264
1297
  resetToGlobal: resetToGlobal,
1265
- resetAllUsers: resetAllUsers
1298
+ resetAllUsers: resetAllUsers,
1299
+ // ========== 全局方案回退状态 @author nokecy ==========
1300
+ isUsingGlobalFallback: isUsingGlobalFallback,
1301
+ isUsingGlobalQueryFallback: isUsingGlobalQueryFallback,
1302
+ // ========== 实体扩展字段配置 @author nokecy ==========
1303
+ hostEntityExtensions: hostEntityExtensions
1266
1304
  };
1267
1305
  }, [extensibleColumns, gridPlusColumnState, allColDefsRef.current,
1268
1306
  // 【修复】添加到依赖数组
@@ -1272,7 +1310,11 @@ function AgGridPlus(props) {
1272
1310
  // 方案管理依赖
1273
1311
  columnSchemes, querySchemes, currentSchemes, schemesLoading, lastSyncTime, saveColumnScheme, deleteColumnScheme, saveQueryScheme, deleteQueryScheme, setCurrentColumnScheme, setCurrentQueryScheme, refreshSchemes, getColumnSchemes, getQuerySchemes, getCurrentScheme,
1274
1312
  // 全局配置依赖
1275
- globalConfigPermissions, applySchemeToGlobal, resetToGlobal, resetAllUsers]);
1313
+ globalConfigPermissions, applySchemeToGlobal, resetToGlobal, resetAllUsers,
1314
+ // 全局方案回退状态依赖 @author nokecy
1315
+ isUsingGlobalFallback, isUsingGlobalQueryFallback,
1316
+ // 实体扩展字段配置依赖 @author nokecy
1317
+ hostEntityExtensions]);
1276
1318
  return /*#__PURE__*/_react.default.createElement(_gridContext.GridPlusContext.Provider, {
1277
1319
  value: gridPlusContextValue
1278
1320
  }, /*#__PURE__*/_react.default.createElement(_antd.Spin, {
@@ -1,6 +1,7 @@
1
1
  import React from "react";
2
2
  import type { ColumnScheme, QueryScheme, CurrentSchemeDto } from "../shared/storage/schemeStorageAdapter";
3
3
  import type { GlobalConfigPermissions } from '../shared/permissions/globalConfigPermissions';
4
+ import type { HostEntityExtensions } from '../types';
4
5
  /**
5
6
  * 方案管理 API 接口
6
7
  *
@@ -166,5 +167,23 @@ export interface GridPlusContextValue extends SchemeManagementAPI {
166
167
  * 由使用端(业务应用)传入,用于前端根据权限动态显示/隐藏操作按钮
167
168
  */
168
169
  globalConfigPermissions?: GlobalConfigPermissions;
170
+ /**
171
+ * 是否使用全局列方案作为回退
172
+ * 当没有用户方案时自动使用全局方案,此时为 true
173
+ */
174
+ isUsingGlobalFallback?: boolean;
175
+ /**
176
+ * 是否使用全局查询方案作为回退
177
+ */
178
+ isUsingGlobalQueryFallback?: boolean;
179
+ /**
180
+ * 实体扩展字段配置映射
181
+ * key: 实体类型全名 (如 "Burn.Product.Domain.Product")
182
+ * value: 该实体的扩展配置(包含字段定义数组)
183
+ *
184
+ * 来自后端 ABP 配置的 extraProperties.hostEntityExtensions
185
+ * 用于 AgGridPlus 根据 entityType 属性自动注入扩展列
186
+ */
187
+ hostEntityExtensions?: HostEntityExtensions;
169
188
  }
170
189
  export declare const GridPlusContext: React.Context<GridPlusContextValue>;
@@ -32,9 +32,13 @@ export declare function useSchemeSource(gridKey: string, schemeData: SchemeData)
32
32
  columnSchemes: ColumnScheme[];
33
33
  currentColumnSchemeId: string | null | undefined;
34
34
  currentColumnScheme: ColumnScheme | undefined;
35
+ /** 是否使用全局方案作为回退(没有用户方案时自动使用全局方案) */
36
+ isUsingGlobalFallback: boolean;
35
37
  querySchemes: QueryScheme[];
36
38
  currentQuerySchemeId: string | null | undefined;
37
39
  currentQueryScheme: QueryScheme | undefined;
40
+ /** 是否使用全局查询方案作为回退 */
41
+ isUsingGlobalQueryFallback: boolean;
38
42
  };
39
43
  /**
40
44
  * 派生层 - 计算 Grid 状态(只读派生)
@@ -83,7 +87,11 @@ export declare function useSchemeDataFlow(gridKey: string, allColDefs: ExtendedC
83
87
  columnSchemes: ColumnScheme[];
84
88
  currentColumnSchemeId: string | null | undefined;
85
89
  currentColumnScheme: ColumnScheme | undefined;
90
+ /** 是否使用全局方案作为回退(没有用户方案时自动使用全局方案) */
91
+ isUsingGlobalFallback: boolean;
86
92
  querySchemes: QueryScheme[];
87
93
  currentQuerySchemeId: string | null | undefined;
88
94
  currentQueryScheme: QueryScheme | undefined;
95
+ /** 是否使用全局查询方案作为回退 */
96
+ isUsingGlobalQueryFallback: boolean;
89
97
  };
@@ -47,23 +47,84 @@ function useSchemeSource(gridKey, schemeData) {
47
47
  var _currentSchemes$gridK, _currentSchemes$gridK2;
48
48
  var schemes = (columnSchemes === null || columnSchemes === void 0 ? void 0 : columnSchemes[gridKey]) || [];
49
49
  var currentColumnSchemeId = currentSchemes === null || currentSchemes === void 0 || (_currentSchemes$gridK = currentSchemes[gridKey]) === null || _currentSchemes$gridK === void 0 ? void 0 : _currentSchemes$gridK.columnSchemeId;
50
+
51
+ // 优先使用当前用户方案,如果没有则自动使用全局方案
52
+ // @author nokecy
50
53
  var currentColumnScheme = schemes.find(function (s) {
51
54
  return s.id === currentColumnSchemeId;
52
55
  });
56
+ var isUsingGlobalFallback = false;
57
+ if (!currentColumnScheme && schemes.length > 0) {
58
+ // 没有当前用户方案,查找全局方案
59
+ var globalSchemes = schemes.filter(function (s) {
60
+ return s.isGlobal === true;
61
+ });
62
+
63
+ // 多个全局方案警告 @author nokecy
64
+ if (globalSchemes.length > 1) {
65
+ console.warn('[useSchemeSource] 检测到多个全局方案,将使用第一个', {
66
+ gridKey: gridKey,
67
+ globalSchemeCount: globalSchemes.length,
68
+ globalSchemes: globalSchemes.map(function (s) {
69
+ return {
70
+ id: s.id,
71
+ name: s.name
72
+ };
73
+ })
74
+ });
75
+ }
76
+ var globalScheme = globalSchemes[0];
77
+ if (globalScheme) {
78
+ currentColumnScheme = globalScheme;
79
+ isUsingGlobalFallback = true;
80
+ }
81
+ }
53
82
  var querySchemeList = (querySchemes === null || querySchemes === void 0 ? void 0 : querySchemes[gridKey]) || [];
54
83
  var currentQuerySchemeId = currentSchemes === null || currentSchemes === void 0 || (_currentSchemes$gridK2 = currentSchemes[gridKey]) === null || _currentSchemes$gridK2 === void 0 ? void 0 : _currentSchemes$gridK2.querySchemeId;
84
+
85
+ // 查询方案也采用相同的回退逻辑
86
+ // @author nokecy
55
87
  var currentQueryScheme = querySchemeList.find(function (s) {
56
88
  return s.id === currentQuerySchemeId;
57
89
  });
90
+ var isUsingGlobalQueryFallback = false;
91
+ if (!currentQueryScheme && querySchemeList.length > 0) {
92
+ var globalQuerySchemes = querySchemeList.filter(function (s) {
93
+ return s.isGlobal === true;
94
+ });
95
+
96
+ // 多个全局查询方案警告 @author nokecy
97
+ if (globalQuerySchemes.length > 1) {
98
+ console.warn('[useSchemeSource] 检测到多个全局查询方案,将使用第一个', {
99
+ gridKey: gridKey,
100
+ globalSchemeCount: globalQuerySchemes.length,
101
+ globalSchemes: globalQuerySchemes.map(function (s) {
102
+ return {
103
+ id: s.id,
104
+ name: s.name
105
+ };
106
+ })
107
+ });
108
+ }
109
+ var globalQueryScheme = globalQuerySchemes[0];
110
+ if (globalQueryScheme) {
111
+ currentQueryScheme = globalQueryScheme;
112
+ isUsingGlobalQueryFallback = true;
113
+ }
114
+ }
58
115
  return {
59
116
  // 列方案
60
117
  columnSchemes: schemes,
61
118
  currentColumnSchemeId: currentColumnSchemeId,
62
119
  currentColumnScheme: currentColumnScheme,
120
+ /** 是否使用全局方案作为回退(没有用户方案时自动使用全局方案) */
121
+ isUsingGlobalFallback: isUsingGlobalFallback,
63
122
  // 查询方案
64
123
  querySchemes: querySchemeList,
65
124
  currentQuerySchemeId: currentQuerySchemeId,
66
- currentQueryScheme: currentQueryScheme
125
+ currentQueryScheme: currentQueryScheme,
126
+ /** 是否使用全局查询方案作为回退 */
127
+ isUsingGlobalQueryFallback: isUsingGlobalQueryFallback
67
128
  };
68
129
  }, [columnSchemes, querySchemes, currentSchemes, gridKey]);
69
130
  }
@@ -13,3 +13,5 @@ export type { UseSchemeManagerConfig } from "./context/useSchemeManager";
13
13
  export type { BackendApiAdapterConfig } from "./shared/storage/backendApiAdapter";
14
14
  export type { LocalStorageAdapterConfig } from "./shared/storage/localStorageAdapter";
15
15
  export type { GlobalConfigPermissions } from "./shared/permissions/globalConfigPermissions";
16
+ export type { EntityExtensionField, EntityExtensionConfig, HostEntityExtensions } from "./types";
17
+ export { fieldToColumnDef, getEntityExtensionColumns } from "./utils/entityExtensionColumns";
@@ -57,6 +57,12 @@ Object.defineProperty(exports, "dateValueFormatter", {
57
57
  return _utils.dateValueFormatter;
58
58
  }
59
59
  });
60
+ Object.defineProperty(exports, "fieldToColumnDef", {
61
+ enumerable: true,
62
+ get: function get() {
63
+ return _entityExtensionColumns.fieldToColumnDef;
64
+ }
65
+ });
60
66
  Object.defineProperty(exports, "flatten", {
61
67
  enumerable: true,
62
68
  get: function get() {
@@ -69,6 +75,12 @@ Object.defineProperty(exports, "flattenTreeDeep", {
69
75
  return _utils.flattenTreeDeep;
70
76
  }
71
77
  });
78
+ Object.defineProperty(exports, "getEntityExtensionColumns", {
79
+ enumerable: true,
80
+ get: function get() {
81
+ return _entityExtensionColumns.getEntityExtensionColumns;
82
+ }
83
+ });
72
84
  Object.defineProperty(exports, "toTree", {
73
85
  enumerable: true,
74
86
  get: function get() {
@@ -101,4 +113,5 @@ var _utils = require("./utils");
101
113
  var _useSchemeManager = require("./context/useSchemeManager");
102
114
  var _localStorageAdapter = require("./shared/storage/localStorageAdapter");
103
115
  var _backendApiAdapter = require("./shared/storage/backendApiAdapter");
116
+ var _entityExtensionColumns = require("./utils/entityExtensionColumns");
104
117
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@@ -95,6 +95,15 @@ interface GridProps extends AgGridReactProps {
95
95
  * @default false
96
96
  */
97
97
  useNativeTreeFilter?: boolean;
98
+ /**
99
+ * 实体类型全名,用于自动注入扩展字段列
100
+ * 当配置此属性时,组件会自动从 context 的 hostEntityExtensions
101
+ * 获取对应实体的扩展字段并转换为列定义
102
+ *
103
+ * @example "Burn.Product.Domain.Product"
104
+ * @author nokecy
105
+ */
106
+ entityType?: string;
98
107
  }
99
108
  interface AgGridColumnPropsClone extends ColDef {
100
109
  /**
@@ -68,7 +68,8 @@ var ColumnSetting = function ColumnSetting(_ref) {
68
68
  applySchemeToGlobal = _useGridSchemes.applySchemeToGlobal,
69
69
  resetToGlobal = _useGridSchemes.resetToGlobal,
70
70
  resetAllUsers = _useGridSchemes.resetAllUsers,
71
- globalConfigPermissions = _useGridSchemes.globalConfigPermissions;
71
+ globalConfigPermissions = _useGridSchemes.globalConfigPermissions,
72
+ isUsingGlobalFallback = _useGridSchemes.isUsingGlobalFallback;
72
73
 
73
74
  // 解构权限信息
74
75
  var canApplyToGlobal = (_globalConfigPermissi = globalConfigPermissions === null || globalConfigPermissions === void 0 ? void 0 : globalConfigPermissions.canApplyToGlobal) !== null && _globalConfigPermissi !== void 0 ? _globalConfigPermissi : false;
@@ -1162,7 +1163,12 @@ var ColumnSetting = function ColumnSetting(_ref) {
1162
1163
  fontWeight: 'normal',
1163
1164
  color: '#1890ff'
1164
1165
  }
1165
- }, "- \u5F53\u524D\u65B9\u6848: ", currentScheme.name)),
1166
+ }, "- \u5F53\u524D\u65B9\u6848: ", currentScheme.name, isUsingGlobalFallback && currentScheme.isGlobal && /*#__PURE__*/_react.default.createElement(_antd.Tag, {
1167
+ color: "orange",
1168
+ style: {
1169
+ marginLeft: 8
1170
+ }
1171
+ }, "\u81EA\u52A8\u4F7F\u7528\u5168\u5C40"))),
1166
1172
  open: visible,
1167
1173
  onCancel: handleClose,
1168
1174
  width: 1100,
@@ -5,9 +5,9 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.defaultLocalStorageAdapter = exports.LocalStorageSchemeAdapter = void 0;
7
7
  function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
8
+ function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
8
9
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
9
10
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
10
- function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
11
11
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
12
12
  function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
13
13
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
@@ -115,13 +115,35 @@ var LocalStorageSchemeAdapter = exports.LocalStorageSchemeAdapter = /*#__PURE__*
115
115
  while (1) switch (_context.prev = _context.next) {
116
116
  case 0:
117
117
  this.log('加载所有方案数据');
118
- data = this.readData();
118
+ data = this.readData(); // 【修复】确保所有方案都有 isGlobal 字段
119
+ // 如果没有设置,默认为 false(非全局方案)
120
+ // @author nokecy
121
+ if (data.columnSchemes) {
122
+ Object.keys(data.columnSchemes).forEach(function (gridId) {
123
+ data.columnSchemes[gridId] = data.columnSchemes[gridId].map(function (scheme) {
124
+ var _scheme$isGlobal;
125
+ return _objectSpread(_objectSpread({}, scheme), {}, {
126
+ isGlobal: (_scheme$isGlobal = scheme.isGlobal) !== null && _scheme$isGlobal !== void 0 ? _scheme$isGlobal : false
127
+ });
128
+ });
129
+ });
130
+ }
131
+ if (data.querySchemes) {
132
+ Object.keys(data.querySchemes).forEach(function (gridId) {
133
+ data.querySchemes[gridId] = data.querySchemes[gridId].map(function (scheme) {
134
+ var _isGlobal;
135
+ return _objectSpread(_objectSpread({}, scheme), {}, {
136
+ isGlobal: (_isGlobal = scheme.isGlobal) !== null && _isGlobal !== void 0 ? _isGlobal : false
137
+ });
138
+ });
139
+ });
140
+ }
119
141
  this.log('加载完成', {
120
142
  columnSchemes: Object.keys(data.columnSchemes).length,
121
143
  querySchemes: Object.keys(data.querySchemes).length
122
144
  });
123
145
  return _context.abrupt("return", data);
124
- case 4:
146
+ case 6:
125
147
  case "end":
126
148
  return _context.stop();
127
149
  }
@@ -136,7 +158,8 @@ var LocalStorageSchemeAdapter = exports.LocalStorageSchemeAdapter = /*#__PURE__*
136
158
  key: "saveColumnScheme",
137
159
  value: function () {
138
160
  var _saveColumnScheme = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(gridId, scheme) {
139
- var data, index, newScheme;
161
+ var _savedScheme$isGlobal;
162
+ var data, index, newScheme, savedScheme;
140
163
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
141
164
  while (1) switch (_context2.prev = _context2.next) {
142
165
  case 0:
@@ -163,8 +186,13 @@ var LocalStorageSchemeAdapter = exports.LocalStorageSchemeAdapter = /*#__PURE__*
163
186
  this.log("\u65B0\u589E\u5217\u65B9\u6848: ".concat(gridId, " - ").concat(scheme.name));
164
187
  }
165
188
  this.writeData(data);
166
- return _context2.abrupt("return", data.columnSchemes[gridId][index >= 0 ? index : data.columnSchemes[gridId].length - 1]);
167
- case 6:
189
+
190
+ // 【修复】确保返回的方案包含 isGlobal 字段 @author nokecy
191
+ savedScheme = data.columnSchemes[gridId][index >= 0 ? index : data.columnSchemes[gridId].length - 1];
192
+ return _context2.abrupt("return", _objectSpread(_objectSpread({}, savedScheme), {}, {
193
+ isGlobal: (_savedScheme$isGlobal = savedScheme.isGlobal) !== null && _savedScheme$isGlobal !== void 0 ? _savedScheme$isGlobal : false
194
+ }));
195
+ case 7:
168
196
  case "end":
169
197
  return _context2.stop();
170
198
  }
@@ -75,6 +75,8 @@ export interface QueryScheme {
75
75
  updatedAt?: number;
76
76
  /** 创建用户ID(可选) */
77
77
  createdBy?: string;
78
+ /** 是否为全局方案 @author nokecy */
79
+ isGlobal?: boolean;
78
80
  }
79
81
  /**
80
82
  * 列方案(集中式 API 使用)
@@ -310,3 +310,56 @@ export type RowDataArray<T = any> = T[];
310
310
  * 查询表单项数组类型
311
311
  */
312
312
  export type QueryFormItems = QueryFormItem[];
313
+ /**
314
+ * 扩展字段定义
315
+ * 来自后端 ABP 配置的 hostEntityExtensions
316
+ */
317
+ export interface EntityExtensionField {
318
+ /** 字段名称 */
319
+ name: string;
320
+ /** 显示名称 */
321
+ displayName: string;
322
+ /** 描述信息 */
323
+ description?: string | null;
324
+ /** 数据类型: String, Int, Long, Decimal, Double, Float, Boolean, DateTime, Date, Guid, Enum, Text */
325
+ dataType: string;
326
+ /** 最大长度(字符串类型) */
327
+ maxLength?: number | null;
328
+ /** 精度(数值类型) */
329
+ precision?: number | null;
330
+ /** 小数位数(数值类型) */
331
+ scale?: number | null;
332
+ /** 是否必填 */
333
+ isRequired?: boolean;
334
+ /** 排序顺序 */
335
+ sortOrder?: number;
336
+ /** UI 组件类型 */
337
+ uiComponent?: string | null;
338
+ /** 占位符文本 */
339
+ placeholder?: string | null;
340
+ /** 默认值 */
341
+ defaultValue?: any;
342
+ /** 组件属性(JSON 字符串) */
343
+ componentProps?: string | null;
344
+ /** 验证规则(JSON 字符串) */
345
+ validationRules?: string | null;
346
+ }
347
+ /**
348
+ * 单个实体的扩展配置
349
+ */
350
+ export interface EntityExtensionConfig {
351
+ /** 实体类型全名 (如 "Burn.Product.Domain.Product") */
352
+ entityType: string;
353
+ /** 实体显示名称 */
354
+ displayName: string;
355
+ /** 模块名称 */
356
+ moduleName: string;
357
+ /** 扩展字段列表 */
358
+ fields: EntityExtensionField[];
359
+ }
360
+ /**
361
+ * 所有实体扩展配置映射
362
+ * key: 实体类型全名
363
+ * value: 该实体的扩展配置
364
+ */
365
+ export type HostEntityExtensions = Record<string, EntityExtensionConfig>;
@@ -0,0 +1,22 @@
1
+ /**
2
+ * 实体扩展字段列转换工具
3
+ * 将后端 ABP 配置的扩展字段转换为 AG-Grid 列定义
4
+ *
5
+ * @author nokecy
6
+ */
7
+ import type { ExtendedColDef, EntityExtensionField, HostEntityExtensions } from '../types';
8
+ /**
9
+ * 将单个扩展字段转换为列定义
10
+ *
11
+ * @param field 扩展字段定义
12
+ * @returns AG-Grid 列定义
13
+ */
14
+ export declare function fieldToColumnDef(field: EntityExtensionField): ExtendedColDef;
15
+ /**
16
+ * 获取指定实体的扩展列定义
17
+ *
18
+ * @param entityType 实体类型全名 (如 "Burn.Product.Domain.Product")
19
+ * @param extensions 实体扩展配置映射
20
+ * @returns 扩展列定义数组,按 sortOrder 排序
21
+ */
22
+ export declare function getEntityExtensionColumns(entityType: string | undefined, extensions?: HostEntityExtensions): ExtendedColDef[];