@kmkf-fe-packages/services-components 0.11.0-alpha.3 → 0.11.0-alpha.5

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.
@@ -1,8 +1,8 @@
1
- import { ComponentInterface, PickOption, ColumnConfig, Record } from "../../../type";
2
- import React from "react";
3
- import { ExpressData } from "@kmkf-fe-packages/kmkf-utils";
4
- import ExpressCompany from "../common/expressCompany";
5
- import ExpressCode from "../common/expressCode";
1
+ import { ComponentInterface, PickOption, ColumnConfig, Record } from '../../../type';
2
+ import React from 'react';
3
+ import { ExpressData } from '@kmkf-fe-packages/kmkf-utils';
4
+ import ExpressCompany from '../common/expressCompany';
5
+ import ExpressCode from '../common/expressCode';
6
6
  declare class BsLogistics implements ComponentInterface {
7
7
  name: string;
8
8
  id: string;
@@ -15,13 +15,13 @@ declare class BsLogistics implements ComponentInterface {
15
15
  }[];
16
16
  type: string;
17
17
  rules: any[];
18
- componentConfig: ComponentInterface["componentConfig"];
18
+ componentConfig: ComponentInterface['componentConfig'];
19
19
  expressDateInstance: InstanceType<typeof ExpressData>;
20
20
  isCombinationComponent: boolean;
21
21
  formField: string;
22
22
  canSort: boolean;
23
23
  children: ComponentInterface[];
24
- dataType: ComponentInterface["dataType"];
24
+ dataType: ComponentInterface['dataType'];
25
25
  expressCompany: ExpressCompany;
26
26
  expressCode: ExpressCode;
27
27
  constructor(options: PickOption);
@@ -8,28 +8,28 @@ 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 { ExpressData } from "@kmkf-fe-packages/kmkf-utils";
13
- import some from "lodash/some";
11
+ import React from 'react';
12
+ import { ExpressData } from '@kmkf-fe-packages/kmkf-utils';
13
+ import some from 'lodash/some';
14
14
  import GetFormItem from "../../GetFormItem";
15
15
  import { JstGoodImage } from "../../Common";
16
- import { JstGoods } from "@kmkf-fe-packages/basic-components";
16
+ import { JstGoods } from '@kmkf-fe-packages/basic-components';
17
17
  import ItemView from "../../../commonComponents/ItemView";
18
- import { isNull } from "@kmkf-fe-packages/kmkf-utils";
18
+ import { isNull } from '@kmkf-fe-packages/kmkf-utils';
19
19
  import ExpressCompany from "../common/expressCompany";
20
20
  import ExpressCode from "../common/expressCode";
21
21
  var typeMap = {
22
22
  BS_LOGISTICS: {
23
- key: "bsLogisticsList",
24
- name: "bs",
25
- company: "bsLogisticsCompany",
26
- code: "bsLogisticsCode"
23
+ key: 'bsLogisticsList',
24
+ name: 'bs',
25
+ company: 'bsLogisticsCompany',
26
+ code: 'bsLogisticsCode'
27
27
  },
28
28
  WLN_LOGISTICS: {
29
- key: "wlnLogisticsList",
30
- name: "wln",
31
- company: "wlnLogisticsCompany",
32
- code: "wlnLogisticsCode"
29
+ key: 'wlnLogisticsList',
30
+ name: '万里牛',
31
+ company: 'wlnLogisticsCompany',
32
+ code: 'wlnLogisticsCode'
33
33
  }
34
34
  };
35
35
  var BsLogistics = /*#__PURE__*/_createClass(function BsLogistics(options) {
@@ -40,9 +40,11 @@ var BsLogistics = /*#__PURE__*/_createClass(function BsLogistics(options) {
40
40
  _typeMap$options$type4,
41
41
  _typeMap$options$type5,
42
42
  _typeMap$options$type6,
43
- _this$componentConfig3,
44
43
  _typeMap$options$type7,
45
- _typeMap$options$type8;
44
+ _typeMap$options$type8,
45
+ _this$componentConfig3,
46
+ _typeMap$options$type9,
47
+ _typeMap$options$type10;
46
48
  _classCallCheck(this, BsLogistics);
47
49
  _defineProperty(this, "name", void 0);
48
50
  _defineProperty(this, "id", void 0);
@@ -129,17 +131,19 @@ var BsLogistics = /*#__PURE__*/_createClass(function BsLogistics(options) {
129
131
  this.isCombinationComponent = true;
130
132
  this.canSort = false;
131
133
  this.expressCompany = new ExpressCompany(_objectSpread(_objectSpread({}, options), {}, {
132
- name: "物流公司",
133
- id: "".concat(options.id, "_").concat((_typeMap$options$type3 = typeMap[options.type]) === null || _typeMap$options$type3 === void 0 ? void 0 : _typeMap$options$type3.key, "_").concat((_typeMap$options$type4 = typeMap[options.type]) === null || _typeMap$options$type4 === void 0 ? void 0 : _typeMap$options$type4.company),
134
+ name: '物流公司',
135
+ parentName: (_typeMap$options$type3 = typeMap[options.type]) === null || _typeMap$options$type3 === void 0 ? void 0 : _typeMap$options$type3.name,
136
+ id: "".concat(options.id, "_").concat((_typeMap$options$type4 = typeMap[options.type]) === null || _typeMap$options$type4 === void 0 ? void 0 : _typeMap$options$type4.key, "_").concat((_typeMap$options$type5 = typeMap[options.type]) === null || _typeMap$options$type5 === void 0 ? void 0 : _typeMap$options$type5.company),
134
137
  width: 200
135
138
  }));
136
139
  this.expressCode = new ExpressCode(_objectSpread(_objectSpread({}, options), {}, {
137
- name: "物流单号",
138
- id: "".concat(options.id, "_").concat((_typeMap$options$type5 = typeMap[options.type]) === null || _typeMap$options$type5 === void 0 ? void 0 : _typeMap$options$type5.key, "_").concat((_typeMap$options$type6 = typeMap[options.type]) === null || _typeMap$options$type6 === void 0 ? void 0 : _typeMap$options$type6.code),
140
+ name: '物流单号',
141
+ parentName: (_typeMap$options$type6 = typeMap[options.type]) === null || _typeMap$options$type6 === void 0 ? void 0 : _typeMap$options$type6.name,
142
+ id: "".concat(options.id, "_").concat((_typeMap$options$type7 = typeMap[options.type]) === null || _typeMap$options$type7 === void 0 ? void 0 : _typeMap$options$type7.key, "_").concat((_typeMap$options$type8 = typeMap[options.type]) === null || _typeMap$options$type8 === void 0 ? void 0 : _typeMap$options$type8.code),
139
143
  width: 200
140
144
  }));
141
145
  this.children = [this.expressCompany, this.expressCode];
142
- this.dataType = "object";
146
+ this.dataType = 'object';
143
147
  this.rules = (_this$componentConfig3 = this.componentConfig) !== null && _this$componentConfig3 !== void 0 && _this$componentConfig3.required ? [{
144
148
  required: true,
145
149
  validator: function validator(_, value) {
@@ -154,14 +158,14 @@ var BsLogistics = /*#__PURE__*/_createClass(function BsLogistics(options) {
154
158
  }] : [];
155
159
  this.expressDateInstance = ExpressData.getInstance();
156
160
  this.sortChildField = [{
157
- name: "物流公司",
158
- key: "".concat(options.id, "_").concat((_typeMap$options$type7 = typeMap[options.type]) === null || _typeMap$options$type7 === void 0 ? void 0 : _typeMap$options$type7.company),
161
+ name: '物流公司',
162
+ key: "".concat(options.id, "_").concat((_typeMap$options$type9 = typeMap[options.type]) === null || _typeMap$options$type9 === void 0 ? void 0 : _typeMap$options$type9.company),
159
163
  options: this.expressDateInstance.getExpressData(),
160
- dataType: "string"
164
+ dataType: 'string'
161
165
  }, {
162
- name: "物流单号",
163
- key: "".concat(options.id, "_").concat((_typeMap$options$type8 = typeMap[options.type]) === null || _typeMap$options$type8 === void 0 ? void 0 : _typeMap$options$type8.code),
164
- dataType: "string"
166
+ name: '物流单号',
167
+ key: "".concat(options.id, "_").concat((_typeMap$options$type10 = typeMap[options.type]) === null || _typeMap$options$type10 === void 0 ? void 0 : _typeMap$options$type10.code),
168
+ dataType: 'string'
165
169
  }];
166
170
  });
167
171
  export default BsLogistics;
@@ -1,19 +1,20 @@
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 ExpressCode 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
  width: number;
12
12
  isCombinationComponent: boolean;
13
13
  formField: string;
14
14
  canSort: boolean;
15
15
  children: ComponentInterface[];
16
- dataType: ComponentInterface["dataType"];
16
+ dataType: ComponentInterface['dataType'];
17
+ parentName: string;
17
18
  constructor(options: PickOption);
18
19
  renderClient: () => null;
19
20
  renderPc: (value: unknown, record: Record) => React.JSX.Element;
@@ -11,16 +11,16 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
11
11
  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; }
12
12
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
13
13
  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); }
14
- import React from "react";
14
+ import React from 'react';
15
15
  import { BsExpressRender } from "../../Common";
16
- import { isNull, filterFn as _filterFn } from "@kmkf-fe-packages/kmkf-utils";
16
+ import { isNull, filterFn as _filterFn } from '@kmkf-fe-packages/kmkf-utils';
17
17
  import { SYMBOL } from "../../../constant";
18
18
  var typeMap = {
19
- BS_SYSTEM_ORDER: {
20
- key: "bsLogisticsItem"
19
+ BS_LOGISTICS: {
20
+ key: 'bsLogisticsItem'
21
21
  },
22
- WLN_SYSTEM_ORDER: {
23
- key: "wlnLogisticsItem"
22
+ WLN_LOGISTICS: {
23
+ key: 'wlnLogisticsItem'
24
24
  }
25
25
  };
26
26
  var ExpressCode = /*#__PURE__*/_createClass(function ExpressCode(options) {
@@ -40,11 +40,12 @@ var ExpressCode = /*#__PURE__*/_createClass(function ExpressCode(options) {
40
40
  _defineProperty(this, "canSort", void 0);
41
41
  _defineProperty(this, "children", void 0);
42
42
  _defineProperty(this, "dataType", void 0);
43
+ _defineProperty(this, "parentName", void 0);
43
44
  _defineProperty(this, "renderClient", function () {
44
45
  return null;
45
46
  });
46
47
  _defineProperty(this, "renderPc", function (value, record) {
47
- var _this$id$split = _this.id.split("_"),
48
+ var _this$id$split = _this.id.split('_'),
48
49
  _this$id$split2 = _slicedToArray(_this$id$split, 3),
49
50
  key = _this$id$split2[0],
50
51
  parentKey = _this$id$split2[1],
@@ -54,7 +55,7 @@ var ExpressCode = /*#__PURE__*/_createClass(function ExpressCode(options) {
54
55
  }
55
56
  return /*#__PURE__*/React.createElement(BsExpressRender, {
56
57
  list: record === null || record === void 0 ? void 0 : record["".concat(key, "_").concat(parentKey, "_").concat(typeMap[_this.type].key)],
57
- showField: "code"
58
+ showField: 'code'
58
59
  });
59
60
  });
60
61
  _defineProperty(this, "renderLog", function (r) {
@@ -66,7 +67,7 @@ var ExpressCode = /*#__PURE__*/_createClass(function ExpressCode(options) {
66
67
  });
67
68
  _defineProperty(this, "renderExport", function (value, record) {
68
69
  var _record;
69
- return (_record = record === null || record === void 0 ? void 0 : record["".concat(_this.id)]) !== null && _record !== void 0 ? _record : "--";
70
+ return (_record = record === null || record === void 0 ? void 0 : record["".concat(_this.id)]) !== null && _record !== void 0 ? _record : '--';
70
71
  });
71
72
  _defineProperty(this, "editRender", function () {
72
73
  return null;
@@ -77,11 +78,11 @@ var ExpressCode = /*#__PURE__*/_createClass(function ExpressCode(options) {
77
78
  searchDefaultConditions: SYMBOL.like,
78
79
  type: item.type,
79
80
  id: "".concat(item.id, "_").concat(subKey),
80
- name: "".concat(_this.name, "\u7269\u6D41\u5355\u53F7"),
81
- filterComponentType: "Input",
81
+ name: "".concat(_this.parentName, "\u7269\u6D41\u5355\u53F7"),
82
+ filterComponentType: 'Input',
82
83
  filterFn: function filterFn(value) {
83
84
  return function (i) {
84
- return _filterFn.filterSplitComma(_filterFn.filterTableListItemColumnValue(i, item.id, "logisticsCode"), value);
85
+ return _filterFn.filterSplitComma(_filterFn.filterTableListItemColumnValue(i, item.id, 'logisticsCode'), value);
85
86
  };
86
87
  }
87
88
  };
@@ -97,14 +98,15 @@ var ExpressCode = /*#__PURE__*/_createClass(function ExpressCode(options) {
97
98
  if (/^[0-9a-zA-Z]*$/.test(value)) {
98
99
  return Promise.resolve();
99
100
  }
100
- return Promise.reject(new Error("只能输入数字和字母"));
101
+ return Promise.reject(new Error('只能输入数字和字母'));
101
102
  }
102
103
  }] : [];
103
- this.align = "left";
104
+ this.align = 'left';
104
105
  this.width = (options === null || options === void 0 ? void 0 : options.width) || 150;
105
106
  this.isCombinationComponent = false;
106
107
  this.canSort = false;
107
- this.dataType = "string";
108
+ this.dataType = 'string';
108
109
  this.children = [];
110
+ this.parentName = options === null || options === void 0 ? void 0 : options.parentName;
109
111
  });
110
112
  export default ExpressCode;
@@ -1,13 +1,13 @@
1
- import { ComponentInterface, PickOption, ColumnConfig, ALignType, Record } from "../../../type";
2
- import React from "react";
3
- import { ExpressData } from "@kmkf-fe-packages/kmkf-utils";
1
+ import { ComponentInterface, PickOption, ColumnConfig, ALignType, Record } from '../../../type';
2
+ import React from 'react';
3
+ import { ExpressData } from '@kmkf-fe-packages/kmkf-utils';
4
4
  declare class Express implements ComponentInterface {
5
5
  name: string;
6
6
  id: string;
7
7
  sortField: string;
8
8
  type: string;
9
9
  rules: any[];
10
- componentConfig: ComponentInterface["componentConfig"];
10
+ componentConfig: ComponentInterface['componentConfig'];
11
11
  align: ALignType;
12
12
  expressDateInstance: InstanceType<typeof ExpressData>;
13
13
  width: number;
@@ -15,8 +15,8 @@ declare class Express implements ComponentInterface {
15
15
  formField: string;
16
16
  canSort: boolean;
17
17
  children: ComponentInterface[];
18
- dataType: ComponentInterface["dataType"];
19
- options: ComponentInterface["options"];
18
+ dataType: ComponentInterface['dataType'];
19
+ options: ComponentInterface['options'];
20
20
  constructor(options: PickOption);
21
21
  renderClient: () => null;
22
22
  renderPc: (value: unknown, record: Record) => React.JSX.Element;
@@ -11,17 +11,17 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
11
11
  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; }
12
12
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
13
13
  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); }
14
- import React from "react";
15
- import { ExpressData } from "@kmkf-fe-packages/kmkf-utils";
14
+ import React from 'react';
15
+ import { ExpressData } from '@kmkf-fe-packages/kmkf-utils';
16
16
  import { BsExpressRender } from "../../Common";
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
- BS_SYSTEM_ORDER: {
21
- key: "bsLogisticsItem"
20
+ BS_LOGISTICS: {
21
+ key: 'bsLogisticsItem'
22
22
  },
23
- WLN_SYSTEM_ORDER: {
24
- key: "wlnLogisticsItem"
23
+ WLN_LOGISTICS: {
24
+ key: 'wlnLogisticsItem'
25
25
  }
26
26
  };
27
27
  var Express = /*#__PURE__*/_createClass(function Express(options) {
@@ -46,17 +46,19 @@ var Express = /*#__PURE__*/_createClass(function Express(options) {
46
46
  return null;
47
47
  });
48
48
  _defineProperty(this, "renderPc", function (value, record) {
49
- var _this$id$split = _this.id.split("_"),
49
+ var _typeMap$_this$type, _typeMap$_this$type2;
50
+ console.log(_this.type);
51
+ var _this$id$split = _this.id.split('_'),
50
52
  _this$id$split2 = _slicedToArray(_this$id$split, 3),
51
53
  key = _this$id$split2[0],
52
54
  parentKey = _this$id$split2[1],
53
55
  childKey = _this$id$split2[2];
54
- if (!(record !== null && record !== void 0 && record["".concat(key, "_").concat(parentKey, "_").concat(typeMap[_this.type].key)])) {
56
+ if (!(record !== null && record !== void 0 && record["".concat(key, "_").concat(parentKey, "_").concat((_typeMap$_this$type = typeMap[_this.type]) === null || _typeMap$_this$type === void 0 ? void 0 : _typeMap$_this$type.key)])) {
55
57
  return /*#__PURE__*/React.createElement("span", null, "--");
56
58
  }
57
59
  return /*#__PURE__*/React.createElement(BsExpressRender, {
58
- list: record === null || record === void 0 ? void 0 : record["".concat(key, "_").concat(parentKey, "_").concat(typeMap[_this.type].key)],
59
- showField: "company"
60
+ list: record === null || record === void 0 ? void 0 : record["".concat(key, "_").concat(parentKey, "_").concat((_typeMap$_this$type2 = typeMap[_this.type]) === null || _typeMap$_this$type2 === void 0 ? void 0 : _typeMap$_this$type2.key)],
61
+ showField: 'company'
60
62
  });
61
63
  });
62
64
  _defineProperty(this, "renderLog", function (r) {
@@ -67,7 +69,7 @@ var Express = /*#__PURE__*/_createClass(function Express(options) {
67
69
  return r === null || r === void 0 ? void 0 : r["".concat(_this.id)];
68
70
  });
69
71
  _defineProperty(this, "renderExport", function (value, record) {
70
- return _this.expressDateInstance.getExpressNameByCode(record === null || record === void 0 ? void 0 : record["".concat(_this.id)]) || (record === null || record === void 0 ? void 0 : record["".concat(_this.id)]) || "--";
72
+ return _this.expressDateInstance.getExpressNameByCode(record === null || record === void 0 ? void 0 : record["".concat(_this.id)]) || (record === null || record === void 0 ? void 0 : record["".concat(_this.id)]) || '--';
71
73
  });
72
74
  _defineProperty(this, "editRender", function () {
73
75
  return null;
@@ -79,14 +81,14 @@ var Express = /*#__PURE__*/_createClass(function Express(options) {
79
81
  type: item.type,
80
82
  id: "".concat(item.id, "_").concat(subKey),
81
83
  name: "".concat(_this.name),
82
- filterComponentType: "MultipleSelect",
84
+ filterComponentType: 'MultipleSelect',
83
85
  props: {
84
86
  options: _this.expressDateInstance.getExpressData() || []
85
87
  },
86
88
  filterFn: function filterFn(value) {
87
89
  return function (i) {
88
90
  var _ref;
89
- return (_ref = _filterFn.filterTableListItemColumnValue(i, item.id, "logisticsCompany").split(",") || []) === null || _ref === void 0 ? void 0 : _ref.some(function (item) {
91
+ return (_ref = _filterFn.filterTableListItemColumnValue(i, item.id, 'logisticsCompany').split(',') || []) === null || _ref === void 0 ? void 0 : _ref.some(function (item) {
90
92
  var _String;
91
93
  var logisticsCompany = item ? (_String = String(item)) === null || _String === void 0 ? void 0 : _String.includes(value) : false;
92
94
  return logisticsCompany;
@@ -102,13 +104,13 @@ var Express = /*#__PURE__*/_createClass(function Express(options) {
102
104
  this.type = options.type;
103
105
  this.componentConfig = options.componentConfig;
104
106
  this.rules = [];
105
- this.align = "left";
107
+ this.align = 'left';
106
108
  this.expressDateInstance = ExpressData.getInstance();
107
109
  this.width = (options === null || options === void 0 ? void 0 : options.width) || 150;
108
110
  this.isCombinationComponent = false;
109
111
  this.canSort = false;
110
112
  this.children = [];
111
- this.dataType = "string";
113
+ this.dataType = 'string';
112
114
  this.options = this.expressDateInstance.getExpressData() || [];
113
115
  });
114
116
  export default Express;
@@ -1,4 +1,4 @@
1
- import React from "react";
1
+ import React from 'react';
2
2
  declare type getFormItemProps = {
3
3
  name: string;
4
4
  title: string;