@kmkf-fe-packages/services-components 0.8.18-alpha.8 → 0.8.19-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.
@@ -0,0 +1,53 @@
1
+ import { ComponentInterface, PickOption, ColumnConfig, Record } from '../../../type';
2
+ import React from 'react';
3
+ import { ExpressData } from '@kmkf-fe-packages/kmkf-utils';
4
+ import ExpressCompany from '../common/expressCompany';
5
+ import ExpressCode from '../common/expressCode';
6
+ declare class BsLogistics implements ComponentInterface {
7
+ name: string;
8
+ id: string;
9
+ sortField: string;
10
+ sortChildField: {
11
+ name: string;
12
+ key: string;
13
+ dataType: string;
14
+ [key: string]: any;
15
+ }[];
16
+ type: string;
17
+ rules: any[];
18
+ componentConfig: ComponentInterface['componentConfig'];
19
+ expressDateInstance: InstanceType<typeof ExpressData>;
20
+ isCombinationComponent: boolean;
21
+ formField: string;
22
+ canSort: boolean;
23
+ children: ComponentInterface[];
24
+ dataType: ComponentInterface['dataType'];
25
+ expressCompany: ExpressCompany;
26
+ expressCode: ExpressCode;
27
+ constructor(options: PickOption);
28
+ renderClient: (record: any) => React.JSX.Element | null;
29
+ renderPc: (value: any, record: Record) => React.JSX.Element;
30
+ renderLog: (r: Record) => React.JSX.Element | null;
31
+ getComponentValue: (r: Record) => any;
32
+ renderExport: () => null;
33
+ editRender: (p: any) => React.JSX.Element;
34
+ filterConfig: (item: ColumnConfig) => ({
35
+ searchDefaultConditions: "in";
36
+ type: string;
37
+ id: string;
38
+ name: string;
39
+ filterComponentType: "MultipleSelect";
40
+ props: {
41
+ options: any[];
42
+ };
43
+ filterFn: (value: string) => (i: Record) => any;
44
+ } | {
45
+ searchDefaultConditions: "like";
46
+ type: string;
47
+ id: string;
48
+ name: string;
49
+ filterComponentType: "Input";
50
+ filterFn: (value: string) => (i: Record) => boolean;
51
+ })[];
52
+ }
53
+ export default BsLogistics;
@@ -0,0 +1,161 @@
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 some from 'lodash/some';
14
+ import GetFormItem from "../../GetFormItem";
15
+ import { JstGoodImage } from "../../Common";
16
+ import { JstGoods } from '@kmkf-fe-packages/basic-components';
17
+ import ItemView from "../../../commonComponents/ItemView";
18
+ import { isNull } from '@kmkf-fe-packages/kmkf-utils';
19
+ import ExpressCompany from "../common/expressCompany";
20
+ import ExpressCode from "../common/expressCode";
21
+ var typeMap = {
22
+ BS_LOGISTICS: {
23
+ key: 'bsLogisticsList',
24
+ name: 'bs',
25
+ company: 'bsLogisticsCompany',
26
+ code: 'bsLogisticsCode'
27
+ }
28
+ };
29
+ var BsLogistics = /*#__PURE__*/_createClass(function BsLogistics(options) {
30
+ var _this = this,
31
+ _typeMap$options$type,
32
+ _typeMap$options$type2,
33
+ _typeMap$options$type3,
34
+ _typeMap$options$type4,
35
+ _typeMap$options$type5,
36
+ _typeMap$options$type6,
37
+ _this$componentConfig3,
38
+ _typeMap$options$type7,
39
+ _typeMap$options$type8;
40
+ _classCallCheck(this, BsLogistics);
41
+ _defineProperty(this, "name", void 0);
42
+ _defineProperty(this, "id", void 0);
43
+ _defineProperty(this, "sortField", void 0);
44
+ _defineProperty(this, "sortChildField", void 0);
45
+ _defineProperty(this, "type", void 0);
46
+ _defineProperty(this, "rules", void 0);
47
+ _defineProperty(this, "componentConfig", void 0);
48
+ _defineProperty(this, "expressDateInstance", void 0);
49
+ _defineProperty(this, "isCombinationComponent", void 0);
50
+ _defineProperty(this, "formField", void 0);
51
+ _defineProperty(this, "canSort", void 0);
52
+ _defineProperty(this, "children", void 0);
53
+ _defineProperty(this, "dataType", void 0);
54
+ _defineProperty(this, "expressCompany", void 0);
55
+ _defineProperty(this, "expressCode", void 0);
56
+ _defineProperty(this, "renderClient", function (record) {
57
+ 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) {
58
+ return !isNull(item);
59
+ }) : false;
60
+ return isShow ? /*#__PURE__*/React.createElement(ItemView, {
61
+ id: _this.id,
62
+ label: _this.name,
63
+ value: /*#__PURE__*/React.createElement(JstGoodImage, {
64
+ list: record === null || record === void 0 ? void 0 : record[_this.id],
65
+ type: 1
66
+ })
67
+ }) : null;
68
+ });
69
+ _defineProperty(this, "renderPc", function (value, record) {
70
+ var _typeMap$_this$type;
71
+ var list = record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_").concat((_typeMap$_this$type = typeMap[_this.type]) === null || _typeMap$_this$type === void 0 ? void 0 : _typeMap$_this$type.key)];
72
+ //兼容多个商品
73
+ return /*#__PURE__*/React.createElement("span", {
74
+ onClick: function onClick(e) {
75
+ return e.stopPropagation();
76
+ }
77
+ }, /*#__PURE__*/React.createElement(JstGoodImage, {
78
+ list: list,
79
+ type: 1
80
+ }));
81
+ });
82
+ _defineProperty(this, "renderLog", function (r) {
83
+ var _typeMap$_this$type2;
84
+ var list = r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_").concat((_typeMap$_this$type2 = typeMap[_this.type]) === null || _typeMap$_this$type2 === void 0 ? void 0 : _typeMap$_this$type2.key)];
85
+ if (isNull(list)) return null;
86
+ return _this.renderPc(undefined, r);
87
+ });
88
+ _defineProperty(this, "getComponentValue", function (r) {
89
+ var _typeMap$_this$type3;
90
+ return r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_").concat((_typeMap$_this$type3 = typeMap[_this.type]) === null || _typeMap$_this$type3 === void 0 ? void 0 : _typeMap$_this$type3.key)];
91
+ });
92
+ _defineProperty(this, "renderExport", function () {
93
+ return null;
94
+ });
95
+ _defineProperty(this, "editRender", function (p) {
96
+ var _this$componentConfig, _this$componentConfig2;
97
+ return /*#__PURE__*/React.createElement(GetFormItem, {
98
+ title: _this.name,
99
+ name: _this.id,
100
+ rules: _this.rules,
101
+ hidden: p === null || p === void 0 ? void 0 : p.hidden,
102
+ 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,
103
+ component: /*#__PURE__*/React.createElement(JstGoods, _extends({}, _this.componentConfig, {
104
+ type: 1,
105
+ options: _this.expressDateInstance.getExpressData()
106
+ }))
107
+ });
108
+ });
109
+ _defineProperty(this, "filterConfig", function (item) {
110
+ var _typeMap$_this$type4, _typeMap$_this$type5;
111
+ return [_this.expressCompany.filterConfig(_objectSpread(_objectSpread({}, item), {}, {
112
+ subKey: (_typeMap$_this$type4 = typeMap[_this.type]) === null || _typeMap$_this$type4 === void 0 ? void 0 : _typeMap$_this$type4.company
113
+ })), _this.expressCode.filterConfig(_objectSpread(_objectSpread({}, item), {}, {
114
+ subKey: (_typeMap$_this$type5 = typeMap[_this.type]) === null || _typeMap$_this$type5 === void 0 ? void 0 : _typeMap$_this$type5.code
115
+ }))];
116
+ });
117
+ this.name = options.name;
118
+ this.id = options.id;
119
+ this.sortField = "".concat(options.id, "_").concat((_typeMap$options$type = typeMap[options.type]) === null || _typeMap$options$type === void 0 ? void 0 : _typeMap$options$type.key);
120
+ this.formField = "".concat(options.id, "_").concat((_typeMap$options$type2 = typeMap[options.type]) === null || _typeMap$options$type2 === void 0 ? void 0 : _typeMap$options$type2.key);
121
+ this.type = options.type;
122
+ this.componentConfig = options.componentConfig;
123
+ this.isCombinationComponent = true;
124
+ this.canSort = false;
125
+ this.expressCompany = new ExpressCompany(_objectSpread(_objectSpread({}, options), {}, {
126
+ name: '物流公司',
127
+ id: "".concat(options.id, "_").concat((_typeMap$options$type3 = typeMap[options.type]) === null || _typeMap$options$type3 === void 0 ? void 0 : _typeMap$options$type3.key, "_").concat((_typeMap$options$type4 = typeMap[options.type]) === null || _typeMap$options$type4 === void 0 ? void 0 : _typeMap$options$type4.company),
128
+ width: 200
129
+ }));
130
+ this.expressCode = new ExpressCode(_objectSpread(_objectSpread({}, options), {}, {
131
+ name: '物流单号',
132
+ id: "".concat(options.id, "_").concat((_typeMap$options$type5 = typeMap[options.type]) === null || _typeMap$options$type5 === void 0 ? void 0 : _typeMap$options$type5.key, "_").concat((_typeMap$options$type6 = typeMap[options.type]) === null || _typeMap$options$type6 === void 0 ? void 0 : _typeMap$options$type6.code),
133
+ width: 200
134
+ }));
135
+ this.children = [this.expressCompany, this.expressCode];
136
+ this.dataType = 'object';
137
+ this.rules = (_this$componentConfig3 = this.componentConfig) !== null && _this$componentConfig3 !== void 0 && _this$componentConfig3.required ? [{
138
+ required: true,
139
+ validator: function validator(_, value) {
140
+ var hasNo = (value || []).some(function (item) {
141
+ return item.logisticsCompany && item.logisticsCode;
142
+ });
143
+ if (!hasNo) {
144
+ return Promise.reject(new Error("\u81F3\u5C11\u586B\u5199\u4E00\u4E2A\u5B8C\u6574\u7684\u7269\u6D41\u4FE1\u606F"));
145
+ }
146
+ return Promise.resolve();
147
+ }
148
+ }] : [];
149
+ this.expressDateInstance = ExpressData.getInstance();
150
+ this.sortChildField = [{
151
+ name: '物流公司',
152
+ key: "".concat(options.id, "_").concat((_typeMap$options$type7 = typeMap[options.type]) === null || _typeMap$options$type7 === void 0 ? void 0 : _typeMap$options$type7.company),
153
+ options: this.expressDateInstance.getExpressData(),
154
+ dataType: 'string'
155
+ }, {
156
+ name: '物流单号',
157
+ key: "".concat(options.id, "_").concat((_typeMap$options$type8 = typeMap[options.type]) === null || _typeMap$options$type8 === void 0 ? void 0 : _typeMap$options$type8.code),
158
+ dataType: 'string'
159
+ }];
160
+ });
161
+ export default BsLogistics;
@@ -73,8 +73,8 @@ var BsChildPic = /*#__PURE__*/_createClass(function BsChildPic(options) {
73
73
  return list;
74
74
  });
