@kmkf-fe-packages/kmkf-work-order-service-component 2.2.5-beta.2 → 2.2.5-beta.21

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 (24) hide show
  1. package/dist/esm/FlowTemplateDetailV2/components/FormRender/component-dependency-finder.d.ts +75 -0
  2. package/dist/esm/FlowTemplateDetailV2/components/FormRender/component-dependency-finder.js +328 -0
  3. package/dist/esm/FlowTemplateDetailV2/components/FormRender/index.js +378 -257
  4. package/dist/esm/FlowTemplateDetailV2/components/FormRender/onBlur.d.ts +6 -0
  5. package/dist/esm/FlowTemplateDetailV2/components/FormRender/onBlur.js +67 -1
  6. package/dist/esm/FlowTemplateDetailV2/components/FormRender/types.d.ts +41 -0
  7. package/dist/esm/FlowTemplateDetailV2/components/FormRender/types.js +1 -0
  8. package/dist/esm/FlowTemplateDetailV2/components/FormRender/value-mapping-finder.d.ts +61 -0
  9. package/dist/esm/FlowTemplateDetailV2/components/FormRender/value-mapping-finder.js +292 -0
  10. package/dist/esm/FlowTemplateDetailV2/components/FormRender/value-mapping-types.d.ts +65 -0
  11. package/dist/esm/FlowTemplateDetailV2/components/FormRender/value-mapping-types.js +1 -0
  12. package/dist/esm/FlowTemplateDetailV2/components/ShareLinkModal/index.d.ts +0 -1
  13. package/dist/esm/FlowTemplateDetailV2/components/ShareLinkModal/index.js +25 -26
  14. package/dist/esm/FlowTemplateDetailV2/components/ShareLinkModal/index.module.less +2 -2
  15. package/dist/esm/FlowTemplateDetailV2/index.js +37 -27
  16. package/dist/esm/FlowTemplateDetailV2/store/reducers.d.ts +2 -0
  17. package/dist/esm/FlowTemplateDetailV2/store/reducers.js +13 -7
  18. package/dist/esm/FlowTemplateDetailV2/store/selector.d.ts +1 -0
  19. package/dist/esm/FlowTemplateDetailV2/store/selector.js +3 -0
  20. package/dist/esm/common/utils/tools.js +20 -12
  21. package/dist/esm/model/flowTemplateDetail/api.js +2 -1
  22. package/dist/esm/model/flowTemplateDetail/types.d.ts +1 -0
  23. package/dist/esm/model/servers/request.js +1 -1
  24. package/package.json +5 -5
@@ -30,3 +30,9 @@ export declare const onBlurSkxLogisticsCode: ({ form, value, templateDetail, com
30
30
  templateDetail: any;
31
31
  componentOnBlur: (value: any, type: string) => Promise<void>;
32
32
  }) => Promise<void>;
