@kmkf-fe-packages/services-components 2.0.0-rc.10 → 2.0.0-rc.12
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/GlobalContext/index.d.ts +1 -1
- package/dist/esm/commonComponents/GlobalContext/index.js +4 -2
- package/dist/esm/components/BS/BsLogistics/index.js +8 -1
- package/dist/esm/components/BS/common/BsHeaderGood.js +13 -40
- package/dist/esm/components/BS/common/expressCode.js +4 -1
- package/dist/esm/components/BS/common/expressCompany.js +3 -0
- package/dist/esm/components/Common/index.d.ts +10 -3
- package/dist/esm/components/Common/index.js +57 -72
- package/dist/esm/components/CommonSystemOrder/index.d.ts +4 -4
- package/dist/esm/components/CommonSystemOrder/index.js +25 -25
- package/dist/esm/components/EItemEnCode/index.d.ts +3 -1
- package/dist/esm/components/EItemEnCode/index.js +26 -29
- package/dist/esm/components/{JST/JstLogistics → Reissue/Logistics}/index.d.ts +2 -2
- package/dist/esm/components/{JST/JstLogistics → Reissue/Logistics}/index.js +3 -9
- package/dist/esm/factory.d.ts +2 -2
- package/dist/esm/factory.js +3 -3
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/service/api.d.ts +2 -0
- package/dist/esm/service/api.js +12 -0
- package/package.json +4 -4
- package/dist/esm/components/CommonHeaderGood/index copy.d.ts +0 -27
- package/dist/esm/components/CommonHeaderGood/index copy.js +0 -659
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
declare type RequestType = "queryAddressData" | "queryBsAddressData" | "queryExpressInterceptData" | "queryLogisticsAddressData" | "queryPlatData" | "queryWdtAddressData" | "queryAllLogisticsCompany" | "queryLabel" | "queryWdtLogisticsCompany" | "queryBsE3LogisticsCompany" | "querySendData";
|
|
2
|
+
declare type RequestType = "queryAddressData" | "queryBsAddressData" | "queryExpressInterceptData" | "queryLogisticsAddressData" | "queryPlatData" | "queryWdtAddressData" | "queryAllLogisticsCompany" | "queryLabel" | "queryWdtLogisticsCompany" | "queryBsE3LogisticsCompany" | "querySendData" | "queryJSTLogisticsCompany" | "queryWLNLogisticsCompany";
|
|
3
3
|
declare const Global: ({ children, requestList, repeatRequestList, }: React.PropsWithChildren<{
|
|
4
4
|
requestList?: RequestType[] | undefined;
|
|
5
5
|
repeatRequestList?: Record<string, () => Promise<any>> | undefined;
|
|
@@ -15,7 +15,7 @@ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefine
|
|
|
15
15
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
16
16
|
import React, { useEffect, useState } from "react";
|
|
17
17
|
import { Skeleton, Button, Alert, Space } from "antd";
|
|
18
|
-
import { queryExpressInterceptData, queryLogisticsAddressData, queryPlatData, queryLabel, queryAllLogisticsCompany, queryWdtLogisticsCompany, queryBsE3LogisticsCompany, querySendData } from "../../service/api";
|
|
18
|
+
import { queryExpressInterceptData, queryLogisticsAddressData, queryPlatData, queryLabel, queryAllLogisticsCompany, queryWdtLogisticsCompany, queryBsE3LogisticsCompany, querySendData, queryJSTLogisticsCompany, queryWLNLogisticsCompany } from "../../service/api";
|
|
19
19
|
import { servers } from "@kmkf-fe-packages/kmkf-utils";
|
|
20
20
|
var Global = function Global(_ref) {
|
|
21
21
|
var children = _ref.children,
|
|
@@ -44,7 +44,9 @@ var Global = function Global(_ref) {
|
|
|
44
44
|
queryWdtAddressData: servers.queryWdtAddressData,
|
|
45
45
|
queryWdtLogisticsCompany: queryWdtLogisticsCompany,
|
|
46
46
|
queryBsE3LogisticsCompany: queryBsE3LogisticsCompany,
|
|
47
|
-
querySendData: querySendData
|
|
47
|
+
querySendData: querySendData,
|
|
48
|
+
queryJSTLogisticsCompany: queryJSTLogisticsCompany,
|
|
49
|
+
queryWLNLogisticsCompany: queryWLNLogisticsCompany
|
|
48
50
|
};
|
|
49
51
|
mergeMapping = _objectSpread(_objectSpread({}, mapping), repeatRequestList);
|
|
50
52
|
promises = [];
|
|
@@ -38,7 +38,7 @@ var typeMap = {
|
|
|
38
38
|
name: "万里牛",
|
|
39
39
|
company: "wlnLogisticsCompany",
|
|
40
40
|
code: "wlnLogisticsCode",
|
|
41
|
-
platformType: "
|
|
41
|
+
platformType: "wln"
|
|
42
42
|
},
|
|
43
43
|
WDT_LOGISTICS: {
|
|
44
44
|
key: "wdtLogisticsList",
|
|
@@ -46,6 +46,13 @@ var typeMap = {
|
|
|
46
46
|
company: "wdtLogisticsCompany",
|
|
47
47
|
code: "wdtLogisticsCode",
|
|
48
48
|
platformType: "wdt"
|
|
49
|
+
},
|
|
50
|
+
JST_LOGISTICS: {
|
|
51
|
+
key: "jstItemList",
|
|
52
|
+
name: "聚水潭",
|
|
53
|
+
company: "logisticsCompany",
|
|
54
|
+
code: "logisticsCode",
|
|
55
|
+
platformType: 'jst'
|
|
49
56
|
}
|
|
50
57
|
};
|
|
51
58
|
var BsLogistics = /*#__PURE__*/_createClass(function BsLogistics(_options) {
|
|
@@ -21,6 +21,7 @@ import React from "react";
|
|
|
21
21
|
import ItemView from "../../../commonComponents/ItemView";
|
|
22
22
|
import { isNull } from "@kmkf-fe-packages/kmkf-utils";
|
|
23
23
|
import { BsHeaderPic, BsHeaderChild, BsHeaderGoodPic } from "./index";
|
|
24
|
+
import { getMapping, columnsGoodsList } from "@kmkf-fe-packages/kmkf-utils";
|
|
24
25
|
var HeaderMap = {
|
|
25
26
|
mark: {
|
|
26
27
|
component: BsHeaderChild,
|
|
@@ -46,6 +47,12 @@ var HeaderMap = {
|
|
|
46
47
|
key: "name",
|
|
47
48
|
width: 200
|
|
48
49
|
},
|
|
50
|
+
num: {
|
|
51
|
+
component: BsHeaderChild,
|
|
52
|
+
name: "商品数量",
|
|
53
|
+
key: "num",
|
|
54
|
+
width: 200
|
|
55
|
+
},
|
|
49
56
|
code: {
|
|
50
57
|
component: BsHeaderChild,
|
|
51
58
|
name: "编码",
|
|
@@ -215,15 +222,7 @@ var BsHeaderGods = /*#__PURE__*/function () {
|
|
|
215
222
|
this.isCombinationComponent = true;
|
|
216
223
|
this.canSort = false;
|
|
217
224
|
this.dataType = "string";
|
|
218
|
-
this.itemKey = options.type === "ITEM_ENCODE" ? {
|
|
219
|
-
title: "商品名称",
|
|
220
|
-
outerId: "商品编码",
|
|
221
|
-
picUrl: "图片",
|
|
222
|
-
numIid: "商品id",
|
|
223
|
-
skuId: "SKU ID",
|
|
224
|
-
outerSkuId: "SKU 编码",
|
|
225
|
-
propertiesName: "SKU 信息"
|
|
226
|
-
} : {
|
|
225
|
+
this.itemKey = options.type === "ITEM_ENCODE" ? getMapping(columnsGoodsList) : {
|
|
227
226
|
mark: "商品标记",
|
|
228
227
|
pic: "图片",
|
|
229
228
|
name: "名称",
|
|
@@ -238,36 +237,6 @@ var BsHeaderGods = /*#__PURE__*/function () {
|
|
|
238
237
|
expireDate: "有效期"
|
|
239
238
|
};
|
|
240
239
|
this.children = this.getChildren(options);
|
|
241
|
-
// [
|
|
242
|
-
// ...Object.keys(HeaderMap).reduce((prv: any, key: string) => {
|
|
243
|
-
// if (options?.componentConfig?.showHeader?.includes(key)) {
|
|
244
|
-
// prv.push(
|
|
245
|
-
// new HeaderMap[key].component({
|
|
246
|
-
// ...options,
|
|
247
|
-
// name: this.itemKey[key],
|
|
248
|
-
// id: `${options.id}_${HeaderMap[key].key}`,
|
|
249
|
-
// width: HeaderMap[key].width,
|
|
250
|
-
// })
|
|
251
|
-
// );
|
|
252
|
-
// }
|
|
253
|
-
// return prv;
|
|
254
|
-
// }, []),
|
|
255
|
-
// ...(options?.componentConfig?.showHeader || []).reduce(
|
|
256
|
-
// (prv: any, next: string) => {
|
|
257
|
-
// if (HeaderMap[next]) {
|
|
258
|
-
// prv.push(
|
|
259
|
-
// new HeaderMap[next].component({
|
|
260
|
-
// ...options,
|
|
261
|
-
// name: this.itemKey[next],
|
|
262
|
-
// id: `${options.id}_${HeaderMap[next].key}`,
|
|
263
|
-
// })
|
|
264
|
-
// );
|
|
265
|
-
// }
|
|
266
|
-
// return prv;
|
|
267
|
-
// },
|
|
268
|
-
// []
|
|
269
|
-
// ),
|
|
270
|
-
// ];
|
|
271
240
|
}
|
|
272
241
|
_createClass(BsHeaderGods, [{
|
|
273
242
|
key: "getChildren",
|
|
@@ -275,9 +244,13 @@ var BsHeaderGods = /*#__PURE__*/function () {
|
|
|
275
244
|
var _options$componentCon,
|
|
276
245
|
_this2 = this;
|
|
277
246
|
var showHeader = options === null || options === void 0 ? void 0 : (_options$componentCon = options.componentConfig) === null || _options$componentCon === void 0 ? void 0 : _options$componentCon.showHeader;
|
|
247
|
+
var dataIndexList = [];
|
|
248
|
+
if (!Array.isArray(showHeader)) {
|
|
249
|
+
dataIndexList = Object.keys(this.itemKey);
|
|
250
|
+
showHeader = dataIndexList;
|
|
251
|
+
}
|
|
278
252
|
var isStringArray = Array.isArray(showHeader) && typeof showHeader[0] === "string";
|
|
279
253
|
var isObjectArray = Array.isArray(showHeader) && Object.prototype.toString.call(showHeader[0]) === "[object Object]";
|
|
280
|
-
var dataIndexList = [];
|
|
281
254
|
if (isStringArray) {
|
|
282
255
|
dataIndexList = showHeader;
|
|
283
256
|
} else if (isObjectArray) {
|
|
@@ -26,7 +26,10 @@ var typeMap = {
|
|
|
26
26
|
key: "wlnLogisticsItem"
|
|
27
27
|
},
|
|
28
28
|
WDT_LOGISTICS: {
|
|
29
|
-
key:
|
|
29
|
+
key: "wdtLogisticsItem"
|
|
30
|
+
},
|
|
31
|
+
JST_LOGISTICS: {
|
|
32
|
+
key: "jstLogisticsItem"
|
|
30
33
|
}
|
|
31
34
|
};
|
|
32
35
|
var ExpressCode = /*#__PURE__*/_createClass(function ExpressCode(options) {
|
|
@@ -12,13 +12,20 @@ export declare const showImage: ({ item, type, index, showHeader, }: {
|
|
|
12
12
|
item: any;
|
|
13
13
|
type: string;
|
|
14
14
|
index: number;
|
|
15
|
-
showHeader:
|
|
15
|
+
showHeader: string[];
|
|
16
|
+
}) => React.JSX.Element;
|
|
17
|
+
export declare const ShowTotalImage: ({ total, allImage, type, showHeader, }: {
|
|
18
|
+
total: number;
|
|
19
|
+
allImage: {
|
|
20
|
+
[key: string]: any;
|
|
21
|
+
}[];
|
|
22
|
+
type: string;
|
|
23
|
+
showHeader: string[];
|
|
16
24
|
}) => React.JSX.Element;
|
|
17
|
-
export declare const ShowTotalImage: ({ total, allImage, type, showHeader, }: any) => React.JSX.Element;
|
|
18
25
|
export declare const GoodImage: ({ list, type, showHeader }: any) => React.JSX.Element | null;
|
|
19
26
|
export declare const JstGoodImage: ({ list, type, platformType, }: any) => any;
|
|
20
27
|
export declare const BsExpressRender: ({ list, showField, platformType, }: any) => any;
|
|
21
|
-
export declare const CommonOrderContent: ({ list, valueKey, failValue, options, isShowPopover, }: any) => any;
|
|
28
|
+
export declare const CommonOrderContent: ({ list, valueKey: initValueKey, failValue, options, isShowPopover, }: any) => any;
|
|
22
29
|
export declare const BsGoodImage: ({ item, index }: {
|
|
23
30
|
item: any;
|
|
24
31
|
index: number;
|
|
@@ -21,6 +21,7 @@ import styles from "./index.module.less";
|
|
|
21
21
|
import defaultImg from "./img/default-img.png";
|
|
22
22
|
import CopyText from "../../commonComponents/CopyText";
|
|
23
23
|
import { KM_SYSTEM_ORDER_CONFIG } from "@kmkf-fe-packages/kmkf-utils";
|
|
24
|
+
import { getMapping, columnsGoodsList } from "@kmkf-fe-packages/kmkf-utils";
|
|
24
25
|
var Paragraph = Typography.Paragraph;
|
|
25
26
|
export var getFormItem = function getFormItem(_ref) {
|
|
26
27
|
var name = _ref.name,
|
|
@@ -55,23 +56,11 @@ export var showImage = function showImage(_ref2) {
|
|
|
55
56
|
index = _ref2.index,
|
|
56
57
|
showHeader = _ref2.showHeader;
|
|
57
58
|
var picUrl = item.picUrl ? (item === null || item === void 0 ? void 0 : item.platform) !== "tabao" ? item.picUrl : item.picUrl + "_40x40.jpg" : defaultImg;
|
|
58
|
-
var
|
|
59
|
-
var isStringArray = Array.isArray(showHeader) && typeof showHeader[0] === "string";
|
|
60
|
-
var isObjectArray = Array.isArray(showHeader) && Object.prototype.toString.call(showHeader[0]) === "[object Object]";
|
|
61
|
-
var dataIndexList = [];
|
|
62
|
-
if (isStringArray) {
|
|
63
|
-
dataIndexList = showHeader;
|
|
64
|
-
} else if (isObjectArray) {
|
|
65
|
-
dataIndexList = showHeader.map(function (item) {
|
|
66
|
-
return item.dataIndex;
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
|
-
return dataIndexList;
|
|
70
|
-
}, [showHeader]);
|
|
59
|
+
var mapping_itemCode = getMapping(columnsGoodsList);
|
|
71
60
|
return /*#__PURE__*/React.createElement("div", {
|
|
72
61
|
className: styles.goodImgBox,
|
|
73
62
|
key: index
|
|
74
|
-
}, type === "itemCode" && !
|
|
63
|
+
}, type === "itemCode" && !showHeader.includes("picUrl") ? null : (item === null || item === void 0 ? void 0 : item.platform) === "taobao" ? /*#__PURE__*/React.createElement("a", {
|
|
75
64
|
target: "_blank",
|
|
76
65
|
href: item.numIid ? "https://item.taobao.com/item.htm?id=".concat(item.numIid) : "javascript:void(0);"
|
|
77
66
|
}, /*#__PURE__*/React.createElement("img", {
|
|
@@ -89,28 +78,20 @@ export var showImage = function showImage(_ref2) {
|
|
|
89
78
|
},
|
|
90
79
|
src: picUrl
|
|
91
80
|
}), /*#__PURE__*/React.createElement("div", {
|
|
92
|
-
className: styles.options
|
|
81
|
+
className: styles.options,
|
|
82
|
+
onClick: function onClick() {
|
|
83
|
+
console.log("show---", showHeader);
|
|
84
|
+
}
|
|
93
85
|
}, type === "itemId" && /*#__PURE__*/React.createElement(TextTool, {
|
|
94
86
|
title: "商品id",
|
|
95
87
|
text: item.numIid
|
|
96
|
-
}), type === "itemCode" && /*#__PURE__*/React.createElement(React.Fragment, null,
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
title: "商品id",
|
|
104
|
-
text: item.numIid
|
|
105
|
-
}), showHeaderMap.includes("skuId") && /*#__PURE__*/React.createElement(TextTool, {
|
|
106
|
-
title: "SKU ID",
|
|
107
|
-
text: item.skuId
|
|
108
|
-
}), showHeaderMap.includes("outerSkuId") && /*#__PURE__*/React.createElement(TextTool, {
|
|
109
|
-
title: "SKU 编码",
|
|
110
|
-
text: item.outerSkuId
|
|
111
|
-
}), showHeaderMap.includes("propertiesName") && /*#__PURE__*/React.createElement(TextTool, {
|
|
112
|
-
title: "SKU 信息",
|
|
113
|
-
text: item.propertiesName
|
|
88
|
+
}), type === "itemCode" && /*#__PURE__*/React.createElement(React.Fragment, null, showHeader.filter(function (dataIndex) {
|
|
89
|
+
return dataIndex !== "picUrl";
|
|
90
|
+
}).map(function (dataIndex) {
|
|
91
|
+
return /*#__PURE__*/React.createElement(TextTool, {
|
|
92
|
+
title: mapping_itemCode[dataIndex],
|
|
93
|
+
text: item[dataIndex]
|
|
94
|
+
});
|
|
114
95
|
})), (type === "itemThird" || type === "jstItemThird") && (item.itemId || item.supplierItemOuterId) && /*#__PURE__*/React.createElement(TextTool, {
|
|
115
96
|
title: "供应商编码",
|
|
116
97
|
text: item.itemId || item.supplierItemOuterId
|
|
@@ -149,19 +130,7 @@ export var ShowTotalImage = function ShowTotalImage(_ref4) {
|
|
|
149
130
|
_useState2 = _slicedToArray(_useState, 2),
|
|
150
131
|
visible = _useState2[0],
|
|
151
132
|
setVisible = _useState2[1];
|
|
152
|
-
var
|
|
153
|
-
var isStringArray = Array.isArray(showHeader) && typeof showHeader[0] === "string";
|
|
154
|
-
var isObjectArray = Array.isArray(showHeader) && Object.prototype.toString.call(showHeader[0]) === "[object Object]";
|
|
155
|
-
var dataIndexList = [];
|
|
156
|
-
if (isStringArray) {
|
|
157
|
-
dataIndexList = showHeader;
|
|
158
|
-
} else if (isObjectArray) {
|
|
159
|
-
dataIndexList = showHeader.map(function (item) {
|
|
160
|
-
return item.dataIndex;
|
|
161
|
-
});
|
|
162
|
-
}
|
|
163
|
-
return dataIndexList;
|
|
164
|
-
}, [showHeader]);
|
|
133
|
+
var mapping_itemCode = getMapping(columnsGoodsList);
|
|
165
134
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Button, {
|
|
166
135
|
type: "link",
|
|
167
136
|
onClick: function onClick() {
|
|
@@ -185,7 +154,7 @@ export var ShowTotalImage = function ShowTotalImage(_ref4) {
|
|
|
185
154
|
width: "50%"
|
|
186
155
|
},
|
|
187
156
|
key: index
|
|
188
|
-
}, type === "itemCode" && !
|
|
157
|
+
}, type === "itemCode" && !showHeader.includes("picUrl") ? null : /*#__PURE__*/React.createElement("a", {
|
|
189
158
|
href: i.link || ((i === null || i === void 0 ? void 0 : i.platform) === "taobao" && i.numIid ? "https://item.taobao.com/item.htm?id=".concat(i.numIid) : "javascript:void(0);"),
|
|
190
159
|
target: "__blank",
|
|
191
160
|
style: {
|
|
@@ -206,24 +175,13 @@ export var ShowTotalImage = function ShowTotalImage(_ref4) {
|
|
|
206
175
|
})), /*#__PURE__*/React.createElement("div", null, type === "itemId" && /*#__PURE__*/React.createElement(TextTool, {
|
|
207
176
|
title: "商品id",
|
|
208
177
|
text: i.numIid
|
|
209
|
-
}), type === "itemCode" && /*#__PURE__*/React.createElement(React.Fragment, null,
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
title: "商品id",
|
|
217
|
-
text: i.numIid
|
|
218
|
-
}), showHeaderMap.includes("skuId") && /*#__PURE__*/React.createElement(TextTool, {
|
|
219
|
-
title: "SKU ID",
|
|
220
|
-
text: i.skuId
|
|
221
|
-
}), showHeaderMap.includes("outerSkuId") && /*#__PURE__*/React.createElement(TextTool, {
|
|
222
|
-
title: "SKU 编码",
|
|
223
|
-
text: i.outerSkuId
|
|
224
|
-
}), showHeaderMap.includes("propertiesName") && /*#__PURE__*/React.createElement(TextTool, {
|
|
225
|
-
title: "SKU 信息",
|
|
226
|
-
text: i.propertiesName
|
|
178
|
+
}), type === "itemCode" && /*#__PURE__*/React.createElement(React.Fragment, null, showHeader.filter(function (dataIndex) {
|
|
179
|
+
return dataIndex !== "picUrl";
|
|
180
|
+
}).map(function (dataIndex) {
|
|
181
|
+
return /*#__PURE__*/React.createElement(TextTool, {
|
|
182
|
+
title: mapping_itemCode[dataIndex],
|
|
183
|
+
text: i[dataIndex]
|
|
184
|
+
});
|
|
227
185
|
})), (type === "itemThird" || type === "jstItemThird") && (i.itemId || i.supplierItemOuterId) && /*#__PURE__*/React.createElement(TextTool, {
|
|
228
186
|
title: "供应商编码",
|
|
229
187
|
text: i.itemId || i.supplierItemOuterId
|
|
@@ -253,7 +211,9 @@ export var GoodImage = function GoodImage(_ref5) {
|
|
|
253
211
|
if (isStringArray) {
|
|
254
212
|
dataIndexList = showHeader;
|
|
255
213
|
} else if (isObjectArray) {
|
|
256
|
-
dataIndexList = showHeader.
|
|
214
|
+
dataIndexList = showHeader.filter(function (item) {
|
|
215
|
+
return item.show !== false;
|
|
216
|
+
}).map(function (item) {
|
|
257
217
|
return item.dataIndex;
|
|
258
218
|
});
|
|
259
219
|
}
|
|
@@ -273,7 +233,7 @@ export var GoodImage = function GoodImage(_ref5) {
|
|
|
273
233
|
}), total > initShowTotal && /*#__PURE__*/React.createElement(ShowTotalImage, {
|
|
274
234
|
total: total,
|
|
275
235
|
allImage: list,
|
|
276
|
-
showHeader:
|
|
236
|
+
showHeader: showHeaderMap,
|
|
277
237
|
type: type
|
|
278
238
|
})) : null;
|
|
279
239
|
};
|
|
@@ -356,23 +316,48 @@ export var BsExpressRender = function BsExpressRender(_ref7) {
|
|
|
356
316
|
export var CommonOrderContent = function CommonOrderContent(_ref8) {
|
|
357
317
|
var _ref8$list = _ref8.list,
|
|
358
318
|
list = _ref8$list === void 0 ? [] : _ref8$list,
|
|
359
|
-
|
|
319
|
+
initValueKey = _ref8.valueKey,
|
|
360
320
|
failValue = _ref8.failValue,
|
|
361
321
|
_ref8$options = _ref8.options,
|
|
362
322
|
options = _ref8$options === void 0 ? [] : _ref8$options,
|
|
363
323
|
_ref8$isShowPopover = _ref8.isShowPopover,
|
|
364
324
|
isShowPopover = _ref8$isShowPopover === void 0 ? true : _ref8$isShowPopover;
|
|
325
|
+
var getContentData = function getContentData(item, index) {
|
|
326
|
+
if (item.platformId) return {
|
|
327
|
+
text: "平台售后单号",
|
|
328
|
+
id: item.platformId
|
|
329
|
+
};
|
|
330
|
+
if (item.returnLogisticsCode) return {
|
|
331
|
+
text: "物流单号",
|
|
332
|
+
id: item.returnLogisticsCode
|
|
333
|
+
};
|
|
334
|
+
return {
|
|
335
|
+
text: "系统订单号" + (index + 1),
|
|
336
|
+
id: item.systemOrderId
|
|
337
|
+
};
|
|
338
|
+
};
|
|
365
339
|
var orderContent = function orderContent(item, index) {
|
|
366
|
-
var
|
|
367
|
-
var leftText = item.platformId ? "平台售后单号" : "系统订单号" + (index + 1);
|
|
340
|
+
var contentData = getContentData(item, index);
|
|
368
341
|
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
|
|
369
342
|
style: {
|
|
370
343
|
textAlign: "center"
|
|
371
344
|
}
|
|
372
|
-
},
|
|
345
|
+
}, contentData.text, "\uFF1A", contentData.id));
|
|
373
346
|
};
|
|
374
347
|
return list !== null && list !== void 0 && list.length ? (list || []).map(function (item, index) {
|
|
375
348
|
var _options$find;
|
|
349
|
+
var valueKey = "";
|
|
350
|
+
if (Array.isArray(initValueKey)) {
|
|
351
|
+
for (var _index = 0; _index < initValueKey.length; _index++) {
|
|
352
|
+
var itemKey = initValueKey[_index];
|
|
353
|
+
if (item[itemKey]) {
|
|
354
|
+
valueKey = itemKey;
|
|
355
|
+
break;
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
} else {
|
|
359
|
+
valueKey = initValueKey;
|
|
360
|
+
}
|
|
376
361
|
var color = ((_options$find = options.find(function (it) {
|
|
377
362
|
return item[valueKey] === it.value;
|
|
378
363
|
})) === null || _options$find === void 0 ? void 0 : _options$find.color) || "#000";
|
|
@@ -390,7 +375,7 @@ export var CommonOrderContent = function CommonOrderContent(_ref8) {
|
|
|
390
375
|
color: "#1890ff",
|
|
391
376
|
cursor: "pointer"
|
|
392
377
|
}
|
|
393
|
-
}, "".concat(item
|
|
378
|
+
}, "".concat(getContentData(item, index).text), ":")) : null, /*#__PURE__*/React.createElement("span", {
|
|
394
379
|
style: {
|
|
395
380
|
color: color
|
|
396
381
|
}
|
|
@@ -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;
|
|
@@ -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
|
|
15
|
+
import { isNull, filterFn as _filterFn } from "@kmkf-fe-packages/kmkf-utils";
|
|
16
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", "returnLogisticsCode"]
|
|
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) {
|
|
@@ -108,7 +108,7 @@ var CommonSystemOrder = /*#__PURE__*/_createClass(function CommonSystemOrder(opt
|
|
|
108
108
|
return (list || []).map(function (item) {
|
|
109
109
|
var _typeMap$_this$type8;
|
|
110
110
|
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];
|
|
111
|
-
}).join(
|
|
111
|
+
}).join(",");
|
|
112
112
|
});
|
|
113
113
|
_defineProperty(this, "editRender", function (p) {
|
|
114
114
|
var _this$componentConfig3, _this$componentConfig4, _this$componentConfig5, _this$componentConfig6, _typeMap$_this$type9;
|
|
@@ -119,7 +119,7 @@ var CommonSystemOrder = /*#__PURE__*/_createClass(function CommonSystemOrder(opt
|
|
|
119
119
|
hidden: p === null || p === void 0 ? void 0 : p.hidden,
|
|
120
120
|
display: p === null || p === void 0 ? void 0 : p.display,
|
|
121
121
|
required: (_this$componentConfig3 = (_this$componentConfig4 = _this.componentConfig) === null || _this$componentConfig4 === void 0 ? void 0 : _this$componentConfig4.required) !== null && _this$componentConfig3 !== void 0 ? _this$componentConfig3 : false,
|
|
122
|
-
tooltip: (_this$componentConfig5 = _this.componentConfig) !== null && _this$componentConfig5 !== void 0 && _this$componentConfig5.showTooltip ? (_this$componentConfig6 = _this.componentConfig) === null || _this$componentConfig6 === void 0 ? void 0 : _this$componentConfig6.tooltip :
|
|
122
|
+
tooltip: (_this$componentConfig5 = _this.componentConfig) !== null && _this$componentConfig5 !== void 0 && _this$componentConfig5.showTooltip ? (_this$componentConfig6 = _this.componentConfig) === null || _this$componentConfig6 === void 0 ? void 0 : _this$componentConfig6.tooltip : "",
|
|
123
123
|
component: /*#__PURE__*/React.createElement(SystemOrder, _extends({}, _this.componentConfig, {
|
|
124
124
|
type: (_typeMap$_this$type9 = typeMap[_this.type]) === null || _typeMap$_this$type9 === void 0 ? void 0 : _typeMap$_this$type9.type
|
|
125
125
|
}))
|
|
@@ -132,7 +132,7 @@ var CommonSystemOrder = /*#__PURE__*/_createClass(function CommonSystemOrder(opt
|
|
|
132
132
|
type: item.type,
|
|
133
133
|
id: "".concat(item.id, "_").concat((_typeMap$_this$type10 = typeMap[_this.type]) === null || _typeMap$_this$type10 === void 0 ? void 0 : _typeMap$_this$type10.code),
|
|
134
134
|
name: "".concat(_this.name),
|
|
135
|
-
filterComponentType:
|
|
135
|
+
filterComponentType: "Input",
|
|
136
136
|
filterFn: function filterFn(value) {
|
|
137
137
|
return function (i) {
|
|
138
138
|
var _typeMap$_this$type11;
|
|
@@ -153,7 +153,7 @@ var CommonSystemOrder = /*#__PURE__*/_createClass(function CommonSystemOrder(opt
|
|
|
153
153
|
this.isCombinationComponent = false;
|
|
154
154
|
this.canSort = false;
|
|
155
155
|
this.children = [];
|
|
156
|
-
this.dataType =
|
|
156
|
+
this.dataType = "object";
|
|
157
157
|
this.rules = (_this$componentConfig7 = this.componentConfig) !== null && _this$componentConfig7 !== void 0 && _this$componentConfig7.required ? [{
|
|
158
158
|
required: true,
|
|
159
159
|
validator: function validator(_, value) {
|
|
@@ -168,6 +168,6 @@ var CommonSystemOrder = /*#__PURE__*/_createClass(function CommonSystemOrder(opt
|
|
|
168
168
|
return Promise.resolve();
|
|
169
169
|
}
|
|
170
170
|
}] : [];
|
|
171
|
-
this.align =
|
|
171
|
+
this.align = "left";
|
|
172
172
|
});
|
|
173
173
|
export default CommonSystemOrder;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ComponentInterface, PickOption, ColumnConfig, Record } from "../../type";
|
|
2
2
|
import React from "react";
|
|
3
3
|
import { BsHeaderGood } from "../BS/common/index";
|
|
4
|
+
import type { ShowHeaderObjType } from "../../type";
|
|
4
5
|
declare class EItemEncode implements ComponentInterface {
|
|
5
6
|
name: string;
|
|
6
7
|
id: string;
|
|
@@ -15,7 +16,7 @@ declare class EItemEncode implements ComponentInterface {
|
|
|
15
16
|
children: ComponentInterface[];
|
|
16
17
|
goods: BsHeaderGood;
|
|
17
18
|
dataType: ComponentInterface["dataType"];
|
|
18
|
-
showHeader: string[];
|
|
19
|
+
showHeader: (string | ShowHeaderObjType)[];
|
|
19
20
|
platform?: ComponentInterface["platform"];
|
|
20
21
|
sortChildField: {
|
|
21
22
|
name: string;
|
|
@@ -25,6 +26,7 @@ declare class EItemEncode implements ComponentInterface {
|
|
|
25
26
|
}[];
|
|
26
27
|
constructor(options: PickOption);
|
|
27
28
|
getSortChildFields: () => any;
|
|
29
|
+
getShowHeader: (showHeader: any) => any[];
|
|
28
30
|
renderClient: (record: any) => React.JSX.Element | null;
|
|
29
31
|
renderPc: (value: unknown, record: Record) => React.JSX.Element | null;
|
|
30
32
|
renderLog: (r: Record) => React.JSX.Element | null;
|
|
@@ -16,6 +16,7 @@ import { BsHeaderGood } from "../BS/common/index";
|
|
|
16
16
|
import ItemView from "../../commonComponents/ItemView";
|
|
17
17
|
import { isNull } from "@kmkf-fe-packages/kmkf-utils";
|
|
18
18
|
import { SYMBOL } from "../../constant";
|
|
19
|
+
import { columnsGoodsList } from "@kmkf-fe-packages/kmkf-utils";
|
|
19
20
|
var EItemEncode = /*#__PURE__*/_createClass(function EItemEncode(options) {
|
|
20
21
|
var _this = this,
|
|
21
22
|
_this$componentConfig3,
|
|
@@ -38,23 +39,33 @@ var EItemEncode = /*#__PURE__*/_createClass(function EItemEncode(options) {
|
|
|
38
39
|
_defineProperty(this, "platform", void 0);
|
|
39
40
|
_defineProperty(this, "sortChildField", void 0);
|
|
40
41
|
_defineProperty(this, "getSortChildFields", function () {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
numIid: '商品id',
|
|
45
|
-
skuId: 'skuId',
|
|
46
|
-
outerSkuId: 'sku编码',
|
|
47
|
-
propertiesName: 'sku信息'
|
|
48
|
-
};
|
|
49
|
-
return Object.keys(mapping).map(function (item) {
|
|
42
|
+
return columnsGoodsList.filter(function (item) {
|
|
43
|
+
return !["picUrl", "num"].includes(item.dataIndex);
|
|
44
|
+
}).map(function (item) {
|
|
50
45
|
return {
|
|
51
|
-
name:
|
|
52
|
-
key: "".concat(_this.id, "_").concat(item),
|
|
46
|
+
name: item.title,
|
|
47
|
+
key: "".concat(_this.id, "_").concat(item.dataIndex),
|
|
53
48
|
dataType: "arrayObject",
|
|
54
|
-
disabled: !_this.showHeader.includes(item)
|
|
49
|
+
disabled: !_this.showHeader.includes(item.dataIndex)
|
|
55
50
|
};
|
|
56
51
|
});
|
|
57
52
|
});
|
|
53
|
+
_defineProperty(this, "getShowHeader", function (showHeader) {
|
|
54
|
+
if (!Array.isArray(showHeader)) {
|
|
55
|
+
return columnsGoodsList.map(function (item) {
|
|
56
|
+
return item.dataIndex;
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
var isStringArray = Array.isArray(showHeader) && typeof showHeader[0] === "string";
|
|
60
|
+
var isObjectArray = Array.isArray(showHeader) && Object.prototype.toString.call(showHeader[0]) === "[object Object]";
|
|
61
|
+
if (isStringArray) return showHeader;
|
|
62
|
+
if (isObjectArray) return showHeader.filter(function (item) {
|
|
63
|
+
return item.show !== false;
|
|
64
|
+
}).map(function (item) {
|
|
65
|
+
return item.dataIndex;
|
|
66
|
+
});
|
|
67
|
+
return [];
|
|
68
|
+
});
|
|
58
69
|
_defineProperty(this, "renderClient", function (record) {
|
|
59
70
|
if (isNull(record === null || record === void 0 ? void 0 : record[_this.id])) return null;
|
|
60
71
|
return /*#__PURE__*/React.createElement(ItemView, {
|
|
@@ -105,9 +116,9 @@ var EItemEncode = /*#__PURE__*/_createClass(function EItemEncode(options) {
|
|
|
105
116
|
required: false,
|
|
106
117
|
hidden: p === null || p === void 0 ? void 0 : p.hidden,
|
|
107
118
|
display: p === null || p === void 0 ? void 0 : p.display,
|
|
108
|
-
tooltip: (_this$componentConfig = _this.componentConfig) !== null && _this$componentConfig !== void 0 && _this$componentConfig.showTooltip ? (_this$componentConfig2 = _this.componentConfig) === null || _this$componentConfig2 === void 0 ? void 0 : _this$componentConfig2.tooltip :
|
|
119
|
+
tooltip: (_this$componentConfig = _this.componentConfig) !== null && _this$componentConfig !== void 0 && _this$componentConfig.showTooltip ? (_this$componentConfig2 = _this.componentConfig) === null || _this$componentConfig2 === void 0 ? void 0 : _this$componentConfig2.tooltip : "",
|
|
109
120
|
component: /*#__PURE__*/React.createElement(ItemEncode, _extends({
|
|
110
|
-
isSingleRow: _this.platform !==
|
|
121
|
+
isSingleRow: _this.platform !== "pc"
|
|
111
122
|
}, _this.componentConfig, {
|
|
112
123
|
shopId: (_this$effects = _this.effects) === null || _this$effects === void 0 ? void 0 : _this$effects.shopId,
|
|
113
124
|
shopList: (_this$effects2 = _this.effects) === null || _this$effects2 === void 0 ? void 0 : _this$effects2.shopList,
|
|
@@ -134,21 +145,7 @@ var EItemEncode = /*#__PURE__*/_createClass(function EItemEncode(options) {
|
|
|
134
145
|
this.type = options.type;
|
|
135
146
|
this.effects = options === null || options === void 0 ? void 0 : options.effects;
|
|
136
147
|
this.componentConfig = options === null || options === void 0 ? void 0 : options.componentConfig;
|
|
137
|
-
this.showHeader = ((_this$componentConfig3 = this.componentConfig) === null || _this$componentConfig3 === void 0 ? void 0 : _this$componentConfig3.showHeader)
|
|
138
|
-
// 商品名称
|
|
139
|
-
"outerId",
|
|
140
|
-
// 商品编码
|
|
141
|
-
"picUrl",
|
|
142
|
-
// 图片
|
|
143
|
-
"numIid",
|
|
144
|
-
// 商品id
|
|
145
|
-
"skuId",
|
|
146
|
-
// skuId
|
|
147
|
-
"outerSkuId",
|
|
148
|
-
// sku编码
|
|
149
|
-
"propertiesName" // sku 信息
|
|
150
|
-
];
|
|
151
|
-
|
|
148
|
+
this.showHeader = this.getShowHeader((_this$componentConfig3 = this.componentConfig) === null || _this$componentConfig3 === void 0 ? void 0 : _this$componentConfig3.showHeader);
|
|
152
149
|
this.isCombinationComponent = true;
|
|
153
150
|
this.canSort = false;
|
|
154
151
|
this.goods = new BsHeaderGood(_objectSpread(_objectSpread({}, options), {}, {
|