@kmkf-fe-packages/services-components 0.23.0-alpha.3 → 0.24.0-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.
- package/dist/esm/components/BS/BsLogistics/index.js +5 -4
- package/dist/esm/components/BS/BsSystemOrder/index.d.ts +7 -6
- package/dist/esm/components/BS/BsSystemOrder/index.js +22 -19
- package/dist/esm/components/BS/DeliveryNo/index.d.ts +6 -5
- package/dist/esm/components/BS/DeliveryNo/index.js +15 -12
- package/dist/esm/components/CommonMultiStatus/index.d.ts +6 -5
- package/dist/esm/components/CommonMultiStatus/index.js +58 -51
- package/dist/esm/components/CommonSystemOrder/index.d.ts +6 -5
- package/dist/esm/components/CommonSystemOrder/index.js +29 -26
- package/dist/esm/components/Input/index.d.ts +7 -6
- package/dist/esm/components/Input/index.js +25 -15
- package/dist/esm/components/JST/JstLogistics/index.d.ts +11 -0
- package/dist/esm/components/JST/JstLogistics/index.js +21 -7
- package/dist/esm/components/Logistics/index.d.ts +6 -6
- package/dist/esm/components/Logistics/index.js +16 -15
- package/dist/esm/components/LogisticsMoreTrajectory/index.d.ts +48 -0
- package/dist/esm/components/LogisticsMoreTrajectory/index.js +119 -0
- package/dist/esm/components/LogisticsMoreTrajectory/trajectoryCode.d.ts +34 -0
- package/dist/esm/components/LogisticsMoreTrajectory/trajectoryCode.js +98 -0
- package/dist/esm/components/LogisticsMoreTrajectory/trajectoryCompany.d.ts +40 -0
- package/dist/esm/components/LogisticsMoreTrajectory/trajectoryCompany.js +95 -0
- package/dist/esm/components/LogisticsMoreTrajectory/trajectorySnapshot.d.ts +32 -0
- package/dist/esm/components/LogisticsMoreTrajectory/trajectorySnapshot.js +74 -0
- package/dist/esm/components/Payment/index.d.ts +12 -12
- package/dist/esm/components/Payment/index.js +11 -12
- package/dist/esm/components/PostIng/index.js +1 -1
- package/dist/esm/components/TradeId/index.d.ts +1 -1
- package/dist/esm/components/TradeId/index.js +2 -2
- package/dist/esm/constant.d.ts +1 -0
- package/dist/esm/constant.js +3 -0
- package/dist/esm/factory.d.ts +2 -2
- package/dist/esm/factory.js +4 -2
- package/dist/esm/index.d.ts +2 -1
- package/dist/esm/index.js +1 -0
- package/dist/esm/type.d.ts +12 -12
- package/package.json +4 -4
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { ComponentInterface, PickOption, ColumnConfig, Record } from
|
|
2
|
-
import React from
|
|
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[
|
|
9
|
+
componentConfig: ComponentInterface["componentConfig"];
|
|
10
10
|
isCombinationComponent: boolean;
|
|
11
11
|
formField: string;
|
|
12
12
|
canSort: boolean;
|
|
13
13
|
children: ComponentInterface[];
|
|
14
|
-
dataType: ComponentInterface[
|
|
14
|
+
dataType: ComponentInterface["dataType"];
|
|
15
15
|
templateId?: string;
|
|
16
16
|
workOrderUniqueKey?: string;
|
|
17
17
|
constructor(options: PickOption);
|
|
@@ -22,12 +22,13 @@ declare class BasicInput implements ComponentInterface {
|
|
|
22
22
|
renderClient: (record: Record) => React.JSX.Element | null;
|
|
23
23
|
editRender: (p: any) => React.JSX.Element;
|
|
24
24
|
filterConfig: (item: ColumnConfig) => {
|
|
25
|
-
searchDefaultConditions: "
|
|
25
|
+
searchDefaultConditions: "in";
|
|
26
26
|
type: string;
|
|
27
27
|
id: string;
|
|
28
28
|
name: string;
|
|
29
|
-
filterComponentType: "
|
|
29
|
+
filterComponentType: "SelectInput";
|
|
30
30
|
filterFn: (value: string) => (i: Record) => boolean;
|
|
31
|
+
formatFilterValue: (value: any) => any;
|
|
31
32
|
};
|
|
32
33
|
}
|
|
33
34
|
export default BasicInput;
|
|
@@ -9,12 +9,12 @@ 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
|
|
13
|
-
import { ApaasInput } from
|
|
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
|
|
17
|
-
import { SYMBOL } from "../../constant";
|
|
16
|
+
import { isNull, filterFn as _filterFn } from "@kmkf-fe-packages/kmkf-utils";
|
|
17
|
+
import { SYMBOL, batchInput } from "../../constant";
|
|
18
18
|
import { replaceCheck } from "../../service/api";
|
|
19
19
|
var BasicInput = /*#__PURE__*/_createClass(function BasicInput(options) {
|
|
20
20
|
var _this = this,
|
|
@@ -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,26 +62,36 @@ 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: [
|
|
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
|
});
|
|
72
75
|
_defineProperty(this, "filterConfig", function (item) {
|
|
73
76
|
return {
|
|
74
|
-
searchDefaultConditions: SYMBOL.
|
|
77
|
+
searchDefaultConditions: SYMBOL.in,
|
|
75
78
|
type: item.type,
|
|
76
79
|
id: "".concat(item.id, "_input"),
|
|
77
80
|
// 过滤组件id
|
|
78
81
|
name: item.name,
|
|
79
82
|
// 过滤组件名称
|
|
80
|
-
filterComponentType:
|
|
83
|
+
filterComponentType: "SelectInput",
|
|
81
84
|
filterFn: function filterFn(value) {
|
|
82
85
|
return function (i) {
|
|
83
|
-
return "".concat(_filterFn.filterTableListItemColumnValue(i, item.id,
|
|
86
|
+
return "".concat(_filterFn.filterTableListItemColumnValue(i, item.id, "input")).includes(value);
|
|
84
87
|
};
|
|
88
|
+
},
|
|
89
|
+
formatFilterValue: function formatFilterValue(value) {
|
|
90
|
+
if (value.type === "keywords") {
|
|
91
|
+
return batchInput(value.keywords);
|
|
92
|
+
} else {
|
|
93
|
+
return value;
|
|
94
|
+
}
|
|
85
95
|
}
|
|
86
96
|
};
|
|
87
97
|
});
|
|
@@ -110,7 +120,7 @@ var BasicInput = /*#__PURE__*/_createClass(function BasicInput(options) {
|
|
|
110
120
|
return item.test(value);
|
|
111
121
|
});
|
|
112
122
|
if (testList.length && !isTest) {
|
|
113
|
-
return Promise.reject(new Error(
|
|
123
|
+
return Promise.reject(new Error("请填写正确的格式"));
|
|
114
124
|
}
|
|
115
125
|
if ((_this$componentConfig6 = _this.componentConfig) !== null && _this$componentConfig6 !== void 0 && (_this$componentConfig7 = _this$componentConfig6.rulesOptions) !== null && _this$componentConfig7 !== void 0 && _this$componentConfig7.length) {
|
|
116
126
|
var _this$componentConfig8;
|
|
@@ -136,7 +146,7 @@ var BasicInput = /*#__PURE__*/_createClass(function BasicInput(options) {
|
|
|
136
146
|
return Promise.resolve();
|
|
137
147
|
}
|
|
138
148
|
}, {
|
|
139
|
-
validateTrigger:
|
|
149
|
+
validateTrigger: "onBlur",
|
|
140
150
|
validator: function () {
|
|
141
151
|
var _validator = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(_, value) {
|
|
142
152
|
var _this$componentConfig10;
|
|
@@ -171,7 +181,7 @@ var BasicInput = /*#__PURE__*/_createClass(function BasicInput(options) {
|
|
|
171
181
|
_context.next = 10;
|
|
172
182
|
break;
|
|
173
183
|
}
|
|
174
|
-
return _context.abrupt("return", Promise.reject(new Error(
|
|
184
|
+
return _context.abrupt("return", Promise.reject(new Error("内容已存在,不能重复提交")));
|
|
175
185
|
case 10:
|
|
176
186
|
case "end":
|
|
177
187
|
return _context.stop();
|
|
@@ -187,6 +197,6 @@ var BasicInput = /*#__PURE__*/_createClass(function BasicInput(options) {
|
|
|
187
197
|
this.isCombinationComponent = false;
|
|
188
198
|
this.canSort = true;
|
|
189
199
|
this.children = [];
|
|
190
|
-
this.dataType = options !== null && options !== void 0 && (_options$componentCon = options.componentConfig) !== null && _options$componentCon !== void 0 && _options$componentCon.isNumber ?
|
|
200
|
+
this.dataType = options !== null && options !== void 0 && (_options$componentCon = options.componentConfig) !== null && _options$componentCon !== void 0 && _options$componentCon.isNumber ? "number" : "string";
|
|
191
201
|
});
|
|
192
202
|
export default BasicInput;
|
|
@@ -39,6 +39,16 @@ declare class JstLogistics implements ComponentInterface {
|
|
|
39
39
|
options: any[];
|
|
40
40
|
};
|
|
41
41
|
filterFn: (value: string) => (i: Record) => any;
|
|
42
|
+
formatFilterValue?: undefined;
|
|
43
|
+
} | {
|
|
44
|
+
searchDefaultConditions: "in";
|
|
45
|
+
type: string;
|
|
46
|
+
id: string;
|
|
47
|
+
name: string;
|
|
48
|
+
filterComponentType: "Input";
|
|
49
|
+
filterFn: (value: string) => (i: Record) => boolean;
|
|
50
|
+
formatFilterValue: (input: string) => string | string[];
|
|
51
|
+
props?: undefined;
|
|
42
52
|
} | {
|
|
43
53
|
searchDefaultConditions: "like";
|
|
44
54
|
type: string;
|
|
@@ -47,6 +57,7 @@ declare class JstLogistics implements ComponentInterface {
|
|
|
47
57
|
filterComponentType: "Input";
|
|
48
58
|
filterFn: (value: string) => (i: Record) => boolean;
|
|
49
59
|
props?: undefined;
|
|
60
|
+
formatFilterValue?: undefined;
|
|
50
61
|
})[];
|
|
51
62
|
}
|
|
52
63
|
export default JstLogistics;
|
|
@@ -14,7 +14,7 @@ import { JstGoodImage } from "../../Common";
|
|
|
14
14
|
import { JstGoods } from "@kmkf-fe-packages/basic-components";
|
|
15
15
|
import ItemView from "../../../commonComponents/ItemView";
|
|
16
16
|
import { isNull, filterFn as _filterFn } from "@kmkf-fe-packages/kmkf-utils";
|
|
17
|
-
import { SYMBOL } from "../../../constant";
|
|
17
|
+
import { SYMBOL, batchInput } from "../../../constant";
|
|
18
18
|
var typeMap = {
|
|
19
19
|
JST_LOGISTICS: {
|
|
20
20
|
key: "jstItemList",
|
|
@@ -64,7 +64,7 @@ var JstLogistics = /*#__PURE__*/_createClass(function JstLogistics(_options) {
|
|
|
64
64
|
dataType: "string"
|
|
65
65
|
}];
|
|
66
66
|
}
|
|
67
|
-
if (type ===
|
|
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 ===
|
|
76
|
+
if (type === "logisticsCode") {
|
|
77
77
|
var _typeMap$options$type4;
|
|
78
78
|
return [{
|
|
79
79
|
name: "物流单号",
|
|
@@ -141,7 +141,7 @@ var JstLogistics = /*#__PURE__*/_createClass(function JstLogistics(_options) {
|
|
|
141
141
|
});
|
|
142
142
|
});
|
|
143
143
|
_defineProperty(this, "filterConfig", function (item) {
|
|
144
|
-
var _typeMap$_this$type5, _typeMap$_this$type6;
|
|
144
|
+
var _typeMap$_this$type5, _typeMap$_this$type6, _typeMap$_this$type7;
|
|
145
145
|
return [{
|
|
146
146
|
searchDefaultConditions: SYMBOL.in,
|
|
147
147
|
type: item.type,
|
|
@@ -161,12 +161,26 @@ var JstLogistics = /*#__PURE__*/_createClass(function JstLogistics(_options) {
|
|
|
161
161
|
});
|
|
162
162
|
};
|
|
163
163
|
}
|
|
164
|
-
}, {
|
|
165
|
-
searchDefaultConditions: SYMBOL.
|
|
164
|
+
}, _this.type === "REISSUE_LOGISTICS" ? {
|
|
165
|
+
searchDefaultConditions: SYMBOL.in,
|
|
166
166
|
type: item.type,
|
|
167
167
|
id: "".concat(item.id, "_").concat((_typeMap$_this$type6 = typeMap[_this.type]) === null || _typeMap$_this$type6 === void 0 ? void 0 : _typeMap$_this$type6.code),
|
|
168
168
|
name: "".concat(_this.name, "\u7269\u6D41\u5355\u53F7"),
|
|
169
169
|
filterComponentType: "Input",
|
|
170
|
+
filterFn: function filterFn(value) {
|
|
171
|
+
return function (i) {
|
|
172
|
+
return _filterFn.filterSplitComma(_filterFn.filterTableListItemColumnValue(i, item.id, "logisticsCode"), value);
|
|
173
|
+
};
|
|
174
|
+
},
|
|
175
|
+
formatFilterValue: function formatFilterValue(input) {
|
|
176
|
+
return batchInput(input);
|
|
177
|
+
}
|
|
178
|
+
} : {
|
|
179
|
+
searchDefaultConditions: SYMBOL.like,
|
|
180
|
+
type: item.type,
|
|
181
|
+
id: "".concat(item.id, "_").concat((_typeMap$_this$type7 = typeMap[_this.type]) === null || _typeMap$_this$type7 === void 0 ? void 0 : _typeMap$_this$type7.code),
|
|
182
|
+
name: "".concat(_this.name, "\u7269\u6D41\u5355\u53F7"),
|
|
183
|
+
filterComponentType: "Input",
|
|
170
184
|
filterFn: function filterFn(value) {
|
|
171
185
|
return function (i) {
|
|
172
186
|
return _filterFn.filterSplitComma(_filterFn.filterTableListItemColumnValue(i, item.id, "logisticsCode"), value);
|
|
@@ -198,6 +212,6 @@ var JstLogistics = /*#__PURE__*/_createClass(function JstLogistics(_options) {
|
|
|
198
212
|
}] : [];
|
|
199
213
|
this.align = "left";
|
|
200
214
|
this.expressDateInstance = ExpressData.getInstance();
|
|
201
|
-
this.sortChildField = this.getSortChildFields(((_this$componentConfig4 = this.componentConfig) === null || _this$componentConfig4 === void 0 ? void 0 : _this$componentConfig4.showField) ||
|
|
215
|
+
this.sortChildField = this.getSortChildFields(((_this$componentConfig4 = this.componentConfig) === null || _this$componentConfig4 === void 0 ? void 0 : _this$componentConfig4.showField) || "", _options);
|
|
202
216
|
});
|
|
203
217
|
export default JstLogistics;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { ComponentInterface, PickOption, ColumnConfig, Record } from
|
|
2
|
-
import React from
|
|
3
|
-
import { ExpressData } from
|
|
4
|
-
import Express from
|
|
5
|
-
import ExpressCode from
|
|
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[
|
|
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
|
|
12
|
-
import { ExpressData } from
|
|
13
|
-
import { ExpressLogistics } from
|
|
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:
|
|
70
|
+
subKey: "expressLogisticsCompany"
|
|
70
71
|
})), _this.expressCode.filterConfig(_objectSpread(_objectSpread({}, item), {}, {
|
|
71
|
-
subKey:
|
|
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 =
|
|
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) ===
|
|
99
|
-
return Promise.reject(new Error(
|
|
100
|
-
} else if (((_this$componentConfig6 = _this.componentConfig) === null || _this$componentConfig6 === void 0 ? void 0 : _this$componentConfig6.showField) ===
|
|
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,48 @@
|
|
|
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) => any;
|
|
28
|
+
getComponentValue: (r: Record) => any;
|
|
29
|
+
renderExport: () => null;
|
|
30
|
+
filterConfig: (item: ColumnConfig) => ({
|
|
31
|
+
searchDefaultConditions: "in";
|
|
32
|
+
type: string;
|
|
33
|
+
id: string;
|
|
34
|
+
name: string;
|
|
35
|
+
filterComponentType: "MultipleSelect";
|
|
36
|
+
props: {
|
|
37
|
+
options: any[];
|
|
38
|
+
};
|
|
39
|
+
filterFn: (value: string) => (i: Record) => boolean;
|
|
40
|
+
} | {
|
|
41
|
+
searchDefaultConditions: "like";
|
|
42
|
+
type: string;
|
|
43
|
+
id: string;
|
|
44
|
+
name: string;
|
|
45
|
+
filterComponentType: "Input";
|
|
46
|
+
})[];
|
|
47
|
+
}
|
|
48
|
+
export default LogisticsMoreTrajectory;
|
|
@@ -0,0 +1,119 @@
|
|
|
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
|
+
var LogisticsMoreTrajectory = /*#__PURE__*/_createClass(function LogisticsMoreTrajectory(options) {
|
|
20
|
+
var _this = this,
|
|
21
|
+
_this$componentConfig3;
|
|
22
|
+
_classCallCheck(this, LogisticsMoreTrajectory);
|
|
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, "expressDateInstance", void 0);
|
|
30
|
+
_defineProperty(this, "express", void 0);
|
|
31
|
+
_defineProperty(this, "expressCode", void 0);
|
|
32
|
+
_defineProperty(this, "expressSnapshot", void 0);
|
|
33
|
+
_defineProperty(this, "isCombinationComponent", void 0);
|
|
34
|
+
_defineProperty(this, "formField", void 0);
|
|
35
|
+
_defineProperty(this, "canSort", void 0);
|
|
36
|
+
_defineProperty(this, "children", void 0);
|
|
37
|
+
_defineProperty(this, "dataType", void 0);
|
|
38
|
+
_defineProperty(this, "editRender", function (p) {
|
|
39
|
+
var _this$componentConfig, _this$componentConfig2;
|
|
40
|
+
return /*#__PURE__*/React.createElement(GetFormItem, {
|
|
41
|
+
title: _this.name,
|
|
42
|
+
name: _this.id,
|
|
43
|
+
rules: _this.rules,
|
|
44
|
+
hidden: p === null || p === void 0 ? void 0 : p.hidden,
|
|
45
|
+
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,
|
|
46
|
+
component: /*#__PURE__*/React.createElement(MoreTrajectory, _this.componentConfig)
|
|
47
|
+
});
|
|
48
|
+
});
|
|
49
|
+
_defineProperty(this, "renderClient", function (record) {
|
|
50
|
+
return !isNull(record === null || record === void 0 ? void 0 : record[_this.id]) ? /*#__PURE__*/React.createElement(ItemView, {
|
|
51
|
+
id: _this.id,
|
|
52
|
+
label: _this.name,
|
|
53
|
+
value: record === null || record === void 0 ? void 0 : record[_this.id].map(function (item, index) {
|
|
54
|
+
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);
|
|
55
|
+
})
|
|
56
|
+
}) : null;
|
|
57
|
+
});
|
|
58
|
+
_defineProperty(this, "renderPc", function () {
|
|
59
|
+
return null;
|
|
60
|
+
});
|
|
61
|
+
_defineProperty(this, "renderLog", function (r) {
|
|
62
|
+
return !isNull(r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_trajectoryList")]) ? r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_trajectoryList")].map(function (item, index) {
|
|
63
|
+
return /*#__PURE__*/React.createElement("div", null, (r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_trajectoryList")].length) > 1 ? "\u5305\u88F9".concat(index + 1, ":") : "", _this.expressDateInstance.getExpressNameByCode(item.trajectoryCompany) || item.trajectoryCompany, "/", item.trajectoryCode, "/", item.trajectorySnapshot);
|
|
64
|
+
}) : null;
|
|
65
|
+
});
|
|
66
|
+
_defineProperty(this, "getComponentValue", function (r) {
|
|
67
|
+
return r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_trajectoryList")];
|
|
68
|
+
});
|
|
69
|
+
_defineProperty(this, "renderExport", function () {
|
|
70
|
+
return null;
|
|
71
|
+
});
|
|
72
|
+
_defineProperty(this, "filterConfig", function (item) {
|
|
73
|
+
return [_this.express.filterConfig(_objectSpread(_objectSpread({}, item), {}, {
|
|
74
|
+
subKey: "trajectoryMoreCompany"
|
|
75
|
+
})), _this.expressCode.filterConfig(item), _this.expressSnapshot.filterConfig(item)];
|
|
76
|
+
});
|
|
77
|
+
this.name = options.name;
|
|
78
|
+
this.id = options.id;
|
|
79
|
+
this.sortField = "".concat(options.id, "_trajectoryList");
|
|
80
|
+
this.formField = "".concat(options.id, "_trajectoryList");
|
|
81
|
+
this.type = options.type;
|
|
82
|
+
this.componentConfig = options.componentConfig;
|
|
83
|
+
this.expressDateInstance = ExpressData.getInstance();
|
|
84
|
+
this.express = new TrajectoryCompany(_objectSpread(_objectSpread({}, options), {}, {
|
|
85
|
+
name: "".concat(this.name, "-\u516C\u53F8"),
|
|
86
|
+
id: "".concat(this.id, "_trajectoryMoreCompany")
|
|
87
|
+
}));
|
|
88
|
+
this.expressCode = new TrajectoryCode(_objectSpread(_objectSpread({}, options), {}, {
|
|
89
|
+
name: "".concat(this.name, "-\u5355\u53F7"),
|
|
90
|
+
id: "".concat(this.id, "_trajectoryMoreCode")
|
|
91
|
+
}));
|
|
92
|
+
this.expressSnapshot = new TrajectorySnapshot(_objectSpread(_objectSpread({}, options), {}, {
|
|
93
|
+
name: "".concat(this.name, "-\u5FEB\u7167"),
|
|
94
|
+
id: "".concat(this.id, "_trajectoryMoreSnapshot")
|
|
95
|
+
}));
|
|
96
|
+
this.isCombinationComponent = true;
|
|
97
|
+
this.canSort = false;
|
|
98
|
+
this.dataType = "object";
|
|
99
|
+
this.children = [this.express, this.expressCode, this.expressSnapshot];
|
|
100
|
+
this.rules = (_this$componentConfig3 = this.componentConfig) !== null && _this$componentConfig3 !== void 0 && _this$componentConfig3.required ? [{
|
|
101
|
+
required: true,
|
|
102
|
+
validator: function validator(_, value) {
|
|
103
|
+
var hasNoCompany = value.some(function (item) {
|
|
104
|
+
return !item.trajectoryCompany;
|
|
105
|
+
});
|
|
106
|
+
var hasNoCode = value.some(function (item) {
|
|
107
|
+
return !item.trajectoryCode;
|
|
108
|
+
});
|
|
109
|
+
if (!hasNoCompany) {
|
|
110
|
+
return Promise.reject(new Error("请选择物流公司"));
|
|
111
|
+
}
|
|
112
|
+
if (!hasNoCode) {
|
|
113
|
+
return Promise.reject(new Error("请输入物流单号"));
|
|
114
|
+
}
|
|
115
|
+
return Promise.resolve();
|
|
116
|
+
}
|
|
117
|
+
}] : [];
|
|
118
|
+
});
|
|
119
|
+
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
|
+
parentId: string;
|
|
7
|
+
sortField: string;
|
|
8
|
+
type: string;
|
|
9
|
+
rules: any[];
|
|
10
|
+
componentConfig: ComponentInterface["componentConfig"];
|
|
11
|
+
align: ALignType;
|
|
12
|
+
width: number;
|
|
13
|
+
isCombinationComponent: boolean;
|
|
14
|
+
formField: string;
|
|
15
|
+
canSort: boolean;
|
|
16
|
+
children: ComponentInterface[];
|
|
17
|
+
dataType: ComponentInterface["dataType"];
|
|
18
|
+
constructor(options: PickOption);
|
|
19
|
+
renderCode: (record: any, w?: number) => React.JSX.Element;
|
|
20
|
+
renderClient: () => null;
|
|
21
|
+
renderPc: (value: unknown, record: Record) => React.JSX.Element;
|
|
22
|
+
renderLog: (r: Record) => React.JSX.Element | null;
|
|
23
|
+
getComponentValue: (r: Record) => any;
|
|
24
|
+
renderExport: (value: string, record: Record) => any;
|
|
25
|
+
editRender: () => null;
|
|
26
|
+
filterConfig: (item: ColumnConfig) => {
|
|
27
|
+
searchDefaultConditions: "like";
|
|
28
|
+
type: string;
|
|
29
|
+
id: string;
|
|
30
|
+
name: string;
|
|
31
|
+
filterComponentType: "Input";
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
export default TrajectoryCode;
|