@kmkf-fe-packages/services-components 2.4.0-rc.0 → 2.4.1
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/Hooks/index.d.ts +2 -0
- package/dist/esm/Hooks/index.js +2 -0
- package/dist/esm/Hooks/useColumnsConfig.d.ts +26 -0
- package/dist/esm/Hooks/useColumnsConfig.js +243 -0
- package/dist/esm/Hooks/useGoodsSourceFormat.d.ts +29 -0
- package/dist/esm/Hooks/useGoodsSourceFormat.js +441 -0
- package/dist/esm/commonComponents/GlobalContext/hook/useGetHasErpData.d.ts +1 -1
- package/dist/esm/commonComponents/GlobalContext/hook/useGetHasErpData.js +4 -2
- package/dist/esm/commonComponents/GlobalContext/index.js +10 -3
- package/dist/esm/commonComponents/GlobalContext/orderQuery/useGetErpAddressData.js +14 -11
- package/dist/esm/commonComponents/GlobalContext/orderQuery/useGetErpLogisticsCompany.js +14 -12
- package/dist/esm/commonComponents/GlobalContext/orderQuery/useGetErpSendData.js +11 -9
- package/dist/esm/commonComponents/OperationLog/index.d.ts +2 -1
- package/dist/esm/commonComponents/OperationLog/index.js +4 -2
- package/dist/esm/commonComponents/QueryLogisticsTrack/index.d.ts +5 -3
- package/dist/esm/commonComponents/QueryLogisticsTrack/index.js +23 -19
- package/dist/esm/commonComponents/ShopList/index.js +3 -1
- package/dist/esm/components/BS/BsLogistics/index.d.ts +7 -2
- package/dist/esm/components/BS/BsLogistics/index.js +61 -8
- package/dist/esm/components/BS/BsSystemOrder/index.d.ts +8 -0
- package/dist/esm/components/BS/BsSystemOrder/index.js +56 -9
- package/dist/esm/components/BS/common/BsHeaderChild.d.ts +4 -4
- package/dist/esm/components/BS/common/BsHeaderChild.js +8 -8
- package/dist/esm/components/BS/common/BsHeaderGood.js +2 -2
- package/dist/esm/components/BS/common/BsHeaderPic.d.ts +2 -0
- package/dist/esm/components/BS/common/BsHeaderPic.js +20 -10
- package/dist/esm/components/BS/common/BsMemo.js +4 -1
- package/dist/esm/components/BS/common/BsType.js +4 -1
- package/dist/esm/components/BS/common/SystemOrderNo.js +4 -1
- package/dist/esm/components/BS/common/expressCode.d.ts +4 -1
- package/dist/esm/components/BS/common/expressCode.js +16 -4
- package/dist/esm/components/BS/common/expressCompany.d.ts +5 -2
- package/dist/esm/components/BS/common/expressCompany.js +31 -5
- package/dist/esm/components/BsE3/BsReissueE3/index.js +4 -1
- package/dist/esm/components/Cascader/index.d.ts +8 -6
- package/dist/esm/components/Cascader/index.js +26 -22
- package/dist/esm/components/Common/constants/bs.js +2 -2
- package/dist/esm/components/Common/constants/columnsBaseInfoMap.js +6 -2
- package/dist/esm/components/Common/constants/defaultColumns.js +2 -2
- package/dist/esm/components/Common/constants/wdt.js +104 -0
- package/dist/esm/components/Common/index.d.ts +3 -3
- package/dist/esm/components/Common/index.js +49 -28
- package/dist/esm/components/CommonDataTime/index.d.ts +2 -2
- package/dist/esm/components/CommonDataTime/index.js +2 -2
- package/dist/esm/components/CommonHeaderGood/index.js +1165 -18
- package/dist/esm/components/CommonInput/index.js +11 -3
- package/dist/esm/components/CommonMultiStatus/index.js +73 -36
- package/dist/esm/components/ErpTradeId/index.d.ts +2 -2
- package/dist/esm/components/ErpTradeId/index.js +7 -4
- package/dist/esm/components/File/index.d.ts +6 -6
- package/dist/esm/components/File/index.js +9 -10
- package/dist/esm/components/FlowOverallStatusSelect/index.d.ts +40 -0
- package/dist/esm/components/FlowOverallStatusSelect/index.js +180 -0
- package/dist/esm/components/GY/GyGoods/index.js +5 -1
- package/dist/esm/components/GY/GyReissue/index.js +5 -1
- package/dist/esm/components/GY/GyReturn/index.js +5 -1
- package/dist/esm/components/Input/index.d.ts +4 -4
- package/dist/esm/components/Input/index.js +35 -31
- package/dist/esm/components/JST/JstSendGood/index.js +17 -1
- package/dist/esm/components/KM/KmExchange/index.d.ts +35 -0
- package/dist/esm/components/KM/KmExchange/index.js +136 -0
- package/dist/esm/components/KmErpSendGood/index.js +1 -1
- package/dist/esm/components/Logistics/index.d.ts +1 -0
- package/dist/esm/components/Logistics/index.js +10 -0
- package/dist/esm/components/LogisticsInterception/columnHeader.js +1 -1
- package/dist/esm/components/LogisticsInterception/index.d.ts +20 -0
- package/dist/esm/components/LogisticsInterception/index.js +10 -5
- package/dist/esm/components/LogisticsInterception/interceptApiStatusReason.d.ts +45 -0
- package/dist/esm/components/LogisticsInterception/interceptApiStatusReason.js +97 -0
- package/dist/esm/components/LogisticsInterception/interceptSenderMobile.js +3 -2
- package/dist/esm/components/LogisticsMoreInterception/InterceptAddress.js +4 -2
- package/dist/esm/components/LogisticsMoreInterception/InterceptApiStatus.js +1 -1
- package/dist/esm/components/LogisticsMoreInterception/index.js +1 -0
- package/dist/esm/components/LogisticsMoreInterception/interceptSenderMobile.d.ts +5 -5
- package/dist/esm/components/LogisticsMoreInterception/interceptSenderMobile.js +9 -9
- package/dist/esm/components/OrderSubForm/index.d.ts +56 -0
- package/dist/esm/components/OrderSubForm/index.js +285 -0
- package/dist/esm/components/Payment/index.d.ts +13 -12
- package/dist/esm/components/Payment/index.js +31 -11
- package/dist/esm/components/PaymentVoucherCode/Preview.js +35 -9
- package/dist/esm/components/Picture/index.d.ts +5 -5
- package/dist/esm/components/Picture/index.js +20 -20
- package/dist/esm/components/PicturePro/index.d.ts +15 -6
- package/dist/esm/components/PicturePro/index.js +42 -25
- package/dist/esm/components/PostIng/index.d.ts +5 -0
- package/dist/esm/components/PostIng/index.js +42 -8
- package/dist/esm/components/Public/Goods/index.d.ts +10 -8
- package/dist/esm/components/Public/Goods/index.js +42 -2
- package/dist/esm/components/Public/ReissueGoods/index.js +62 -4
- package/dist/esm/components/Public/ReturnWarehouse/index.d.ts +51 -0
- package/dist/esm/components/Public/ReturnWarehouse/index.js +210 -0
- package/dist/esm/components/ReceiverAddress/index.d.ts +7 -6
- package/dist/esm/components/ReceiverAddress/index.js +41 -27
- package/dist/esm/components/Reissue/Logistics/index.js +2 -2
- package/dist/esm/components/Remark/index.d.ts +18 -2
- package/dist/esm/components/Remark/index.js +37 -2
- package/dist/esm/components/ReturnLogistics/index.d.ts +7 -6
- package/dist/esm/components/ReturnLogistics/index.js +34 -17
- package/dist/esm/components/SKX/SkxGoods/index.js +4 -0
- package/dist/esm/components/SKX/SkxIdInputSelect/index.js +4 -0
- package/dist/esm/components/Select/index.d.ts +1 -0
- package/dist/esm/components/Select/index.js +22 -11
- package/dist/esm/components/ShopInput/index.d.ts +5 -5
- package/dist/esm/components/ShopInput/index.js +12 -9
- package/dist/esm/components/StatusSelect/index.js +4 -0
- package/dist/esm/components/SubForm/children/HeaderChildFile.d.ts +30 -0
- package/dist/esm/components/SubForm/children/HeaderChildFile.js +117 -0
- package/dist/esm/components/SubForm/children/HeaderChildPic.d.ts +30 -0
- package/dist/esm/components/SubForm/children/HeaderChildPic.js +116 -0
- package/dist/esm/components/SubForm/index.js +78 -6
- package/dist/esm/components/TradeId/index.d.ts +5 -5
- package/dist/esm/components/TradeId/index.js +17 -14
- package/dist/esm/components/WDT/WdtRessuie/index.js +28 -8
- package/dist/esm/factory.d.ts +2 -2
- package/dist/esm/factory.js +37 -7
- package/dist/esm/index.d.ts +5 -0
- package/dist/esm/index.js +7 -1
- package/dist/esm/service/api.d.ts +3 -0
- package/dist/esm/service/api.js +34 -1
- package/dist/esm/type.d.ts +38 -0
- package/package.json +4 -4
- package/dist/esm/components/Common/constants/gy.d.ts +0 -3
- package/dist/esm/components/Common/constants/gy.js +0 -219
|
@@ -0,0 +1,441 @@
|
|
|
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 _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
6
|
+
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."); }
|
|
7
|
+
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); }
|
|
8
|
+
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; }
|
|
9
|
+
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; } }
|
|
10
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
11
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
12
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
13
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
14
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
15
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
16
|
+
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); }
|
|
17
|
+
import { DEFAULT_FIELD_TYPE_LIST, servers, TEMPLATE_ID } from "@kmkf-fe-packages/kmkf-utils";
|
|
18
|
+
import { useEffect, useState } from "react";
|
|
19
|
+
import ShopList from "../commonComponents/ShopList";
|
|
20
|
+
import { factory } from "../factory";
|
|
21
|
+
import { useColumnsConfig } from "./useColumnsConfig";
|
|
22
|
+
var toArray = function toArray(data) {
|
|
23
|
+
if (Array.isArray(data)) return data;
|
|
24
|
+
if (data && _typeof(data) === "object") return [data];
|
|
25
|
+
return [];
|
|
26
|
+
};
|
|
27
|
+
var stringToNumber = function stringToNumber(str) {
|
|
28
|
+
if (typeof str === 'number') return str;
|
|
29
|
+
// 检查输入是否为字符串类型
|
|
30
|
+
if (typeof str !== "string") return null;
|
|
31
|
+
|
|
32
|
+
// 去除首尾空白字符
|
|
33
|
+
str = str.trim();
|
|
34
|
+
|
|
35
|
+
// 检查是否为空字符串
|
|
36
|
+
if (str === "") {
|
|
37
|
+
return null;
|
|
38
|
+
}
|
|
39
|
+
var num = Number(str);
|
|
40
|
+
if (isNaN(num)) {
|
|
41
|
+
return null;
|
|
42
|
+
}
|
|
43
|
+
return num;
|
|
44
|
+
};
|
|
45
|
+
var getShopList = function getShopList() {
|
|
46
|
+
return servers.singletonWrap(function () {
|
|
47
|
+
return servers.queryShopList();
|
|
48
|
+
}, {
|
|
49
|
+
name: "getShopList",
|
|
50
|
+
key: "getShopList",
|
|
51
|
+
cacheTime: 1000 * 60 * 3
|
|
52
|
+
});
|
|
53
|
+
};
|
|
54
|
+
var queryCompanyUserSimpleInfoList = function queryCompanyUserSimpleInfoList() {
|
|
55
|
+
return servers.singletonWrap(function () {
|
|
56
|
+
return servers.queryCompanyUserSimpleInfoList();
|
|
57
|
+
}, {
|
|
58
|
+
name: "queryCompanyUserSimpleInfoList",
|
|
59
|
+
key: "queryCompanyUserSimpleInfoList",
|
|
60
|
+
cacheTime: 1000 * 60 * 3
|
|
61
|
+
});
|
|
62
|
+
};
|
|
63
|
+
var getPublishFlowDetail = function getPublishFlowDetail(flowTemplateKey) {
|
|
64
|
+
return servers.singletonWrap(function () {
|
|
65
|
+
return servers.getPublishFlowDetail(flowTemplateKey);
|
|
66
|
+
}, {
|
|
67
|
+
name: "getPublishFlowDetail",
|
|
68
|
+
key: flowTemplateKey,
|
|
69
|
+
cacheTime: 1000 * 10
|
|
70
|
+
});
|
|
71
|
+
};
|
|
72
|
+
var getGroupList = function getGroupList() {
|
|
73
|
+
return servers.singletonWrap(function () {
|
|
74
|
+
return servers.getGroupList();
|
|
75
|
+
}, {
|
|
76
|
+
name: "getGroupList",
|
|
77
|
+
key: "getGroupList",
|
|
78
|
+
cacheTime: 1000 * 60 * 3
|
|
79
|
+
});
|
|
80
|
+
};
|
|
81
|
+
var queryColumnsConfig = function queryColumnsConfig(params) {
|
|
82
|
+
return servers.singletonWrap(function () {
|
|
83
|
+
return servers.queryColumnsConfig(_objectSpread({
|
|
84
|
+
isGroupNode: false
|
|
85
|
+
}, params));
|
|
86
|
+
}, {
|
|
87
|
+
name: "queryColumnsConfig",
|
|
88
|
+
key: "".concat(params.flowTemplateKey, "_").concat(params.nodeId, "_").concat(params.templateId),
|
|
89
|
+
cacheTime: 1000 * 10
|
|
90
|
+
});
|
|
91
|
+
};
|
|
92
|
+
var sortArr = function sortArr(arr) {
|
|
93
|
+
return arr.sort(function (_ref, _ref2) {
|
|
94
|
+
var a = _ref.index;
|
|
95
|
+
var b = _ref2.index;
|
|
96
|
+
// 检查 a 和 b 是否为数字
|
|
97
|
+
var aIsNum = typeof a === "number" && !isNaN(a);
|
|
98
|
+
var bIsNum = typeof b === "number" && !isNaN(b);
|
|
99
|
+
if (aIsNum && bIsNum) {
|
|
100
|
+
// 都是数字,按数值大小排序
|
|
101
|
+
return a - b;
|
|
102
|
+
} else if (aIsNum) {
|
|
103
|
+
// a 是数字,b 不是,a 排在前面
|
|
104
|
+
return -1;
|
|
105
|
+
} else if (bIsNum) {
|
|
106
|
+
// b 是数字,a 不是,b 排在前面
|
|
107
|
+
return 1;
|
|
108
|
+
} else {
|
|
109
|
+
// 都不是数字,保持相对顺序(或都排最后)
|
|
110
|
+
return 0;
|
|
111
|
+
}
|
|
112
|
+
});
|
|
113
|
+
};
|
|
114
|
+
var findIndex = function findIndex(field, dataFilterConfig) {
|
|
115
|
+
var smallest = Number.MAX_VALUE;
|
|
116
|
+
if (dataFilterConfig) {
|
|
117
|
+
field.children.forEach(function (child) {
|
|
118
|
+
var _child$children, _dataFilterConfig;
|
|
119
|
+
var key = child.dataIndex || child.formField;
|
|
120
|
+
var index = (_child$children = child.children) !== null && _child$children !== void 0 && _child$children.length ? findIndex(child, dataFilterConfig) : (_dataFilterConfig = dataFilterConfig[key]) === null || _dataFilterConfig === void 0 ? void 0 : _dataFilterConfig.index;
|
|
121
|
+
if (typeof index === "number" && index < smallest) {
|
|
122
|
+
smallest = index;
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
return smallest < Number.MAX_VALUE ? smallest : void 0;
|
|
127
|
+
};
|
|
128
|
+
var filterTableColumn = function filterTableColumn(cols, dataFilterConfig) {
|
|
129
|
+
return cols.filter(function (col) {
|
|
130
|
+
var _col$children;
|
|
131
|
+
if ((_col$children = col.children) !== null && _col$children !== void 0 && _col$children.length) {
|
|
132
|
+
var _col$children2;
|
|
133
|
+
// 如果是复合组件
|
|
134
|
+
col.children = filterTableColumn(col.children, dataFilterConfig);
|
|
135
|
+
return (_col$children2 = col.children) === null || _col$children2 === void 0 ? void 0 : _col$children2.length;
|
|
136
|
+
} else {
|
|
137
|
+
var _dataFilterConfig2;
|
|
138
|
+
var _key = col.formField || col.dataIndex;
|
|
139
|
+
return dataFilterConfig === null || dataFilterConfig === void 0 ? void 0 : (_dataFilterConfig2 = dataFilterConfig[_key]) === null || _dataFilterConfig2 === void 0 ? void 0 : _dataFilterConfig2.isShow;
|
|
140
|
+
// return true;
|
|
141
|
+
}
|
|
142
|
+
});
|
|
143
|
+
};
|
|
144
|
+
|
|
145
|
+
export var useGoodsSourceFormat = function useGoodsSourceFormat(goodsSource) {
|
|
146
|
+
var _goodsSource$sourceSe, _goodsSource$sourceSe2, _goodsSource$sourceSe3;
|
|
147
|
+
var _useState = useState([]),
|
|
148
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
149
|
+
filterItems = _useState2[0],
|
|
150
|
+
setFilterItems = _useState2[1];
|
|
151
|
+
var _useState3 = useState([]),
|
|
152
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
153
|
+
allTableColumns = _useState4[0],
|
|
154
|
+
setAllTableColumns = _useState4[1];
|
|
155
|
+
var _useState5 = useState(),
|
|
156
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
157
|
+
flowTemplateKey = _useState6[0],
|
|
158
|
+
setFlowTemplateKey = _useState6[1];
|
|
159
|
+
var _useState7 = useState(),
|
|
160
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
161
|
+
flowNodeId = _useState8[0],
|
|
162
|
+
setFlowNodeId = _useState8[1];
|
|
163
|
+
var _useState9 = useState(),
|
|
164
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
|
165
|
+
templateKey = _useState10[0],
|
|
166
|
+
setTemplateKey = _useState10[1];
|
|
167
|
+
var _useState11 = useState(),
|
|
168
|
+
_useState12 = _slicedToArray(_useState11, 2),
|
|
169
|
+
shopList = _useState12[0],
|
|
170
|
+
setShopList = _useState12[1];
|
|
171
|
+
var _useState13 = useState(),
|
|
172
|
+
_useState14 = _slicedToArray(_useState13, 2),
|
|
173
|
+
userList = _useState14[0],
|
|
174
|
+
setUserList = _useState14[1];
|
|
175
|
+
var _useState15 = useState(),
|
|
176
|
+
_useState16 = _slicedToArray(_useState15, 2),
|
|
177
|
+
groupList = _useState16[0],
|
|
178
|
+
setGroupList = _useState16[1];
|
|
179
|
+
// 表格展示列头
|
|
180
|
+
var _useState17 = useState([]),
|
|
181
|
+
_useState18 = _slicedToArray(_useState17, 2),
|
|
182
|
+
tableColumns = _useState18[0],
|
|
183
|
+
setTableColumns = _useState18[1];
|
|
184
|
+
// console.log(`**** 数据源配置:`, { goodsSource, filterItems });
|
|
185
|
+
|
|
186
|
+
var queryComponentsConfig = {
|
|
187
|
+
filterType: {
|
|
188
|
+
every: 0,
|
|
189
|
+
some: 1
|
|
190
|
+
}[(goodsSource === null || goodsSource === void 0 ? void 0 : (_goodsSource$sourceSe = goodsSource.sourceSettings) === null || _goodsSource$sourceSe === void 0 ? void 0 : _goodsSource$sourceSe.filterMode) || "every"],
|
|
191
|
+
preQueryComponents: goodsSource === null || goodsSource === void 0 ? void 0 : (_goodsSource$sourceSe2 = goodsSource.sourceSettings) === null || _goodsSource$sourceSe2 === void 0 ? void 0 : (_goodsSource$sourceSe3 = _goodsSource$sourceSe2.filterRules) === null || _goodsSource$sourceSe3 === void 0 ? void 0 : _goodsSource$sourceSe3.map(function (rule) {
|
|
192
|
+
var _rule$leftValue, _rule$leftValue$split;
|
|
193
|
+
var key = (_rule$leftValue = rule.leftValue) === null || _rule$leftValue === void 0 ? void 0 : (_rule$leftValue$split = _rule$leftValue.split(".")[2]) === null || _rule$leftValue$split === void 0 ? void 0 : _rule$leftValue$split.replace(/#$/, "");
|
|
194
|
+
if (key === 'flowCreator') {
|
|
195
|
+
var _rule$rightValue, _rule$rightValue2;
|
|
196
|
+
var value = new Set();
|
|
197
|
+
(((_rule$rightValue = rule.rightValue) === null || _rule$rightValue === void 0 ? void 0 : _rule$rightValue.staffIds) || []).map(function (userKey) {
|
|
198
|
+
var user = userList === null || userList === void 0 ? void 0 : userList.find(function (item) {
|
|
199
|
+
return item.value === userKey;
|
|
200
|
+
});
|
|
201
|
+
if (user !== null && user !== void 0 && user.label) {
|
|
202
|
+
value.add(user.label);
|
|
203
|
+
} else {
|
|
204
|
+
value.add(userKey);
|
|
205
|
+
}
|
|
206
|
+
});
|
|
207
|
+
(((_rule$rightValue2 = rule.rightValue) === null || _rule$rightValue2 === void 0 ? void 0 : _rule$rightValue2.groupIds) || []).forEach(function (groupId) {
|
|
208
|
+
var _group$relationUserLi;
|
|
209
|
+
var group = groupList === null || groupList === void 0 ? void 0 : groupList.find(function (item) {
|
|
210
|
+
return item.value === groupId;
|
|
211
|
+
});
|
|
212
|
+
group === null || group === void 0 ? void 0 : (_group$relationUserLi = group.relationUserList) === null || _group$relationUserLi === void 0 ? void 0 : _group$relationUserLi.map(function (item) {
|
|
213
|
+
value.add(item.userName);
|
|
214
|
+
});
|
|
215
|
+
});
|
|
216
|
+
return {
|
|
217
|
+
key: key,
|
|
218
|
+
symbol: rule.compareSymbol,
|
|
219
|
+
value: _toConsumableArray(value)
|
|
220
|
+
};
|
|
221
|
+
}
|
|
222
|
+
return {
|
|
223
|
+
key: key === 'shopName' ? 'shopNameList' : key,
|
|
224
|
+
symbol: rule.compareSymbol,
|
|
225
|
+
value: rule.rightValue
|
|
226
|
+
};
|
|
227
|
+
})
|
|
228
|
+
};
|
|
229
|
+
var _useColumnsConfig = useColumnsConfig({}),
|
|
230
|
+
tableColumnConfig = _useColumnsConfig.tableColumnConfig;
|
|
231
|
+
var workOrderDataToGoods = function workOrderDataToGoods(data, erp) {
|
|
232
|
+
var _goodsSource$sourceSe4;
|
|
233
|
+
// gy商品 接口返回,和选中的 都是这个
|
|
234
|
+
// brandName: "小白熊"
|
|
235
|
+
// brandNo: "BRD01"
|
|
236
|
+
// categoryName: "03母乳保存"
|
|
237
|
+
// categoryType: "18"
|
|
238
|
+
// companyKey: "SZF4ZGWZSNW6PYXMCIFEWBXT"
|
|
239
|
+
// costPrice: "13.1802"
|
|
240
|
+
// goodId: "535367779990"
|
|
241
|
+
// goodName: "母乳收集器(2只装)"
|
|
242
|
+
// goodNo: "XCP.01.03.20001"
|
|
243
|
+
// goodPicUrl: ""
|
|
244
|
+
// goodShortName: "08395"
|
|
245
|
+
// id: 162457
|
|
246
|
+
// isGift: false
|
|
247
|
+
// isSkuItem: true
|
|
248
|
+
// isVirtual: false
|
|
249
|
+
// platform: "GY_ERP"
|
|
250
|
+
// retailPrice: "59.0"
|
|
251
|
+
// specBarcode: "6951406983951"
|
|
252
|
+
// specId: "535367763578"
|
|
253
|
+
// specName: "2入装"
|
|
254
|
+
// specNo: "XCP.01.03.20001"
|
|
255
|
+
|
|
256
|
+
// 配置的值 keyMap
|
|
257
|
+
// amount: "adidBRdsfi"
|
|
258
|
+
// amountAfter: "qzBjJj8sfi"
|
|
259
|
+
// cancel: "qzBjJj8sfi"
|
|
260
|
+
// discountFee: "qzBjJj8sfi"
|
|
261
|
+
// goodName: "qzBjJj8sfi"
|
|
262
|
+
// goodNo: "Q8ZZHLWlki"
|
|
263
|
+
// goodShortName: "adidBRdsfi"
|
|
264
|
+
// isGift: "qzBjJj8sfi"
|
|
265
|
+
// originAmount: "qzBjJj8sfi"
|
|
266
|
+
// originPrice: "qzBjJj8sfi"
|
|
267
|
+
// price: "qzBjJj8sfi"
|
|
268
|
+
// qty: "qzBjJj8sfi"
|
|
269
|
+
// skuNote: "qzBjJj8sfi"
|
|
270
|
+
// specName: "qzBjJj8sfi"
|
|
271
|
+
// specNo: "qzBjJj8sfi"
|
|
272
|
+
// console.log("*** 商品 数据转换", {
|
|
273
|
+
// data,
|
|
274
|
+
// erp,
|
|
275
|
+
// keyMap: goodsSource?.sourceSettings.keyMap,
|
|
276
|
+
// });
|
|
277
|
+
var goods = {};
|
|
278
|
+
var keyMap = (goodsSource === null || goodsSource === void 0 ? void 0 : (_goodsSource$sourceSe4 = goodsSource.sourceSettings) === null || _goodsSource$sourceSe4 === void 0 ? void 0 : _goodsSource$sourceSe4.keyMap) || {};
|
|
279
|
+
var ids = _toConsumableArray(new Set(Object.values(keyMap)));
|
|
280
|
+
var fieldMap = new Map();
|
|
281
|
+
ids.forEach(function (id) {
|
|
282
|
+
var field = allTableColumns.find(function (column) {
|
|
283
|
+
return column.id === id;
|
|
284
|
+
});
|
|
285
|
+
if (field) {
|
|
286
|
+
fieldMap.set(id, field);
|
|
287
|
+
}
|
|
288
|
+
});
|
|
289
|
+
// console.log(`🚀 ~ 组件 ids:`, ids, allTableColumns, fieldMap);
|
|
290
|
+
Object.entries(keyMap).forEach(function (_ref3) {
|
|
291
|
+
var _ref4 = _slicedToArray(_ref3, 2),
|
|
292
|
+
key = _ref4[0],
|
|
293
|
+
id = _ref4[1];
|
|
294
|
+
var field = fieldMap.get(id);
|
|
295
|
+
if (!field) return;
|
|
296
|
+
// PS: 当前只有输入框/多行文本框/单选/下拉单选 所以不用考虑复合组件
|
|
297
|
+
var fillValue = field.formField ? data[field.formField] : void 0;
|
|
298
|
+
if (field.type === "RADIO" && data["".concat(field.id, "_radioOther")]) {
|
|
299
|
+
fillValue = data["".concat(field.id, "_radioOther")];
|
|
300
|
+
}
|
|
301
|
+
if (["isGift", "cancel"].includes(key)) {
|
|
302
|
+
fillValue = fillValue === "是" ? 1 : fillValue === "否" ? 0 : void 0;
|
|
303
|
+
}
|
|
304
|
+
goods[key] = ["qty", "price", "amount", "originPrice", "originAmount", "discountFee", "amountAfter"].includes(key) ? stringToNumber(fillValue) : fillValue;
|
|
305
|
+
});
|
|
306
|
+
goods.id = data.id;
|
|
307
|
+
// console.log("***** 转换之后的 values", goods);
|
|
308
|
+
return goods;
|
|
309
|
+
};
|
|
310
|
+
useEffect(function () {
|
|
311
|
+
getShopList().then(function (_ref5) {
|
|
312
|
+
var data = _ref5.data;
|
|
313
|
+
setShopList(data);
|
|
314
|
+
}).catch(console.warn);
|
|
315
|
+
queryCompanyUserSimpleInfoList().then(function (_ref6) {
|
|
316
|
+
var data = _ref6.data;
|
|
317
|
+
setUserList((data || []).map(function (_ref7) {
|
|
318
|
+
var account = _ref7.account,
|
|
319
|
+
userKey = _ref7.userKey;
|
|
320
|
+
return {
|
|
321
|
+
label: account,
|
|
322
|
+
value: userKey
|
|
323
|
+
};
|
|
324
|
+
}));
|
|
325
|
+
}).catch(console.warn);
|
|
326
|
+
getGroupList().then(function (_ref8) {
|
|
327
|
+
var data = _ref8.data;
|
|
328
|
+
setGroupList((data || []).map(function (_ref9) {
|
|
329
|
+
var groupUniqueKey = _ref9.groupUniqueKey,
|
|
330
|
+
groupName = _ref9.groupName,
|
|
331
|
+
relationUserList = _ref9.relationUserList;
|
|
332
|
+
return {
|
|
333
|
+
label: groupName,
|
|
334
|
+
value: groupUniqueKey,
|
|
335
|
+
relationUserList: relationUserList
|
|
336
|
+
};
|
|
337
|
+
}));
|
|
338
|
+
}).catch(console.warn);
|
|
339
|
+
|
|
340
|
+
// return () => {
|
|
341
|
+
// setShopList(void 0);
|
|
342
|
+
// setUserList(void 0);
|
|
343
|
+
// setGroupList(void 0);
|
|
344
|
+
// };
|
|
345
|
+
}, []);
|
|
346
|
+
useEffect(function () {
|
|
347
|
+
var _goodsSource$sourceSe5;
|
|
348
|
+
var _ref10 = (goodsSource === null || goodsSource === void 0 ? void 0 : (_goodsSource$sourceSe5 = goodsSource.sourceSettings) === null || _goodsSource$sourceSe5 === void 0 ? void 0 : _goodsSource$sourceSe5.workOrder) || {},
|
|
349
|
+
flowTemplateKey = _ref10.flowTemplateKey,
|
|
350
|
+
nodeId = _ref10.nodeId;
|
|
351
|
+
if ((goodsSource === null || goodsSource === void 0 ? void 0 : goodsSource.source) === "workOrder" && flowTemplateKey && nodeId && shopList && userList && groupList) {
|
|
352
|
+
setFilterItems([]);
|
|
353
|
+
setAllTableColumns([]);
|
|
354
|
+
setTemplateKey(undefined);
|
|
355
|
+
setTableColumns([]);
|
|
356
|
+
setFlowTemplateKey(flowTemplateKey);
|
|
357
|
+
setFlowNodeId(nodeId);
|
|
358
|
+
getPublishFlowDetail(flowTemplateKey).then(function (_ref11) {
|
|
359
|
+
var _data$flowConfig, _data$flowConfig$node, _currentNodeInfo$rela;
|
|
360
|
+
var data = _ref11.data;
|
|
361
|
+
var currentNodeInfo = data === null || data === void 0 ? void 0 : (_data$flowConfig = data.flowConfig) === null || _data$flowConfig === void 0 ? void 0 : (_data$flowConfig$node = _data$flowConfig.nodes) === null || _data$flowConfig$node === void 0 ? void 0 : _data$flowConfig$node.find(function (node) {
|
|
362
|
+
return node.id === nodeId;
|
|
363
|
+
});
|
|
364
|
+
var workOrderTemplateId = currentNodeInfo === null || currentNodeInfo === void 0 ? void 0 : (_currentNodeInfo$rela = currentNodeInfo.relationEvent) === null || _currentNodeInfo$rela === void 0 ? void 0 : _currentNodeInfo$rela.workOrderTemplateId;
|
|
365
|
+
// console.log("**** in 获取到流程数据", {
|
|
366
|
+
// data,
|
|
367
|
+
// currentNodeInfo,
|
|
368
|
+
// workOrderTemplateId,
|
|
369
|
+
// });
|
|
370
|
+
if (workOrderTemplateId) {
|
|
371
|
+
queryColumnsConfig({
|
|
372
|
+
flowTemplateKey: flowTemplateKey,
|
|
373
|
+
nodeId: nodeId,
|
|
374
|
+
templateId: workOrderTemplateId
|
|
375
|
+
}).then(function (_ref12) {
|
|
376
|
+
var _data$fixedColumns, _goodsSource$sourceSe13;
|
|
377
|
+
var data = _ref12.data;
|
|
378
|
+
var columnsList = data === null || data === void 0 ? void 0 : (_data$fixedColumns = data.fixedColumns) === null || _data$fixedColumns === void 0 ? void 0 : _data$fixedColumns.concat(data === null || data === void 0 ? void 0 : data.nonFixedColumns);
|
|
379
|
+
var newFilterItems = [];
|
|
380
|
+
columnsList === null || columnsList === void 0 ? void 0 : columnsList.forEach(function (l) {
|
|
381
|
+
var instance = factory(l.type, {
|
|
382
|
+
id: l.id,
|
|
383
|
+
name: l.name,
|
|
384
|
+
type: l.type,
|
|
385
|
+
componentConfig: _objectSpread(_objectSpread({}, l === null || l === void 0 ? void 0 : l.config), l === null || l === void 0 ? void 0 : l.templateConfig),
|
|
386
|
+
renderExport: function renderExport() {
|
|
387
|
+
return null;
|
|
388
|
+
},
|
|
389
|
+
effects: {
|
|
390
|
+
shopList: shopList,
|
|
391
|
+
userList: userList,
|
|
392
|
+
groupList: groupList
|
|
393
|
+
}
|
|
394
|
+
});
|
|
395
|
+
var filterConfigList = toArray(instance === null || instance === void 0 ? void 0 : instance.filterConfig(l)).filter(function (item) {
|
|
396
|
+
var _goodsSource$sourceSe6, _goodsSource$sourceSe7;
|
|
397
|
+
return ((_goodsSource$sourceSe6 = goodsSource.sourceSettings) === null || _goodsSource$sourceSe6 === void 0 ? void 0 : (_goodsSource$sourceSe7 = _goodsSource$sourceSe6.dataFilterConfig[item.formField || item.id]) === null || _goodsSource$sourceSe7 === void 0 ? void 0 : _goodsSource$sourceSe7.isFilter) && !(DEFAULT_FIELD_TYPE_LIST.includes(item.type) || item.type === TEMPLATE_ID);
|
|
398
|
+
});
|
|
399
|
+
newFilterItems = newFilterItems.concat(filterConfigList.map(function (item) {
|
|
400
|
+
var _goodsSource$sourceSe8, _goodsSource$sourceSe9;
|
|
401
|
+
item.index = (_goodsSource$sourceSe8 = goodsSource.sourceSettings) === null || _goodsSource$sourceSe8 === void 0 ? void 0 : (_goodsSource$sourceSe9 = _goodsSource$sourceSe8.dataFilterConfig[item.formField || item.id]) === null || _goodsSource$sourceSe9 === void 0 ? void 0 : _goodsSource$sourceSe9.index;
|
|
402
|
+
return item;
|
|
403
|
+
}));
|
|
404
|
+
});
|
|
405
|
+
var allTableColumns = sortArr(columnsList.reduce(tableColumnConfig, []).map(function (item) {
|
|
406
|
+
var _item$children, _goodsSource$sourceSe10, _goodsSource$sourceSe11, _goodsSource$sourceSe12;
|
|
407
|
+
var _index = (_item$children = item.children) !== null && _item$children !== void 0 && _item$children.length ? findIndex(item, (_goodsSource$sourceSe10 = goodsSource.sourceSettings) === null || _goodsSource$sourceSe10 === void 0 ? void 0 : _goodsSource$sourceSe10.dataFilterConfig) : (_goodsSource$sourceSe11 = goodsSource.sourceSettings) === null || _goodsSource$sourceSe11 === void 0 ? void 0 : (_goodsSource$sourceSe12 = _goodsSource$sourceSe11.dataFilterConfig[item.sortField]) === null || _goodsSource$sourceSe12 === void 0 ? void 0 : _goodsSource$sourceSe12.index;
|
|
408
|
+
item.index = _index;
|
|
409
|
+
return item;
|
|
410
|
+
}));
|
|
411
|
+
var newTableColumns = filterTableColumn(allTableColumns, (_goodsSource$sourceSe13 = goodsSource.sourceSettings) === null || _goodsSource$sourceSe13 === void 0 ? void 0 : _goodsSource$sourceSe13.dataFilterConfig);
|
|
412
|
+
setTableColumns(newTableColumns);
|
|
413
|
+
setFilterItems(sortArr(newFilterItems));
|
|
414
|
+
setAllTableColumns(allTableColumns);
|
|
415
|
+
setTemplateKey(workOrderTemplateId);
|
|
416
|
+
// console.log("**** in 获取到表头信息", {
|
|
417
|
+
// newTableColumns,
|
|
418
|
+
// data,
|
|
419
|
+
// newFilterItems,
|
|
420
|
+
// allTableColumns,
|
|
421
|
+
// });
|
|
422
|
+
}).catch(function (error) {
|
|
423
|
+
console.log("**** 获取表头信息 error", error);
|
|
424
|
+
});
|
|
425
|
+
}
|
|
426
|
+
}).catch(function (error) {
|
|
427
|
+
console.log("**** in 获取流程数据 error", error);
|
|
428
|
+
});
|
|
429
|
+
}
|
|
430
|
+
}, [shopList, userList, groupList]);
|
|
431
|
+
return {
|
|
432
|
+
flowTemplateKey: flowTemplateKey,
|
|
433
|
+
flowNodeId: flowNodeId,
|
|
434
|
+
templateKey: templateKey,
|
|
435
|
+
filterItems: filterItems,
|
|
436
|
+
tableColumns: tableColumns,
|
|
437
|
+
ShopList: ShopList,
|
|
438
|
+
workOrderDataToGoods: workOrderDataToGoods,
|
|
439
|
+
queryComponentsConfig: queryComponentsConfig
|
|
440
|
+
};
|
|
441
|
+
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
declare type HasErpDataKeyType = "hasWln" | "hasWdt" | "hasBs" | "hasE3" | "hasJst" | "hasGy";
|
|
1
|
+
declare type HasErpDataKeyType = "hasWln" | "hasWdt" | "hasBs" | "hasE3" | "hasJst" | "hasGy" | "hasJy" | "hasJky";
|
|
2
2
|
declare function useGetHasErpData(reduxData: any): Record<HasErpDataKeyType, boolean>;
|
|
3
3
|
export default useGetHasErpData;
|
|
@@ -6,14 +6,16 @@ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefine
|
|
|
6
6
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
7
|
import { useEffect, useMemo, useState } from "react";
|
|
8
8
|
var getTemplate = function getTemplate(companyUserConfig) {
|
|
9
|
-
var _companyUserConfig$pl, _companyUserConfig$pl2, _companyUserConfig$pl3, _companyUserConfig$pl4, _companyUserConfig$pl5, _companyUserConfig$pl6, _companyUserConfig$pl7, _companyUserConfig$pl8, _companyUserConfig$pl9, _companyUserConfig$pl10, _companyUserConfig$pl11, _companyUserConfig$pl12, _companyUserConfig$pl13, _companyUserConfig$pl14, _companyUserConfig$pl15, _companyUserConfig$pl16, _companyUserConfig$pl17, _companyUserConfig$pl18;
|
|
9
|
+
var _companyUserConfig$pl, _companyUserConfig$pl2, _companyUserConfig$pl3, _companyUserConfig$pl4, _companyUserConfig$pl5, _companyUserConfig$pl6, _companyUserConfig$pl7, _companyUserConfig$pl8, _companyUserConfig$pl9, _companyUserConfig$pl10, _companyUserConfig$pl11, _companyUserConfig$pl12, _companyUserConfig$pl13, _companyUserConfig$pl14, _companyUserConfig$pl15, _companyUserConfig$pl16, _companyUserConfig$pl17, _companyUserConfig$pl18, _companyUserConfig$pl19, _companyUserConfig$pl20, _companyUserConfig$pl21, _companyUserConfig$pl22, _companyUserConfig$pl23, _companyUserConfig$pl24;
|
|
10
10
|
return JSON.stringify({
|
|
11
11
|
hasWln: (_companyUserConfig$pl = companyUserConfig === null || companyUserConfig === void 0 ? void 0 : (_companyUserConfig$pl2 = companyUserConfig.plugins) === null || _companyUserConfig$pl2 === void 0 ? void 0 : (_companyUserConfig$pl3 = _companyUserConfig$pl2.wln) === null || _companyUserConfig$pl3 === void 0 ? void 0 : _companyUserConfig$pl3.show) !== null && _companyUserConfig$pl !== void 0 ? _companyUserConfig$pl : false,
|
|
12
12
|
hasWdt: (_companyUserConfig$pl4 = companyUserConfig === null || companyUserConfig === void 0 ? void 0 : (_companyUserConfig$pl5 = companyUserConfig.plugins) === null || _companyUserConfig$pl5 === void 0 ? void 0 : (_companyUserConfig$pl6 = _companyUserConfig$pl5.wdt) === null || _companyUserConfig$pl6 === void 0 ? void 0 : _companyUserConfig$pl6.show) !== null && _companyUserConfig$pl4 !== void 0 ? _companyUserConfig$pl4 : false,
|
|
13
13
|
hasBs: (_companyUserConfig$pl7 = companyUserConfig === null || companyUserConfig === void 0 ? void 0 : (_companyUserConfig$pl8 = companyUserConfig.plugins) === null || _companyUserConfig$pl8 === void 0 ? void 0 : (_companyUserConfig$pl9 = _companyUserConfig$pl8.bs) === null || _companyUserConfig$pl9 === void 0 ? void 0 : _companyUserConfig$pl9.show) !== null && _companyUserConfig$pl7 !== void 0 ? _companyUserConfig$pl7 : false,
|
|
14
14
|
hasE3: (_companyUserConfig$pl10 = companyUserConfig === null || companyUserConfig === void 0 ? void 0 : (_companyUserConfig$pl11 = companyUserConfig.plugins) === null || _companyUserConfig$pl11 === void 0 ? void 0 : (_companyUserConfig$pl12 = _companyUserConfig$pl11.bse3) === null || _companyUserConfig$pl12 === void 0 ? void 0 : _companyUserConfig$pl12.show) !== null && _companyUserConfig$pl10 !== void 0 ? _companyUserConfig$pl10 : false,
|
|
15
15
|
hasJst: (_companyUserConfig$pl13 = companyUserConfig === null || companyUserConfig === void 0 ? void 0 : (_companyUserConfig$pl14 = companyUserConfig.plugins) === null || _companyUserConfig$pl14 === void 0 ? void 0 : (_companyUserConfig$pl15 = _companyUserConfig$pl14.jst) === null || _companyUserConfig$pl15 === void 0 ? void 0 : _companyUserConfig$pl15.show) !== null && _companyUserConfig$pl13 !== void 0 ? _companyUserConfig$pl13 : false,
|
|
16
|
-
hasGy: (_companyUserConfig$pl16 = companyUserConfig === null || companyUserConfig === void 0 ? void 0 : (_companyUserConfig$pl17 = companyUserConfig.plugins) === null || _companyUserConfig$pl17 === void 0 ? void 0 : (_companyUserConfig$pl18 = _companyUserConfig$pl17.gy) === null || _companyUserConfig$pl18 === void 0 ? void 0 : _companyUserConfig$pl18.show) !== null && _companyUserConfig$pl16 !== void 0 ? _companyUserConfig$pl16 : false
|
|
16
|
+
hasGy: (_companyUserConfig$pl16 = companyUserConfig === null || companyUserConfig === void 0 ? void 0 : (_companyUserConfig$pl17 = companyUserConfig.plugins) === null || _companyUserConfig$pl17 === void 0 ? void 0 : (_companyUserConfig$pl18 = _companyUserConfig$pl17.gy) === null || _companyUserConfig$pl18 === void 0 ? void 0 : _companyUserConfig$pl18.show) !== null && _companyUserConfig$pl16 !== void 0 ? _companyUserConfig$pl16 : false,
|
|
17
|
+
hasJy: (_companyUserConfig$pl19 = companyUserConfig === null || companyUserConfig === void 0 ? void 0 : (_companyUserConfig$pl20 = companyUserConfig.plugins) === null || _companyUserConfig$pl20 === void 0 ? void 0 : (_companyUserConfig$pl21 = _companyUserConfig$pl20.juYi) === null || _companyUserConfig$pl21 === void 0 ? void 0 : _companyUserConfig$pl21.show) !== null && _companyUserConfig$pl19 !== void 0 ? _companyUserConfig$pl19 : false,
|
|
18
|
+
hasJky: (_companyUserConfig$pl22 = companyUserConfig === null || companyUserConfig === void 0 ? void 0 : (_companyUserConfig$pl23 = companyUserConfig.plugins) === null || _companyUserConfig$pl23 === void 0 ? void 0 : (_companyUserConfig$pl24 = _companyUserConfig$pl23.jky) === null || _companyUserConfig$pl24 === void 0 ? void 0 : _companyUserConfig$pl24.show) !== null && _companyUserConfig$pl22 !== void 0 ? _companyUserConfig$pl22 : false
|
|
17
19
|
});
|
|
18
20
|
};
|
|
19
21
|
function useGetHasErpData(reduxData) {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
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); }
|
|
2
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
|
3
|
+
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); } }
|
|
4
|
+
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); }); }; }
|
|
2
5
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3
6
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
4
7
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
8
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
6
9
|
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
7
|
-
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
|
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
|
-
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
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
11
11
|
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."); }
|
|
12
12
|
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); }
|
|
@@ -15,6 +15,7 @@ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefine
|
|
|
15
15
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
16
16
|
import React, { useEffect, useState, useMemo } from "react";
|
|
17
17
|
import { Skeleton, Button, Alert, Space, message } from "antd";
|
|
18
|
+
import { cloneDeep } from "lodash";
|
|
18
19
|
import { queryExpressInterceptData, queryLogisticsAddressData, queryPlatData, queryLabel, queryAllLogisticsCompany, queryKMLogisticsCompany } from "../../service/api";
|
|
19
20
|
import { servers, SendDataCenter } from "@kmkf-fe-packages/kmkf-utils";
|
|
20
21
|
import useGetErpLogisticsCompany from "./orderQuery/useGetErpLogisticsCompany";
|
|
@@ -48,6 +49,12 @@ var Global = function Global(_ref) {
|
|
|
48
49
|
try {
|
|
49
50
|
var _reduxData$main, _reduxData$workOrder, _reduxData$global;
|
|
50
51
|
var userInfo = (reduxData === null || reduxData === void 0 ? void 0 : (_reduxData$main = reduxData.main) === null || _reduxData$main === void 0 ? void 0 : _reduxData$main.userInfo) || (reduxData === null || reduxData === void 0 ? void 0 : (_reduxData$workOrder = reduxData.workOrder) === null || _reduxData$workOrder === void 0 ? void 0 : _reduxData$workOrder.userInfo) || (reduxData === null || reduxData === void 0 ? void 0 : (_reduxData$global = reduxData.global) === null || _reduxData$global === void 0 ? void 0 : _reduxData$global.userInfo) || {};
|
|
52
|
+
var companyUserConfig = cloneDeep(userInfo.companyUserConfig);
|
|
53
|
+
if (companyUserConfig && typeof companyUserConfig === "string") {
|
|
54
|
+
userInfo = _objectSpread(_objectSpread({}, userInfo), {}, {
|
|
55
|
+
companyUserConfig: JSON.parse(companyUserConfig)
|
|
56
|
+
});
|
|
57
|
+
}
|
|
51
58
|
localStorage.setItem("reduxData_userInfo", JSON.stringify(userInfo));
|
|
52
59
|
} catch (e) {
|
|
53
60
|
console.error(e);
|
|
@@ -22,36 +22,39 @@ function useGetErpAddressData(reduxData, notJudgedErp) {
|
|
|
22
22
|
}, [hasErpData, notJudgedErp]);
|
|
23
23
|
var asyncQueryData = /*#__PURE__*/function () {
|
|
24
24
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(hasErpData, notJudgedErp, isReload) {
|
|
25
|
-
var hasBs, hasWdt, hasGy, promises;
|
|
25
|
+
var hasBs, hasWdt, hasGy, hasJst, hasJky, promises;
|
|
26
26
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
27
27
|
while (1) switch (_context.prev = _context.next) {
|
|
28
28
|
case 0:
|
|
29
29
|
if (!isReload) {
|
|
30
30
|
setGlobalState("loading");
|
|
31
31
|
}
|
|
32
|
-
hasBs = hasErpData.hasBs, hasWdt = hasErpData.hasWdt, hasGy = hasErpData.hasGy;
|
|
32
|
+
hasBs = hasErpData.hasBs, hasWdt = hasErpData.hasWdt, hasGy = hasErpData.hasGy, hasJst = hasErpData.hasJst, hasJky = hasErpData.hasJky;
|
|
33
33
|
promises = [];
|
|
34
34
|
if (hasBs || notJudgedErp) promises.push(servers.queryBsAddressData);
|
|
35
35
|
if (hasWdt || notJudgedErp) promises.push(servers.queryWdtAddressData);
|
|
36
|
+
// JKY用的系统的地址,暂时不需要查询
|
|
37
|
+
// if (hasJky || notJudgedErp) promises.push(servers.queryJkyAddressData);
|
|
36
38
|
if (hasGy || notJudgedErp) promises.push(servers.queryGyAddressData);
|
|
37
|
-
|
|
38
|
-
_context.
|
|
39
|
+
if (hasJst || notJudgedErp) promises.push(servers.queryJstAddressData);
|
|
40
|
+
_context.prev = 7;
|
|
41
|
+
_context.next = 10;
|
|
39
42
|
return Promise.all(promises.map(function (promise) {
|
|
40
43
|
return promise();
|
|
41
44
|
}));
|
|
42
|
-
case
|
|
45
|
+
case 10:
|
|
43
46
|
setGlobalState("success");
|
|
44
|
-
_context.next =
|
|
47
|
+
_context.next = 16;
|
|
45
48
|
break;
|
|
46
|
-
case
|
|
47
|
-
_context.prev =
|
|
48
|
-
_context.t0 = _context["catch"](
|
|
49
|
+
case 13:
|
|
50
|
+
_context.prev = 13;
|
|
51
|
+
_context.t0 = _context["catch"](7);
|
|
49
52
|
setGlobalState("failed");
|
|
50
|
-
case
|
|
53
|
+
case 16:
|
|
51
54
|
case "end":
|
|
52
55
|
return _context.stop();
|
|
53
56
|
}
|
|
54
|
-
}, _callee, null, [[
|
|
57
|
+
}, _callee, null, [[7, 13]]);
|
|
55
58
|
}));
|
|
56
59
|
return function asyncQueryData(_x2, _x3, _x4) {
|
|
57
60
|
return _ref.apply(this, arguments);
|