@kmkf-fe-packages/kmkf-utils 1.0.10-rc.4 → 1.1.0

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
@@ -1 +1 @@
1
- 11122311
1
+ 11122311
@@ -150,35 +150,6 @@ var updateWdtItemListByConfigHandle = function updateWdtItemListByConfigHandle(l
150
150
  return prv;
151
151
  }, []);
152
152
  };
153
-
154
- // WDT根据订单号请求返回的srcTid会有多个订单号组合在一起的数据 排除其他的,返回当前订单号
155
- var handleOrderNo = function handleOrderNo(detail, form) {
156
- var _detail$componentList, _detail$componentList2;
157
- var tradeIdComp = detail === null || detail === void 0 ? void 0 : (_detail$componentList = detail.componentList) === null || _detail$componentList === void 0 ? void 0 : (_detail$componentList2 = _detail$componentList.find) === null || _detail$componentList2 === void 0 ? void 0 : _detail$componentList2.call(_detail$componentList, function (item) {
158
- return item.workOrderComponentType === 'TRADE_ID_INPUT';
159
- });
160
- var tradeIdValue = form.getFieldValue(tradeIdComp.uniqueKey) || form.getFieldValue("".concat(tradeIdComp.uniqueKey, "_tradeId"));
161
- var currentTrades = ((detail === null || detail === void 0 ? void 0 : detail.trades) || []).filter(function (item) {
162
- return (item.srcTid || '').split(',').includes(tradeIdValue);
163
- }).map(function (item) {
164
- if (Array.isArray(item.goodDetails)) {
165
- item.goodDetails = item.goodDetails.filter(function (good) {
166
- return good.srcTid === tradeIdValue;
167
- });
168
- }
169
- return item;
170
- });
171
- if (currentTrades.length) {
172
- return {
173
- currentTrades: currentTrades,
174
- orderNo: tradeIdValue
175
- };
176
- }
177
- return {
178
- currentTrades: [],
179
- orderNo: ''
180
- };
181
- };
182
153
  export var wdtOrderBackFormValues = function wdtOrderBackFormValues() {
183
154
  var detail = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
184
155
  var templateDetail = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
@@ -241,26 +212,25 @@ export var wdtOrderBackFormValues = function wdtOrderBackFormValues() {
241
212
  };
242
213
  //wdt订单信息转换
243
214
  export var wdtOrderTransform = function wdtOrderTransform(detail, form) {
244
- var _detail$trades, _currentTrades$find, _currentTrades$find$c;
215
+ var _detail$trades, _detail$trades$find, _detail$trades2, _ref, _detail$trades3, _detail$trades3$find, _detail$trades3$find$;
245
216
  // const advItem: any =
246
217
  // detail?.orders?.[0]?.advancedDistributionInfos?.[0] || {};
247
- var _handleOrderNo = handleOrderNo(detail, form),
248
- currentTrades = _handleOrderNo.currentTrades,
249
- orderNo = _handleOrderNo.orderNo;
250
218
  return {
251
219
  wdtSystemOrder: {
252
- orderNo: orderNo,
253
- orders: currentTrades.map(function (item) {
220
+ orderNo: (detail === null || detail === void 0 ? void 0 : (_detail$trades = detail.trades) === null || _detail$trades === void 0 ? void 0 : (_detail$trades$find = _detail$trades.find(function (item) {
221
+ return item.srcTid;
222
+ })) === null || _detail$trades$find === void 0 ? void 0 : _detail$trades$find.srcTid) || '',
223
+ orders: ((detail === null || detail === void 0 ? void 0 : detail.trades) || []).map(function (item) {
254
224
  return _objectSpread(_objectSpread({}, item), {}, {
255
225
  billNo: item.tradeNo,
256
226
  billType: WDT_ORDER_TYPE_MAP[item.tradeType],
257
227
  billTag: item.tagName
258
228
  });
259
229
  }),
260
- selectIds: (detail === null || detail === void 0 ? void 0 : (_detail$trades = detail.trades) === null || _detail$trades === void 0 ? void 0 : _detail$trades.length) === 1 ? currentTrades.map(function (item) {
230
+ selectIds: (detail === null || detail === void 0 ? void 0 : (_detail$trades2 = detail.trades) === null || _detail$trades2 === void 0 ? void 0 : _detail$trades2.length) === 1 ? detail === null || detail === void 0 ? void 0 : detail.trades.map(function (item) {
261
231
  return item.tradeNo;
262
232
  }) : [],
263
- showOrderInfo: currentTrades === null || currentTrades === void 0 ? void 0 : currentTrades.map(function (item) {
233
+ showOrderInfo: (_ref = (detail === null || detail === void 0 ? void 0 : detail.trades) || []) === null || _ref === void 0 ? void 0 : _ref.map(function (item) {
264
234
  return {
265
235
  billNo: item.tradeNo,
266
236
  billType: WDT_ORDER_TYPE_MAP[item.tradeType],
@@ -269,13 +239,13 @@ export var wdtOrderTransform = function wdtOrderTransform(detail, form) {
269
239
  })
270
240
  },
271
241
  wdtGoods: {
272
- shopCode: (currentTrades === null || currentTrades === void 0 ? void 0 : (_currentTrades$find = currentTrades.find) === null || _currentTrades$find === void 0 ? void 0 : (_currentTrades$find$c = _currentTrades$find.call(currentTrades, function (item) {
242
+ shopCode: (detail === null || detail === void 0 ? void 0 : (_detail$trades3 = detail.trades) === null || _detail$trades3 === void 0 ? void 0 : (_detail$trades3$find = _detail$trades3.find) === null || _detail$trades3$find === void 0 ? void 0 : (_detail$trades3$find$ = _detail$trades3$find.call(_detail$trades3, function (item) {
273
243
  return item.shopNo;
274
- })) === null || _currentTrades$find$c === void 0 ? void 0 : _currentTrades$find$c.shopNo) || null,
275
- wdtGoods: updateWdtGoodsHandle(currentTrades)
244
+ })) === null || _detail$trades3$find$ === void 0 ? void 0 : _detail$trades3$find$.shopNo) || null,
245
+ wdtGoods: updateWdtGoodsHandle(detail === null || detail === void 0 ? void 0 : detail.trades)
276
246
  },
277
- wdtLogistics: updateWdtItemListHandle(currentTrades, "logistics", (detail === null || detail === void 0 ? void 0 : detail.componentList) || [], form),
278
- wdtSendGood: updateWdtItemListHandle(currentTrades, "send", (detail === null || detail === void 0 ? void 0 : detail.componentList) || [], form)
247
+ wdtLogistics: updateWdtItemListHandle(detail === null || detail === void 0 ? void 0 : detail.trades, "logistics", (detail === null || detail === void 0 ? void 0 : detail.componentList) || [], form),
248
+ wdtSendGood: updateWdtItemListHandle(detail === null || detail === void 0 ? void 0 : detail.trades, "send", (detail === null || detail === void 0 ? void 0 : detail.componentList) || [], form)
279
249
  // wdtSingingTime: detail?.receiptDate,
280
250
  // wdtSendTime:
281
251
  // detail?.orders?.[0]?.advancedDistributionInfos?.[0]?.deliveryDate,
package/package.json CHANGED
@@ -1,13 +1,12 @@
1
1
  {
2
2
  "name": "@kmkf-fe-packages/kmkf-utils",
3
- "version": "1.0.10-rc.4",
3
+ "version": "1.1.0",
4
4
  "module": "dist/esm/index.js",
5
5
  "typings": "dist/esm/index.d.ts",
6
6
  "files": [
7
7
  "dist"
8
8
  ],
9
9
  "scripts": {
10
- "sync": "yarn build && yalc push",
11
10
  "build": "yarn run lint && father build",
12
11
  "jest:init": "jest --init",
13
12
  "lint": "eslint . --ext .ts",
@@ -41,7 +40,7 @@
41
40
  "publishConfig": {
42
41
  "access": "public"
43
42
  },
44
- "gitHead": "34ea8d6f141ef4a7d4688c2cf7b8ba5203568200",
43
+ "gitHead": "7234f433e97adce6c27bbd7c087cb043a1627739",
45
44
  "gitHooks": {
46
45
  "pre-commit": "lint-staged"
47
46
  }