@kmkf-fe-packages/services-components 1.1.3 → 1.2.0
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 +2 -3
- package/dist/esm/components/BS/common/BsMemo.js +1 -2
- package/dist/esm/components/BS/common/BsType.js +1 -2
- package/dist/esm/components/Cascader/index.d.ts +0 -1
- package/dist/esm/components/Cascader/index.js +1 -4
- package/dist/esm/components/Common/index.d.ts +1 -1
- package/dist/esm/components/Common/index.js +4 -185
- package/dist/esm/components/CommonHeaderGood/index.js +0 -182
- package/dist/esm/components/CommonMultiStatus/index.js +19 -25
- package/dist/esm/components/CommonSystemOrder/index.js +8 -10
- package/dist/esm/components/StatusSelect/index.js +0 -3
- package/dist/esm/factory.d.ts +2 -2
- package/dist/esm/factory.js +1 -7
- package/dist/esm/index.d.ts +0 -3
- package/dist/esm/index.js +0 -3
- package/dist/esm/service/api.d.ts +0 -1
- package/dist/esm/service/api.js +1 -20
- package/dist/esm/type.d.ts +2 -3
- package/package.json +4 -4
- package/dist/esm/components/Label/index.d.ts +0 -36
- package/dist/esm/components/Label/index.js +0 -142
- package/dist/esm/components/WDT/WdtExchange/index.d.ts +0 -35
- package/dist/esm/components/WDT/WdtExchange/index.js +0 -183
- package/dist/esm/components/WDT/WdtReturn/index.d.ts +0 -54
- package/dist/esm/components/WDT/WdtReturn/index.js +0 -150
|
@@ -48,7 +48,7 @@ var CommonSystemOrder = /*#__PURE__*/_createClass(function CommonSystemOrder(opt
|
|
|
48
48
|
var _this = this,
|
|
49
49
|
_typeMap$options$type,
|
|
50
50
|
_typeMap$options$type2,
|
|
51
|
-
_this$
|
|
51
|
+
_this$componentConfig3;
|
|
52
52
|
_classCallCheck(this, CommonSystemOrder);
|
|
53
53
|
_defineProperty(this, "name", void 0);
|
|
54
54
|
_defineProperty(this, "id", void 0);
|
|
@@ -63,7 +63,7 @@ var CommonSystemOrder = /*#__PURE__*/_createClass(function CommonSystemOrder(opt
|
|
|
63
63
|
_defineProperty(this, "children", void 0);
|
|
64
64
|
_defineProperty(this, "dataType", void 0);
|
|
65
65
|
_defineProperty(this, "renderClient", function (record) {
|
|
66
|
-
var _typeMap$_this$type
|
|
66
|
+
var _typeMap$_this$type;
|
|
67
67
|
var isShow = Array.isArray(record === null || record === void 0 ? void 0 : record[_this.id]) ? some(record === null || record === void 0 ? void 0 : record[_this.id], function (item) {
|
|
68
68
|
return !isNull(item);
|
|
69
69
|
}) : false;
|
|
@@ -72,13 +72,12 @@ var CommonSystemOrder = /*#__PURE__*/_createClass(function CommonSystemOrder(opt
|
|
|
72
72
|
label: _this.name,
|
|
73
73
|
value: /*#__PURE__*/React.createElement(CommonOrderContent, {
|
|
74
74
|
list: record === null || record === void 0 ? void 0 : record[_this.id],
|
|
75
|
-
valueKey: (_typeMap$_this$type = typeMap[_this.type]) === null || _typeMap$_this$type === void 0 ? void 0 : _typeMap$_this$type.valueKey
|
|
76
|
-
isShowPopover: ((_this$componentConfig = _this.componentConfig) === null || _this$componentConfig === void 0 ? void 0 : _this$componentConfig.belongType) !== "wdt"
|
|
75
|
+
valueKey: (_typeMap$_this$type = typeMap[_this.type]) === null || _typeMap$_this$type === void 0 ? void 0 : _typeMap$_this$type.valueKey
|
|
77
76
|
})
|
|
78
77
|
}) : null;
|
|
79
78
|
});
|
|
80
79
|
_defineProperty(this, "renderPc", function (value, record) {
|
|
81
|
-
var _typeMap$_this$type2, _typeMap$_this$type3, _typeMap$_this$type4
|
|
80
|
+
var _typeMap$_this$type2, _typeMap$_this$type3, _typeMap$_this$type4;
|
|
82
81
|
var list = record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_").concat((_typeMap$_this$type2 = typeMap[_this.type]) === null || _typeMap$_this$type2 === void 0 ? void 0 : _typeMap$_this$type2.key)];
|
|
83
82
|
//兼容多个商品
|
|
84
83
|
return /*#__PURE__*/React.createElement("span", {
|
|
@@ -88,8 +87,7 @@ var CommonSystemOrder = /*#__PURE__*/_createClass(function CommonSystemOrder(opt
|
|
|
88
87
|
}, /*#__PURE__*/React.createElement(CommonOrderContent, {
|
|
89
88
|
list: list,
|
|
90
89
|
type: (_typeMap$_this$type3 = typeMap[_this.type]) === null || _typeMap$_this$type3 === void 0 ? void 0 : _typeMap$_this$type3.type,
|
|
91
|
-
valueKey: (_typeMap$_this$type4 = typeMap[_this.type]) === null || _typeMap$_this$type4 === void 0 ? void 0 : _typeMap$_this$type4.valueKey
|
|
92
|
-
isShowPopover: ((_this$componentConfig2 = _this.componentConfig) === null || _this$componentConfig2 === void 0 ? void 0 : _this$componentConfig2.belongType) !== "wdt"
|
|
90
|
+
valueKey: (_typeMap$_this$type4 = typeMap[_this.type]) === null || _typeMap$_this$type4 === void 0 ? void 0 : _typeMap$_this$type4.valueKey
|
|
93
91
|
}));
|
|
94
92
|
});
|
|
95
93
|
_defineProperty(this, "renderLog", function (r) {
|
|
@@ -111,14 +109,14 @@ var CommonSystemOrder = /*#__PURE__*/_createClass(function CommonSystemOrder(opt
|
|
|
111
109
|
}).join(',');
|
|
112
110
|
});
|
|
113
111
|
_defineProperty(this, "editRender", function (p) {
|
|
114
|
-
var _this$
|
|
112
|
+
var _this$componentConfig, _this$componentConfig2, _typeMap$_this$type9;
|
|
115
113
|
return /*#__PURE__*/React.createElement(GetFormItem, {
|
|
116
114
|
title: _this.name,
|
|
117
115
|
name: _this.id,
|
|
118
116
|
rules: _this.rules,
|
|
119
117
|
hidden: p === null || p === void 0 ? void 0 : p.hidden,
|
|
120
118
|
display: p === null || p === void 0 ? void 0 : p.display,
|
|
121
|
-
required: (_this$
|
|
119
|
+
required: (_this$componentConfig = (_this$componentConfig2 = _this.componentConfig) === null || _this$componentConfig2 === void 0 ? void 0 : _this$componentConfig2.required) !== null && _this$componentConfig !== void 0 ? _this$componentConfig : false,
|
|
122
120
|
component: /*#__PURE__*/React.createElement(SystemOrder, _extends({}, _this.componentConfig, {
|
|
123
121
|
type: (_typeMap$_this$type9 = typeMap[_this.type]) === null || _typeMap$_this$type9 === void 0 ? void 0 : _typeMap$_this$type9.type
|
|
124
122
|
}))
|
|
@@ -153,7 +151,7 @@ var CommonSystemOrder = /*#__PURE__*/_createClass(function CommonSystemOrder(opt
|
|
|
153
151
|
this.canSort = false;
|
|
154
152
|
this.children = [];
|
|
155
153
|
this.dataType = 'object';
|
|
156
|
-
this.rules = (_this$
|
|
154
|
+
this.rules = (_this$componentConfig3 = this.componentConfig) !== null && _this$componentConfig3 !== void 0 && _this$componentConfig3.required ? [{
|
|
157
155
|
required: true,
|
|
158
156
|
validator: function validator(_, value) {
|
|
159
157
|
var hasNo = (value || []).some(function (item) {
|
|
@@ -112,9 +112,6 @@ var StatusSelect = /*#__PURE__*/_createClass(function StatusSelect(options) {
|
|
|
112
112
|
display: p === null || p === void 0 ? void 0 : p.display,
|
|
113
113
|
required: (_this$componentConfig = (_this$componentConfig2 = _this.componentConfig) === null || _this$componentConfig2 === void 0 ? void 0 : _this$componentConfig2.required) !== null && _this$componentConfig !== void 0 ? _this$componentConfig : false,
|
|
114
114
|
component: /*#__PURE__*/React.createElement(CommonStatus, _extends({}, _this.componentConfig, {
|
|
115
|
-
style: {
|
|
116
|
-
width: 200
|
|
117
|
-
},
|
|
118
115
|
placeholder: "\u8BF7\u8F93\u5165".concat(_this.name),
|
|
119
116
|
failValue: selectTypeMap[_this.type].failValue
|
|
120
117
|
}))
|
package/dist/esm/factory.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { JstLogistics, JstItemSelect, JstSupply, JstSendGood, BasicInput, BasicAddress, BasicCascader, BasicCheckbox, BasicDataTime, BasicSelect, BasicRadio, BasicTextArea, BasicPicture, BasicMultSelect, BasicGrade, BasicRate, BasicFile, BasicPosting, CommonDataTime, TradeId, ShopName, BuyerNick, ReceiverName, ReceiverMobile, ReceiverAddress, TradeDateTime, Logistics, ReturnLogistics, ActualPayment, ERemark, AliPay, ItemSelect, ItemId, ItemEnCode, SystemOrderNo, Ordinary, ThirdItemSelect, FlowStatusSelect, FlowMarkSelect, FlowTag, Payment, TemplateSelect, WorkOrderId, PlatForm, ShopInput, Submitter, PrevSubmitter, FlowCreator, Handler, CompletedUser, LogisticsInterception, LogisticsMoreInterception, LogisticsTrajectory, LogisticsMoreTrajectory, FlowWorkOrderId, BsGoods, BsExchange, BsReissue, BsReturn, BsSystemOrder, BsLogistics, StatusSelect, CommonSystemOrder, CommonMultiStatus, Calculation, NodeDeadLine, HandlerDeadLine, NodeStayDuration, WlnGoods, BsPosting, MsgStatus, NodeInput, FlowWorkOrderStatus, WdtGoods,
|
|
1
|
+
import { JstLogistics, JstItemSelect, JstSupply, JstSendGood, BasicInput, BasicAddress, BasicCascader, BasicCheckbox, BasicDataTime, BasicSelect, BasicRadio, BasicTextArea, BasicPicture, BasicMultSelect, BasicGrade, BasicRate, BasicFile, BasicPosting, CommonDataTime, TradeId, ShopName, BuyerNick, ReceiverName, ReceiverMobile, ReceiverAddress, TradeDateTime, Logistics, ReturnLogistics, ActualPayment, ERemark, AliPay, ItemSelect, ItemId, ItemEnCode, SystemOrderNo, Ordinary, ThirdItemSelect, FlowStatusSelect, FlowMarkSelect, FlowTag, Payment, TemplateSelect, WorkOrderId, PlatForm, ShopInput, Submitter, PrevSubmitter, FlowCreator, Handler, CompletedUser, LogisticsInterception, LogisticsMoreInterception, LogisticsTrajectory, LogisticsMoreTrajectory, FlowWorkOrderId, BsGoods, BsExchange, BsReissue, BsReturn, BsSystemOrder, BsLogistics, StatusSelect, CommonSystemOrder, CommonMultiStatus, Calculation, NodeDeadLine, HandlerDeadLine, NodeStayDuration, WlnGoods, BsPosting, MsgStatus, NodeInput, FlowWorkOrderStatus, WdtGoods, CommonInput, PaymentVoucherCode, WdtReissue } from "./index";
|
|
2
2
|
import { PickOption } from "./type";
|
|
3
|
-
export declare const factory: (type: string, options: PickOption) => AliPay | BasicCascader | CommonMultiStatus | CommonSystemOrder |
|
|
3
|
+
export declare const factory: (type: string, options: PickOption) => AliPay | BasicCascader | CommonMultiStatus | CommonSystemOrder | FlowMarkSelect | BasicInput | MsgStatus | StatusSelect | BasicAddress | BasicCheckbox | BasicDataTime | BasicSelect | BasicRadio | BasicTextArea | BasicPicture | BasicMultSelect | BasicGrade | BasicRate | BasicFile | BasicPosting | CommonDataTime | TradeId | ShopName | BuyerNick | ReceiverName | ReceiverMobile | ReceiverAddress | TradeDateTime | Logistics | ReturnLogistics | ActualPayment | ERemark | ItemSelect | ItemId | ItemEnCode | SystemOrderNo | Ordinary | ThirdItemSelect | Payment | JstLogistics | JstItemSelect | JstSendGood | JstSupply | BsSystemOrder | BsGoods | BsExchange | BsReissue | BsReturn | BsLogistics | FlowStatusSelect | FlowTag | TemplateSelect | WorkOrderId | LogisticsInterception | LogisticsMoreInterception | LogisticsTrajectory | LogisticsMoreTrajectory | PlatForm | ShopInput | Submitter | PrevSubmitter | FlowCreator | Handler | CompletedUser | FlowWorkOrderId | Calculation | NodeDeadLine | HandlerDeadLine | NodeStayDuration | WlnGoods | BsPosting | NodeInput | FlowWorkOrderStatus | WdtGoods | WdtReissue | CommonInput | PaymentVoucherCode;
|
package/dist/esm/factory.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
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, FlowMarkSelect, FlowTag, Payment, TemplateSelect, WorkOrderId, PlatForm, ShopInput, Submitter, PrevSubmitter, FlowCreator, Handler, CompletedUser, LogisticsInterception, LogisticsMoreInterception, LogisticsTrajectory, LogisticsMoreTrajectory, FlowWorkOrderId, BsGoods, BsExchange, BsReissue, BsReturn, BsSystemOrder, BsLogistics, StatusSelect,
|
|
2
2
|
// CommonTradeId,
|
|
3
|
-
CommonSystemOrder, CommonMultiStatus, Calculation, NodeDeadLine, HandlerDeadLine, NodeStayDuration, WlnGoods, BsPosting, MsgStatus, NodeInput, FlowWorkOrderStatus, WdtGoods,
|
|
3
|
+
CommonSystemOrder, CommonMultiStatus, Calculation, NodeDeadLine, HandlerDeadLine, NodeStayDuration, WlnGoods, BsPosting, MsgStatus, NodeInput, FlowWorkOrderStatus, WdtGoods, CommonInput, PaymentVoucherCode, WdtReissue } from "./index";
|
|
4
4
|
export var factory = function factory(type, options) {
|
|
5
5
|
var _options$componentCon;
|
|
6
6
|
switch (type) {
|
|
@@ -141,16 +141,12 @@ export var factory = function factory(type, options) {
|
|
|
141
141
|
return new BsGoods(options);
|
|
142
142
|
case "BS_EXCHANGE_GOODS":
|
|
143
143
|
return new BsExchange(options);
|
|
144
|
-
case "WDT_EXCHANGE_GOODS":
|
|
145
|
-
return new WdtExchange(options);
|
|
146
144
|
case "BS_REISSUE_GOODS":
|
|
147
145
|
return new BsReissue(options);
|
|
148
146
|
case "WDT_REISSUE_GOODS":
|
|
149
147
|
return new WdtReissue(options);
|
|
150
148
|
case "BS_RETURN_GOODS":
|
|
151
149
|
return new BsReturn(options);
|
|
152
|
-
case "WDT_RETURN_GOODS":
|
|
153
|
-
return new WdtReturn(options);
|
|
154
150
|
case "REISSUE_TRADE_ID":
|
|
155
151
|
case "BS_DELIVERY_NO":
|
|
156
152
|
case "RETURN_GOODS_TRADE_ID":
|
|
@@ -208,8 +204,6 @@ export var factory = function factory(type, options) {
|
|
|
208
204
|
return new CommonInput(options);
|
|
209
205
|
case "PAYMENT_VOUCHER_CODE":
|
|
210
206
|
return new PaymentVoucherCode(options);
|
|
211
|
-
case "LABEL":
|
|
212
|
-
return new Label(options);
|
|
213
207
|
default:
|
|
214
208
|
return new BasicInput(options);
|
|
215
209
|
}
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -75,11 +75,8 @@ export { default as FlowWorkOrderStatus } from "./components/FlowWorkOrderStatus
|
|
|
75
75
|
export { default as MsgStatus } from "./components/MsgStatus";
|
|
76
76
|
export { default as WdtGoods } from "./components/WDT/WdtGoods";
|
|
77
77
|
export { default as WdtReissue } from "./components/WDT/WdtRessuie";
|
|
78
|
-
export { default as WdtReturn } from "./components/WDT/WdtReturn";
|
|
79
|
-
export { default as WdtExchange } from "./components/WDT/WdtExchange";
|
|
80
78
|
export { default as CommonInput } from "./components/CommonInput";
|
|
81
79
|
export { default as PaymentVoucherCode } from "./components/PaymentVoucherCode";
|
|
82
|
-
export { default as Label } from "./components/Label";
|
|
83
80
|
export { default as KmErpOrderNum } from "./components/ErpTradeId/components/OrderNum";
|
|
84
81
|
export { factory } from "./factory";
|
|
85
82
|
export { default as PlatformAvatar } from "./commonComponents/PlatformAvatar";
|
package/dist/esm/index.js
CHANGED
|
@@ -75,11 +75,8 @@ export { default as FlowWorkOrderStatus } from "./components/FlowWorkOrderStatus
|
|
|
75
75
|
export { default as MsgStatus } from "./components/MsgStatus";
|
|
76
76
|
export { default as WdtGoods } from "./components/WDT/WdtGoods";
|
|
77
77
|
export { default as WdtReissue } from "./components/WDT/WdtRessuie";
|
|
78
|
-
export { default as WdtReturn } from "./components/WDT/WdtReturn";
|
|
79
|
-
export { default as WdtExchange } from "./components/WDT/WdtExchange";
|
|
80
78
|
export { default as CommonInput } from "./components/CommonInput";
|
|
81
79
|
export { default as PaymentVoucherCode } from "./components/PaymentVoucherCode";
|
|
82
|
-
export { default as Label } from "./components/Label";
|
|
83
80
|
// TODO: ERP 打款工单使用
|
|
84
81
|
export { default as KmErpOrderNum } from "./components/ErpTradeId/components/OrderNum";
|
|
85
82
|
export { factory } from "./factory";
|
|
@@ -9,4 +9,3 @@ export declare const queryAllLogisticsCompany: () => Promise<void>;
|
|
|
9
9
|
export declare const queryWdtLogisticsCompany: () => Promise<void>;
|
|
10
10
|
export declare const queryWdtSendData: () => Promise<void>;
|
|
11
11
|
export declare const getAlipayBillReceipt: (data: any) => Promise<any>;
|
|
12
|
-
export declare const queryLabel: () => Promise<any>;
|
package/dist/esm/service/api.js
CHANGED
|
@@ -10,7 +10,7 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
10
10
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
11
11
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
12
12
|
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; }
|
|
13
|
-
import { AddressData, toTree, BsAddressData, WdtAddressData, PlatData, ExpressInterceptData, LogisticsAddressData, ExpressData,
|
|
13
|
+
import { AddressData, toTree, BsAddressData, WdtAddressData, PlatData, ExpressInterceptData, LogisticsAddressData, ExpressData, WdtSendData, servers, WDT } from "@kmkf-fe-packages/kmkf-utils";
|
|
14
14
|
import get from "lodash/get";
|
|
15
15
|
import request from "./request";
|
|
16
16
|
// 重复校验
|
|
@@ -267,23 +267,4 @@ export var getAlipayBillReceipt = function getAlipayBillReceipt(data) {
|
|
|
267
267
|
method: "post",
|
|
268
268
|
data: data
|
|
269
269
|
});
|
|
270
|
-
};
|
|
271
|
-
export var queryLabel = function queryLabel() {
|
|
272
|
-
return request({
|
|
273
|
-
url: "/qy/diamond/getConfigInfo",
|
|
274
|
-
method: "get",
|
|
275
|
-
data: {
|
|
276
|
-
key: 'RISK_WARING_LABEL_LIST'
|
|
277
|
-
}
|
|
278
|
-
}).then(function (res) {
|
|
279
|
-
var data = res.data;
|
|
280
|
-
var instance = LabelData.getInstance();
|
|
281
|
-
try {
|
|
282
|
-
var finalData = JSON.parse(data);
|
|
283
|
-
instance.labelData = finalData;
|
|
284
|
-
} catch (e) {
|
|
285
|
-
console.error('转换标签数据数据异常');
|
|
286
|
-
instance.labelData = [];
|
|
287
|
-
}
|
|
288
|
-
});
|
|
289
270
|
};
|
package/dist/esm/type.d.ts
CHANGED
|
@@ -47,8 +47,8 @@ export interface ComponentInterface {
|
|
|
47
47
|
rules?: any[];
|
|
48
48
|
width?: number;
|
|
49
49
|
align?: ALignType;
|
|
50
|
-
dataType:
|
|
51
|
-
format?:
|
|
50
|
+
dataType: 'string' | 'number' | 'boolean' | 'array' | 'range' | 'object';
|
|
51
|
+
format?: 'dateTime' | 'date' | 'time' | 'cascader' | 'shopInput' | 'staffGroup';
|
|
52
52
|
options?: Array<any>;
|
|
53
53
|
templateId?: string;
|
|
54
54
|
workOrderUniqueKey?: string;
|
|
@@ -168,7 +168,6 @@ export interface ComponentInterface {
|
|
|
168
168
|
rulesOptions?: Array<any>;
|
|
169
169
|
selectRules?: Array<string>;
|
|
170
170
|
logistics?: string;
|
|
171
|
-
belongType?: string;
|
|
172
171
|
};
|
|
173
172
|
effects?: {
|
|
174
173
|
queryWorkOrderDetail?: (r: Record) => void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kmkf-fe-packages/services-components",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"module": "dist/esm/index.js",
|
|
5
5
|
"typings": "dist/esm/index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -20,8 +20,8 @@
|
|
|
20
20
|
]
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@kmkf-fe-packages/basic-components": "1.
|
|
24
|
-
"@kmkf-fe-packages/kmkf-utils": "1.
|
|
23
|
+
"@kmkf-fe-packages/basic-components": "1.2.0",
|
|
24
|
+
"@kmkf-fe-packages/kmkf-utils": "1.2.0"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"@typescript-eslint/eslint-plugin": "^5.59.2",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"publishConfig": {
|
|
38
38
|
"access": "public"
|
|
39
39
|
},
|
|
40
|
-
"gitHead": "
|
|
40
|
+
"gitHead": "b14fc34f8d5d1d37484367f2a09782c4f9d065cb",
|
|
41
41
|
"gitHooks": {
|
|
42
42
|
"pre-commit": "lint-staged"
|
|
43
43
|
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { ComponentInterface, PickOption, ColumnConfig, Record } from "../../type";
|
|
2
|
-
import React from "react";
|
|
3
|
-
import { LabelData } from "@kmkf-fe-packages/kmkf-utils";
|
|
4
|
-
declare class Label implements ComponentInterface {
|
|
5
|
-
name: string;
|
|
6
|
-
id: string;
|
|
7
|
-
sortField: string;
|
|
8
|
-
type: string;
|
|
9
|
-
rules: any[];
|
|
10
|
-
componentConfig: ComponentInterface["componentConfig"];
|
|
11
|
-
isCombinationComponent: boolean;
|
|
12
|
-
formField: string;
|
|
13
|
-
canSort: boolean;
|
|
14
|
-
children: ComponentInterface[];
|
|
15
|
-
dataType: ComponentInterface["dataType"];
|
|
16
|
-
options: ComponentInterface["options"];
|
|
17
|
-
labelDateInstance: InstanceType<typeof LabelData>;
|
|
18
|
-
constructor(options: PickOption);
|
|
19
|
-
getComponentValue: (r: Record) => any;
|
|
20
|
-
editRender: (p: any) => React.JSX.Element;
|
|
21
|
-
renderClient: (record: any) => React.JSX.Element | null;
|
|
22
|
-
showDetail: (value: Array<{
|
|
23
|
-
labelId: string;
|
|
24
|
-
labelName: string;
|
|
25
|
-
labelShowName: string;
|
|
26
|
-
openId: string;
|
|
27
|
-
}>) => React.JSX.Element;
|
|
28
|
-
renderPc: (value: any, record: Record) => React.JSX.Element;
|
|
29
|
-
renderLog: (r: Record) => React.JSX.Element;
|
|
30
|
-
renderExport: (value: any, record: Record) => any;
|
|
31
|
-
filterConfig: (item: ColumnConfig) => never[];
|
|
32
|
-
formDataTransform: (v: Array<{
|
|
33
|
-
labelShowName: string;
|
|
34
|
-
}>) => string[];
|
|
35
|
-
}
|
|
36
|
-
export default Label;
|
|
@@ -1,142 +0,0 @@
|
|
|
1
|
-
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
-
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
3
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
4
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
5
|
-
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; }
|
|
6
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
7
|
-
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); }
|
|
8
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
9
|
-
import React from "react";
|
|
10
|
-
import { Tag, Select, Space } from 'antd';
|
|
11
|
-
import { LabelData, isNull } from "@kmkf-fe-packages/kmkf-utils";
|
|
12
|
-
import GetFormItem from "../GetFormItem";
|
|
13
|
-
import ItemView from "../../commonComponents/ItemView";
|
|
14
|
-
var EditRenderItem = function EditRenderItem(props) {
|
|
15
|
-
var value = props.value;
|
|
16
|
-
var tagRender = function tagRender(prop) {
|
|
17
|
-
var _props$options, _props$options$find;
|
|
18
|
-
var label = prop.label,
|
|
19
|
-
closable = prop.closable,
|
|
20
|
-
onClose = prop.onClose,
|
|
21
|
-
value = prop.value;
|
|
22
|
-
var color = props === null || props === void 0 ? void 0 : (_props$options = props.options) === null || _props$options === void 0 ? void 0 : (_props$options$find = _props$options.find(function (item) {
|
|
23
|
-
return item.value === value;
|
|
24
|
-
})) === null || _props$options$find === void 0 ? void 0 : _props$options$find.color;
|
|
25
|
-
var onPreventMouseDown = function onPreventMouseDown(event) {
|
|
26
|
-
event.preventDefault();
|
|
27
|
-
event.stopPropagation();
|
|
28
|
-
};
|
|
29
|
-
return /*#__PURE__*/React.createElement(Tag, {
|
|
30
|
-
color: color,
|
|
31
|
-
onMouseDown: onPreventMouseDown,
|
|
32
|
-
closable: closable,
|
|
33
|
-
onClose: onClose,
|
|
34
|
-
style: {
|
|
35
|
-
marginRight: 3
|
|
36
|
-
}
|
|
37
|
-
}, label);
|
|
38
|
-
};
|
|
39
|
-
return /*#__PURE__*/React.createElement(Select, _extends({}, props, {
|
|
40
|
-
value: Array.from(new Set(value === null || value === void 0 ? void 0 : value.map(function (item) {
|
|
41
|
-
return item === null || item === void 0 ? void 0 : item.labelShowName;
|
|
42
|
-
}))),
|
|
43
|
-
mode: "multiple",
|
|
44
|
-
showArrow: true,
|
|
45
|
-
tagRender: tagRender
|
|
46
|
-
}));
|
|
47
|
-
};
|
|
48
|
-
var Label = /*#__PURE__*/_createClass(function Label(options) {
|
|
49
|
-
var _this = this;
|
|
50
|
-
_classCallCheck(this, Label);
|
|
51
|
-
_defineProperty(this, "name", void 0);
|
|
52
|
-
_defineProperty(this, "id", void 0);
|
|
53
|
-
_defineProperty(this, "sortField", void 0);
|
|
54
|
-
_defineProperty(this, "type", void 0);
|
|
55
|
-
_defineProperty(this, "rules", void 0);
|
|
56
|
-
_defineProperty(this, "componentConfig", void 0);
|
|
57
|
-
_defineProperty(this, "isCombinationComponent", void 0);
|
|
58
|
-
_defineProperty(this, "formField", void 0);
|
|
59
|
-
_defineProperty(this, "canSort", void 0);
|
|
60
|
-
_defineProperty(this, "children", void 0);
|
|
61
|
-
_defineProperty(this, "dataType", void 0);
|
|
62
|
-
_defineProperty(this, "options", void 0);
|
|
63
|
-
_defineProperty(this, "labelDateInstance", void 0);
|
|
64
|
-
_defineProperty(this, "getComponentValue", function (r) {
|
|
65
|
-
return r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_label")];
|
|
66
|
-
});
|
|
67
|
-
_defineProperty(this, "editRender", function (p) {
|
|
68
|
-
var _this$componentConfig, _this$componentConfig2;
|
|
69
|
-
return /*#__PURE__*/React.createElement(GetFormItem, {
|
|
70
|
-
title: _this.name,
|
|
71
|
-
name: _this.id,
|
|
72
|
-
rules: _this.rules,
|
|
73
|
-
hidden: p === null || p === void 0 ? void 0 : p.hidden,
|
|
74
|
-
display: p === null || p === void 0 ? void 0 : p.display,
|
|
75
|
-
required: (_this$componentConfig = (_this$componentConfig2 = _this.componentConfig) === null || _this$componentConfig2 === void 0 ? void 0 : _this$componentConfig2.required) !== null && _this$componentConfig !== void 0 ? _this$componentConfig : false,
|
|
76
|
-
component: /*#__PURE__*/React.createElement(EditRenderItem, _extends({}, _this.componentConfig, {
|
|
77
|
-
placeholder: "\u7CFB\u7EDF\u81EA\u52A8\u751F\u6210",
|
|
78
|
-
showSearch: true,
|
|
79
|
-
onChange: p === null || p === void 0 ? void 0 : p.onChange,
|
|
80
|
-
options: _this.labelDateInstance.labelData,
|
|
81
|
-
optionFilterProp: "label"
|
|
82
|
-
}))
|
|
83
|
-
});
|
|
84
|
-
});
|
|
85
|
-
_defineProperty(this, "renderClient", function (record) {
|
|
86
|
-
return !isNull(record === null || record === void 0 ? void 0 : record[_this.id]) ? /*#__PURE__*/React.createElement(ItemView, {
|
|
87
|
-
id: _this.id,
|
|
88
|
-
label: _this.name,
|
|
89
|
-
value: _this.showDetail(record === null || record === void 0 ? void 0 : record["".concat(_this.id)])
|
|
90
|
-
}) : null;
|
|
91
|
-
});
|
|
92
|
-
_defineProperty(this, "showDetail", function (value) {
|
|
93
|
-
return /*#__PURE__*/React.createElement(Space, {
|
|
94
|
-
style: {
|
|
95
|
-
flexWrap: 'wrap'
|
|
96
|
-
}
|
|
97
|
-
}, Array.isArray(value) ? value === null || value === void 0 ? void 0 : value.map(function (v) {
|
|
98
|
-
var _this$labelDateInstan;
|
|
99
|
-
var label = ((_this$labelDateInstan = _this.labelDateInstance.labelData) === null || _this$labelDateInstan === void 0 ? void 0 : _this$labelDateInstan.find(function (item) {
|
|
100
|
-
return item.value === (v === null || v === void 0 ? void 0 : v.labelShowName);
|
|
101
|
-
})) || {};
|
|
102
|
-
if (!isNull(label)) return /*#__PURE__*/React.createElement(Tag, {
|
|
103
|
-
color: label === null || label === void 0 ? void 0 : label.color
|
|
104
|
-
}, label === null || label === void 0 ? void 0 : label.label);
|
|
105
|
-
return null;
|
|
106
|
-
}) : "--");
|
|
107
|
-
});
|
|
108
|
-
_defineProperty(this, "renderPc", function (value, record) {
|
|
109
|
-
return _this.showDetail(record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_label")]);
|
|
110
|
-
});
|
|
111
|
-
_defineProperty(this, "renderLog", function (r) {
|
|
112
|
-
return _this.renderPc(undefined, r);
|
|
113
|
-
});
|
|
114
|
-
_defineProperty(this, "renderExport", function (value, record) {
|
|
115
|
-
var _record, _record$map;
|
|
116
|
-
return record === null || record === void 0 ? void 0 : (_record = record["".concat(_this.id, "_label")]) === null || _record === void 0 ? void 0 : (_record$map = _record.map(function (item) {
|
|
117
|
-
return item === null || item === void 0 ? void 0 : item.labelShowName;
|
|
118
|
-
})) === null || _record$map === void 0 ? void 0 : _record$map.join('、');
|
|
119
|
-
});
|
|
120
|
-
_defineProperty(this, "filterConfig", function (item) {
|
|
121
|
-
return [];
|
|
122
|
-
});
|
|
123
|
-
_defineProperty(this, "formDataTransform", function (v) {
|
|
124
|
-
return v === null || v === void 0 ? void 0 : v.map(function (item) {
|
|
125
|
-
return item.labelShowName;
|
|
126
|
-
});
|
|
127
|
-
});
|
|
128
|
-
this.name = options.name;
|
|
129
|
-
this.id = options.id;
|
|
130
|
-
this.sortField = options.id;
|
|
131
|
-
this.formField = "".concat(options.id, "_label");
|
|
132
|
-
this.type = options.type;
|
|
133
|
-
this.componentConfig = options.componentConfig;
|
|
134
|
-
this.rules = [];
|
|
135
|
-
this.isCombinationComponent = false;
|
|
136
|
-
this.canSort = false;
|
|
137
|
-
this.children = [];
|
|
138
|
-
this.dataType = "array";
|
|
139
|
-
this.labelDateInstance = LabelData.getInstance();
|
|
140
|
-
this.options = this.labelDateInstance.labelData || [];
|
|
141
|
-
});
|
|
142
|
-
export default Label;
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { ComponentInterface, PickOption, ColumnConfig, Record } from "../../../type";
|
|
2
|
-
import React from "react";
|
|
3
|
-
import CommonHeaderGoods from "../../CommonHeaderGood";
|
|
4
|
-
declare class WDTExchange implements ComponentInterface {
|
|
5
|
-
name: string;
|
|
6
|
-
id: string;
|
|
7
|
-
sortField: string;
|
|
8
|
-
type: string;
|
|
9
|
-
rules: any[];
|
|
10
|
-
componentConfig: ComponentInterface["componentConfig"];
|
|
11
|
-
effects: ComponentInterface["effects"];
|
|
12
|
-
isCombinationComponent: boolean;
|
|
13
|
-
formField: string;
|
|
14
|
-
canSort: boolean;
|
|
15
|
-
children: ComponentInterface[];
|
|
16
|
-
dataType: ComponentInterface["dataType"];
|
|
17
|
-
returnGoods: CommonHeaderGoods;
|
|
18
|
-
constructor(options: PickOption);
|
|
19
|
-
renderClient: (record: any) => React.JSX.Element | null;
|
|
20
|
-
renderPc: () => null;
|
|
21
|
-
renderLog: (r: Record) => React.JSX.Element;
|
|
22
|
-
getComponentValue: (r: Record) => {
|
|
23
|
-
wdtExchangeGoods: any;
|
|
24
|
-
};
|
|
25
|
-
renderExport: (value: any, record: any) => null;
|
|
26
|
-
editRender: (p: any) => React.JSX.Element;
|
|
27
|
-
filterConfig: (item: ColumnConfig) => {
|
|
28
|
-
searchDefaultConditions: "like";
|
|
29
|
-
type: string;
|
|
30
|
-
id: string;
|
|
31
|
-
name: string;
|
|
32
|
-
filterComponentType: "Input";
|
|
33
|
-
}[];
|
|
34
|
-
}
|
|
35
|
-
export default WDTExchange;
|
|
@@ -1,183 +0,0 @@
|
|
|
1
|
-
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
4
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
5
|
-
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
6
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
7
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
8
|
-
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
9
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
10
|
-
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
11
|
-
import React from "react";
|
|
12
|
-
import GetFormItem from "../../GetFormItem";
|
|
13
|
-
import { BsGoodsTable } from "../../Common";
|
|
14
|
-
import ItemView from "../../../commonComponents/ItemView";
|
|
15
|
-
import { isNull } from "@kmkf-fe-packages/kmkf-utils";
|
|
16
|
-
import { SYMBOL } from "../../../constant";
|
|
17
|
-
// import { BsType, BsMemo } from "../../Bs/common";
|
|
18
|
-
import { CommonExchangeGoods } from "@kmkf-fe-packages/basic-components";
|
|
19
|
-
import CommonHeaderGoods from "../../CommonHeaderGood";
|
|
20
|
-
var WDTExchange = /*#__PURE__*/_createClass(
|
|
21
|
-
// wdtType: BsType;
|
|
22
|
-
// wdtMemo: BsMemo;
|
|
23
|
-
|
|
24
|
-
// swapOutGoods: BsHeaderGood;
|
|
25
|
-
// giftGoods: BsHeaderGood;
|
|
26
|
-
function WDTExchange(options) {
|
|
27
|
-
var _this = this,
|
|
28
|
-
_this$componentConfig4;
|
|
29
|
-
_classCallCheck(this, WDTExchange);
|
|
30
|
-
_defineProperty(this, "name", void 0);
|
|
31
|
-
_defineProperty(this, "id", void 0);
|
|
32
|
-
_defineProperty(this, "sortField", void 0);
|
|
33
|
-
_defineProperty(this, "type", void 0);
|
|
34
|
-
_defineProperty(this, "rules", void 0);
|
|
35
|
-
_defineProperty(this, "componentConfig", void 0);
|
|
36
|
-
_defineProperty(this, "effects", void 0);
|
|
37
|
-
_defineProperty(this, "isCombinationComponent", void 0);
|
|
38
|
-
_defineProperty(this, "formField", void 0);
|
|
39
|
-
_defineProperty(this, "canSort", void 0);
|
|
40
|
-
_defineProperty(this, "children", void 0);
|
|
41
|
-
_defineProperty(this, "dataType", void 0);
|
|
42
|
-
_defineProperty(this, "returnGoods", void 0);
|
|
43
|
-
_defineProperty(this, "renderClient", function (record) {
|
|
44
|
-
var _this$componentConfig;
|
|
45
|
-
var wdtExchangeGoods = JSON.parse((record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_wdtExchangeGoods")]) || "[]");
|
|
46
|
-
return !isNull(record === null || record === void 0 ? void 0 : record["".concat(_this.id)]) ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ItemView, {
|
|
47
|
-
id: "".concat(_this.id, "-out"),
|
|
48
|
-
label: "".concat(_this.name, "-\u6362\u51FA"),
|
|
49
|
-
value: /*#__PURE__*/React.createElement(BsGoodsTable, {
|
|
50
|
-
type: _this.type,
|
|
51
|
-
list: wdtExchangeGoods || [],
|
|
52
|
-
showHeader: ((_this$componentConfig = _this.componentConfig) === null || _this$componentConfig === void 0 ? void 0 : _this$componentConfig.showHeader) || []
|
|
53
|
-
})
|
|
54
|
-
})) : null;
|
|
55
|
-
});
|
|
56
|
-
_defineProperty(this, "renderPc", function () {
|
|
57
|
-
return null;
|
|
58
|
-
});
|
|
59
|
-
_defineProperty(this, "renderLog", function (r) {
|
|
60
|
-
var _r, _this$componentConfig2;
|
|
61
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, r !== null && r !== void 0 && (_r = r["".concat(_this.id, "_wdtExchangeGoods")]) !== null && _r !== void 0 && _r.length ? /*#__PURE__*/React.createElement("div", null, "\u6362\u51FA\u5546\u54C1\uFF1A", /*#__PURE__*/React.createElement(BsGoodsTable, {
|
|
62
|
-
type: _this.type,
|
|
63
|
-
list: (r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_wdtExchangeGoods")]) || [],
|
|
64
|
-
showHeader: ((_this$componentConfig2 = _this.componentConfig) === null || _this$componentConfig2 === void 0 ? void 0 : _this$componentConfig2.showHeader) || []
|
|
65
|
-
})) : null, r !== null && r !== void 0 && r["".concat(_this.id, "_shopCode")] ? /*#__PURE__*/React.createElement("div", null, "\u5E97\u94FAid:", r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_shopCode")]) : null);
|
|
66
|
-
});
|
|
67
|
-
_defineProperty(this, "getComponentValue", function (r) {
|
|
68
|
-
return {
|
|
69
|
-
wdtExchangeGoods: r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_wdtExchangeGoods")]
|
|
70
|
-
};
|
|
71
|
-
});
|
|
72
|
-
_defineProperty(this, "renderExport", function (value, record) {
|
|
73
|
-
return null;
|
|
74
|
-
});
|
|
75
|
-
_defineProperty(this, "editRender", function (p) {
|
|
76
|
-
var _this$componentConfig3, _this$effects, _this$effects2, _this$effects3;
|
|
77
|
-
return /*#__PURE__*/React.createElement(GetFormItem, {
|
|
78
|
-
title: _this.name,
|
|
79
|
-
name: _this.id,
|
|
80
|
-
rules: _this.rules,
|
|
81
|
-
required: false,
|
|
82
|
-
hidden: p === null || p === void 0 ? void 0 : p.hidden,
|
|
83
|
-
display: p === null || p === void 0 ? void 0 : p.display,
|
|
84
|
-
component: /*#__PURE__*/React.createElement(CommonExchangeGoods, _extends({}, _this.componentConfig, {
|
|
85
|
-
maxLength: ((_this$componentConfig3 = _this.componentConfig) === null || _this$componentConfig3 === void 0 ? void 0 : _this$componentConfig3.maxLength) || 20,
|
|
86
|
-
shopId: (_this$effects = _this.effects) === null || _this$effects === void 0 ? void 0 : _this$effects.shopId,
|
|
87
|
-
shopList: ((_this$effects2 = _this.effects) === null || _this$effects2 === void 0 ? void 0 : _this$effects2.shopList) || [],
|
|
88
|
-
companyKey: (_this$effects3 = _this.effects) === null || _this$effects3 === void 0 ? void 0 : _this$effects3.companyKey,
|
|
89
|
-
width: "90%",
|
|
90
|
-
type: "WDT_EXCHANGE_GOODS"
|
|
91
|
-
}))
|
|
92
|
-
});
|
|
93
|
-
});
|
|
94
|
-
_defineProperty(this, "filterConfig", function (item) {
|
|
95
|
-
return [{
|
|
96
|
-
searchDefaultConditions: SYMBOL.like,
|
|
97
|
-
type: item.type,
|
|
98
|
-
id: "".concat(item.id, "_wdtExchangeGoods"),
|
|
99
|
-
name: "".concat(_this.name, "-\u6362\u51FA"),
|
|
100
|
-
filterComponentType: "Input"
|
|
101
|
-
}];
|
|
102
|
-
});
|
|
103
|
-
this.name = options.name;
|
|
104
|
-
this.id = options.id;
|
|
105
|
-
this.sortField = "".concat(options.id);
|
|
106
|
-
this.formField = "".concat(options.id);
|
|
107
|
-
this.type = options.type;
|
|
108
|
-
this.effects = options === null || options === void 0 ? void 0 : options.effects;
|
|
109
|
-
this.isCombinationComponent = true;
|
|
110
|
-
this.canSort = false;
|
|
111
|
-
// this.wdtType = new BsType({
|
|
112
|
-
// ...options,
|
|
113
|
-
// id: `${options.id}_wdtExchangeType`,
|
|
114
|
-
// name: "换货类型",
|
|
115
|
-
// });
|
|
116
|
-
// this.wdtMemo = new BsMemo({
|
|
117
|
-
// ...options,
|
|
118
|
-
// id: `${options.id}_wdtExchangeType_memo`,
|
|
119
|
-
// name: "换货备注",
|
|
120
|
-
// });
|
|
121
|
-
this.returnGoods = new CommonHeaderGoods(_objectSpread(_objectSpread({}, options), {}, {
|
|
122
|
-
id: "".concat(options.id, "_wdtExchangeGoods"),
|
|
123
|
-
name: "商品信息"
|
|
124
|
-
}));
|
|
125
|
-
// this.swapOutGoods = new BsHeaderGood({
|
|
126
|
-
// ...options,
|
|
127
|
-
// id: `${options.id}_wdtExchangeSwapOutGoods`,
|
|
128
|
-
// name: "换出商品",
|
|
129
|
-
// });
|
|
130
|
-
// this.giftGoods = new BsHeaderGood({
|
|
131
|
-
// ...options,
|
|
132
|
-
// id: `${options.id}_wdtExchangeGiftGoods`,
|
|
133
|
-
// name: "赠品商品",
|
|
134
|
-
// });
|
|
135
|
-
this.children = [
|
|
136
|
-
// this.wdtType,
|
|
137
|
-
// this.wdtMemo,
|
|
138
|
-
this.returnGoods
|
|
139
|
-
// this.swapOutGoods,
|
|
140
|
-
// this.giftGoods,
|
|
141
|
-
];
|
|
142
|
-
|
|
143
|
-
this.componentConfig = options === null || options === void 0 ? void 0 : options.componentConfig;
|
|
144
|
-
this.rules = [{
|
|
145
|
-
required: (_this$componentConfig4 = this.componentConfig) === null || _this$componentConfig4 === void 0 ? void 0 : _this$componentConfig4.required,
|
|
146
|
-
validator: function validator(_, value) {
|
|
147
|
-
var _this$componentConfig5, _value$wdtExchangeGoo;
|
|
148
|
-
if ((_this$componentConfig5 = _this.componentConfig) !== null && _this$componentConfig5 !== void 0 && _this$componentConfig5.required && !(value !== null && value !== void 0 && (_value$wdtExchangeGoo = value.wdtExchangeGoods) !== null && _value$wdtExchangeGoo !== void 0 && _value$wdtExchangeGoo.length)) {
|
|
149
|
-
return Promise.reject(new Error("请选择wdt换货商品"));
|
|
150
|
-
}
|
|
151
|
-
return Promise.resolve();
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
/* {
|
|
155
|
-
validator: (_: any, value: any) => {
|
|
156
|
-
if (value && ["2", "4"].includes(value?.wdtExchangeType?.[0])) {
|
|
157
|
-
const hasNoGood = (value?.wdtExchangeGoods || []).some(
|
|
158
|
-
(item: any) => {
|
|
159
|
-
return !item?.wdtExchangeGoods.length;
|
|
160
|
-
}
|
|
161
|
-
);
|
|
162
|
-
if (hasNoGood) {
|
|
163
|
-
return Promise.reject(new Error("请选择退回商品后再提交工单"));
|
|
164
|
-
}
|
|
165
|
-
const hasLen = (value?.wdtExchangeGoods || []).some(
|
|
166
|
-
(item: any) => {
|
|
167
|
-
return (
|
|
168
|
-
item?.wdtExchangeGoods.length !==
|
|
169
|
-
item?.wdtExchangeSwapOutGoods.length
|
|
170
|
-
);
|
|
171
|
-
}
|
|
172
|
-
);
|
|
173
|
-
if (hasLen) {
|
|
174
|
-
return Promise.reject(new Error("请核对商品数据,再提交工单"));
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
return Promise.resolve();
|
|
178
|
-
},
|
|
179
|
-
},*/];
|
|
180
|
-
|
|
181
|
-
this.dataType = "object";
|
|
182
|
-
});
|
|
183
|
-
export default WDTExchange;
|