@kmkf-fe-packages/services-components 1.17.8-beta.0 → 1.17.8-beta.10

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.
@@ -1065,7 +1065,7 @@ export var MsgContent = function MsgContent(_ref14) {
1065
1065
  var getColorByStatus = function getColorByStatus(value) {
1066
1066
  var _options$find2;
1067
1067
  return ((_options$find2 = options.find(function (innerItem) {
1068
- return value === innerItem.label;
1068
+ return value === innerItem.label || value === innerItem.oldValue;
1069
1069
  })) === null || _options$find2 === void 0 ? void 0 : _options$find2.color) || '#000';
1070
1070
  };
1071
1071
  var detailContent = function detailContent(item) {
@@ -1106,7 +1106,7 @@ export var MsgContent = function MsgContent(_ref14) {
1106
1106
  cursor: "pointer"
1107
1107
  }
1108
1108
  }, (_item$msgReceivers2 = item.msgReceivers) !== null && _item$msgReceivers2 !== void 0 && _item$msgReceivers2.some(function (msgItem) {
1109
- return (msgItem === null || msgItem === void 0 ? void 0 : msgItem.status) === failValue;
1109
+ return Array.isArray(failValue) ? failValue.includes(msgItem === null || msgItem === void 0 ? void 0 : msgItem.status) : (msgItem === null || msgItem === void 0 ? void 0 : msgItem.status) === failValue;
1110
1110
  }) || item.failReason ? /*#__PURE__*/React.createElement(Popover, {
1111
1111
  content: detailContent(item),
1112
1112
  overlayStyle: {
@@ -110,7 +110,7 @@ var BasicInput = /*#__PURE__*/_createClass(function BasicInput(options) {
110
110
  this.workOrderUniqueKey = options === null || options === void 0 ? void 0 : options.workOrderUniqueKey;
111
111
  this.rules = [{
112
112
  validator: function validator(_, value) {
113
- var _this$componentConfig6, _this$componentConfig7, _this$componentConfig8, _this$componentConfig9, _this$componentConfig10;
113
+ var _this$componentConfig6, _this$componentConfig7, _this$componentConfig8, _this$componentConfig9, _this$componentConfig10, _this$componentConfig11;
114
114
  if (!value) {
115
115
  return Promise.resolve();
116
116
  }
@@ -127,11 +127,14 @@ var BasicInput = /*#__PURE__*/_createClass(function BasicInput(options) {
127
127
  if (testList.length && !isTest) {
128
128
  return Promise.reject(new Error("请填写正确的格式"));
129
129
  }
130
- if ((_this$componentConfig9 = _this.componentConfig) !== null && _this$componentConfig9 !== void 0 && (_this$componentConfig10 = _this$componentConfig9.rulesOptions) !== null && _this$componentConfig10 !== void 0 && _this$componentConfig10.length) {
131
- var _this$componentConfig11;
132
- var rulesList = (_this$componentConfig11 = _this.componentConfig) === null || _this$componentConfig11 === void 0 ? void 0 : _this$componentConfig11.rulesOptions.filter(function (item) {
133
- var _this$componentConfig12;
134
- return (((_this$componentConfig12 = _this.componentConfig) === null || _this$componentConfig12 === void 0 ? void 0 : _this$componentConfig12.selectRules) || []).includes(item.id);
130
+ if ((_this$componentConfig9 = _this.componentConfig) !== null && _this$componentConfig9 !== void 0 && _this$componentConfig9.isNumber && value > Number.MAX_SAFE_INTEGER) {
131
+ return Promise.reject(new Error("输入数值超出最大数字上限,请使用文本框替代当前数字输入框组件"));
132
+ }
133
+ if ((_this$componentConfig10 = _this.componentConfig) !== null && _this$componentConfig10 !== void 0 && (_this$componentConfig11 = _this$componentConfig10.rulesOptions) !== null && _this$componentConfig11 !== void 0 && _this$componentConfig11.length) {
134
+ var _this$componentConfig12;
135
+ var rulesList = (_this$componentConfig12 = _this.componentConfig) === null || _this$componentConfig12 === void 0 ? void 0 : _this$componentConfig12.rulesOptions.filter(function (item) {
136
+ var _this$componentConfig13;
137
+ return (((_this$componentConfig13 = _this.componentConfig) === null || _this$componentConfig13 === void 0 ? void 0 : _this$componentConfig13.selectRules) || []).includes(item.id);
135
138
  });
136
139
  if (!rulesList.length) {
137
140
  return Promise.resolve();
@@ -154,8 +157,8 @@ var BasicInput = /*#__PURE__*/_createClass(function BasicInput(options) {
154
157
  validateTrigger: "onBlur",
155
158
  validator: function () {
156
159
  var _validator = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(_, value) {
157
- var _this$componentConfig13;
158
- var _resultList$, params, _yield$replaceCheck, resultList, _this$componentConfig14, _this$componentConfig15, _this$componentConfig16, messageMap;
160
+ var _this$componentConfig14;
161
+ var _resultList$, params, _yield$replaceCheck, resultList, _this$componentConfig15, _this$componentConfig16, _this$componentConfig17, messageMap;
159
162
  return _regeneratorRuntime().wrap(function _callee$(_context) {
160
163
  while (1) switch (_context.prev = _context.next) {
161
164
  case 0:
@@ -165,7 +168,7 @@ var BasicInput = /*#__PURE__*/_createClass(function BasicInput(options) {
165
168
  }
166
169
  return _context.abrupt("return", Promise.resolve());
167
170
  case 2:
168
- if (!((_this$componentConfig13 = _this.componentConfig) !== null && _this$componentConfig13 !== void 0 && _this$componentConfig13.replaceWarn)) {
171
+ if (!((_this$componentConfig14 = _this.componentConfig) !== null && _this$componentConfig14 !== void 0 && _this$componentConfig14.replaceWarn)) {
169
172
  _context.next = 11;
170
173
  break;
171
174
  }
@@ -192,7 +195,7 @@ var BasicInput = /*#__PURE__*/_createClass(function BasicInput(options) {
192
195
  currFlow: "数据已存在本模版中,不能重复提交",
193
196
  allWorkOrder: "数据已存在其他模版中,不能重复提交"
194
197
  };
195
- return _context.abrupt("return", Promise.reject(new Error(messageMap[(_this$componentConfig14 = (_this$componentConfig15 = _this.componentConfig) === null || _this$componentConfig15 === void 0 ? void 0 : (_this$componentConfig16 = _this$componentConfig15.repeatConfig) === null || _this$componentConfig16 === void 0 ? void 0 : _this$componentConfig16.repeatRange) !== null && _this$componentConfig14 !== void 0 ? _this$componentConfig14 : ""] || "内容已存在,不能重复提交")));
198
+ return _context.abrupt("return", Promise.reject(new Error(messageMap[(_this$componentConfig15 = (_this$componentConfig16 = _this.componentConfig) === null || _this$componentConfig16 === void 0 ? void 0 : (_this$componentConfig17 = _this$componentConfig16.repeatConfig) === null || _this$componentConfig17 === void 0 ? void 0 : _this$componentConfig17.repeatRange) !== null && _this$componentConfig15 !== void 0 ? _this$componentConfig15 : ""] || "内容已存在,不能重复提交")));
196
199
  case 11:
197
200
  case "end":
198
201
  return _context.stop();
@@ -19,6 +19,7 @@ declare class JstSendGood implements ComponentInterface {
19
19
  canSort: boolean;
20
20
  children: ComponentInterface[];
21
21
  dataType: ComponentInterface["dataType"];
22
+ format: ComponentInterface["format"];
22
23
  constructor(options: PickOption);
23
24
  getSortChildFields: (type: string, options: PickOption, fieldType?: string) => any;
24
25
  renderClient: (record: Record) => React.JSX.Element | null;
@@ -46,8 +47,5 @@ declare class JstSendGood implements ComponentInterface {
46
47
  filterFn: (value: string) => (i: Record) => any;
47
48
  props?: undefined;
48
49
  })[];
49
- formDataTransform: (v: Array<{
50
- sendName: string;
51
- }>) => string[];
52
50
  }
53
51
  export default JstSendGood;
@@ -60,17 +60,20 @@ var JstSendGood = /*#__PURE__*/_createClass(function JstSendGood(_options) {
60
60
  _defineProperty(this, "canSort", void 0);
61
61
  _defineProperty(this, "children", void 0);
62
62
  _defineProperty(this, "dataType", void 0);
63
+ _defineProperty(this, "format", void 0);
63
64
  _defineProperty(this, "getSortChildFields", function (type, options, fieldType) {
64
65
  var _typeMap$options$type, _typeMap$options$type2;
65
66
  var sendName = {
66
67
  name: "发货仓名称",
67
68
  key: "".concat(options.id, "_").concat((_typeMap$options$type = typeMap[options.type]) === null || _typeMap$options$type === void 0 ? void 0 : _typeMap$options$type.sendName),
68
- dataType: "string"
69
+ dataType: "array",
70
+ format: "input"
69
71
  };
70
72
  var sendId = {
71
73
  name: "发货仓编码",
72
74
  key: "".concat(options.id, "_").concat((_typeMap$options$type2 = typeMap[options.type]) === null || _typeMap$options$type2 === void 0 ? void 0 : _typeMap$options$type2.sendId),
73
- dataType: "string"
75
+ dataType: "array",
76
+ format: "input"
74
77
  };
75
78
  if (fieldType === 'WDT_SEND_GOOD') {
76
79
  sendName.options = WdtSendData.getInstance().getWdtSendData() || [];
@@ -202,14 +205,6 @@ var JstSendGood = /*#__PURE__*/_createClass(function JstSendGood(_options) {
202
205
  }
203
206
  }];
204
207
  });
205
- _defineProperty(this, "formDataTransform", function (v) {
206
- var _v$map;
207
- return v === null || v === void 0 ? void 0 : (_v$map = v.map(function (item) {
208
- return item.sendName;
209
- })) === null || _v$map === void 0 ? void 0 : _v$map.filter(function (item) {
210
- return !isNull(item);
211
- });
212
- });
213
208
  this.name = _options.name;
214
209
  this.id = _options.id;
215
210
  this.sortField = "".concat(_options.id, "_").concat((_typeMap$_options$typ = typeMap[_options.type]) === null || _typeMap$_options$typ === void 0 ? void 0 : _typeMap$_options$typ.key);
@@ -244,5 +239,6 @@ var JstSendGood = /*#__PURE__*/_createClass(function JstSendGood(_options) {
244
239
  this.isCombinationComponent = false;
245
240
  this.canSort = false;
246
241
  this.children = [];
242
+ this.format = 'object';
247
243
  });
248
244
  export default JstSendGood;
@@ -34,7 +34,7 @@ var PaymentTid = /*#__PURE__*/_createClass(function PaymentTid(options) {
34
34
  var addressText = (_item$interceptAddres = item.interceptAddress) === null || _item$interceptAddres === void 0 ? void 0 : _item$interceptAddres.map(function (suffix) {
35
35
  return _this.addressDateInstance.getNameByCode(suffix);
36
36
  }).join('');
37
- return addressText || item.interceptDetail || item.interceptReceiverName || item.interceptReceiverMobile ? /*#__PURE__*/React.createElement("div", null, "\u5305\u88F9".concat(index + 1, ":"), addressText, item.interceptDetail, item.interceptReceiverName, item.interceptReceiverMobile) : '--';
37
+ return /*#__PURE__*/React.createElement("div", null, "\u5305\u88F9".concat(index + 1, ":"), addressText || item.interceptDetail || item.interceptReceiverName || item.interceptReceiverMobile ? /*#__PURE__*/React.createElement("div", null, addressText, item.interceptDetail, item.interceptReceiverName, item.interceptReceiverMobile) : "--");
38
38
  }));
39
39
  });
40
40
  _defineProperty(this, "renderClient", function () {
@@ -67,7 +67,7 @@ var Logistics = /*#__PURE__*/_createClass(function Logistics(options) {
67
67
  }).join("");
68
68
  return /*#__PURE__*/React.createElement("div", null, list.length > 1 ? "\u5305\u88F9".concat(index + 1, ":") : "", item.interceptCompany ? /*#__PURE__*/React.createElement("div", null, "\u7269\u6D41\u516C\u53F8\uFF1A", _this.expressDateInstance.getExpressNameByCode(item.interceptCompany) || item.interceptCompany) : null, item.interceptCode ? /*#__PURE__*/React.createElement("div", null, "\u7269\u6D41\u5355\u53F7\uFF1A", /*#__PURE__*/React.createElement(CopyText, {
69
69
  text: item.interceptCode
70
- })) : null, (_item$interceptAddres = item.interceptAddress) !== null && _item$interceptAddres !== void 0 && _item$interceptAddres.length || item.interceptDetail || item.interceptReceiverName || item.interceptReceiverMobile ? /*#__PURE__*/React.createElement("div", null, "\u6D3E\u4EF6\u4FE1\u606F\uFF1A", addressText, item.interceptDetail, " ", item.interceptReceiverName, " ", item.interceptReceiverMobile) : null, item.interceptType ? /*#__PURE__*/React.createElement("div", null, "\u62E6\u622A\u7C7B\u578B\uFF1A", _this.expressInterceptInstance.getTypeNameMap()[item.interceptType]) : null, item.interceptLogisticsStatus ? /*#__PURE__*/React.createElement("div", null, "\u7269\u6D41\u72B6\u6001\uFF1A", (_this$expressIntercep = _this.expressInterceptInstance.getStatusNameMap()) === null || _this$expressIntercep === void 0 ? void 0 : _this$expressIntercep[item.interceptLogisticsStatus], /*#__PURE__*/React.createElement(QueryLogisticsTrack, {
70
+ })) : null, (_item$interceptAddres = item.interceptAddress) !== null && _item$interceptAddres !== void 0 && _item$interceptAddres.length || item.interceptDetail || item.interceptReceiverName || item.interceptReceiverMobile ? /*#__PURE__*/React.createElement("div", null, "\u6D3E\u4EF6\u4FE1\u606F\uFF1A", addressText, item.interceptDetail, " ", item.interceptReceiverName, item.interceptReceiverMobile) : null, item.interceptType ? /*#__PURE__*/React.createElement("div", null, "\u62E6\u622A\u7C7B\u578B\uFF1A", _this.expressInterceptInstance.getTypeNameMap()[item.interceptType]) : null, item.interceptLogisticsStatus ? /*#__PURE__*/React.createElement("div", null, "\u7269\u6D41\u72B6\u6001\uFF1A", (_this$expressIntercep = _this.expressInterceptInstance.getStatusNameMap()) === null || _this$expressIntercep === void 0 ? void 0 : _this$expressIntercep[item.interceptLogisticsStatus], /*#__PURE__*/React.createElement(QueryLogisticsTrack, {
71
71
  modelWidth: 500,
72
72
  interceptCompany: item.interceptCompany,
73
73
  interceptCode: item.interceptCode,
@@ -28,7 +28,7 @@ var InterceptSnapshot = /*#__PURE__*/_createClass(function InterceptSnapshot(opt
28
28
  _defineProperty(this, "renderSnapshot", function (record) {
29
29
  var snapshotList = record[_this.id] || [];
30
30
  return /*#__PURE__*/React.createElement(React.Fragment, null, snapshotList.map(function (item, index) {
31
- return /*#__PURE__*/React.createElement("div", null, "\u5305\u88F9".concat(index + 1, ":"), item);
31
+ return /*#__PURE__*/React.createElement("div", null, "\u5305\u88F9".concat(index + 1, ":"), item ? item : "--");
32
32
  }));
33
33
  });
34
34
  _defineProperty(this, "getComponentValue", function (r) {
@@ -19,22 +19,27 @@ import { SYMBOL } from "../../constant";
19
19
  var typeMap = {
20
20
  MSG_STATUS: {
21
21
  options: [{
22
+ oldValue: '发送成功',
22
23
  value: '执行成功',
23
24
  label: '执行成功',
24
25
  color: '#52c41a'
25
26
  }, {
27
+ oldValue: '已发送',
26
28
  value: '执行中',
27
29
  label: '执行中',
28
30
  color: '#52c41a'
29
31
  }, {
32
+ oldValue: '发送失败',
30
33
  value: '执行失败',
31
34
  label: '执行失败',
32
35
  color: '#ff4d4f'
33
36
  }, {
37
+ oldValue: '等待发送',
34
38
  value: '等待执行',
35
39
  label: '等待执行',
36
40
  color: '#e7780f'
37
41
  }, {
42
+ oldValue: '等待发送',
38
43
  value: '不满足条件,无需执行',
39
44
  label: '不满足条件,无需执行',
40
45
  color: '#8A8A8A'
@@ -45,7 +50,8 @@ var typeMap = {
45
50
  type: 1,
46
51
  valueKey: 'status',
47
52
  idKey: 'systemOrderId',
48
- failValue: '发送失败'
53
+ // 添加 发送失败 是为了兼容老数据
54
+ failValue: ['执行失败', '发送失败']
49
55
  }
50
56
  };
51
57
  var msgTypeCh = {
@@ -21,6 +21,7 @@ import BsHeaderChild from "../BS/common/BsHeaderChild";
21
21
  import GetFormItem from "../GetFormItem";
22
22
  import ItemView from "../../commonComponents/ItemView";
23
23
  import { isNull } from "@kmkf-fe-packages/kmkf-utils";
24
+ import { difference } from 'lodash';
24
25
  import { SYMBOL } from "../../constant";
25
26
  var SubForm = /*#__PURE__*/_createClass(function SubForm(options) {
26
27
  var _this = this;
@@ -160,9 +161,22 @@ var SubForm = /*#__PURE__*/_createClass(function SubForm(options) {
160
161
  }
161
162
  return prv;
162
163
  }, {});
163
- var msg = (value || []).reduce(function (prv, next) {
164
+ // TODO: 补充确省字段
165
+ var fillKeysValue = value === null || value === void 0 ? void 0 : value.map(function (item) {
166
+ var _this$componentConfig11, _this$componentConfig12;
167
+ var lostKeys = difference((_this$componentConfig11 = _this.componentConfig) === null || _this$componentConfig11 === void 0 ? void 0 : (_this$componentConfig12 = _this$componentConfig11.tableHeader) === null || _this$componentConfig12 === void 0 ? void 0 : _this$componentConfig12.map(function (item) {
168
+ return item.key;
169
+ }), Object.keys(item));
170
+ if (!isNull(lostKeys)) {
171
+ return lostKeys.reduce(function (prv, next) {
172
+ return _objectSpread(_objectSpread({}, prv), {}, _defineProperty({}, next, undefined));
173
+ }, item);
174
+ }
175
+ return item;
176
+ });
177
+ var msg = (fillKeysValue || []).reduce(function (prv, next) {
164
178
  Object.keys(next).forEach(function (key) {
165
- if (result[key] && !next[key]) {
179
+ if (result[key] && isNull(next[key])) {
166
180
  prv = result[key];
167
181
  }
168
182
  });
@@ -48,7 +48,7 @@ export interface ComponentInterface {
48
48
  width?: number;
49
49
  align?: ALignType;
50
50
  dataType: "string" | "number" | "boolean" | "array" | "range" | "object";
51
- format?: "dateTime" | "date" | "time" | "cascader" | "shopInput" | "staffGroup";
51
+ format?: "dateTime" | "date" | "time" | "cascader" | "shopInput" | "staffGroup" | "object";
52
52
  options?: Array<any>;
53
53
  templateId?: string;
54
54
  flowTemplateKey?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kmkf-fe-packages/services-components",
3
- "version": "1.17.8-beta.0",
3
+ "version": "1.17.8-beta.10",
4
4
  "module": "dist/esm/index.js",
5
5
  "typings": "dist/esm/index.d.ts",
6
6
  "files": [
@@ -21,8 +21,8 @@
21
21
  ]
22
22
  },
23
23
  "dependencies": {
24
- "@kmkf-fe-packages/basic-components": "1.17.8-beta.0",
25
- "@kmkf-fe-packages/kmkf-utils": "1.17.8-beta.0",
24
+ "@kmkf-fe-packages/basic-components": "1.17.8-beta.4",
25
+ "@kmkf-fe-packages/kmkf-utils": "1.17.8-beta.4",
26
26
  "b64-to-blob": "^1.2.19",
27
27
  "html2canvas": "^1.4.1",
28
28
  "react-pdf-js": "^5.1.0"
@@ -41,7 +41,7 @@
41
41
  "publishConfig": {
42
42
  "access": "public"
43
43
  },
44
- "gitHead": "9ea02095293fdcb64d6537a00710cced14554c31",
44
+ "gitHead": "3ff026325ed771f6757a133231383a57c4b72213",
45
45
  "gitHooks": {
46
46
  "pre-commit": "lint-staged"
47
47
  }