@kmkf-fe-packages/kmkf-work-order-service-component 1.10.0 → 1.10.1-beta.2
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/README.md +2 -1
- package/dist/esm/FlowTemplateDetail/components/FormRender/index.js +52 -11
- package/dist/esm/FlowTemplateDetail/index.js +21 -2
- package/dist/esm/common/utils/tools.d.ts +1 -5
- package/dist/esm/common/utils/tools.js +76 -30
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/index.js +1 -1
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -63,4 +63,5 @@ const Text = ()=>{
|
|
|
63
63
|
|
|
64
64
|
```
|
|
65
65
|
|
|
66
|
-
| 字段 | 说明 | 数据类型 | | ----------------- | ---------------- | ------------------------------------ | | platform | 平台 | TAOBAO =淘宝\|FXG=抖音\|PDD=拼多多\| | | shopId | 店铺 ID | number | | buyerNick | 买家昵称 | string | | buyerId | 买家 id | string | | orderNo | 订单 id | string | | onEmpowerCallback | 授权弹框点击回调 | function |
|
|
66
|
+
| 字段 | 说明 | 数据类型 | | ----------------- | ---------------- | ------------------------------------ | | platform | 平台 | TAOBAO =淘宝\|FXG=抖音\|PDD=拼多多\| | | shopId | 店铺 ID | number | | buyerNick | 买家昵称 | string | | buyerId | 买家 id | string | | orderNo | 订单 id | string | | onEmpowerCallback | 授权弹框点击回调 | function |
|
|
67
|
+
|
|
@@ -28,7 +28,7 @@ import { get, some, set, every, cloneDeep, isEmpty, intersection, throttle, grou
|
|
|
28
28
|
import 'moment/locale/zh-cn';
|
|
29
29
|
import { calcWorkOrderList, orderBack, getReplaceWarnValues, COMPONENT_MAP_NAME, EXCLUDE_REPLACE_TOP_COMPONENT,
|
|
30
30
|
// 重复检验不需要展示在顶部的
|
|
31
|
-
INNER_REPLACE_COMPONENT, reversalFormValues, bsSystemOrderBackValues, wlnSystemOrderBackValues, getMappingConfigByTemplateDetail, wdtSystemOrderBackValues, setLogisticsInfo } from "../../../common/utils/tools";
|
|
31
|
+
INNER_REPLACE_COMPONENT, reversalFormValues, bsSystemOrderBackValues, wlnSystemOrderBackValues, getMappingConfigByTemplateDetail, wdtSystemOrderBackValues, setLogisticsInfo, COMPONENT_MAP, getMappingTargetValue } from "../../../common/utils/tools";
|
|
32
32
|
import { replaceCheck, orderDetail, queryLabelByTradeId } from "../../../model/servers/api";
|
|
33
33
|
import { factory } from '@kmkf-fe-packages/services-components';
|
|
34
34
|
import { getExpression, formatDisplayConfig, isNull, LabelData } from '@kmkf-fe-packages/kmkf-utils';
|
|
@@ -194,7 +194,7 @@ var FormRender = function FormRender(props, ref) {
|
|
|
194
194
|
var obj = {};
|
|
195
195
|
Object.keys(params).forEach(function (key) {
|
|
196
196
|
var _params$key;
|
|
197
|
-
if (params[key] && ((_params$key = params[key]) === null || _params$key === void 0 ? void 0 : _params$key.indexOf('*')) > -1) {
|
|
197
|
+
if (params[key] && typeof params[key] === 'string' && ((_params$key = params[key]) === null || _params$key === void 0 ? void 0 : _params$key.indexOf('*')) > -1) {
|
|
198
198
|
obj[key] = 0;
|
|
199
199
|
}
|
|
200
200
|
});
|
|
@@ -460,8 +460,45 @@ var FormRender = function FormRender(props, ref) {
|
|
|
460
460
|
(antFormEl === null || antFormEl === void 0 ? void 0 : antFormEl.length) > 0 && set(antFormEl, '0.scrollTop', 0);
|
|
461
461
|
resetMappdingHideComponents();
|
|
462
462
|
};
|
|
463
|
+
var repeatWarningDataSchema = function repeatWarningDataSchema(formValue, templateDetail) {
|
|
464
|
+
var getKeyByValue = function getKeyByValue(value) {
|
|
465
|
+
return Object.keys(COMPONENT_MAP).find(function (key) {
|
|
466
|
+
return COMPONENT_MAP[key] === value;
|
|
467
|
+
});
|
|
468
|
+
};
|
|
469
|
+
var needRepeatWarnComponent = Object.values(COMPONENT_MAP);
|
|
470
|
+
return templateDetail.componentDtoList.reduce(function (cur, nxt) {
|
|
471
|
+
if (needRepeatWarnComponent !== null && needRepeatWarnComponent !== void 0 && needRepeatWarnComponent.includes(nxt === null || nxt === void 0 ? void 0 : nxt.workOrderComponentType)) {
|
|
472
|
+
var instance = factory(nxt.workOrderComponentType, {
|
|
473
|
+
id: nxt.uniqueKey,
|
|
474
|
+
name: nxt.name,
|
|
475
|
+
componentConfig: nxt.componentConfig,
|
|
476
|
+
effects: {},
|
|
477
|
+
type: nxt.workOrderComponentType
|
|
478
|
+
});
|
|
479
|
+
var _id = instance === null || instance === void 0 ? void 0 : instance.id;
|
|
480
|
+
var value = formValue[_id];
|
|
481
|
+
var _key = getKeyByValue(nxt.workOrderComponentType);
|
|
482
|
+
// TODO: 如果是订单号组件, 将值设置为orderNo
|
|
483
|
+
if (nxt.workOrderComponentType === 'TRADE_ID_INPUT') {
|
|
484
|
+
_key = 'orderNo';
|
|
485
|
+
}
|
|
486
|
+
if (_key) {
|
|
487
|
+
cur[_key] = value;
|
|
488
|
+
}
|
|
489
|
+
}
|
|
490
|
+
return cur;
|
|
491
|
+
}, {});
|
|
492
|
+
};
|
|
463
493
|
useEffect(function () {
|
|
464
|
-
if (isErpUse)
|
|
494
|
+
if (isErpUse && templateDetail) {
|
|
495
|
+
var formValue = form.getFieldsValue(true);
|
|
496
|
+
console.debug('表单内容值', formValue);
|
|
497
|
+
// TODO: 拼装需要重复提醒的组件数据格式
|
|
498
|
+
var value = repeatWarningDataSchema(formValue, templateDetail);
|
|
499
|
+
console.debug('重复提醒转换之后数据', value);
|
|
500
|
+
return orderBackReplace(value, templateDetail);
|
|
501
|
+
}
|
|
465
502
|
queryDetail({
|
|
466
503
|
workOrderId: workOrderId,
|
|
467
504
|
shopId: shopId,
|
|
@@ -471,7 +508,7 @@ var FormRender = function FormRender(props, ref) {
|
|
|
471
508
|
buyerId: buyerId,
|
|
472
509
|
buyerNick: buyerNick
|
|
473
510
|
});
|
|
474
|
-
}, [workOrderId, record, shopId, isErpUse]);
|
|
511
|
+
}, [workOrderId, record, shopId, isErpUse, templateDetail]);
|
|
475
512
|
|
|
476
513
|
// 重置映射隐藏的组件, 目前只有单选、下拉组件可能会因为映射关系隐藏
|
|
477
514
|
var resetMappdingHideComponents = function resetMappdingHideComponents() {
|
|
@@ -502,22 +539,26 @@ var FormRender = function FormRender(props, ref) {
|
|
|
502
539
|
|
|
503
540
|
// 批量映射
|
|
504
541
|
var batchFillByMapping = function batchFillByMapping(values) {
|
|
505
|
-
for (var
|
|
506
|
-
fillByMapping(
|
|
542
|
+
for (var _key2 in values) {
|
|
543
|
+
fillByMapping(_key2, values[_key2]);
|
|
507
544
|
}
|
|
508
545
|
};
|
|
509
546
|
// 组件映射
|
|
510
547
|
var fillByMapping = function fillByMapping(triggerUniqueKey, value) {
|
|
511
|
-
var _mappingConfig$config;
|
|
512
|
-
var
|
|
548
|
+
var _componentList$find, _mappingConfig$config;
|
|
549
|
+
var componentList = [].concat(_toConsumableArray((templateDetail === null || templateDetail === void 0 ? void 0 : templateDetail.preNodeComponentDtoList) || []), _toConsumableArray((templateDetail === null || templateDetail === void 0 ? void 0 : templateDetail.componentDtoList) || []));
|
|
550
|
+
var workOrderComponentType = (_componentList$find = componentList.find(function (t) {
|
|
551
|
+
return t.uniqueKey === triggerUniqueKey;
|
|
552
|
+
})) === null || _componentList$find === void 0 ? void 0 : _componentList$find.workOrderComponentType;
|
|
553
|
+
var triggerValue = getMappingTargetValue(value, workOrderComponentType);
|
|
513
554
|
// 如果有映射关系,则修改对应组件的值
|
|
514
555
|
var mapping = (_mappingConfig$config = mappingConfig.config) === null || _mappingConfig$config === void 0 ? void 0 : _mappingConfig$config[triggerUniqueKey];
|
|
515
556
|
if (mapping !== null && mapping !== void 0 && mapping[triggerValue]) {
|
|
516
557
|
form.setFieldsValue(mapping === null || mapping === void 0 ? void 0 : mapping[triggerValue]);
|
|
517
558
|
} else {
|
|
518
559
|
var resetSet = new Set();
|
|
519
|
-
for (var
|
|
520
|
-
for (var uniqueKey in mapping[
|
|
560
|
+
for (var _key3 in mapping) {
|
|
561
|
+
for (var uniqueKey in mapping[_key3]) {
|
|
521
562
|
resetSet.add(uniqueKey);
|
|
522
563
|
}
|
|
523
564
|
}
|
|
@@ -620,7 +661,7 @@ var FormRender = function FormRender(props, ref) {
|
|
|
620
661
|
var componentOnValueChange = function componentOnValueChange(uniqueKey, value, workOrderComponentType) {
|
|
621
662
|
if (mappingConfig.config[uniqueKey]) {
|
|
622
663
|
// PS: 目前只有string 和 { value: string, other: ''}这两种类型,后面其他组件如果需要在调整
|
|
623
|
-
fillByMapping(uniqueKey,
|
|
664
|
+
fillByMapping(uniqueKey, value);
|
|
624
665
|
}
|
|
625
666
|
if (workOrderComponentType === 'BS_SYSTEM_ORDER') {
|
|
626
667
|
bsSystemOrderBackValues({
|
|
@@ -24,6 +24,7 @@ import { useDispatch, useSelector, Provider, batch } from 'react-redux';
|
|
|
24
24
|
import store from "../model/store";
|
|
25
25
|
import zhCN from 'antd/es/locale/zh_CN';
|
|
26
26
|
import { calcWorkOrderList, deleteCacheOrder } from "../common/utils/tools";
|
|
27
|
+
import moment from 'moment';
|
|
27
28
|
import { setPlat, fetchPanelInfo, fetchAllFlowOperateRecord, setAction, setVisibleRemarkList, setAddRemarkVisible, setLoading, setClearStore
|
|
28
29
|
// setLabelList
|
|
29
30
|
} from "../model/flowTemplateDetail";
|
|
@@ -45,8 +46,8 @@ import SubmitRemindModal from "./components/SubmitRemindModal";
|
|
|
45
46
|
import { useSignal } from "../hooks/useSignal";
|
|
46
47
|
import { verifyHandle, submitParams, FLOW_STATUS_V2, getTag, currentUserHasOperatorAuth, CANNOT_BACK_FILL } from "./common";
|
|
47
48
|
import { saveWorkOrder, submitWorkOrder, addRemark, stopWorkOrder, closeWorkOrder, startWorkOrder, forwardWorkOrder, returnWorkOrder, withDrawWorkOrder, reminder, cancelReminder } from "../model/flowTemplateDetail/api";
|
|
48
|
-
import { COMPONENT_MAP } from "../common/utils/tools";
|
|
49
49
|
import RenderDetail from "./components/RenderDetail";
|
|
50
|
+
import { COMPONENT_MAP } from "../common/utils/tools";
|
|
50
51
|
import { orderDetail } from "../model/servers/api";
|
|
51
52
|
import cache from "../common/cache";
|
|
52
53
|
import "./index.less";
|
|
@@ -1053,7 +1054,25 @@ var FlowTemplateDetail = function FlowTemplateDetail(props) {
|
|
|
1053
1054
|
onClick: function onClick() {
|
|
1054
1055
|
return handleFillWorkOrder(transData);
|
|
1055
1056
|
}
|
|
1056
|
-
}, "\u7ACB\u5373\u586B\u5145"), details.flowWorkOrderId, /*#__PURE__*/React.createElement(
|
|
1057
|
+
}, "\u7ACB\u5373\u586B\u5145"), details.flowWorkOrderId, /*#__PURE__*/React.createElement("div", {
|
|
1058
|
+
style: {
|
|
1059
|
+
margin: '0 8px'
|
|
1060
|
+
}
|
|
1061
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
1062
|
+
style: {
|
|
1063
|
+
color: 'rgba(0,0,0,0.4)',
|
|
1064
|
+
fontSize: '12px'
|
|
1065
|
+
}
|
|
1066
|
+
}, "\u63D0\u4EA4\u4EBA\uFF1A"), ' ', details.submitter), /*#__PURE__*/React.createElement("div", {
|
|
1067
|
+
style: {
|
|
1068
|
+
margin: '0 8px'
|
|
1069
|
+
}
|
|
1070
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
1071
|
+
style: {
|
|
1072
|
+
color: 'rgba(0,0,0,0.4)',
|
|
1073
|
+
fontSize: '12px'
|
|
1074
|
+
}
|
|
1075
|
+
}, "\u63D0\u4EA4\u65F6\u95F4\uFF1A"), moment(details.created).format('YYYY-MM-DD HH:mm:ss')), /*#__PURE__*/React.createElement(RenderDetail, {
|
|
1057
1076
|
workOrderTemplateInfo: currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : currentNodeDetail.workOrderTemplateInfo,
|
|
1058
1077
|
transData: transDataall,
|
|
1059
1078
|
platform: plat.platform,
|
|
@@ -1,9 +1,4 @@
|
|
|
1
1
|
import { PlatFormInfo } from '../../model/flowTemplateDetail/types';
|
|
2
|
-
/**
|
|
3
|
-
* 多级下拉框数据转换成aPaas数据结构
|
|
4
|
-
* @param {*} sourceOptions
|
|
5
|
-
*/
|
|
6
|
-
export declare const transMultSelectOptions: (sourceOptions: any[]) => any;
|
|
7
2
|
/**
|
|
8
3
|
* @param {*} nowData
|
|
9
4
|
* @param {*} sourceTemplateDetail
|
|
@@ -129,6 +124,7 @@ export declare const getMappingConfigByTemplateDetail: (templateDetail: {
|
|
|
129
124
|
};
|
|
130
125
|
hideComponents: string[];
|
|
131
126
|
};
|
|
127
|
+
export declare const getMappingTargetValue: (value: any, type: string) => any;
|
|
132
128
|
export declare const transformWorkOrderDetail: (detail: any) => any;
|
|
133
129
|
export declare const setLogisticsInfo: ({ logisticsMappingConfig, uniqueKey, workOrderComponentType, value, form, }: any) => void;
|
|
134
130
|
export {};
|
|
@@ -17,12 +17,11 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
17
17
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
18
18
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
19
19
|
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; }
|
|
20
|
-
import { get, every, maxBy } from 'lodash';
|
|
20
|
+
import { get, every, maxBy, last, cloneDeep, isEqual, set } from 'lodash';
|
|
21
21
|
import V from 'voca';
|
|
22
22
|
import { orderDetail, jstOrderDetail, bsOrderDetail, wlnOrderDetail, wdtOrderDetail } from "../../model/servers/api";
|
|
23
23
|
import moment from 'moment';
|
|
24
|
-
import { AddressData, ExpressData, ExpressInterceptData, orderBackFormValues, bsOrderBackFormValues, wlnOrderBackFormValues, wdtOrderBackFormValues, findLabelBySelectValue, request, isNull, bsOrderTransform, wlnOrderTransform, wdtOrderTransform, filterWdtOrders, unTransField } from '@kmkf-fe-packages/kmkf-utils';
|
|
25
|
-
import { cloneDeep, isEqual, set } from 'lodash';
|
|
24
|
+
import { AddressData, ExpressData, ExpressInterceptData, orderBackFormValues, bsOrderBackFormValues, wlnOrderBackFormValues, wdtOrderBackFormValues, findLabelBySelectValue, request, isNull, bsOrderTransform, wlnOrderTransform, wdtOrderTransform, filterWdtOrders, unTransField, transMultSelectOptions } from '@kmkf-fe-packages/kmkf-utils';
|
|
26
25
|
import Monitor from 'kmkf-monitor';
|
|
27
26
|
import { PlatForm } from "../../model/flowTemplateDetail/types";
|
|
28
27
|
import cache from "../cache";
|
|
@@ -98,26 +97,6 @@ var findNodeById = function findNodeById(tree) {
|
|
|
98
97
|
}
|
|
99
98
|
}
|
|
100
99
|
};
|
|
101
|
-
|
|
102
|
-
/**
|
|
103
|
-
* 多级下拉框数据转换成aPaas数据结构
|
|
104
|
-
* @param {*} sourceOptions
|
|
105
|
-
*/
|
|
106
|
-
export var transMultSelectOptions = function transMultSelectOptions(sourceOptions) {
|
|
107
|
-
var tree = [];
|
|
108
|
-
var newOptions = JSON.parse(JSON.stringify(sourceOptions));
|
|
109
|
-
newOptions.map(function (item) {
|
|
110
|
-
if (tree.length === 0) {
|
|
111
|
-
return tree = tree.concat(get(item, 'list.1', []));
|
|
112
|
-
}
|
|
113
|
-
Object.keys(item.list).map(function (l) {
|
|
114
|
-
// 在树中找到l对应的节点,将当前数组放到children里面
|
|
115
|
-
var result = findNodeById(tree, l);
|
|
116
|
-
result && (result.children = item.list[l]);
|
|
117
|
-
});
|
|
118
|
-
});
|
|
119
|
-
return tree;
|
|
120
|
-
};
|
|
121
100
|
var findValueByField = function findValueByField(componentDtoList) {
|
|
122
101
|
return function (data, type) {
|
|
123
102
|
var component = componentDtoList.find(function (item) {
|
|
@@ -2392,6 +2371,37 @@ export var wdtSystemOrderBackValues = function wdtSystemOrderBackValues(_ref8) {
|
|
|
2392
2371
|
});
|
|
2393
2372
|
form.setFieldsValue(values);
|
|
2394
2373
|
};
|
|
2374
|
+
//获取多级下拉最后的值
|
|
2375
|
+
var getChildValue = function getChildValue() {
|
|
2376
|
+
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
2377
|
+
var keys = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
2378
|
+
var disabled = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
2379
|
+
var childs = [];
|
|
2380
|
+
var newKeys = keys.map(function (t) {
|
|
2381
|
+
return String(t);
|
|
2382
|
+
});
|
|
2383
|
+
function loop(list, key) {
|
|
2384
|
+
var disabled = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
2385
|
+
var childs = arguments.length > 3 ? arguments[3] : undefined;
|
|
2386
|
+
var len = list === null || list === void 0 ? void 0 : list.length;
|
|
2387
|
+
for (var i = 0; i < len; i++) {
|
|
2388
|
+
var _item$children, _item$children2;
|
|
2389
|
+
var item = cloneDeep(list[i]);
|
|
2390
|
+
var newDisabled = disabled;
|
|
2391
|
+
if (key.includes(String(item === null || item === void 0 ? void 0 : item.actived))) {
|
|
2392
|
+
newDisabled = true;
|
|
2393
|
+
}
|
|
2394
|
+
if (!(item !== null && item !== void 0 && (_item$children = item.children) !== null && _item$children !== void 0 && _item$children.length) && newDisabled) {
|
|
2395
|
+
childs.push(item.actived);
|
|
2396
|
+
}
|
|
2397
|
+
if (item !== null && item !== void 0 && (_item$children2 = item.children) !== null && _item$children2 !== void 0 && _item$children2.length) {
|
|
2398
|
+
item.children = loop(item.children, key, newDisabled, childs);
|
|
2399
|
+
}
|
|
2400
|
+
}
|
|
2401
|
+
return childs;
|
|
2402
|
+
}
|
|
2403
|
+
return loop(options, newKeys, disabled, childs);
|
|
2404
|
+
};
|
|
2395
2405
|
|
|
2396
2406
|
// 获取映射关系
|
|
2397
2407
|
export var getMappingConfigByTemplateDetail = function getMappingConfigByTemplateDetail(templateDetail) {
|
|
@@ -2419,9 +2429,35 @@ export var getMappingConfigByTemplateDetail = function getMappingConfigByTemplat
|
|
|
2419
2429
|
return newItem;
|
|
2420
2430
|
});
|
|
2421
2431
|
[].concat(_toConsumableArray(templateDetail.componentDtoList), _toConsumableArray(preList)).forEach(function (componentDto) {
|
|
2422
|
-
var _mapping$
|
|
2432
|
+
var _mapping$rules2;
|
|
2423
2433
|
var mapping = componentDto.componentConfig.mapping || {};
|
|
2424
|
-
|
|
2434
|
+
var triggerComponent = templateDetail.componentDtoList.find(function (t) {
|
|
2435
|
+
return t.uniqueKey === mapping.triggerComponentKey;
|
|
2436
|
+
});
|
|
2437
|
+
// 多级下拉处理rules数据
|
|
2438
|
+
if ((triggerComponent === null || triggerComponent === void 0 ? void 0 : triggerComponent.workOrderComponentType) === 'MULT_SELECT') {
|
|
2439
|
+
var _mapping$rules;
|
|
2440
|
+
var options = transMultSelectOptions(triggerComponent.componentConfig.options || []);
|
|
2441
|
+
if ((_mapping$rules = mapping.rules) !== null && _mapping$rules !== void 0 && _mapping$rules.length) {
|
|
2442
|
+
var rules = cloneDeep(mapping.rules).reduce(function (prv, next) {
|
|
2443
|
+
var lastTriggerValue = next.triggerValue.map(function (t) {
|
|
2444
|
+
return last(t);
|
|
2445
|
+
});
|
|
2446
|
+
var childValues = getChildValue(options, lastTriggerValue, false);
|
|
2447
|
+
prv.push.apply(prv, _toConsumableArray(childValues.map(function (t) {
|
|
2448
|
+
return {
|
|
2449
|
+
currentValue: next.currentValue,
|
|
2450
|
+
triggerValue: t
|
|
2451
|
+
};
|
|
2452
|
+
})));
|
|
2453
|
+
return prv;
|
|
2454
|
+
}, []);
|
|
2455
|
+
mapping = _objectSpread(_objectSpread({}, componentDto.componentConfig.mapping), {}, {
|
|
2456
|
+
rules: rules
|
|
2457
|
+
});
|
|
2458
|
+
}
|
|
2459
|
+
}
|
|
2460
|
+
if ((_mapping$rules2 = mapping.rules) !== null && _mapping$rules2 !== void 0 && _mapping$rules2.length && mapping.triggerComponentKey) {
|
|
2425
2461
|
readonlyComponents[componentDto.uniqueKey] = {
|
|
2426
2462
|
auth: mapping.auth
|
|
2427
2463
|
};
|
|
@@ -2431,17 +2467,17 @@ export var getMappingConfigByTemplateDetail = function getMappingConfigByTemplat
|
|
|
2431
2467
|
if (componentDto._isPreItem) {
|
|
2432
2468
|
return;
|
|
2433
2469
|
}
|
|
2434
|
-
var
|
|
2470
|
+
var _rules = {};
|
|
2435
2471
|
mapping.rules.forEach(function (rule) {
|
|
2436
|
-
if (!
|
|
2437
|
-
|
|
2472
|
+
if (!_rules[rule.triggerValue]) {
|
|
2473
|
+
_rules[rule.triggerValue] = {};
|
|
2438
2474
|
}
|
|
2439
|
-
|
|
2475
|
+
_rules[rule.triggerValue][componentDto.uniqueKey] = componentDto.workOrderComponentType === 'RADIO' ? {
|
|
2440
2476
|
value: rule.currentValue,
|
|
2441
2477
|
other: ''
|
|
2442
2478
|
} : rule.currentValue;
|
|
2443
2479
|
});
|
|
2444
|
-
config[mapping.triggerComponentKey] =
|
|
2480
|
+
config[mapping.triggerComponentKey] = _rules;
|
|
2445
2481
|
}
|
|
2446
2482
|
});
|
|
2447
2483
|
return {
|
|
@@ -2450,6 +2486,16 @@ export var getMappingConfigByTemplateDetail = function getMappingConfigByTemplat
|
|
|
2450
2486
|
hideComponents: hideComponents
|
|
2451
2487
|
};
|
|
2452
2488
|
};
|
|
2489
|
+
|
|
2490
|
+
// 获取映射值
|
|
2491
|
+
export var getMappingTargetValue = function getMappingTargetValue(value, type) {
|
|
2492
|
+
if (type === 'RADIO') {
|
|
2493
|
+
return value === null || value === void 0 ? void 0 : value.value;
|
|
2494
|
+
} else if (type === 'MULT_SELECT') {
|
|
2495
|
+
return last(value);
|
|
2496
|
+
}
|
|
2497
|
+
return value;
|
|
2498
|
+
};
|
|
2453
2499
|
//转换表单信息基本数据
|
|
2454
2500
|
export var transformWorkOrderDetail = function transformWorkOrderDetail(detail) {
|
|
2455
2501
|
return Object.keys(detail).reduce(function (prv, key) {
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -5,8 +5,8 @@ export { default as FormRender } from './FormRender';
|
|
|
5
5
|
export { default as FormRenderTemplateId } from './FormRenderTemplateId';
|
|
6
6
|
export { default as FlowWorkOrderDetail } from './FlowTemplateDetail';
|
|
7
7
|
export { default as TradeList } from './TradeList';
|
|
8
|
-
export { default as WdtTradeList } from './WdtTradeList';
|
|
9
8
|
export { default as FlowFormRender } from './FlowTemplateDetail/components/FormRender';
|
|
9
|
+
export { default as WdtTradeList } from './WdtTradeList';
|
|
10
10
|
export * as utils from './common/utils/tools';
|
|
11
11
|
export * as arithmetic from './common/utils/arithmetic';
|
|
12
12
|
export * from './WorkOrder/types';
|
package/dist/esm/index.js
CHANGED
|
@@ -15,8 +15,8 @@ export { default as FormRender } from "./FormRender";
|
|
|
15
15
|
export { default as FormRenderTemplateId } from "./FormRenderTemplateId";
|
|
16
16
|
export { default as FlowWorkOrderDetail } from "./FlowTemplateDetail";
|
|
17
17
|
export { default as TradeList } from "./TradeList";
|
|
18
|
-
export { default as WdtTradeList } from "./WdtTradeList";
|
|
19
18
|
export { default as FlowFormRender } from "./FlowTemplateDetail/components/FormRender";
|
|
19
|
+
export { default as WdtTradeList } from "./WdtTradeList";
|
|
20
20
|
import * as _utils from "./common/utils/tools";
|
|
21
21
|
export { _utils as utils };
|
|
22
22
|
import * as _arithmetic from "./common/utils/arithmetic";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kmkf-fe-packages/kmkf-work-order-service-component",
|
|
3
|
-
"version": "1.10.
|
|
3
|
+
"version": "1.10.1-beta.2",
|
|
4
4
|
"module": "dist/esm/index.js",
|
|
5
5
|
"typings": "dist/esm/index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -32,9 +32,9 @@
|
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@ant-design/icons": "^4.7.0",
|
|
35
|
-
"@kmkf-fe-packages/basic-components": "1.10.
|
|
36
|
-
"@kmkf-fe-packages/kmkf-utils": "1.10.0",
|
|
37
|
-
"@kmkf-fe-packages/services-components": "1.10.
|
|
35
|
+
"@kmkf-fe-packages/basic-components": "1.10.1-beta.2",
|
|
36
|
+
"@kmkf-fe-packages/kmkf-utils": "1.10.1-beta.0",
|
|
37
|
+
"@kmkf-fe-packages/services-components": "1.10.1-beta.2",
|
|
38
38
|
"@reduxjs/toolkit": "^1.8.5",
|
|
39
39
|
"ahooks": "^3.7.4",
|
|
40
40
|
"copy-to-clipboard": "^3.3.3",
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
"publishConfig": {
|
|
74
74
|
"access": "public"
|
|
75
75
|
},
|
|
76
|
-
"gitHead": "
|
|
76
|
+
"gitHead": "d1f8b145213bc3fb624883b78fdfc9a902bfb308",
|
|
77
77
|
"gitHooks": {
|
|
78
78
|
"pre-commit": "lint-staged"
|
|
79
79
|
}
|