@kmkf-fe-packages/services-components 0.7.15-alpha.1 → 0.7.15-alpha.10
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 +48 -0
- package/dist/esm/components/BS/BsExchange/index.js +258 -0
- package/dist/esm/components/BS/BsGoods/index.d.ts +31 -0
- package/dist/esm/components/BS/BsGoods/index.js +136 -0
- 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 +43 -0
- package/dist/esm/components/BS/BsReissue/index.js +149 -0
- package/dist/esm/components/{BsSendGood/index.d.ts → BS/common/BsChildCode.d.ts} +9 -9
- package/dist/esm/components/BS/common/BsChildCode.js +71 -0
- package/dist/esm/components/BS/common/BsChildMoney.d.ts +25 -0
- package/dist/esm/components/BS/common/BsChildMoney.js +71 -0
- package/dist/esm/components/BS/common/BsChildName.d.ts +25 -0
- package/dist/esm/components/BS/common/BsChildName.js +71 -0
- package/dist/esm/components/BS/common/BsChildNumber.d.ts +25 -0
- package/dist/esm/components/BS/common/BsChildNumber.js +71 -0
- package/dist/esm/components/BS/common/BsChildPic.d.ts +25 -0
- package/dist/esm/components/BS/common/BsChildPic.js +72 -0
- package/dist/esm/components/BS/common/BsChildShare.d.ts +25 -0
- package/dist/esm/components/BS/common/BsChildShare.js +71 -0
- package/dist/esm/components/BS/common/BsChildSku.d.ts +25 -0
- package/dist/esm/components/BS/common/BsChildSku.js +71 -0
- package/dist/esm/components/BS/common/BsChildType.d.ts +25 -0
- package/dist/esm/components/BS/common/BsChildType.js +71 -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/BS/common/BsMemo.d.ts +25 -0
- 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/BS/common/index.d.ts +10 -0
- package/dist/esm/components/BS/common/index.js +10 -0
- package/dist/esm/components/Common/index.d.ts +12 -6
- package/dist/esm/components/Common/index.js +115 -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
- package/dist/esm/components/BsSendGood/index.js +0 -116
|
@@ -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;
|
|
@@ -6,15 +6,15 @@ 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 some from
|
|
12
|
-
import GetFormItem from "
|
|
13
|
-
import { JstGoodImage } from "
|
|
14
|
-
import { JstGoods } from
|
|
15
|
-
import ItemView from "
|
|
16
|
-
import { isNull, filterFn as _filterFn } from
|
|
17
|
-
import { SYMBOL } from "
|
|
9
|
+
import React from "react";
|
|
10
|
+
import { ExpressData } from "@kmkf-fe-packages/kmkf-utils";
|
|
11
|
+
import some from "lodash/some";
|
|
12
|
+
import GetFormItem from "../../GetFormItem";
|
|
13
|
+
import { JstGoodImage } from "../../Common";
|
|
14
|
+
import { JstGoods } from "@kmkf-fe-packages/basic-components";
|
|
15
|
+
import ItemView from "../../../commonComponents/ItemView";
|
|
16
|
+
import { isNull, filterFn as _filterFn } from "@kmkf-fe-packages/kmkf-utils";
|
|
17
|
+
import { SYMBOL } from "../../../constant";
|
|
18
18
|
var JstLogistics = /*#__PURE__*/_createClass(function JstLogistics(options) {
|
|
19
19
|
var _this = this,
|
|
20
20
|
_this$componentConfig3;
|
|
@@ -64,8 +64,8 @@ var JstLogistics = /*#__PURE__*/_createClass(function JstLogistics(options) {
|
|
|
64
64
|
_defineProperty(this, "renderExport", function (value, record) {
|
|
65
65
|
var list = record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_jstItemList")];
|
|
66
66
|
return (list || []).map(function (item) {
|
|
67
|
-
return [_this.expressDateInstance.getExpressNameByCode(item === null || item === void 0 ? void 0 : item.logisticsCompany), item === null || item === void 0 ? void 0 : item.logisticsCode].join(
|
|
68
|
-
}).join(
|
|
67
|
+
return [_this.expressDateInstance.getExpressNameByCode(item === null || item === void 0 ? void 0 : item.logisticsCompany), item === null || item === void 0 ? void 0 : item.logisticsCode].join("/");
|
|
68
|
+
}).join(",");
|
|
69
69
|
});
|
|
70
70
|
_defineProperty(this, "editRender", function (p) {
|
|
71
71
|
var _this$componentConfig, _this$componentConfig2;
|
|
@@ -87,10 +87,10 @@ var JstLogistics = /*#__PURE__*/_createClass(function JstLogistics(options) {
|
|
|
87
87
|
type: item.type,
|
|
88
88
|
id: "".concat(item.id, "_logisticsCode"),
|
|
89
89
|
name: "jst\u7269\u6D41\u5355\u53F7",
|
|
90
|
-
filterComponentType:
|
|
90
|
+
filterComponentType: "Input",
|
|
91
91
|
filterFn: function filterFn(value) {
|
|
92
92
|
return function (i) {
|
|
93
|
-
return _filterFn.filterSplitComma(_filterFn.filterTableListItemColumnValue(i, item.id,
|
|
93
|
+
return _filterFn.filterSplitComma(_filterFn.filterTableListItemColumnValue(i, item.id, "logisticsCode"), value);
|
|
94
94
|
};
|
|
95
95
|
}
|
|
96
96
|
}, {
|
|
@@ -98,14 +98,14 @@ var JstLogistics = /*#__PURE__*/_createClass(function JstLogistics(options) {
|
|
|
98
98
|
type: item.type,
|
|
99
99
|
id: "".concat(item.id, "_logisticsCompany"),
|
|
100
100
|
name: "jst\u7269\u6D41\u516C\u53F8",
|
|
101
|
-
filterComponentType:
|
|
101
|
+
filterComponentType: "MultipleSelect",
|
|
102
102
|
props: {
|
|
103
103
|
options: _this.expressDateInstance.getExpressData() || []
|
|
104
104
|
},
|
|
105
105
|
filterFn: function filterFn(value) {
|
|
106
106
|
return function (i) {
|
|
107
107
|
var _ref;
|
|
108
|
-
return (_ref = _filterFn.filterTableListItemColumnValue(i, item.id,
|
|
108
|
+
return (_ref = _filterFn.filterTableListItemColumnValue(i, item.id, "logisticsCompany").split(",") || []) === null || _ref === void 0 ? void 0 : _ref.some(function (item) {
|
|
109
109
|
var _String;
|
|
110
110
|
var logisticsCompany = item ? (_String = String(item)) === null || _String === void 0 ? void 0 : _String.includes(value) : false;
|
|
111
111
|
return logisticsCompany;
|
|
@@ -123,7 +123,7 @@ var JstLogistics = /*#__PURE__*/_createClass(function JstLogistics(options) {
|
|
|
123
123
|
this.isCombinationComponent = false;
|
|
124
124
|
this.canSort = false;
|
|
125
125
|
this.children = [];
|
|
126
|
-
this.dataType =
|
|
126
|
+
this.dataType = "object";
|
|
127
127
|
this.rules = (_this$componentConfig3 = this.componentConfig) !== null && _this$componentConfig3 !== void 0 && _this$componentConfig3.required ? [{
|
|
128
128
|
required: true,
|
|
129
129
|
validator: function validator(_, value) {
|
|
@@ -136,7 +136,7 @@ var JstLogistics = /*#__PURE__*/_createClass(function JstLogistics(options) {
|
|
|
136
136
|
return Promise.resolve();
|
|
137
137
|
}
|
|
138
138
|
}] : [];
|
|
139
|
-
this.align =
|
|
139
|
+
this.align = "left";
|
|
140
140
|
this.expressDateInstance = ExpressData.getInstance();
|
|
141
141
|
});
|
|
142
142
|
export default JstLogistics;
|
|
@@ -1,5 +1,5 @@
|
|
|
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 JstSendGood implements ComponentInterface {
|
|
4
4
|
name: string;
|
|
5
5
|
id: string;
|
|
@@ -12,7 +12,7 @@ declare class JstSendGood implements ComponentInterface {
|
|
|
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: Record) => React.JSX.Element | null;
|
|
18
18
|
renderPc: (value: any, record: Record) => React.JSX.Element;
|
|
@@ -6,16 +6,28 @@ 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
|
|
11
|
-
import GetFormItem from "
|
|
12
|
-
import { JstGoodImage } from "
|
|
13
|
-
import { JstGoods } from
|
|
14
|
-
import ItemView from "
|
|
15
|
-
import { isNull, filterFn as _filterFn } from
|
|
16
|
-
import { SYMBOL } from "
|
|
9
|
+
import React from "react";
|
|
10
|
+
import some from "lodash/some";
|
|
11
|
+
import GetFormItem from "../../GetFormItem";
|
|
12
|
+
import { JstGoodImage } from "../../Common";
|
|
13
|
+
import { JstGoods } 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
|
+
var typeMap = {
|
|
18
|
+
JST_SEND_GOOD: {
|
|
19
|
+
key: "jstItemList",
|
|
20
|
+
name: "jst"
|
|
21
|
+
},
|
|
22
|
+
BS_SEND_GOOD: {
|
|
23
|
+
key: "bsSendGood",
|
|
24
|
+
name: "bs"
|
|
25
|
+
}
|
|
26
|
+
};
|
|
17
27
|
var JstSendGood = /*#__PURE__*/_createClass(function JstSendGood(options) {
|
|
18
28
|
var _this = this,
|
|
29
|
+
_typeMap$options$type,
|
|
30
|
+
_typeMap$options$type2,
|
|
19
31
|
_this$componentConfig;
|
|
20
32
|
_classCallCheck(this, JstSendGood);
|
|
21
33
|
_defineProperty(this, "name", void 0);
|
|
@@ -44,7 +56,8 @@ var JstSendGood = /*#__PURE__*/_createClass(function JstSendGood(options) {
|
|
|
44
56
|
}) : null;
|
|
45
57
|
});
|
|
46
58
|
_defineProperty(this, "renderPc", function (value, record) {
|
|
47
|
-
var
|
|
59
|
+
var _typeMap$_this$type;
|
|
60
|
+
var list = record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_").concat((_typeMap$_this$type = typeMap[_this.type]) === null || _typeMap$_this$type === void 0 ? void 0 : _typeMap$_this$type.key)];
|
|
48
61
|
//兼容多个商品
|
|
49
62
|
return /*#__PURE__*/React.createElement(JstGoodImage, {
|
|
50
63
|
list: list,
|
|
@@ -52,18 +65,21 @@ var JstSendGood = /*#__PURE__*/_createClass(function JstSendGood(options) {
|
|
|
52
65
|
});
|
|
53
66
|
});
|
|
54
67
|
_defineProperty(this, "renderLog", function (r) {
|
|
55
|
-
var
|
|
68
|
+
var _typeMap$_this$type2;
|
|
69
|
+
var list = r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_").concat((_typeMap$_this$type2 = typeMap[_this.type]) === null || _typeMap$_this$type2 === void 0 ? void 0 : _typeMap$_this$type2.key)];
|
|
56
70
|
if (isNull(list)) return null;
|
|
57
71
|
return _this.renderPc(undefined, r);
|
|
58
72
|
});
|
|
59
73
|
_defineProperty(this, "getComponentValue", function (r) {
|
|
60
|
-
|
|
74
|
+
var _typeMap$_this$type3;
|
|
75
|
+
return r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_").concat((_typeMap$_this$type3 = typeMap[_this.type]) === null || _typeMap$_this$type3 === void 0 ? void 0 : _typeMap$_this$type3.key)];
|
|
61
76
|
});
|
|
62
77
|
_defineProperty(this, "renderExport", function (value, record) {
|
|
63
|
-
var
|
|
78
|
+
var _typeMap$_this$type4;
|
|
79
|
+
var list = record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_").concat((_typeMap$_this$type4 = typeMap[_this.type]) === null || _typeMap$_this$type4 === void 0 ? void 0 : _typeMap$_this$type4.key)];
|
|
64
80
|
return (list || []).map(function (item) {
|
|
65
|
-
return [item === null || item === void 0 ? void 0 : item.sendId, item === null || item === void 0 ? void 0 : item.sendName].join(
|
|
66
|
-
}).join(
|
|
81
|
+
return [item === null || item === void 0 ? void 0 : item.sendId, item === null || item === void 0 ? void 0 : item.sendName].join("/");
|
|
82
|
+
}).join(",");
|
|
67
83
|
});
|
|
68
84
|
_defineProperty(this, "editRender", function (p) {
|
|
69
85
|
return /*#__PURE__*/React.createElement(GetFormItem, {
|
|
@@ -78,16 +94,17 @@ var JstSendGood = /*#__PURE__*/_createClass(function JstSendGood(options) {
|
|
|
78
94
|
});
|
|
79
95
|
});
|
|
80
96
|
_defineProperty(this, "filterConfig", function (item) {
|
|
97
|
+
var _typeMap$_this$type5, _typeMap$_this$type7;
|
|
81
98
|
return [{
|
|
82
99
|
searchDefaultConditions: SYMBOL.like,
|
|
83
100
|
type: item.type,
|
|
84
101
|
id: "".concat(item.id, "_sendName"),
|
|
85
|
-
name: "
|
|
86
|
-
filterComponentType:
|
|
102
|
+
name: "".concat((_typeMap$_this$type5 = typeMap[_this.type]) === null || _typeMap$_this$type5 === void 0 ? void 0 : _typeMap$_this$type5.name, "\u53D1\u8D27\u4ED3\u540D\u79F0"),
|
|
103
|
+
filterComponentType: "Input",
|
|
87
104
|
filterFn: function filterFn(value) {
|
|
88
105
|
return function (i) {
|
|
89
|
-
var _ref;
|
|
90
|
-
return (_ref = _filterFn.filterTableListItemColumnValue(i, item.id,
|
|
106
|
+
var _ref, _typeMap$_this$type6;
|
|
107
|
+
return (_ref = _filterFn.filterTableListItemColumnValue(i, item.id, (_typeMap$_this$type6 = typeMap[_this.type]) === null || _typeMap$_this$type6 === void 0 ? void 0 : _typeMap$_this$type6.key) || []) === null || _ref === void 0 ? void 0 : _ref.some(function (item) {
|
|
91
108
|
var _String;
|
|
92
109
|
var name = item !== null && item !== void 0 && item.sendName ? (_String = String(item === null || item === void 0 ? void 0 : item.sendName)) === null || _String === void 0 ? void 0 : _String.includes(value) : false;
|
|
93
110
|
return name;
|
|
@@ -98,12 +115,12 @@ var JstSendGood = /*#__PURE__*/_createClass(function JstSendGood(options) {
|
|
|
98
115
|
searchDefaultConditions: SYMBOL.like,
|
|
99
116
|
type: item.type,
|
|
100
117
|
id: "".concat(item.id, "_sendId"),
|
|
101
|
-
name: "
|
|
102
|
-
filterComponentType:
|
|
118
|
+
name: "".concat((_typeMap$_this$type7 = typeMap[_this.type]) === null || _typeMap$_this$type7 === void 0 ? void 0 : _typeMap$_this$type7.name, "\u53D1\u8D27\u4ED3\u7F16\u7801"),
|
|
119
|
+
filterComponentType: "Input",
|
|
103
120
|
filterFn: function filterFn(value) {
|
|
104
121
|
return function (i) {
|
|
105
|
-
var _ref2;
|
|
106
|
-
return (_ref2 = _filterFn.filterTableListItemColumnValue(i, item.id,
|
|
122
|
+
var _ref2, _typeMap$_this$type8;
|
|
123
|
+
return (_ref2 = _filterFn.filterTableListItemColumnValue(i, item.id, (_typeMap$_this$type8 = typeMap[_this.type]) === null || _typeMap$_this$type8 === void 0 ? void 0 : _typeMap$_this$type8.key) || []) === null || _ref2 === void 0 ? void 0 : _ref2.some(function (item) {
|
|
107
124
|
var _String2;
|
|
108
125
|
var id = item !== null && item !== void 0 && item.sendId ? (_String2 = String(item === null || item === void 0 ? void 0 : item.sendId)) === null || _String2 === void 0 ? void 0 : _String2.includes(value) : false;
|
|
109
126
|
return id;
|
|
@@ -114,22 +131,22 @@ var JstSendGood = /*#__PURE__*/_createClass(function JstSendGood(options) {
|
|
|
114
131
|
});
|
|
115
132
|
this.name = options.name;
|
|
116
133
|
this.id = options.id;
|
|
117
|
-
this.sortField = "".concat(options.id, "
|
|
118
|
-
this.formField = "".concat(options.id, "
|
|
134
|
+
this.sortField = "".concat(options.id, "_").concat((_typeMap$options$type = typeMap[options.type]) === null || _typeMap$options$type === void 0 ? void 0 : _typeMap$options$type.key);
|
|
135
|
+
this.formField = "".concat(options.id, "_").concat((_typeMap$options$type2 = typeMap[options.type]) === null || _typeMap$options$type2 === void 0 ? void 0 : _typeMap$options$type2.key);
|
|
119
136
|
this.type = options.type;
|
|
120
137
|
this.componentConfig = options.componentConfig;
|
|
121
|
-
this.dataType =
|
|
138
|
+
this.dataType = "object";
|
|
122
139
|
this.rules = (_this$componentConfig = this.componentConfig) !== null && _this$componentConfig !== void 0 && _this$componentConfig.required ? [{
|
|
123
140
|
required: true,
|
|
124
141
|
validator: function validator(_, value) {
|
|
125
142
|
if (!value || !value.length) {
|
|
126
|
-
return Promise.reject(new Error(
|
|
143
|
+
return Promise.reject(new Error("请选择宝贝"));
|
|
127
144
|
}
|
|
128
145
|
var hasNo = (value || []).some(function (item) {
|
|
129
146
|
var _this$componentConfig2, _this$componentConfig3;
|
|
130
|
-
if ([
|
|
147
|
+
if (["sendName"].includes((_this === null || _this === void 0 ? void 0 : (_this$componentConfig2 = _this.componentConfig) === null || _this$componentConfig2 === void 0 ? void 0 : _this$componentConfig2.showField) || "")) {
|
|
131
148
|
return item.sendName;
|
|
132
|
-
} else if ([
|
|
149
|
+
} else if (["sendId"].includes((_this === null || _this === void 0 ? void 0 : (_this$componentConfig3 = _this.componentConfig) === null || _this$componentConfig3 === void 0 ? void 0 : _this$componentConfig3.showField) || "")) {
|
|
133
150
|
return item.sendId;
|
|
134
151
|
} else {
|
|
135
152
|
return item.sendId && item.sendName;
|
|
@@ -141,7 +158,7 @@ var JstSendGood = /*#__PURE__*/_createClass(function JstSendGood(options) {
|
|
|
141
158
|
return Promise.resolve();
|
|
142
159
|
}
|
|
143
160
|
}] : [];
|
|
144
|
-
this.align =
|
|
161
|
+
this.align = "left";
|
|
145
162
|
this.isCombinationComponent = false;
|
|
146
163
|
this.canSort = false;
|
|
147
164
|
this.children = [];
|
|
@@ -1,5 +1,5 @@
|
|
|
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 JstSupply implements ComponentInterface {
|
|
4
4
|
name: string;
|
|
5
5
|
id: string;
|
|
@@ -12,7 +12,7 @@ declare class JstSupply implements ComponentInterface {
|
|
|
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: Record) => React.JSX.Element | null;
|
|
18
18
|
renderPc: (value: any, record: Record) => React.JSX.Element;
|