@kmkf-fe-packages/services-components 2.2.24 → 2.2.25

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.
@@ -12,7 +12,7 @@ import React from "react";
12
12
  import GetFormItem from "../../GetFormItem";
13
13
  import ItemView from "../../../commonComponents/ItemView";
14
14
  import { isNull, filterFn as _filterFn } from "@kmkf-fe-packages/kmkf-utils";
15
- import { WdtReissue as Reissue } from "@kmkf-fe-packages/basic-components";
15
+ import { WdtReissue as Reissue, erpFormValidator } from "@kmkf-fe-packages/basic-components";
16
16
  import { SYMBOL } from "../../../constant";
17
17
  import { BsGoodsTable } from "../../Common/index";
18
18
  import { BsType, BsMemo, BsHeaderGood, SystemOrderNo } from "../../BS/common/index";
@@ -24,7 +24,15 @@ var typeMap = {
24
24
  typeName: "wdtReissueType",
25
25
  remark: "wdtReissueType_memo",
26
26
  systemOrderNo: "wdtSystemOrderNo",
27
- errMsg: "请选择旺店通补发商品"
27
+ errMsg: "请选择旺店通补发商品",
28
+ validator: function validator(_rule, value, type) {
29
+ if (!_rule.required) return Promise.resolve();
30
+ var validatorFlag = erpFormValidator(_rule, value, type);
31
+ if (validatorFlag) {
32
+ return validatorFlag;
33
+ }
34
+ return Promise.resolve();
35
+ }
28
36
  }
29
37
  };
30
38
  var WdtReissue = /*#__PURE__*/_createClass(function WdtReissue(options) {
@@ -95,7 +103,7 @@ var WdtReissue = /*#__PURE__*/_createClass(function WdtReissue(options) {
95
103
  required: false,
96
104
  hidden: p === null || p === void 0 ? void 0 : p.hidden,
97
105
  display: p === null || p === void 0 ? void 0 : p.display,
98
- tooltip: (_this$componentConfig3 = _this.componentConfig) !== null && _this$componentConfig3 !== void 0 && _this$componentConfig3.showTooltip ? (_this$componentConfig4 = _this.componentConfig) === null || _this$componentConfig4 === void 0 ? void 0 : _this$componentConfig4.tooltip : '',
106
+ tooltip: (_this$componentConfig3 = _this.componentConfig) !== null && _this$componentConfig3 !== void 0 && _this$componentConfig3.showTooltip ? (_this$componentConfig4 = _this.componentConfig) === null || _this$componentConfig4 === void 0 ? void 0 : _this$componentConfig4.tooltip : "",
99
107
  component: /*#__PURE__*/React.createElement(Reissue, _extends({}, _this.componentConfig, {
100
108
  maxLength: ((_this$componentConfig5 = _this.componentConfig) === null || _this$componentConfig5 === void 0 ? void 0 : _this$componentConfig5.maxLength) || 20,
101
109
  shopId: (_this$effects = _this.effects) === null || _this$effects === void 0 ? void 0 : _this$effects.shopId,
@@ -176,8 +184,9 @@ var WdtReissue = /*#__PURE__*/_createClass(function WdtReissue(options) {
176
184
  }));
177
185
  this.children = [this.bsType, this.systemOrderNo, this.bsMemo, this.reissueGoods];
178
186
  this.componentConfig = options === null || options === void 0 ? void 0 : options.componentConfig;
179
- this.rules = this !== null && this !== void 0 && (_this$componentConfig6 = this.componentConfig) !== null && _this$componentConfig6 !== void 0 && _this$componentConfig6.required ? [{
180
- required: true,
187
+ var isRequired = this === null || this === void 0 ? void 0 : (_this$componentConfig6 = this.componentConfig) === null || _this$componentConfig6 === void 0 ? void 0 : _this$componentConfig6.required;
188
+ this.rules = [{
189
+ required: isRequired,
181
190
  validator: function validator(_, value) {
182
191
  var _value, _typeMap$options$type6;
183
192
  if (!value || !(value !== null && value !== void 0 && (_value = value["".concat((_typeMap$options$type6 = typeMap[options.type]) === null || _typeMap$options$type6 === void 0 ? void 0 : _typeMap$options$type6.key)]) !== null && _value !== void 0 && _value.length)) {
@@ -186,7 +195,15 @@ var WdtReissue = /*#__PURE__*/_createClass(function WdtReissue(options) {
186
195
  }
187
196
  return Promise.resolve();
188
197
  }
189
- }] : [];
198
+ }, {
199
+ required: isRequired,
200
+ validator: function validator(_rule, value) {
201
+ var _typeMap$options$type8, _typeMap$options$type9;
202
+ return ((_typeMap$options$type8 = typeMap[options.type]) === null || _typeMap$options$type8 === void 0 ? void 0 : (_typeMap$options$type9 = _typeMap$options$type8.validator) === null || _typeMap$options$type9 === void 0 ? void 0 : _typeMap$options$type9.call(_typeMap$options$type8, _rule, value, options.type)) || function () {
203
+ return Promise.resolve();
204
+ };
205
+ }
206
+ }];
190
207
  this.dataType = "object";
191
208
  });
192
209
  export default WdtReissue;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kmkf-fe-packages/services-components",
3
- "version": "2.2.24",
3
+ "version": "2.2.25",
4
4
  "module": "dist/esm/index.js",
5
5
  "typings": "dist/esm/index.d.ts",
6
6
  "files": [
@@ -21,7 +21,7 @@
21
21
  ]
22
22
  },
23
23
  "dependencies": {
24
- "@kmkf-fe-packages/basic-components": "2.2.24",
24
+ "@kmkf-fe-packages/basic-components": "2.2.25",
25
25
  "@kmkf-fe-packages/kmkf-utils": "2.2.24",
26
26
  "b64-to-blob": "^1.2.19",
27
27
  "html2canvas": "^1.4.1",
@@ -41,7 +41,7 @@
41
41
  "publishConfig": {
42
42
  "access": "public"
43
43
  },
44
- "gitHead": "35bc1e4833e1bcb1255c9c43cb3c807d2544e88c",
44
+ "gitHead": "eb88c3c93e2a120ed15b41688edff56c7faaf043",
45
45
  "gitHooks": {
46
46
  "pre-commit": "lint-staged"
47
47
  }