33
+ export declare const onBlurSkxReturnTHLogisticsCode: ({ form, value, templateDetail, componentOnBlur, }: {
34
+ form: FormInstance;
35
+ value: string;
36
+ templateDetail: any;
37
+ componentOnBlur: (value: any, type: string) => Promise<void>;
38
+ }) => Promise<void>;
@@ -286,7 +286,7 @@ export var onBlurSkxLogisticsCode = /*#__PURE__*/function () {
286
286
  case 6:
287
287
  _context8.next = 8;
288
288
  return servers.SKX.queryReturnOrderDetailSingleton({
289
- logisticsCode: value
289
+ expressCode: value
290
290
  }).then( /*#__PURE__*/function () {
291
291
  var _ref13 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(res) {
292
292
  var data, tradeId, oldValue, blurPromise;
@@ -325,4 +325,70 @@ export var onBlurSkxLogisticsCode = /*#__PURE__*/function () {
325
325
  return function onBlurSkxLogisticsCode(_x7) {
326
326
  return _ref12.apply(this, arguments);
327
327
  };
328
+ }();
329
+ export var onBlurSkxReturnTHLogisticsCode = /*#__PURE__*/function () {
330
+ var _ref15 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10(_ref14) {
331
+ var form, value, templateDetail, componentOnBlur, hasSkxReturnBillNoComponent;
332
+ return _regeneratorRuntime().wrap(function _callee10$(_context10) {
333
+ while (1) switch (_context10.prev = _context10.next) {
334
+ case 0:
335
+ form = _ref14.form, value = _ref14.value, templateDetail = _ref14.templateDetail, componentOnBlur = _ref14.componentOnBlur;
336
+ if (value) {
337
+ _context10.next = 3;
338
+ break;
339
+ }
340
+ return _context10.abrupt("return");
341
+ case 3:
342
+ hasSkxReturnBillNoComponent = templateDetail.componentDtoList.some(function (item) {
343
+ return item.workOrderComponentType === 'SKX_RETURN_BILL_NO';
344
+ });
345
+ if (hasSkxReturnBillNoComponent) {
346
+ _context10.next = 6;
347
+ break;
348
+ }
349
+ return _context10.abrupt("return");
350
+ case 6:
351
+ _context10.next = 8;
352
+ return servers.SKX.queryReturnOrderDetailSingleton({
353
+ expressCode: value
354
+ }).then( /*#__PURE__*/function () {
355
+ var _ref16 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(res) {
356
+ var _list$;
357
+ var data, list, oldValue, returnBillNo, blurPromise;
358
+ return _regeneratorRuntime().wrap(function _callee9$(_context9) {
359
+ while (1) switch (_context9.prev = _context9.next) {
360
+ case 0:
361
+ data = res.data;
362
+ list = (data === null || data === void 0 ? void 0 : data.skqReturnOrderDetailInfoDtos) || [];
363
+ oldValue = form.getFieldValue('4487c6516b');
364
+ returnBillNo = (list === null || list === void 0 ? void 0 : list.length) === 1 ? (_list$ = list[0]) === null || _list$ === void 0 ? void 0 : _list$.returnBillNo : ''; // 创建一个异步操作的Promise
365
+ blurPromise = componentOnBlur(returnBillNo, 'skxReturnBillNo'); // 等待异步操作完成后再执行setTimeout
366
+ _context9.next = 7;
367
+ return blurPromise;
368
+ case 7:
369
+ // // 所有异步操作完成后执行
370
+
371
+ form.setFieldsValue({
372
+ fe10d6f36b: returnBillNo,
373
+ '4487c6516b': oldValue
374
+ });
375
+ case 8:
376
+ case "end":
377
+ return _context9.stop();
378
+ }
379
+ }, _callee9);
380
+ }));
381
+ return function (_x10) {
382
+ return _ref16.apply(this, arguments);
383
+ };
384
+ }()).catch(console.debug);
385
+ case 8:
386
+ case "end":
387
+ return _context10.stop();
388
+ }
389
+ }, _callee10);
390
+ }));
391
+ return function onBlurSkxReturnTHLogisticsCode(_x9) {
392
+ return _ref15.apply(this, arguments);
393
+ };
328
394
  }();
