@kmkf-fe-packages/kmkf-work-order-service-component 1.20.1 → 1.20.2-beta.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.
@@ -4,10 +4,12 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
4
4
  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
5
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
6
6
  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
+ import { Monitor } from 'kmkf-monitor';
7
8
  import { cloneDeep, isEqual, set, get } from 'lodash';
8
9
  import { isNull, unTransField } from '@kmkf-fe-packages/kmkf-utils';
9
10
  import { submitDataTransOldFormat } from "../common/utils/tools";
10
11
  import { NodeType, PlatForm } from "../model/flowTemplateDetail/types";
12
+ import newSubmitDataTransOldFormat from "../common/utils/submitDataTransOldFormat";
11
13
  export var getTag = function getTag(item) {
12
14
  var tag = 'artificial'; // 人工节点
13
15
  // 先判断是什么节点类型 步骤/判断
@@ -87,7 +89,7 @@ export var submitParams = function submitParams(_ref) {
87
89
  }, operateParams)
88
90
  };
89
91
  if (update) {
90
- var _currentNodeDetail$wo, _currentNodeDetail$wo2, _currentNodeDetail$wo3, _currentNodeDetail$wo4, _currentNodeDetail$wo5, _currentNodeDetail$wo6;
92
+ var _currentNodeDetail$wo, _currentNodeDetail$wo2, _currentNodeDetail$wo3, _currentNodeDetail$wo4, _currentNodeDetail$wo5, _currentNodeDetail$wo6, _currentNodeDetail$wo7;
91
93
  params.updateInfo = {
92
94
  templateId: currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$wo = currentNodeDetail.workOrder) === null || _currentNodeDetail$wo === void 0 ? void 0 : _currentNodeDetail$wo.templateId,
93
95
  workOrderId: currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$wo2 = currentNodeDetail.workOrder) === null || _currentNodeDetail$wo2 === void 0 ? void 0 : _currentNodeDetail$wo2.id,
@@ -98,7 +100,16 @@ export var submitParams = function submitParams(_ref) {
98
100
  workOrderId: currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$wo4 = currentNodeDetail.workOrder) === null || _currentNodeDetail$wo4 === void 0 ? void 0 : _currentNodeDetail$wo4.id,
99
101
  workOrderUpdateKeySupVos: []
100
102
  };
103
+ // **************START****************
104
+ var cloneParams = cloneDeep(params);
101
105
  var submitData = submitDataTransOldFormat(formData, newTemplateDetail, !!(currentNodeDetail !== null && currentNodeDetail !== void 0 && (_currentNodeDetail$wo5 = currentNodeDetail.workOrder) !== null && _currentNodeDetail$wo5 !== void 0 && _currentNodeDetail$wo5.id), currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : currentNodeDetail.workOrder, params, plat.accountName);
