@kmkf-fe-packages/kmkf-work-order-service-component 2.2.7 → 2.2.8
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/esm/FlowTemplateDetailV2/components/FormRender/component-dependency-finder.d.ts +75 -0
- package/dist/esm/FlowTemplateDetailV2/components/FormRender/component-dependency-finder.js +328 -0
- package/dist/esm/FlowTemplateDetailV2/components/FormRender/index.js +115 -46
- package/dist/esm/FlowTemplateDetailV2/components/FormRender/onBlur.d.ts +6 -0
- package/dist/esm/FlowTemplateDetailV2/components/FormRender/onBlur.js +112 -44
- package/dist/esm/FlowTemplateDetailV2/components/FormRender/types.d.ts +41 -0
- package/dist/esm/FlowTemplateDetailV2/components/FormRender/types.js +1 -0
- package/dist/esm/FlowTemplateDetailV2/components/FormRender/value-mapping-finder.d.ts +61 -0
- package/dist/esm/FlowTemplateDetailV2/components/FormRender/value-mapping-finder.js +292 -0
- package/dist/esm/FlowTemplateDetailV2/components/FormRender/value-mapping-types.d.ts +65 -0
- package/dist/esm/FlowTemplateDetailV2/components/FormRender/value-mapping-types.js +1 -0
- package/dist/esm/FlowTemplateDetailV2/constant.js +9 -1
- package/dist/esm/common/utils/constant.d.ts +3 -0
- package/dist/esm/common/utils/constant.js +10 -1
- package/dist/esm/common/utils/submitDataTransOldFormat.js +75 -62
- package/dist/esm/common/utils/tools.js +58 -38
- package/dist/esm/common/utils/tools_constants.js +12 -2
- package/dist/esm/common/utils/transformWorkOrderData.js +18 -5
- package/dist/esm/model/servers/api.d.ts +1 -0
- package/dist/esm/model/servers/api.js +11 -3
- package/package.json +5 -5
|
@@ -25,7 +25,7 @@ import React, { useState, useRef, useEffect, useMemo, forwardRef, useImperativeH
|
|
|
25
25
|
import { ConfigProvider, Form, Space, Tag } from 'antd';
|
|
26
26
|
import { useWhyDidYouUpdate } from 'ahooks';
|
|
27
27
|
import zhCN from 'antd/es/locale/zh_CN';
|
|
28
|
-
import { get, some, set, every, cloneDeep, isEmpty, intersection, throttle, groupBy, find, isArray } from 'lodash';
|
|
28
|
+
import { get, some, set, every, cloneDeep, isEmpty, intersection, throttle, groupBy, find, isArray, debounce, isMatch, isEqual } from 'lodash';
|
|
29
29
|
import 'moment/locale/zh-cn';
|
|
30
30
|
import { calcWorkOrderList, orderBack, getReplaceWarnValues, COMPONENT_MAP_NAME, EXCLUDE_REPLACE_TOP_COMPONENT,
|
|
31
31
|
// 重复检验不需要展示在顶部的
|
|
@@ -43,7 +43,9 @@ import { jsonParseSecurity, findComponentUniqueKeyByType } from "../../../common
|
|
|
43
43
|
import { NEED_CLEAR_FIELDS_WHEN_SHOP_ID_CHANGE } from "../../constant";
|
|
44
44
|
import { Context } from "../../context";
|
|
45
45
|
import { orderBackKmAddress } from "./constants";
|
|
46
|
-
import { onBlurExpressLogisticsCode, onBlurErpAfterSaleTradeId, onBlurSkxOutboundNoticeNo } from "./onBlur";
|
|
46
|
+
import { onBlurExpressLogisticsCode, onBlurErpAfterSaleTradeId, onBlurSkxOutboundNoticeNo, onBlurSkxReturnBillNo } from "./onBlur";
|
|
47
|
+
import { findAllDependencies } from "./component-dependency-finder";
|
|
48
|
+
import { findValueDependencies } from "./value-mapping-finder";
|
|
47
49
|
// 记录显隐触发隐藏的组件。显示后,重新出发一遍映射规则
|
|
48
50
|
// TODO: 用useState会有bug, 不确定是哪里导致的
|
|
49
51
|
var hideByXYComponentsMap = {};
|
|
@@ -221,6 +223,9 @@ var FormRender = function FormRender(props, ref) {
|
|
|
221
223
|
}
|
|
222
224
|
});
|
|
223
225
|
setReplaceValue(function (value) {
|
|
226
|
+
if (isMatch(value, obj)) {
|
|
227
|
+
return value;
|
|
228
|
+
}
|
|
224
229
|
return _objectSpread(_objectSpread({}, value), obj);
|
|
225
230
|
});
|
|
226
231
|
};
|
|
@@ -278,6 +283,9 @@ var FormRender = function FormRender(props, ref) {
|
|
|
278
283
|
return prv;
|
|
279
284
|
}, {});
|
|
280
285
|
setReplaceValue(function (prev) {
|
|
286
|
+
if (isMatch(prev, resultParams)) {
|
|
287
|
+
return prev;
|
|
288
|
+
}
|
|
281
289
|
return _objectSpread(_objectSpread({}, prev), resultParams);
|
|
282
290
|
});
|
|
283
291
|
setReplaceConfig(function (prev) {
|
|
@@ -342,6 +350,11 @@ var FormRender = function FormRender(props, ref) {
|
|
|
342
350
|
// 清空打款组件之前的重复校验
|
|
343
351
|
if (!enterprisePaymentAlipayNo) {
|
|
344
352
|
setReplaceValue(function (value) {
|
|
353
|
+
if (isMatch(value, {
|
|
354
|
+
enterprisePaymentAlipayNo: 0
|
|
355
|
+
})) {
|
|
356
|
+
return value;
|
|
357
|
+
}
|
|
345
358
|
return _objectSpread(_objectSpread({}, value), {}, {
|
|
346
359
|
enterprisePaymentAlipayNo: 0
|
|
347
360
|
});
|
|
@@ -619,7 +632,7 @@ var FormRender = function FormRender(props, ref) {
|
|
|
619
632
|
// 查询标签
|
|
620
633
|
var queryLabels = /*#__PURE__*/function () {
|
|
621
634
|
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(tid, shopId) {
|
|
622
|
-
var _yield$queryLabelByTr, _yield$queryLabelByTr2, data;
|
|
635
|
+
var oldLabelList, _yield$queryLabelByTr, _yield$queryLabelByTr2, data;
|
|
623
636
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
624
637
|
while (1) switch (_context2.prev = _context2.next) {
|
|
625
638
|
case 0:
|
|
@@ -635,26 +648,37 @@ var FormRender = function FormRender(props, ref) {
|
|
|
635
648
|
}
|
|
636
649
|
return _context2.abrupt("return", console.debug('查询标签缺少必要参数-shopId'));
|
|
637
650
|
case 4:
|
|
651
|
+
oldLabelList = form.getFieldValue("".concat(labelComponent.uniqueKey));
|
|
638
652
|
if (tid) {
|
|
639
|
-
_context2.next =
|
|
653
|
+
_context2.next = 9;
|
|
640
654
|
break;
|
|
641
655
|
}
|
|
642
|
-
setLabelList(
|
|
643
|
-
|
|
656
|
+
setLabelList(function (list) {
|
|
657
|
+
if (list.length === 0) return list;
|
|
658
|
+
return [];
|
|
659
|
+
});
|
|
660
|
+
if (oldLabelList.length !== 0) {
|
|
661
|
+
form.setFieldsValue(_defineProperty({}, "".concat(labelComponent.uniqueKey), []));
|
|
662
|
+
}
|
|
644
663
|
return _context2.abrupt("return", console.debug('查询标签缺少必要参数-tradeId'));
|
|
645
|
-
case
|
|
646
|
-
_context2.next =
|
|
664
|
+
case 9:
|
|
665
|
+
_context2.next = 11;
|
|
647
666
|
return queryLabelByTradeId({
|
|
648
667
|
tid: tid,
|
|
649
668
|
shopId: shopId
|
|
650
669
|
});
|
|
651
|
-
case
|
|
670
|
+
case 11:
|
|
652
671
|
_yield$queryLabelByTr = _context2.sent;
|
|
653
672
|
_yield$queryLabelByTr2 = _yield$queryLabelByTr.data;
|
|
654
673
|
data = _yield$queryLabelByTr2 === void 0 ? [] : _yield$queryLabelByTr2;
|
|
655
|
-
setLabelList(
|
|
656
|
-
|
|
657
|
-
|
|
674
|
+
setLabelList(function (list) {
|
|
675
|
+
if (isEqual(list, data)) return list;
|
|
676
|
+
return data;
|
|
677
|
+
});
|
|
678
|
+
if (!isEqual(oldLabelList, data)) {
|
|
679
|
+
form.setFieldsValue(_defineProperty({}, "".concat(labelComponent.uniqueKey), data));
|
|
680
|
+
}
|
|
681
|
+
case 16:
|
|
658
682
|
case "end":
|
|
659
683
|
return _context2.stop();
|
|
660
684
|
}
|
|
@@ -667,7 +691,7 @@ var FormRender = function FormRender(props, ref) {
|
|
|
667
691
|
// 查询会员等级
|
|
668
692
|
var queryMemberLevels = /*#__PURE__*/function () {
|
|
669
693
|
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(tid, shopId) {
|
|
670
|
-
var _yield$queryMemberLev, _yield$queryMemberLev2, data;
|
|
694
|
+
var oldMemberLevel, _yield$queryMemberLev, _yield$queryMemberLev2, data;
|
|
671
695
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
672
696
|
while (1) switch (_context3.prev = _context3.next) {
|
|
673
697
|
case 0:
|
|
@@ -683,24 +707,29 @@ var FormRender = function FormRender(props, ref) {
|
|
|
683
707
|
}
|
|
684
708
|
return _context3.abrupt("return", console.debug('查询标签缺少必要参数-shopId'));
|
|
685
709
|
case 4:
|
|
710
|
+
oldMemberLevel = form.getFieldValue("".concat(labelComponent.uniqueKey));
|
|
686
711
|
if (tid) {
|
|
687
|
-
_context3.next =
|
|
712
|
+
_context3.next = 8;
|
|
688
713
|
break;
|
|
689
714
|
}
|
|
690
|
-
|
|
715
|
+
if (oldMemberLevel.length !== 0) {
|
|
716
|
+
form.setFieldsValue(_defineProperty({}, "".concat(labelComponent.uniqueKey), []));
|
|
717
|
+
}
|
|
691
718
|
return _context3.abrupt("return", console.debug('查询标签缺少必要参数-tradeId'));
|
|
692
|
-
case
|
|
693
|
-
_context3.next =
|
|
719
|
+
case 8:
|
|
720
|
+
_context3.next = 10;
|
|
694
721
|
return queryMemberLevel({
|
|
695
722
|
tid: tid,
|
|
696
723
|
shopId: shopId
|
|
697
724
|
});
|
|
698
|
-
case
|
|
725
|
+
case 10:
|
|
699
726
|
_yield$queryMemberLev = _context3.sent;
|
|
700
727
|
_yield$queryMemberLev2 = _yield$queryMemberLev.data;
|
|
701
728
|
data = _yield$queryMemberLev2 === void 0 ? [] : _yield$queryMemberLev2;
|
|
702
|
-
|
|
703
|
-
|
|
729
|
+
if (!isEqual(oldMemberLevel, data)) {
|
|
730
|
+
form.setFieldsValue(_defineProperty({}, "".concat(labelComponent.uniqueKey), data));
|
|
731
|
+
}
|
|
732
|
+
case 14:
|
|
704
733
|
case "end":
|
|
705
734
|
return _context3.stop();
|
|
706
735
|
}
|
|
@@ -852,7 +881,7 @@ var FormRender = function FormRender(props, ref) {
|
|
|
852
881
|
setKmLoading: setKmLoading
|
|
853
882
|
});
|
|
854
883
|
case 3:
|
|
855
|
-
_context5.next =
|
|
884
|
+
_context5.next = 33;
|
|
856
885
|
break;
|
|
857
886
|
case 5:
|
|
858
887
|
if (!(type === 'expressLogisticsCode')) {
|
|
@@ -868,7 +897,7 @@ var FormRender = function FormRender(props, ref) {
|
|
|
868
897
|
componentOnBlur: componentOnBlur
|
|
869
898
|
});
|
|
870
899
|
case 8:
|
|
871
|
-
_context5.next =
|
|
900
|
+
_context5.next = 33;
|
|
872
901
|
break;
|
|
873
902
|
case 10:
|
|
874
903
|
if (!(type === 'skxOutboundNoticeNo')) {
|
|
@@ -885,9 +914,24 @@ var FormRender = function FormRender(props, ref) {
|
|
|
885
914
|
componentOnBlur: componentOnBlur
|
|
886
915
|
});
|
|
887
916
|
case 14:
|
|
888
|
-
_context5.next =
|
|
917
|
+
_context5.next = 33;
|
|
889
918
|
break;
|
|
890
919
|
case 16:
|
|
920
|
+
if (!(type === 'skxReturnBillNo')) {
|
|
921
|
+
_context5.next = 21;
|
|
922
|
+
break;
|
|
923
|
+
}
|
|
924
|
+
_context5.next = 19;
|
|
925
|
+
return onBlurSkxReturnBillNo({
|
|
926
|
+
form: form,
|
|
927
|
+
value: value,
|
|
928
|
+
templateDetail: templateDetail,
|
|
929
|
+
componentOnBlur: componentOnBlur
|
|
930
|
+
});
|
|
931
|
+
case 19:
|
|
932
|
+
_context5.next = 33;
|
|
933
|
+
break;
|
|
934
|
+
case 21:
|
|
891
935
|
// 收集所有需要执行的异步操作
|
|
892
936
|
promises = [];
|
|
893
937
|
if (type === 'tradeId') {
|
|
@@ -899,26 +943,29 @@ var FormRender = function FormRender(props, ref) {
|
|
|
899
943
|
promises.push(handleChangeTradeId(value));
|
|
900
944
|
}
|
|
901
945
|
if (value) {
|
|
902
|
-
_context5.next =
|
|
946
|
+
_context5.next = 28;
|
|
903
947
|
break;
|
|
904
948
|
}
|
|
905
949
|
setReplaceValue(function (prev) {
|
|
950
|
+
if (isMatch(prev, _defineProperty({}, type, 0))) {
|
|
951
|
+
return prev;
|
|
952
|
+
}
|
|
906
953
|
return _objectSpread(_objectSpread({}, prev), {}, _defineProperty({}, type, 0));
|
|
907
954
|
});
|
|
908
955
|
replaceValueRef.current = _objectSpread(_objectSpread({}, replaceValue), {}, _defineProperty({}, type, 0));
|
|
909
956
|
return _context5.abrupt("return");
|
|
910
|
-
case
|
|
957
|
+
case 28:
|
|
911
958
|
promises.push(queryReplaceCount(_defineProperty({}, type, value), templateDetail));
|
|
912
959
|
// TODO: ERP不走订单反弹逻辑
|
|
913
960
|
if ((type === 'tradeId' || type === 'enterprisePaymentTid') && !isErpUse) {
|
|
914
961
|
promises.push(changeHandle(value));
|
|
915
962
|
}
|
|
916
963
|
// 等待所有异步操作完成
|
|
917
|
-
_context5.next =
|
|
964
|
+
_context5.next = 32;
|
|
918
965
|
return Promise.all(promises);
|
|
919
|
-
case
|
|
966
|
+
case 32:
|
|
920
967
|
return _context5.abrupt("return", Promise.resolve());
|
|
921
|
-
case
|
|
968
|
+
case 33:
|
|
922
969
|
case "end":
|
|
923
970
|
return _context5.stop();
|
|
924
971
|
}
|
|
@@ -973,7 +1020,7 @@ var FormRender = function FormRender(props, ref) {
|
|
|
973
1020
|
}
|
|
974
1021
|
//如果有bs组件 设置成初始值
|
|
975
1022
|
var hasBs = get(templateDetail, 'componentDtoList', []).some(function (item) {
|
|
976
|
-
return ['BS_LOGISTICS', 'BS_E3_LOGISTICS', 'BS_SEND_GOOD', 'BS_E3_SEND_GOOD', 'WDT_LOGISTICS', 'WDT_SEND_GOOD', 'WLN_LOGISTICS', 'WLN_SEND_GOOD', 'KM_LOGISTICS', 'KM_SEND_GOOD', 'GY_SEND_GOOD', 'GY_LOGISTICS', 'SKX_LOGISTICS'].includes(item.workOrderComponentType);
|
|
1023
|
+
return ['BS_LOGISTICS', 'BS_E3_LOGISTICS', 'BS_SEND_GOOD', 'BS_E3_SEND_GOOD', 'WDT_LOGISTICS', 'WDT_SEND_GOOD', 'WLN_LOGISTICS', 'WLN_SEND_GOOD', 'KM_LOGISTICS', 'KM_SEND_GOOD', 'GY_SEND_GOOD', 'GY_LOGISTICS', 'SKX_LOGISTICS', 'SKX_RETURN_LOGISTICS'].includes(item.workOrderComponentType);
|
|
977
1024
|
});
|
|
978
1025
|
if (hasBs) {
|
|
979
1026
|
var bsValue = get(templateDetail, 'componentDtoList', []).reduce(function (prv, next) {
|
|
@@ -990,6 +1037,12 @@ var FormRender = function FormRender(props, ref) {
|
|
|
990
1037
|
logisticsCode: null
|
|
991
1038
|
}];
|
|
992
1039
|
break;
|
|
1040
|
+
case 'SKX_RETURN_LOGISTICS':
|
|
1041
|
+
prv[next.uniqueKey] = [{
|
|
1042
|
+
skxReturnLogisticsCompany: null,
|
|
1043
|
+
skxReturnLogisticsCode: null
|
|
1044
|
+
}];
|
|
1045
|
+
break;
|
|
993
1046
|
case 'BS_SEND_GOOD':
|
|
994
1047
|
case 'BS_E3_SEND_GOOD':
|
|
995
1048
|
case 'WLN_SEND_GOOD':
|
|
@@ -1091,13 +1144,6 @@ var FormRender = function FormRender(props, ref) {
|
|
|
1091
1144
|
if (Reflect.has(currentComponentDisplayStatus.current, prefixId) && !currentComponentDisplayStatus.current[prefixId]) {
|
|
1092
1145
|
return false;
|
|
1093
1146
|
}
|
|
1094
|
-
// console.debug(
|
|
1095
|
-
// '显影计算',
|
|
1096
|
-
// dependenceDetail?.type,
|
|
1097
|
-
// leftValue,
|
|
1098
|
-
// item.compareSymbol?.toUpperCase(),
|
|
1099
|
-
// item.rightValue,
|
|
1100
|
-
// );
|
|
1101
1147
|
return getExpression((_item$compareSymbol = item.compareSymbol) === null || _item$compareSymbol === void 0 ? void 0 : _item$compareSymbol.toUpperCase(), leftValue, item.rightValue);
|
|
1102
1148
|
};
|
|
1103
1149
|
var getDisplayAndDisabledConfig = function getDisplayAndDisabledConfig(config) {
|
|
@@ -1184,12 +1230,23 @@ var FormRender = function FormRender(props, ref) {
|
|
|
1184
1230
|
currentTemplateAllComponentsDisplay.current[instance === null || instance === void 0 ? void 0 : instance.id] = true;
|
|
1185
1231
|
if (Reflect.has(idConditionListMap, instance.id)) {
|
|
1186
1232
|
var currentIdDependenceOtherFields = idConditionListMap[instance.id];
|
|
1233
|
+
// console.group('当前组件', instance.id, instance.name);
|
|
1234
|
+
var dependencies = findAllDependencies(instance.id, idConditionListMap);
|
|
1235
|
+
// console.log('当前组件所依赖项: ', dependencies);
|
|
1236
|
+
var currentDependenciesMappingComponent = _toConsumableArray(new Set(dependencies.concat(instance.id))).reduce(function (cur, nxt) {
|
|
1237
|
+
var _findValueDependencie, _findValueDependencie2;
|
|
1238
|
+
var mappingDependencies = (_findValueDependencie = findValueDependencies(nxt, mappingConfig.config)) === null || _findValueDependencie === void 0 ? void 0 : (_findValueDependencie2 = _findValueDependencie.dependencies) === null || _findValueDependencie2 === void 0 ? void 0 : _findValueDependencie2.map(function (item) {
|
|
1239
|
+
return item.sourceComponent;
|
|
1240
|
+
});
|
|
1241
|
+
cur = cur.concat(mappingDependencies);
|
|
1242
|
+
return cur;
|
|
1243
|
+
}, []);
|
|
1244
|
+
// console.log('当前组件所依赖项+值映射依赖项: ', currentDependenciesMappingComponent);
|
|
1245
|
+
// console.groupEnd();
|
|
1187
1246
|
// 需要增加显隐处理逻辑
|
|
1188
1247
|
return /*#__PURE__*/React.createElement(Form.Item, {
|
|
1189
1248
|
noStyle: true,
|
|
1190
|
-
|
|
1191
|
-
return true; // TODO: 修复重复依赖的问题 https://tb.raycloud.com/task/64e4491e0b8b5c001e1099b9
|
|
1192
|
-
}
|
|
1249
|
+
dependencies: _toConsumableArray(new Set(dependencies.concat(currentDependenciesMappingComponent)))
|
|
1193
1250
|
}, function (_ref8) {
|
|
1194
1251
|
var getFieldValue = _ref8.getFieldValue;
|
|
1195
1252
|
var show = currentIdDependenceOtherFields === null || currentIdDependenceOtherFields === void 0 ? void 0 : currentIdDependenceOtherFields.reduce(function (cur, nxt) {
|
|
@@ -1292,17 +1349,29 @@ var FormRender = function FormRender(props, ref) {
|
|
|
1292
1349
|
var handleWatchFormValueChange = function handleWatchFormValueChange(changedValues) {
|
|
1293
1350
|
var allValues = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
1294
1351
|
var componentShowMap = currentTemplateAllComponentsDisplay.current;
|
|
1295
|
-
var formValue =
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1352
|
+
var formValue = {};
|
|
1353
|
+
// FIXME: 计算组件存在,此处还可能出现性能问题
|
|
1354
|
+
if (calculationTypeComponentList.length > 0) {
|
|
1355
|
+
formValue = getCalculationComponentValue({
|
|
1356
|
+
calculationTypeComponentList: calculationTypeComponentList,
|
|
1357
|
+
allValues: allValues,
|
|
1358
|
+
componentShowMap: componentShowMap
|
|
1359
|
+
});
|
|
1360
|
+
if (!isMatch(allValues, formValue)) {
|
|
1361
|
+
form.setFieldsValue(_objectSpread(_objectSpread({}, allValues), formValue));
|
|
1362
|
+
}
|
|
1363
|
+
}
|
|
1364
|
+
|
|
1301
1365
|
//缓存防止bs商品组件联动返填获取不到值
|
|
1302
1366
|
setTimeout(function () {
|
|
1303
1367
|
changeValuesCacheOrderInfo(_objectSpread(_objectSpread({}, form.getFieldsValue()), formValue), templateDetail === null || templateDetail === void 0 ? void 0 : templateDetail.componentDtoList);
|
|
1304
1368
|
});
|
|
1305
1369
|
};
|
|
1370
|
+
var debouncedHandleWatchFormValueChange = useMemo(function () {
|
|
1371
|
+
return debounce(handleWatchFormValueChange, 150);
|
|
1372
|
+
},
|
|
1373
|
+
// 150ms防抖
|
|
1374
|
+
[handleWatchFormValueChange]);
|
|
1306
1375
|
var changeValuesCacheOrderInfo = throttle(function (value, tempLateList) {
|
|
1307
1376
|
//如果店铺id不存在 不缓存
|
|
1308
1377
|
if (!(value !== null && value !== void 0 && value.shopId)) return;
|
|
@@ -1416,7 +1485,7 @@ var FormRender = function FormRender(props, ref) {
|
|
|
1416
1485
|
}, formProps), preNodeFormItems), /*#__PURE__*/React.createElement(Form, _extends({
|
|
1417
1486
|
form: form
|
|
1418
1487
|
}, formProps, {
|
|
1419
|
-
onValuesChange:
|
|
1488
|
+
onValuesChange: debouncedHandleWatchFormValueChange
|
|
1420
1489
|
}), /*#__PURE__*/React.createElement(ShopName, {
|
|
1421
1490
|
shopList: shopList,
|
|
1422
1491
|
handleChangeShopId: handleChangeShopId,
|
|
@@ -18,3 +18,9 @@ export declare const onBlurSkxOutboundNoticeNo: ({ form, value, templateDetail,
|
|
|
18
18
|
templateDetail: any;
|
|
19
19
|
componentOnBlur: (value: any, type: string) => Promise<void>;
|
|
20
20
|
}) => Promise<void>;
|
|
21
|
+
export declare const onBlurSkxReturnBillNo: ({ form, value, templateDetail, componentOnBlur, }: {
|
|
22
|
+
form: FormInstance;
|
|
23
|
+
value: string;
|
|
24
|
+
templateDetail: any;
|
|
25
|
+
componentOnBlur: (value: any, type: string) => Promise<void>;
|
|
26
|
+
}) => Promise<void>;
|
|
@@ -8,9 +8,9 @@ function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyri
|
|
|
8
8
|
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); } }
|
|
9
9
|
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); }); }; }
|
|
10
10
|
import { orderBackKmVideoByLogisticsCode } from "../../../common/utils/orderBackKm";
|
|
11
|
-
import { isNull, skxSystemOrderBackValues } from '@kmkf-fe-packages/kmkf-utils';
|
|
11
|
+
import { isNull, skxSystemOrderBackValues, skxReturnSystemOrderBackValues } from '@kmkf-fe-packages/kmkf-utils';
|
|
12
12
|
import { queryTidByOutSid } from "../../../model/servers/api";
|
|
13
|
-
import {
|
|
13
|
+
import { servers } from '@kmkf-fe-packages/kmkf-utils';
|
|
14
14
|
export var onBlurErpAfterSaleTradeId = /*#__PURE__*/function () {
|
|
15
15
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(_ref) {
|
|
16
16
|
var _kmErpVideoComponent$;
|
|
@@ -72,7 +72,7 @@ export var onBlurExpressLogisticsCode = /*#__PURE__*/function () {
|
|
|
72
72
|
});
|
|
73
73
|
case 6:
|
|
74
74
|
if (!hasTradeIdComponent) {
|
|
75
|
-
_context2.next =
|
|
75
|
+
_context2.next = 23;
|
|
76
76
|
break;
|
|
77
77
|
}
|
|
78
78
|
hasKm = false;
|
|
@@ -127,11 +127,10 @@ export var onBlurExpressLogisticsCode = /*#__PURE__*/function () {
|
|
|
127
127
|
return blurPromise;
|
|
128
128
|
case 22:
|
|
129
129
|
// 所有异步操作完成后执行
|
|
130
|
-
console.log('[组件失焦事件]---set', oldValue);
|
|
131
130
|
form.setFieldsValue({
|
|
132
131
|
'0eVTfMGEyd': oldValue
|
|
133
132
|
});
|
|
134
|
-
case
|
|
133
|
+
case 23:
|
|
135
134
|
case "end":
|
|
136
135
|
return _context2.stop();
|
|
137
136
|
}
|
|
@@ -142,55 +141,124 @@ export var onBlurExpressLogisticsCode = /*#__PURE__*/function () {
|
|
|
142
141
|
};
|
|
143
142
|
}();
|
|
144
143
|
export var onBlurSkxOutboundNoticeNo = /*#__PURE__*/function () {
|
|
145
|
-
var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
146
|
-
var form, value, templateDetail, componentOnBlur
|
|
147
|
-
return _regeneratorRuntime().wrap(function
|
|
148
|
-
while (1) switch (
|
|
144
|
+
var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(_ref5) {
|
|
145
|
+
var form, value, templateDetail, componentOnBlur;
|
|
146
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
147
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
149
148
|
case 0:
|
|
150
149
|
form = _ref5.form, value = _ref5.value, templateDetail = _ref5.templateDetail, componentOnBlur = _ref5.componentOnBlur;
|
|
151
|
-
console.log('onBlurSkxOutboundNoticeNo', {
|
|
152
|
-
form: form,
|
|
153
|
-
value: value,
|
|
154
|
-
templateDetail: templateDetail
|
|
155
|
-
});
|
|
156
150
|
if (value) {
|
|
157
|
-
|
|
151
|
+
_context4.next = 3;
|
|
158
152
|
break;
|
|
159
153
|
}
|
|
160
|
-
return
|
|
161
|
-
case
|
|
162
|
-
|
|
163
|
-
return
|
|
154
|
+
return _context4.abrupt("return");
|
|
155
|
+
case 3:
|
|
156
|
+
_context4.next = 5;
|
|
157
|
+
return servers.SKX.querySkxOrderDetailSingleton({
|
|
164
158
|
onBillNo: value
|
|
165
|
-
})
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
159
|
+
}).then( /*#__PURE__*/function () {
|
|
160
|
+
var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(res) {
|
|
161
|
+
var data, tradeId, blurPromise, values;
|
|
162
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
163
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
164
|
+
case 0:
|
|
165
|
+
data = res.data;
|
|
166
|
+
tradeId = data === null || data === void 0 ? void 0 : data.tid; // 创建一个异步操作的Promise
|
|
167
|
+
blurPromise = componentOnBlur(tradeId, 'tradeId'); // 等待异步操作完成后再执行setTimeout
|
|
168
|
+
_context3.next = 5;
|
|
169
|
+
return blurPromise;
|
|
170
|
+
case 5:
|
|
171
|
+
// 所有异步操作完成后执行
|
|
172
|
+
values = skxSystemOrderBackValues({
|
|
173
|
+
templateList: templateDetail,
|
|
174
|
+
value: {
|
|
175
|
+
allOrders: (data === null || data === void 0 ? void 0 : data.orderDetailInfoList) || []
|
|
176
|
+
},
|
|
177
|
+
form: form,
|
|
178
|
+
isReverseFilling: false
|
|
179
|
+
});
|
|
180
|
+
form.setFieldsValue(_objectSpread(_objectSpread({}, values || {}), {}, {
|
|
181
|
+
m3ap1EvEyd: tradeId,
|
|
182
|
+
'78CADF2951': value
|
|
183
|
+
}));
|
|
184
|
+
case 7:
|
|
185
|
+
case "end":
|
|
186
|
+
return _context3.stop();
|
|
187
|
+
}
|
|
188
|
+
}, _callee3);
|
|
189
|
+
}));
|
|
190
|
+
return function (_x4) {
|
|
191
|
+
return _ref7.apply(this, arguments);
|
|
192
|
+
};
|
|
193
|
+
}()).catch(console.debug);
|
|
194
|
+
case 5:
|
|
188
195
|
case "end":
|
|
189
|
-
return
|
|
196
|
+
return _context4.stop();
|
|
190
197
|
}
|
|
191
|
-
},
|
|
198
|
+
}, _callee4);
|
|
192
199
|
}));
|
|
193
200
|
return function onBlurSkxOutboundNoticeNo(_x3) {
|
|
194
201
|
return _ref6.apply(this, arguments);
|
|
195
202
|
};
|
|
203
|
+
}();
|
|
204
|
+
export var onBlurSkxReturnBillNo = /*#__PURE__*/function () {
|
|
205
|
+
var _ref9 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(_ref8) {
|
|
206
|
+
var form, value, templateDetail, componentOnBlur;
|
|
207
|
+
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
208
|
+
while (1) switch (_context6.prev = _context6.next) {
|
|
209
|
+
case 0:
|
|
210
|
+
form = _ref8.form, value = _ref8.value, templateDetail = _ref8.templateDetail, componentOnBlur = _ref8.componentOnBlur;
|
|
211
|
+
if (value) {
|
|
212
|
+
_context6.next = 3;
|
|
213
|
+
break;
|
|
214
|
+
}
|
|
215
|
+
return _context6.abrupt("return");
|
|
216
|
+
case 3:
|
|
217
|
+
_context6.next = 5;
|
|
218
|
+
return servers.SKX.queryReturnOrderDetailSingleton({
|
|
219
|
+
returnBillNo: value
|
|
220
|
+
}).then( /*#__PURE__*/function () {
|
|
221
|
+
var _ref10 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(res) {
|
|
222
|
+
var data, tradeId, blurPromise, values;
|
|
223
|
+
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
224
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
225
|
+
case 0:
|
|
226
|
+
data = res.data;
|
|
227
|
+
tradeId = data === null || data === void 0 ? void 0 : data.tid; // 创建一个异步操作的Promise
|
|
228
|
+
blurPromise = componentOnBlur(tradeId, 'tradeId'); // 等待异步操作完成后再执行setTimeout
|
|
229
|
+
_context5.next = 5;
|
|
230
|
+
return blurPromise;
|
|
231
|
+
case 5:
|
|
232
|
+
// 所有异步操作完成后执行
|
|
233
|
+
values = skxReturnSystemOrderBackValues({
|
|
234
|
+
templateList: templateDetail,
|
|
235
|
+
value: {
|
|
236
|
+
allOrders: (data === null || data === void 0 ? void 0 : data.skqReturnOrderDetailInfoDtos) || []
|
|
237
|
+
},
|
|
238
|
+
form: form,
|
|
239
|
+
isReverseFilling: false
|
|
240
|
+
});
|
|
241
|
+
form.setFieldsValue(_objectSpread(_objectSpread({}, values || {}), {}, {
|
|
242
|
+
m3ap1EvEyd: tradeId,
|
|
243
|
+
fe10d6f36b: value
|
|
244
|
+
}));
|
|
245
|
+
case 7:
|
|
246
|
+
case "end":
|
|
247
|
+
return _context5.stop();
|
|
248
|
+
}
|
|
249
|
+
}, _callee5);
|
|
250
|
+
}));
|
|
251
|
+
return function (_x6) {
|
|
252
|
+
return _ref10.apply(this, arguments);
|
|
253
|
+
};
|
|
254
|
+
}()).catch(console.debug);
|
|
255
|
+
case 5:
|
|
256
|
+
case "end":
|
|
257
|
+
return _context6.stop();
|
|
258
|
+
}
|
|
259
|
+
}, _callee6);
|
|
260
|
+
}));
|
|
261
|
+
return function onBlurSkxReturnBillNo(_x5) {
|
|
262
|
+
return _ref9.apply(this, arguments);
|
|
263
|
+
};
|
|
196
264
|
}();
|
|
@@ -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 @@
|
|
|
1
|
+
export {};
|
|
@@ -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
|
+
};
|