@kmkf-fe-packages/services-components 0.23.1-alpha.0 → 0.23.1-beta.3
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 +11 -4
- package/dist/esm/components/BS/BsReissue/index.d.ts +7 -8
- package/dist/esm/components/BS/BsReissue/index.js +55 -32
- 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/BS/common/expressCode.js +3 -0
- package/dist/esm/components/BS/common/expressCompany.js +3 -0
- 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 +37 -26
- 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/JST/JstSendGood/index.js +6 -0
- 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/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 +8 -0
- package/dist/esm/factory.d.ts +2 -2
- package/dist/esm/factory.js +7 -3
- 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
|
@@ -8,72 +8,72 @@ 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 some from
|
|
11
|
+
import React from 'react';
|
|
12
|
+
import some from 'lodash/some';
|
|
13
13
|
import GetFormItem from "../GetFormItem";
|
|
14
14
|
import { CommonOrderContent } from "../Common";
|
|
15
|
-
import { CommonMultiStatus as Status } from
|
|
15
|
+
import { CommonMultiStatus as Status } from '@kmkf-fe-packages/basic-components';
|
|
16
16
|
import ItemView from "../../commonComponents/ItemView";
|
|
17
|
-
import { isNull, filterFn as _filterFn } from
|
|
17
|
+
import { isNull, filterFn as _filterFn } from '@kmkf-fe-packages/kmkf-utils';
|
|
18
18
|
import { SYMBOL } from "../../constant";
|
|
19
19
|
var typeMap = {
|
|
20
20
|
RETURN_GOODS_STATUS: {
|
|
21
21
|
options: [{
|
|
22
|
-
value:
|
|
23
|
-
label:
|
|
24
|
-
color:
|
|
22
|
+
value: '成功',
|
|
23
|
+
label: '成功',
|
|
24
|
+
color: '#52c41a'
|
|
25
25
|
}, {
|
|
26
|
-
value:
|
|
27
|
-
label:
|
|
28
|
-
color:
|
|
26
|
+
value: '失败',
|
|
27
|
+
label: '失败',
|
|
28
|
+
color: '#ff4d4f'
|
|
29
29
|
}],
|
|
30
|
-
key:
|
|
31
|
-
code:
|
|
32
|
-
name:
|
|
30
|
+
key: 'returnGoodsStatusList',
|
|
31
|
+
code: 'returnGoodsStatusValue',
|
|
32
|
+
name: '退货状态',
|
|
33
33
|
type: 1,
|
|
34
|
-
valueKey:
|
|
35
|
-
idKey:
|
|
36
|
-
failValue:
|
|
34
|
+
valueKey: 'status',
|
|
35
|
+
idKey: 'systemOrderId',
|
|
36
|
+
failValue: '失败'
|
|
37
37
|
},
|
|
38
38
|
EXCHANGE_STATUS: {
|
|
39
39
|
options: [{
|
|
40
|
-
value:
|
|
41
|
-
label:
|
|
42
|
-
color:
|
|
40
|
+
value: '成功',
|
|
41
|
+
label: '成功',
|
|
42
|
+
color: '#52c41a'
|
|
43
43
|
}, {
|
|
44
|
-
value:
|
|
45
|
-
label:
|
|
46
|
-
color:
|
|
44
|
+
value: '失败',
|
|
45
|
+
label: '失败',
|
|
46
|
+
color: '#ff4d4f'
|
|
47
47
|
}],
|
|
48
|
-
key:
|
|
49
|
-
code:
|
|
50
|
-
name:
|
|
48
|
+
key: 'exchangeReason',
|
|
49
|
+
code: 'exchangeStatusValue',
|
|
50
|
+
name: '换货状态',
|
|
51
51
|
type: 1,
|
|
52
|
-
valueKey:
|
|
53
|
-
idKey:
|
|
54
|
-
failValue:
|
|
52
|
+
valueKey: 'status',
|
|
53
|
+
idKey: 'systemOrderId',
|
|
54
|
+
failValue: '失败'
|
|
55
55
|
},
|
|
56
56
|
WAREHOUSING_STATUS: {
|
|
57
57
|
options: [{
|
|
58
|
-
value:
|
|
59
|
-
label:
|
|
60
|
-
color:
|
|
58
|
+
value: '2',
|
|
59
|
+
label: '已入库',
|
|
60
|
+
color: '#52c41a'
|
|
61
61
|
}, {
|
|
62
|
-
value:
|
|
63
|
-
label:
|
|
64
|
-
color:
|
|
62
|
+
value: '1',
|
|
63
|
+
label: '部分入库',
|
|
64
|
+
color: '#e7780f'
|
|
65
65
|
}, {
|
|
66
|
-
value:
|
|
67
|
-
label:
|
|
68
|
-
color:
|
|
66
|
+
value: '0',
|
|
67
|
+
label: '未入库',
|
|
68
|
+
color: '#ff4d4f'
|
|
69
69
|
}],
|
|
70
|
-
key:
|
|
71
|
-
code:
|
|
72
|
-
name:
|
|
70
|
+
key: 'inStockStatusItemList',
|
|
71
|
+
code: 'inStockStatusList',
|
|
72
|
+
name: '商品入库状态(勿填)',
|
|
73
73
|
type: 2,
|
|
74
|
-
valueKey:
|
|
75
|
-
idKey:
|
|
76
|
-
failValue:
|
|
74
|
+
valueKey: 'status',
|
|
75
|
+
idKey: 'systemOrderId',
|
|
76
|
+
failValue: '失败'
|
|
77
77
|
}
|
|
78
78
|
};
|
|
79
79
|
var CommonMultiStatus = /*#__PURE__*/_createClass(function CommonMultiStatus(options) {
|
|
@@ -144,8 +144,8 @@ var CommonMultiStatus = /*#__PURE__*/_createClass(function CommonMultiStatus(opt
|
|
|
144
144
|
var _typeMap$_this$type14;
|
|
145
145
|
return item[(_typeMap$_this$type14 = typeMap[_this.type]) === null || _typeMap$_this$type14 === void 0 ? void 0 : _typeMap$_this$type14.valueKey] === option.value;
|
|
146
146
|
});
|
|
147
|
-
return "".concat(item === null || item === void 0 ? void 0 : item[(_typeMap$_this$type15 = typeMap[_this.type]) === null || _typeMap$_this$type15 === void 0 ? void 0 : _typeMap$_this$type15.idKey], ":").concat(currentOption ? (currentOption === null || currentOption === void 0 ? void 0 : currentOption.label) ||
|
|
148
|
-
}).join(
|
|
147
|
+
return "".concat(item === null || item === void 0 ? void 0 : item[(_typeMap$_this$type15 = typeMap[_this.type]) === null || _typeMap$_this$type15 === void 0 ? void 0 : _typeMap$_this$type15.idKey], ":").concat(currentOption ? (currentOption === null || currentOption === void 0 ? void 0 : currentOption.label) || '' : (item === null || item === void 0 ? void 0 : item[(_typeMap$_this$type16 = typeMap[_this.type]) === null || _typeMap$_this$type16 === void 0 ? void 0 : _typeMap$_this$type16.valueKey]) || '');
|
|
148
|
+
}).join(',');
|
|
149
149
|
});
|
|
150
150
|
_defineProperty(this, "editRender", function (p) {
|
|
151
151
|
var _this$componentConfig, _this$componentConfig2, _typeMap$_this$type17;
|
|
@@ -164,16 +164,16 @@ var CommonMultiStatus = /*#__PURE__*/_createClass(function CommonMultiStatus(opt
|
|
|
164
164
|
_defineProperty(this, "filterConfig", function (item) {
|
|
165
165
|
var _typeMap$_this$type18, _item$templateConfig;
|
|
166
166
|
return {
|
|
167
|
-
searchDefaultConditions: _this.type ===
|
|
167
|
+
searchDefaultConditions: _this.type === 'WAREHOUSING_STATUS' ? SYMBOL.in : SYMBOL.like,
|
|
168
168
|
type: item.type,
|
|
169
169
|
id: "".concat(item.id, "_").concat((_typeMap$_this$type18 = typeMap[_this.type]) === null || _typeMap$_this$type18 === void 0 ? void 0 : _typeMap$_this$type18.code),
|
|
170
170
|
name: "".concat(_this.name),
|
|
171
|
-
filterComponentType: _this.type ===
|
|
171
|
+
filterComponentType: _this.type === 'WAREHOUSING_STATUS' ? 'MultipleSelect' : 'SelectInput',
|
|
172
172
|
props: {
|
|
173
173
|
options: item === null || item === void 0 ? void 0 : (_item$templateConfig = item.templateConfig) === null || _item$templateConfig === void 0 ? void 0 : _item$templateConfig.reasonList,
|
|
174
174
|
fieldNames: {
|
|
175
|
-
label:
|
|
176
|
-
value:
|
|
175
|
+
label: 'label',
|
|
176
|
+
value: 'value'
|
|
177
177
|
}
|
|
178
178
|
},
|
|
179
179
|
filterFn: function filterFn(value) {
|
|
@@ -181,6 +181,13 @@ var CommonMultiStatus = /*#__PURE__*/_createClass(function CommonMultiStatus(opt
|
|
|
181
181
|
var _typeMap$_this$type19;
|
|
182
182
|
return _filterFn.filterSplitComma(_filterFn.filterTableListItemColumnValue(i, item.id, (_typeMap$_this$type19 = typeMap[_this.type]) === null || _typeMap$_this$type19 === void 0 ? void 0 : _typeMap$_this$type19.code), value);
|
|
183
183
|
};
|
|
184
|
+
},
|
|
185
|
+
formatFilterValue: _this.type === 'WAREHOUSING_STATUS' ? null : function (value) {
|
|
186
|
+
if (value.type === 'keywords') {
|
|
187
|
+
return value.keywords;
|
|
188
|
+
} else {
|
|
189
|
+
return value;
|
|
190
|
+
}
|
|
184
191
|
}
|
|
185
192
|
};
|
|
186
193
|
});
|
|
@@ -195,7 +202,7 @@ var CommonMultiStatus = /*#__PURE__*/_createClass(function CommonMultiStatus(opt
|
|
|
195
202
|
this.isCombinationComponent = false;
|
|
196
203
|
this.canSort = false;
|
|
197
204
|
this.children = [];
|
|
198
|
-
this.dataType =
|
|
205
|
+
this.dataType = 'object';
|
|
199
206
|
this.rules = (_this$componentConfig3 = this.componentConfig) !== null && _this$componentConfig3 !== void 0 && _this$componentConfig3.required ? [{
|
|
200
207
|
required: true,
|
|
201
208
|
validator: function validator(_, value) {
|
|
@@ -210,6 +217,6 @@ var CommonMultiStatus = /*#__PURE__*/_createClass(function CommonMultiStatus(opt
|
|
|
210
217
|
return Promise.resolve();
|
|
211
218
|
}
|
|
212
219
|
}] : [];
|
|
213
|
-
this.align =
|
|
220
|
+
this.align = 'left';
|
|
214
221
|
});
|
|
215
222
|
export default CommonMultiStatus;
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { ComponentInterface, PickOption, ColumnConfig, ALignType, Record } from
|
|
2
|
-
import React from
|
|
1
|
+
import { ComponentInterface, PickOption, ColumnConfig, ALignType, Record } from '../../type';
|
|
2
|
+
import React from 'react';
|
|
3
3
|
declare class CommonSystemOrder 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
|
align: ALignType;
|
|
11
11
|
isCombinationComponent: boolean;
|
|
12
12
|
formField: string;
|
|
13
13
|
canSort: boolean;
|
|
14
14
|
children: ComponentInterface[];
|
|
15
|
-
dataType: ComponentInterface[
|
|
15
|
+
dataType: ComponentInterface['dataType'];
|
|
16
16
|
constructor(options: PickOption);
|
|
17
17
|
renderClient: (record: any) => React.JSX.Element | null;
|
|
18
18
|
renderPc: (value: any, record: Record) => React.JSX.Element;
|
|
@@ -21,12 +21,13 @@ declare class CommonSystemOrder implements ComponentInterface {
|
|
|
21
21
|
renderExport: (value: any, record: any) => any;
|
|
22
22
|
editRender: (p: any) => React.JSX.Element;
|
|
23
23
|
filterConfig: (item: ColumnConfig) => {
|
|
24
|
-
searchDefaultConditions: "
|
|
24
|
+
searchDefaultConditions: "in";
|
|
25
25
|
type: string;
|
|
26
26
|
id: string;
|
|
27
27
|
name: string;
|
|
28
28
|
filterComponentType: "Input";
|
|
29
29
|
filterFn: (value: string) => (i: Record) => boolean;
|
|
30
|
+
formatFilterValue: (input: string) => string | string[];
|
|
30
31
|
};
|
|
31
32
|
}
|
|
32
33
|
export default CommonSystemOrder;
|
|
@@ -6,42 +6,42 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
|
|
|
6
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
7
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
8
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
|
|
10
|
-
import some from
|
|
9
|
+
import React from 'react';
|
|
10
|
+
import some from 'lodash/some';
|
|
11
11
|
import GetFormItem from "../GetFormItem";
|
|
12
12
|
import { CommonOrderContent } from "../Common";
|
|
13
|
-
import { CommonSystemOrder as SystemOrder } from
|
|
13
|
+
import { CommonSystemOrder as SystemOrder } from '@kmkf-fe-packages/basic-components';
|
|
14
14
|
import ItemView from "../../commonComponents/ItemView";
|
|
15
|
-
import { isNull, filterFn as _filterFn } from
|
|
16
|
-
import { SYMBOL } from "../../constant";
|
|
15
|
+
import { isNull, filterFn as _filterFn } from '@kmkf-fe-packages/kmkf-utils';
|
|
16
|
+
import { SYMBOL, batchInput } from "../../constant";
|
|
17
17
|
var typeMap = {
|
|
18
18
|
BS_DELIVERY_NO: {
|
|
19
|
-
key:
|
|
20
|
-
code:
|
|
21
|
-
name:
|
|
19
|
+
key: 'deliveryNoList',
|
|
20
|
+
code: 'deliveryNoIds',
|
|
21
|
+
name: '出库单',
|
|
22
22
|
type: 1,
|
|
23
|
-
valueKey:
|
|
23
|
+
valueKey: 'deliveryNo'
|
|
24
24
|
},
|
|
25
25
|
RETURN_GOODS_TRADE_ID: {
|
|
26
|
-
key:
|
|
27
|
-
code:
|
|
28
|
-
name:
|
|
26
|
+
key: 'returnGoodsTradeItemList',
|
|
27
|
+
code: 'returnGoodsTradeIdList',
|
|
28
|
+
name: '退货单id',
|
|
29
29
|
type: 2,
|
|
30
|
-
valueKey:
|
|
30
|
+
valueKey: 'returnGoodsTradeId'
|
|
31
31
|
},
|
|
32
32
|
REISSUE_TRADE_ID: {
|
|
33
|
-
key:
|
|
34
|
-
code:
|
|
35
|
-
name:
|
|
33
|
+
key: 'tradeItemList',
|
|
34
|
+
code: 'tradeIdList',
|
|
35
|
+
name: '补发单id',
|
|
36
36
|
type: 3,
|
|
37
|
-
valueKey:
|
|
37
|
+
valueKey: 'billNo'
|
|
38
38
|
},
|
|
39
39
|
EXCHANGE_TRADE_ID: {
|
|
40
|
-
key:
|
|
41
|
-
code:
|
|
42
|
-
name:
|
|
40
|
+
key: 'tradeItemList',
|
|
41
|
+
code: 'tradeIdList',
|
|
42
|
+
name: '换货单id',
|
|
43
43
|
type: 4,
|
|
44
|
-
valueKey:
|
|
44
|
+
valueKey: 'billNo'
|
|
45
45
|
}
|
|
46
46
|
};
|
|
47
47
|
var CommonSystemOrder = /*#__PURE__*/_createClass(function CommonSystemOrder(options) {
|
|
@@ -106,7 +106,7 @@ var CommonSystemOrder = /*#__PURE__*/_createClass(function CommonSystemOrder(opt
|
|
|
106
106
|
return (list || []).map(function (item) {
|
|
107
107
|
var _typeMap$_this$type8;
|
|
108
108
|
return item === null || item === void 0 ? void 0 : item[(_typeMap$_this$type8 = typeMap[_this.type]) === null || _typeMap$_this$type8 === void 0 ? void 0 : _typeMap$_this$type8.valueKey];
|
|
109
|
-
}).join(
|
|
109
|
+
}).join(',');
|
|
110
110
|
});
|
|
111
111
|
_defineProperty(this, "editRender", function (p) {
|
|
112
112
|
var _this$componentConfig, _this$componentConfig2, _typeMap$_this$type9;
|
|
@@ -124,16 +124,19 @@ var CommonSystemOrder = /*#__PURE__*/_createClass(function CommonSystemOrder(opt
|
|
|
124
124
|
_defineProperty(this, "filterConfig", function (item) {
|
|
125
125
|
var _typeMap$_this$type10;
|
|
126
126
|
return {
|
|
127
|
-
searchDefaultConditions: SYMBOL.
|
|
127
|
+
searchDefaultConditions: SYMBOL.in,
|
|
128
128
|
type: item.type,
|
|
129
129
|
id: "".concat(item.id, "_").concat((_typeMap$_this$type10 = typeMap[_this.type]) === null || _typeMap$_this$type10 === void 0 ? void 0 : _typeMap$_this$type10.code),
|
|
130
130
|
name: "".concat(_this.name),
|
|
131
|
-
filterComponentType:
|
|
131
|
+
filterComponentType: 'Input',
|
|
132
132
|
filterFn: function filterFn(value) {
|
|
133
133
|
return function (i) {
|
|
134
134
|
var _typeMap$_this$type11;
|
|
135
135
|
return _filterFn.filterSplitComma(_filterFn.filterTableListItemColumnValue(i, item.id, (_typeMap$_this$type11 = typeMap[_this.type]) === null || _typeMap$_this$type11 === void 0 ? void 0 : _typeMap$_this$type11.code), value);
|
|
136
136
|
};
|
|
137
|
+
},
|
|
138
|
+
formatFilterValue: function formatFilterValue(input) {
|
|
139
|
+
return batchInput(input);
|
|
137
140
|
}
|
|
138
141
|
};
|
|
139
142
|
});
|
|
@@ -146,7 +149,7 @@ var CommonSystemOrder = /*#__PURE__*/_createClass(function CommonSystemOrder(opt
|
|
|
146
149
|
this.isCombinationComponent = false;
|
|
147
150
|
this.canSort = false;
|
|
148
151
|
this.children = [];
|
|
149
|
-
this.dataType =
|
|
152
|
+
this.dataType = 'object';
|
|
150
153
|
this.rules = (_this$componentConfig3 = this.componentConfig) !== null && _this$componentConfig3 !== void 0 && _this$componentConfig3.required ? [{
|
|
151
154
|
required: true,
|
|
152
155
|
validator: function validator(_, value) {
|
|
@@ -161,6 +164,6 @@ var CommonSystemOrder = /*#__PURE__*/_createClass(function CommonSystemOrder(opt
|
|
|
161
164
|
return Promise.resolve();
|
|
162
165
|
}
|
|
163
166
|
}] : [];
|
|
164
|
-
this.align =
|
|
167
|
+
this.align = 'left';
|
|
165
168
|
});
|
|
166
169
|
export default CommonSystemOrder;
|
|
@@ -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,37 @@ 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
|
+
var _this$componentConfig3, _e$target;
|
|
71
|
+
return p === null || p === void 0 ? void 0 : p.onChange((_this$componentConfig3 = _this.componentConfig) !== null && _this$componentConfig3 !== void 0 && _this$componentConfig3.isNumber ? e : e === null || e === void 0 ? void 0 : (_e$target = e.target) === null || _e$target === void 0 ? void 0 : _e$target.value);
|
|
72
|
+
}
|
|
69
73
|
}))
|
|
70
74
|
});
|
|
71
75
|
});
|
|
72
76
|
_defineProperty(this, "filterConfig", function (item) {
|
|
73
77
|
return {
|
|
74
|
-
searchDefaultConditions: SYMBOL.
|
|
78
|
+
searchDefaultConditions: SYMBOL.in,
|
|
75
79
|
type: item.type,
|
|
76
80
|
id: "".concat(item.id, "_input"),
|
|
77
81
|
// 过滤组件id
|
|
78
82
|
name: item.name,
|
|
79
83
|
// 过滤组件名称
|
|
80
|
-
filterComponentType:
|
|
84
|
+
filterComponentType: "SelectInput",
|
|
81
85
|
filterFn: function filterFn(value) {
|
|
82
86
|
return function (i) {
|
|
83
|
-
return "".concat(_filterFn.filterTableListItemColumnValue(i, item.id,
|
|
87
|
+
return "".concat(_filterFn.filterTableListItemColumnValue(i, item.id, "input")).includes(value);
|
|
84
88
|
};
|
|
89
|
+
},
|
|
90
|
+
formatFilterValue: function formatFilterValue(value) {
|
|
91
|
+
if (value.type === "keywords") {
|
|
92
|
+
return batchInput(value.keywords);
|
|
93
|
+
} else {
|
|
94
|
+
return value;
|
|
95
|
+
}
|
|
85
96
|
}
|
|
86
97
|
};
|
|
87
98
|
});
|
|
@@ -95,7 +106,7 @@ var BasicInput = /*#__PURE__*/_createClass(function BasicInput(options) {
|
|
|
95
106
|
this.workOrderUniqueKey = options === null || options === void 0 ? void 0 : options.workOrderUniqueKey;
|
|
96
107
|
this.rules = [{
|
|
97
108
|
validator: function validator(_, value) {
|
|
98
|
-
var _this$
|
|
109
|
+
var _this$componentConfig4, _this$componentConfig5, _this$componentConfig6, _this$componentConfig7, _this$componentConfig8;
|
|
99
110
|
if (!value) {
|
|
100
111
|
return Promise.resolve();
|
|
101
112
|
}
|
|
@@ -103,20 +114,20 @@ var BasicInput = /*#__PURE__*/_createClass(function BasicInput(options) {
|
|
|
103
114
|
var mail = /^[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(.[a-zA-Z0-9_-]+)+$/;
|
|
104
115
|
var phone = /^1\d{10}$/;
|
|
105
116
|
var testList = [];
|
|
106
|
-
((_this$
|
|
107
|
-
((_this$
|
|
108
|
-
((_this$
|
|
117
|
+
((_this$componentConfig4 = _this.componentConfig) === null || _this$componentConfig4 === void 0 ? void 0 : _this$componentConfig4.isNumber) && testList.push(number);
|
|
118
|
+
((_this$componentConfig5 = _this.componentConfig) === null || _this$componentConfig5 === void 0 ? void 0 : _this$componentConfig5.isMail) && testList.push(mail);
|
|
119
|
+
((_this$componentConfig6 = _this.componentConfig) === null || _this$componentConfig6 === void 0 ? void 0 : _this$componentConfig6.isPhone) && testList.push(phone);
|
|
109
120
|
var isTest = testList.some(function (item) {
|
|
110
121
|
return item.test(value);
|
|
111
122
|
});
|
|
112
123
|
if (testList.length && !isTest) {
|
|
113
|
-
return Promise.reject(new Error(
|
|
124
|
+
return Promise.reject(new Error("请填写正确的格式"));
|
|
114
125
|
}
|
|
115
|
-
if ((_this$
|
|
116
|
-
var _this$
|
|
117
|
-
var rulesList = (_this$
|
|
118
|
-
var _this$
|
|
119
|
-
return (((_this$
|
|
126
|
+
if ((_this$componentConfig7 = _this.componentConfig) !== null && _this$componentConfig7 !== void 0 && (_this$componentConfig8 = _this$componentConfig7.rulesOptions) !== null && _this$componentConfig8 !== void 0 && _this$componentConfig8.length) {
|
|
127
|
+
var _this$componentConfig9;
|
|
128
|
+
var rulesList = (_this$componentConfig9 = _this.componentConfig) === null || _this$componentConfig9 === void 0 ? void 0 : _this$componentConfig9.rulesOptions.filter(function (item) {
|
|
129
|
+
var _this$componentConfig10;
|
|
130
|
+
return (((_this$componentConfig10 = _this.componentConfig) === null || _this$componentConfig10 === void 0 ? void 0 : _this$componentConfig10.selectRules) || []).includes(item.id);
|
|
120
131
|
});
|
|
121
132
|
if (!rulesList.length) {
|
|
122
133
|
return Promise.resolve();
|
|
@@ -136,10 +147,10 @@ var BasicInput = /*#__PURE__*/_createClass(function BasicInput(options) {
|
|
|
136
147
|
return Promise.resolve();
|
|
137
148
|
}
|
|
138
149
|
}, {
|
|
139
|
-
validateTrigger:
|
|
150
|
+
validateTrigger: "onBlur",
|
|
140
151
|
validator: function () {
|
|
141
152
|
var _validator = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(_, value) {
|
|
142
|
-
var _this$
|
|
153
|
+
var _this$componentConfig11;
|
|
143
154
|
var _resultList$, params, _yield$replaceCheck, resultList;
|
|
144
155
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
145
156
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -150,7 +161,7 @@ var BasicInput = /*#__PURE__*/_createClass(function BasicInput(options) {
|
|
|
150
161
|
}
|
|
151
162
|
return _context.abrupt("return", Promise.resolve());
|
|
152
163
|
case 2:
|
|
153
|
-
if (!((_this$
|
|
164
|
+
if (!((_this$componentConfig11 = _this.componentConfig) !== null && _this$componentConfig11 !== void 0 && _this$componentConfig11.replaceWarn)) {
|
|
154
165
|
_context.next = 10;
|
|
155
166
|
break;
|
|
156
167
|
}
|
|
@@ -171,7 +182,7 @@ var BasicInput = /*#__PURE__*/_createClass(function BasicInput(options) {
|
|
|
171
182
|
_context.next = 10;
|
|
172
183
|
break;
|
|
173
184
|
}
|
|
174
|
-
return _context.abrupt("return", Promise.reject(new Error(
|
|
185
|
+
return _context.abrupt("return", Promise.reject(new Error("内容已存在,不能重复提交")));
|
|
175
186
|
case 10:
|
|
176
187
|
case "end":
|
|
177
188
|
return _context.stop();
|
|
@@ -187,6 +198,6 @@ var BasicInput = /*#__PURE__*/_createClass(function BasicInput(options) {
|
|
|
187
198
|
this.isCombinationComponent = false;
|
|
188
199
|
this.canSort = true;
|
|
189
200
|
this.children = [];
|
|
190
|
-
this.dataType = options !== null && options !== void 0 && (_options$componentCon = options.componentConfig) !== null && _options$componentCon !== void 0 && _options$componentCon.isNumber ?
|
|
201
|
+
this.dataType = options !== null && options !== void 0 && (_options$componentCon = options.componentConfig) !== null && _options$componentCon !== void 0 && _options$componentCon.isNumber ? "number" : "string";
|
|
191
202
|
});
|
|
192
203
|
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;
|
|
@@ -32,6 +32,12 @@ var typeMap = {
|
|
|
32
32
|
name: "wln",
|
|
33
33
|
sendId: "wlnSendId",
|
|
34
34
|
sendName: "wlnSendName"
|
|
35
|
+
},
|
|
36
|
+
WDT_SEND_GOOD: {
|
|
37
|
+
key: "wdtSendGood",
|
|
38
|
+
name: "wdt",
|
|
39
|
+
sendId: "wdtSendId",
|
|
40
|
+
sendName: "wdtSendName"
|
|
35
41
|
}
|
|
36
42
|
};
|
|
37
43
|
var JstSendGood = /*#__PURE__*/_createClass(function JstSendGood(_options) {
|