106
+ var newSubmitData = newSubmitDataTransOldFormat(formData, newTemplateDetail, !!(currentNodeDetail !== null && currentNodeDetail !== void 0 && (_currentNodeDetail$wo6 = currentNodeDetail.workOrder) !== null && _currentNodeDetail$wo6 !== void 0 && _currentNodeDetail$wo6.id), currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : currentNodeDetail.workOrder, cloneParams, plat.accountName);
107
+ var checkParams = isEqual(params, cloneParams);
108
+ var checkSubmitData = isEqual(submitData, newSubmitData);
109
+ Monitor.automaticReport({
110
+ message: "\n \u5DE5\u5355\u66F4\u65B0-\u63D0\u4EA4\u53C2\u6570\u5BF9\u6BD4:".concat(checkParams, ";\u5DE5\u5355\u66F4\u65B0-\u63D0\u4EA4\u7ED3\u679C\u5BF9\u6BD4:").concat(checkSubmitData, "; \n \u63D0\u4EA4\u53C2\u6570: {").concat(!checkParams ? JSON.stringify(params) : '', "} {").concat(!checkParams ? JSON.stringify(cloneParams) : '', "}; \n \u63D0\u4EA4\u7ED3\u679C: {").concat(!checkSubmitData ? JSON.stringify(submitData) : '', "} {").concat(!checkSubmitData ? JSON.stringify(checkSubmitData) : '', "}")
111
+ });
112
+ // **************END****************
102
113
  var updateList = submitData === null || submitData === void 0 ? void 0 : submitData.reduce(function (cur, nxt) {
103
114
  var _nxt$contentList;
104
115
  nxt === null || nxt === void 0 ? void 0 : (_nxt$contentList = nxt.contentList) === null || _nxt$contentList === void 0 ? void 0 : _nxt$contentList.map(function (item) {
@@ -124,7 +135,7 @@ export var submitParams = function submitParams(_ref) {
124
135
  return cur;
125
136
  }, []);
126
137
  // 数据第一次更新
127
- if (update && currentNodeDetail !== null && currentNodeDetail !== void 0 && (_currentNodeDetail$wo6 = currentNodeDetail.workOrder) !== null && _currentNodeDetail$wo6 !== void 0 && _currentNodeDetail$wo6.preCreateAndNotModified) {
138
+ if (update && currentNodeDetail !== null && currentNodeDetail !== void 0 && (_currentNodeDetail$wo7 = currentNodeDetail.workOrder) !== null && _currentNodeDetail$wo7 !== void 0 && _currentNodeDetail$wo7.preCreateAndNotModified) {
128
139
  updateList.push({
129
140
  dataKey: 'preCreateAndNotModified',
130
141
  oldValue: true,
@@ -136,20 +147,20 @@ export var submitParams = function submitParams(_ref) {
136
147
  delete params.workOrderUpdateKeyVos;
137
148
  delete params.needTransForm;
138
149
  } else {
139
- var _Object$keys, _currentNodeDetail$wo7, _currentNodeDetail$wo8, _currentNodeDetail$wo9, _currentNodeDetail$wo10, _currentNodeDetail$wo11, _currentNodeDetail$wo12, _currentNodeDetail$wo13, _currentNodeDetail$wo14, _currentNodeDetail$wo15, _currentNodeDetail$wo16, _currentNodeDetail$wo17, _currentNodeDetail$wo18, _currentNodeDetail$wo19, _currentNodeDetail$wo20;
150
+ var _Object$keys, _currentNodeDetail$wo8, _currentNodeDetail$wo9, _currentNodeDetail$wo10, _currentNodeDetail$wo11, _currentNodeDetail$wo12, _currentNodeDetail$wo13, _currentNodeDetail$wo14, _currentNodeDetail$wo15, _currentNodeDetail$wo16, _currentNodeDetail$wo17, _currentNodeDetail$wo18, _currentNodeDetail$wo19, _currentNodeDetail$wo20, _currentNodeDetail$wo21, _currentNodeDetail$wo22;
140
151
  // TODO: 新保存工单
141
152
  // 获取当前表单中非空字段
142
153
  var finalComponentList = (_Object$keys = Object.keys(formData)) === null || _Object$keys === void 0 ? void 0 : _Object$keys.filter(function (i) {
143
154
  return !isNull(formData[i]);
144
155
  });
145
156
  // 获取非空字段对应的组件
146
- var finalDtoList = currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$wo7 = currentNodeDetail.workOrderTemplateInfo) === null || _currentNodeDetail$wo7 === void 0 ? void 0 : (_currentNodeDetail$wo8 = _currentNodeDetail$wo7.componentDtoList) === null || _currentNodeDetail$wo8 === void 0 ? void 0 : _currentNodeDetail$wo8.filter(function (item) {
157
+ var finalDtoList = currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$wo8 = currentNodeDetail.workOrderTemplateInfo) === null || _currentNodeDetail$wo8 === void 0 ? void 0 : (_currentNodeDetail$wo9 = _currentNodeDetail$wo8.componentDtoList) === null || _currentNodeDetail$wo9 === void 0 ? void 0 : _currentNodeDetail$wo9.filter(function (item) {
147
158
  return finalComponentList.includes(item.uniqueKey) || item.workOrderComponentType === 'BUYER_MESSAGE_NOTICE';
148
159
  });
149
160
  set(newTemplateDetail, 'componentDtoList', finalDtoList);
150
161
  params.workOrder = {
151
- templateId: currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$wo9 = currentNodeDetail.workOrderTemplateInfo) === null || _currentNodeDetail$wo9 === void 0 ? void 0 : _currentNodeDetail$wo9.uniqueKey,
152
- handleWorkOrderId: currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$wo10 = currentNodeDetail.workOrder) === null || _currentNodeDetail$wo10 === void 0 ? void 0 : _currentNodeDetail$wo10.id,
162
+ templateId: currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$wo10 = currentNodeDetail.workOrderTemplateInfo) === null || _currentNodeDetail$wo10 === void 0 ? void 0 : _currentNodeDetail$wo10.uniqueKey,
163
+ handleWorkOrderId: currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$wo11 = currentNodeDetail.workOrder) === null || _currentNodeDetail$wo11 === void 0 ? void 0 : _currentNodeDetail$wo11.id,
153
164
  buyerNick: plat === null || plat === void 0 ? void 0 : plat.buyerNick,
154
165
  buyerOpenUid: plat === null || plat === void 0 ? void 0 : plat.buyerId,
155
166
  shopUniqueKey: shopUniqueKey,
@@ -159,18 +170,18 @@ export var submitParams = function submitParams(_ref) {
159
170
  };
160
171
 
161
172
  // 判断是否有订单号组建,订单号数据需要特殊处理
162
- var tradeIdUniqueKey = currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$wo11 = currentNodeDetail.workOrderTemplateInfo) === null || _currentNodeDetail$wo11 === void 0 ? void 0 : (_currentNodeDetail$wo12 = _currentNodeDetail$wo11.componentDtoList) === null || _currentNodeDetail$wo12 === void 0 ? void 0 : (_currentNodeDetail$wo13 = _currentNodeDetail$wo12.find(function (item) {
173
+ var tradeIdUniqueKey = currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$wo12 = currentNodeDetail.workOrderTemplateInfo) === null || _currentNodeDetail$wo12 === void 0 ? void 0 : (_currentNodeDetail$wo13 = _currentNodeDetail$wo12.componentDtoList) === null || _currentNodeDetail$wo13 === void 0 ? void 0 : (_currentNodeDetail$wo14 = _currentNodeDetail$wo13.find(function (item) {
163
174
  return item.workOrderComponentType === 'TRADE_ID_INPUT';
164
- })) === null || _currentNodeDetail$wo13 === void 0 ? void 0 : _currentNodeDetail$wo13.uniqueKey;
175
+ })) === null || _currentNodeDetail$wo14 === void 0 ? void 0 : _currentNodeDetail$wo14.uniqueKey;
165
176
  // 判断是否有订单号组建,订单号数据需要特殊处理
166
- var paymentTradeIdUniqueKey = currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$wo14 = currentNodeDetail.workOrderTemplateInfo) === null || _currentNodeDetail$wo14 === void 0 ? void 0 : (_currentNodeDetail$wo15 = _currentNodeDetail$wo14.componentDtoList) === null || _currentNodeDetail$wo15 === void 0 ? void 0 : (_currentNodeDetail$wo16 = _currentNodeDetail$wo15.find(function (item) {
177
+ var paymentTradeIdUniqueKey = currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$wo15 = currentNodeDetail.workOrderTemplateInfo) === null || _currentNodeDetail$wo15 === void 0 ? void 0 : (_currentNodeDetail$wo16 = _currentNodeDetail$wo15.componentDtoList) === null || _currentNodeDetail$wo16 === void 0 ? void 0 : (_currentNodeDetail$wo17 = _currentNodeDetail$wo16.find(function (item) {
167
178
  return item.workOrderComponentType === 'ENTERPRISE_PAYMENT';
168
- })) === null || _currentNodeDetail$wo16 === void 0 ? void 0 : _currentNodeDetail$wo16.uniqueKey;
179
+ })) === null || _currentNodeDetail$wo17 === void 0 ? void 0 : _currentNodeDetail$wo17.uniqueKey;
169
180
 
170
181
  // 判断是否有买家昵称或者
171
- var buyerNickUniqueKey = currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$wo17 = currentNodeDetail.workOrderTemplateInfo) === null || _currentNodeDetail$wo17 === void 0 ? void 0 : (_currentNodeDetail$wo18 = _currentNodeDetail$wo17.componentDtoList) === null || _currentNodeDetail$wo18 === void 0 ? void 0 : (_currentNodeDetail$wo19 = _currentNodeDetail$wo18.find(function (item) {
182
+ var buyerNickUniqueKey = currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : (_currentNodeDetail$wo18 = currentNodeDetail.workOrderTemplateInfo) === null || _currentNodeDetail$wo18 === void 0 ? void 0 : (_currentNodeDetail$wo19 = _currentNodeDetail$wo18.componentDtoList) === null || _currentNodeDetail$wo19 === void 0 ? void 0 : (_currentNodeDetail$wo20 = _currentNodeDetail$wo19.find(function (item) {
172
183
  return item.workOrderComponentType === 'BUYER_NICK_INPUT';
173
- })) === null || _currentNodeDetail$wo19 === void 0 ? void 0 : _currentNodeDetail$wo19.uniqueKey;
184
+ })) === null || _currentNodeDetail$wo20 === void 0 ? void 0 : _currentNodeDetail$wo20.uniqueKey;
174
185
  if (paymentTradeIdUniqueKey) {
175
186
  var _formData, _formData2;
176
187
  params.workOrder.tid = formData === null || formData === void 0 ? void 0 : (_formData = formData["".concat(paymentTradeIdUniqueKey)]) === null || _formData === void 0 ? void 0 : _formData.enterprisePaymentTid;
@@ -183,7 +194,15 @@ export var submitParams = function submitParams(_ref) {
183
194
  var _formData$buyerNickUn;
184
195
  params.workOrder.buyerOpenUid = formData === null || formData === void 0 ? void 0 : (_formData$buyerNickUn = formData[buyerNickUniqueKey]) === null || _formData$buyerNickUn === void 0 ? void 0 : _formData$buyerNickUn.buyerOpenUid;
185
196
  }
186
- params.workOrder.workOrderComponents = submitDataTransOldFormat(formData, newTemplateDetail, !!(currentNodeDetail !== null && currentNodeDetail !== void 0 && (_currentNodeDetail$wo20 = currentNodeDetail.workOrder) !== null && _currentNodeDetail$wo20 !== void 0 && _currentNodeDetail$wo20.id), currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : currentNodeDetail.workOrder, params.workOrder, (plat === null || plat === void 0 ? void 0 : plat.accountName) || '');
197
+ // **************START****************
198
+ var _cloneParams = cloneDeep(params);
199
+ params.workOrder.workOrderComponents = submitDataTransOldFormat(formData, newTemplateDetail, !!(currentNodeDetail !== null && currentNodeDetail !== void 0 && (_currentNodeDetail$wo21 = currentNodeDetail.workOrder) !== null && _currentNodeDetail$wo21 !== void 0 && _currentNodeDetail$wo21.id), currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : currentNodeDetail.workOrder, params.workOrder, (plat === null || plat === void 0 ? void 0 : plat.accountName) || '');
200
+ _cloneParams.workOrder.workOrderComponents = newSubmitDataTransOldFormat(formData, newTemplateDetail, !!(currentNodeDetail !== null && currentNodeDetail !== void 0 && (_currentNodeDetail$wo22 = currentNodeDetail.workOrder) !== null && _currentNodeDetail$wo22 !== void 0 && _currentNodeDetail$wo22.id), currentNodeDetail === null || currentNodeDetail === void 0 ? void 0 : currentNodeDetail.workOrder, _cloneParams.workOrder, (plat === null || plat === void 0 ? void 0 : plat.accountName) || '');
201
+ var check = isEqual(params, _cloneParams);
202
+ Monitor.automaticReport({
203
+ message: "\u5DE5\u5355\u65B0\u589E-\u63D0\u4EA4\u53C2\u6570\u5BF9\u6BD4:".concat(check, ";\u63D0\u4EA4\u7ED3\u679C:{").concat(!check ? JSON.stringify(params) : '', "}{").concat(!check ? JSON.stringify(_cloneParams) : '', "}")
204
+ });
205
+ // **************END****************
187
206
  //端上有买家id 就返填当前买家 即使不是当前买家的订单
188
207
  if (plat.platform !== PlatForm.PC && plat !== null && plat !== void 0 && plat.buyerId) {
189
208
  params.workOrder.buyerOpenUid = plat === null || plat === void 0 ? void 0 : plat.buyerId;
@@ -16,7 +16,3 @@ export declare const getCurrentNodeModifiedShowHideRule: (list: {
16
16
  }>;
17
17
  displayComponentList: Array<string>;
18
18
  }[];
19
- export declare const findComponentUniqueKeyByType: (componentDtoList: {
20
- workOrderComponentType: string;
21
- uniqueKey: string;
22
- }[], workOrderComponentType: string) => string | undefined;
@@ -63,12 +63,4 @@ export var getCurrentNodeModifiedShowHideRule = function getCurrentNodeModifiedS
63
63
  return newRules;
64
64
  }
65
65
  return [];
66
- };
67
-
68
- // 根据组件类型获取组件的UniqueKey
69
- export var findComponentUniqueKeyByType = function findComponentUniqueKeyByType(componentDtoList, workOrderComponentType) {
70
- var _componentDtoList$fin;
71
- return (_componentDtoList$fin = componentDtoList.find(function (item) {
72
- return item.workOrderComponentType === workOrderComponentType;
73
- })) === null || _componentDtoList$fin === void 0 ? void 0 : _componentDtoList$fin.uniqueKey;
74
66
  };
