@kmkf-fe-packages/services-components 0.21.4 → 0.21.6-alpha.1

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.
package/README.md CHANGED
@@ -2,4 +2,4 @@
2
2
 
3
3
  - 针对于自定义组件的后缀,在提交的时候是以组件类型的驼峰式来命名的
4
4
 
5
- ---
5
+ ---
@@ -87,7 +87,7 @@ var BsLogistics = /*#__PURE__*/_createClass(function BsLogistics(_options) {
87
87
  dataType: "string"
88
88
  }];
89
89
  }
90
- if (type === 'logisticsCompany') {
90
+ if (type === "logisticsCompany") {
91
91
  var _typeMap$options$type3;
92
92
  return [{
93
93
  name: "物流公司",
@@ -96,7 +96,7 @@ var BsLogistics = /*#__PURE__*/_createClass(function BsLogistics(_options) {
96
96
  dataType: "string"
97
97
  }];
98
98
  }
99
- if (type === 'logisticsCode') {
99
+ if (type === "logisticsCode") {
100
100
  var _typeMap$options$type4;
101
101
  return [{
102
102
  name: "物流单号",
@@ -142,7 +142,8 @@ var BsLogistics = /*#__PURE__*/_createClass(function BsLogistics(_options) {
142
142
  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,
143
143
  component: /*#__PURE__*/React.createElement(JstGoods, _extends({}, _this.componentConfig, {
144
144
  type: 1,
145
- options: _this.expressDateInstance.getExpressData()
145
+ options: _this.expressDateInstance.getExpressData(),
146
+ onChange: p === null || p === void 0 ? void 0 : p.onChange
146
147
  }))
147
148
  });
148
149
  });
@@ -196,6 +197,6 @@ var BsLogistics = /*#__PURE__*/_createClass(function BsLogistics(_options) {
196
197
  }
197
198
  }] : [];
198
199
  this.expressDateInstance = ExpressData.getInstance();
199
- this.sortChildField = this.getSortChildFields(((_this$componentConfig4 = this.componentConfig) === null || _this$componentConfig4 === void 0 ? void 0 : _this$componentConfig4.showField) || '', _options);
200
+ this.sortChildField = this.getSortChildFields(((_this$componentConfig4 = this.componentConfig) === null || _this$componentConfig4 === void 0 ? void 0 : _this$componentConfig4.showField) || "", _options);
200
201
  });
201
202
  export default BsLogistics;
@@ -1,17 +1,17 @@
1
- import { ComponentInterface, PickOption, ColumnConfig, Record } from '../../type';
2
- import React from 'react';
1
+ import { ComponentInterface, PickOption, ColumnConfig, Record } from "../../type";
2
+ import React from "react";
3
3
  declare class BasicInput 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
  isCombinationComponent: boolean;
11
11
  formField: string;
12
12
  canSort: boolean;
13
13
  children: ComponentInterface[];
14
- dataType: ComponentInterface['dataType'];
14
+ dataType: ComponentInterface["dataType"];
15
15
  templateId?: string;
16
16
  workOrderUniqueKey?: string;
17
17
  constructor(options: PickOption);
@@ -9,11 +9,11 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
9
9
  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; }
10
10
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
11
11
  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); }
12
- import React from 'react';
13
- import { ApaasInput } from '@kmkf-fe-packages/basic-components';
12
+ import React from "react";
13
+ import { ApaasInput } from "@kmkf-fe-packages/basic-components";
14
14
  import GetFormItem from "../GetFormItem";
15
15
  import ItemView from "../../commonComponents/ItemView";
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
  import { replaceCheck } from "../../service/api";
