@kmkf-fe-packages/services-components 0.7.14-alpha.5 → 0.7.15-alpha.0

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.
Files changed (32) hide show
  1. package/dist/esm/commonComponents/OperationLog/index.js +3 -1
  2. package/dist/esm/components/ActualPayment/index.d.ts +5 -3
  3. package/dist/esm/components/ActualPayment/index.js +38 -17
  4. package/dist/esm/components/BsLogistics/index.d.ts +50 -0
  5. package/dist/esm/components/BsLogistics/index.js +115 -0
  6. package/dist/esm/components/BsSendGood/index.d.ts +25 -0
  7. package/dist/esm/components/BsSendGood/index.js +116 -0
  8. package/dist/esm/components/Common/index.d.ts +5 -5
  9. package/dist/esm/components/CommonDataTime/index.d.ts +4 -4
  10. package/dist/esm/components/CommonDataTime/index.js +13 -13
  11. package/dist/esm/components/DataTime/ApaasDate.d.ts +2 -2
  12. package/dist/esm/components/EItemEnCode/ItemEncode.d.ts +2 -2
  13. package/dist/esm/components/EItemId/ItemId.d.ts +2 -2
  14. package/dist/esm/components/EItemSelect/ItemSelect.d.ts +2 -2
  15. package/dist/esm/components/ExpressCompany/index.d.ts +2 -2
  16. package/dist/esm/components/File/index.d.ts +33 -0
  17. package/dist/esm/components/File/index.js +117 -0
  18. package/dist/esm/components/FlowStatusSelect/index.js +5 -8
  19. package/dist/esm/components/Input/index.d.ts +3 -3
  20. package/dist/esm/components/Input/index.js +28 -14
  21. package/dist/esm/components/Popover/index.d.ts +2 -2
  22. package/dist/esm/components/PostIng/index.d.ts +33 -0
  23. package/dist/esm/components/PostIng/index.js +144 -0
  24. package/dist/esm/components/ThirdItemSelect/ItemEncode.d.ts +2 -2
  25. package/dist/esm/components/TradeDateTime/index.d.ts +5 -5
  26. package/dist/esm/components/TradeDateTime/index.js +28 -33
  27. package/dist/esm/factory.d.ts +3 -3
  28. package/dist/esm/factory.js +65 -51
  29. package/dist/esm/index.d.ts +4 -0
  30. package/dist/esm/index.js +4 -0
  31. package/dist/esm/type.d.ts +20 -3
  32. package/package.json +4 -4