@@ -35,11 +35,12 @@ import { factory } from '@kmkf-fe-packages/services-components';
35
35
  import { getExpression, formatDisplayConfig, isNull, LabelData } from '@kmkf-fe-packages/kmkf-utils';
36
36
  import ShopName from "../ShopName";
37
37
  import { PlatForm } from "../../../model/flowTemplateDetail/types";
38
- import { groupByPreNode, getCurrentNodeModifiedShowHideRule, findComponentUniqueKeyByType } from "./common";
38
+ import { groupByPreNode, getCurrentNodeModifiedShowHideRule } from "./common";
39
39
  import { getCalculationComponentValue } from "../../../common/utils/arithmetic";
40
40
  import "./index.less";
41
41
  import { CHILD_FIELD_TYPE, CHILD_FIELD_VALUE } from "../../../common/constant";
42
- import { jsonParseSecurity } from "../../../common/utils/tools";
42
+ import { jsonParseSecurity, findComponentUniqueKeyByType } from "../../../common/utils/tools";
43
+ import { NEED_CLEAR_FIELDS_WHEN_SHOP_ID_CHANGE } from "../../constant";
43
44
  // 记录显隐触发隐藏的组件。显示后,重新出发一遍映射规则
44
45
  // TODO: 用useState会有bug, 不确定是哪里导致的
