@kmkf-fe-packages/services-components 0.8.19-alpha.0 → 0.8.19-alpha.2

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, ALignType, 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,14 +15,13 @@ declare class BsLogistics implements ComponentInterface {
15
15
  }[];
16
16
  type: string;
17
17
  rules: any[];
18
- componentConfig: ComponentInterface["componentConfig"];
19
- align: ALignType;
18
+ componentConfig: ComponentInterface['componentConfig'];
20
19
  expressDateInstance: InstanceType<typeof ExpressData>;
21
20
  isCombinationComponent: boolean;
22
21
  formField: string;
23
22
  canSort: boolean;
24
23
  children: ComponentInterface[];
25
- dataType: ComponentInterface["dataType"];
24
+ dataType: ComponentInterface['dataType'];
26
25
  expressCompany: ExpressCompany;
27
26
  expressCode: ExpressCode;
28
27
  constructor(options: PickOption);
@@ -49,7 +48,6 @@ declare class BsLogistics implements ComponentInterface {
49
48
  name: string;
50
49
  filterComponentType: "Input";
51
50
  filterFn: (value: string) => (i: Record) => boolean;
52
- props?: undefined;
53
51
  })[];
54
52
  }
55
53
  export default BsLogistics;
@@ -8,23 +8,22 @@ 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, filterFn as _filterFn } from "@kmkf-fe-packages/kmkf-utils";
19
- import { SYMBOL } from "../../../constant";
18
+ import { isNull } from '@kmkf-fe-packages/kmkf-utils';
20
19
  import ExpressCompany from "../common/expressCompany";
21
20
  import ExpressCode from "../common/expressCode";
22
21
  var typeMap = {
23
22
  BS_LOGISTICS: {
24
- key: "bsLogisticsList",
25
- name: "bs",
26
- company: "bsLogisticsCompany",
27
- code: "bsLogisticsCode"
23
+ key: 'bsLogisticsList',
24
+ name: 'bs',
25
+ company: 'bsLogisticsCompany',
26
+ code: 'bsLogisticsCode'
28
27
  }
29
28
  };
