@kmkf-fe-packages/kmkf-work-order-service-component 0.25.2 → 0.26.0-alpha.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
CHANGED
|
@@ -65,4 +65,4 @@ const Text = ()=>{
|
|
|
65
65
|
|
|
66
66
|
```
|
|
67
67
|
|
|
68
|
-
| 字段 | 说明 | 数据类型 | | ----------------- | ---------------- | ------------------------------------ | | platform | 平台 | TAOBAO =淘宝\|FXG=抖音\|PDD=拼多多\| | | shopId | 店铺 ID | number | | buyerNick | 买家昵称 | string | | buyerId | 买家 id | string | | orderNo | 订单 id | string | | onEmpowerCallback | 授权弹框点击回调 | function |
|
|
68
|
+
| 字段 | 说明 | 数据类型 | | ----------------- | ---------------- | ------------------------------------ | | platform | 平台 | TAOBAO =淘宝\|FXG=抖音\|PDD=拼多多\| | | shopId | 店铺 ID | number | | buyerNick | 买家昵称 | string | | buyerId | 买家 id | string | | orderNo | 订单 id | string | | onEmpowerCallback | 授权弹框点击回调 | function |
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var _excluded = ["displayConfig", "disabled", "platform"];
|
|
1
|
+
var _excluded = ["displayConfig", "disabled", "platform", "isPreRender"];
|
|
2
2
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
3
3
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
4
4
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
@@ -31,7 +31,7 @@ import { calcWorkOrderList, orderBack, getReplaceWarnValues, COMPONENT_MAP_NAME,
|
|
|
31
31
|
INNER_REPLACE_COMPONENT, reversalFormValues, bsSystemOrderBackValues, wlnSystemOrderBackValues, getMappingConfigByTemplateDetail, setLogisticsInfo } from "../../../common/utils/tools";
|
|
32
32
|
import { replaceCheck, orderDetail } from "../../../model/servers/api";
|
|
33
33
|
import { factory } from '@kmkf-fe-packages/services-components';
|
|
34
|
-
import { AddressData, ExpressData, ExpressInterceptData, PlatData, LogisticsAddressData, getExpression, formatDisplayConfig, BsAddressData } from '@kmkf-fe-packages/kmkf-utils';
|
|
34
|
+
import { AddressData, ExpressData, ExpressInterceptData, PlatData, LogisticsAddressData, getExpression, formatDisplayConfig, BsAddressData, isNull } from '@kmkf-fe-packages/kmkf-utils';
|
|
35
35
|
import ShopName from "../ShopName";
|
|
36
36
|
import { PlatForm } from "../../../model/flowTemplateDetail/types";
|
|
37
37
|
import { groupByPreNode, getCurrentNodeModifiedShowHideRule } from "./common";
|
|
@@ -721,8 +721,23 @@ var FormRender = function FormRender(props, ref) {
|
|
|
721
721
|
}
|
|
722
722
|
return getExpression((_item$compareSymbol = item.compareSymbol) === null || _item$compareSymbol === void 0 ? void 0 : _item$compareSymbol.toUpperCase(), leftValue, item.rightValue);
|
|
723
723
|
};
|
|
724
|
+
var getDisplayAndDisabledConfig = function getDisplayAndDisabledConfig(config) {
|
|
725
|
+
if (isNull(config)) {
|
|
726
|
+
return {
|
|
727
|
+
display: true,
|
|
728
|
+
disabled: false
|
|
729
|
+
};
|
|
730
|
+
}
|
|
731
|
+
var display = Math.floor(Number(config) / 2) === 1; // 取整
|
|
732
|
+
var disabled = Number(config) % 2 === 0;
|
|
733
|
+
return {
|
|
734
|
+
display: display,
|
|
735
|
+
disabled: disabled
|
|
736
|
+
};
|
|
737
|
+
};
|
|
724
738
|
var newRenderColumnItem = function newRenderColumnItem(effects) {
|
|
725
739
|
return function (item) {
|
|
740
|
+
var _componentConfig$stat, _componentConfig$stat2;
|
|
726
741
|
var _item$componentConfig2 = item.componentConfig,
|
|
727
742
|
componentConfig = _item$componentConfig2 === void 0 ? {} : _item$componentConfig2,
|
|
728
743
|
workOrderComponentType = item.workOrderComponentType,
|
|
@@ -731,13 +746,19 @@ var FormRender = function FormRender(props, ref) {
|
|
|
731
746
|
var displayConfig = effects.displayConfig,
|
|
732
747
|
disabled = effects.disabled,
|
|
733
748
|
platform = effects.platform,
|
|
749
|
+
isPreRender = effects.isPreRender,
|
|
734
750
|
others = _objectWithoutProperties(effects, _excluded);
|
|
735
751
|
var newComponentConfig = _objectSpread(_objectSpread({}, componentConfig), {}, {
|
|
736
752
|
disabled: disabled
|
|
737
753
|
});
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
754
|
+
var _getDisplayAndDisable = getDisplayAndDisabledConfig(workOrderId ? componentConfig === null || componentConfig === void 0 ? void 0 : (_componentConfig$stat = componentConfig.status) === null || _componentConfig$stat === void 0 ? void 0 : _componentConfig$stat.upgrade : componentConfig === null || componentConfig === void 0 ? void 0 : (_componentConfig$stat2 = componentConfig.status) === null || _componentConfig$stat2 === void 0 ? void 0 : _componentConfig$stat2.created),
|
|
755
|
+
componentCanEdit = _getDisplayAndDisable.disabled,
|
|
756
|
+
componentCanShow = _getDisplayAndDisable.display;
|
|
757
|
+
// TODO: 非前置节点组件渲染消费是否可以编辑配置
|
|
758
|
+
if (!isPreRender) {
|
|
759
|
+
console.debug(workOrderId ? '编辑状态:' : '新建状态:', name, '是否可以展示: ', componentCanShow, '是否可以编辑: ', !componentCanEdit, componentConfig === null || componentConfig === void 0 ? void 0 : componentConfig.status);
|
|
760
|
+
newComponentConfig['disabled'] = componentCanEdit;
|
|
761
|
+
}
|
|
741
762
|
if (workOrderComponentType === 'ENTERPRISE_PAYMENT') {
|
|
742
763
|
newComponentConfig['disabled'] = disabled || !canModifyPayment;
|
|
743
764
|
}
|
|
@@ -769,19 +790,10 @@ var FormRender = function FormRender(props, ref) {
|
|
|
769
790
|
currentTemplateAllComponentsDisplay.current[instance === null || instance === void 0 ? void 0 : instance.id] = true;
|
|
770
791
|
if (Reflect.has(idConditionListMap, instance.id)) {
|
|
771
792
|
var currentIdDependenceOtherFields = idConditionListMap[instance.id];
|
|
772
|
-
// 当前组件显隐依赖组件id列表
|
|
773
|
-
var dependenciesFields = currentIdDependenceOtherFields === null || currentIdDependenceOtherFields === void 0 ? void 0 : currentIdDependenceOtherFields.reduce(function (cur, nxt) {
|
|
774
|
-
var _nxt$rules;
|
|
775
|
-
nxt === null || nxt === void 0 ? void 0 : (_nxt$rules = nxt.rules) === null || _nxt$rules === void 0 ? void 0 : _nxt$rules.map(function (i) {
|
|
776
|
-
return cur.add(i.leftValue);
|
|
777
|
-
});
|
|
778
|
-
return cur;
|
|
779
|
-
}, new Set());
|
|
780
|
-
|
|
781
793
|
// 需要增加显隐处理逻辑
|
|
782
794
|
return /*#__PURE__*/React.createElement(Form.Item, {
|
|
783
795
|
noStyle: true,
|
|
784
|
-
shouldUpdate: function shouldUpdate(
|
|
796
|
+
shouldUpdate: function shouldUpdate() {
|
|
785
797
|
return true; // TODO: 修复重复依赖的问题 https://tb.raycloud.com/task/64e4491e0b8b5c001e1099b9
|
|
786
798
|
}
|
|
787
799
|
}, function (_ref4) {
|
|
@@ -796,57 +808,11 @@ var FormRender = function FormRender(props, ref) {
|
|
|
796
808
|
// 满足所有
|
|
797
809
|
if (linkCondition === 'every') {
|
|
798
810
|
return every(conditionList, function (item) {
|
|
799
|
-
//现支持子组件控制显隐,格式为${uniqueKey}_${type}与普通组件做区分
|
|
800
|
-
// const isChildField = item.leftValue.includes('_');
|
|
801
|
-
// const prefixId = isChildField ? item.leftValue.split('_')?.[0] : item.leftValue;
|
|
802
|
-
// const childFieldType = isChildField ? item.leftValue.split('_')?.[1] : '';
|
|
803
|
-
// let dependenceDetail = getComponentDetailByFieldId(prefixId);
|
|
804
|
-
// if (isChildField && CHILD_FIELD_TYPE[childFieldType]) {
|
|
805
|
-
// const childType = CHILD_FIELD_TYPE[childFieldType];
|
|
806
|
-
// dependenceDetail = dependenceDetail?.[childType] || dependenceDetail;
|
|
807
|
-
// }
|
|
808
|
-
|
|
809
|
-
// let leftValue = getFieldValue(prefixId);
|
|
810
|
-
// if (isChildField) {
|
|
811
|
-
// leftValue = (leftValue as Record<string, any>)?.[childFieldType];
|
|
812
|
-
// }
|
|
813
|
-
// if (typeof dependenceDetail.formDataTransform === 'function') {
|
|
814
|
-
// leftValue = dependenceDetail.formDataTransform(leftValue);
|
|
815
|
-
// }
|
|
816
|
-
// // TODO: 如果依赖的组件是隐藏的,当前依赖项为false
|
|
817
|
-
// if (
|
|
818
|
-
// Reflect.has(currentComponentDisplayStatus.current, prefixId) &&
|
|
819
|
-
// !currentComponentDisplayStatus.current[prefixId]
|
|
820
|
-
// ) {
|
|
821
|
-
// return false;
|
|
822
|
-
// }
|
|
823
|
-
// return getExpression(
|
|
824
|
-
// item.compareSymbol?.toUpperCase(),
|
|
825
|
-
// leftValue,
|
|
826
|
-
// item.rightValue,
|
|
827
|
-
// );
|
|
828
811
|
return conditionItemResult(item, getFieldValue);
|
|
829
812
|
});
|
|
830
813
|
}
|
|
831
814
|
// 满足其中之一
|
|
832
815
|
return some(conditionList, function (item) {
|
|
833
|
-
// const dependenceDetail = getComponentDetailByFieldId(item.leftValue);
|
|
834
|
-
// let leftValue = getFieldValue(item.leftValue);
|
|
835
|
-
// if (typeof dependenceDetail.formDataTransform === 'function') {
|
|
836
|
-
// leftValue = dependenceDetail.formDataTransform(leftValue);
|
|
837
|
-
// }
|
|
838
|
-
// // TODO: 如果依赖的组件是隐藏的,当前依赖项为false
|
|
839
|
-
// if (
|
|
840
|
-
// Reflect.has(currentComponentDisplayStatus.current, item.leftValue) &&
|
|
841
|
-
// !currentComponentDisplayStatus.current[item.leftValue]
|
|
842
|
-
// ) {
|
|
843
|
-
// return false;
|
|
844
|
-
// }
|
|
845
|
-
// return getExpression(
|
|
846
|
-
// item.compareSymbol?.toUpperCase(),
|
|
847
|
-
// leftValue,
|
|
848
|
-
// item.rightValue,
|
|
849
|
-
// );
|
|
850
816
|
return conditionItemResult(item, getFieldValue);
|
|
851
817
|
});
|
|
852
818
|
}, false);
|
|
@@ -867,7 +833,8 @@ var FormRender = function FormRender(props, ref) {
|
|
|
867
833
|
},
|
|
868
834
|
hidden: !show || mappdingHideComponents.includes(uniqueKey),
|
|
869
835
|
platform: platform,
|
|
870
|
-
innerReplaceValueCh: innerReplaceValueCh
|
|
836
|
+
innerReplaceValueCh: innerReplaceValueCh,
|
|
837
|
+
display: isPreRender ? true : componentCanShow
|
|
871
838
|
});
|
|
872
839
|
});
|
|
873
840
|
}
|
|
@@ -878,7 +845,8 @@ var FormRender = function FormRender(props, ref) {
|
|
|
878
845
|
},
|
|
879
846
|
hidden: mappdingHideComponents.includes(uniqueKey),
|
|
880
847
|
platform: platform,
|
|
881
|
-
innerReplaceValueCh: innerReplaceValueCh
|
|
848
|
+
innerReplaceValueCh: innerReplaceValueCh,
|
|
849
|
+
display: isPreRender ? true : componentCanShow
|
|
882
850
|
});
|
|
883
851
|
};
|
|
884
852
|
};
|
|
@@ -896,7 +864,8 @@ var FormRender = function FormRender(props, ref) {
|
|
|
896
864
|
workOrderDetail: record,
|
|
897
865
|
templateDetail: templateDetail,
|
|
898
866
|
disabled: look,
|
|
899
|
-
displayConfig: get(templateDetail, 'flowTemplateConfig.showHideRule.rules', [])
|
|
867
|
+
displayConfig: get(templateDetail, 'flowTemplateConfig.showHideRule.rules', []),
|
|
868
|
+
isPreRender: false
|
|
900
869
|
}));
|
|
901
870
|
// TODO: 这里只是为了把前置组件的值能够set到当前form表单中去
|
|
902
871
|
// TODO: 为什么不直接把前置和当前放在同一个form里面呢?因为放在同一个里面会有必填校验等逻辑,前置节点在当前表单中只是做展示,但是还必须有控制显隐功能
|
|
@@ -1007,7 +976,8 @@ var FormRender = function FormRender(props, ref) {
|
|
|
1007
976
|
workOrderDetail: record,
|
|
1008
977
|
templateDetail: templateDetail,
|
|
1009
978
|
disabled: true,
|
|
1010
|
-
displayConfig: finalDisplayConfig
|
|
979
|
+
displayConfig: finalDisplayConfig,
|
|
980
|
+
isPreRender: true
|
|
1011
981
|
})));
|
|
1012
982
|
});
|
|
1013
983
|
return preNodeItems;
|
|
@@ -6,6 +6,7 @@ export declare const selectFlowList: ((state: {
|
|
|
6
6
|
paymentWorkOrder: import("../paymentWorkOrder/types").PaymentWorkOrderState;
|
|
7
7
|
singleWorkOrder: import("../singleShopWorkOrder/types").SingleWorkOrderState;
|
|
8
8
|
logicFlow: import("./types").LogicFlowState;
|
|
9
|
+
flowWOrkOrderDetail: import("../flowTemplateDetail/types").FlowTemplateDetailState;
|
|
9
10
|
}) => import("./types").LogicFlow[]) & import("reselect").OutputSelectorFields<(args_0: import("./types").LogicFlowState) => import("./types").LogicFlow[], {
|
|
10
11
|
clearCache: () => void;
|
|
11
12
|
}> & {
|
|
@@ -19,6 +20,7 @@ export declare const selectGroupFlowList: ((state: {
|
|
|
19
20
|
paymentWorkOrder: import("../paymentWorkOrder/types").PaymentWorkOrderState;
|
|
20
21
|
singleWorkOrder: import("../singleShopWorkOrder/types").SingleWorkOrderState;
|
|
21
22
|
logicFlow: import("./types").LogicFlowState;
|
|
23
|
+
flowWOrkOrderDetail: import("../flowTemplateDetail/types").FlowTemplateDetailState;
|
|
22
24
|
}) => import("./types").Option[]) & import("reselect").OutputSelectorFields<(args_0: import("./types").LogicFlowState) => import("./types").Option[], {
|
|
23
25
|
clearCache: () => void;
|
|
24
26
|
}> & {
|
|
@@ -32,6 +34,7 @@ export declare const selectFlowTemplateGroupWorkOrderTemplateList: ((state: {
|
|
|
32
34
|
paymentWorkOrder: import("../paymentWorkOrder/types").PaymentWorkOrderState;
|
|
33
35
|
singleWorkOrder: import("../singleShopWorkOrder/types").SingleWorkOrderState;
|
|
34
36
|
logicFlow: import("./types").LogicFlowState;
|
|
37
|
+
flowWOrkOrderDetail: import("../flowTemplateDetail/types").FlowTemplateDetailState;
|
|
35
38
|
}) => import("./types").Option[]) & import("reselect").OutputSelectorFields<(args_0: import("./types").LogicFlowState) => import("./types").Option[], {
|
|
36
39
|
clearCache: () => void;
|
|
37
40
|
}> & {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kmkf-fe-packages/kmkf-work-order-service-component",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.26.0-alpha.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": "^0.
|
|
36
|
-
"@kmkf-fe-packages/kmkf-utils": "^0.
|
|
37
|
-
"@kmkf-fe-packages/services-components": "^0.
|
|
35
|
+
"@kmkf-fe-packages/basic-components": "^0.26.0-alpha.0",
|
|
36
|
+
"@kmkf-fe-packages/kmkf-utils": "^0.26.0-alpha.0",
|
|
37
|
+
"@kmkf-fe-packages/services-components": "^0.26.0-alpha.0",
|
|
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": "052f0dc001ab5a964c6159c0215849e43d1451d3",
|
|
77
77
|
"gitHooks": {
|
|
78
78
|
"pre-commit": "lint-staged"
|
|
79
79
|
}
|