@kmkf-fe-packages/services-components 0.14.1-alpha.9 → 0.15.0-alpha.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.
@@ -107,36 +107,39 @@ var BsPosting = /*#__PURE__*/_createClass(function BsPosting(options) {
107
107
  this.addressDateInstance = BsAddressData.getInstance();
108
108
  this.province = new Province(_objectSpread(_objectSpread({}, options), {}, {
109
109
  id: "".concat(options.id, "_bsPostingProvince"),
110
- name: '',
110
+ name: "",
111
111
  addressDateInstance: this.addressDateInstance
112
112
  }));
113
113
  this.city = new City(_objectSpread(_objectSpread({}, options), {}, {
114
114
  id: "".concat(options.id, "_bsPostingCity"),
115
- name: '',
115
+ name: "",
116
116
  addressDateInstance: this.addressDateInstance
117
117
  }));
118
118
  this.district = new District(_objectSpread(_objectSpread({}, options), {}, {
119
119
  id: "".concat(options.id, "_bsPostingDistrict"),
120
- name: '区/县',
120
+ name: "区/县",
121
121
  addressDateInstance: this.addressDateInstance
122
122
  }));
123
123
  this.detail = new Detail(_objectSpread(_objectSpread({}, options), {}, {
124
124
  id: "".concat(options.id, "_bsPostingDetail"),
125
- name: '详细地址'
125
+ name: "详细地址"
126
126
  }));
127
127
  this.receiverName = new ReceiverName(_objectSpread(_objectSpread({}, options), {}, {
128
128
  id: "".concat(options.id, "_bsPostingReceiverName"),
129
- name: '收件人姓名'
129
+ name: "收件人姓名"
130
130
  }));
131
131
  this.receiverMobile = new ReceiverMobile(_objectSpread(_objectSpread({}, options), {}, {
132
132
  id: "".concat(options.id, "_bsPostingReceiverMobile"),
133
- name: '收件人电话'
133
+ name: "收件人电话"
134
134
  }));
135
135
  this.children = [this.province, this.city, this.district, this.detail, this.receiverName, this.receiverMobile];
136
136
  this.rules = options !== null && options !== void 0 && (_options$componentCon = options.componentConfig) !== null && _options$componentCon !== void 0 && _options$componentCon.required ? [{
137
137
  validator: function validator(_, value) {
138
138
  var _value$postingAddress;
139
- if (!(value !== null && value !== void 0 && (_value$postingAddress = value.postingAddress) !== null && _value$postingAddress !== void 0 && _value$postingAddress.length) || !(value !== null && value !== void 0 && value.postingDetail) || !(value !== null && value !== void 0 && value.postingReceiverName) || !(value !== null && value !== void 0 && value.postingReceiverMobile)) {
139
+ var addressLen = !(value !== null && value !== void 0 && (_value$postingAddress = value.postingAddress) !== null && _value$postingAddress !== void 0 && _value$postingAddress.length) || (value === null || value === void 0 ? void 0 : value.postingAddress.some(function (t) {
140
+ return !t;
141
+ }));
142
+ if (addressLen || !(value !== null && value !== void 0 && value.postingDetail) || !(value !== null && value !== void 0 && value.postingReceiverName) || !(value !== null && value !== void 0 && value.postingReceiverMobile)) {
140
143
  return Promise.reject(new Error("请填写地址"));
141
144
  }
142
145
  return Promise.resolve();
@@ -1,18 +1,18 @@
1
- import { ComponentInterface, PickOption, ColumnConfig, ALignType, Record } from '../../type';
2
- import React from 'react';
1
+ import { ComponentInterface, PickOption, ColumnConfig, ALignType, Record } from "../../type";
2
+ import React from "react";
3
3
  declare class CommonMultiStatus implements ComponentInterface {
4
4
  name: string;
5
5
  id: string;
6
6
  sortField: string;
7
7
  type: string;
8
8
  rules: any[];
9
- componentConfig: ComponentInterface['componentConfig'];
9
+ componentConfig: ComponentInterface["componentConfig"];
10
10
  align: ALignType;
11
11
  isCombinationComponent: boolean;
12
12
  formField: string;
13
13
  canSort: boolean;
14
14
  children: ComponentInterface[];
15
- dataType: ComponentInterface['dataType'];
15
+ dataType: ComponentInterface["dataType"];
16
16
  constructor(options: PickOption);
17
17
  renderClient: (record: any) => React.JSX.Element | null;
18
18
  renderPc: (value: any, record: Record) => React.JSX.Element;
@@ -8,72 +8,72 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
8
8
  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; }
9
9
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
10
10
  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); }
11
- import React from 'react';
12
- import some from 'lodash/some';
11
+ import React from "react";
12
+ import some from "lodash/some";
13
13
  import GetFormItem from "../GetFormItem";
14
14
  import { CommonOrderContent } from "../Common";
15
- import { CommonMultiStatus as Status } from '@kmkf-fe-packages/basic-components';
15
+ import { CommonMultiStatus as Status } from "@kmkf-fe-packages/basic-components";
16
16
  import ItemView from "../../commonComponents/ItemView";
17
- import { isNull, filterFn as _filterFn } from '@kmkf-fe-packages/kmkf-utils';
17
+ import { isNull, filterFn as _filterFn } from "@kmkf-fe-packages/kmkf-utils";
18
18
  import { SYMBOL } from "../../constant";
19
19
  var typeMap = {
20
20
  RETURN_GOODS_STATUS: {
21
21
  options: [{
22
- value: '成功',
23
- label: '成功',
24
- color: '#52c41a'
22
+ value: "成功",
23
+ label: "成功",
24
+ color: "#52c41a"
25
25
  }, {
26
- value: '失败',
27
- label: '失败',
28
- color: '#ff4d4f'
26
+ value: "失败",
27
+ label: "失败",
28
+ color: "#ff4d4f"
29
29
  }],
30
- key: 'returnGoodsStatusList',
31
- code: 'returnGoodsStatusValue',
32
- name: '退货状态',
30
+ key: "returnGoodsStatusList",
31
+ code: "returnGoodsStatusValue",
32
+ name: "退货状态",
33
33
  type: 1,
34
- valueKey: 'status',
35
- idKey: 'systemOrderId',
36
- failValue: '失败'
34
+ valueKey: "status",
35
+ idKey: "systemOrderId",
36
+ failValue: "失败"
37
37
  },
38
38
  EXCHANGE_STATUS: {
39
39
  options: [{
40
- value: '成功',
41
- label: '成功',
42
- color: '#52c41a'
40
+ value: "成功",
41
+ label: "成功",
42
+ color: "#52c41a"
43
43
  }, {
44
- value: '失败',
45
- label: '失败',
46
- color: '#ff4d4f'
44
+ value: "失败",
45
+ label: "失败",
46
+ color: "#ff4d4f"
47
47
  }],
48
- key: 'exchangeReason',
49
- code: 'exchangeStatusValue',
50
- name: '退货状态',
48
+ key: "exchangeReason",
49
+ code: "exchangeStatusValue",
50
+ name: "退货状态",
51
51
  type: 1,
52
- valueKey: 'status',
53
- idKey: 'systemOrderId',
54
- failValue: '失败'
52
+ valueKey: "status",
53
+ idKey: "systemOrderId",
54
+ failValue: "失败"
55
55
  },
56
56
  WAREHOUSING_STATUS: {
57
57
  options: [{
58
- value: '2',
59
- label: '已入库',
60
- color: '#52c41a'
58
+ value: "2",
59
+ label: "已入库",
60
+ color: "#52c41a"
61
61
  }, {
62
- value: '1',
63
- label: '部分入库',
64
- color: '#e7780f'
62
+ value: "1",
63
+ label: "部分入库",
64
+ color: "#e7780f"
65
65
  }, {
66
- value: '0',
67
- label: '未入库',
68
- color: '#ff4d4f'
66
+ value: "0",
67
+ label: "未入库",
68
+ color: "#ff4d4f"
69
69
  }],
70
- key: 'inStockStatusItemList',
71
- code: 'inStockStatusList',
72
- name: '退货入库状态',
70
+ key: "inStockStatusItemList",
71
+ code: "inStockStatusList",
72
+ name: "退货入库状态",
73
73
  type: 2,
74
- valueKey: 'status',
75
- idKey: 'systemOrderId',
76
- failValue: '失败'
74
+ valueKey: "status",
75
+ idKey: "systemOrderId",
76
+ failValue: "失败"
77
77
  }
78
78
  };
79
79
  var CommonMultiStatus = /*#__PURE__*/_createClass(function CommonMultiStatus(options) {
@@ -144,8 +144,8 @@ var CommonMultiStatus = /*#__PURE__*/_createClass(function CommonMultiStatus(opt
144
144
  var _typeMap$_this$type14;
145
145
  return item[(_typeMap$_this$type14 = typeMap[_this.type]) === null || _typeMap$_this$type14 === void 0 ? void 0 : _typeMap$_this$type14.valueKey] === option.value;
146
146
  });
147
- return "".concat(item === null || item === void 0 ? void 0 : item[(_typeMap$_this$type15 = typeMap[_this.type]) === null || _typeMap$_this$type15 === void 0 ? void 0 : _typeMap$_this$type15.idKey], ":").concat(currentOption ? (currentOption === null || currentOption === void 0 ? void 0 : currentOption.label) || '' : (item === null || item === void 0 ? void 0 : item[(_typeMap$_this$type16 = typeMap[_this.type]) === null || _typeMap$_this$type16 === void 0 ? void 0 : _typeMap$_this$type16.valueKey]) || '');
148
- }).join(',');
147
+ return "".concat(item === null || item === void 0 ? void 0 : item[(_typeMap$_this$type15 = typeMap[_this.type]) === null || _typeMap$_this$type15 === void 0 ? void 0 : _typeMap$_this$type15.idKey], ":").concat(currentOption ? (currentOption === null || currentOption === void 0 ? void 0 : currentOption.label) || "" : (item === null || item === void 0 ? void 0 : item[(_typeMap$_this$type16 = typeMap[_this.type]) === null || _typeMap$_this$type16 === void 0 ? void 0 : _typeMap$_this$type16.valueKey]) || "");
148
+ }).join(",");
149
149
  });
