@kmkf-fe-packages/services-components 0.11.0-alpha.6 → 0.11.0-alpha.8

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.
@@ -48,7 +48,6 @@ var Express = /*#__PURE__*/_createClass(function Express(options) {
48
48
  });
49
49
  _defineProperty(this, "renderPc", function (value, record) {
50
50
  var _typeMap$_this$type, _typeMap$_this$type2;
51
- console.log(_this.type);
52
51
  var _this$id$split = _this.id.split("_"),
53
52
  _this$id$split2 = _slicedToArray(_this$id$split, 3),
54
53
  key = _this$id$split2[0],
@@ -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 CommonSystemOrder 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;
@@ -6,42 +6,42 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
6
6
  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; }
7
7
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
8
8
  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); }
9
- import React from 'react';
10
- import some from 'lodash/some';
9
+ import React from "react";
10
+ import some from "lodash/some";
11
11
  import GetFormItem from "../GetFormItem";
12
12
  import { CommonOrderContent } from "../Common";
13
- import { CommonSystemOrder as SystemOrder } from '@kmkf-fe-packages/basic-components';
13
+ import { CommonSystemOrder as SystemOrder } from "@kmkf-fe-packages/basic-components";
14
14
  import ItemView from "../../commonComponents/ItemView";
15
- import { isNull, filterFn as _filterFn } from '@kmkf-fe-packages/kmkf-utils';
15
+ import { isNull, filterFn as _filterFn } from "@kmkf-fe-packages/kmkf-utils";
16
16
  import { SYMBOL } from "../../constant";
17
17
  var typeMap = {
18
18
  BS_DELIVERY_NO: {
19
- key: 'deliveryNoList',
20
- code: 'deliveryNoIds',
21
- name: '出库单',
19
+ key: "deliveryNoList",
20
+ code: "deliveryNoIds",
21
+ name: "出库单",
22
22
  type: 1,
23
- valueKey: 'deliveryNo'
23
+ valueKey: "deliveryNo"
24
24
  },
25
25
  RETURN_GOODS_TRADE_ID: {
26
- key: 'returnGoodsTradeItemList',
27
- code: 'returnGoodsTradeIdList',
28
- name: '退货单id',
26
+ key: "returnGoodsTradeItemList",
27
+ code: "returnGoodsTradeIdList",
28
+ name: "退货单id",
29
29
  type: 2,
30
- valueKey: 'returnGoodsTradeId'
30
+ valueKey: "returnGoodsTradeId"
31
31
  },
32
32
  REISSUE_TRADE_ID: {
33
- key: 'tradeItemList',
34
- code: 'tradeIdList',
35
- name: '补发单id',
33
+ key: "tradeItemList",
34
+ code: "tradeIdList",
35
+ name: "补发单id",
36
36
  type: 3,
37
- valueKey: 'billNo'
37
+ valueKey: "billNo"
38
38
  },
39
39
  EXCHANGE_TRADE_ID: {
40
- key: 'tradeItemList',
41
- code: 'tradeIdList',
42
- name: '换货单id',
40
+ key: "tradeItemList",
41
+ code: "tradeIdList",
42
+ name: "换货单id",
43
43
  type: 4,
44
- valueKey: 'billNo'
44
+ valueKey: "billNo"
45
45
  }
46
46
  };