@@ -18,6 +18,8 @@ var OperationLog = function OperationLog(_ref) {
18
18
  componentDtoList = _ref.componentDtoList;
19
19
  if (!content) return null;
20
20
  try {
21
+ //todo过滤一些固定字段 展示不确定
22
+ var filterList = ["COMPLETED_DATETIME", "COMPLETED_USER_INPUT"];
21
23
  if (/^TRANSFER/.test(operation)) {
22
24
  if (/^\[.*?\]-->>\[.*?\]$/.test(content)) {
23
25
  var _content$split = content.split("-->>"),
@@ -71,7 +73,7 @@ var OperationLog = function OperationLog(_ref) {
71
73
  }, {});
72
74
  var currentNeedContentId = Object.keys(currentContent);
73
75
  var newTemplateColumns = componentDtoList === null || componentDtoList === void 0 ? void 0 : componentDtoList.filter(function (item) {
74
- return currentNeedContentId.findIndex(function (id) {
76
+ return !filterList.includes(item.workOrderComponentType) && currentNeedContentId.findIndex(function (id) {
75
77
  return id === null || id === void 0 ? void 0 : id.startsWith(item === null || item === void 0 ? void 0 : item.uniqueKey);
76
78
  }) > -1;
77
79
  });
@@ -1,5 +1,5 @@
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 ActualPayment implements ComponentInterface {
4
4
  name: string;
5
5
  id: string;
@@ -11,8 +11,10 @@ declare class ActualPayment implements ComponentInterface {
11
11
  canSort: boolean;
12
12
  children: ComponentInterface[];
13
13
  componentConfig: ComponentInterface["componentConfig"];
14
- dataType: ComponentInterface['dataType'];
14
+ dataType: ComponentInterface["dataType"];
15
+ dataMap: Record;
15
16
  constructor(options: PickOption);
17
+ getKeyByComponentType: (type: string) => any;
16
18
  renderClient: (record: any) => React.JSX.Element | null;
17
19
  renderPc: (value: unknown, record: Record) => React.JSX.Element;
18
20
  renderLog: (r: Record) => React.JSX.Element | null;
@@ -9,12 +9,18 @@ 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
+ var typeMap = {
19
+ ACTUAL_PAYMENT: "actualPayment",
20
+ BS_NET_RECEIPTS: "bsNetReceipts",
21
+ BS_DEPOSIT: "bsDeposit",
22
+ BS_PACKAGE_WEIGHT: "bsPackageWeight"
23
+ };
18
24
  var ActualPayment = /*#__PURE__*/_createClass(function ActualPayment(options) {
19
25
  var _this = this;
20
26
  _classCallCheck(this, ActualPayment);
@@ -29,6 +35,10 @@ var ActualPayment = /*#__PURE__*/_createClass(function ActualPayment(options) {
29
35
  _defineProperty(this, "children", void 0);
30
36
  _defineProperty(this, "componentConfig", void 0);
31
37
  _defineProperty(this, "dataType", void 0);
38
+ _defineProperty(this, "dataMap", void 0);
39
+ _defineProperty(this, "getKeyByComponentType", function (type) {
40
+ return typeMap[type] || "";
41
+ });
32
42
  _defineProperty(this, "renderClient", function (record) {
33
43
  return !isNull(record === null || record === void 0 ? void 0 : record[_this.id]) ? /*#__PURE__*/React.createElement(ItemView, {
34
44
  id: _this.id,
@@ -38,18 +48,22 @@ var ActualPayment = /*#__PURE__*/_createClass(function ActualPayment(options) {
38
48
  });
39
49
  _defineProperty(this, "renderPc", function (value, record) {
40
50
  var _record;
41
- return /*#__PURE__*/React.createElement("span", null, (_record = record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_actualPayment")]) !== null && _record !== void 0 ? _record : '--');
51
+ var type = _this.type;
52
+ return /*#__PURE__*/React.createElement("span", null, (_record = record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_").concat(typeMap[type])]) !== null && _record !== void 0 ? _record : "--");
42
53
  });
43
54
  _defineProperty(this, "renderLog", function (r) {
44
- if (isNull(r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_actualPayment")])) return null;
55
+ var type = _this.type;
56
+ if (isNull(r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_").concat(typeMap[type])])) return null;
45
57
  return _this.renderPc(undefined, r);
46
58
  });
47
59
  _defineProperty(this, "getComponentValue", function (r) {
48
- return r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_actualPayment")];
60
+ var type = _this.type;
61
+ return r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_").concat(typeMap[type])];
49
62
  });
50
63
  _defineProperty(this, "renderExport", function (value, record) {
51
64
  var _record2;
52
- return (_record2 = record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_actualPayment")]) !== null && _record2 !== void 0 ? _record2 : '--';
65
+ var type = _this.type;
66
+ return (_record2 = record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_").concat(typeMap[type])]) !== null && _record2 !== void 0 ? _record2 : "--";
53
67
  });
54
68
  _defineProperty(this, "editRender", function (p) {
55
69
  var _this$componentConfig, _this$componentConfig2;
@@ -65,14 +79,15 @@ var ActualPayment = /*#__PURE__*/_createClass(function ActualPayment(options) {
65
79
  });
66
80
  });
67
81
  _defineProperty(this, "filterConfig", function (item) {
82
+ var key = _this.getKeyByComponentType(item.type);
68
83
  return {
69
84
  searchDefaultConditions: SYMBOL.between,
70
85
  type: item.type,
71
- id: "".concat(item.id, "_actualPayment"),
86
+ id: "".concat(item.id, "_").concat(key),
72
87
  // 过滤组件id
73
88
  name: item.name,
74
89
  // 过滤组件名称
75
- filterComponentType: 'Rate',
90
+ filterComponentType: "Rate",
76
91
  rules: [{
77
92
  validator: function () {
78
93
  var _validator = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(_, value) {
@@ -97,13 +112,13 @@ var ActualPayment = /*#__PURE__*/_createClass(function ActualPayment(options) {
97
112
  _context.next = 5;
98
113
  break;
99
114
  }
100
- return _context.abrupt("return", Promise.reject(new Error('请输入正确的金额区间范围')));
115
+ return _context.abrupt("return", Promise.reject(new Error("请输入正确的金额区间范围")));
101
116
  case 5:
102
117
  if (!(value[0] > value[1])) {
103
118
  _context.next = 7;
104
119
  break;
105
120
  }
106
- return _context.abrupt("return", Promise.reject(new Error('开始金额必须小于结束金额')));
121
+ return _context.abrupt("return", Promise.reject(new Error("开始金额必须小于结束金额")));
107
122
  case 7:
108
123
  case "end":
109
124
  return _context.stop();
@@ -117,7 +132,7 @@ var ActualPayment = /*#__PURE__*/_createClass(function ActualPayment(options) {
117
132
  }()
118
133
  }],
119
134
  props: {
120
- placeholder: ['始-实付金额', '终-实付金额']
135
+ placeholder: ["始-实付金额", "终-实付金额"]
121
136
  },
122
137
  formatFilterValue: function formatFilterValue(val) {
123
138
  if (val !== null && val !== void 0 && val.some(function (v) {
@@ -129,24 +144,30 @@ var ActualPayment = /*#__PURE__*/_createClass(function ActualPayment(options) {
129
144
  },
130
145
  filterFn: function filterFn(value) {
131
146
  return function (i) {
132
- return "".concat(_filterFn.filterTableListItemColumnValue(i, item.id, 'actualPayment')).includes(value);
147
+ return "".concat(_filterFn.filterTableListItemColumnValue(i, item.id, key)).includes(value);
133
148
  };
134
149
  }
135
150
  };
136
151
  });
137
152
  this.id = options.id;
138
- this.sortField = "".concat(options.id, "_actualPayment");
139
- this.formField = "".concat(options.id, "_actualPayment");
153
+ this.sortField = "".concat(options.id, "_").concat(this.getKeyByComponentType(options.type));
154
+ this.formField = "".concat(options.id, "_").concat(this.getKeyByComponentType(options.type));
140
155
  this.name = options.name;
141
156
  this.type = options.type;
142
- this.dataType = 'number';
157
+ this.dataType = "number";
143
158
  this.isCombinationComponent = false;
144
159
  this.canSort = true;
145
160
  this.children = [];
146
161
  this.componentConfig = options.componentConfig;
147
162
  this.rules = [{
148
163
  pattern: /^\d+(\.\d{1,2})?$/,
149
- message: '字段为正数或最多两位小数'
164
+ message: "字段为正数或最多两位小数"
150
165
  }];
166
+ this.dataMap = {
167
+ ACTUAL_PAYMENT: "actualPayment",
168
+ BS_NET_RECEIPTS: "bsNetReceipts",
169
+ BS_DEPOSIT: "bsDeposit",
170
+ BS_PACKAGE_WEIGHT: "bsPackageWeight"
171
+ };
151
172
  });
152
173
  export default ActualPayment;
@@ -0,0 +1,50 @@
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
+ declare class BsLogistics implements ComponentInterface {
7
+ name: string;
8
+ id: string;
9
+ sortField: string;
10
+ type: string;
11
+ rules: any[];
12
+ componentConfig: ComponentInterface["componentConfig"];
13
+ expressDateInstance: InstanceType<typeof ExpressData>;
14
+ express: Express;
15
+ expressCode: ExpressCode;
16
+ isCombinationComponent: boolean;
17
+ formField: string;
18
+ canSort: boolean;
19
+ children: ComponentInterface[];
20
+ dataType: ComponentInterface["dataType"];
21
+ constructor(options: PickOption);
22
+ editRender: (p: any) => React.JSX.Element;
23
+ renderClient: (record: Record) => React.JSX.Element;
24
+ renderPc: () => null;
25
+ renderLog: (r: Record) => React.JSX.Element;
26
+ getComponentValue: (r: Record) => {
27
+ company: any;
28
+ order: any;
29
+ };
30
+ renderExport: () => null;
31
+ filterConfig: (item: ColumnConfig) => ({
32
+ searchDefaultConditions: "in";
33
+ type: string;
34
+ id: string;
35
+ name: string;
36
+ filterComponentType: "MultipleSelect";
37
+ props: {
38
+ options: any[];
39
+ };
40
+ filterFn: (value: string) => (i: Record) => boolean;
41
+ } | {
42
+ searchDefaultConditions: "like";
43
+ type: string;
44
+ id: string;
45
+ name: string;
46
+ filterComponentType: "Input";
47
+ filterFn: (value: string) => (i: Record) => boolean;
48
+ })[];
49
+ }
50
+ export default BsLogistics;
@@ -0,0 +1,115 @@
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 _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
5
+ 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); } }
6
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
7
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
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
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
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";
14
+ import Express from "../Express";
15
+ import ExpressCode from "../ExpressCode";
16
+ import GetFormItem from "../GetFormItem";
17
+ var BsLogistics = /*#__PURE__*/_createClass(function BsLogistics(options) {
18
+ var _this = this,
19
+ _this$componentConfig3;
20
+ _classCallCheck(this, BsLogistics);
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, "rules", void 0);
26
+ _defineProperty(this, "componentConfig", void 0);
27
+ _defineProperty(this, "expressDateInstance", void 0);
28
+ _defineProperty(this, "express", void 0);
29
+ _defineProperty(this, "expressCode", void 0);
30
+ _defineProperty(this, "isCombinationComponent", void 0);
31
+ _defineProperty(this, "formField", void 0);
32
+ _defineProperty(this, "canSort", void 0);
33
+ _defineProperty(this, "children", void 0);
34
+ _defineProperty(this, "dataType", void 0);
35
+ _defineProperty(this, "editRender", function (p) {
36
+ var _this$componentConfig, _this$componentConfig2;
37
+ return /*#__PURE__*/React.createElement(GetFormItem, {
38
+ title: _this.name,
39
+ name: _this.id,
40
+ rules: _this.rules,
41
+ hidden: p === null || p === void 0 ? void 0 : p.hidden,
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
+ component: /*#__PURE__*/React.createElement(ExpressLogistics, _extends({}, _this.componentConfig, {
44
+ options: _this.expressDateInstance.getExpressData(),
45
+ onBlur: p === null || p === void 0 ? void 0 : p.onBlur
46
+ }))
47
+ });
48
+ });
49
+ _defineProperty(this, "renderClient", function (record) {
50
+ return /*#__PURE__*/React.createElement(React.Fragment, null, _this.express.renderClient(record), _this.expressCode.renderClient(record));
51
+ });
52
+ _defineProperty(this, "renderPc", function () {
53
+ return null;
54
+ });
55
+ _defineProperty(this, "renderLog", function (r) {
56
+ 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)));
57
+ });
58
+ _defineProperty(this, "getComponentValue", function (r) {
59
+ return {
60
+ company: _this.express.getComponentValue(r),
61
+ order: _this.expressCode.getComponentValue(r)
62
+ };
63
+ });
64
+ _defineProperty(this, "renderExport", function () {
65
+ return null;
66
+ });
67
+ _defineProperty(this, "filterConfig", function (item) {
68
+ return [_this.express.filterConfig(_objectSpread(_objectSpread({}, item), {}, {
69
+ subKey: "bsLogisticsCompany"
70
+ })), _this.expressCode.filterConfig(_objectSpread(_objectSpread({}, item), {}, {
71
+ subKey: "bsLogisticsCode"
72
+ }))];
73
+ });
74
+ this.name = options.name;
75
+ this.id = options.id;
76
+ this.sortField = options.id;
77
+ this.formField = options.id;
78
+ this.type = options.type;
79
+ this.componentConfig = options.componentConfig;
80
+ this.expressDateInstance = ExpressData.getInstance();
81
+ this.express = new Express(_objectSpread(_objectSpread({}, options), {}, {
82
+ name: "快递物流公司",
83
+ id: "".concat(this.id, "_bsLogisticsCompany")
84
+ }));
85
+ this.expressCode = new ExpressCode(_objectSpread(_objectSpread({}, options), {}, {
86
+ name: "快递物流单号",
87
+ id: "".concat(this.id, "_bsLogisticsCode")
88
+ }));
89
+ this.isCombinationComponent = true;
90
+ this.canSort = false;
91
+ this.dataType = "object";
92
+ this.children = [this.express, this.expressCode];
93
+ this.rules = (_this$componentConfig3 = this.componentConfig) !== null && _this$componentConfig3 !== void 0 && _this$componentConfig3.required ? [{
94
+ validator: function validator(_, value) {
95
+ var _this$componentConfig4;
96
+ if ((_this$componentConfig4 = _this.componentConfig) !== null && _this$componentConfig4 !== void 0 && _this$componentConfig4.isSingle) {
97
+ 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("请输入物流单号"));
102
+ }
103
+ } else {
104
+ if (!(value !== null && value !== void 0 && value.company)) {
105
+ return Promise.reject(new Error("请选择物流公司"));
106
+ }
107
+ if (!(value !== null && value !== void 0 && value.order)) {
108
+ return Promise.reject(new Error("请输入物流单号"));
109
+ }
110
+ }
111
+ return Promise.resolve();
112
+ }
113
+ }] : [];
114
+ });
115
+ export default BsLogistics;
@@ -0,0 +1,25 @@
1
+ import { ComponentInterface, PickOption, ColumnConfig, ALignType, Record } from "../../type";
2
+ import React from "react";
3
+ declare class BsSendGood 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
+ isCombinationComponent: boolean;
12
+ formField: string;
13
+ canSort: boolean;
14
+ children: ComponentInterface[];
15
+ dataType: ComponentInterface["dataType"];
16
+ constructor(options: PickOption);
17
+ renderClient: (record: Record) => React.JSX.Element | null;
18
+ renderPc: (value: any, record: Record) => React.JSX.Element;
19
+ renderLog: (r: Record) => React.JSX.Element | null;
20
+ getComponentValue: (r: Record) => any;
21
+ renderExport: (value: any, record: any) => any;
22
+ editRender: (p: any) => React.JSX.Element;
23
+ filterConfig: (item: ColumnConfig) => never[];
24
+ }
25
+ export default BsSendGood;
@@ -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 _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
3
+ 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); } }
4
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
5
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
6
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
7
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
8
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
9
+ import React from "react";
10
+ import some from "lodash/some";
11
+ import GetFormItem from "../GetFormItem";
12
+ import { JstGoodImage } from "../Common";
13
+ import { JstGoods } from "@kmkf-fe-packages/basic-components";
14
+ import ItemView from "../../commonComponents/ItemView";
15
+ import { isNull } from "@kmkf-fe-packages/kmkf-utils";
16
+ var BsSendGood = /*#__PURE__*/_createClass(function BsSendGood(options) {
17
+ var _this = this,
18
+ _this$componentConfig;
19
+ _classCallCheck(this, BsSendGood);
20
+ _defineProperty(this, "name", void 0);
21
+ _defineProperty(this, "id", void 0);
22
+ _defineProperty(this, "sortField", void 0);
23
+ _defineProperty(this, "type", void 0);
24
+ _defineProperty(this, "rules", void 0);
25
+ _defineProperty(this, "componentConfig", void 0);
26
+ _defineProperty(this, "align", void 0);
27
+ _defineProperty(this, "isCombinationComponent", void 0);
28
+ _defineProperty(this, "formField", void 0);
29
+ _defineProperty(this, "canSort", void 0);
30
+ _defineProperty(this, "children", void 0);
31
+ _defineProperty(this, "dataType", void 0);
32
+ _defineProperty(this, "renderClient", function (record) {
33
+ var isShow = Array.isArray(record === null || record === void 0 ? void 0 : record[_this.id]) ? some(record === null || record === void 0 ? void 0 : record[_this.id], function (item) {
34
+ return !isNull(item);
35
+ }) : false;
36
+ return isShow ? /*#__PURE__*/React.createElement(ItemView, {
37
+ id: _this.id,
38
+ label: _this.name,
39
+ value: /*#__PURE__*/React.createElement(JstGoodImage, {
40
+ list: record === null || record === void 0 ? void 0 : record[_this.id],
41
+ type: 3
42
+ })
43
+ }) : null;
44
+ });
45
+ _defineProperty(this, "renderPc", function (value, record) {
46
+ var list = record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_bsSendGood")];
47
+ //兼容多个商品
48
+ return /*#__PURE__*/React.createElement(JstGoodImage, {
49
+ list: list,
50
+ type: 3
51
+ });
52
+ });
53
+ _defineProperty(this, "renderLog", function (r) {
54
+ var list = r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_bsSendGood")];
55
+ if (isNull(list)) return null;
56
+ return _this.renderPc(undefined, r);
57
+ });
58
+ _defineProperty(this, "getComponentValue", function (r) {
59
+ return r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_bsSendGood")];
60
+ });
61
+ _defineProperty(this, "renderExport", function (value, record) {
62
+ var list = record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_bsSendGood")];
63
+ return (list || []).map(function (item) {
64
+ return [item === null || item === void 0 ? void 0 : item.sendId, item === null || item === void 0 ? void 0 : item.sendName].join("/");
65
+ }).join(",");
66
+ });
67
+ _defineProperty(this, "editRender", function (p) {
68
+ return /*#__PURE__*/React.createElement(GetFormItem, {
69
+ title: _this.name,
70
+ name: _this.id,
71
+ rules: _this.rules,
72
+ required: false,
73
+ hidden: p === null || p === void 0 ? void 0 : p.hidden,
74
+ component: /*#__PURE__*/React.createElement(JstGoods, _extends({}, _this.componentConfig, {
75
+ type: 3
76
+ }))
77
+ });
78
+ });
79
+ _defineProperty(this, "filterConfig", function (item) {
80
+ return [];
81
+ });
82
+ this.name = options.name;
83
+ this.id = options.id;
84
+ this.sortField = "".concat(options.id, "_bsSendGood");
85
+ this.formField = "".concat(options.id, "_bsSendGood");
86
+ this.type = options.type;
87
+ this.componentConfig = options.componentConfig;
88
+ this.dataType = "object";
89
+ this.rules = (_this$componentConfig = this.componentConfig) !== null && _this$componentConfig !== void 0 && _this$componentConfig.required ? [{
90
+ required: true,
91
+ validator: function validator(_, value) {
92
+ if (!value || !value.length) {
93
+ return Promise.reject(new Error("请选择宝贝"));
94
+ }
95
+ var hasNo = (value || []).some(function (item) {
96
+ var _this$componentConfig2, _this$componentConfig3;
97
+ if (["sendName"].includes((_this === null || _this === void 0 ? void 0 : (_this$componentConfig2 = _this.componentConfig) === null || _this$componentConfig2 === void 0 ? void 0 : _this$componentConfig2.showField) || "")) {
98
+ return item.sendName;
99
+ } else if (["sendId"].includes((_this === null || _this === void 0 ? void 0 : (_this$componentConfig3 = _this.componentConfig) === null || _this$componentConfig3 === void 0 ? void 0 : _this$componentConfig3.showField) || "")) {
100
+ return item.sendId;
101
+ } else {
102
+ return item.sendId && item.sendName;
103
+ }
104
+ });
105
+ if (!hasNo) {
106
+ return Promise.reject(new Error("\u81F3\u5C11\u586B\u5199\u4E00\u4E2A\u5B8C\u6574\u7684\u53D1\u8D27\u4ED3\u4FE1\u606F"));
107
+ }
108
+ return Promise.resolve();
109
+ }
110
+ }] : [];
111
+ this.align = "left";
112
+ this.isCombinationComponent = false;
113
+ this.canSort = false;
114
+ this.children = [];
115
+ });
116
+ export default BsSendGood;
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ /// <reference types="react" />
2
2
  declare type getFormItemProps = {
3
3
  name: string;
4
4
  title: string;
@@ -6,13 +6,13 @@ declare type getFormItemProps = {
6
6
  required: boolean;
7
7
  component: JSX.Element | string | null;
8
8
  };
9
- export declare const getFormItem: ({ name, title, rules, required, component }: getFormItemProps) => React.JSX.Element;
9
+ export declare const getFormItem: ({ name, title, rules, required, component }: getFormItemProps) => JSX.Element;
10
10
  export declare const showImage: ({ item, type, index }: {
11
11
  item: any;
12
12
  type: string;
13
13
  index: number;
14
- }) => React.JSX.Element;
15
- export declare const ShowTotalImage: ({ total, allImage, type }: any) => React.JSX.Element;
16
- export declare const GoodImage: ({ list, type }: any) => React.JSX.Element | null;
14
+ }) => JSX.Element;
15
+ export declare const ShowTotalImage: ({ total, allImage, type }: any) => JSX.Element;
16
+ export declare const GoodImage: ({ list, type }: any) => JSX.Element | null;
17
17
  export declare const JstGoodImage: ({ list, type }: any) => any;
18
18
  export {};
@@ -1,5 +1,5 @@
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
  /**
4
4
  * 针对完成时间、创建时间、修改时间定义了3中类型
5
5
  */
@@ -14,8 +14,8 @@ declare class CommonDataTime implements ComponentInterface {
14
14
  formField: string;
15
15
  canSort: boolean;
16
16
  children: ComponentInterface[];
17
- dataType: ComponentInterface['dataType'];
18
- format: ComponentInterface['format'];
17
+ dataType: ComponentInterface["dataType"];
18
+ format: ComponentInterface["format"];
19
19
  constructor(options: PickOption);
20
20
  getValue: (value: string) => string;
21
21
  renderClient: (record: any) => React.JSX.Element | null;
@@ -5,10 +5,10 @@ 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 moment from 'moment';
8
+ import React from "react";
9
+ import moment from "moment";
10
10
  import ItemView from "../../commonComponents/ItemView";
11
- import { isNull, filterFn as _filterFn } from '@kmkf-fe-packages/kmkf-utils';
11
+ import { isNull, filterFn as _filterFn } from "@kmkf-fe-packages/kmkf-utils";
12
12
  import { SYMBOL } from "../../constant";
13
13
 
14
14
  /**
@@ -30,18 +30,18 @@ var CommonDataTime = /*#__PURE__*/_createClass(function CommonDataTime(options)
30
30
  _defineProperty(this, "dataType", void 0);
31
31
  _defineProperty(this, "format", void 0);
32
32
  _defineProperty(this, "getValue", function (value) {
33
- return moment(value).format('YYYY-MM-DD HH:mm:ss');
33
+ return moment(value).format("YYYY-MM-DD HH:mm:ss");
34
34
  });
35
35
  _defineProperty(this, "renderClient", function (record) {
36
36
  return !isNull(record === null || record === void 0 ? void 0 : record[_this.id]) ? /*#__PURE__*/React.createElement(ItemView, {
37
37
  id: _this.id,
38
38
  label: _this.name,
39
- value: _this.getValue(record === null || record === void 0 ? void 0 : record[_this.id]) || ''
39
+ value: _this.getValue(record === null || record === void 0 ? void 0 : record[_this.id]) || ""
40
40
  }) : null;
41
41
  });
42
42
  _defineProperty(this, "renderPc", function (value, record) {
43
43
  var _record;
44
- return (_record = record === null || record === void 0 ? void 0 : record["".concat(_this.id)]) !== null && _record !== void 0 ? _record : '--';
44
+ return (_record = record === null || record === void 0 ? void 0 : record["".concat(_this.id)]) !== null && _record !== void 0 ? _record : "--";
45
45
  // if (record?.[`${this.id}`] === undefined) {
46
46
  // return <span>--</span>;
47
47
  // }
@@ -60,9 +60,9 @@ var CommonDataTime = /*#__PURE__*/_createClass(function CommonDataTime(options)
60
60
  });
61
61
  _defineProperty(this, "renderExport", function (value, record) {
62
62
  if ((record === null || record === void 0 ? void 0 : record["".concat(_this.id)]) === undefined) {
63
- return '--';
63
+ return "--";
64
64
  }
65
- return moment(record === null || record === void 0 ? void 0 : record["".concat(_this.id)]).format('YYYY-MM-DD HH:mm:ss');
65
+ return moment(record === null || record === void 0 ? void 0 : record["".concat(_this.id)]).format("YYYY-MM-DD HH:mm:ss");
66
66
  });
67
67
  _defineProperty(this, "editRender", function () {
68
68
  return null;
@@ -75,17 +75,17 @@ var CommonDataTime = /*#__PURE__*/_createClass(function CommonDataTime(options)
75
75
  // 过滤组件id
76
76
  name: item.name,
77
77
  // 过滤组件名称
78
- filterComponentType: 'Date',
78
+ filterComponentType: "Date",
79
79
  filterFn: function filterFn(value) {
80
80
  return function (i) {
81
- var recordDateTime = _filterFn.filterTableListItemColumnValue(i, item.id, '');
81
+ var recordDateTime = _filterFn.filterTableListItemColumnValue(i, item.id, "");
82
82
  return _filterFn.filterDateFn(value, recordDateTime);
83
83
  };
84
84
  },
85
85
  formatFilterValue: function formatFilterValue(val) {
86
86
  if ((val === null || val === void 0 ? void 0 : val.length) > 0) {
87
87
  return val === null || val === void 0 ? void 0 : val.map(function (v) {
88
- return moment(v).startOf('second').valueOf();
88
+ return moment(v).startOf("second").valueOf();
89
89
  });
90
90
  }
91
91
  }
@@ -101,7 +101,7 @@ var CommonDataTime = /*#__PURE__*/_createClass(function CommonDataTime(options)
101
101
  this.isCombinationComponent = false;
102
102
  this.canSort = true;
103
103
  this.children = [];
104
- this.dataType = 'string';
105
- this.format = 'dateTime';
104
+ this.dataType = "string";
105
+ this.format = "dateTime";
106
106
  });
107
107
  export default CommonDataTime;
@@ -1,9 +1,9 @@
1
- import React from 'react';
1
+ /// <reference types="react" />
2
2
  declare const DateType: ['DATE', 'DATE_TIME', 'DATE_RANGE', 'DATE_TIME_RANGE'];
3
3
  export declare type ButtonType = typeof DateType[number];
4
4
  export interface ApaasDate {
5
5
  dateType?: ButtonType;
6
6
  [propName: string]: any;
7
7
  }
8
- declare const Date: (props: ApaasDate) => React.JSX.Element;
8
+ declare const Date: (props: ApaasDate) => JSX.Element;
9
9
  export default Date;
@@ -1,3 +1,3 @@
1
- import React from 'react';
2
- declare const ItemEncode: (props: JSX.IntrinsicAttributes & any) => React.JSX.Element;
1
+ /// <reference types="react" />
2
+ declare const ItemEncode: (props: JSX.IntrinsicAttributes & any) => JSX.Element;
3
3
  export default ItemEncode;
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ /// <reference types="react" />
2
2
  import { GoodsProps } from '@kmkf-fe-packages/basic-components/dist/common/Goods';
3
- declare const ItemId: (props: JSX.IntrinsicAttributes & GoodsProps) => React.JSX.Element;
3
+ declare const ItemId: (props: JSX.IntrinsicAttributes & GoodsProps) => JSX.Element;
4
4
  export default ItemId;