45
46
  var hideByXYComponentsMap = {};
@@ -300,6 +301,8 @@ var FormRender = function FormRender(props, ref) {
300
301
  enterprisePaymentTid: orderNo,
301
302
  enterprisePaymentAlipayNo: enterprisePaymentAlipayNo
302
303
  }, templateDetail);
304
+ var formData = form.getFieldsValue(true);
305
+ handleWatchFormValueChange(undefined, formData);
303
306
  };
304
307
  useEffect(function () {
305
308
  if (labelComponent && !isNull(record)) {
@@ -695,7 +698,7 @@ var FormRender = function FormRender(props, ref) {
695
698
  setShopId(val);
696
699
  // 清空表单字段
697
700
  var needClearFormFields = get(templateDetail, 'componentDtoList', []).reduce(function (cur, nxt) {
698
- if (['ITEM_SELECT_THIRD', 'STATUS', 'ITEM_SELECT', 'ITEM_ID', 'ITEM_ENCODE', 'JST_LOGISTICS', 'JST_ITEM_SELECT_THIRD', 'JST_SUPPLY', 'JST_SEND_GOOD', 'BS_GOODS', 'BS_EXCHANGE_GOODS', 'BS_REISSUE_GOODS', 'BS_RETURN_GOODS', 'BS_LOGISTICS', 'BS_SEND_GOOD', 'BS_SYSTEM_ORDER', 'WLN_SYSTEM_ORDER', 'WLN_GOODS', 'WLN_LOGISTICS', 'WLN_SEND_GOOD', 'WDT_LOGISTICS', 'WDT_SEND_GOOD', 'WDT_SYSTEM_ORDER', 'WDT_REISSUE_GOODS', 'WDT_RETURN_GOODS', 'WDT_EXCHANGE_GOODS', 'KM_SEND_GOOD', 'BS_E3_SYSTEM_ORDER', 'BS_E3_REISSUE_GOODS'].includes(nxt === null || nxt === void 0 ? void 0 : nxt.workOrderComponentType)) {
701
+ if (NEED_CLEAR_FIELDS_WHEN_SHOP_ID_CHANGE.includes(nxt === null || nxt === void 0 ? void 0 : nxt.workOrderComponentType)) {
699
702
  cur.push(nxt === null || nxt === void 0 ? void 0 : nxt.uniqueKey);
700
703
  }
701
704
  return cur;
@@ -733,7 +736,7 @@ var FormRender = function FormRender(props, ref) {
733
736
  }
734
737
  //如果有bs组件 设置成初始值
735
738
  var hasBs = get(templateDetail, 'componentDtoList', []).some(function (item) {
736
- return ['BS_LOGISTICS', 'BS_SEND_GOOD', 'WDT_LOGISTICS', 'WDT_SEND_GOOD', 'WLN_LOGISTICS', 'WLN_SEND_GOOD', 'KM_SEND_GOOD'].includes(item.workOrderComponentType);
739
+ return ['BS_LOGISTICS', 'BS_E3_LOGISTICS', 'BS_SEND_GOOD', 'BS_E3_SEND_GOOD', 'WDT_LOGISTICS', 'WDT_SEND_GOOD', 'WLN_LOGISTICS', 'WLN_SEND_GOOD', 'KM_SEND_GOOD'].includes(item.workOrderComponentType);
737
740
  });
738
741
  if (hasBs) {
739
742
  var bsValue = get(templateDetail, 'componentDtoList', []).reduce(function (prv, next) {
@@ -741,12 +744,14 @@ var FormRender = function FormRender(props, ref) {
741
744
  case 'BS_LOGISTICS':
742
745
  case 'WLN_LOGISTICS':
743
746
  case 'WDT_LOGISTICS':
747
+ case 'BS_E3_LOGISTICS':
744
748
  prv[next.uniqueKey] = [{
745
749
  logisticsCompany: null,
746
750
  logisticsCode: null
747
751
  }];
748
752
  break;
749
753
  case 'BS_SEND_GOOD':
754
+ case 'BS_E3_SEND_GOOD':
750
755
  case 'WLN_SEND_GOOD':
751
756
  case 'WDT_SEND_GOOD':
752
757
  case 'KM_SEND_GOOD':
@@ -1042,10 +1047,8 @@ var FormRender = function FormRender(props, ref) {
1042
1047
  if (!(value !== null && value !== void 0 && value.shopId)) return;
1043
1048
  //如果是初始化创建工单 缓存信息
1044
1049
  if (!workOrderId && ['fxg', 'tb', 'ks', 'xiaozhi'].includes(plat.platform)) {
1045
- var _tempLateList$find;
1046
- var tradeIdUniqueKey = (_tempLateList$find = tempLateList.find(function (item) {
1047
- return item.workOrderComponentType === 'TRADE_ID_INPUT';
1048
- })) === null || _tempLateList$find === void 0 ? void 0 : _tempLateList$find.uniqueKey;
1050
+ var _findComponentUniqueK;
1051
+ var tradeIdUniqueKey = (_findComponentUniqueK = findComponentUniqueKeyByType(tempLateList, 'TRADE_ID_INPUT')) !== null && _findComponentUniqueK !== void 0 ? _findComponentUniqueK : '';
1049
1052
  var tradeId = value[tradeIdUniqueKey];
1050
1053
  if (plat !== null && plat !== void 0 && plat.subOrderNo) {
1051
1054
  var cacheOmsOrderInfo = JSON.parse(sessionStorage.getItem('cacheOmsOrderInfo') || '{}');
@@ -0,0 +1 @@
1
+ export declare const NEED_CLEAR_FIELDS_WHEN_SHOP_ID_CHANGE: string[];
@@ -0,0 +1,2 @@
1
+ // 切换当前店铺时,以下组件字段需要清空
2
+ export var NEED_CLEAR_FIELDS_WHEN_SHOP_ID_CHANGE = ['ITEM_SELECT_THIRD', 'STATUS', 'ITEM_SELECT', 'ITEM_ID', 'ITEM_ENCODE', 'JST_LOGISTICS', 'JST_ITEM_SELECT_THIRD', 'JST_SUPPLY', 'JST_SEND_GOOD', 'BS_GOODS', 'BS_EXCHANGE_GOODS', 'BS_REISSUE_GOODS', 'BS_RETURN_GOODS', 'BS_LOGISTICS', 'BS_SEND_GOOD', 'BS_SYSTEM_ORDER', 'WLN_SYSTEM_ORDER', 'WLN_GOODS', 'WLN_LOGISTICS', 'WLN_SEND_GOOD', 'WDT_LOGISTICS', 'WDT_SEND_GOOD', 'WDT_SYSTEM_ORDER', 'WDT_REISSUE_GOODS', 'WDT_RETURN_GOODS', 'WDT_EXCHANGE_GOODS', 'KM_SEND_GOOD', 'BS_E3_SYSTEM_ORDER', 'BS_E3_REISSUE_GOODS'];
@@ -3,6 +3,7 @@ export declare const COMMON_HOST = "https://kefu.kuaimai.com";
3
3
  export declare const HD_HOST = "https://kefuab.kuaimai.com";
4
4
  interface LoginProps {
5
5
  loginCallBack?: (val: any) => void;
6
+ clickImgCallBack?: () => void;
6
7
  }
7
8
  declare const ProviderLogin: (props: LoginProps) => React.JSX.Element;
8
9
  export default ProviderLogin;
@@ -21,7 +21,8 @@ import styles from "./index.module.less";
21
21
  export var COMMON_HOST = 'https://kefu.kuaimai.com';
22
22
  export var HD_HOST = 'https://kefuab.kuaimai.com';
23
23
  var Login = function Login(props) {
24
- var loginCallBack = props.loginCallBack;
24
+ var loginCallBack = props.loginCallBack,
25
+ clickImgCallBack = props.clickImgCallBack;
25
26
  var _useState = useState(''),
26
27
  _useState2 = _slicedToArray(_useState, 2),
27
28
  name = _useState2[0],
@@ -248,7 +249,8 @@ var Login = function Login(props) {
248
249
  className: styles.logo
249
250
  }, /*#__PURE__*/React.createElement("img", {
250
251
  src: logo,
251
- alt: "logo"
252
+ alt: "logo",
253
+ onClick: clickImgCallBack
252
254
  })), /*#__PURE__*/React.createElement(Form, {
253
255
  className: styles.container
254
256
  }, /*#__PURE__*/React.createElement(Form.Item, null, /*#__PURE__*/React.createElement(Input, {
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ export declare const COMMON_HOST = "https://kefu.kuaimai.com";
3
+ export declare const HD_HOST = "https://kefuab.kuaimai.com";
4
+ interface LoginProps {
5
+ loginCallBack?: (val: any) => void;
6
+ }
7
+ declare const ProviderLogin: (props: LoginProps) => React.JSX.Element;
8
+ export default ProviderLogin;
@@ -0,0 +1,268 @@
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); }); }; }
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
+ import React, { useState, useMemo, useEffect } from 'react';
12
+ import { Input, message, Form, Button } from 'antd';
13
+ import md5 from 'js-md5';
14
+ import { Provider } from 'react-redux';
15
+ import store from "../model/store";
16
+ import cache from "../common/cache";
17
+ import { useAppDispatch } from "../model/hooks";
18
+ import { fetchLoginNew, fetchShopList, setUserInfo } from "../model/login";
19
+ import logo from "../assets/logo.svg";
20
+ import styles from "./index.module.less";
21
+ export var COMMON_HOST = 'https://kefu.kuaimai.com';
22
+ export var HD_HOST = 'https://kefuab.kuaimai.com';
23
+ var Login = function Login(props) {
24
+ var loginCallBack = props.loginCallBack;
25
+ var _useState = useState(''),
26
+ _useState2 = _slicedToArray(_useState, 2),
27
+ name = _useState2[0],
28
+ setName = _useState2[1];
29
+ var _useState3 = useState(''),
30
+ _useState4 = _slicedToArray(_useState3, 2),
31
+ account = _useState4[0],
32
+ setAccount = _useState4[1];
33
+ var _useState5 = useState(''),
34
+ _useState6 = _slicedToArray(_useState5, 2),
35
+ password = _useState6[0],
36
+ setPassword = _useState6[1];
37
+ var _useState7 = useState(false),
38
+ _useState8 = _slicedToArray(_useState7, 2),
39
+ loading = _useState8[0],
40
+ setLoading = _useState8[1];
41
+ // 直接登陆模式
42
+ var _useState9 = useState(false),
43
+ _useState10 = _slicedToArray(_useState9, 2),
44
+ isDirectProcess = _useState10[0],
45
+ setDirectProcess = _useState10[1];
46
+ // 显示历史记录
47
+ var _useState11 = useState(false),
48
+ _useState12 = _slicedToArray(_useState11, 2),
49
+ showRecommendPwdList = _useState12[0],
50
+ setShowRecommendPwdList = _useState12[1];
51
+ var dispatch = useAppDispatch();
52
+ useEffect(function () {
53
+ localStorage.removeItem('kmkf_kmgd_cookie');
54
+ cache.setHost(COMMON_HOST);
55
+ }, []);
56
+ var processHistoryPwd = function processHistoryPwd(params) {
57
+ var historyList = cache.getHistoryList();
58
+ if (historyList.findIndex(function (item) {
59
+ return item.account === params.account;
60
+ }) < 0) {
61
+ historyList.unshift(params);
62
+ }
63
+ cache.setHistoryList(historyList);
64
+ };
65
+ var changeProcessHistoryPwd = function changeProcessHistoryPwd(params) {
66
+ var historyList = cache.getHistoryList();
67
+ historyList = historyList.filter(function (item) {
68
+ return item.account !== params.account;
69
+ });
70
+ historyList.unshift(params);
71
+ cache.setHistoryList(historyList);
72
+ };
73
+ var onCompanyChange = function onCompanyChange(val) {
74
+ if (isDirectProcess) {
75
+ setDirectProcess(false);
76
+ setPassword('');
77
+ }
78
+ setName(val);
79
+ };
80
+ var onAccountChange = function onAccountChange(val) {
81
+ if (isDirectProcess) {
82
+ setDirectProcess(false);
83
+ setPassword('');
84
+ }
85
+ setAccount(val);
86
+ };
87
+ var handleLoginClick = /*#__PURE__*/function () {
88
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
89
+ var isDirect,
90
+ _args2 = arguments;
91
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
92
+ while (1) switch (_context2.prev = _context2.next) {
93
+ case 0:
94
+ isDirect = _args2.length > 0 && _args2[0] !== undefined ? _args2[0] : false;
95
+ if (name) {
96
+ _context2.next = 4;
97
+ break;
98
+ }
99
+ message.error('请输入公司名称');
100
+ return _context2.abrupt("return");
101
+ case 4:
102
+ if (account) {
103
+ _context2.next = 7;
104
+ break;
105
+ }
106
+ message.error('请输入登录账号');
107
+ return _context2.abrupt("return");
108
+ case 7:
109
+ if (password) {
110
+ _context2.next = 10;
111
+ break;
112
+ }
113
+ message.error('请输入密码');
114
+ return _context2.abrupt("return");
115
+ case 10:
116
+ try {
117
+ setLoading(true);
118
+ dispatch(fetchLoginNew({
119
+ name: name.trim(),
120
+ account: account.trim(),
121
+ password: isDirect ? password : md5(password),
122
+ pageReturnType: 'client_jump'
123
+ })).unwrap().then( /*#__PURE__*/function () {
124
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(res) {
125
+ var data, success, _data$companyUser;
126
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
127
+ while (1) switch (_context.prev = _context.next) {
128
+ case 0:
129
+ data = res.data, success = res.success; // console.log(data, success);
130
+ if (isDirect) {
131
+ processHistoryPwd({
132
+ name: name,
133
+ account: account,
134
+ password: password
135
+ });
136
+ } else {
137
+ changeProcessHistoryPwd({
138
+ name: name,
139
+ account: account,
140
+ password: md5(password)
141
+ });
142
+ }
143
+ if (!success) {
144
+ _context.next = 10;
145
+ break;
146
+ }
147
+ message.success('登录成功', 1.5);
148
+ dispatch(setUserInfo(data === null || data === void 0 ? void 0 : data.companyUser));
149
+ cache.setHost((data === null || data === void 0 ? void 0 : data.domain) || COMMON_HOST);
150
+ cache.setCookie(data === null || data === void 0 ? void 0 : (_data$companyUser = data.companyUser) === null || _data$companyUser === void 0 ? void 0 : _data$companyUser.ckValue);
151
+ _context.next = 9;
152
+ return dispatch(fetchShopList());
153
+ case 9:
154
+ loginCallBack === null || loginCallBack === void 0 ? void 0 : loginCallBack({
155
+ data: data
156
+ });
157
+ case 10:
158
+ setLoading(false);
159
+ case 11:
160
+ case "end":
161
+ return _context.stop();
162
+ }
163
+ }, _callee);
164
+ }));
165
+ return function (_x2) {
166
+ return _ref2.apply(this, arguments);
167
+ };
168
+ }()).catch(function () {
169
+ setLoading(false);
170
+ });
171
+ } catch (err) {
172
+ setLoading(false);
173
+ console.error(err);
174
+ }
175
+ case 11:
176
+ case "end":
177
+ return _context2.stop();
178
+ }
179
+ }, _callee2);
180
+ }));
181
+ return function handleLoginClick() {
182
+ return _ref.apply(this, arguments);
183
+ };
184
+ }();
185
+ var changeRecommendVisible = function changeRecommendVisible(flag) {
186
+ setTimeout(function () {
187
+ setShowRecommendPwdList(flag);
188
+ }, 500);
189
+ };
190
+ var handleSelectHistoryRecord = function handleSelectHistoryRecord(item) {
191
+ var itemName = item.name,
192
+ itemAccount = item.account,
193
+ itemPassword = item.password;
194
+ setName(itemName);
195
+ setAccount(itemAccount);
196
+ setPassword(itemPassword);
197
+ setDirectProcess(true);
198
+ };
199
+ var filteredHistoryList = useMemo(function () {
200
+ var historyList = cache.getHistoryList();
201
+ return historyList.filter(function (item) {
202
+ if (account) {
203
+ return item.account.includes(account);
204
+ }
205
+ return true;
206
+ });
207
+ }, [account]);
208
+ return /*#__PURE__*/React.createElement("div", {
209
+ className: styles.wrap
210
+ }, /*#__PURE__*/React.createElement("div", {
211
+ className: styles.logo
212
+ }, /*#__PURE__*/React.createElement("img", {
213
+ src: logo,
214
+ alt: "logo"
215
+ })), /*#__PURE__*/React.createElement(Form, {
216
+ className: styles.container
217
+ }, /*#__PURE__*/React.createElement(Form.Item, null, /*#__PURE__*/React.createElement(Input, {
218
+ value: name,
219
+ onChange: function onChange(e) {
220
+ return onCompanyChange(e.target.value);
221
+ },
222
+ placeholder: "\u8BF7\u8F93\u5165\u516C\u53F8\u540D\u79F0"
223
+ })), /*#__PURE__*/React.createElement(Form.Item, null, /*#__PURE__*/React.createElement("div", {
224
+ className: styles.recomConWrap
225
+ }, /*#__PURE__*/React.createElement(Input, {
226
+ onFocus: function onFocus() {
227
+ return changeRecommendVisible(true);
228
+ },
229
+ onBlur: function onBlur() {
230
+ return changeRecommendVisible(false);
231
+ },
232
+ value: account,
233
+ onChange: function onChange(e) {
234
+ return onAccountChange(e.target.value);
235
+ },
236
+ placeholder: "\u8BF7\u8F93\u5165\u767B\u5F55\u8D26\u53F7"
237
+ }), showRecommendPwdList && filteredHistoryList.length > 0 && /*#__PURE__*/React.createElement("div", {
238
+ className: styles.recomListCon
239
+ }, /*#__PURE__*/React.createElement("ul", null, filteredHistoryList.map(function (item) {
240
+ return /*#__PURE__*/React.createElement("li", {
241
+ key: item.account,
242
+ className: styles.recomListItem,
243
+ onClick: function onClick() {
244
+ return handleSelectHistoryRecord(item);
245
+ }
246
+ }, /*#__PURE__*/React.createElement("div", null, "\u4F01\u4E1A\u540D\u79F0\uFF1A", item.name), /*#__PURE__*/React.createElement("div", null, "\u767B\u5F55\u8D26\u53F7:", item.account));
247
+ }))))), /*#__PURE__*/React.createElement(Form.Item, null, /*#__PURE__*/React.createElement(Input, {
248
+ value: password,
249
+ type: "password",
250
+ onChange: function onChange(e) {
251
+ return setPassword(e.target.value);
252
+ },
253
+ placeholder: "\u8BF7\u8F93\u5165\u5BC6\u7801"
254
+ }))), /*#__PURE__*/React.createElement(Button, {
255
+ onClick: function onClick() {
256
+ return handleLoginClick(isDirectProcess);
257
+ },
258
+ type: "primary",
259
+ block: true,
260
+ loading: loading
261
+ }, "\u767B\u5F55"));
262
+ };
263
+ var ProviderLogin = function ProviderLogin(props) {
264
+ return /*#__PURE__*/React.createElement(Provider, {
265
+ store: store
266
+ }, /*#__PURE__*/React.createElement(Login, props));
267
+ };
268
+ export default ProviderLogin;
@@ -0,0 +1,45 @@
1
+ .wrap {
2
+ width: 266px;
3
+ margin: auto;
4
+
5
+ .logo {
6
+ display: flex;
7
+ justify-content: center;
8
+ margin-top: 146px;
9
+ }
10
+
11
+ .container {
12
+ margin-top: 48px;
13
+
14
+ ul {
15
+ margin: 0px;
16
+ padding: 0;
17
+ list-style-type: none;
18
+ }
19
+ }
20
+ }
21
+
22
+ .recomConWrap {
23
+ position: relative;
24
+
25
+ .recomListCon {
26
+ position: absolute;
27
+ left: 28px;
28
+ z-index: 2;
29
+ width: 300px;
30
+ max-height: 160px;
31
+ overflow: auto;
32
+ background-color: #fff;
33
+
34
+ ul {
35
+ margin: 0px;
36
+ padding: 0;
37
+ list-style-type: none;
38
+ }
39
+
40
+ .recomListItem {
41
+ padding: 8px;
42
+ cursor: pointer;
43
+ }
44
+ }
45
+ }
@@ -6,7 +6,7 @@ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefine
6
6
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
7
7
  import React from 'react';
8
8
  import { Select, message } from 'antd';
9
- import { WDT } from '@kmkf-fe-packages/kmkf-utils';
9
+ import { servers } from '@kmkf-fe-packages/kmkf-utils';
10
10
  var Warehouse = function Warehouse(props) {
11
11
  var onChange = props.onChange,
12
12
  value = props.value;
@@ -18,7 +18,7 @@ var Warehouse = function Warehouse(props) {
18
18
  onChange === null || onChange === void 0 ? void 0 : onChange(val);
19
19
  };
20
20
  React.useEffect(function () {
21
- WDT.getWarehouseDataAsync().then(setOptions).catch(function (e) {
21
+ servers.WDT.getWarehouseDataAsync().then(setOptions).catch(function (e) {
22
22
  message.error((e === null || e === void 0 ? void 0 : e.message) || '获取发货仓数据失败,请刷新重试');
23
23
  });
24
24
  }, []);
@@ -1,2 +1,12 @@
1
1
  export declare const updateWorkTypeKeys: any;
2
2
  export declare const systemOrderMap: any;
3
+ export declare const DEFAULT_STRING_COMPONENT_TYPE_FIELD_MAPPING: any;
4
+ export declare const DEFAULT_ARRAY_COMPONENT_TYPE_FIELD_MAPPING: any;
5
+ export declare const SUBMIT_COMPONENT_STATUS_MAP: any;
6
+ export declare const SUBMIT_COMPONENT_GOOD_STATUS_MAP: any;
7
+ export declare const SUBMIT_COMPONENT_ERP_LOGISTICS_MAP: any;
8
+ export declare const SUBMIT_COMPONENT_SEND_GOOD_MAP: any;
9
+ export declare const SUBMIT_COMPONENT_GOODS_MAP: any;
10
+ export declare const SUBMIT_COMPONENT_REISSUE_MAP: any;
11
+ export declare const SUBMIT_COMPONENT_RETURN_GOODS_MAP: Record<string, Record<string, string>>;
12
+ export declare const SUBMIT_COMPONENT_SYSTEM_ORDER_MAP: any;