@kmkf-fe-packages/services-components 0.8.15-alpha.2 → 0.8.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/components/BS/BsExchange/index.js +0 -14
- package/dist/esm/components/Radio/index.d.ts +1 -2
- package/dist/esm/components/Radio/index.js +12 -23
- package/dist/esm/components/Select/index.d.ts +1 -2
- package/dist/esm/components/Select/index.js +8 -20
- package/dist/esm/factory.d.ts +1 -1
- package/dist/esm/factory.js +0 -2
- package/package.json +4 -4
|
@@ -181,20 +181,6 @@ var BsExchange = /*#__PURE__*/_createClass(function BsExchange(options) {
|
|
|
181
181
|
if (hasNoGood) {
|
|
182
182
|
return Promise.reject(new Error("请选择退回商品后再提交工单"));
|
|
183
183
|
}
|
|
184
|
-
var hasMore = ((value === null || value === void 0 ? void 0 : value.bsExchangeReturnGoods) || []).some(function (item) {
|
|
185
|
-
var returnMoney = ((item === null || item === void 0 ? void 0 : item.bsExchangeReturnGoods) || []).reduce(function (prv, next) {
|
|
186
|
-
prv += Number(next.money || 0);
|
|
187
|
-
return prv;
|
|
188
|
-
}, 0);
|
|
189
|
-
var swapOutMoney = ((item === null || item === void 0 ? void 0 : item.bsExchangeSwapOutGoods) || []).reduce(function (prv, next) {
|
|
190
|
-
prv += Number(next.money || 0);
|
|
191
|
-
return prv;
|
|
192
|
-
}, 0);
|
|
193
|
-
return returnMoney < swapOutMoney;
|
|
194
|
-
});
|
|
195
|
-
if (hasMore) {
|
|
196
|
-
return Promise.reject(new Error("换货商品的金额不能大于退回商品的金额"));
|
|
197
|
-
}
|
|
198
184
|
var hasLen = ((value === null || value === void 0 ? void 0 : value.bsExchangeReturnGoods) || []).some(function (item) {
|
|
199
185
|
return (item === null || item === void 0 ? void 0 : item.bsExchangeReturnGoods.length) !== (item === null || item === void 0 ? void 0 : item.bsExchangeSwapOutGoods.length);
|
|
200
186
|
});
|
|
@@ -10,7 +10,7 @@ declare class BasicRadio implements ComponentInterface {
|
|
|
10
10
|
sortField: string;
|
|
11
11
|
type: string;
|
|
12
12
|
rules: any[];
|
|
13
|
-
componentConfig: ComponentInterface[
|
|
13
|
+
componentConfig: ComponentInterface["componentConfig"];
|
|
14
14
|
isCombinationComponent: boolean;
|
|
15
15
|
formField: string;
|
|
16
16
|
canSort: boolean;
|
|
@@ -26,7 +26,6 @@ declare class BasicRadio implements ComponentInterface {
|
|
|
26
26
|
other: any;
|
|
27
27
|
};
|
|
28
28
|
renderExport: (value: any, record: Record) => string;
|
|
29
|
-
getKeyByComponentType: (type: string) => any;
|
|
30
29
|
renderClient: (record: Record) => React.JSX.Element | null;
|
|
31
30
|
editRender: (p: any) => React.JSX.Element;
|
|
32
31
|
filterConfig: (item: ColumnConfig) => {
|
|
@@ -13,9 +13,6 @@ import ItemView from "../../commonComponents/ItemView";
|
|
|
13
13
|
import { isNull, filterFn as _filterFn } from '@kmkf-fe-packages/kmkf-utils';
|
|
14
14
|
import get from 'lodash/get';
|
|
15
15
|
import { SYMBOL } from "../../constant";
|
|
16
|
-
var typeMap = {
|
|
17
|
-
RADIO: 'radio'
|
|
18
|
-
};
|
|
19
16
|
var BasicRadio = /*#__PURE__*/_createClass(function BasicRadio(options) {
|
|
20
17
|
var _this = this,
|
|
21
18
|
_this$componentConfig3,
|
|
@@ -35,36 +32,29 @@ var BasicRadio = /*#__PURE__*/_createClass(function BasicRadio(options) {
|
|
|
35
32
|
_defineProperty(this, "options", void 0);
|
|
36
33
|
_defineProperty(this, "render", function (value) {
|
|
37
34
|
var _value$value;
|
|
38
|
-
return /*#__PURE__*/React.createElement("span", null, value === null || value === void 0 ? void 0 : value.value, (value === null || value === void 0 ? void 0 : value.value) &&
|
|
35
|
+
return /*#__PURE__*/React.createElement("span", null, value === null || value === void 0 ? void 0 : value.value, (value === null || value === void 0 ? void 0 : value.value) && (value === null || value === void 0 ? void 0 : (_value$value = value.value) === null || _value$value === void 0 ? void 0 : _value$value.indexOf('其他')) > -1 && (value === null || value === void 0 ? void 0 : value.other) && "(".concat(value === null || value === void 0 ? void 0 : value.other, ")"));
|
|
39
36
|
});
|
|
40
37
|
_defineProperty(this, "renderPc", function (value, record) {
|
|
41
|
-
|
|
42
|
-
if ((record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_").concat(typeMap[type])]) === undefined && (record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_").concat(typeMap[type], "Other")]) === undefined) {
|
|
38
|
+
if ((record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_radio")]) === undefined && (record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_radioOther")]) === undefined) {
|
|
43
39
|
return /*#__PURE__*/React.createElement("span", null, "--");
|
|
44
40
|
}
|
|
45
|
-
return /*#__PURE__*/React.createElement("span", null, record === null || record === void 0 ? void 0 : record["".concat(_this.id, "
|
|
41
|
+
return /*#__PURE__*/React.createElement("span", null, record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_radio")], record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_radioOther")]);
|
|
46
42
|
});
|
|
47
43
|
_defineProperty(this, "renderLog", function (r) {
|
|
48
|
-
|
|
49
|
-
if (isNull(r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_").concat(typeMap[type])]) && isNull(r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_").concat(typeMap[type], "Other")])) return null;
|
|
44
|
+
if (isNull(r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_radio")]) && isNull(r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_radioOther")])) return null;
|
|
50
45
|
return _this.renderPc(undefined, r);
|
|
51
46
|
});
|
|
52
47
|
_defineProperty(this, "getComponentValue", function (r) {
|
|
53
|
-
var type = _this.type;
|
|
54
48
|
return {
|
|
55
|
-
value: r === null || r === void 0 ? void 0 : r["".concat(_this.id, "
|
|
56
|
-
other: r === null || r === void 0 ? void 0 : r["".concat(_this.id, "
|
|
49
|
+
value: r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_radio")],
|
|
50
|
+
other: r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_radioOther")]
|
|
57
51
|
};
|
|
58
52
|
});
|
|
59
53
|
_defineProperty(this, "renderExport", function (value, record) {
|
|
60
|
-
|
|
61
|
-
if ((record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_").concat(typeMap[type])]) === undefined) {
|
|
54
|
+
if ((record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_radio")]) === undefined) {
|
|
62
55
|
return '--';
|
|
63
56
|
}
|
|
64
|
-
return "".concat(record === null || record === void 0 ? void 0 : record["".concat(_this.id, "
|
|
65
|
-
});
|
|
66
|
-
_defineProperty(this, "getKeyByComponentType", function (type) {
|
|
67
|
-
return typeMap[type] || '';
|
|
57
|
+
return "".concat(record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_radio")], " ").concat(get(record, "".concat(_this.id, "_radioOther"), ''));
|
|
68
58
|
});
|
|
69
59
|
_defineProperty(this, "renderClient", function (record) {
|
|
70
60
|
return !isNull(record === null || record === void 0 ? void 0 : record[_this.id]) ? /*#__PURE__*/React.createElement(ItemView, {
|
|
@@ -88,11 +78,10 @@ var BasicRadio = /*#__PURE__*/_createClass(function BasicRadio(options) {
|
|
|
88
78
|
});
|
|
89
79
|
_defineProperty(this, "filterConfig", function (item) {
|
|
90
80
|
var _item$config, _item$config2, _item$config2$options, _item$config3;
|
|
91
|
-
var key = _this.getKeyByComponentType(item.type);
|
|
92
81
|
return {
|
|
93
82
|
searchDefaultConditions: SYMBOL.in,
|
|
94
83
|
type: item.type,
|
|
95
|
-
id: "".concat(item.id, "
|
|
84
|
+
id: "".concat(item.id, "_radio"),
|
|
96
85
|
// 过滤组件id
|
|
97
86
|
name: item.name,
|
|
98
87
|
// 过滤组件名称
|
|
@@ -105,7 +94,7 @@ var BasicRadio = /*#__PURE__*/_createClass(function BasicRadio(options) {
|
|
|
105
94
|
},
|
|
106
95
|
filterFn: function filterFn(value) {
|
|
107
96
|
return function (i) {
|
|
108
|
-
return value === null || value === void 0 ? void 0 : value.includes(_filterFn.filterTableListItemColumnValue(i, item.id,
|
|
97
|
+
return value === null || value === void 0 ? void 0 : value.includes(_filterFn.filterTableListItemColumnValue(i, item.id, 'radio'));
|
|
109
98
|
};
|
|
110
99
|
} // 第一个为选中值,第二个参数为表格行记录值
|
|
111
100
|
};
|
|
@@ -118,8 +107,8 @@ var BasicRadio = /*#__PURE__*/_createClass(function BasicRadio(options) {
|
|
|
118
107
|
this.type = options.type;
|
|
119
108
|
this.isCombinationComponent = false;
|
|
120
109
|
this.canSort = true;
|
|
121
|
-
this.sortField = "".concat(options.id, "
|
|
122
|
-
this.formField = "".concat(options.id, "
|
|
110
|
+
this.sortField = "".concat(options.id, "_radio");
|
|
111
|
+
this.formField = "".concat(options.id, "_radio");
|
|
123
112
|
this.children = [];
|
|
124
113
|
this.componentConfig = options.componentConfig;
|
|
125
114
|
this.rules = (_this$componentConfig3 = this.componentConfig) !== null && _this$componentConfig3 !== void 0 && _this$componentConfig3.required ? [{
|
|
@@ -6,7 +6,7 @@ declare class BasicSelect implements ComponentInterface {
|
|
|
6
6
|
sortField: string;
|
|
7
7
|
type: string;
|
|
8
8
|
rules: any[];
|
|
9
|
-
componentConfig: ComponentInterface[
|
|
9
|
+
componentConfig: ComponentInterface["componentConfig"];
|
|
10
10
|
isCombinationComponent: boolean;
|
|
11
11
|
formField: string;
|
|
12
12
|
canSort: boolean;
|
|
@@ -14,7 +14,6 @@ declare class BasicSelect implements ComponentInterface {
|
|
|
14
14
|
dataType: ComponentInterface['dataType'];
|
|
15
15
|
options: ComponentInterface['options'];
|
|
16
16
|
constructor(options: PickOption);
|
|
17
|
-
getKeyByComponentType: (type: string) => any;
|
|
18
17
|
editRender: (p: any) => React.JSX.Element;
|
|
19
18
|
renderClient: (record: any) => React.JSX.Element | null;
|
|
20
19
|
renderPc: (value: any, record: Record) => React.JSX.Element;
|
|
@@ -12,10 +12,6 @@ import GetFormItem from "../GetFormItem";
|
|
|
12
12
|
import ItemView from "../../commonComponents/ItemView";
|
|
13
13
|
import { isNull, filterFn as _filterFn } from '@kmkf-fe-packages/kmkf-utils';
|
|
14
14
|
import { SYMBOL } from "../../constant";
|
|
15
|
-
var typeMap = {
|
|
16
|
-
BUYER_MESSAGE_NOTICE: 'buyerMessageNotice',
|
|
17
|
-
SELECT: 'select'
|
|
18
|
-
};
|
|
19
15
|
var BasicSelect = /*#__PURE__*/_createClass(function BasicSelect(options) {
|
|
20
16
|
var _this = this,
|
|
21
17
|
_this$componentConfig3;
|
|
@@ -32,9 +28,6 @@ var BasicSelect = /*#__PURE__*/_createClass(function BasicSelect(options) {
|
|
|
32
28
|
_defineProperty(this, "children", void 0);
|
|
33
29
|
_defineProperty(this, "dataType", void 0);
|
|
34
30
|
_defineProperty(this, "options", void 0);
|
|
35
|
-
_defineProperty(this, "getKeyByComponentType", function (type) {
|
|
36
|
-
return typeMap[type] || '';
|
|
37
|
-
});
|
|
38
31
|
_defineProperty(this, "editRender", function (p) {
|
|
39
32
|
var _this$componentConfig, _this$componentConfig2;
|
|
40
33
|
return /*#__PURE__*/React.createElement(GetFormItem, {
|
|
@@ -59,30 +52,25 @@ var BasicSelect = /*#__PURE__*/_createClass(function BasicSelect(options) {
|
|
|
59
52
|
});
|
|
60
53
|
_defineProperty(this, "renderPc", function (value, record) {
|
|
61
54
|
var _record;
|
|
62
|
-
|
|
63
|
-
return /*#__PURE__*/React.createElement("span", null, (_record = record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_").concat(typeMap[type])]) !== null && _record !== void 0 ? _record : '--');
|
|
55
|
+
return /*#__PURE__*/React.createElement("span", null, (_record = record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_select")]) !== null && _record !== void 0 ? _record : '--');
|
|
64
56
|
});
|
|
65
57
|
_defineProperty(this, "renderLog", function (r) {
|
|
66
|
-
|
|
67
|
-
if (isNull(r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_").concat(typeMap[type])])) return null;
|
|
58
|
+
if (isNull(r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_select")])) return null;
|
|
68
59
|
return _this.renderPc(undefined, r);
|
|
69
60
|
});
|
|
70
61
|
_defineProperty(this, "getComponentValue", function (r) {
|
|
71
|
-
|
|
72
|
-
return r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_").concat(typeMap[type])];
|
|
62
|
+
return r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_select")];
|
|
73
63
|
});
|
|
74
64
|
_defineProperty(this, "renderExport", function (value, record) {
|
|
75
65
|
var _record2;
|
|
76
|
-
|
|
77
|
-
return (_record2 = record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_").concat(typeMap[type])]) !== null && _record2 !== void 0 ? _record2 : '--';
|
|
66
|
+
return (_record2 = record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_select")]) !== null && _record2 !== void 0 ? _record2 : '--';
|
|
78
67
|
});
|
|
79
68
|
_defineProperty(this, "filterConfig", function (item) {
|
|
80
69
|
var _item$config;
|
|
81
|
-
var key = _this.getKeyByComponentType(item.type);
|
|
82
70
|
return {
|
|
83
71
|
searchDefaultConditions: SYMBOL.in,
|
|
84
72
|
type: item.type,
|
|
85
|
-
id: "".concat(item.id, "
|
|
73
|
+
id: "".concat(item.id, "_select"),
|
|
86
74
|
// 过滤组件id
|
|
87
75
|
name: item.name,
|
|
88
76
|
// 过滤组件名称
|
|
@@ -92,15 +80,15 @@ var BasicSelect = /*#__PURE__*/_createClass(function BasicSelect(options) {
|
|
|
92
80
|
},
|
|
93
81
|
filterFn: function filterFn(value) {
|
|
94
82
|
return function (i) {
|
|
95
|
-
return value === null || value === void 0 ? void 0 : value.includes(_filterFn.filterTableListItemColumnValue(i, item.id,
|
|
83
|
+
return value === null || value === void 0 ? void 0 : value.includes(_filterFn.filterTableListItemColumnValue(i, item.id, 'select'));
|
|
96
84
|
};
|
|
97
85
|
} // 第一个为选中值,第二个参数为表格行记录值
|
|
98
86
|
};
|
|
99
87
|
});
|
|
100
88
|
this.name = options.name;
|
|
101
89
|
this.id = options.id;
|
|
102
|
-
this.sortField = "".concat(options.id, "
|
|
103
|
-
this.formField = "".concat(options.id, "
|
|
90
|
+
this.sortField = "".concat(options.id, "_select");
|
|
91
|
+
this.formField = "".concat(options.id, "_select");
|
|
104
92
|
this.type = options.type;
|
|
105
93
|
this.componentConfig = options.componentConfig;
|
|
106
94
|
this.rules = [];
|
package/dist/esm/factory.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { JstLogistics, JstItemSelect, JstSupply, JstSendGood, BasicInput, BasicAddress, BasicCascader, BasicCheckbox, BasicDataTime, BasicSelect, BasicRadio, BasicTextArea, BasicPicture, BasicMultSelect, BasicGrade, BasicRate, BasicFile, BasicPosting, CommonDataTime, TradeId, ShopName, ErpTradeId, BuyerNick, ReceiverName, ReceiverMobile, ReceiverAddress, TradeDateTime, Logistics, ReturnLogistics, ActualPayment, ERemark, AliPay, ItemSelect, ItemId, ItemEnCode, SystemOrderNo, Ordinary, ThirdItemSelect, FlowStatusSelect, Payment, TemplateSelect, WorkOrderId, PlatForm, ShopInput, Submitter, Handler, CompletedUser, LogisticsInterception, LogisticsTrajectory, FlowWorkOrderId, BsGoods, BsExchange, BsReissue } from "./index";
|
|
2
2
|
import { PickOption } from "./type";
|
|
3
|
-
export declare const factory: (type: string, options: PickOption) =>
|
|
3
|
+
export declare const factory: (type: string, options: PickOption) => BsExchange | BsGoods | BsReissue | JstLogistics | BasicPosting | BasicRadio | BasicSelect | BasicInput | BasicAddress | BasicCascader | BasicCheckbox | BasicDataTime | BasicTextArea | BasicPicture | BasicMultSelect | BasicGrade | BasicRate | BasicFile | CommonDataTime | TradeId | ErpTradeId | ShopName | BuyerNick | ReceiverName | ReceiverMobile | ReceiverAddress | TradeDateTime | Logistics | ReturnLogistics | ActualPayment | ERemark | AliPay | ItemSelect | ItemId | ItemEnCode | SystemOrderNo | Ordinary | ThirdItemSelect | Payment | JstItemSelect | JstSendGood | JstSupply | FlowStatusSelect | TemplateSelect | WorkOrderId | LogisticsInterception | LogisticsTrajectory | PlatForm | ShopInput | Submitter | Handler | CompletedUser | FlowWorkOrderId;
|
package/dist/esm/factory.js
CHANGED
|
@@ -15,7 +15,6 @@ export var factory = function factory(type, options) {
|
|
|
15
15
|
case "INPUT":
|
|
16
16
|
return new BasicInput(options);
|
|
17
17
|
case "RADIO":
|
|
18
|
-
case "BUYER_MESSAGE_NOTICE":
|
|
19
18
|
return new BasicRadio(options);
|
|
20
19
|
case "TEXTAREA":
|
|
21
20
|
return new BasicTextArea(options);
|
|
@@ -24,7 +23,6 @@ export var factory = function factory(type, options) {
|
|
|
24
23
|
case "DATETIME":
|
|
25
24
|
return new BasicDataTime(options);
|
|
26
25
|
case "SELECT":
|
|
27
|
-
case 'BUYER_MESSAGE_NOTICE':
|
|
28
26
|
return new BasicSelect(options);
|
|
29
27
|
case "PICTURE":
|
|
30
28
|
return new BasicPicture(options);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kmkf-fe-packages/services-components",
|
|
3
|
-
"version": "0.8.15
|
|
3
|
+
"version": "0.8.15",
|
|
4
4
|
"module": "dist/esm/index.js",
|
|
5
5
|
"typings": "dist/esm/index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -26,8 +26,8 @@
|
|
|
26
26
|
"father": "^4.1.7"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@kmkf-fe-packages/basic-components": "^0.8.
|
|
30
|
-
"@kmkf-fe-packages/kmkf-utils": "^0.8.
|
|
29
|
+
"@kmkf-fe-packages/basic-components": "^0.8.9",
|
|
30
|
+
"@kmkf-fe-packages/kmkf-utils": "^0.8.9"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
33
33
|
"@ant-design/icons": "^4.7.0",
|
|
@@ -40,5 +40,5 @@
|
|
|
40
40
|
"gitHooks": {
|
|
41
41
|
"pre-commit": "lint-staged"
|
|
42
42
|
},
|
|
43
|
-
"gitHead": "
|
|
43
|
+
"gitHead": "ae567bf609056af8b9270ac03f39f2e52a9d6b5d"
|
|
44
44
|
}
|