@kmkf-fe-packages/services-components 0.7.15-alpha.1 → 0.7.15-alpha.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/commonComponents/QueryLogisticsTrack/index.d.ts +1 -1
- package/dist/esm/commonComponents/QueryLogisticsTrack/index.js +61 -31
- package/dist/esm/components/BS/BsExchange/index.d.ts +47 -0
- package/dist/esm/components/BS/BsExchange/index.js +143 -0
- package/dist/esm/components/BS/BsGoods/index.d.ts +31 -0
- package/dist/esm/components/{BsSendGood → BS/BsGoods}/index.js +53 -57
- package/dist/esm/components/{BsLogistics → BS/BsLogistics}/index.d.ts +3 -3
- package/dist/esm/components/{BsLogistics → BS/BsLogistics}/index.js +3 -3
- package/dist/esm/components/BS/BsReissue/index.d.ts +47 -0
- package/dist/esm/components/BS/BsReissue/index.js +115 -0
- package/dist/esm/components/BS/common/BsExchangeImage.d.ts +31 -0
- package/dist/esm/components/BS/common/BsExchangeImage.js +126 -0
- package/dist/esm/components/BS/common/BsGoodImage.d.ts +31 -0
- package/dist/esm/components/BS/common/BsGoodImage.js +88 -0
- package/dist/esm/components/{BsSendGood/index.d.ts → BS/common/BsMemo.d.ts} +9 -9
- package/dist/esm/components/BS/common/BsMemo.js +76 -0
- package/dist/esm/components/BS/common/BsType.d.ts +35 -0
- package/dist/esm/components/BS/common/BsType.js +89 -0
- package/dist/esm/components/Common/index.d.ts +11 -6
- package/dist/esm/components/Common/index.js +105 -50
- package/dist/esm/components/Common/index.module.less +8 -0
- package/dist/esm/components/File/index.d.ts +7 -8
- package/dist/esm/components/File/index.js +20 -49
- package/dist/esm/components/Input/index.js +4 -1
- package/dist/esm/components/{JstItemSelect → JST/JstItemSelect}/index.d.ts +4 -4
- package/dist/esm/components/{JstItemSelect → JST/JstItemSelect}/index.js +19 -19
- package/dist/esm/components/{JstLogistics → JST/JstLogistics}/index.d.ts +4 -4
- package/dist/esm/components/{JstLogistics → JST/JstLogistics}/index.js +17 -17
- package/dist/esm/components/{JstSendGood → JST/JstSendGood}/index.d.ts +3 -3
- package/dist/esm/components/{JstSendGood → JST/JstSendGood}/index.js +46 -29
- package/dist/esm/components/{JstSupply → JST/JstSupply}/index.d.ts +3 -3
- package/dist/esm/components/{JstSupply → JST/JstSupply}/index.js +20 -20
- package/dist/esm/components/LogisticsTrajectory/index.d.ts +53 -0
- package/dist/esm/components/LogisticsTrajectory/index.js +107 -0
- package/dist/esm/components/LogisticsTrajectory/trajectoryCode.d.ts +35 -0
- package/dist/esm/components/LogisticsTrajectory/trajectoryCode.js +103 -0
- package/dist/esm/components/LogisticsTrajectory/trajectoryCompany.d.ts +39 -0
- package/dist/esm/components/LogisticsTrajectory/trajectoryCompany.js +91 -0
- package/dist/esm/components/LogisticsTrajectory/trajectorySnapshot.d.ts +32 -0
- package/dist/esm/components/LogisticsTrajectory/trajectorySnapshot.js +80 -0
- package/dist/esm/components/PostIng/index.d.ts +26 -3
- package/dist/esm/components/PostIng/index.js +94 -25
- package/dist/esm/factory.d.ts +2 -2
- package/dist/esm/factory.js +12 -3
- package/dist/esm/index.d.ts +9 -6
- package/dist/esm/index.js +9 -6
- package/dist/esm/type.d.ts +2 -1
- package/package.json +4 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import React from "react";
|
|
2
2
|
declare type getFormItemProps = {
|
|
3
3
|
name: string;
|
|
4
4
|
title: string;
|
|
@@ -6,13 +6,18 @@ declare type getFormItemProps = {
|
|
|
6
6
|
required: boolean;
|
|
7
7
|
component: JSX.Element | string | null;
|
|
8
8
|
};
|
|
9
|
-
export declare const getFormItem: ({ name, title, rules, required, component }: getFormItemProps) => JSX.Element;
|
|
10
|
-
export declare const showImage: ({ item, type, index }: {
|
|
9
|
+
export declare const getFormItem: ({ name, title, rules, required, component, }: getFormItemProps) => React.JSX.Element;
|
|
10
|
+
export declare const showImage: ({ item, type, index, }: {
|
|
11
11
|
item: any;
|
|
12
12
|
type: string;
|
|
13
13
|
index: number;
|
|
14
|
-
}) => JSX.Element;
|
|
15
|
-
export declare const ShowTotalImage: ({ total, allImage, type }: any) => JSX.Element;
|
|
16
|
-
export declare const GoodImage: ({ list, type }: any) => JSX.Element | null;
|
|
14
|
+
}) => React.JSX.Element;
|
|
15
|
+
export declare const ShowTotalImage: ({ total, allImage, type }: any) => React.JSX.Element;
|
|
16
|
+
export declare const GoodImage: ({ list, type }: any) => React.JSX.Element | null;
|
|
17
17
|
export declare const JstGoodImage: ({ list, type }: any) => any;
|
|
18
|
+
export declare const BsGoodImage: ({ item, index }: {
|
|
19
|
+
item: any;
|
|
20
|
+
index: number;
|
|
21
|
+
}) => React.JSX.Element;
|
|
22
|
+
export declare const BsExchangeList: ({ list }: any) => React.JSX.Element;
|
|
18
23
|
export {};
|
|
@@ -4,9 +4,9 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
4
4
|
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; }
|
|
5
5
|
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; } }
|
|
6
6
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
|
-
import { Form, Button, Modal, Tooltip, Space, Image, Popover } from
|
|
8
|
-
import React, { useState } from
|
|
9
|
-
import { ExpressData } from
|
|
7
|
+
import { Form, Button, Modal, Tooltip, Space, Image, Popover } from "antd";
|
|
8
|
+
import React, { useState } from "react";
|
|
9
|
+
import { ExpressData } from "@kmkf-fe-packages/kmkf-utils";
|
|
10
10
|
import styles from "./index.module.less";
|
|
11
11
|
import defaultImg from "./img/default-img.png";
|
|
12
12
|
export var getFormItem = function getFormItem(_ref) {
|
|
@@ -26,7 +26,7 @@ export var getFormItem = function getFormItem(_ref) {
|
|
|
26
26
|
return /*#__PURE__*/React.createElement("div", {
|
|
27
27
|
className: "form-item--wrap",
|
|
28
28
|
style: {
|
|
29
|
-
position:
|
|
29
|
+
position: "relative"
|
|
30
30
|
}
|
|
31
31
|
}, /*#__PURE__*/React.createElement(Form.Item, {
|
|
32
32
|
name: name,
|
|
@@ -40,43 +40,43 @@ export var showImage = function showImage(_ref2) {
|
|
|
40
40
|
var item = _ref2.item,
|
|
41
41
|
type = _ref2.type,
|
|
42
42
|
index = _ref2.index;
|
|
43
|
-
var picUrl = item.picUrl ? (item === null || item === void 0 ? void 0 : item.platform) !==
|
|
43
|
+
var picUrl = item.picUrl ? (item === null || item === void 0 ? void 0 : item.platform) !== "tabao" ? item.picUrl : item.picUrl + "_40x40.jpg" : defaultImg;
|
|
44
44
|
return /*#__PURE__*/React.createElement("div", {
|
|
45
45
|
className: styles.goodImgBox,
|
|
46
46
|
key: index
|
|
47
|
-
}, (item === null || item === void 0 ? void 0 : item.platform) ===
|
|
47
|
+
}, (item === null || item === void 0 ? void 0 : item.platform) === "taobao" ? /*#__PURE__*/React.createElement("a", {
|
|
48
48
|
target: "_blank",
|
|
49
49
|
href: "https://item.taobao.com/item.htm?id=".concat(item.numIid)
|
|
50
50
|
}, /*#__PURE__*/React.createElement("img", {
|
|
51
51
|
style: {
|
|
52
|
-
width:
|
|
53
|
-
height:
|
|
54
|
-
objectFit:
|
|
52
|
+
width: "40px",
|
|
53
|
+
height: "40px",
|
|
54
|
+
objectFit: "contain"
|
|
55
55
|
},
|
|
56
56
|
src: picUrl
|
|
57
57
|
})) : /*#__PURE__*/React.createElement("img", {
|
|
58
58
|
style: {
|
|
59
|
-
width:
|
|
60
|
-
height:
|
|
61
|
-
objectFit:
|
|
59
|
+
width: "40px",
|
|
60
|
+
height: "40px",
|
|
61
|
+
objectFit: "contain"
|
|
62
62
|
},
|
|
63
63
|
src: picUrl
|
|
64
64
|
}), /*#__PURE__*/React.createElement("div", {
|
|
65
65
|
className: styles.options
|
|
66
|
-
}, type ===
|
|
67
|
-
title:
|
|
66
|
+
}, type === "itemId" && /*#__PURE__*/React.createElement(TextTool, {
|
|
67
|
+
title: "商品id",
|
|
68
68
|
text: item.numIid
|
|
69
|
-
}), type ===
|
|
70
|
-
title:
|
|
69
|
+
}), type === "itemCode" && /*#__PURE__*/React.createElement(TextTool, {
|
|
70
|
+
title: "商品编码",
|
|
71
71
|
text: item.outerId
|
|
72
|
-
}), (type ===
|
|
73
|
-
title:
|
|
72
|
+
}), (type === "itemThird" || type === "jstItemThird") && (item.itemId || item.supplierItemOuterId) && /*#__PURE__*/React.createElement(TextTool, {
|
|
73
|
+
title: "供应商编码",
|
|
74
74
|
text: item.itemId || item.supplierItemOuterId
|
|
75
|
-
}), (type ===
|
|
76
|
-
title:
|
|
75
|
+
}), (type === "itemThird" || type === "jstItemThird") && item.supplierName && /*#__PURE__*/React.createElement(TextTool, {
|
|
76
|
+
title: "供应商名称",
|
|
77
77
|
text: item.supplierName
|
|
78
78
|
}), item.propertiesName && /*#__PURE__*/React.createElement(TextTool, {
|
|
79
|
-
title:
|
|
79
|
+
title: "规格",
|
|
80
80
|
text: item.propertiesName
|
|
81
81
|
})));
|
|
82
82
|
};
|
|
@@ -89,9 +89,9 @@ var TextTool = function TextTool(_ref3) {
|
|
|
89
89
|
title: text
|
|
90
90
|
}, /*#__PURE__*/React.createElement("div", {
|
|
91
91
|
style: {
|
|
92
|
-
overflow:
|
|
93
|
-
whiteSpace:
|
|
94
|
-
textOverflow:
|
|
92
|
+
overflow: "hidden",
|
|
93
|
+
whiteSpace: "nowrap",
|
|
94
|
+
textOverflow: "ellipsis"
|
|
95
95
|
}
|
|
96
96
|
}, title, ":", text));
|
|
97
97
|
};
|
|
@@ -119,47 +119,47 @@ export var ShowTotalImage = function ShowTotalImage(_ref4) {
|
|
|
119
119
|
title: "\u6240\u6709\u9009\u62E9\u5B9D\u8D1D"
|
|
120
120
|
}, /*#__PURE__*/React.createElement("div", {
|
|
121
121
|
style: {
|
|
122
|
-
display:
|
|
123
|
-
flexWrap:
|
|
122
|
+
display: "flex",
|
|
123
|
+
flexWrap: "wrap"
|
|
124
124
|
}
|
|
125
125
|
}, allImage.map(function (i, index) {
|
|
126
126
|
return /*#__PURE__*/React.createElement("div", {
|
|
127
127
|
style: {
|
|
128
|
-
width:
|
|
128
|
+
width: "50%"
|
|
129
129
|
},
|
|
130
130
|
key: index
|
|
131
131
|
}, /*#__PURE__*/React.createElement("a", {
|
|
132
132
|
href: i.link,
|
|
133
133
|
target: "__blank",
|
|
134
134
|
style: {
|
|
135
|
-
marginRight:
|
|
136
|
-
marginTop:
|
|
137
|
-
padding:
|
|
138
|
-
border:
|
|
139
|
-
display:
|
|
135
|
+
marginRight: "12px",
|
|
136
|
+
marginTop: "8px",
|
|
137
|
+
padding: "2px",
|
|
138
|
+
border: "1px dashed #ccc",
|
|
139
|
+
display: "inline-block"
|
|
140
140
|
}
|
|
141
141
|
}, /*#__PURE__*/React.createElement("img", {
|
|
142
142
|
alt: "",
|
|
143
143
|
src: i.picUrl || defaultImg,
|
|
144
144
|
style: {
|
|
145
|
-
width:
|
|
146
|
-
height:
|
|
147
|
-
objectFit:
|
|
145
|
+
width: "72px",
|
|
146
|
+
height: "72px",
|
|
147
|
+
objectFit: "contain"
|
|
148
148
|
}
|
|
149
|
-
})), /*#__PURE__*/React.createElement("div", null, type ===
|
|
150
|
-
title:
|
|
149
|
+
})), /*#__PURE__*/React.createElement("div", null, type === "itemId" && /*#__PURE__*/React.createElement(TextTool, {
|
|
150
|
+
title: "商品id",
|
|
151
151
|
text: i.numIid
|
|
152
|
-
}), type ===
|
|
153
|
-
title:
|
|
152
|
+
}), type === "itemCode" && /*#__PURE__*/React.createElement(TextTool, {
|
|
153
|
+
title: "商品编码",
|
|
154
154
|
text: i.outerId
|
|
155
|
-
}), (type ===
|
|
156
|
-
title:
|
|
155
|
+
}), (type === "itemThird" || type === "jstItemThird") && (i.itemId || i.supplierItemOuterId) && /*#__PURE__*/React.createElement(TextTool, {
|
|
156
|
+
title: "供应商编码",
|
|
157
157
|
text: i.itemId || i.supplierItemOuterId
|
|
158
|
-
}), (type ===
|
|
159
|
-
title:
|
|
158
|
+
}), (type === "itemThird" || type === "jstItemThird") && i.supplierName && /*#__PURE__*/React.createElement(TextTool, {
|
|
159
|
+
title: "供应商名称",
|
|
160
160
|
text: i.supplierName
|
|
161
161
|
}), i.propertiesName && /*#__PURE__*/React.createElement(TextTool, {
|
|
162
|
-
title:
|
|
162
|
+
title: "规格",
|
|
163
163
|
text: i.propertiesName
|
|
164
164
|
})));
|
|
165
165
|
}))));
|
|
@@ -169,12 +169,12 @@ export var GoodImage = function GoodImage(_ref5) {
|
|
|
169
169
|
var _list$slice;
|
|
170
170
|
var list = _ref5.list,
|
|
171
171
|
_ref5$type = _ref5.type,
|
|
172
|
-
type = _ref5$type === void 0 ?
|
|
172
|
+
type = _ref5$type === void 0 ? "" : _ref5$type;
|
|
173
173
|
var total = (list === null || list === void 0 ? void 0 : list.length) || 0;
|
|
174
174
|
var initShowTotal = 3;
|
|
175
175
|
return (list === null || list === void 0 ? void 0 : list.length) > 0 ? /*#__PURE__*/React.createElement("div", {
|
|
176
176
|
style: {
|
|
177
|
-
display: type ===
|
|
177
|
+
display: type === "itemSelect" ? "flex" : "block"
|
|
178
178
|
}
|
|
179
179
|
}, list === null || list === void 0 ? void 0 : (_list$slice = list.slice(0, initShowTotal)) === null || _list$slice === void 0 ? void 0 : _list$slice.map(function (item, index) {
|
|
180
180
|
return showImage({
|
|
@@ -191,7 +191,7 @@ export var GoodImage = function GoodImage(_ref5) {
|
|
|
191
191
|
var content = function content(item, index) {
|
|
192
192
|
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
|
|
193
193
|
style: {
|
|
194
|
-
textAlign:
|
|
194
|
+
textAlign: "center"
|
|
195
195
|
}
|
|
196
196
|
}, "\u5305\u88F9".concat(index + 1, "\u5546\u54C1\u4FE1\u606F")), ((item === null || item === void 0 ? void 0 : item.items) || []).map(function (t, index) {
|
|
197
197
|
return /*#__PURE__*/React.createElement("div", {
|
|
@@ -215,9 +215,64 @@ export var JstGoodImage = function JstGoodImage(_ref6) {
|
|
|
215
215
|
}, /*#__PURE__*/React.createElement("span", {
|
|
216
216
|
key: index,
|
|
217
217
|
style: {
|
|
218
|
-
color:
|
|
219
|
-
cursor:
|
|
218
|
+
color: "#1890ff",
|
|
219
|
+
cursor: "pointer"
|
|
220
220
|
}
|
|
221
|
-
}, "\u5305\u88F9".concat(index + 1), ":")), type === 1 ? /*#__PURE__*/React.createElement("span", null, company && item.logisticsCode ? [company, item.logisticsCode].join(
|
|
221
|
+
}, "\u5305\u88F9".concat(index + 1), ":")), type === 1 ? /*#__PURE__*/React.createElement("span", null, company && item.logisticsCode ? [company, item.logisticsCode].join("/") : company ? company : item.logisticsCode) : null, type === 2 ? /*#__PURE__*/React.createElement("span", null, item.supplyName && item.supplyId ? [item.supplyId, item.supplyName].join("/") : item.supplyId ? item.supplyId : item.supplyName) : null, type === 3 ? /*#__PURE__*/React.createElement("span", null, item.sendName && item.sendId ? [item.sendId, item.sendName].join("/") : item.sendId ? item.sendId : item.sendName) : null));
|
|
222
222
|
}) : null;
|
|
223
|
+
};
|
|
224
|
+
//bs商品展示
|
|
225
|
+
export var BsGoodImage = function BsGoodImage(_ref7) {
|
|
226
|
+
var item = _ref7.item,
|
|
227
|
+
index = _ref7.index;
|
|
228
|
+
var picUrl = item.picUrl || defaultImg;
|
|
229
|
+
var keyMap = {
|
|
230
|
+
name: "bs名称",
|
|
231
|
+
code: "bs编码",
|
|
232
|
+
skuId: "bssku编码",
|
|
233
|
+
money: "bs实付金额",
|
|
234
|
+
number: "bs数量",
|
|
235
|
+
share: "bs分摊价",
|
|
236
|
+
type: "bs赠品类型"
|
|
237
|
+
};
|
|
238
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
239
|
+
className: styles.goodImgBox,
|
|
240
|
+
key: index
|
|
241
|
+
}, /*#__PURE__*/React.createElement("img", {
|
|
242
|
+
style: {
|
|
243
|
+
width: "40px",
|
|
244
|
+
height: "40px",
|
|
245
|
+
objectFit: "contain"
|
|
246
|
+
},
|
|
247
|
+
src: picUrl
|
|
248
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
249
|
+
className: styles.options
|
|
250
|
+
}, Object.keys(keyMap).map(function (key) {
|
|
251
|
+
return item[key] ? /*#__PURE__*/React.createElement(TextTool, {
|
|
252
|
+
title: keyMap[key],
|
|
253
|
+
text: item[key]
|
|
254
|
+
}) : null;
|
|
255
|
+
})));
|
|
256
|
+
};
|
|
257
|
+
export var BsExchangeList = function BsExchangeList(_ref8) {
|
|
258
|
+
var list = _ref8.list;
|
|
259
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
260
|
+
className: styles.bsImgBox
|
|
261
|
+
}, list.map(function (item) {
|
|
262
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
263
|
+
className: styles.bsImgItem
|
|
264
|
+
}, ((item === null || item === void 0 ? void 0 : item.returnGood) || []).map(function (t, i) {
|
|
265
|
+
return BsGoodImage({
|
|
266
|
+
item: t,
|
|
267
|
+
index: i
|
|
268
|
+
});
|
|
269
|
+
})), "==>", /*#__PURE__*/React.createElement("div", {
|
|
270
|
+
className: styles.bsImgItem
|
|
271
|
+
}, ((item === null || item === void 0 ? void 0 : item.returnGood) || []).map(function (t, i) {
|
|
272
|
+
return BsGoodImage({
|
|
273
|
+
item: t,
|
|
274
|
+
index: i
|
|
275
|
+
});
|
|
276
|
+
})));
|
|
277
|
+
}));
|
|
223
278
|
};
|
|
@@ -1,32 +1,31 @@
|
|
|
1
1
|
import { ComponentInterface, PickOption, Record } from "../../type";
|
|
2
2
|
import React from "react";
|
|
3
|
-
declare type Value = string[] | undefined;
|
|
4
3
|
declare class BasicFile implements ComponentInterface {
|
|
5
4
|
name: string;
|
|
6
5
|
id: string;
|
|
7
6
|
sortField: string;
|
|
7
|
+
formField: string;
|
|
8
8
|
type: string;
|
|
9
9
|
rules: any[];
|
|
10
10
|
componentConfig: ComponentInterface["componentConfig"];
|
|
11
11
|
isCombinationComponent: boolean;
|
|
12
12
|
canSort: boolean;
|
|
13
13
|
children: ComponentInterface[];
|
|
14
|
+
dataType: ComponentInterface["dataType"];
|
|
14
15
|
constructor(options: PickOption);
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
renderPc: (value: any, record: Record) => React.JSX.Element | React.JSX.Element[];
|
|
18
|
-
renderLog: (r: Record) => React.JSX.Element | React.JSX.Element[] | null;
|
|
16
|
+
renderPc: (value: any, record: Record) => any;
|
|
17
|
+
renderLog: (r: Record) => any;
|
|
19
18
|
getComponentValue: (r: Record) => any;
|
|
20
19
|
renderClient: (record: any) => React.JSX.Element | null;
|
|
21
20
|
editRender: () => React.JSX.Element;
|
|
22
21
|
/**
|
|
23
22
|
*
|
|
24
|
-
* @returns
|
|
23
|
+
* @returns
|
|
25
24
|
*/
|
|
26
|
-
renderExport: () =>
|
|
25
|
+
renderExport: (value: any, record: any) => any;
|
|
27
26
|
/**
|
|
28
27
|
*
|
|
29
|
-
* @returns
|
|
28
|
+
* @returns 文件不支持过滤
|
|
30
29
|
*/
|
|
31
30
|
filterConfig: () => never[];
|
|
32
31
|
}
|
|
@@ -7,9 +7,7 @@ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key i
|
|
|
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
9
|
import React from "react";
|
|
10
|
-
import { Image } from "antd";
|
|
11
10
|
import { ApaasUploadFile } from "@kmkf-fe-packages/basic-components";
|
|
12
|
-
import { imgResize } from "@kmkf-fe-packages/kmkf-utils";
|
|
13
11
|
import GetFormItem from "../GetFormItem";
|
|
14
12
|
import ItemView from "../../commonComponents/ItemView";
|
|
15
13
|
import { isNull } from "@kmkf-fe-packages/kmkf-utils";
|
|
@@ -19,70 +17,37 @@ var BasicFile = /*#__PURE__*/_createClass(function BasicFile(options) {
|
|
|
19
17
|
_defineProperty(this, "name", void 0);
|
|
20
18
|
_defineProperty(this, "id", void 0);
|
|
21
19
|
_defineProperty(this, "sortField", void 0);
|
|
20
|
+
_defineProperty(this, "formField", void 0);
|
|
22
21
|
_defineProperty(this, "type", void 0);
|
|
23
22
|
_defineProperty(this, "rules", void 0);
|
|
24
23
|
_defineProperty(this, "componentConfig", void 0);
|
|
25
24
|
_defineProperty(this, "isCombinationComponent", void 0);
|
|
26
25
|
_defineProperty(this, "canSort", void 0);
|
|
27
26
|
_defineProperty(this, "children", void 0);
|
|
28
|
-
_defineProperty(this, "
|
|
29
|
-
pictures = pictures.replace(/[\[\]]/g, "");
|
|
30
|
-
pictures = pictures.replace(/\s/g, "");
|
|
31
|
-
return pictures ? pictures.split(",") : [];
|
|
32
|
-
});
|
|
33
|
-
_defineProperty(this, "render", function (value) {
|
|
34
|
-
if (!(value !== null && value !== void 0 && value.length)) {
|
|
35
|
-
return null;
|
|
36
|
-
}
|
|
37
|
-
return /*#__PURE__*/React.createElement("div", null, value === null || value === void 0 ? void 0 : value.map(function (pic) {
|
|
38
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
39
|
-
style: {
|
|
40
|
-
marginRight: "5px",
|
|
41
|
-
display: "inline-block"
|
|
42
|
-
}
|
|
43
|
-
}, /*#__PURE__*/React.createElement(Image, {
|
|
44
|
-
width: 32,
|
|
45
|
-
src: imgResize(pic || ""),
|
|
46
|
-
preview: {
|
|
47
|
-
src: imgResize(pic || "", 0, 0)
|
|
48
|
-
}
|
|
49
|
-
}));
|
|
50
|
-
}));
|
|
51
|
-
});
|
|
27
|
+
_defineProperty(this, "dataType", void 0);
|
|
52
28
|
_defineProperty(this, "renderPc", function (value, record) {
|
|
53
|
-
|
|
29
|
+
var fileList = (record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_file")]) || [];
|
|
30
|
+
if (!fileList.length) {
|
|
54
31
|
return /*#__PURE__*/React.createElement("span", null, "--");
|
|
55
32
|
}
|
|
56
|
-
|
|
57
|
-
return ""
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
61
|
-
style: {
|
|
62
|
-
marginRight: "5px",
|
|
63
|
-
display: "inline-block"
|
|
64
|
-
}
|
|
65
|
-
}, /*#__PURE__*/React.createElement(Image, {
|
|
66
|
-
width: 32,
|
|
67
|
-
src: "".concat(pic, "?x-oss-process=image/resize,m_pad,h_40,w_40"),
|
|
68
|
-
preview: {
|
|
69
|
-
src: pic
|
|
70
|
-
}
|
|
71
|
-
}));
|
|
33
|
+
return fileList === null || fileList === void 0 ? void 0 : fileList.map(function (file) {
|
|
34
|
+
return /*#__PURE__*/React.createElement("a", {
|
|
35
|
+
href: file.url
|
|
36
|
+
}, file.name);
|
|
72
37
|
});
|
|
73
38
|
});
|
|
74
39
|
_defineProperty(this, "renderLog", function (r) {
|
|
75
|
-
if (isNull(r === null || r === void 0 ? void 0 : r["".concat(_this.id, "
|
|
40
|
+
if (isNull(r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_file")])) return null;
|
|
76
41
|
return _this.renderPc(undefined, r);
|
|
77
42
|
});
|
|
78
43
|
_defineProperty(this, "getComponentValue", function (r) {
|
|
79
|
-
return r === null || r === void 0 ? void 0 : r["".concat(_this.id, "
|
|
44
|
+
return r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_file")];
|
|
80
45
|
});
|
|
81
46
|
_defineProperty(this, "renderClient", function (record) {
|
|
82
|
-
return !isNull(record === null || record === void 0 ? void 0 : record[_this.id]) ? /*#__PURE__*/React.createElement(ItemView, {
|
|
47
|
+
return !isNull(record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_file")]) ? /*#__PURE__*/React.createElement(ItemView, {
|
|
83
48
|
id: _this.id,
|
|
84
49
|
label: _this.name,
|
|
85
|
-
value: _this.
|
|
50
|
+
value: _this.renderPc(null, record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_file")])
|
|
86
51
|
}) : null;
|
|
87
52
|
});
|
|
88
53
|
_defineProperty(this, "editRender", function () {
|
|
@@ -98,8 +63,12 @@ var BasicFile = /*#__PURE__*/_createClass(function BasicFile(options) {
|
|
|
98
63
|
}))
|
|
99
64
|
});
|
|
100
65
|
});
|
|
101
|
-
_defineProperty(this, "renderExport", function () {
|
|
102
|
-
|
|
66
|
+
_defineProperty(this, "renderExport", function (value, record) {
|
|
67
|
+
var textArr = ((record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_rate")]) || []).reduce(function (prv, next) {
|
|
68
|
+
prv.push(next.url);
|
|
69
|
+
return prv;
|
|
70
|
+
}, []);
|
|
71
|
+
return textArr === null || textArr === void 0 ? void 0 : textArr.join(",");
|
|
103
72
|
});
|
|
104
73
|
_defineProperty(this, "filterConfig", function () {
|
|
105
74
|
return [];
|
|
@@ -107,11 +76,13 @@ var BasicFile = /*#__PURE__*/_createClass(function BasicFile(options) {
|
|
|
107
76
|
this.name = options.name;
|
|
108
77
|
this.id = options.id;
|
|
109
78
|
this.sortField = "".concat(options.id, "_file");
|
|
79
|
+
this.formField = "".concat(options.id, "_file");
|
|
110
80
|
this.type = options.type;
|
|
111
81
|
this.componentConfig = options.componentConfig;
|
|
112
82
|
this.rules = [];
|
|
113
83
|
this.isCombinationComponent = false;
|
|
114
84
|
this.canSort = false;
|
|
115
85
|
this.children = [];
|
|
86
|
+
this.dataType = "array";
|
|
116
87
|
});
|
|
117
88
|
export default BasicFile;
|
|
@@ -87,6 +87,9 @@ var BasicInput = /*#__PURE__*/_createClass(function BasicInput(options) {
|
|
|
87
87
|
this.rules = [{
|
|
88
88
|
validator: function validator(_, value) {
|
|
89
89
|
var _this$componentConfig3, _this$componentConfig4, _this$componentConfig5;
|
|
90
|
+
if (!value) {
|
|
91
|
+
return Promise.resolve();
|
|
92
|
+
}
|
|
90
93
|
var number = /^(([0-9]*(\.[0-9]{1,})$)|([0-9]+$))/;
|
|
91
94
|
var mail = /^[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(.[a-zA-Z0-9_-]+)+$/;
|
|
92
95
|
var phone = /^1\d{10}$/;
|
|
@@ -97,7 +100,7 @@ var BasicInput = /*#__PURE__*/_createClass(function BasicInput(options) {
|
|
|
97
100
|
var isTest = testList.some(function (item) {
|
|
98
101
|
return item.test(value);
|
|
99
102
|
});
|
|
100
|
-
if (!isTest) {
|
|
103
|
+
if (testList.length && !isTest) {
|
|
101
104
|
return Promise.reject(new Error("请填写正确的格式"));
|
|
102
105
|
}
|
|
103
106
|
return Promise.resolve();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ComponentInterface, PickOption, ColumnConfig, ALignType, Record } from
|
|
2
|
-
import React from
|
|
3
|
-
import { ExpressData } from
|
|
1
|
+
import { ComponentInterface, PickOption, ColumnConfig, ALignType, Record } from "../../../type";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { ExpressData } from "@kmkf-fe-packages/kmkf-utils";
|
|
4
4
|
declare class JstItemSelect implements ComponentInterface {
|
|
5
5
|
name: string;
|
|
6
6
|
id: string;
|
|
@@ -14,7 +14,7 @@ declare class JstItemSelect implements ComponentInterface {
|
|
|
14
14
|
formField: string;
|
|
15
15
|
canSort: boolean;
|
|
16
16
|
children: ComponentInterface[];
|
|
17
|
-
dataType: ComponentInterface[
|
|
17
|
+
dataType: ComponentInterface["dataType"];
|
|
18
18
|
constructor(options: PickOption);
|
|
19
19
|
renderClient: (record: Record) => React.JSX.Element | null;
|
|
20
20
|
renderPc: (value: any, record: Record) => React.JSX.Element;
|
|
@@ -6,14 +6,14 @@ 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 { ExpressData } from
|
|
11
|
-
import GetFormItem from "
|
|
12
|
-
import { GoodImage } from "
|
|
13
|
-
import { JstItemList } from
|
|
14
|
-
import ItemView from "
|
|
15
|
-
import { isNull, filterFn as _filterFn } from
|
|
16
|
-
import { SYMBOL } from "
|
|
9
|
+
import React from "react";
|
|
10
|
+
import { ExpressData } from "@kmkf-fe-packages/kmkf-utils";
|
|
11
|
+
import GetFormItem from "../../GetFormItem";
|
|
12
|
+
import { GoodImage } from "../../Common";
|
|
13
|
+
import { JstItemList } from "@kmkf-fe-packages/basic-components";
|
|
14
|
+
import ItemView from "../../../commonComponents/ItemView";
|
|
15
|
+
import { isNull, filterFn as _filterFn } from "@kmkf-fe-packages/kmkf-utils";
|
|
16
|
+
import { SYMBOL } from "../../../constant";
|
|
17
17
|
var JstItemSelect = /*#__PURE__*/_createClass(function JstItemSelect(options) {
|
|
18
18
|
var _this = this,
|
|
19
19
|
_this$componentConfig;
|
|
@@ -60,8 +60,8 @@ var JstItemSelect = /*#__PURE__*/_createClass(function JstItemSelect(options) {
|
|
|
60
60
|
_defineProperty(this, "renderExport", function (value, record) {
|
|
61
61
|
var list = record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_jstItemList")];
|
|
62
62
|
return (list || []).map(function (item) {
|
|
63
|
-
return [item === null || item === void 0 ? void 0 : item.itemId, item === null || item === void 0 ? void 0 : item.supplierName].join(
|
|
64
|
-
}).join(
|
|
63
|
+
return [item === null || item === void 0 ? void 0 : item.itemId, item === null || item === void 0 ? void 0 : item.supplierName].join("/");
|
|
64
|
+
}).join(",");
|
|
65
65
|
});
|
|
66
66
|
_defineProperty(this, "editRender", function (p) {
|
|
67
67
|
return /*#__PURE__*/React.createElement(GetFormItem, {
|
|
@@ -81,11 +81,11 @@ var JstItemSelect = /*#__PURE__*/_createClass(function JstItemSelect(options) {
|
|
|
81
81
|
type: item.type,
|
|
82
82
|
id: "".concat(item.id, "_itemId"),
|
|
83
83
|
name: "jst\u4F9B\u5E94\u5546\u7F16\u7801",
|
|
84
|
-
filterComponentType:
|
|
84
|
+
filterComponentType: "Input",
|
|
85
85
|
filterFn: function filterFn(value) {
|
|
86
86
|
return function (i) {
|
|
87
87
|
var _ref;
|
|
88
|
-
return (_ref = _filterFn.filterTableListItemColumnValue(i, item.id,
|
|
88
|
+
return (_ref = _filterFn.filterTableListItemColumnValue(i, item.id, "jstItemList") || []) === null || _ref === void 0 ? void 0 : _ref.some(function (item) {
|
|
89
89
|
var _String;
|
|
90
90
|
var id = item !== null && item !== void 0 && item.itemId ? (_String = String(item === null || item === void 0 ? void 0 : item.itemId)) === null || _String === void 0 ? void 0 : _String.includes(value) : false;
|
|
91
91
|
return id;
|
|
@@ -97,11 +97,11 @@ var JstItemSelect = /*#__PURE__*/_createClass(function JstItemSelect(options) {
|
|
|
97
97
|
type: item.type,
|
|
98
98
|
id: "".concat(item.id, "_supplierName"),
|
|
99
99
|
name: "jst\u4F9B\u5E94\u5546\u540D\u79F0",
|
|
100
|
-
filterComponentType:
|
|
100
|
+
filterComponentType: "Input",
|
|
101
101
|
filterFn: function filterFn(value) {
|
|
102
102
|
return function (i) {
|
|
103
103
|
var _ref2;
|
|
104
|
-
return (_ref2 = _filterFn.filterTableListItemColumnValue(i, item.id,
|
|
104
|
+
return (_ref2 = _filterFn.filterTableListItemColumnValue(i, item.id, "jstItemList") || []) === null || _ref2 === void 0 ? void 0 : _ref2.some(function (item) {
|
|
105
105
|
var _String2;
|
|
106
106
|
var name = item !== null && item !== void 0 && item.supplierName ? (_String2 = String(item === null || item === void 0 ? void 0 : item.supplierName)) === null || _String2 === void 0 ? void 0 : _String2.includes(value) : false;
|
|
107
107
|
return name;
|
|
@@ -119,30 +119,30 @@ var JstItemSelect = /*#__PURE__*/_createClass(function JstItemSelect(options) {
|
|
|
119
119
|
this.isCombinationComponent = false;
|
|
120
120
|
this.canSort = false;
|
|
121
121
|
this.children = [];
|
|
122
|
-
this.dataType =
|
|
122
|
+
this.dataType = "object";
|
|
123
123
|
this.rules = (_this$componentConfig = this.componentConfig) !== null && _this$componentConfig !== void 0 && _this$componentConfig.required ? [{
|
|
124
124
|
required: true,
|
|
125
125
|
validator: function validator(_, value) {
|
|
126
126
|
var _this$componentConfig2, _this$componentConfig3;
|
|
127
127
|
if (!value || !value.length) {
|
|
128
|
-
return Promise.reject(new Error(
|
|
128
|
+
return Promise.reject(new Error("请选择宝贝"));
|
|
129
129
|
}
|
|
130
130
|
var hasNotId = (value || []).some(function (item) {
|
|
131
131
|
return !item.itemId;
|
|
132
132
|
});
|
|
133
133
|
if ((_this$componentConfig2 = _this.componentConfig) !== null && _this$componentConfig2 !== void 0 && _this$componentConfig2.enableItemId && hasNotId) {
|
|
134
|
-
return Promise.reject(new Error(
|
|
134
|
+
return Promise.reject(new Error("请输入供应商编码"));
|
|
135
135
|
}
|
|
136
136
|
var hasNotName = (value || []).some(function (item) {
|
|
137
137
|
return !item.supplierName;
|
|
138
138
|
});
|
|
139
139
|
if ((_this$componentConfig3 = _this.componentConfig) !== null && _this$componentConfig3 !== void 0 && _this$componentConfig3.enableSupplierName && hasNotName) {
|
|
140
|
-
return Promise.reject(new Error(
|
|
140
|
+
return Promise.reject(new Error("请输入供应商名称"));
|
|
141
141
|
}
|
|
142
142
|
return Promise.resolve();
|
|
143
143
|
}
|
|
144
144
|
}] : [];
|
|
145
|
-
this.align =
|
|
145
|
+
this.align = "left";
|
|
146
146
|
this.expressDateInstance = ExpressData.getInstance();
|
|
147
147
|
});
|
|
148
148
|
export default JstItemSelect;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ComponentInterface, PickOption, ColumnConfig, ALignType, Record } from
|
|
2
|
-
import React from
|
|
3
|
-
import { ExpressData } from
|
|
1
|
+
import { ComponentInterface, PickOption, ColumnConfig, ALignType, Record } from "../../../type";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { ExpressData } from "@kmkf-fe-packages/kmkf-utils";
|
|
4
4
|
declare class JstLogistics implements ComponentInterface {
|
|
5
5
|
name: string;
|
|
6
6
|
id: string;
|
|
@@ -14,7 +14,7 @@ declare class JstLogistics implements ComponentInterface {
|
|
|
14
14
|
formField: string;
|
|
15
15
|
canSort: boolean;
|
|
16
16
|
children: ComponentInterface[];
|
|
17
|
-
dataType: ComponentInterface[
|
|
17
|
+
dataType: ComponentInterface["dataType"];
|
|
18
18
|
constructor(options: PickOption);
|
|
19
19
|
renderClient: (record: any) => React.JSX.Element | null;
|
|
20
20
|
renderPc: (value: any, record: Record) => React.JSX.Element;
|