@kmkf-fe-packages/services-components 0.6.3-alpha.14 → 0.6.3-alpha.16

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,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  declare type OperationLogProps = {
2
3
  content: string;
3
4
  operation: string;
@@ -51,6 +51,7 @@ var OperationLog = function OperationLog(_ref) {
51
51
  } catch (e) {
52
52
  nxt[cur['uniqueKey']] = cur['content'];
53
53
  } finally {
54
+ // eslint-disable-next-line no-unsafe-finally
54
55
  return nxt;
55
56
  }
56
57
  }, {});
@@ -64,6 +65,7 @@ var OperationLog = function OperationLog(_ref) {
64
65
  } catch (e) {
65
66
  nxt[cur['uniqueKey']] = cur['oldContent'];
66
67
  } finally {
68
+ // eslint-disable-next-line no-unsafe-finally
67
69
  return nxt;
68
70
  }
69
71
  }, {});
@@ -6,6 +6,7 @@ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key i
6
6
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
7
7
  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); }
8
8
  import React from 'react';
9
+ import intersection from 'lodash/intersection';
9
10
  import { filterFn as _filterFn } from '@kmkf-fe-packages/kmkf-utils';
10
11
  var Handler = /*#__PURE__*/_createClass(function Handler(options) {
11
12
  var _this = this;
@@ -56,7 +57,10 @@ var Handler = /*#__PURE__*/_createClass(function Handler(options) {
56
57
  options: ((_this$effects = _this.effects) === null || _this$effects === void 0 ? void 0 : _this$effects.userList) || [],
57
58
  filterFn: function filterFn(value) {
58
59
  return function (i) {
59
- return value === null || value === void 0 ? void 0 : value.includes(_filterFn.filterTableListItemColumnValue(i, item.id, ''));
60
+ var _ref;
61
+ return intersection(value, (_ref = _filterFn.filterTableListItemColumnValue(i, item.id) || []) === null || _ref === void 0 ? void 0 : _ref.map(function (item) {
62
+ return item === null || item === void 0 ? void 0 : item.account;
63
+ })).length > 0;
60
64
  };
61
65
  }
62
66
  };
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
- import { ComponentInterface, PickOption, ColumnConfig, ALignType, Record } from '../../type';
3
- import { AddressData } from '@kmkf-fe-packages/kmkf-utils';
2
+ import { ComponentInterface, PickOption, ColumnConfig, ALignType, Record } from "../../type";
3
+ import { AddressData } from "@kmkf-fe-packages/kmkf-utils";
4
4
  declare class PaymentTid implements ComponentInterface {
5
5
  name: string;
6
6
  id: string;
@@ -13,14 +13,14 @@ declare class PaymentTid implements ComponentInterface {
13
13
  isCombinationComponent: boolean;
14
14
  children: ComponentInterface[];
15
15
  originId: string;
16
- addressDateInstance: AddressData;
16
+ addressDateInstance: typeof AddressData;
17
17
  constructor(options: PickOption);
18
18
  render: (value: any, record: any) => JSX.Element | null;
19
19
  renderClient: (record: any) => JSX.Element | null;
20
20
  renderPc: (value: any, record: Record) => JSX.Element;
21
- renderLog: (r: Record) => null;
21
+ renderLog: (r: Record) => JSX.Element | null;
22
22
  getComponentValue: (r: Record) => {};
23
- renderExport: (value: any, record: Record) => any;
23
+ renderExport: (value: any, record: Record) => null;
24
24
  editRender: () => JSX.Element;
25
25
  filterConfig: (item: ColumnConfig) => never[];
26
26
  }
@@ -5,12 +5,12 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
5
5
  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; }
6
6
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
7
7
  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); }
8
- import React from 'react';
9
- import { ApaasInput } from '@kmkf-fe-packages/basic-components';
8
+ import React from "react";
9
+ import { ApaasInput } from "@kmkf-fe-packages/basic-components";
10
10
  import GetFormItem from "../GetFormItem";
11
11
  import ItemView from "../../commonComponents/ItemView";
12
- import { isNull } from '@kmkf-fe-packages/kmkf-utils';
13
- import { AddressData } from '@kmkf-fe-packages/kmkf-utils';
12
+ import { isNull } from "@kmkf-fe-packages/kmkf-utils";
13
+ import { AddressData } from "@kmkf-fe-packages/kmkf-utils";
14
14
  var PaymentTid = /*#__PURE__*/_createClass(function PaymentTid(options) {
15
15
  var _this = this;
16
16
  _classCallCheck(this, PaymentTid);
@@ -28,21 +28,35 @@ var PaymentTid = /*#__PURE__*/_createClass(function PaymentTid(options) {
28
28
  _defineProperty(this, "addressDateInstance", void 0);
29
29
  _defineProperty(this, "render", function (value, record) {
30
30
  var _ref;
31
- var address = JSON.parse(record["".concat(_this.id, "_interceptAddress")] || '[]');
31
+ var province = record["".concat(_this.id, "_interceptProvince")];
32
+ var city = record["".concat(_this.id, "_interceptCity")];
33
+ var district = record["".concat(_this.id, "_interceptDistrict")];
32
34
  var detail = record["".concat(_this.id, "_interceptDetail")];
33
35
  var name = record["".concat(_this.originId, "_interceptReceiverName")];
34
36
  var mobile = record["".concat(_this.originId, "_interceptReceiverMobile")];
35
- var addressText = (_ref = address || []) === null || _ref === void 0 ? void 0 : _ref.map(function (suffix) {
37
+ var addressText = (_ref = [province, city, district]) === null || _ref === void 0 ? void 0 : _ref.map(function (suffix) {
36
38
  return _this.addressDateInstance.getNameByCode(suffix);
37
- }).join('');
39
+ }).join("");
38
40
  var hasValue = addressText || detail || name || mobile;
39
- return hasValue ? /*#__PURE__*/React.createElement("div", null, [addressText, detail].join('/'), /*#__PURE__*/React.createElement("br", null), [name, mobile].join('/')) : null;
41
+ return hasValue ? /*#__PURE__*/React.createElement("div", null, [addressText, detail].join("/"), /*#__PURE__*/React.createElement("br", null), [name, mobile].join("/")) : null;
40
42
  });
41
43
  _defineProperty(this, "renderClient", function (record) {
44
+ var _ref2;
45
+ var province = record["".concat(_this.originId, "_interceptProvince")];
46
+ var city = record["".concat(_this.originId, "_interceptCity")];
47
+ var district = record["".concat(_this.originId, "_interceptDistrict")];
48
+ var detail = record["".concat(_this.originId, "_interceptDetail")];
49
+ var name = record["".concat(_this.originId, "_interceptReceiverName")];
50
+ var mobile = record["".concat(_this.originId, "_interceptReceiverMobile")];
51
+ var addressText = (_ref2 = [province, city, district]) === null || _ref2 === void 0 ? void 0 : _ref2.map(function (suffix) {
52
+ return _this.addressDateInstance.getNameByCode(suffix);
53
+ }).join("");
54
+ var hasValue = addressText || detail || name || mobile;
55
+ var value = hasValue ? /*#__PURE__*/React.createElement("div", null, [addressText, detail].join("/"), /*#__PURE__*/React.createElement("br", null), [name, mobile].join("/")) : null;
42
56
  return !isNull(record === null || record === void 0 ? void 0 : record[_this.id]) ? /*#__PURE__*/React.createElement(ItemView, {
43
57
  id: _this.id,
44
58
  label: _this.name,
45
- value: record === null || record === void 0 ? void 0 : record[_this.id]
59
+ value: value
46
60
  }) : null;
47
61
  });
48
62
  _defineProperty(this, "renderPc", function (value, record) {
@@ -53,18 +67,19 @@ var PaymentTid = /*#__PURE__*/_createClass(function PaymentTid(options) {
53
67
  className: "pointer",
54
68
  onClick: function onClick() {
55
69
  var _this$effects, _this$effects2;
56
- typeof (_this === null || _this === void 0 ? void 0 : (_this$effects = _this.effects) === null || _this$effects === void 0 ? void 0 : _this$effects.queryWorkOrderDetail) === 'function' && (_this === null || _this === void 0 ? void 0 : (_this$effects2 = _this.effects) === null || _this$effects2 === void 0 ? void 0 : _this$effects2.queryWorkOrderDetail(record));
70
+ typeof (_this === null || _this === void 0 ? void 0 : (_this$effects = _this.effects) === null || _this$effects === void 0 ? void 0 : _this$effects.queryWorkOrderDetail) === "function" && (_this === null || _this === void 0 ? void 0 : (_this$effects2 = _this.effects) === null || _this$effects2 === void 0 ? void 0 : _this$effects2.queryWorkOrderDetail(record));
57
71
  }
58
72
  }, value);
59
73
  });
60
74
  _defineProperty(this, "renderLog", function (r) {
61
- return null;
75
+ if (isNull(r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_interceptProvince")]) && isNull(r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_interceptDetail")]) && isNull(r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_interceptReceiverName")]) && isNull(r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_interceptReceiverMobile")])) return null;
76
+ return _this.renderPc(undefined, r);
62
77
  });
63
78
  _defineProperty(this, "getComponentValue", function (r) {
64
79
  return {};
65
80
  });
66
81
  _defineProperty(this, "renderExport", function (value, record) {
67
- return value !== null && value !== void 0 ? value : '--';
82
+ return null;
68
83
  });
69
84
  _defineProperty(this, "editRender", function () {
70
85
  var _this$componentConfig, _this$componentConfig2;
@@ -79,12 +94,12 @@ var PaymentTid = /*#__PURE__*/_createClass(function PaymentTid(options) {
79
94
  _defineProperty(this, "filterConfig", function (item) {
80
95
  return [];
81
96
  });
82
- this.name = '新派送地';
83
- this.id = "".concat(options.id, "_interceptAddress");
97
+ this.name = "新派送地";
98
+ this.id = "".concat(options.id, "_interceptProvince");
84
99
  this.type = options.type;
85
100
  this.componentConfig = options.componentConfig;
86
101
  this.rules = [];
87
- this.align = 'left';
102
+ this.align = "left";
88
103
  this.width = 200;
89
104
  this.originId = options.id;
90
105
  this.isCombinationComponent = false;
@@ -0,0 +1,27 @@
1
+ /// <reference types="react" />
2
+ import { ComponentInterface, PickOption, ColumnConfig, ALignType, Record } from "../../type";
3
+ import { ExpressInterceptData } from "@kmkf-fe-packages/kmkf-utils";
4
+ declare class InterceptStatus implements ComponentInterface {
5
+ name: string;
6
+ id: string;
7
+ companyId: string;
8
+ type: string;
9
+ rules: any[];
10
+ componentConfig: ComponentInterface["componentConfig"];
11
+ effects: ComponentInterface["effects"];
12
+ align: ALignType;
13
+ width: number;
14
+ isCombinationComponent: boolean;
15
+ children: ComponentInterface[];
16
+ expressDataInstance: typeof ExpressInterceptData;
17
+ constructor(options: PickOption);
18
+ render: (value: any, record: any) => JSX.Element;
19
+ getComponentValue: (r: Record) => any;
20
+ renderClient: (record: any) => JSX.Element | null;
21
+ renderPc: (value: any, record: Record) => any;
22
+ renderLog: (r: Record) => any;
23
+ renderExport: (value: any, record: Record) => any;
24
+ editRender: () => null;
25
+ filterConfig: (item: ColumnConfig) => never[];
26
+ }
27
+ export default InterceptStatus;
@@ -0,0 +1,70 @@
1
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
3
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
4
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
5
+ 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; }
6
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
7
+ 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); }
8
+ import React from "react";
9
+ import ItemView from "../../commonComponents/ItemView";
10
+ import { isNull } from "@kmkf-fe-packages/kmkf-utils";
11
+ import { ExpressInterceptData } from "@kmkf-fe-packages/kmkf-utils";
12
+ var InterceptStatus = /*#__PURE__*/_createClass(function InterceptStatus(options) {
13
+ var _this = this;
14
+ _classCallCheck(this, InterceptStatus);
15
+ _defineProperty(this, "name", void 0);
16
+ _defineProperty(this, "id", void 0);
17
+ _defineProperty(this, "companyId", void 0);
18
+ _defineProperty(this, "type", void 0);
19
+ _defineProperty(this, "rules", void 0);
20
+ _defineProperty(this, "componentConfig", void 0);
21
+ _defineProperty(this, "effects", void 0);
22
+ _defineProperty(this, "align", void 0);
23
+ _defineProperty(this, "width", void 0);
24
+ _defineProperty(this, "isCombinationComponent", void 0);
25
+ _defineProperty(this, "children", void 0);
26
+ _defineProperty(this, "expressDataInstance", void 0);
27
+ _defineProperty(this, "render", function (value, record) {
28
+ return /*#__PURE__*/React.createElement("span", null, "TODO");
29
+ });
30
+ _defineProperty(this, "getComponentValue", function (r) {
31
+ return r === null || r === void 0 ? void 0 : r[_this.id];
32
+ });
33
+ _defineProperty(this, "renderClient", function (record) {
34
+ return !isNull(record === null || record === void 0 ? void 0 : record[_this.id]) ? /*#__PURE__*/React.createElement(ItemView, {
35
+ id: _this.id,
36
+ label: _this.name,
37
+ value: _this.expressDataInstance.getStatusNameMap()["".concat(record === null || record === void 0 ? void 0 : record[_this.companyId], "_").concat(record === null || record === void 0 ? void 0 : record[_this.id])]
38
+ }) : null;
39
+ });
40
+ _defineProperty(this, "renderPc", function (value, record) {
41
+ var _this$expressDataInst;
42
+ return (_this$expressDataInst = _this.expressDataInstance.getStatusNameMap()["".concat(record === null || record === void 0 ? void 0 : record[_this.companyId], "_").concat(record === null || record === void 0 ? void 0 : record[_this.id])]) !== null && _this$expressDataInst !== void 0 ? _this$expressDataInst : "--";
43
+ });
44
+ _defineProperty(this, "renderLog", function (r) {
45
+ if (isNull(r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_interceptStatus")])) return null;
46
+ return _this.expressDataInstance.getTypeNameMap()[r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_interceptStatus")]];
47
+ });
48
+ _defineProperty(this, "renderExport", function (value, record) {
49
+ return _this.renderPc("", record);
50
+ });
51
+ _defineProperty(this, "editRender", function () {
52
+ return null;
53
+ });
54
+ _defineProperty(this, "filterConfig", function (item) {
55
+ return [];
56
+ });
57
+ this.name = "拦截状态";
58
+ this.id = "".concat(options.id, "_interceptStatus");
59
+ this.companyId = "".concat(options.id, "_interceptCompany");
60
+ this.type = options.type;
61
+ this.componentConfig = options.componentConfig;
62
+ this.rules = [];
63
+ this.align = "left";
64
+ this.width = 200;
65
+ this.isCombinationComponent = false;
66
+ this.children = [];
67
+ this.effects = options === null || options === void 0 ? void 0 : options.effects;
68
+ this.expressDataInstance = ExpressInterceptData.getInstance();
69
+ });
70
+ export default InterceptStatus;
@@ -1,9 +1,10 @@
1
1
  /// <reference types="react" />
2
- import { ComponentInterface, PickOption, ColumnConfig, ALignType, Record } from '../../type';
3
- import { AddressData } from '@kmkf-fe-packages/kmkf-utils';
4
- declare class PaymentTid implements ComponentInterface {
2
+ import { ComponentInterface, PickOption, ColumnConfig, ALignType, Record } from "../../type";
3
+ import { ExpressInterceptData } from "@kmkf-fe-packages/kmkf-utils";
4
+ declare class InterceptType implements ComponentInterface {
5
5
  name: string;
6
6
  id: string;
7
+ companyId: string;
7
8
  type: string;
8
9
  rules: any[];
9
10
  componentConfig: ComponentInterface["componentConfig"];
@@ -12,13 +13,15 @@ declare class PaymentTid implements ComponentInterface {
12
13
  width: number;
13
14
  isCombinationComponent: boolean;
14
15
  children: ComponentInterface[];
15
- addressDateInstance: AddressData;
16
+ expressDataInstance: typeof ExpressInterceptData;
16
17
  constructor(options: PickOption);
17
18
  render: (value: any, record: any) => JSX.Element;
19
+ getComponentValue: (r: Record) => any;
18
20
  renderClient: (record: any) => JSX.Element | null;
19
21
  renderPc: (value: any, record: Record) => any;
22
+ renderLog: (r: Record) => any;
20
23
  renderExport: (value: any, record: Record) => any;
21
24
  editRender: () => null;
22
25
  filterConfig: (item: ColumnConfig) => never[];
23
26
  }
24
- export default PaymentTid;
27
+ export default InterceptType;
@@ -5,15 +5,16 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
5
5
  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; }
6
6
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
7
7
  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); }
8
- import React from 'react';
8
+ import React from "react";
9
9
  import ItemView from "../../commonComponents/ItemView";
10
- import { isNull } from '@kmkf-fe-packages/kmkf-utils';
11
- import { AddressData } from '@kmkf-fe-packages/kmkf-utils';
12
- var PaymentTid = /*#__PURE__*/_createClass(function PaymentTid(options) {
10
+ import { isNull } from "@kmkf-fe-packages/kmkf-utils";
11
+ import { ExpressInterceptData } from "@kmkf-fe-packages/kmkf-utils";
12
+ var InterceptType = /*#__PURE__*/_createClass(function InterceptType(options) {
13
13
  var _this = this;
14
- _classCallCheck(this, PaymentTid);
14
+ _classCallCheck(this, InterceptType);
15
15
  _defineProperty(this, "name", void 0);
16
16
  _defineProperty(this, "id", void 0);
17
+ _defineProperty(this, "companyId", void 0);
17
18
  _defineProperty(this, "type", void 0);
18
19
  _defineProperty(this, "rules", void 0);
19
20
  _defineProperty(this, "componentConfig", void 0);
@@ -22,24 +23,30 @@ var PaymentTid = /*#__PURE__*/_createClass(function PaymentTid(options) {
22
23
  _defineProperty(this, "width", void 0);
23
24
  _defineProperty(this, "isCombinationComponent", void 0);
24
25
  _defineProperty(this, "children", void 0);
25
- _defineProperty(this, "addressDateInstance", void 0);
26
+ _defineProperty(this, "expressDataInstance", void 0);
26
27
  _defineProperty(this, "render", function (value, record) {
27
28
  return /*#__PURE__*/React.createElement("span", null, "TODO");
28
29
  });
30
+ _defineProperty(this, "getComponentValue", function (r) {
31
+ return r === null || r === void 0 ? void 0 : r[_this.id];
32
+ });
29
33
  _defineProperty(this, "renderClient", function (record) {
30
34
  return !isNull(record === null || record === void 0 ? void 0 : record[_this.id]) ? /*#__PURE__*/React.createElement(ItemView, {
31
35
  id: _this.id,
32
36
  label: _this.name,
33
- value: record === null || record === void 0 ? void 0 : record[_this.id]
37
+ value: _this.expressDataInstance.getTypeNameMap()["".concat(record === null || record === void 0 ? void 0 : record[_this.companyId], "_").concat(record === null || record === void 0 ? void 0 : record[_this.id])]
34
38
  }) : null;
35
39
  });
36
40
  _defineProperty(this, "renderPc", function (value, record) {
37
- var _record;
38
- return (_record = record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_interceptType")]) !== null && _record !== void 0 ? _record : '--';
41
+ var _this$expressDataInst;
42
+ return (_this$expressDataInst = _this.expressDataInstance.getTypeNameMap()["".concat(record === null || record === void 0 ? void 0 : record[_this.companyId], "_").concat(record === null || record === void 0 ? void 0 : record[_this.id])]) !== null && _this$expressDataInst !== void 0 ? _this$expressDataInst : "--";
43
+ });
44
+ _defineProperty(this, "renderLog", function (r) {
45
+ if (isNull(r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_interceptType")])) return null;
46
+ return _this.expressDataInstance.getTypeNameMap()[r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_interceptType")]];
39
47
  });
40
48
  _defineProperty(this, "renderExport", function (value, record) {
41
- var _record2;
42
- return (_record2 = record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_interceptType")]) !== null && _record2 !== void 0 ? _record2 : '--';
49
+ return _this.renderPc("", record);
43
50
  });
44
51
  _defineProperty(this, "editRender", function () {
45
52
  return null;
@@ -47,16 +54,17 @@ var PaymentTid = /*#__PURE__*/_createClass(function PaymentTid(options) {
47
54
  _defineProperty(this, "filterConfig", function (item) {
48
55
  return [];
49
56
  });
50
- this.name = '拦截类型';
57
+ this.name = "拦截类型";
51
58
  this.id = "".concat(options.id, "_interceptType");
59
+ this.companyId = "".concat(options.id, "_interceptCompany");
52
60
  this.type = options.type;
53
61
  this.componentConfig = options.componentConfig;
54
62
  this.rules = [];
55
- this.align = 'left';
63
+ this.align = "left";
56
64
  this.width = 200;
57
65
  this.isCombinationComponent = false;
58
66
  this.children = [];
59
67
  this.effects = options === null || options === void 0 ? void 0 : options.effects;
60
- this.addressDateInstance = AddressData.getInstance();
68
+ this.expressDataInstance = ExpressInterceptData.getInstance();
61
69
  });
62
- export default PaymentTid;
70
+ export default InterceptType;
@@ -1,7 +1,9 @@
1
1
  /// <reference types="react" />
2
2
  import { ComponentInterface, PickOption, ColumnConfig, Record } from "../../type";
3
- import { ExpressData } from "@kmkf-fe-packages/kmkf-utils";
3
+ import { ExpressData, ExpressInterceptData } from "@kmkf-fe-packages/kmkf-utils";
4
4
  import InterceptAddress from "./InterceptAddress";
5
+ import InterceptType from "./InterceptType";
6
+ import InterceptStatus from "./InterceptStatus";
5
7
  import Express from "../Express";
6
8
  import ExpressCode from "../ExpressCode";
7
9
  declare class Logistics implements ComponentInterface {
@@ -11,11 +13,15 @@ declare class Logistics implements ComponentInterface {
11
13
  rules: any[];
12
14
  componentConfig: ComponentInterface["componentConfig"];
13
15
  interceptAddress: InterceptAddress;
16
+ interceptType: InterceptType;
17
+ interceptStatus: InterceptStatus;
14
18
  isCombinationComponent: boolean;
15
19
  children: ComponentInterface[];
16
20
  express: Express;
17
21
  expressCode: ExpressCode;
18
- expressDateInstance: ExpressData;
22
+ expressDateInstance: typeof ExpressData;
23
+ expressInterceptData: typeof ExpressInterceptData;
24
+ effects: ComponentInterface["effects"];
19
25
  constructor(options: PickOption);
20
26
  render: () => null;
21
27
  renderClient: (record: any) => JSX.Element;
@@ -10,9 +10,11 @@ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _ty
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
11
  import React from "react";
12
12
  import { LogisticsInterception } from "@kmkf-fe-packages/basic-components";
13
- import { ExpressData } from "@kmkf-fe-packages/kmkf-utils";
13
+ import { ExpressData, ExpressInterceptData } from "@kmkf-fe-packages/kmkf-utils";
14
14
  import GetFormItem from "../GetFormItem";
15
15
  import InterceptAddress from "./InterceptAddress";
16
+ import InterceptType from "./InterceptType";
17
+ import InterceptStatus from "./InterceptStatus";
16
18
  import Express from "../Express";
17
19
  import ExpressCode from "../ExpressCode";
18
20
  var Logistics = /*#__PURE__*/_createClass(function Logistics(options) {
@@ -24,19 +26,23 @@ var Logistics = /*#__PURE__*/_createClass(function Logistics(options) {
24
26
  _defineProperty(this, "rules", void 0);
25
27
  _defineProperty(this, "componentConfig", void 0);
26
28
  _defineProperty(this, "interceptAddress", void 0);
29
+ _defineProperty(this, "interceptType", void 0);
30
+ _defineProperty(this, "interceptStatus", void 0);
27
31
  _defineProperty(this, "isCombinationComponent", void 0);
28
32
  _defineProperty(this, "children", void 0);
29
33
  _defineProperty(this, "express", void 0);
30
34
  _defineProperty(this, "expressCode", void 0);
31
35
  _defineProperty(this, "expressDateInstance", void 0);
36
+ _defineProperty(this, "expressInterceptData", void 0);
37
+ _defineProperty(this, "effects", void 0);
32
38
  _defineProperty(this, "render", function () {
33
39
  return null;
34
40
  });
35
41
  _defineProperty(this, "renderClient", function (record) {
36
- return /*#__PURE__*/React.createElement(React.Fragment, null, _this.express.renderClient(record), _this.expressCode.renderClient(record), _this.interceptAddress.renderClient(record));
42
+ return /*#__PURE__*/React.createElement(React.Fragment, null, _this.express.renderClient(record), _this.expressCode.renderClient(record), _this.interceptType.renderClient(record), _this.interceptAddress.renderClient(record), _this.interceptStatus.renderClient(record));
37
43
  });
38
44
  _defineProperty(this, "renderLog", function (record) {
39
- return /*#__PURE__*/React.createElement(React.Fragment, null, _this.express.renderLog(record), _this.expressCode.renderLog(record), _this.interceptAddress.renderLog(record));
45
+ return /*#__PURE__*/React.createElement(React.Fragment, null, _this.express.renderLog(record), _this.expressCode.renderLog(record), _this.interceptType.renderLog(record), _this.interceptAddress.renderLog(record), _this.interceptStatus.renderLog(record));
40
46
  });
41
47
  _defineProperty(this, "getComponentValue", function (r) {
42
48
  return {};
@@ -48,14 +54,17 @@ var Logistics = /*#__PURE__*/_createClass(function Logistics(options) {
48
54
  return null;
49
55
  });
50
56
  _defineProperty(this, "editRender", function (value) {
51
- var _this$componentConfig, _this$componentConfig2;
57
+ var _this$componentConfig, _this$componentConfig2, _this$effects, _this$effects2, _this$effects2$workOr;
52
58
  return /*#__PURE__*/React.createElement(GetFormItem, {
53
59
  title: _this.name,
54
60
  name: _this.id,
55
61
  rules: _this.rules,
56
62
  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,
57
63
  component: /*#__PURE__*/React.createElement(LogisticsInterception, _extends({}, _this.componentConfig, {
58
- logisticsOptions: _this.expressDateInstance.getExpressData()
64
+ logisticsOptions: _this.expressDateInstance.getExpressData(),
65
+ expressInterceptData: _this.expressInterceptData.getExpressData(),
66
+ isEditing: (_this$effects = _this.effects) === null || _this$effects === void 0 ? void 0 : _this$effects.isEditing,
67
+ logisticsInterceptHandleStatus: ((_this$effects2 = _this.effects) === null || _this$effects2 === void 0 ? void 0 : (_this$effects2$workOr = _this$effects2.workOrderDetail) === null || _this$effects2$workOr === void 0 ? void 0 : _this$effects2$workOr.logisticsInterceptHandleStatus) || ""
59
68
  }))
60
69
  });
61
70
  });
@@ -66,8 +75,12 @@ var Logistics = /*#__PURE__*/_createClass(function Logistics(options) {
66
75
  this.id = options.id;
67
76
  this.type = options.type;
68
77
  this.componentConfig = options.componentConfig;
78
+ this.effects = options === null || options === void 0 ? void 0 : options.effects;
69
79
  this.expressDateInstance = ExpressData.getInstance();
80
+ this.expressInterceptData = ExpressInterceptData.getInstance();
70
81
  this.interceptAddress = new InterceptAddress(options);
82
+ this.interceptType = new InterceptType(options);
83
+ this.interceptStatus = new InterceptStatus(options);
71
84
  this.express = new Express(_objectSpread(_objectSpread({}, options), {}, {
72
85
  id: "".concat(options.id, "_interceptCompany"),
73
86
  name: "物流信息"
@@ -87,8 +100,7 @@ var Logistics = /*#__PURE__*/_createClass(function Logistics(options) {
87
100
  if ((_this$componentConfig4 = _this.componentConfig) !== null && _this$componentConfig4 !== void 0 && _this$componentConfig4.required && !(value !== null && value !== void 0 && value.interceptType)) {
88
101
  return Promise.reject(new Error("请选择拦截类型"));
89
102
  }
90
- var showAddress = _this.expressDateInstance.isShowNewAddress(value === null || value === void 0 ? void 0 : value.interceptCompany, value === null || value === void 0 ? void 0 : value.interceptType);
91
- console.log(showAddress);
103
+ var showAddress = _this.expressData.getShowNewAddressMap()["".concat(value === null || value === void 0 ? void 0 : value.interceptCompany, "_").concat(value === null || value === void 0 ? void 0 : value.interceptType)];
92
104
  if (showAddress && (!(value !== null && value !== void 0 && (_value$interceptAddre = value.interceptAddress) !== null && _value$interceptAddre !== void 0 && _value$interceptAddre.length) || !(value !== null && value !== void 0 && value.interceptDetail) || !(value !== null && value !== void 0 && value.interceptReceiverName) || !(value !== null && value !== void 0 && value.interceptReceiverMobile))) {
93
105
  return Promise.reject(new Error("请填写新派送地"));
94
106
  }
@@ -87,7 +87,7 @@ var AlipayNo = /*#__PURE__*/_createClass(function AlipayNo(options) {
87
87
  this.children = [];
88
88
  this.rules = [{
89
89
  validator: function validator(_, value) {
90
- if (/^(?:1[3-9]\d{9}|[a-zA-Z\d._-]*\@[a-zA-Z\d.-]{1,10}\.[a-zA-Z\d]{1,20})$/.test(value)) {
90
+ if (/^(?:1[3-9]\d{9}|[a-zA-Z\d._-]*@[a-zA-Z\d.-]{1,10}\.[a-zA-Z\d]{1,20})$/.test(value)) {
91
91
  return Promise.resolve();
92
92
  }
93
93
  return Promise.reject(new Error('请输入有效的邮箱或者手机号'));
package/package.json CHANGED
@@ -1,13 +1,15 @@
1
1
  {
2
2
  "name": "@kmkf-fe-packages/services-components",
3
- "version": "0.6.3-alpha.14",
3
+ "version": "0.6.3-alpha.16",
4
4
  "module": "dist/esm/index.js",
5
5
  "typings": "dist/esm/index.d.ts",
6
6
  "files": [
7
7
  "dist"
8
8
  ],
9
9
  "scripts": {
10
- "build": "father build"
10
+ "build": "yarn run lint && father build",
11
+ "lint": "eslint '**/*.{ts,tsx}'",
12
+ "lint:fix": "eslint --fix '**/*.{ts,tsx}'"
11
13
  },
12
14
  "lint-staged": {
13
15
  "*.{js,jsx,less,md,json}": [
@@ -18,11 +20,14 @@
18
20
  ]
19
21
  },
20
22
  "devDependencies": {
23
+ "@typescript-eslint/eslint-plugin": "^5.59.2",
24
+ "@typescript-eslint/parser": "^5.59.2",
25
+ "eslint": "^8.40.0",
21
26
  "father": "^4.1.7"
22
27
  },
23
28
  "dependencies": {
24
- "@kmkf-fe-packages/basic-components": "^0.6.3-alpha.5",
25
- "@kmkf-fe-packages/kmkf-utils": "^0.6.3-alpha.9"
29
+ "@kmkf-fe-packages/basic-components": "^0.6.3-alpha.16",
30
+ "@kmkf-fe-packages/kmkf-utils": "^0.6.3-alpha.16"
26
31
  },
27
32
  "peerDependencies": {
28
33
  "@ant-design/icons": "^4.7.0",
@@ -35,5 +40,5 @@
35
40
  "gitHooks": {
36
41
  "pre-commit": "lint-staged"
37
42
  },
38
- "gitHead": "fea796cf97c6a19e9c1206e52d521471e21b2eec"
43
+ "gitHead": "b12616df54e56709922c3dc064f381f3032c0b73"
39
44
  }