19
19
  var BasicInput = /*#__PURE__*/_createClass(function BasicInput(options) {
@@ -35,7 +35,7 @@ var BasicInput = /*#__PURE__*/_createClass(function BasicInput(options) {
35
35
  _defineProperty(this, "workOrderUniqueKey", void 0);
36
36
  _defineProperty(this, "renderPc", function (value, record) {
37
37
  var _record;
38
- return /*#__PURE__*/React.createElement("span", null, (_record = record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_input")]) !== null && _record !== void 0 ? _record : '--');
38
+ return /*#__PURE__*/React.createElement("span", null, (_record = record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_input")]) !== null && _record !== void 0 ? _record : "--");
39
39
  });
40
40
  _defineProperty(this, "renderLog", function (r) {
41
41
  if (isNull(r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_input")])) return null;
@@ -46,7 +46,7 @@ var BasicInput = /*#__PURE__*/_createClass(function BasicInput(options) {
46
46
  });
47
47
  _defineProperty(this, "renderExport", function (value, record) {
48
48
  var _record2;
49
- return (_record2 = record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_input")]) !== null && _record2 !== void 0 ? _record2 : '--';
49
+ return (_record2 = record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_input")]) !== null && _record2 !== void 0 ? _record2 : "--";
50
50
  });
51
51
  _defineProperty(this, "renderClient", function (record) {
52
52
  return !isNull(record === null || record === void 0 ? void 0 : record[_this.id]) ? /*#__PURE__*/React.createElement(ItemView, {
@@ -62,10 +62,13 @@ var BasicInput = /*#__PURE__*/_createClass(function BasicInput(options) {
62
62
  name: _this.id,
63
63
  rules: _this.rules,
64
64
  hidden: p === null || p === void 0 ? void 0 : p.hidden,
65
- validateTrigger: ['onBlur', 'onChange'],
65
+ validateTrigger: ["onBlur", "onChange"],
66
66
  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,
67
67
  component: /*#__PURE__*/React.createElement(ApaasInput, _extends({}, _this.componentConfig, {
68
- placeholder: "\u8BF7\u8F93\u5165".concat(_this.name)
68
+ placeholder: "\u8BF7\u8F93\u5165".concat(_this.name),
69
+ onChange: function onChange(e) {
70
+ return p === null || p === void 0 ? void 0 : p.onChange(e.target.value);
71
+ }
69
72
  }))
70
73
  });
71
74
  });
@@ -77,10 +80,10 @@ var BasicInput = /*#__PURE__*/_createClass(function BasicInput(options) {
77
80
  // 过滤组件id
78
81
  name: item.name,
79
82
  // 过滤组件名称
80
- filterComponentType: 'Input',
83
+ filterComponentType: "Input",
81
84
  filterFn: function filterFn(value) {
82
85
  return function (i) {
83
- return "".concat(_filterFn.filterTableListItemColumnValue(i, item.id, 'input')).includes(value);
86
+ return "".concat(_filterFn.filterTableListItemColumnValue(i, item.id, "input")).includes(value);
84
87
  };
85
88
  }
86
89
  };
@@ -110,7 +113,7 @@ var BasicInput = /*#__PURE__*/_createClass(function BasicInput(options) {
110
113
  return item.test(value);
111
114
  });
112
115
  if (testList.length && !isTest) {
113
- return Promise.reject(new Error('请填写正确的格式'));
116
+ return Promise.reject(new Error("请填写正确的格式"));
114
117
  }
115
118
  if ((_this$componentConfig6 = _this.componentConfig) !== null && _this$componentConfig6 !== void 0 && (_this$componentConfig7 = _this$componentConfig6.rulesOptions) !== null && _this$componentConfig7 !== void 0 && _this$componentConfig7.length) {
116
119
  var _this$componentConfig8;
@@ -136,7 +139,7 @@ var BasicInput = /*#__PURE__*/_createClass(function BasicInput(options) {
136
139
  return Promise.resolve();
137
140
  }
138
141
  }, {
139
- validateTrigger: 'onBlur',
142
+ validateTrigger: "onBlur",
140
143
  validator: function () {
141
144
  var _validator = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(_, value) {
142
145
  var _this$componentConfig10;
@@ -171,7 +174,7 @@ var BasicInput = /*#__PURE__*/_createClass(function BasicInput(options) {
171
174
  _context.next = 10;
172
175
  break;
173
176
  }
174
- return _context.abrupt("return", Promise.reject(new Error('内容已存在,不能重复提交')));
177
+ return _context.abrupt("return", Promise.reject(new Error("内容已存在,不能重复提交")));
175
178
  case 10:
176
179
  case "end":
177
180
  return _context.stop();
@@ -187,6 +190,6 @@ var BasicInput = /*#__PURE__*/_createClass(function BasicInput(options) {
187
190
  this.isCombinationComponent = false;
188
191
  this.canSort = true;
189
192
  this.children = [];
190
- this.dataType = options !== null && options !== void 0 && (_options$componentCon = options.componentConfig) !== null && _options$componentCon !== void 0 && _options$componentCon.isNumber ? 'number' : 'string';
193
+ this.dataType = options !== null && options !== void 0 && (_options$componentCon = options.componentConfig) !== null && _options$componentCon !== void 0 && _options$componentCon.isNumber ? "number" : "string";
191
194
  });
192
195
  export default BasicInput;
@@ -64,7 +64,7 @@ var JstLogistics = /*#__PURE__*/_createClass(function JstLogistics(_options) {
64
64
  dataType: "string"
65
65
  }];
66
66
  }
67
- if (type === 'logisticsCompany') {
67
+ if (type === "logisticsCompany") {
68
68
  var _typeMap$options$type3;
69
69
  return [{
70
70
  name: "物流公司",
@@ -73,7 +73,7 @@ var JstLogistics = /*#__PURE__*/_createClass(function JstLogistics(_options) {
73
73
  dataType: "string"
74
74
  }];
75
75
  }
76
- if (type === 'logisticsCode') {
76
+ if (type === "logisticsCode") {
77
77
  var _typeMap$options$type4;
78
78
  return [{
79
79
  name: "物流单号",
@@ -198,6 +198,6 @@ var JstLogistics = /*#__PURE__*/_createClass(function JstLogistics(_options) {
198
198
  }] : [];
199
199
  this.align = "left";
200
200
  this.expressDateInstance = ExpressData.getInstance();
201
- this.sortChildField = this.getSortChildFields(((_this$componentConfig4 = this.componentConfig) === null || _this$componentConfig4 === void 0 ? void 0 : _this$componentConfig4.showField) || '', _options);
201
+ this.sortChildField = this.getSortChildFields(((_this$componentConfig4 = this.componentConfig) === null || _this$componentConfig4 === void 0 ? void 0 : _this$componentConfig4.showField) || "", _options);
202
202
  });
203
203
  export default JstLogistics;
@@ -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 Express from '../Express';
5
- import ExpressCode from '../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 Express from "../Express";
5
+ import ExpressCode from "../ExpressCode";
6
6
  declare class Logistics implements ComponentInterface {
7
7
  name: string;
8
8
  id: string;
@@ -17,7 +17,7 @@ declare class Logistics implements ComponentInterface {
17
17
  formField: string;
18
18
  canSort: boolean;
19
19
  children: ComponentInterface[];
20
- dataType: ComponentInterface['dataType'];
20
+ dataType: ComponentInterface["dataType"];
21
21
  constructor(options: PickOption);
22
22
  editRender: (p: any) => React.JSX.Element;
23
23
  renderClient: (record: Record) => React.JSX.Element;
@@ -8,9 +8,9 @@ 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 { ExpressLogistics } from '@kmkf-fe-packages/basic-components';
11
+ import React from "react";
12
+ import { ExpressData } from "@kmkf-fe-packages/kmkf-utils";
13
+ import { ExpressLogistics } from "@kmkf-fe-packages/basic-components";
14
14
  import Express from "../Express";
15
15
  import ExpressCode from "../ExpressCode";
16
16
  import GetFormItem from "../GetFormItem";
@@ -42,7 +42,8 @@ var Logistics = /*#__PURE__*/_createClass(function Logistics(options) {
42
42
  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,
43
43
  component: /*#__PURE__*/React.createElement(ExpressLogistics, _extends({}, _this.componentConfig, {
44
44
  options: _this.expressDateInstance.getExpressData(),
45
- onBlur: p === null || p === void 0 ? void 0 : p.onBlur
45
+ onBlur: p === null || p === void 0 ? void 0 : p.onBlur,
46
+ onChange: p === null || p === void 0 ? void 0 : p.onChange
46
47
  }))
47
48
  });
48
49
  });
@@ -66,9 +67,9 @@ var Logistics = /*#__PURE__*/_createClass(function Logistics(options) {
66
67
  });
67
68
  _defineProperty(this, "filterConfig", function (item) {
68
69
  return [_this.express.filterConfig(_objectSpread(_objectSpread({}, item), {}, {
69
- subKey: 'expressLogisticsCompany'
70
+ subKey: "expressLogisticsCompany"
70
71
  })), _this.expressCode.filterConfig(_objectSpread(_objectSpread({}, item), {}, {
71
- subKey: 'expressLogisticsCode'
72
+ subKey: "expressLogisticsCode"
72
73
  }))];
73
74
  });
74
75
  this.name = options.name;
@@ -79,33 +80,33 @@ var Logistics = /*#__PURE__*/_createClass(function Logistics(options) {
79
80
  this.componentConfig = options.componentConfig;
80
81
  this.expressDateInstance = ExpressData.getInstance();
81
82
  this.express = new Express(_objectSpread(_objectSpread({}, options), {}, {
82
- name: '快递物流公司',
83
+ name: "快递物流公司",
83
84
  id: "".concat(this.id, "_expressLogisticsCompany")
84
85
  }));
85
86
  this.expressCode = new ExpressCode(_objectSpread(_objectSpread({}, options), {}, {
86
- name: '快递物流单号',
87
+ name: "快递物流单号",
87
88
  id: "".concat(this.id, "_expressLogisticsCode")
88
89
  }));
89
90
  this.isCombinationComponent = true;
90
91
  this.canSort = false;
91
- this.dataType = 'object';
92
+ this.dataType = "object";
92
93
  this.children = [this.express, this.expressCode];
93
94
  this.rules = (_this$componentConfig3 = this.componentConfig) !== null && _this$componentConfig3 !== void 0 && _this$componentConfig3.required ? [{
94
95
  validator: function validator(_, value) {
95
96
  var _this$componentConfig4;
96
97
  if ((_this$componentConfig4 = _this.componentConfig) !== null && _this$componentConfig4 !== void 0 && _this$componentConfig4.isSingle) {
97
98
  var _this$componentConfig5, _this$componentConfig6;
98
- if (((_this$componentConfig5 = _this.componentConfig) === null || _this$componentConfig5 === void 0 ? void 0 : _this$componentConfig5.showField) === 'EXPRESS_COMPANY' && !(value !== null && value !== void 0 && value.company)) {
99
- return Promise.reject(new Error('请选择物流公司'));
100
- } else if (((_this$componentConfig6 = _this.componentConfig) === null || _this$componentConfig6 === void 0 ? void 0 : _this$componentConfig6.showField) === 'EXPRESS_WAYBILL_CODE' && !(value !== null && value !== void 0 && value.order)) {
101
- return Promise.reject(new Error('请输入物流单号'));
99
+ if (((_this$componentConfig5 = _this.componentConfig) === null || _this$componentConfig5 === void 0 ? void 0 : _this$componentConfig5.showField) === "EXPRESS_COMPANY" && !(value !== null && value !== void 0 && value.company)) {
100
+ return Promise.reject(new Error("请选择物流公司"));
101
+ } else if (((_this$componentConfig6 = _this.componentConfig) === null || _this$componentConfig6 === void 0 ? void 0 : _this$componentConfig6.showField) === "EXPRESS_WAYBILL_CODE" && !(value !== null && value !== void 0 && value.order)) {
102
+ return Promise.reject(new Error("请输入物流单号"));
102
103
  }
103
104
  } else {
104
105
  if (!(value !== null && value !== void 0 && value.company)) {
105
- return Promise.reject(new Error('请选择物流公司'));
106
+ return Promise.reject(new Error("请选择物流公司"));
106
107
  }
107
108
  if (!(value !== null && value !== void 0 && value.order)) {
108
- return Promise.reject(new Error('请输入物流单号'));
109
+ return Promise.reject(new Error("请输入物流单号"));
109
110
  }
110
111
  }
111
112
  return Promise.resolve();
@@ -0,0 +1,42 @@
1
+ import { ComponentInterface, PickOption, ColumnConfig, Record } from "../../type";
2
+ import React from "react";
3
+ import { ExpressData } from "@kmkf-fe-packages/kmkf-utils";
4
+ import TrajectoryCompany from "./trajectoryCompany";
5
+ import TrajectoryCode from "./trajectoryCode";
6
+ import TrajectorySnapshot from "./trajectorySnapshot";
7
+ declare class LogisticsMoreTrajectory implements ComponentInterface {
8
+ name: string;
9
+ id: string;
10
+ sortField: string;
11
+ type: string;
12
+ rules: any[];
13
+ componentConfig: ComponentInterface["componentConfig"];
14
+ expressDateInstance: InstanceType<typeof ExpressData>;
15
+ express: TrajectoryCompany;
16
+ expressCode: TrajectoryCode;
17
+ expressSnapshot: TrajectorySnapshot;
18
+ isCombinationComponent: boolean;
19
+ formField: string;
20
+ canSort: boolean;
21
+ children: ComponentInterface[];
22
+ dataType: ComponentInterface["dataType"];
23
+ constructor(options: PickOption);
24
+ editRender: (p: any) => React.JSX.Element;
25
+ renderClient: (record: Record) => React.JSX.Element | null;
26
+ renderPc: () => null;
27
+ renderLog: (r: Record) => React.JSX.Element;
28
+ getComponentValue: (r: Record) => {
29
+ company: any;
30
+ order: any;
31
+ snapshot: any;
32
+ };
33
+ renderExport: () => null;
34
+ filterConfig: (item: ColumnConfig) => {
35
+ searchDefaultConditions: "like";
36
+ type: string;
37
+ id: string;
38
+ name: string;
39
+ filterComponentType: "Input";
40
+ }[];
41
+ }
42
+ export default LogisticsMoreTrajectory;
@@ -0,0 +1,128 @@
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 ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
3
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
4
+ 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); } }
5
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
6
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
7
+ 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; }
8
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
9
+ 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); }
10
+ import React from "react";
11
+ import { ExpressData } from "@kmkf-fe-packages/kmkf-utils";
12
+ import { LogisticsMoreTrajectory as MoreTrajectory } from "@kmkf-fe-packages/basic-components";
13
+ import TrajectoryCompany from "./trajectoryCompany";
14
+ import TrajectoryCode from "./trajectoryCode";
15
+ import TrajectorySnapshot from "./trajectorySnapshot";
16
+ import GetFormItem from "../GetFormItem";
17
+ import ItemView from "../../commonComponents/ItemView";
18
+ import { isNull } from "@kmkf-fe-packages/kmkf-utils";
19
+ import { SYMBOL } from "../../constant";
20
+ var LogisticsMoreTrajectory = /*#__PURE__*/_createClass(function LogisticsMoreTrajectory(options) {
21
+ var _this = this,
22
+ _this$componentConfig3;
23
+ _classCallCheck(this, LogisticsMoreTrajectory);
24
+ _defineProperty(this, "name", void 0);
25
+ _defineProperty(this, "id", void 0);
26
+ _defineProperty(this, "sortField", void 0);
27
+ _defineProperty(this, "type", void 0);
28
+ _defineProperty(this, "rules", void 0);
29
+ _defineProperty(this, "componentConfig", void 0);
30
+ _defineProperty(this, "expressDateInstance", void 0);
31
+ _defineProperty(this, "express", void 0);
32
+ _defineProperty(this, "expressCode", void 0);
33
+ _defineProperty(this, "expressSnapshot", void 0);
34
+ _defineProperty(this, "isCombinationComponent", void 0);
35
+ _defineProperty(this, "formField", void 0);
36
+ _defineProperty(this, "canSort", void 0);
37
+ _defineProperty(this, "children", void 0);
38
+ _defineProperty(this, "dataType", void 0);
39
+ _defineProperty(this, "editRender", function (p) {
40
+ var _this$componentConfig, _this$componentConfig2;
41
+ return /*#__PURE__*/React.createElement(GetFormItem, {
42
+ title: _this.name,
43
+ name: _this.id,
44
+ rules: _this.rules,
45
+ hidden: p === null || p === void 0 ? void 0 : p.hidden,
46
+ 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,
47
+ component: /*#__PURE__*/React.createElement(MoreTrajectory, _this.componentConfig)
48
+ });
49
+ });
50
+ _defineProperty(this, "renderClient", function (record) {
51
+ return !isNull(record === null || record === void 0 ? void 0 : record[_this.id]) ? /*#__PURE__*/React.createElement(ItemView, {
52
+ id: _this.id,
53
+ label: _this.name,
54
+ value: record === null || record === void 0 ? void 0 : record[_this.id].map(function (item, index) {
55
+ return /*#__PURE__*/React.createElement("div", null, (record === null || record === void 0 ? void 0 : record[_this.id].length) > 1 ? "\u5305\u88F9".concat(index + 1, ":") : "", _this.expressDateInstance.getExpressNameByCode(item.trajectoryCompany) || item.trajectoryCompany, "/", item.trajectoryCode, "/", item.trajectorySnapshot);
56
+ })
57
+ }) : null;
58
+ });
59
+ _defineProperty(this, "renderPc", function () {
60
+ return null;
61
+ });
62
+ _defineProperty(this, "renderLog", function (r) {
63
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", null, _this.express.name, ": ", _this.express.renderLog(r)), /*#__PURE__*/React.createElement("div", null, _this.expressCode.name, ": ", _this.expressCode.renderLog(r)), /*#__PURE__*/React.createElement("div", null, _this.expressSnapshot.name, ":", _this.expressSnapshot.renderLog(r)));
64
+ });
65
+ _defineProperty(this, "getComponentValue", function (r) {
66
+ return {
67
+ company: _this.express.getComponentValue(r),
68
+ order: _this.expressCode.getComponentValue(r),
69
+ snapshot: _this.expressSnapshot.getComponentValue(r)
70
+ };
71
+ });
72
+ _defineProperty(this, "renderExport", function () {
73
+ return null;
74
+ });
75
+ _defineProperty(this, "filterConfig", function (item) {
76
+ return [{
77
+ searchDefaultConditions: SYMBOL.like,
78
+ type: item.type,
79
+ id: "".concat(item.id, "_trajectoryList"),
80
+ // 过滤组件id
81
+ name: item.name,
82
+ // 过滤组件名称
83
+ filterComponentType: "Input"
84
+ }];
85
+ });
86
+ this.name = options.name;
87
+ this.id = options.id;
88
+ this.sortField = options.id;
89
+ this.formField = options.id;
90
+ this.type = options.type;
91
+ this.componentConfig = options.componentConfig;
92
+ this.expressDateInstance = ExpressData.getInstance();
93
+ this.express = new TrajectoryCompany(_objectSpread(_objectSpread({}, options), {}, {
94
+ name: "".concat(this.name, "-\u516C\u53F8"),
95
+ id: "".concat(this.id, "_trajectoryList")
96
+ }));
97
+ this.expressCode = new TrajectoryCode(_objectSpread(_objectSpread({}, options), {}, {
98
+ name: "".concat(this.name, "-\u5355\u53F7"),
99
+ id: "".concat(this.id, "_trajectoryList")
100
+ }));
101
+ this.expressSnapshot = new TrajectorySnapshot(_objectSpread(_objectSpread({}, options), {}, {
102
+ name: "".concat(this.name, "-\u5FEB\u7167"),
103
+ id: "".concat(this.id, "_trajectoryList")
104
+ }));
105
+ this.isCombinationComponent = true;
106
+ this.canSort = false;
107
+ this.dataType = "object";
108
+ this.children = [this.express, this.expressCode, this.expressSnapshot];
109
+ this.rules = (_this$componentConfig3 = this.componentConfig) !== null && _this$componentConfig3 !== void 0 && _this$componentConfig3.required ? [{
110
+ required: true,
111
+ validator: function validator(_, value) {
112
+ var hasNoCompany = value.some(function (item) {
113
+ return !item.trajectoryCompany;
114
+ });
115
+ var hasNoCode = value.some(function (item) {
116
+ return !item.trajectoryCode;
117
+ });
118
+ if (!hasNoCompany) {
119
+ return Promise.reject(new Error("请选择物流公司"));
120
+ }
121
+ if (!hasNoCode) {
122
+ return Promise.reject(new Error("请输入物流单号"));
123
+ }
124
+ return Promise.resolve();
125
+ }
126
+ }] : [];
127
+ });
128
+ export default LogisticsMoreTrajectory;
@@ -0,0 +1,34 @@
1
+ import { ComponentInterface, PickOption, ColumnConfig, ALignType, Record } from "../../type";
2
+ import React from "react";
3
+ declare class TrajectoryCode implements ComponentInterface {
4
+ name: string;
5
+ id: string;
6
+ sortField: string;
7
+ type: string;
8
+ rules: any[];
9
+ componentConfig: ComponentInterface["componentConfig"];
10
+ align: ALignType;
11
+ width: number;
12
+ isCombinationComponent: boolean;
13
+ formField: string;
14
+ canSort: boolean;
15
+ children: ComponentInterface[];
16
+ dataType: ComponentInterface["dataType"];
17
+ constructor(options: PickOption);
18
+ renderCode: (list: any, w?: number) => React.JSX.Element;
19
+ renderClient: (record: any) => React.JSX.Element | null;
20
+ renderPc: (value: unknown, record: Record) => React.JSX.Element;
21
+ renderLog: (r: Record) => React.JSX.Element | null;
22
+ getComponentValue: (r: Record) => any;
23
+ renderExport: (value: string, record: Record) => any;
24
+ editRender: () => null;
25
+ filterConfig: (item: ColumnConfig) => {
26
+ searchDefaultConditions: "like";
27
+ type: string;
28
+ id: string;
29
+ name: string;
30
+ filterComponentType: "Input";
31
+ filterFn: (value: string) => (i: Record) => boolean;
32
+ };
33
+ }
34
+ export default TrajectoryCode;
@@ -0,0 +1,116 @@
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 _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
3
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
4
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
5
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
6
+ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
7
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
8
+ 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); } }
9
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
10
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
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
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
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 ItemView from "../../commonComponents/ItemView";
16
+ import { isNull, filterFn as _filterFn } from "@kmkf-fe-packages/kmkf-utils";
17
+ import QueryLogisticsTrack from "../../commonComponents/QueryLogisticsTrack";
18
+ import { SYMBOL } from "../../constant";
19
+ var TrajectoryCode = /*#__PURE__*/_createClass(function TrajectoryCode(options) {
20
+ var _this = this,
21
+ _this$componentConfig;
22
+ _classCallCheck(this, TrajectoryCode);
23
+ _defineProperty(this, "name", void 0);
24
+ _defineProperty(this, "id", void 0);
25
+ _defineProperty(this, "sortField", void 0);
26
+ _defineProperty(this, "type", void 0);
27
+ _defineProperty(this, "rules", void 0);
28
+ _defineProperty(this, "componentConfig", void 0);
29
+ _defineProperty(this, "align", void 0);
30
+ _defineProperty(this, "width", void 0);
31
+ _defineProperty(this, "isCombinationComponent", void 0);
32
+ _defineProperty(this, "formField", void 0);
33
+ _defineProperty(this, "canSort", void 0);
34
+ _defineProperty(this, "children", void 0);
35
+ _defineProperty(this, "dataType", void 0);
36
+ _defineProperty(this, "renderCode", function (list) {
37
+ var w = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 500;
38
+ return /*#__PURE__*/React.createElement("div", {
39
+ onClick: function onClick(e) {
40
+ return e.stopPropagation();
41
+ }
42
+ }, list.length ? list.map(function (item, index) {
43
+ return /*#__PURE__*/React.createElement(React.Fragment, null, list.length > 1 ? "\u5305\u88F9".concat(index + 1, ":") : "", /*#__PURE__*/React.createElement(QueryLogisticsTrack, {
44
+ title: item.trajectoryCode,
45
+ modelWidth: w,
46
+ interceptCompany: item.trajectoryCompany,
47
+ interceptCode: item.trajectoryCode,
48
+ interceptSenderMobile: item.trajectoryPhone
49
+ }));
50
+ }) : "--");
51
+ });
52
+ _defineProperty(this, "renderClient", function (record) {
53
+ var _this$id$split = _this.id.split("_"),
54
+ _this$id$split2 = _slicedToArray(_this$id$split, 1),
55
+ id = _this$id$split2[0];
56
+ return !isNull(record === null || record === void 0 ? void 0 : record[id]) ? /*#__PURE__*/React.createElement(ItemView, {
57
+ id: _this.id,
58
+ label: _this.name,
59
+ value: _this.renderCode(record[id])
60
+ }) : null;
61
+ });
62
+ _defineProperty(this, "renderPc", function (value, record) {
63
+ return _this.renderCode(record[_this.id], 700);
64
+ });
65
+ _defineProperty(this, "renderLog", function (r) {
66
+ if (isNull(r === null || r === void 0 ? void 0 : r[_this.id])) return null;
67
+ return _this.renderPc(undefined, r);
68
+ });
69
+ _defineProperty(this, "getComponentValue", function (r) {
70
+ return r === null || r === void 0 ? void 0 : r[_this.id].map(function (item) {
71
+ return item.trajectoryCode;
72
+ }).join();
73
+ });
74
+ _defineProperty(this, "renderExport", function (value, record) {
75
+ var _this$getComponentVal;
76
+ return (_this$getComponentVal = _this.getComponentValue(record)) !== null && _this$getComponentVal !== void 0 ? _this$getComponentVal : "--";
77
+ });
78
+ _defineProperty(this, "editRender", function () {
79
+ return null;
80
+ });
81
+ _defineProperty(this, "filterConfig", function (item) {
82
+ return {
83
+ searchDefaultConditions: SYMBOL.like,
84
+ type: item.type,
85
+ id: "".concat(item.id, "_trajectoryCode"),
86
+ name: "".concat(item.name, "-\u7269\u6D41\u5355\u53F7"),
87
+ filterComponentType: "Input",
88
+ filterFn: function filterFn(value) {
89
+ return function (i) {
90
+ return _filterFn.filterSplitComma(_filterFn.filterTableListItemColumnValue(i, item.id, "trajectoryCode"), value);
91
+ };
92
+ }
93
+ };
94
+ });
95
+ this.name = options.name;
96
+ this.id = options.id;
97
+ this.sortField = options.id;
98
+ this.formField = options.id;
99
+ this.type = options.type;
100
+ this.componentConfig = options.componentConfig;
101
+ this.rules = (_this$componentConfig = this.componentConfig) !== null && _this$componentConfig !== void 0 && _this$componentConfig.required ? [{
102
+ validator: function validator(_, value) {
103
+ if (/^[0-9a-zA-Z]*$/.test(value)) {
104
+ return Promise.resolve();
105
+ }
106
+ return Promise.reject(new Error("只能输入数字和字母"));
107
+ }
108
+ }] : [];
109
+ this.align = "left";
110
+ this.width = 200;
111
+ this.isCombinationComponent = false;
112
+ this.canSort = false;
113
+ this.dataType = "string";
114
+ this.children = [];
115
+ });
116
+ export default TrajectoryCode;
@@ -0,0 +1,40 @@
1
+ import { ComponentInterface, PickOption, ColumnConfig, ALignType, Record } from "../../type";
2
+ import React from "react";
3
+ import { ExpressData } from "@kmkf-fe-packages/kmkf-utils";
4
+ declare class TrajectoryCompany implements ComponentInterface {
5
+ name: string;
6
+ id: string;
7
+ sortField: string;
8
+ type: string;
9
+ rules: any[];
10
+ componentConfig: ComponentInterface["componentConfig"];
11
+ align: ALignType;
12
+ expressDateInstance: InstanceType<typeof ExpressData>;
13
+ width: number;
14
+ isCombinationComponent: boolean;
15
+ formField: string;
16
+ canSort: boolean;
17
+ children: ComponentInterface[];
18
+ dataType: ComponentInterface["dataType"];
19
+ options: ComponentInterface["options"];
20
+ constructor(options: PickOption);
21
+ renderCompany: (list: any) => any;
22
+ renderClient: (record: any) => React.JSX.Element | null;
23
+ renderPc: (value: unknown, record: Record) => React.JSX.Element;
24
+ renderLog: (r: Record) => React.JSX.Element | null;
25
+ getComponentValue: (r: Record) => any;
26
+ renderExport: (value: string, record: Record) => any;
27
+ editRender: () => null;
28
+ filterConfig: (item: ColumnConfig) => {
29
+ searchDefaultConditions: "in";
30
+ type: string;
31
+ id: string;
32
+ name: string;
33
+ filterComponentType: "MultipleSelect";
34
+ props: {
35
+ options: any[];
36
+ };
37
+ filterFn: (value: string) => (i: Record) => boolean;
38
+ };
39
+ }
40
+ export default TrajectoryCompany;
@@ -0,0 +1,108 @@
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 _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
3
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
4
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
5
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
6
+ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
7
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
8
+ 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); } }
9
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
10
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
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
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
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";
16
+ import ItemView from "../../commonComponents/ItemView";
17
+ import { isNull, filterFn as _filterFn } from "@kmkf-fe-packages/kmkf-utils";
18
+ import { SYMBOL } from "../../constant";
19
+ var TrajectoryCompany = /*#__PURE__*/_createClass(function TrajectoryCompany(options) {
20
+ var _this = this;
21
+ _classCallCheck(this, TrajectoryCompany);
22
+ _defineProperty(this, "name", void 0);
23
+ _defineProperty(this, "id", void 0);
24
+ _defineProperty(this, "sortField", void 0);
25
+ _defineProperty(this, "type", void 0);
26
+ _defineProperty(this, "rules", void 0);
27
+ _defineProperty(this, "componentConfig", void 0);
28
+ _defineProperty(this, "align", void 0);
29
+ _defineProperty(this, "expressDateInstance", void 0);
30
+ _defineProperty(this, "width", void 0);
31
+ _defineProperty(this, "isCombinationComponent", void 0);
32
+ _defineProperty(this, "formField", void 0);
33
+ _defineProperty(this, "canSort", void 0);
34
+ _defineProperty(this, "children", void 0);
35
+ _defineProperty(this, "dataType", void 0);
36
+ _defineProperty(this, "options", void 0);
37
+ _defineProperty(this, "renderCompany", function (list) {
38
+ return list.length ? list.map(function (item, index) {
39
+ return /*#__PURE__*/React.createElement("div", null, list.length > 1 ? "\u5305\u88F9".concat(index + 1, ":") : "", _this.expressDateInstance.getExpressNameByCode(item.trajectoryCompany) || item.trajectoryCompany);
40
+ }) : "--";
41
+ });
42
+ _defineProperty(this, "renderClient", function (record) {
43
+ var _this$id$split = _this.id.split("_"),
44
+ _this$id$split2 = _slicedToArray(_this$id$split, 1),
45
+ id = _this$id$split2[0];
46
+ return !isNull(record === null || record === void 0 ? void 0 : record[id]) ? /*#__PURE__*/React.createElement(ItemView, {
47
+ id: _this.id,
48
+ label: _this.name,
49
+ value: _this.renderCompany(record[id])
50
+ }) : null;
51
+ });
52
+ _defineProperty(this, "renderPc", function (value, record) {
53
+ if ((record === null || record === void 0 ? void 0 : record[_this.id]) === undefined) {
54
+ return /*#__PURE__*/React.createElement("span", null, "--");
55
+ }
56
+ return /*#__PURE__*/React.createElement("span", null, _this.renderCompany(record[_this.id]));
57
+ });
58
+ _defineProperty(this, "renderLog", function (r) {
59
+ if (isNull(r === null || r === void 0 ? void 0 : r[_this.id])) return null;
60
+ return _this.renderPc(undefined, r);
61
+ });
62
+ _defineProperty(this, "getComponentValue", function (r) {
63
+ return r === null || r === void 0 ? void 0 : r[_this.id].map(function (item) {
64
+ return _this.expressDateInstance.getExpressNameByCode(item.trajectoryCompany) || item.trajectoryCompany;
65
+ }).join();
66
+ });
67
+ _defineProperty(this, "renderExport", function (value, record) {
68
+ var _this$getComponentVal;
69
+ return (_this$getComponentVal = _this.getComponentValue(record)) !== null && _this$getComponentVal !== void 0 ? _this$getComponentVal : "--";
70
+ });
71
+ _defineProperty(this, "editRender", function () {
72
+ return null;
73
+ });
74
+ _defineProperty(this, "filterConfig", function (item) {
75
+ var subKey = item.subKey;
76
+ return {
77
+ searchDefaultConditions: SYMBOL.in,
78
+ type: item.type,
79
+ id: subKey ? "".concat(item.id, "_").concat(subKey) : item.id,
80
+ name: "".concat(item.name, "-\u7269\u6D41\u516C\u53F8"),
81
+ filterComponentType: "MultipleSelect",
82
+ props: {
83
+ options: _this.expressDateInstance.getExpressData() || []
84
+ },
85
+ filterFn: function filterFn(value) {
86
+ return function (i) {
87
+ return _filterFn.filterSplitComma(_filterFn.filterTableListItemColumnValue(i, item.id, "".concat(subKey)), value);
88
+ };
89
+ }
90
+ };
91
+ });
92
+ this.name = options.name;
93
+ this.id = options.id;
94
+ this.sortField = options.id;
95
+ this.formField = options.id;
96
+ this.type = options.type;
97
+ this.componentConfig = options.componentConfig;
98
+ this.rules = [];
99
+ this.align = "left";
100
+ this.expressDateInstance = ExpressData.getInstance();
101
+ this.width = 200;
102
+ this.isCombinationComponent = false;
103
+ this.canSort = false;
104
+ this.children = [];
105
+ this.dataType = "string";
106
+ this.options = this.expressDateInstance.getExpressData() || [];
107
+ });
108
+ export default TrajectoryCompany;
@@ -0,0 +1,32 @@
1
+ import { ComponentInterface, PickOption, ColumnConfig, ALignType, Record } from "../../type";
2
+ import React from "react";
3
+ declare class TrajectorySnapshot implements ComponentInterface {
4
+ name: string;
5
+ id: string;
6
+ sortField: string;
7
+ type: string;
8
+ componentConfig: ComponentInterface["componentConfig"];
9
+ align: ALignType;
10
+ width: number;
11
+ isCombinationComponent: boolean;
12
+ formField: string;
13
+ canSort: boolean;
14
+ children: ComponentInterface[];
15
+ dataType: ComponentInterface["dataType"];
16
+ constructor(options: PickOption);
17
+ renderCode: (list: any) => React.JSX.Element;
18
+ renderClient: (record: any) => React.JSX.Element | null;
19
+ renderPc: (value: unknown, record: Record) => React.JSX.Element;
20
+ renderLog: (r: Record) => React.JSX.Element | null;
21
+ getComponentValue: (r: Record) => any;
22
+ renderExport: (value: string, record: Record) => any;
23
+ editRender: () => null;
24
+ filterConfig: (item: ColumnConfig) => {
25
+ searchDefaultConditions: "like";
26
+ type: string;
27
+ id: string;
28
+ name: string;
29
+ filterComponentType: "Input";
30
+ };
31
+ }
32
+ export default TrajectorySnapshot;
@@ -0,0 +1,89 @@
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 _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
3
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
4
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
5
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
6
+ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
7
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
8
+ 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); } }
9
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
10
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
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
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
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 ItemView from "../../commonComponents/ItemView";
16
+ import { isNull } from "@kmkf-fe-packages/kmkf-utils";
17
+ import { SYMBOL } from "../../constant";
18
+ var TrajectorySnapshot = /*#__PURE__*/_createClass(function TrajectorySnapshot(options) {
19
+ var _this = this;
20
+ _classCallCheck(this, TrajectorySnapshot);
21
+ _defineProperty(this, "name", void 0);
22
+ _defineProperty(this, "id", void 0);
23
+ _defineProperty(this, "sortField", void 0);
24
+ _defineProperty(this, "type", void 0);
25
+ _defineProperty(this, "componentConfig", void 0);
26
+ _defineProperty(this, "align", void 0);
27
+ _defineProperty(this, "width", void 0);
28
+ _defineProperty(this, "isCombinationComponent", void 0);
29
+ _defineProperty(this, "formField", void 0);
30
+ _defineProperty(this, "canSort", void 0);
31
+ _defineProperty(this, "children", void 0);
32
+ _defineProperty(this, "dataType", void 0);
33
+ _defineProperty(this, "renderCode", function (list) {
34
+ return /*#__PURE__*/React.createElement("div", null, list.length ? list.map(function (item, index) {
35
+ return /*#__PURE__*/React.createElement(React.Fragment, null, list.length > 1 ? "\u5305\u88F9".concat(index + 1, ":") : "", item.trajectorySnapshot);
36
+ }) : "--");
37
+ });
38
+ _defineProperty(this, "renderClient", function (record) {
39
+ var _this$id$split = _this.id.split("_"),
40
+ _this$id$split2 = _slicedToArray(_this$id$split, 1),
41
+ id = _this$id$split2[0];
42
+ return !isNull(record === null || record === void 0 ? void 0 : record[id]) ? /*#__PURE__*/React.createElement(ItemView, {
43
+ id: _this.id,
44
+ label: _this.name,
45
+ value: _this.renderCode(record[id])
46
+ }) : null;
47
+ });
48
+ _defineProperty(this, "renderPc", function (value, record) {
49
+ return _this.renderCode(record[_this.id]);
50
+ });
51
+ _defineProperty(this, "renderLog", function (r) {
52
+ if (isNull(r === null || r === void 0 ? void 0 : r[_this.id])) return null;
53
+ return _this.renderPc(undefined, r);
54
+ });
55
+ _defineProperty(this, "getComponentValue", function (r) {
56
+ return r === null || r === void 0 ? void 0 : r[_this.id].map(function (item) {
57
+ return item.trajectorySnapshot;
58
+ }).join();
59
+ });
60
+ _defineProperty(this, "renderExport", function (value, record) {
61
+ var _this$getComponentVal;
62
+ return (_this$getComponentVal = _this.getComponentValue(record)) !== null && _this$getComponentVal !== void 0 ? _this$getComponentVal : "--";
63
+ });
64
+ _defineProperty(this, "editRender", function () {
65
+ return null;
66
+ });
67
+ _defineProperty(this, "filterConfig", function (item) {
68
+ return {
69
+ searchDefaultConditions: SYMBOL.like,
70
+ type: item.type,
71
+ id: item.id,
72
+ name: "".concat(item.name, "-\u7269\u6D41\u5FEB\u7167"),
73
+ filterComponentType: "Input"
74
+ };
75
+ });
76
+ this.name = options.name;
77
+ this.id = options.id;
78
+ this.sortField = options.id;
79
+ this.formField = options.id;
80
+ this.type = options.type;
81
+ this.componentConfig = options.componentConfig;
82
+ this.align = "left";
83
+ this.width = 200;
84
+ this.isCombinationComponent = false;
85
+ this.canSort = false;
86
+ this.dataType = "string";
87
+ this.children = [];
88
+ });
89
+ export default TrajectorySnapshot;
@@ -169,7 +169,7 @@ var BasicPosting = /*#__PURE__*/_createClass(function BasicPosting(options) {
169
169
  hidden: p === null || p === void 0 ? void 0 : p.hidden,
170
170
  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,
171
171
  component: /*#__PURE__*/React.createElement(ApaasPosting, _extends({}, _this.componentConfig, {
172
- type: _this.type === "BS_POSTING" ? "bs" : (_this$componentConfig3 = _this.componentConfig) === null || _this$componentConfig3 === void 0 ? void 0 : _this$componentConfig3.showField
172
+ type: _this.type === "POSTING" || ((_this$componentConfig3 = _this.componentConfig) === null || _this$componentConfig3 === void 0 ? void 0 : _this$componentConfig3.showField) === "workOrder" ? "workOrder" : "bs"
173
173
  }))
174
174
  });
175
175
  });
@@ -1,3 +1,3 @@
1
- import { JstLogistics, JstItemSelect, JstSupply, JstSendGood, BasicInput, BasicAddress, BasicCascader, BasicCheckbox, BasicDataTime, BasicSelect, BasicRadio, BasicTextArea, BasicPicture, BasicMultSelect, BasicGrade, BasicRate, BasicFile, BasicPosting, CommonDataTime, TradeId, ShopName, ErpTradeId, BuyerNick, ReceiverName, ReceiverMobile, ReceiverAddress, TradeDateTime, Logistics, ReturnLogistics, ActualPayment, ERemark, AliPay, ItemSelect, ItemId, ItemEnCode, SystemOrderNo, Ordinary, ThirdItemSelect, FlowStatusSelect, FlowMarkSelect, FlowTag, Payment, TemplateSelect, WorkOrderId, PlatForm, ShopInput, Submitter, PrevSubmitter, FlowCreator, Handler, CompletedUser, LogisticsInterception, LogisticsTrajectory, FlowWorkOrderId, BsGoods, BsExchange, BsReissue, BsReturn, BsSystemOrder, BsLogistics, StatusSelect, CommonSystemOrder, CommonMultiStatus, Calculation, NodeDeadLine, HandlerDeadLine, NodeStayDuration, WlnGoods, BsPosting, MsgStatus } from "./index";
1
+ import { JstLogistics, JstItemSelect, JstSupply, JstSendGood, BasicInput, BasicAddress, BasicCascader, BasicCheckbox, BasicDataTime, BasicSelect, BasicRadio, BasicTextArea, BasicPicture, BasicMultSelect, BasicGrade, BasicRate, BasicFile, BasicPosting, CommonDataTime, TradeId, ShopName, ErpTradeId, BuyerNick, ReceiverName, ReceiverMobile, ReceiverAddress, TradeDateTime, Logistics, ReturnLogistics, ActualPayment, ERemark, AliPay, ItemSelect, ItemId, ItemEnCode, SystemOrderNo, Ordinary, ThirdItemSelect, FlowStatusSelect, FlowMarkSelect, FlowTag, Payment, TemplateSelect, WorkOrderId, PlatForm, ShopInput, Submitter, PrevSubmitter, FlowCreator, Handler, CompletedUser, LogisticsInterception, LogisticsTrajectory, LogisticsMoreTrajectory, FlowWorkOrderId, BsGoods, BsExchange, BsReissue, BsReturn, BsSystemOrder, BsLogistics, StatusSelect, CommonSystemOrder, CommonMultiStatus, Calculation, NodeDeadLine, HandlerDeadLine, NodeStayDuration, WlnGoods, BsPosting, MsgStatus } from "./index";
2
2
  import { PickOption } from "./type";
3
- export declare const factory: (type: string, options: PickOption) => ActualPayment | BasicAddress | BsExchange | BsGoods | BsLogistics | BsPosting | BsReissue | BsReturn | BsSystemOrder | BuyerNick | Calculation | BasicCascader | BasicCheckbox | CommonDataTime | CommonMultiStatus | CommonSystemOrder | CompletedUser | BasicDataTime | ItemEnCode | ItemId | ItemSelect | ErpTradeId | BasicFile | FlowCreator | FlowMarkSelect | FlowStatusSelect | FlowTag | FlowWorkOrderId | Handler | HandlerDeadLine | BasicInput | JstItemSelect | JstLogistics | JstSendGood | JstSupply | LogisticsInterception | LogisticsTrajectory | MsgStatus | NodeDeadLine | NodeStayDuration | Payment | BasicPicture | PlatForm | BasicPosting | PrevSubmitter | BasicRadio | BasicRate | ReceiverAddress | ReceiverMobile | ReceiverName | ERemark | BasicSelect | ShopInput | StatusSelect | Submitter | BasicTextArea | ThirdItemSelect | TradeDateTime | TradeId | WlnGoods | WorkOrderId | BasicMultSelect | BasicGrade | ShopName | Logistics | ReturnLogistics | AliPay | SystemOrderNo | Ordinary | TemplateSelect;
3
+ export declare const factory: (type: string, options: PickOption) => BsLogistics | ItemEnCode | JstLogistics | LogisticsMoreTrajectory | Payment | BasicPosting | TradeId | BasicInput | BasicAddress | BasicCascader | BasicCheckbox | BasicDataTime | BasicSelect | BasicRadio | BasicTextArea | BasicPicture | BasicMultSelect | BasicGrade | BasicRate | BasicFile | CommonDataTime | ErpTradeId | ShopName | BuyerNick | ReceiverName | ReceiverMobile | ReceiverAddress | TradeDateTime | Logistics | ReturnLogistics | ActualPayment | ERemark | AliPay | ItemSelect | ItemId | SystemOrderNo | Ordinary | ThirdItemSelect | JstItemSelect | JstSendGood | JstSupply | BsSystemOrder | BsGoods | BsExchange | BsReissue | BsReturn | FlowStatusSelect | FlowMarkSelect | FlowTag | TemplateSelect | WorkOrderId | LogisticsInterception | LogisticsTrajectory | PlatForm | ShopInput | Submitter | PrevSubmitter | FlowCreator | Handler | CompletedUser | FlowWorkOrderId | StatusSelect | Calculation | CommonSystemOrder | CommonMultiStatus | NodeDeadLine | HandlerDeadLine | NodeStayDuration | WlnGoods | BsPosting | MsgStatus;
@@ -1,4 +1,4 @@
1
- import { JstLogistics, JstItemSelect, JstSupply, JstSendGood, BasicInput, BasicAddress, BasicCascader, BasicCheckbox, BasicDataTime, BasicSelect, BasicRadio, BasicTextArea, BasicPicture, BasicMultSelect, BasicGrade, BasicRate, BasicFile, BasicPosting, CommonDataTime, TradeId, ShopName, ErpTradeId, BuyerNick, ReceiverName, ReceiverMobile, ReceiverAddress, TradeDateTime, Logistics, ReturnLogistics, ActualPayment, ERemark, AliPay, ItemSelect, ItemId, ItemEnCode, SystemOrderNo, Ordinary, ThirdItemSelect, FlowStatusSelect, FlowMarkSelect, FlowTag, Payment, TemplateSelect, WorkOrderId, PlatForm, ShopInput, Submitter, PrevSubmitter, FlowCreator, Handler, CompletedUser, LogisticsInterception, LogisticsTrajectory, FlowWorkOrderId, BsGoods, BsExchange, BsReissue, BsReturn, BsSystemOrder, BsLogistics, StatusSelect,
1
+ import { JstLogistics, JstItemSelect, JstSupply, JstSendGood, BasicInput, BasicAddress, BasicCascader, BasicCheckbox, BasicDataTime, BasicSelect, BasicRadio, BasicTextArea, BasicPicture, BasicMultSelect, BasicGrade, BasicRate, BasicFile, BasicPosting, CommonDataTime, TradeId, ShopName, ErpTradeId, BuyerNick, ReceiverName, ReceiverMobile, ReceiverAddress, TradeDateTime, Logistics, ReturnLogistics, ActualPayment, ERemark, AliPay, ItemSelect, ItemId, ItemEnCode, SystemOrderNo, Ordinary, ThirdItemSelect, FlowStatusSelect, FlowMarkSelect, FlowTag, Payment, TemplateSelect, WorkOrderId, PlatForm, ShopInput, Submitter, PrevSubmitter, FlowCreator, Handler, CompletedUser, LogisticsInterception, LogisticsTrajectory, LogisticsMoreTrajectory, FlowWorkOrderId, BsGoods, BsExchange, BsReissue, BsReturn, BsSystemOrder, BsLogistics, StatusSelect,
2
2
  // CommonTradeId,
3
3
  CommonSystemOrder, CommonMultiStatus, Calculation, NodeDeadLine, HandlerDeadLine, NodeStayDuration, WlnGoods, BsPosting, MsgStatus } from "./index";
4
4
  export var factory = function factory(type, options) {
@@ -98,6 +98,8 @@ export var factory = function factory(type, options) {
98
98
  return new LogisticsInterception(options);
99
99
  case "LOGISTICS_TRAJECTORY":
100
100
  return new LogisticsTrajectory(options);
101
+ case "LOGISTICS_TRAJECTORY_MORE":
102
+ return new LogisticsMoreTrajectory(options);
101
103
  case "WORK_ORDER_ID_INPUT":
102
104
  return new WorkOrderId(options);
103
105
  case "FLOW_STATUS_SELECT":
@@ -138,7 +140,7 @@ export var factory = function factory(type, options) {
138
140
  return new BsReissue(options);
139
141
  case "BS_RETURN_GOODS":
140
142
  return new BsReturn(options);
141
- case 'REISSUE_TRADE_ID':
143
+ case "REISSUE_TRADE_ID":
142
144
  case "BS_DELIVERY_NO":
143
145
  case "RETURN_GOODS_TRADE_ID":
144
146
  case "EXCHANGE_TRADE_ID":
@@ -50,6 +50,7 @@ export { default as TemplateSelect } from "./components/TemplateSelect";
50
50
  export { default as WorkOrderId } from "./components/WorkOrderId";
51
51
  export { default as LogisticsInterception } from "./components/LogisticsInterception";
52
52
  export { default as LogisticsTrajectory } from "./components/LogisticsTrajectory";
53
+ export { default as LogisticsMoreTrajectory } from "./components/LogisticsMoreTrajectory";
53
54
  export { default as PlatForm } from "./components/PlatForm";
54
55
  export { default as ShopInput } from "./components/ShopInput";
55
56
  export { default as Submitter } from "./components/Submitter";
@@ -68,7 +69,7 @@ export { default as HandlerDeadLine } from "./components/HandlerDeadLine";
68
69
  export { default as NodeStayDuration } from "./components/NodeStayDuration";
69
70
  export { default as WlnGoods } from "./components/WLN/WlnGoods";
70
71
  export { default as BsPosting } from "./components/BS/BsPosting";
71
- export { default as MsgStatus } from './components/MsgStatus';
72
+ export { default as MsgStatus } from "./components/MsgStatus";
72
73
  export { factory } from "./factory";
73
74
  export { default as PlatformAvatar } from "./commonComponents/PlatformAvatar";
74
75
  export { default as SelectMark } from "./commonComponents/SelectMark";
package/dist/esm/index.js CHANGED
@@ -50,6 +50,7 @@ export { default as TemplateSelect } from "./components/TemplateSelect";
50
50
  export { default as WorkOrderId } from "./components/WorkOrderId";
51
51
  export { default as LogisticsInterception } from "./components/LogisticsInterception";
52
52
  export { default as LogisticsTrajectory } from "./components/LogisticsTrajectory";
53
+ export { default as LogisticsMoreTrajectory } from "./components/LogisticsMoreTrajectory";
53
54
  export { default as PlatForm } from "./components/PlatForm";
54
55
  export { default as ShopInput } from "./components/ShopInput";
55
56
  export { default as Submitter } from "./components/Submitter";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kmkf-fe-packages/services-components",
3
- "version": "0.21.4",
3
+ "version": "0.21.6-alpha.1",
4
4
  "module": "dist/esm/index.js",
5
5
  "typings": "dist/esm/index.d.ts",
6
6
  "files": [
@@ -20,8 +20,8 @@
20
20
  ]
21
21
  },
22
22
  "dependencies": {
23
- "@kmkf-fe-packages/basic-components": "^0.21.4",
24
- "@kmkf-fe-packages/kmkf-utils": "^0.21.4"
23
+ "@kmkf-fe-packages/basic-components": "^0.21.6-alpha.1",
24
+ "@kmkf-fe-packages/kmkf-utils": "^0.21.6-alpha.1"
25
25
  },
26
26
  "devDependencies": {
27
27
  "@typescript-eslint/eslint-plugin": "^5.59.2",
@@ -37,7 +37,7 @@
37
37
  "publishConfig": {
38
38
  "access": "public"
39
39
  },
40
- "gitHead": "510c76d8426f214eb5653d9e75a59fa44e318939",
40
+ "gitHead": "d542c40a1e72468eba0e31e0e290460dad5fbc84",
41
41
  "gitHooks": {
42
42
  "pre-commit": "lint-staged"
43
43
  }