47
47
  var CommonSystemOrder = /*#__PURE__*/_createClass(function CommonSystemOrder(options) {
@@ -63,8 +63,7 @@ var CommonSystemOrder = /*#__PURE__*/_createClass(function CommonSystemOrder(opt
63
63
  _defineProperty(this, "children", void 0);
64
64
  _defineProperty(this, "dataType", void 0);
65
65
  _defineProperty(this, "renderClient", function (record) {
66
- var _typeMap$_this$type, _typeMap$_this$type2;
67
- var list = record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_").concat((_typeMap$_this$type = typeMap[_this.type]) === null || _typeMap$_this$type === void 0 ? void 0 : _typeMap$_this$type.key)];
66
+ var _typeMap$_this$type;
68
67
  var isShow = Array.isArray(record === null || record === void 0 ? void 0 : record[_this.id]) ? some(record === null || record === void 0 ? void 0 : record[_this.id], function (item) {
69
68
  return !isNull(item);
70
69
  }) : false;
@@ -73,13 +72,13 @@ var CommonSystemOrder = /*#__PURE__*/_createClass(function CommonSystemOrder(opt
73
72
  label: _this.name,
74
73
  value: /*#__PURE__*/React.createElement(CommonOrderContent, {
75
74
  list: record === null || record === void 0 ? void 0 : record[_this.id],
76
- valueKey: (_typeMap$_this$type2 = typeMap[_this.type]) === null || _typeMap$_this$type2 === void 0 ? void 0 : _typeMap$_this$type2.valueKey
75
+ valueKey: (_typeMap$_this$type = typeMap[_this.type]) === null || _typeMap$_this$type === void 0 ? void 0 : _typeMap$_this$type.valueKey
77
76
  })
78
77
  }) : null;
79
78
  });
80
79
  _defineProperty(this, "renderPc", function (value, record) {
81
- var _typeMap$_this$type3, _typeMap$_this$type4, _typeMap$_this$type5;
82
- var list = record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_").concat((_typeMap$_this$type3 = typeMap[_this.type]) === null || _typeMap$_this$type3 === void 0 ? void 0 : _typeMap$_this$type3.key)];
80
+ var _typeMap$_this$type2, _typeMap$_this$type3, _typeMap$_this$type4;
81
+ var list = record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_").concat((_typeMap$_this$type2 = typeMap[_this.type]) === null || _typeMap$_this$type2 === void 0 ? void 0 : _typeMap$_this$type2.key)];
83
82
  //兼容多个商品
84
83
  return /*#__PURE__*/React.createElement("span", {
85
84
  onClick: function onClick(e) {
@@ -87,30 +86,30 @@ var CommonSystemOrder = /*#__PURE__*/_createClass(function CommonSystemOrder(opt
87
86
  }
88
87
  }, /*#__PURE__*/React.createElement(CommonOrderContent, {
89
88
  list: list,
90
- type: (_typeMap$_this$type4 = typeMap[_this.type]) === null || _typeMap$_this$type4 === void 0 ? void 0 : _typeMap$_this$type4.type,
91
- valueKey: (_typeMap$_this$type5 = typeMap[_this.type]) === null || _typeMap$_this$type5 === void 0 ? void 0 : _typeMap$_this$type5.valueKey
89
+ type: (_typeMap$_this$type3 = typeMap[_this.type]) === null || _typeMap$_this$type3 === void 0 ? void 0 : _typeMap$_this$type3.type,
90
+ valueKey: (_typeMap$_this$type4 = typeMap[_this.type]) === null || _typeMap$_this$type4 === void 0 ? void 0 : _typeMap$_this$type4.valueKey
92
91
  }));
93
92
  });
94
93
  _defineProperty(this, "renderLog", function (r) {
95
- var _typeMap$_this$type6;
96
- var list = r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_").concat((_typeMap$_this$type6 = typeMap[_this.type]) === null || _typeMap$_this$type6 === void 0 ? void 0 : _typeMap$_this$type6.key)];
94
+ var _typeMap$_this$type5;
95
+ var list = r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_").concat((_typeMap$_this$type5 = typeMap[_this.type]) === null || _typeMap$_this$type5 === void 0 ? void 0 : _typeMap$_this$type5.key)];
97
96
  if (isNull(list)) return null;
98
97
  return _this.renderPc(undefined, r);
99
98
  });
100
99
  _defineProperty(this, "getComponentValue", function (r) {
101
- var _typeMap$_this$type7;
102
- return r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_").concat((_typeMap$_this$type7 = typeMap[_this.type]) === null || _typeMap$_this$type7 === void 0 ? void 0 : _typeMap$_this$type7.key)];
100
+ var _typeMap$_this$type6;
101
+ return r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_").concat((_typeMap$_this$type6 = typeMap[_this.type]) === null || _typeMap$_this$type6 === void 0 ? void 0 : _typeMap$_this$type6.key)];
103
102
  });
104
103
  _defineProperty(this, "renderExport", function (value, record) {
105
- var _typeMap$_this$type8;
106
- var list = record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_").concat((_typeMap$_this$type8 = typeMap[_this.type]) === null || _typeMap$_this$type8 === void 0 ? void 0 : _typeMap$_this$type8.key)];
104
+ var _typeMap$_this$type7;
105
+ var list = record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_").concat((_typeMap$_this$type7 = typeMap[_this.type]) === null || _typeMap$_this$type7 === void 0 ? void 0 : _typeMap$_this$type7.key)];
107
106
  return (list || []).map(function (item) {
108
- var _typeMap$_this$type9;
109
- return item === null || item === void 0 ? void 0 : item[(_typeMap$_this$type9 = typeMap[_this.type]) === null || _typeMap$_this$type9 === void 0 ? void 0 : _typeMap$_this$type9.valueKey];
110
- }).join(',');
107
+ var _typeMap$_this$type8;
108
+ return item === null || item === void 0 ? void 0 : item[(_typeMap$_this$type8 = typeMap[_this.type]) === null || _typeMap$_this$type8 === void 0 ? void 0 : _typeMap$_this$type8.valueKey];
109
+ }).join(",");
111
110
  });
112
111
  _defineProperty(this, "editRender", function (p) {
113
- var _this$componentConfig, _this$componentConfig2, _typeMap$_this$type10;
112
+ var _this$componentConfig, _this$componentConfig2, _typeMap$_this$type9;
114
113
  return /*#__PURE__*/React.createElement(GetFormItem, {
115
114
  title: _this.name,
116
115
  name: _this.id,
@@ -118,22 +117,22 @@ var CommonSystemOrder = /*#__PURE__*/_createClass(function CommonSystemOrder(opt
118
117
  hidden: p === null || p === void 0 ? void 0 : p.hidden,
119
118
  required: (_this$componentConfig = (_this$componentConfig2 = _this.componentConfig) === null || _this$componentConfig2 === void 0 ? void 0 : _this$componentConfig2.required) !== null && _this$componentConfig !== void 0 ? _this$componentConfig : false,
120
119
  component: /*#__PURE__*/React.createElement(SystemOrder, _extends({}, _this.componentConfig, {
121
- type: (_typeMap$_this$type10 = typeMap[_this.type]) === null || _typeMap$_this$type10 === void 0 ? void 0 : _typeMap$_this$type10.type
120
+ type: (_typeMap$_this$type9 = typeMap[_this.type]) === null || _typeMap$_this$type9 === void 0 ? void 0 : _typeMap$_this$type9.type
122
121
  }))
123
122
  });
124
123
  });
125
124
  _defineProperty(this, "filterConfig", function (item) {
126
- var _typeMap$_this$type11;
125
+ var _typeMap$_this$type10;
127
126
  return {
128
127
  searchDefaultConditions: SYMBOL.like,
129
128
  type: item.type,
130
- id: "".concat(item.id, "_").concat((_typeMap$_this$type11 = typeMap[_this.type]) === null || _typeMap$_this$type11 === void 0 ? void 0 : _typeMap$_this$type11.code),
129
+ id: "".concat(item.id, "_").concat((_typeMap$_this$type10 = typeMap[_this.type]) === null || _typeMap$_this$type10 === void 0 ? void 0 : _typeMap$_this$type10.code),
131
130
  name: "".concat(_this.name),
132
- filterComponentType: 'Input',
131
+ filterComponentType: "Input",
133
132
  filterFn: function filterFn(value) {
134
133
  return function (i) {
135
- var _typeMap$_this$type12;
136
- return _filterFn.filterSplitComma(_filterFn.filterTableListItemColumnValue(i, item.id, (_typeMap$_this$type12 = typeMap[_this.type]) === null || _typeMap$_this$type12 === void 0 ? void 0 : _typeMap$_this$type12.code), value);
134
+ var _typeMap$_this$type11;
135
+ return _filterFn.filterSplitComma(_filterFn.filterTableListItemColumnValue(i, item.id, (_typeMap$_this$type11 = typeMap[_this.type]) === null || _typeMap$_this$type11 === void 0 ? void 0 : _typeMap$_this$type11.code), value);
137
136
  };
138
137
  }
139
138
  };
@@ -147,21 +146,21 @@ var CommonSystemOrder = /*#__PURE__*/_createClass(function CommonSystemOrder(opt
147
146
  this.isCombinationComponent = false;
148
147
  this.canSort = false;
149
148
  this.children = [];
150
- this.dataType = 'object';
149
+ this.dataType = "object";
151
150
  this.rules = (_this$componentConfig3 = this.componentConfig) !== null && _this$componentConfig3 !== void 0 && _this$componentConfig3.required ? [{
152
151
  required: true,
153
152
  validator: function validator(_, value) {
154
153
  var hasNo = (value || []).some(function (item) {
155
- var _typeMap$_this$type13;
156
- return item[(_typeMap$_this$type13 = typeMap[_this.type]) === null || _typeMap$_this$type13 === void 0 ? void 0 : _typeMap$_this$type13.valueKey];
154
+ var _typeMap$_this$type12;
155
+ return item[(_typeMap$_this$type12 = typeMap[_this.type]) === null || _typeMap$_this$type12 === void 0 ? void 0 : _typeMap$_this$type12.valueKey];
157
156
  });
158
157
  if (!hasNo) {
159
- var _typeMap$_this$type14;
160
- return Promise.reject(new Error("\u81F3\u5C11\u586B\u5199\u4E00\u4E2A\u5B8C\u6574\u7684".concat((_typeMap$_this$type14 = typeMap[_this.type]) === null || _typeMap$_this$type14 === void 0 ? void 0 : _typeMap$_this$type14.name)));
158
+ var _typeMap$_this$type13;
159
+ return Promise.reject(new Error("\u81F3\u5C11\u586B\u5199\u4E00\u4E2A\u5B8C\u6574\u7684".concat((_typeMap$_this$type13 = typeMap[_this.type]) === null || _typeMap$_this$type13 === void 0 ? void 0 : _typeMap$_this$type13.name)));
161
160
  }
162
161
  return Promise.resolve();
163
162
  }
164
163
  }] : [];
165
- this.align = 'left';
164
+ this.align = "left";
166
165
  });
167
166
  export default CommonSystemOrder;
@@ -34,12 +34,12 @@ var WlnGoods = /*#__PURE__*/_createClass(function WlnGoods(options) {
34
34
  _defineProperty(this, "dataType", void 0);
35
35
  _defineProperty(this, "wlnGoods", void 0);
36
36
  _defineProperty(this, "renderClient", function (record) {
37
- var _this$componentConfig;
37
+ var _record, _this$componentConfig;
38
38
  return !isNull(record === null || record === void 0 ? void 0 : record["".concat(_this.id)]) ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ItemView, {
39
39
  id: _this.id,
40
40
  label: _this.name,
41
41
  value: /*#__PURE__*/React.createElement(BsGoodsTable, {
42
- list: (record === null || record === void 0 ? void 0 : record["".concat(_this.id)]) || [],
42
+ list: (record === null || record === void 0 ? void 0 : (_record = record["".concat(_this.id)]) === null || _record === void 0 ? void 0 : _record.wlnGoods) || [],
43
43
  showHeader: ((_this$componentConfig = _this.componentConfig) === null || _this$componentConfig === void 0 ? void 0 : _this$componentConfig.showHeader) || []
44
44
  })
45
45
  })) : null;
@@ -106,7 +106,8 @@ var WlnGoods = /*#__PURE__*/_createClass(function WlnGoods(options) {
106
106
  this.rules = this !== null && this !== void 0 && (_this$componentConfig4 = this.componentConfig) !== null && _this$componentConfig4 !== void 0 && _this$componentConfig4.required ? [{
107
107
  required: true,
108
108
  validator: function validator(_, value) {
109
- if (!(value !== null && value !== void 0 && value.length)) {
109
+ var _value$wlnGoods;
110
+ if (!value || !(value !== null && value !== void 0 && (_value$wlnGoods = value.wlnGoods) !== null && _value$wlnGoods !== void 0 && _value$wlnGoods.length)) {
110
111
  return Promise.reject(new Error("请选择万里牛商品"));
111
112
  }
112
113
  return Promise.resolve();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kmkf-fe-packages/services-components",
3
- "version": "0.11.0-alpha.6",
3
+ "version": "0.11.0-alpha.8",
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.0-alpha.6",
30
- "@kmkf-fe-packages/kmkf-utils": "^0.11.0-alpha.6"
29
+ "@kmkf-fe-packages/basic-components": "^0.11.0-alpha.8",
30
+ "@kmkf-fe-packages/kmkf-utils": "^0.11.0-alpha.8"
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": "0adcbcc7315425a79695d2d2af0ca3d884c9776e"
43
+ "gitHead": "5157803be30a86d0fe89ab8da2fe2ccb6bda63df"
44
44
  }