kmkf-work-order-service-component 0.4.0-alpha.10 → 0.4.0-alpha.12

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.
@@ -19,6 +19,7 @@ declare type FormRenderProps = {
19
19
  platform?: string;
20
20
  templateList?: Option[];
21
21
  formProps?: FormProps;
22
+ isShowShopList: boolean;
22
23
  onTemplateChange?: (p: string) => any;
23
24
  onFormSubmitSuccess?: <T>(p: T) => void;
24
25
  };
@@ -93,6 +93,7 @@ var FormRender = function FormRender(props, ref) {
93
93
  templateList = props.templateList,
94
94
  onFormSubmitSuccess = props.onFormSubmitSuccess,
95
95
  onTemplateChange = props.onTemplateChange,
96
+ isShowShopList = props.isShowShopList,
96
97
  _props$formProps = props.formProps,
97
98
  formProps = _props$formProps === void 0 ? {} : _props$formProps;
98
99
 
@@ -139,15 +140,14 @@ var FormRender = function FormRender(props, ref) {
139
140
  formatAddrData.initData();
140
141
  }, []);
141
142
  useEffect(function () {
143
+ setShopId(currentShopId);
144
+
142
145
  if (!currentShopId) {
143
146
  getPlatList().then(function (list) {
144
147
  return setPlatIcon(list);
145
148
  });
146
149
  }
147
150
  }, [currentShopId]);
148
- useEffect(function () {
149
- setShopId(currentShopId);
150
- }, [currentShopId]);
151
151
 
152
152
  var _Form$useForm = Form.useForm(),
153
153
  _Form$useForm2 = _slicedToArray(_Form$useForm, 1),
@@ -186,27 +186,26 @@ var FormRender = function FormRender(props, ref) {
186
186
  switch (_context.prev = _context.next) {
187
187
  case 0:
188
188
  _context.prev = 0;
189
- debugger;
190
- _context.next = 4;
189
+ _context.next = 3;
191
190
  return form.validateFields();
192
191
 
193
- case 4:
192
+ case 3:
194
193
  data = _context.sent;
195
194
  console.debug('表单内容', data);
196
195
  console.debug('templateDetail内容', templateDetail);
197
196
  res = verifyHandle(data, templateDetail);
198
197
 
199
198
  if (res.success) {
200
- _context.next = 11;
199
+ _context.next = 10;
201
200
  break;
202
201
  }
203
202
 
204
203
  message.error(res.message);
205
204
  return _context.abrupt("return");
206
205
 
207
- case 11:
206
+ case 10:
208
207
  if (!workOrderId) {
209
- _context.next = 23;
208
+ _context.next = 22;
210
209
  break;
211
210
  }
212
211
 
@@ -226,10 +225,10 @@ var FormRender = function FormRender(props, ref) {
226
225
  params.workOrderUpdateKeyVos.workOrderUpdateKeySupVos = submitData.reduce(function (nex, cur) {
227
226
  return nex.concat(cur === null || cur === void 0 ? void 0 : cur.contentVoList);
228
227
  }, []);
229
- _context.next = 17;
228
+ _context.next = 16;
230
229
  return updateWorkOrder(params);
231
230
 
232
- case 17:
231
+ case 16:
233
232
  _yield$updateWorkOrde = _context.sent;
234
233
  success = _yield$updateWorkOrde.success;
235
234
  result = _yield$updateWorkOrde.data;
@@ -243,10 +242,10 @@ var FormRender = function FormRender(props, ref) {
243
242
  });
244
243
  }
245
244
 
246
- _context.next = 36;
245
+ _context.next = 35;
247
246
  break;
248
247
 
249
- case 23:
248
+ case 22:
250
249
  platformMap = {
251
250
  tb: '淘宝',
252
251
  fxg: '抖音',
@@ -291,10 +290,10 @@ var FormRender = function FormRender(props, ref) {
291
290
  }
292
291
 
293
292
  console.debug('增加数据参数', _params);
294
- _context.next = 32;
293
+ _context.next = 31;
295
294
  return addWorkOrder(_params);
296
295
 
297
- case 32:
296
+ case 31:
298
297
  _yield$addWorkOrder = _context.sent;
299
298
  _success = _yield$addWorkOrder.success;
300
299
  _result = _yield$addWorkOrder.data;
@@ -307,13 +306,13 @@ var FormRender = function FormRender(props, ref) {
307
306
  });
308
307
  }
309
308
 
310
- case 36:
309
+ case 35:
311
310
  console.groupEnd();
312
- _context.next = 42;
311
+ _context.next = 41;
313
312
  break;
314
313
 
315
- case 39:
316
- _context.prev = 39;
314
+ case 38:
315
+ _context.prev = 38;
317
316
  _context.t0 = _context["catch"](0);
318
317
 
319
318
  // 表单校验失败错误时,将错误第一项滚动到可视区域
@@ -329,12 +328,12 @@ var FormRender = function FormRender(props, ref) {
329
328
  }, 0);
330
329
  }
331
330
 
332
- case 42:
331
+ case 41:
333
332
  case "end":
334
333
  return _context.stop();
335
334
  }
336
335
  }
337
- }, _callee, null, [[0, 39]]);
336
+ }, _callee, null, [[0, 38]]);
338
337
  }));
339
338
 
340
339
  return function asyncDoSave(_x, _x2) {
@@ -349,7 +348,7 @@ var FormRender = function FormRender(props, ref) {
349
348
  return {
350
349
  save: handleSubmit
351
350
  };
352
- }, [workOrderDetail, templateDetail]); //带*参数提示清空
351
+ }, [handleSubmit]); //带*参数提示清空
353
352
 
354
353
  var filterStarValues = function filterStarValues() {
355
354
  var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
@@ -695,7 +694,7 @@ var FormRender = function FormRender(props, ref) {
695
694
  onChange: handleChangeTemplateId,
696
695
  allowClear: false
697
696
  })
698
- }), !currentShopId && /*#__PURE__*/_jsx(ShopName, {
697
+ }), isShowShopList && /*#__PURE__*/_jsx(ShopName, {
699
698
  shopList: shopList,
700
699
  platIconList: platIcon,
701
700
  workOrderId: workOrderId,
@@ -401,6 +401,7 @@ var CustomizeWorkOrderList = function CustomizeWorkOrderList(_ref3) {
401
401
  },
402
402
  className: 'customizeFormModalClassName'
403
403
  },
404
+ isShowShopList: false,
404
405
  onFormSubmitSuccess: function onFormSubmitSuccess(val) {
405
406
  submit();
406
407
  handleCloseFormModal();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kmkf-work-order-service-component",
3
- "version": "0.4.0-alpha.10",
3
+ "version": "0.4.0-alpha.12",
4
4
  "scripts": {
5
5
  "start": "dumi dev",
6
6
  "docs:build": "dumi build",