@kmkf-fe-packages/services-components 0.11.1 → 0.12.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.
@@ -8,7 +8,7 @@ import React from "react";
8
8
  import { factory } from "@kmkf-fe-packages/services-components";
9
9
  import { isNull } from "@kmkf-fe-packages/kmkf-utils";
10
10
  export var unTransField = function unTransField(key) {
11
- return ["itemList", "jstItemList", "dateTime", "basicMultSelect", "checkbox", "multSelect", "rate", "picture"].reduce(function (cur, nxt) {
11
+ return ["itemList", "jstItemList", "dateTime", "basicMultSelect", "checkbox", "multSelect", "rate", "picture", "file", "bsSendGood", "bsGoods", "bsExchangeType", "bsExchangeReturnGoods", "bsExchangeSwapOutGoods", "bsExchangeGiftGoods", "bsReissueType", "bsReissueGoods", "bsReturnGoods", "bsReturnType", "bsLogisticsList", "bsSystemShowOrder", "bsSystemSelectIds", "reissueLogisticsList", "deliveryNoList", "returnGoodsStatusList", "returnGoodsTradeIdList", "returnGoodsTradeItemList", "tradeIdList", "tradeItemList", "wlnLogisticsList", "wlnSystemShowOrder", "wlnSystemSelectIds", "wlnGoods", "wlnSendGood", "bsExchangeReason"].reduce(function (cur, nxt) {
12
12
  return cur || (key === null || key === void 0 ? void 0 : key.includes(nxt));
13
13
  }, false);
14
14
  };
@@ -92,6 +92,7 @@ var OperationLog = function OperationLog(_ref) {
92
92
  }, /*#__PURE__*/React.createElement("span", {
93
93
  style: {
94
94
  maxWidth: "66px",
95
+ minWidth: "50px",
95
96
  marginRight: "8px",
96
97
  flexShrink: 1
97
98
  }
@@ -22,7 +22,7 @@ declare class BsExchange implements ComponentInterface {
22
22
  constructor(options: PickOption);
23
23
  renderClient: (record: any) => React.JSX.Element | null;
24
24
  renderPc: () => null;
25
- renderLog: (r: Record) => null;
25
+ renderLog: (r: Record) => React.JSX.Element;
26
26
  getComponentValue: (r: Record) => any;
27
27
  renderExport: (value: any, record: any) => null;
28
28
  editRender: (p: any) => React.JSX.Element;
@@ -67,7 +67,17 @@ var BsExchange = /*#__PURE__*/_createClass(function BsExchange(options) {
67
67
  return null;
68
68
  });
69
69
  _defineProperty(this, "renderLog", function (r) {
70
- return null;
70
+ var _this$componentConfig4, _this$componentConfig5, _r, _this$componentConfig6;
71
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", null, "\u5907\u6CE8\u7C7B\u578B:", _this.bsType.renderLog(r)), /*#__PURE__*/React.createElement("div", null, "\u5907\u6CE8\u4FE1\u606F:", _this.bsMemo.renderLog(r)), /*#__PURE__*/React.createElement("div", null, "\u9000\u56DE\u5546\u54C1\uFF1A", /*#__PURE__*/React.createElement(BsGoodsTable, {
72
+ list: (r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_bsExchangeReturnGoods")]) || [],
73
+ showHeader: ((_this$componentConfig4 = _this.componentConfig) === null || _this$componentConfig4 === void 0 ? void 0 : _this$componentConfig4.showHeader) || []
74
+ })), /*#__PURE__*/React.createElement("div", null, "\u6362\u51FA\u5546\u54C1\uFF1A", /*#__PURE__*/React.createElement(BsGoodsTable, {
75
+ list: (r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_bsExchangeSwapOutGoods")]) || [],
76
+ showHeader: ((_this$componentConfig5 = _this.componentConfig) === null || _this$componentConfig5 === void 0 ? void 0 : _this$componentConfig5.showHeader) || []
77
+ })), r !== null && r !== void 0 && (_r = r["".concat(_this.id, "_bsExchangeGiftGoods")]) !== null && _r !== void 0 && _r.length ? /*#__PURE__*/React.createElement("div", null, "\u8D60\u54C1\uFF1A", /*#__PURE__*/React.createElement(BsGoodsTable, {
78
+ list: (r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_bsExchangeGiftGoods")]) || [],
79
+ showHeader: ((_this$componentConfig6 = _this.componentConfig) === null || _this$componentConfig6 === void 0 ? void 0 : _this$componentConfig6.showHeader) || []
80
+ })) : null);
71
81
  });
72
82
  _defineProperty(this, "getComponentValue", function (r) {
73
83
  return r === null || r === void 0 ? void 0 : r["".concat(_this.id)];
@@ -76,7 +86,7 @@ var BsExchange = /*#__PURE__*/_createClass(function BsExchange(options) {
76
86
  return null;
77
87
  });
78
88
  _defineProperty(this, "editRender", function (p) {
79
- var _this$componentConfig4, _this$effects, _this$effects2, _this$effects3;
89
+ var _this$componentConfig7, _this$effects, _this$effects2, _this$effects3;
80
90
  return /*#__PURE__*/React.createElement(GetFormItem, {
81
91
  title: _this.name,
82
92
  name: _this.id,
@@ -84,7 +94,7 @@ var BsExchange = /*#__PURE__*/_createClass(function BsExchange(options) {
84
94
  required: false,
85
95
  hidden: p === null || p === void 0 ? void 0 : p.hidden,
86
96
  component: /*#__PURE__*/React.createElement(Exchange, _extends({}, _this.componentConfig, {
87
- maxLength: ((_this$componentConfig4 = _this.componentConfig) === null || _this$componentConfig4 === void 0 ? void 0 : _this$componentConfig4.maxLength) || 20,
97
+ maxLength: ((_this$componentConfig7 = _this.componentConfig) === null || _this$componentConfig7 === void 0 ? void 0 : _this$componentConfig7.maxLength) || 20,
88
98
  shopId: (_this$effects = _this.effects) === null || _this$effects === void 0 ? void 0 : _this$effects.shopId,
89
99
  shopList: ((_this$effects2 = _this.effects) === null || _this$effects2 === void 0 ? void 0 : _this$effects2.shopList) || [],
90
100
  companyKey: (_this$effects3 = _this.effects) === null || _this$effects3 === void 0 ? void 0 : _this$effects3.companyKey,
@@ -165,8 +175,8 @@ var BsExchange = /*#__PURE__*/_createClass(function BsExchange(options) {
165
175
  this.componentConfig = options === null || options === void 0 ? void 0 : options.componentConfig;
166
176
  this.rules = [{
167
177
  validator: function validator(_, value) {
168
- var _this$componentConfig5, _value$bsExchangeRetu;
169
- if ((_this$componentConfig5 = _this.componentConfig) !== null && _this$componentConfig5 !== void 0 && _this$componentConfig5.required && !(value !== null && value !== void 0 && (_value$bsExchangeRetu = value.bsExchangeReturnGoods) !== null && _value$bsExchangeRetu !== void 0 && _value$bsExchangeRetu.length)) {
178
+ var _this$componentConfig8, _value$bsExchangeRetu;
179
+ if ((_this$componentConfig8 = _this.componentConfig) !== null && _this$componentConfig8 !== void 0 && _this$componentConfig8.required && !(value !== null && value !== void 0 && (_value$bsExchangeRetu = value.bsExchangeReturnGoods) !== null && _value$bsExchangeRetu !== void 0 && _value$bsExchangeRetu.length)) {
170
180
  return Promise.reject(new Error("请选择bs换货商品"));
171
181
  }
172
182
  return Promise.resolve();
@@ -51,7 +51,7 @@ var BsReissue = /*#__PURE__*/_createClass(function BsReissue(options) {
51
51
  });
52
52
  _defineProperty(this, "renderLog", function (r) {
53
53
  var _this$componentConfig2;
54
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", null, "\u5907\u6CE8\u7C7B\u578B:", _this.bsType.renderLog(r)), /*#__PURE__*/React.createElement("div", null, "\u5907\u6CE8\u4FE1\u606F:", _this.bsMemo.renderLog(r)), /*#__PURE__*/React.createElement("div", null, "\u5546\u54C1\uFF1A", /*#__PURE__*/React.createElement(BsGoodsTable, {
54
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", null, "\u5907\u6CE8\u7C7B\u578B:", _this.bsType.renderLog(r)), /*#__PURE__*/React.createElement("div", null, "\u5907\u6CE8\u4FE1\u606F:", _this.bsMemo.renderLog(r)), /*#__PURE__*/React.createElement("div", null, "\u8865\u53D1\u5546\u54C1\uFF1A", /*#__PURE__*/React.createElement(BsGoodsTable, {
55
55
  list: (r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_bsReissueGoods")]) || [],
56
56
  showHeader: ((_this$componentConfig2 = _this.componentConfig) === null || _this$componentConfig2 === void 0 ? void 0 : _this$componentConfig2.showHeader) || []
57
57
  })));
@@ -86,7 +86,7 @@ var BasicInput = /*#__PURE__*/_createClass(function BasicInput(options) {
86
86
  this.componentConfig = options.componentConfig;
87
87
  this.rules = [{
88
88
  validator: function validator(_, value) {
89
- var _this$componentConfig3, _this$componentConfig4, _this$componentConfig5;
89
+ var _this$componentConfig3, _this$componentConfig4, _this$componentConfig5, _this$componentConfig6, _this$componentConfig7;
90
90
  if (!value) {
91
91
  return Promise.resolve();
92
92
  }
@@ -103,24 +103,24 @@ var BasicInput = /*#__PURE__*/_createClass(function BasicInput(options) {
103
103
  if (testList.length && !isTest) {
104
104
  return Promise.reject(new Error("请填写正确的格式"));
105
105
  }
106
- // if (this.componentConfig?.rulesOptions?.length) {
107
- // const rulesList = this.componentConfig?.rulesOptions.filter(
108
- // (item: any) =>
109
- // (this.componentConfig?.selectRules || []).includes(item.id)
110
- // );
111
-
112
- // const hasRule = rulesList.some((item) => {
113
- // const reg = new RegExp(item.value);
114
- // return reg.test(value);
115
- // });
116
- // if (rulesList.length && !hasRule) {
117
- // const rulesItem = rulesList.find((item) => {
118
- // const reg = new RegExp(item.value);
119
- // return !reg.test(value);
120
- // });
121
- // return Promise.reject(new Error(rulesItem?.errorText));
122
- // }
123
- // }
106
+ if ((_this$componentConfig6 = _this.componentConfig) !== null && _this$componentConfig6 !== void 0 && (_this$componentConfig7 = _this$componentConfig6.rulesOptions) !== null && _this$componentConfig7 !== void 0 && _this$componentConfig7.length) {
107
+ var _this$componentConfig8;
108
+ var rulesList = (_this$componentConfig8 = _this.componentConfig) === null || _this$componentConfig8 === void 0 ? void 0 : _this$componentConfig8.rulesOptions.filter(function (item) {
109
+ var _this$componentConfig9;
110
+ return (((_this$componentConfig9 = _this.componentConfig) === null || _this$componentConfig9 === void 0 ? void 0 : _this$componentConfig9.selectRules) || []).includes(item.id);
111
+ });
112
+ var hasRule = rulesList.some(function (item) {
113
+ var reg = new RegExp(item.value);
114
+ return reg.test(value);
115
+ });
116
+ if (rulesList.length && !hasRule) {
117
+ var rulesItem = rulesList.find(function (item) {
118
+ var reg = new RegExp(item.value);
119
+ return !reg.test(value);
120
+ });
121
+ return Promise.reject(new Error(rulesItem === null || rulesItem === void 0 ? void 0 : rulesItem.errorText));
122
+ }
123
+ }
124
124
  return Promise.resolve();
125
125
  }
126
126
  }];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kmkf-fe-packages/services-components",
3
- "version": "0.11.1",
3
+ "version": "0.12.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.11.1",
30
- "@kmkf-fe-packages/kmkf-utils": "^0.11.1"
29
+ "@kmkf-fe-packages/basic-components": "^0.12.0-alpha.0",
30
+ "@kmkf-fe-packages/kmkf-utils": "^0.12.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": "de6620e377524975bf58e2eed4de23c464c87e83"
43
+ "gitHead": "9a0504b552aa6000b416f1bc4def20c7a635f738"
44
44
  }