@@ -0,0 +1,41 @@
1
+ /**
2
+ * 组件显隐配置相关类型定义
3
+ */
4
+ export declare type CompareSymbol = 'eq' | 'include' | 'ne' | 'gt' | 'lt' | 'gte' | 'lte';
5
+ export declare type LinkCondition = 'some' | 'every';
6
+ export interface Rule {
7
+ compareSymbol: CompareSymbol;
8
+ leftValue: string;
9
+ rightValue: string | string[] | number | boolean;
10
+ }
11
+ export interface RuleGroup {
12
+ linkCondition: LinkCondition;
13
+ rules: Rule[];
14
+ }
15
+ export declare type ComponentConfig = RuleGroup[];
16
+ export interface Config {
17
+ [componentKey: string]: ComponentConfig;
18
+ }
19
+ export interface DependencyGraph {
20
+ [componentKey: string]: string[];
21
+ }
22
+ export declare type CircularDependency = string[];
23
+ export interface DependencyLevels {
24
+ [level: number]: string[];
25
+ }
26
+ export interface ComponentStat {
27
+ key: string;
28
+ count: number;
29
+ }
30
+ export interface DependencyOptions {
31
+ maxDepth?: number;
32
+ includeCircular?: boolean;
33
+ }
34
+ export interface DependencyAnalysis {
35
+ componentKey: string;
36
+ directDependencies: string[];
37
+ allDependencies: string[];
38
+ dependencyCount: number;
39
+ dependencyLevels: DependencyLevels;
40
+ hasCircularDependency: boolean;
41
+ }
@@ -0,0 +1,61 @@
1
+ /**
2
+ * 组件值映射依赖关系查找器 - TypeScript ES Module版本
3
+ * 根据值映射配置查找组件之间的依赖关系
4
+ */
5
+ import type { ValueMappingConfig, ValueDependencyResult } from './value-mapping-types.js';
6
+ /**
7
+ * 查找组件的所有反向依赖(哪些组件会影响当前组件的值)
8
+ * @param targetComponentKey - 目标组件key
9
+ * @param config - 值映射配置对象
10
+ * @returns 反向依赖关系结果
11
+ */
12
+ export declare function findValueDependencies(targetComponentKey: string, config: ValueMappingConfig): ValueDependencyResult;
13
+ /**
14
+ * 查找所有组件的反向依赖关系
15
+ * @param config - 值映射配置对象
16
+ * @returns 所有组件的反向依赖关系图
17
+ */
18
+ export declare function buildValueDependencyGraph(config: ValueMappingConfig): Record<string, ValueDependencyResult>;
19
+ /**
20
+ * 查找特定源组件和值对目标组件的影响
21
+ * @param sourceComponentKey - 源组件key
22
+ * @param sourceValue - 源组件的值
23
+ * @param config - 值映射配置对象
24
+ * @returns 受影响的目标组件及其值
25
+ */
26
+ export declare function findTargetsBySourceValue(sourceComponentKey: string, sourceValue: string, config: ValueMappingConfig): Array<{
27
+ targetComponent: string;
28
+ targetValue: string;
29
+ }>;
30
+ /**
31
+ * 获取所有源组件的统计信息
32
+ * @param config - 值映射配置对象
33
+ * @returns 源组件统计信息
34
+ */
35
+ export declare function getSourceComponentStats(config: ValueMappingConfig): Array<{
36
+ componentKey: string;
37
+ valueCount: number;
38
+ targetCount: number;
39
+ totalMappings: number;
40
+ }>;
41
+ /**
42
+ * 查找值映射链(A影响B,B影响C的传递关系)
43
+ * @param startComponent - 起始组件
44
+ * @param config - 值映射配置对象
45
+ * @param maxDepth - 最大深度
46
+ * @returns 映射链
47
+ */
48
+ export declare function findValueMappingChain(startComponent: string, config: ValueMappingConfig, maxDepth?: number): Array<{
49
+ chain: string[];
50
+ depth: number;
51
+ }>;
52
+ /**
53
+ * 验证值映射配置的格式
54
+ * @param config - 要验证的配置对象
55
+ * @returns 验证结果
56
+ */
57
+ export declare function validateValueMappingConfig(config: unknown): {
58
+ isValid: boolean;
59
+ errors: string[];
60
+ warnings: string[];
61
+ };
@@ -0,0 +1,292 @@
1
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
2
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
3
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
4
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
5
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
6
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
7
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
8
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
9
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
10
+ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
11
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
12
+ /**
13
+ * 组件值映射依赖关系查找器 - TypeScript ES Module版本
14
+ * 根据值映射配置查找组件之间的依赖关系
15
+ */
16
+
17
+ /**
18
+ * 查找组件的所有反向依赖(哪些组件会影响当前组件的值)
19
+ * @param targetComponentKey - 目标组件key
20
+ * @param config - 值映射配置对象
21
+ * @returns 反向依赖关系结果
22
+ */
23
+ export function findValueDependencies(targetComponentKey, config) {
24
+ var dependencies = [];
25
+
26
+ // 遍历配置中的所有组件
27
+ Object.entries(config).forEach(function (_ref) {
28
+ var _ref2 = _slicedToArray(_ref, 2),
29
+ sourceComponentKey = _ref2[0],
30
+ componentMapping = _ref2[1];
31
+ // 跳过 SHOP_SELECT_MAPPING 等非组件映射的配置
32
+ if (_typeof(componentMapping) !== 'object' || componentMapping === null) {
33
+ return;
34
+ }
35
+ var sourceValues = [];
36
+ var mappingDetails = [];
37
+
38
+ // 遍历源组件的所有值映射
39
+ Object.entries(componentMapping).forEach(function (_ref3) {
40
+ var _ref4 = _slicedToArray(_ref3, 2),
41
+ sourceValue = _ref4[0],
42
+ valueMapping = _ref4[1];
43
+ // 检查这个值映射中是否包含目标组件
44
+ if (_typeof(valueMapping) === 'object' && valueMapping !== null) {
45
+ // 检查是否有目标组件的映射
46
+ if (targetComponentKey in valueMapping) {
47
+ var targetMapping = valueMapping[targetComponentKey];
48
+ var targetValue;
49
+
50
+ // 处理不同格式的目标值
51
+ if (typeof targetMapping === 'string') {
52
+ targetValue = targetMapping;
53
+ } else if (Array.isArray(targetMapping)) {
54
+ targetValue = targetMapping.join(', '); // 数组转为字符串
55
+ } else if (_typeof(targetMapping) === 'object' && targetMapping !== null && 'value' in targetMapping) {
56
+ targetValue = targetMapping.value;
57
+ } else {
58
+ return; // 跳过无效的映射
59
+ }
60
+
61
+ sourceValues.push(sourceValue);
62
+ mappingDetails.push({
63
+ sourceValue: sourceValue,
64
+ targetValue: targetValue
65
+ });
66
+ }
67
+ }
68
+ });
69
+
70
+ // 如果找到了依赖关系,添加到结果中
71
+ if (sourceValues.length > 0) {
72
+ dependencies.push({
73
+ sourceComponent: sourceComponentKey,
74
+ sourceValues: sourceValues,
75
+ mappingDetails: mappingDetails
76
+ });
77
+ }
78
+ });
79
+ return {
80
+ targetComponent: targetComponentKey,
81
+ dependencies: dependencies,
82
+ dependencyCount: dependencies.length,
83
+ totalMappings: dependencies.reduce(function (sum, dep) {
84
+ return sum + dep.mappingDetails.length;
85
+ }, 0)
86
+ };
87
+ }
88
+
89
+ /**
90
+ * 查找所有组件的反向依赖关系
91
+ * @param config - 值映射配置对象
92
+ * @returns 所有组件的反向依赖关系图
93
+ */
94
+ export function buildValueDependencyGraph(config) {
95
+ var dependencyGraph = {};
96
+
97
+ // 首先收集所有可能的目标组件
98
+ var allTargetComponents = new Set();
99
+ Object.values(config).forEach(function (componentMapping) {
100
+ if (_typeof(componentMapping) === 'object' && componentMapping !== null) {
101
+ Object.values(componentMapping).forEach(function (valueMapping) {
102
+ if (_typeof(valueMapping) === 'object' && valueMapping !== null) {
103
+ Object.keys(valueMapping).forEach(function (targetKey) {
104
+ allTargetComponents.add(targetKey);
105
+ });
106
+ }
107
+ });
108
+ }
109
+ });
110
+
111
+ // 为每个目标组件构建依赖关系
112
+ allTargetComponents.forEach(function (targetComponent) {
113
+ dependencyGraph[targetComponent] = findValueDependencies(targetComponent, config);
114
+ });
115
+ return dependencyGraph;
116
+ }
117
+
118
+ /**
119
+ * 查找特定源组件和值对目标组件的影响
120
+ * @param sourceComponentKey - 源组件key
121
+ * @param sourceValue - 源组件的值
122
+ * @param config - 值映射配置对象
123
+ * @returns 受影响的目标组件及其值
124
+ */
125
+ export function findTargetsBySourceValue(sourceComponentKey, sourceValue, config) {
126
+ var results = [];
127
+ var componentMapping = config[sourceComponentKey];
128
+ if (_typeof(componentMapping) !== 'object' || componentMapping === null) {
129
+ return results;
130
+ }
131
+ var valueMapping = componentMapping[sourceValue];
132
+ if (_typeof(valueMapping) !== 'object' || valueMapping === null) {
133
+ return results;
134
+ }
135
+ Object.entries(valueMapping).forEach(function (_ref5) {
136
+ var _ref6 = _slicedToArray(_ref5, 2),
137
+ targetComponent = _ref6[0],
138
+ targetMapping = _ref6[1];
139
+ var targetValue;
140
+ if (typeof targetMapping === 'string') {
141
+ targetValue = targetMapping;
142
+ } else if (Array.isArray(targetMapping)) {
143
+ targetValue = targetMapping.join(', '); // 数组转为字符串
144
+ } else if (_typeof(targetMapping) === 'object' && targetMapping !== null && 'value' in targetMapping) {
145
+ targetValue = targetMapping.value;
146
+ } else {
147
+ return; // 跳过无效的映射
148
+ }
149
+
150
+ results.push({
151
+ targetComponent: targetComponent,
152
+ targetValue: targetValue
153
+ });
154
+ });
155
+ return results;
156
+ }
157
+
158
+ /**
159
+ * 获取所有源组件的统计信息
160
+ * @param config - 值映射配置对象
161
+ * @returns 源组件统计信息
162
+ */
163
+ export function getSourceComponentStats(config) {
164
+ var stats = [];
165
+ Object.entries(config).forEach(function (_ref7) {
166
+ var _ref8 = _slicedToArray(_ref7, 2),
167
+ componentKey = _ref8[0],
168
+ componentMapping = _ref8[1];
169
+ if (_typeof(componentMapping) !== 'object' || componentMapping === null) {
170
+ return;
171
+ }
172
+ var allTargets = new Set();
173
+ var totalMappings = 0;
174
+ var valueCount = Object.keys(componentMapping).length;
175
+ Object.values(componentMapping).forEach(function (valueMapping) {
176
+ if (_typeof(valueMapping) === 'object' && valueMapping !== null) {
177
+ Object.keys(valueMapping).forEach(function (targetKey) {
178
+ allTargets.add(targetKey);
179
+ totalMappings++;
180
+ });
181
+ }
182
+ });
183
+ stats.push({
184
+ componentKey: componentKey,
185
+ valueCount: valueCount,
186
+ targetCount: allTargets.size,
187
+ totalMappings: totalMappings
188
+ });
189
+ });
190
+ return stats.sort(function (a, b) {
191
+ return b.totalMappings - a.totalMappings;
192
+ });
193
+ }
194
+
195
+ /**
196
+ * 查找值映射链(A影响B,B影响C的传递关系)
197
+ * @param startComponent - 起始组件
198
+ * @param config - 值映射配置对象
199
+ * @param maxDepth - 最大深度
200
+ * @returns 映射链
201
+ */
202
+ export function findValueMappingChain(startComponent, config) {
203
+ var maxDepth = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 3;
204
+ var chains = [];
205
+ var visited = new Set();
206
+ function dfs(currentComponent, path, depth) {
207
+ if (depth >= maxDepth || visited.has(currentComponent)) {
208
+ return;
209
+ }
210
+ visited.add(currentComponent);
211
+
212
+ // 查找当前组件影响的目标组件
213
+ var componentMapping = config[currentComponent];
214
+ if (_typeof(componentMapping) === 'object' && componentMapping !== null) {
215
+ var targets = new Set();
216
+ Object.values(componentMapping).forEach(function (valueMapping) {
217
+ if (_typeof(valueMapping) === 'object' && valueMapping !== null) {
218
+ Object.keys(valueMapping).forEach(function (targetKey) {
219
+ targets.add(targetKey);
220
+ });
221
+ }
222
+ });
223
+ targets.forEach(function (target) {
224
+ var newPath = [].concat(_toConsumableArray(path), [target]);
225
+ chains.push({
226
+ chain: newPath,
227
+ depth: depth + 1
228
+ });
229
+
230
+ // 递归查找更深层的链
231
+ dfs(target, newPath, depth + 1);
232
+ });
233
+ }
234
+ visited.delete(currentComponent);
235
+ }
236
+ dfs(startComponent, [startComponent], 0);
237
+ return chains.filter(function (chain) {
238
+ return chain.depth > 1;
239
+ }); // 只返回长度大于1的链
240
+ }
241
+
242
+ /**
243
+ * 验证值映射配置的格式
244
+ * @param config - 要验证的配置对象
245
+ * @returns 验证结果
246
+ */
247
+ export function validateValueMappingConfig(config) {
248
+ var errors = [];
249
+ var warnings = [];
250
+ if (!config || _typeof(config) !== 'object') {
251
+ errors.push('配置必须是一个对象');
252
+ return {
253
+ isValid: false,
254
+ errors: errors,
255
+ warnings: warnings
256
+ };
257
+ }
258
+ var configObj = config;
259
+ Object.entries(configObj).forEach(function (_ref9) {
260
+ var _ref10 = _slicedToArray(_ref9, 2),
261
+ componentKey = _ref10[0],
262
+ componentMapping = _ref10[1];
263
+ if (_typeof(componentMapping) !== 'object' || componentMapping === null) {
264
+ warnings.push("\u7EC4\u4EF6 ".concat(componentKey, " \u7684\u6620\u5C04\u4E0D\u662F\u5BF9\u8C61\uFF0C\u53EF\u80FD\u662F\u7279\u6B8A\u914D\u7F6E"));
265
+ return;
266
+ }
267
+ var mapping = componentMapping;
268
+ Object.entries(mapping).forEach(function (_ref11) {
269
+ var _ref12 = _slicedToArray(_ref11, 2),
270
+ value = _ref12[0],
271
+ valueMapping = _ref12[1];
272
+ if (_typeof(valueMapping) !== 'object' || valueMapping === null) {
273
+ warnings.push("\u7EC4\u4EF6 ".concat(componentKey, " \u7684\u503C ").concat(value, " \u7684\u6620\u5C04\u4E0D\u662F\u5BF9\u8C61"));
274
+ return;
275
+ }
276
+ var valueMappingObj = valueMapping;
277
+ Object.entries(valueMappingObj).forEach(function (_ref13) {
278
+ var _ref14 = _slicedToArray(_ref13, 2),
279
+ targetComponent = _ref14[0],
280
+ targetMapping = _ref14[1];
281
+ if (typeof targetMapping !== 'string' && !Array.isArray(targetMapping) && (_typeof(targetMapping) !== 'object' || targetMapping === null || !('value' in targetMapping))) {
282
+ errors.push("\u7EC4\u4EF6 ".concat(componentKey, " \u503C ").concat(value, " \u5230 ").concat(targetComponent, " \u7684\u6620\u5C04\u683C\u5F0F\u65E0\u6548"));
283
+ }
284
+ });
285
+ });
286
+ });
287
+ return {
288
+ isValid: errors.length === 0,
289
+ errors: errors,
290
+ warnings: warnings
291
+ };
292
+ }
@@ -0,0 +1,65 @@
1
+ /**
2
+ * 组件值映射相关类型定义
3
+ */
4
+ export interface TargetValueMapping {
5
+ value: string;
6
+ other?: string;
7
+ }
8
+ export declare type ValueMappingItem = string | TargetValueMapping | string[];
9
+ export interface SingleValueMapping {
10
+ [targetComponentKey: string]: ValueMappingItem;
11
+ }
12
+ export interface ComponentValueMapping {
13
+ [sourceValue: string]: SingleValueMapping;
14
+ }
15
+ export interface ValueMappingConfig {
16
+ [sourceComponentKey: string]: ComponentValueMapping | any;
17
+ }
18
+ export interface ValueDependencyResult {
19
+ targetComponent: string;
20
+ dependencies: Array<{
21
+ sourceComponent: string;
22
+ sourceValues: string[];
23
+ mappingDetails: Array<{
24
+ sourceValue: string;
25
+ targetValue: string;
26
+ }>;
27
+ }>;
28
+ dependencyCount: number;
29
+ totalMappings: number;
30
+ }
31
+ export interface SourceComponentStat {
32
+ componentKey: string;
33
+ valueCount: number;
34
+ targetCount: number;
35
+ totalMappings: number;
36
+ }
37
+ export interface MappingChainNode {
38
+ chain: string[];
39
+ depth: number;
40
+ }
41
+ export interface TargetImpact {
42
+ targetComponent: string;
43
+ targetValue: string;
44
+ }
45
+ export interface ValidationResult {
46
+ isValid: boolean;
47
+ errors: string[];
48
+ warnings: string[];
49
+ }
50
+ export interface ValueMappingAnalysis {
51
+ totalSourceComponents: number;
52
+ totalTargetComponents: number;
53
+ totalValueMappings: number;
54
+ mostComplexSource: SourceComponentStat | null;
55
+ mostDependedTarget: {
56
+ componentKey: string;
57
+ dependencyCount: number;
58
+ } | null;
59
+ longestChains: MappingChainNode[];
60
+ }
61
+ export interface ReverseLookupOptions {
62
+ includeEmptyValues?: boolean;
63
+ caseSensitive?: boolean;
64
+ exactMatch?: boolean;
65
+ }
@@ -1,4 +1,3 @@
1
1
  import React from 'react';
2
- import './index.module.less';
3
2
  declare const ShareLinkModal: React.ForwardRefExoticComponent<Omit<any, "ref"> & React.RefAttributes<any>>;
4
3
  export default ShareLinkModal;