150
150
  _defineProperty(this, "editRender", function (p) {
151
151
  var _this$componentConfig, _this$componentConfig2, _typeMap$_this$type17;
@@ -164,11 +164,11 @@ var CommonMultiStatus = /*#__PURE__*/_createClass(function CommonMultiStatus(opt
164
164
  _defineProperty(this, "filterConfig", function (item) {
165
165
  var _typeMap$_this$type18, _item$templateConfig;
166
166
  return {
167
- searchDefaultConditions: _this.type === 'WAREHOUSING_STATUS' ? SYMBOL.in : SYMBOL.like,
167
+ searchDefaultConditions: _this.type === "WAREHOUSING_STATUS" ? SYMBOL.in : SYMBOL.like,
168
168
  type: item.type,
169
169
  id: "".concat(item.id, "_").concat((_typeMap$_this$type18 = typeMap[_this.type]) === null || _typeMap$_this$type18 === void 0 ? void 0 : _typeMap$_this$type18.code),
170
170
  name: "".concat(_this.name),
171
- filterComponentType: _this.type === 'WAREHOUSING_STATUS' ? 'MultipleSelect' : "Input",
171
+ filterComponentType: _this.type === "WAREHOUSING_STATUS" ? "MultipleSelect" : "Input",
172
172
  props: {
173
173
  options: item === null || item === void 0 ? void 0 : (_item$templateConfig = item.templateConfig) === null || _item$templateConfig === void 0 ? void 0 : _item$templateConfig.reasonList,
174
174
  fieldNames: {
@@ -187,7 +187,7 @@ var CommonMultiStatus = /*#__PURE__*/_createClass(function CommonMultiStatus(opt
187
187
  this.name = options.name;
188
188
  this.id = options.id;
189
189
  this.sortField = "".concat(options.id, "_").concat((_typeMap$options$type = typeMap[options.type]) === null || _typeMap$options$type === void 0 ? void 0 : _typeMap$options$type.key);
190
- this.formField = "".concat(options.id, "_").concat((_typeMap$options$type2 = typeMap[options.type]) === null || _typeMap$options$type2 === void 0 ? void 0 : _typeMap$options$type2.code);
190
+ this.formField = "".concat(options.id, "_").concat((_typeMap$options$type2 = typeMap[options.type]) === null || _typeMap$options$type2 === void 0 ? void 0 : _typeMap$options$type2.key);
191
191
  this.type = options.type;
192
192
  this.componentConfig = _objectSpread(_objectSpread({}, options.componentConfig), {}, {
193
193
  options: typeMap[options.type].options
@@ -195,7 +195,7 @@ var CommonMultiStatus = /*#__PURE__*/_createClass(function CommonMultiStatus(opt
195
195
  this.isCombinationComponent = false;
196
196
  this.canSort = false;
197
197
  this.children = [];
198
- this.dataType = 'object';
198
+ this.dataType = "object";
199
199
  this.rules = (_this$componentConfig3 = this.componentConfig) !== null && _this$componentConfig3 !== void 0 && _this$componentConfig3.required ? [{
200
200
  required: true,
201
201
  validator: function validator(_, value) {
@@ -210,6 +210,6 @@ var CommonMultiStatus = /*#__PURE__*/_createClass(function CommonMultiStatus(opt
210
210
  return Promise.resolve();
211
211
  }
212
212
  }] : [];
213
- this.align = 'left';
213
+ this.align = "left";
214
214
  });
215
215
  export default CommonMultiStatus;
@@ -140,7 +140,7 @@ var CommonSystemOrder = /*#__PURE__*/_createClass(function CommonSystemOrder(opt
140
140
  this.name = options.name;
141
141
  this.id = options.id;
142
142
  this.sortField = "".concat(options.id, "_").concat((_typeMap$options$type = typeMap[options.type]) === null || _typeMap$options$type === void 0 ? void 0 : _typeMap$options$type.key);
143
- this.formField = "".concat(options.id, "_").concat((_typeMap$options$type2 = typeMap[options.type]) === null || _typeMap$options$type2 === void 0 ? void 0 : _typeMap$options$type2.code);
143
+ this.formField = "".concat(options.id, "_").concat((_typeMap$options$type2 = typeMap[options.type]) === null || _typeMap$options$type2 === void 0 ? void 0 : _typeMap$options$type2.key);
144
144
  this.type = options.type;
145
145
  this.componentConfig = options.componentConfig;
146
146
  this.isCombinationComponent = false;
@@ -189,36 +189,39 @@ var BasicPosting = /*#__PURE__*/_createClass(function BasicPosting(options) {
189
189
  this.addressDateInstance = ((_options$componentCon2 = options.componentConfig) === null || _options$componentCon2 === void 0 ? void 0 : _options$componentCon2.showField) === "bs" ? BsAddressData.getInstance() : AddressData.getInstance();
190
190
  this.province = new Province(_objectSpread(_objectSpread({}, options), {}, {
191
191
  id: "".concat(options.id, "_postingProvince"),
192
- name: '',
192
+ name: "",
193
193
  addressDateInstance: this.addressDateInstance
194
194
  }));
195
195
  this.city = new City(_objectSpread(_objectSpread({}, options), {}, {
196
196
  id: "".concat(options.id, "_postingCity"),
197
- name: '',
197
+ name: "",
198
198
  addressDateInstance: this.addressDateInstance
199
199
  }));
200
200
  this.district = new District(_objectSpread(_objectSpread({}, options), {}, {
201
201
  id: "".concat(options.id, "_postingDistrict"),
202
- name: '区/县',
202
+ name: "区/县",
203
203
  addressDateInstance: this.addressDateInstance
204
204
  }));
205
205
  this.detail = new Detail(_objectSpread(_objectSpread({}, options), {}, {
206
206
  id: "".concat(options.id, "_postingDetail"),
207
- name: '详细地址'
207
+ name: "详细地址"
208
208
  }));
209
209
  this.receiverName = new ReceiverName(_objectSpread(_objectSpread({}, options), {}, {
210
210
  id: "".concat(options.id, "_postingReceiverName"),
211
- name: '收件人姓名'
211
+ name: "收件人姓名"
212
212
  }));
213
213
  this.receiverMobile = new ReceiverMobile(_objectSpread(_objectSpread({}, options), {}, {
214
214
  id: "".concat(options.id, "_postingReceiverMobile"),
215
- name: '收件人电话'
215
+ name: "收件人电话"
216
216
  }));
217
217
  this.children = this.isSplitColumns ? [this.province, this.city, this.district, this.detail, this.receiverName, this.receiverMobile] : [];
218
218
  this.rules = options !== null && options !== void 0 && (_options$componentCon3 = options.componentConfig) !== null && _options$componentCon3 !== void 0 && _options$componentCon3.required ? [{
219
219
  validator: function validator(_, value) {
220
- var _value$postingAddress;
221
- if (!(value !== null && value !== void 0 && (_value$postingAddress = value.postingAddress) !== null && _value$postingAddress !== void 0 && _value$postingAddress.length) || !(value !== null && value !== void 0 && value.postingDetail) || !(value !== null && value !== void 0 && value.postingReceiverName) || !(value !== null && value !== void 0 && value.postingReceiverMobile)) {
220
+ var _options$componentCon4, _value$postingAddress, _value$postingAddress2;
221
+ var addressLen = (options === null || options === void 0 ? void 0 : (_options$componentCon4 = options.componentConfig) === null || _options$componentCon4 === void 0 ? void 0 : _options$componentCon4.showField) === "bs" ? !(value !== null && value !== void 0 && (_value$postingAddress = value.postingAddress) !== null && _value$postingAddress !== void 0 && _value$postingAddress.length) || (value === null || value === void 0 ? void 0 : value.postingAddress.some(function (t) {
222
+ return !t;
223
+ })) : !(value !== null && value !== void 0 && (_value$postingAddress2 = value.postingAddress) !== null && _value$postingAddress2 !== void 0 && _value$postingAddress2.length);
224
+ if (addressLen || !(value !== null && value !== void 0 && value.postingDetail) || !(value !== null && value !== void 0 && value.postingReceiverName) || !(value !== null && value !== void 0 && value.postingReceiverMobile)) {
222
225
  return Promise.reject(new Error("请填写地址"));
223
226
  }
224
227
  return Promise.resolve();
@@ -1,3 +1,3 @@
1
1
  import { JstLogistics, JstItemSelect, JstSupply, JstSendGood, BasicInput, BasicAddress, BasicCascader, BasicCheckbox, BasicDataTime, BasicSelect, BasicRadio, BasicTextArea, BasicPicture, BasicMultSelect, BasicGrade, BasicRate, BasicFile, BasicPosting, CommonDataTime, TradeId, ShopName, ErpTradeId, BuyerNick, ReceiverName, ReceiverMobile, ReceiverAddress, TradeDateTime, Logistics, ReturnLogistics, ActualPayment, ERemark, AliPay, ItemSelect, ItemId, ItemEnCode, SystemOrderNo, Ordinary, ThirdItemSelect, FlowStatusSelect, FlowMarkSelect, FlowTag, Payment, TemplateSelect, WorkOrderId, PlatForm, ShopInput, Submitter, PrevSubmitter, FlowCreator, Handler, CompletedUser, LogisticsInterception, LogisticsTrajectory, FlowWorkOrderId, BsGoods, BsExchange, BsReissue, BsReturn, BsSystemOrder, BsLogistics, StatusSelect, CommonSystemOrder, CommonMultiStatus, Calculation, NodeDeadLine, HandlerDeadLine, NodeStayDuration, WlnGoods, BsPosting } from "./index";
2
2
  import { PickOption } from "./type";
3
- export declare const factory: (type: string, options: PickOption) => BasicAddress | BsExchange | BsPosting | BsReissue | BsReturn | BsSystemOrder | BasicCascader | BasicCheckbox | CommonDataTime | CommonMultiStatus | BasicDataTime | FlowCreator | FlowTag | BasicInput | BasicPosting | PrevSubmitter | BasicRadio | ReceiverAddress | ERemark | Submitter | BasicSelect | BasicTextArea | BasicPicture | BasicMultSelect | BasicGrade | BasicRate | BasicFile | TradeId | ErpTradeId | ShopName | BuyerNick | ReceiverName | ReceiverMobile | TradeDateTime | Logistics | ReturnLogistics | ActualPayment | AliPay | ItemSelect | ItemId | ItemEnCode | SystemOrderNo | Ordinary | ThirdItemSelect | Payment | JstLogistics | JstItemSelect | JstSendGood | JstSupply | BsGoods | BsLogistics | FlowStatusSelect | FlowMarkSelect | TemplateSelect | WorkOrderId | LogisticsInterception | LogisticsTrajectory | PlatForm | ShopInput | Handler | CompletedUser | FlowWorkOrderId | StatusSelect | Calculation | CommonSystemOrder | NodeDeadLine | HandlerDeadLine | NodeStayDuration | WlnGoods;
3
+ export declare const factory: (type: string, options: PickOption) => BsExchange | BsGoods | BsReissue | BsReturn | BsSystemOrder | CommonMultiStatus | BasicInput | BasicAddress | BasicCascader | BasicCheckbox | BasicDataTime | BasicSelect | BasicRadio | BasicTextArea | BasicPicture | BasicMultSelect | BasicGrade | BasicRate | BasicFile | BasicPosting | CommonDataTime | TradeId | ErpTradeId | ShopName | BuyerNick | ReceiverName | ReceiverMobile | ReceiverAddress | TradeDateTime | Logistics | ReturnLogistics | ActualPayment | ERemark | AliPay | ItemSelect | ItemId | ItemEnCode | SystemOrderNo | Ordinary | ThirdItemSelect | Payment | JstLogistics | JstItemSelect | JstSendGood | JstSupply | BsLogistics | FlowStatusSelect | FlowMarkSelect | FlowTag | TemplateSelect | WorkOrderId | LogisticsInterception | LogisticsTrajectory | PlatForm | ShopInput | Submitter | PrevSubmitter | FlowCreator | Handler | CompletedUser | FlowWorkOrderId | StatusSelect | Calculation | CommonSystemOrder | NodeDeadLine | HandlerDeadLine | NodeStayDuration | WlnGoods | BsPosting;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kmkf-fe-packages/services-components",
3
- "version": "0.14.1-alpha.9",
3
+ "version": "0.15.0-alpha.0",
4
4
  "module": "dist/esm/index.js",
5
5
  "typings": "dist/esm/index.d.ts",
6
6
  "files": [
@@ -26,8 +26,8 @@
26
26
  "father": "^4.1.7"
27
27
  },
28
28
  "dependencies": {
29
- "@kmkf-fe-packages/basic-components": "^0.14.1-alpha.5",
30
- "@kmkf-fe-packages/kmkf-utils": "^0.13.1"
29
+ "@kmkf-fe-packages/basic-components": "^0.15.0-alpha.0",
30
+ "@kmkf-fe-packages/kmkf-utils": "^0.15.0-alpha.0"
31
31
  },
32
32
  "peerDependencies": {
33
33
  "@ant-design/icons": "^4.7.0",
@@ -40,5 +40,5 @@
40
40
  "gitHooks": {
41
41
  "pre-commit": "lint-staged"
42
42
  },
43
- "gitHead": "2035592a8067c13befdd63e85c0a07ac462ae201"
43
+ "gitHead": "d655ae092175a9211245feee158c52e6cd288003"
44
44
  }