75
75
  _defineProperty(this, "renderExport", function (value, record) {
76
- var _this$getComponentVal, _this$getComponentVal2;
77
- return (_this$getComponentVal = (_this$getComponentVal2 = _this.getComponentValue(record)) === null || _this$getComponentVal2 === void 0 ? void 0 : _this$getComponentVal2.join(',')) !== null && _this$getComponentVal !== void 0 ? _this$getComponentVal : '--';
76
+ var _this$getComponentVal;
77
+ return (_this$getComponentVal = _this.getComponentValue(record)) !== null && _this$getComponentVal !== void 0 ? _this$getComponentVal : '--';
78
78
  });
79
79
  _defineProperty(this, "editRender", function () {
80
80
  return null;
@@ -0,0 +1,33 @@
1
+ import { ComponentInterface, PickOption, ColumnConfig, ALignType, Record } from '../../../type';
2
+ import React from 'react';
3
+ declare class ExpressCode 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
+ renderClient: () => 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
+ filterFn: (value: string) => (i: Record) => boolean;
31
+ };
32
+ }
33
+ export default ExpressCode;
@@ -0,0 +1,102 @@
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 { BsExpressRender } from "../../Common";
16
+ import { isNull, filterFn as _filterFn } from '@kmkf-fe-packages/kmkf-utils';
17
+ import { SYMBOL } from "../../../constant";
18
+ var ExpressCode = /*#__PURE__*/_createClass(function ExpressCode(options) {
19
+ var _this = this,
20
+ _this$componentConfig;
21
+ _classCallCheck(this, ExpressCode);
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, "width", 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, "renderClient", function () {
36
+ return null;
37
+ });
38
+ _defineProperty(this, "renderPc", function (value, record) {
39
+ var _this$id$split = _this.id.split('_'),
40
+ _this$id$split2 = _slicedToArray(_this$id$split, 3),
41
+ key = _this$id$split2[0],
42
+ parentKey = _this$id$split2[1],
43
+ childKey = _this$id$split2[2];
44
+ if (!(record !== null && record !== void 0 && record["".concat(key, "_").concat(parentKey, "_bsLogisticsItem")])) {
45
+ return /*#__PURE__*/React.createElement("span", null, "--");
46
+ }
47
+ return /*#__PURE__*/React.createElement(BsExpressRender, {
48
+ list: record === null || record === void 0 ? void 0 : record["".concat(key, "_").concat(parentKey, "_bsLogisticsItem")],
49
+ showField: 'code'
50
+ });
51
+ });
52
+ _defineProperty(this, "renderLog", function (r) {
53
+ if (isNull(r === null || r === void 0 ? void 0 : r[_this.id])) return null;
54
+ return _this.renderPc(undefined, r);
55
+ });
56
+ _defineProperty(this, "getComponentValue", function (r) {
57
+ return r === null || r === void 0 ? void 0 : r["".concat(_this.id)];
58
+ });
59
+ _defineProperty(this, "renderExport", function (value, record) {
60
+ var _record;
61
+ return (_record = record === null || record === void 0 ? void 0 : record["".concat(_this.id)]) !== null && _record !== void 0 ? _record : '--';
62
+ });
63
+ _defineProperty(this, "editRender", function () {
64
+ return null;
65
+ });
66
+ _defineProperty(this, "filterConfig", function (item) {
67
+ var subKey = item.subKey;
68
+ return {
69
+ searchDefaultConditions: SYMBOL.like,
70
+ type: item.type,
71
+ id: "".concat(item.id, "_").concat(subKey),
72
+ name: "".concat(_this.name, "\u7269\u6D41\u5355\u53F7"),
73
+ filterComponentType: 'Input',
74
+ filterFn: function filterFn(value) {
75
+ return function (i) {
76
+ return _filterFn.filterSplitComma(_filterFn.filterTableListItemColumnValue(i, item.id, 'logisticsCode'), value);
77
+ };
78
+ }
79
+ };
80
+ });
81
+ this.name = options.name;
82
+ this.id = options.id;
83
+ this.sortField = options.id;
84
+ this.formField = options.id;
85
+ this.type = options.type;
86
+ this.componentConfig = options.componentConfig;
87
+ this.rules = (_this$componentConfig = this.componentConfig) !== null && _this$componentConfig !== void 0 && _this$componentConfig.required ? [{
88
+ validator: function validator(_, value) {
89
+ if (/^[0-9a-zA-Z]*$/.test(value)) {
90
+ return Promise.resolve();
91
+ }
92
+ return Promise.reject(new Error('只能输入数字和字母'));
93
+ }
94
+ }] : [];
95
+ this.align = 'left';
96
+ this.width = (options === null || options === void 0 ? void 0 : options.width) || 150;
97
+ this.isCombinationComponent = false;
98
+ this.canSort = false;
99
+ this.dataType = 'string';
100
+ this.children = [];
101
+ });
102
+ export default ExpressCode;
@@ -0,0 +1,39 @@
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 Express 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
+ renderClient: () => null;
22
+ renderPc: (value: unknown, record: Record) => React.JSX.Element;
23
+ renderLog: (r: Record) => React.JSX.Element | null;
24
+ getComponentValue: (r: Record) => any;
25
+ renderExport: (value: string, record: Record) => any;
26
+ editRender: () => null;
27
+ filterConfig: (item: ColumnConfig) => {
28
+ searchDefaultConditions: "in";
29
+ type: string;
30
+ id: string;
31
+ name: string;
32
+ filterComponentType: "MultipleSelect";
33
+ props: {
34
+ options: any[];
35
+ };
36
+ filterFn: (value: string) => (i: Record) => any;
37
+ };
38
+ }
39
+ export default Express;
@@ -0,0 +1,106 @@
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 { BsExpressRender } from "../../Common";
17
+ import { isNull, filterFn as _filterFn } from '@kmkf-fe-packages/kmkf-utils';
18
+ import { SYMBOL } from "../../../constant";
19
+ var Express = /*#__PURE__*/_createClass(function Express(options) {
20
+ var _this = this;
21
+ _classCallCheck(this, Express);
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, "renderClient", function () {
38
+ return null;
39
+ });
40
+ _defineProperty(this, "renderPc", function (value, record) {
41
+ var _this$id$split = _this.id.split('_'),
42
+ _this$id$split2 = _slicedToArray(_this$id$split, 3),
43
+ key = _this$id$split2[0],
44
+ parentKey = _this$id$split2[1],
45
+ childKey = _this$id$split2[2];
46
+ if (!(record !== null && record !== void 0 && record["".concat(key, "_").concat(parentKey, "_bsLogisticsItem")])) {
47
+ return /*#__PURE__*/React.createElement("span", null, "--");
48
+ }
49
+ return /*#__PURE__*/React.createElement(BsExpressRender, {
50
+ list: record === null || record === void 0 ? void 0 : record["".concat(key, "_").concat(parentKey, "_bsLogisticsItem")],
51
+ showField: 'company'
52
+ });
53
+ });
54
+ _defineProperty(this, "renderLog", function (r) {
55
+ if (isNull(r === null || r === void 0 ? void 0 : r[_this.id])) 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)];
60
+ });
61
+ _defineProperty(this, "renderExport", function (value, record) {
62
+ return _this.expressDateInstance.getExpressNameByCode(record === null || record === void 0 ? void 0 : record["".concat(_this.id)]) || (record === null || record === void 0 ? void 0 : record["".concat(_this.id)]) || '--';
63
+ });
64
+ _defineProperty(this, "editRender", function () {
65
+ return null;
66
+ });
67
+ _defineProperty(this, "filterConfig", function (item) {
68
+ var subKey = item.subKey;
69
+ return {
70
+ searchDefaultConditions: SYMBOL.in,
71
+ type: item.type,
72
+ id: "".concat(item.id, "_").concat(subKey),
73
+ name: "".concat(_this.name),
74
+ filterComponentType: 'MultipleSelect',
75
+ props: {
76
+ options: _this.expressDateInstance.getExpressData() || []
77
+ },
78
+ filterFn: function filterFn(value) {
79
+ return function (i) {
80
+ var _ref;
81
+ return (_ref = _filterFn.filterTableListItemColumnValue(i, item.id, 'logisticsCompany').split(',') || []) === null || _ref === void 0 ? void 0 : _ref.some(function (item) {
82
+ var _String;
83
+ var logisticsCompany = item ? (_String = String(item)) === null || _String === void 0 ? void 0 : _String.includes(value) : false;
84
+ return logisticsCompany;
85
+ });
86
+ };
87
+ }
88
+ };
89
+ });
90
+ this.name = options.name;
91
+ this.id = options.id;
92
+ this.sortField = options.id;
93
+ this.formField = options.id;
94
+ this.type = options.type;
95
+ this.componentConfig = options.componentConfig;
96
+ this.rules = [];
97
+ this.align = 'left';
98
+ this.expressDateInstance = ExpressData.getInstance();
99
+ this.width = (options === null || options === void 0 ? void 0 : options.width) || 150;
100
+ this.isCombinationComponent = false;
101
+ this.canSort = false;
102
+ this.children = [];
103
+ this.dataType = 'string';
104
+ this.options = this.expressDateInstance.getExpressData() || [];
105
+ });
106
+ export default Express;
@@ -1,4 +1,4 @@
1
- import React from "react";
1
+ import React from 'react';
2
2
  declare type getFormItemProps = {
3
3
  name: string;
4
4
  title: string;
@@ -15,6 +15,7 @@ export declare const showImage: ({ item, type, index, }: {
15
15
  export declare const ShowTotalImage: ({ total, allImage, type }: any) => React.JSX.Element;
16
16
  export declare const GoodImage: ({ list, type }: any) => React.JSX.Element | null;
17
17
  export declare const JstGoodImage: ({ list, type }: any) => any;
18
+ export declare const BsExpressRender: ({ list, showField }: any) => any;
18
19
  export declare const CommonOrderContent: ({ list, valueKey, failValue, options, }: any) => any;
19
20
  export declare const BsGoodImage: ({ item, index }: {
20
21
  item: any;