30
29
  var BsLogistics = /*#__PURE__*/_createClass(function BsLogistics(options) {
@@ -46,7 +45,6 @@ var BsLogistics = /*#__PURE__*/_createClass(function BsLogistics(options) {
46
45
  _defineProperty(this, "type", void 0);
47
46
  _defineProperty(this, "rules", void 0);
48
47
  _defineProperty(this, "componentConfig", void 0);
49
- _defineProperty(this, "align", void 0);
50
48
  _defineProperty(this, "expressDateInstance", void 0);
51
49
  _defineProperty(this, "isCombinationComponent", void 0);
52
50
  _defineProperty(this, "formField", void 0);
@@ -110,37 +108,11 @@ var BsLogistics = /*#__PURE__*/_createClass(function BsLogistics(options) {
110
108
  });
111
109
  _defineProperty(this, "filterConfig", function (item) {
112
110
  var _typeMap$_this$type4, _typeMap$_this$type5;
113
- return [{
114
- searchDefaultConditions: SYMBOL.in,
115
- type: item.type,
116
- id: "".concat(item.id, "_").concat((_typeMap$_this$type4 = typeMap[_this.type]) === null || _typeMap$_this$type4 === void 0 ? void 0 : _typeMap$_this$type4.company),
117
- name: "".concat(_this.name, "\u7269\u6D41\u516C\u53F8"),
118
- filterComponentType: "MultipleSelect",
119
- props: {
120
- options: _this.expressDateInstance.getExpressData() || []
121
- },
122
- filterFn: function filterFn(value) {
123
- return function (i) {
124
- var _ref;
125
- return (_ref = _filterFn.filterTableListItemColumnValue(i, item.id, "logisticsCompany").split(",") || []) === null || _ref === void 0 ? void 0 : _ref.some(function (item) {
126
- var _String;
127
- var logisticsCompany = item ? (_String = String(item)) === null || _String === void 0 ? void 0 : _String.includes(value) : false;
128
- return logisticsCompany;
129
- });
130
- };
131
- }
132
- }, {
133
- searchDefaultConditions: SYMBOL.like,
134
- type: item.type,
135
- id: "".concat(item.id, "_").concat((_typeMap$_this$type5 = typeMap[_this.type]) === null || _typeMap$_this$type5 === void 0 ? void 0 : _typeMap$_this$type5.code),
136
- name: "".concat(_this.name, "\u7269\u6D41\u5355\u53F7"),
137
- filterComponentType: "Input",
138
- filterFn: function filterFn(value) {
139
- return function (i) {
140
- return _filterFn.filterSplitComma(_filterFn.filterTableListItemColumnValue(i, item.id, "logisticsCode"), value);
141
- };
142
- }
143
- }];
111
+ return [_this.expressCompany.filterConfig(_objectSpread(_objectSpread({}, item), {}, {
112
+ subKey: (_typeMap$_this$type4 = typeMap[_this.type]) === null || _typeMap$_this$type4 === void 0 ? void 0 : _typeMap$_this$type4.company
113
+ })), _this.expressCode.filterConfig(_objectSpread(_objectSpread({}, item), {}, {
114
+ subKey: (_typeMap$_this$type5 = typeMap[_this.type]) === null || _typeMap$_this$type5 === void 0 ? void 0 : _typeMap$_this$type5.code
115
+ }))];
144
116
  });
145
117
  this.name = options.name;
146
118
  this.id = options.id;
@@ -151,15 +123,17 @@ var BsLogistics = /*#__PURE__*/_createClass(function BsLogistics(options) {
151
123
  this.isCombinationComponent = true;
152
124
  this.canSort = false;
153
125
  this.expressCompany = new ExpressCompany(_objectSpread(_objectSpread({}, options), {}, {
154
- name: "物流公司",
155
- 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)
126
+ name: '物流公司',
127
+ 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),
128
+ width: 200
156
129
  }));
157
130
  this.expressCode = new ExpressCode(_objectSpread(_objectSpread({}, options), {}, {
158
- name: "物流单号",
159
- 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)
131
+ name: '物流单号',
132
+ 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),
133
+ width: 200
160
134
  }));
161
135
  this.children = [this.expressCompany, this.expressCode];
162
- this.dataType = "object";
136
+ this.dataType = 'object';
163
137
  this.rules = (_this$componentConfig3 = this.componentConfig) !== null && _this$componentConfig3 !== void 0 && _this$componentConfig3.required ? [{
164
138
  required: true,
165
139
  validator: function validator(_, value) {
@@ -172,17 +146,16 @@ var BsLogistics = /*#__PURE__*/_createClass(function BsLogistics(options) {
172
146
  return Promise.resolve();
173
147
  }
174
148
  }] : [];
175
- this.align = "left";
176
149
  this.expressDateInstance = ExpressData.getInstance();
177
150
  this.sortChildField = [{
178
- name: "物流公司",
151
+ name: '物流公司',
179
152
  key: "".concat(options.id, "_").concat((_typeMap$options$type7 = typeMap[options.type]) === null || _typeMap$options$type7 === void 0 ? void 0 : _typeMap$options$type7.company),
180
153
  options: this.expressDateInstance.getExpressData(),
181
- dataType: "string"
154
+ dataType: 'string'
182
155
  }, {
183
- name: "物流单号",
156
+ name: '物流单号',
184
157
  key: "".concat(options.id, "_").concat((_typeMap$options$type8 = typeMap[options.type]) === null || _typeMap$options$type8 === void 0 ? void 0 : _typeMap$options$type8.code),
185
- dataType: "string"
158
+ dataType: 'string'
186
159
  }];
187
160
  });
188
161
  export default BsLogistics;
@@ -1,4 +1,4 @@
1
- import { ComponentInterface, PickOption, ALignType, Record } from '../../../type';
1
+ import { ComponentInterface, PickOption, ColumnConfig, ALignType, Record } from '../../../type';
2
2
  import React from 'react';
3
3
  declare class ExpressCode implements ComponentInterface {
4
4
  name: string;
@@ -21,6 +21,13 @@ declare class ExpressCode implements ComponentInterface {
21
21
  getComponentValue: (r: Record) => any;
22
22
  renderExport: (value: string, record: Record) => any;
23
23
  editRender: () => null;
24
- filterConfig: () => never[];
24
+ filterConfig: (item: ColumnConfig) => {
25
+ searchDefaultConditions: "like";
26
+ type: string;
27
+ id: string;
28
+ name: string;
29
+ filterComponentType: "Input";
30
+ filterFn: (value: string) => (i: Record) => boolean;
31
+ };
25
32
  }
26
33
  export default ExpressCode;
@@ -13,7 +13,8 @@ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _ty
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
14
  import React from 'react';
15
15
  import { BsExpressRender } from "../../Common";
16
- import { isNull } from '@kmkf-fe-packages/kmkf-utils';
16
+ import { isNull, filterFn as _filterFn } from '@kmkf-fe-packages/kmkf-utils';
17
+ import { SYMBOL } from "../../../constant";
17
18
  var ExpressCode = /*#__PURE__*/_createClass(function ExpressCode(options) {
18
19
  var _this = this,
19
20
  _this$componentConfig;
@@ -62,8 +63,20 @@ var ExpressCode = /*#__PURE__*/_createClass(function ExpressCode(options) {
62
63
  _defineProperty(this, "editRender", function () {
63
64
  return null;
64
65
  });
65
- _defineProperty(this, "filterConfig", function () {
66
- return [];
66
+ _defineProperty(this, "filterConfig", function (item) {
67
+ var subKey = item.subKey;
68
+ return {
69
+ searchDefaultConditions: SYMBOL.like,
70
+ type: item.type,
71
+ id: "".concat(item.id, "_").concat(subKey),
72
+ name: "".concat(_this.name, "\u7269\u6D41\u5355\u53F7"),
73
+ filterComponentType: 'Input',
74
+ filterFn: function filterFn(value) {
75
+ return function (i) {
76
+ return _filterFn.filterSplitComma(_filterFn.filterTableListItemColumnValue(i, item.id, 'logisticsCode'), value);
77
+ };
78
+ }
79
+ };
67
80
  });
68
81
  this.name = options.name;
69
82
  this.id = options.id;
@@ -80,9 +93,9 @@ var ExpressCode = /*#__PURE__*/_createClass(function ExpressCode(options) {
80
93
  }
81
94
  }] : [];
82
95
  this.align = 'left';
83
- this.width = 100;
96
+ this.width = (options === null || options === void 0 ? void 0 : options.width) || 150;
84
97
  this.isCombinationComponent = false;
85
- this.canSort = true;
98
+ this.canSort = false;
86
99
  this.dataType = 'string';
87
100
  this.children = [];
88
101
  });
@@ -1,4 +1,4 @@
1
- import { ComponentInterface, PickOption, ALignType, Record } from '../../../type';
1
+ import { ComponentInterface, PickOption, ColumnConfig, ALignType, Record } from '../../../type';
2
2
  import React from 'react';
3
3
  import { ExpressData } from '@kmkf-fe-packages/kmkf-utils';
4
4
  declare class Express implements ComponentInterface {
@@ -24,6 +24,16 @@ declare class Express implements ComponentInterface {
24
24
  getComponentValue: (r: Record) => any;
25
25
  renderExport: (value: string, record: Record) => any;
26
26
  editRender: () => null;
27
- filterConfig: () => never[];
27
+ filterConfig: (item: ColumnConfig) => {
28
+ searchDefaultConditions: "in";
29
+ type: string;
30
+ id: string;
31
+ name: string;
32
+ filterComponentType: "MultipleSelect";
33
+ props: {
34
+ options: any[];
35
+ };
36
+ filterFn: (value: string) => (i: Record) => any;
37
+ };
28
38
  }
29
39
  export default Express;
@@ -14,7 +14,8 @@ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input ==
14
14
  import React from 'react';
15
15
  import { ExpressData } from '@kmkf-fe-packages/kmkf-utils';
16
16
  import { BsExpressRender } from "../../Common";
17
- import { isNull } from '@kmkf-fe-packages/kmkf-utils';
17
+ import { isNull, filterFn as _filterFn } from '@kmkf-fe-packages/kmkf-utils';
18
+ import { SYMBOL } from "../../../constant";
18
19
  var Express = /*#__PURE__*/_createClass(function Express(options) {
19
20
  var _this = this;
20
21
  _classCallCheck(this, Express);
@@ -63,8 +64,28 @@ var Express = /*#__PURE__*/_createClass(function Express(options) {
63
64
  _defineProperty(this, "editRender", function () {
64
65
  return null;
65
66
  });
66
- _defineProperty(this, "filterConfig", function () {
67
- return [];
67
+ _defineProperty(this, "filterConfig", function (item) {
68
+ var subKey = item.subKey;
69
+ return {
70
+ searchDefaultConditions: SYMBOL.in,
71
+ type: item.type,
72
+ id: "".concat(item.id, "_").concat(subKey),
73
+ name: "".concat(_this.name),
74
+ filterComponentType: 'MultipleSelect',
75
+ props: {
76
+ options: _this.expressDateInstance.getExpressData() || []
77
+ },
78
+ filterFn: function filterFn(value) {
79
+ return function (i) {
80
+ var _ref;
81
+ return (_ref = _filterFn.filterTableListItemColumnValue(i, item.id, 'logisticsCompany').split(',') || []) === null || _ref === void 0 ? void 0 : _ref.some(function (item) {
82
+ var _String;
83
+ var logisticsCompany = item ? (_String = String(item)) === null || _String === void 0 ? void 0 : _String.includes(value) : false;
84
+ return logisticsCompany;
85
+ });
86
+ };
87
+ }
88
+ };
68
89
  });
69
90
  this.name = options.name;
70
91
  this.id = options.id;
@@ -75,9 +96,9 @@ var Express = /*#__PURE__*/_createClass(function Express(options) {
75
96
  this.rules = [];
76
97
  this.align = 'left';
77
98
  this.expressDateInstance = ExpressData.getInstance();
78
- this.width = 100;
99
+ this.width = (options === null || options === void 0 ? void 0 : options.width) || 150;
79
100
  this.isCombinationComponent = false;
80
- this.canSort = true;
101
+ this.canSort = false;
81
102
  this.children = [];
82
103
  this.dataType = 'string';
83
104
  this.options = this.expressDateInstance.getExpressData() || [];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kmkf-fe-packages/services-components",
3
- "version": "0.8.19-alpha.0",
3
+ "version": "0.8.19-alpha.2",
4
4
  "module": "dist/esm/index.js",
5
5
  "typings": "dist/esm/index.d.ts",
6
6
  "files": [
@@ -26,7 +26,7 @@
26
26
  "father": "^4.1.7"
27
27
  },
28
28
  "dependencies": {
29
- "@kmkf-fe-packages/basic-components": "^0.8.19-alpha.0",
29
+ "@kmkf-fe-packages/basic-components": "^0.8.19-alpha.2",
30
30
  "@kmkf-fe-packages/kmkf-utils": "^0.8.19-alpha.0"
31
31
  },
32
32
  "peerDependencies": {
@@ -40,5 +40,5 @@
40
40
  "gitHooks": {
41
41
  "pre-commit": "lint-staged"
42
42
  },
43
- "gitHead": "2ef041e1cfd8a5515a6a82d47b31b4bd5b110efe"
43
+ "gitHead": "76df2a097b11436a61008de980d5b4626ad93f90"
44
44
  }