@kmkf-fe-packages/services-components 0.7.15-alpha.6 → 0.7.15-alpha.60
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.js +23 -21
- package/dist/esm/commonComponents/ShopList/index.d.ts +1 -1
- package/dist/esm/commonComponents/ShopList/index.js +4 -2
- package/dist/esm/components/ActualPayment/index.d.ts +4 -4
- package/dist/esm/components/ActualPayment/index.js +24 -21
- package/dist/esm/components/BS/BsExchange/index.d.ts +14 -11
- package/dist/esm/components/BS/BsExchange/index.js +219 -126
- package/dist/esm/components/BS/BsGoods/index.d.ts +9 -9
- package/dist/esm/components/BS/BsGoods/index.js +82 -60
- package/dist/esm/components/BS/BsLogistics/index.d.ts +7 -7
- package/dist/esm/components/BS/BsLogistics/index.js +14 -14
- package/dist/esm/components/BS/BsReissue/index.d.ts +16 -6
- package/dist/esm/components/BS/BsReissue/index.js +103 -54
- package/dist/esm/components/BS/common/{BsChildCode.d.ts → BsHeaderCode.d.ts} +5 -4
- package/dist/esm/components/BS/common/{BsChildCode.js → BsHeaderCode.js} +27 -11
- package/dist/esm/components/BS/common/{BsChildMoney.d.ts → BsHeaderMoney.d.ts} +5 -4
- package/dist/esm/components/BS/common/{BsChildMoney.js → BsHeaderMoney.js} +27 -11
- package/dist/esm/components/BS/common/{BsChildName.d.ts → BsHeaderName.d.ts} +5 -4
- package/dist/esm/components/BS/common/{BsChildName.js → BsHeaderName.js} +28 -11
- package/dist/esm/components/BS/common/{BsChildNumber.d.ts → BsHeaderNumber.d.ts} +5 -4
- package/dist/esm/components/BS/common/{BsChildNumber.js → BsHeaderNumber.js} +27 -11
- package/dist/esm/components/BS/common/{BsChildPic.d.ts → BsHeaderPic.d.ts} +5 -4
- package/dist/esm/components/BS/common/{BsChildPic.js → BsHeaderPic.js} +26 -10
- package/dist/esm/components/BS/common/{BsChildShare.d.ts → BsHeaderShare.d.ts} +5 -4
- package/dist/esm/components/BS/common/{BsChildShare.js → BsHeaderShare.js} +27 -11
- package/dist/esm/components/BS/common/{BsChildSku.d.ts → BsHeaderSku.d.ts} +5 -4
- package/dist/esm/components/BS/common/{BsChildSku.js → BsHeaderSku.js} +27 -11
- package/dist/esm/components/BS/common/{BsChildType.d.ts → BsHeaderType.d.ts} +5 -4
- package/dist/esm/components/BS/common/{BsChildType.js → BsHeaderType.js} +27 -11
- package/dist/esm/components/BS/common/BsMemo.d.ts +8 -7
- package/dist/esm/components/BS/common/BsMemo.js +55 -21
- package/dist/esm/components/BS/common/BsType.d.ts +8 -6
- package/dist/esm/components/BS/common/BsType.js +53 -17
- package/dist/esm/components/BS/common/index.d.ts +10 -10
- package/dist/esm/components/BS/common/index.js +8 -8
- package/dist/esm/components/Cascader/index.d.ts +1 -0
- package/dist/esm/components/Cascader/index.js +3 -1
- package/dist/esm/components/Common/index.d.ts +7 -2
- package/dist/esm/components/Common/index.js +175 -77
- package/dist/esm/components/DataTime/ApaasDate.d.ts +2 -2
- package/dist/esm/components/EItemEnCode/ItemEncode.d.ts +2 -2
- package/dist/esm/components/EItemId/ItemId.d.ts +2 -2
- package/dist/esm/components/EItemSelect/ItemSelect.d.ts +2 -2
- package/dist/esm/components/ExpressCompany/index.d.ts +2 -2
- package/dist/esm/components/File/index.d.ts +4 -4
- package/dist/esm/components/File/index.js +29 -9
- package/dist/esm/components/FlowStatusSelect/index.d.ts +0 -1
- package/dist/esm/components/FlowStatusSelect/index.js +30 -24
- package/dist/esm/components/FlowWorkOrderId/index.d.ts +33 -0
- package/dist/esm/components/FlowWorkOrderId/index.js +107 -0
- package/dist/esm/components/JST/JstLogistics/index.d.ts +11 -5
- package/dist/esm/components/JST/JstLogistics/index.js +49 -21
- package/dist/esm/components/JST/JstSendGood/index.d.ts +10 -4
- package/dist/esm/components/JST/JstSendGood/index.js +27 -17
- package/dist/esm/components/LogisticsTrajectory/index.d.ts +8 -9
- package/dist/esm/components/LogisticsTrajectory/index.js +12 -10
- package/dist/esm/components/LogisticsTrajectory/trajectoryCode.js +6 -5
- package/dist/esm/components/LogisticsTrajectory/trajectoryCompany.d.ts +6 -6
- package/dist/esm/components/LogisticsTrajectory/trajectoryCompany.js +8 -8
- package/dist/esm/components/LogisticsTrajectory/trajectorySnapshot.d.ts +0 -1
- package/dist/esm/components/LogisticsTrajectory/trajectorySnapshot.js +4 -10
- package/dist/esm/components/Payment/BuyerNick.js +1 -2
- package/dist/esm/components/Payment/index.d.ts +1 -0
- package/dist/esm/components/Payment/index.js +9 -6
- package/dist/esm/components/Popover/index.d.ts +2 -2
- package/dist/esm/components/PostIng/index.d.ts +6 -29
- package/dist/esm/components/PostIng/index.js +73 -77
- package/dist/esm/components/ThirdItemSelect/ItemEncode.d.ts +2 -2
- package/dist/esm/components/TradeDateTime/index.d.ts +1 -9
- package/dist/esm/components/TradeDateTime/index.js +6 -1
- package/dist/esm/factory.d.ts +2 -2
- package/dist/esm/factory.js +6 -3
- package/dist/esm/index.d.ts +1 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/type.d.ts +22 -14
- package/package.json +4 -4
- package/dist/esm/components/BS/common/BsExchangeImage.d.ts +0 -31
- package/dist/esm/components/BS/common/BsExchangeImage.js +0 -126
- package/dist/esm/components/BS/common/BsGoodImage.d.ts +0 -31
- package/dist/esm/components/BS/common/BsGoodImage.js +0 -88
|
@@ -8,16 +8,60 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
|
|
|
8
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
9
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
10
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
|
|
11
|
+
import React from 'react';
|
|
12
12
|
import GetFormItem from "../../GetFormItem";
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import
|
|
16
|
-
import {
|
|
13
|
+
import { BsGoodsTable } from "../../Common";
|
|
14
|
+
import { BsHeaderPic, BsHeaderName, BsHeaderCode, BsHeaderSku, BsHeaderMoney, BsHeaderNumber, BsHeaderShare, BsHeaderType } from "../common/index";
|
|
15
|
+
import ItemView from "../../../commonComponents/ItemView";
|
|
16
|
+
import { isNull } from '@kmkf-fe-packages/kmkf-utils';
|
|
17
|
+
import { BsGoods as Goods } from '@kmkf-fe-packages/basic-components';
|
|
17
18
|
import { SYMBOL } from "../../../constant";
|
|
19
|
+
var childHeaderMap = {
|
|
20
|
+
pic: {
|
|
21
|
+
component: BsHeaderPic,
|
|
22
|
+
name: '图片',
|
|
23
|
+
key: 'pic'
|
|
24
|
+
},
|
|
25
|
+
name: {
|
|
26
|
+
component: BsHeaderName,
|
|
27
|
+
name: '名称',
|
|
28
|
+
key: 'name'
|
|
29
|
+
},
|
|
30
|
+
code: {
|
|
31
|
+
component: BsHeaderCode,
|
|
32
|
+
name: '编码',
|
|
33
|
+
key: 'code'
|
|
34
|
+
},
|
|
35
|
+
sku: {
|
|
36
|
+
component: BsHeaderSku,
|
|
37
|
+
name: 'sku编码',
|
|
38
|
+
key: 'sku'
|
|
39
|
+
},
|
|
40
|
+
money: {
|
|
41
|
+
component: BsHeaderMoney,
|
|
42
|
+
name: '实付金额',
|
|
43
|
+
key: 'money'
|
|
44
|
+
},
|
|
45
|
+
number: {
|
|
46
|
+
component: BsHeaderNumber,
|
|
47
|
+
name: '数量',
|
|
48
|
+
key: 'number'
|
|
49
|
+
},
|
|
50
|
+
share: {
|
|
51
|
+
component: BsHeaderShare,
|
|
52
|
+
name: '分摊价',
|
|
53
|
+
key: 'share'
|
|
54
|
+
},
|
|
55
|
+
type: {
|
|
56
|
+
component: BsHeaderType,
|
|
57
|
+
name: '赠品类型',
|
|
58
|
+
key: 'giftType'
|
|
59
|
+
}
|
|
60
|
+
};
|
|
18
61
|
var BsGoods = /*#__PURE__*/_createClass(function BsGoods(options) {
|
|
19
62
|
var _this = this,
|
|
20
|
-
|
|
63
|
+
_options$componentCon,
|
|
64
|
+
_this$componentConfig3;
|
|
21
65
|
_classCallCheck(this, BsGoods);
|
|
22
66
|
_defineProperty(this, "name", void 0);
|
|
23
67
|
_defineProperty(this, "id", void 0);
|
|
@@ -32,28 +76,21 @@ var BsGoods = /*#__PURE__*/_createClass(function BsGoods(options) {
|
|
|
32
76
|
_defineProperty(this, "children", void 0);
|
|
33
77
|
_defineProperty(this, "dataType", void 0);
|
|
34
78
|
_defineProperty(this, "renderClient", function (record) {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
79
|
+
var _record, _this$componentConfig;
|
|
80
|
+
return !isNull(record === null || record === void 0 ? void 0 : record["".concat(_this.id)]) ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ItemView, {
|
|
81
|
+
id: _this.id,
|
|
82
|
+
label: _this.name,
|
|
83
|
+
value: /*#__PURE__*/React.createElement(BsGoodsTable, {
|
|
84
|
+
list: (record === null || record === void 0 ? void 0 : (_record = record["".concat(_this.id)]) === null || _record === void 0 ? void 0 : _record.bsGoods) || [],
|
|
85
|
+
showHeader: ((_this$componentConfig = _this.componentConfig) === null || _this$componentConfig === void 0 ? void 0 : _this$componentConfig.showHeader) || []
|
|
86
|
+
})
|
|
87
|
+
})) : null;
|
|
41
88
|
});
|
|
42
|
-
_defineProperty(this, "renderPc", function (
|
|
43
|
-
|
|
44
|
-
return /*#__PURE__*/React.createElement("span", null, "--");
|
|
45
|
-
}
|
|
46
|
-
//兼容多个商品
|
|
47
|
-
return record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_bsGoods")].map(function (item, index) {
|
|
48
|
-
return /*#__PURE__*/React.createElement(BsGoodImage, {
|
|
49
|
-
item: item,
|
|
50
|
-
index: index
|
|
51
|
-
});
|
|
52
|
-
});
|
|
89
|
+
_defineProperty(this, "renderPc", function () {
|
|
90
|
+
return null;
|
|
53
91
|
});
|
|
54
92
|
_defineProperty(this, "renderLog", function (r) {
|
|
55
|
-
|
|
56
|
-
return _this.renderPc(undefined, r);
|
|
93
|
+
return null;
|
|
57
94
|
});
|
|
58
95
|
_defineProperty(this, "getComponentValue", function (r) {
|
|
59
96
|
return r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_bsGoods")];
|
|
@@ -62,7 +99,7 @@ var BsGoods = /*#__PURE__*/_createClass(function BsGoods(options) {
|
|
|
62
99
|
return null;
|
|
63
100
|
});
|
|
64
101
|
_defineProperty(this, "editRender", function (p) {
|
|
65
|
-
var _this$
|
|
102
|
+
var _this$componentConfig2, _this$effects, _this$effects2;
|
|
66
103
|
return /*#__PURE__*/React.createElement(GetFormItem, {
|
|
67
104
|
title: _this.name,
|
|
68
105
|
name: _this.id,
|
|
@@ -70,7 +107,7 @@ var BsGoods = /*#__PURE__*/_createClass(function BsGoods(options) {
|
|
|
70
107
|
required: false,
|
|
71
108
|
hidden: p === null || p === void 0 ? void 0 : p.hidden,
|
|
72
109
|
component: /*#__PURE__*/React.createElement(Goods, _extends({}, _this.componentConfig, {
|
|
73
|
-
maxLength: ((_this$
|
|
110
|
+
maxLength: ((_this$componentConfig2 = _this.componentConfig) === null || _this$componentConfig2 === void 0 ? void 0 : _this$componentConfig2.maxLength) || 20,
|
|
74
111
|
shopId: (_this$effects = _this.effects) === null || _this$effects === void 0 ? void 0 : _this$effects.shopId,
|
|
75
112
|
shopList: ((_this$effects2 = _this.effects) === null || _this$effects2 === void 0 ? void 0 : _this$effects2.shopList) || [],
|
|
76
113
|
width: "90%"
|
|
@@ -78,15 +115,15 @@ var BsGoods = /*#__PURE__*/_createClass(function BsGoods(options) {
|
|
|
78
115
|
});
|
|
79
116
|
});
|
|
80
117
|
_defineProperty(this, "filterConfig", function (item) {
|
|
81
|
-
return {
|
|
118
|
+
return [{
|
|
82
119
|
searchDefaultConditions: SYMBOL.like,
|
|
83
120
|
type: item.type,
|
|
84
121
|
id: "".concat(item.id, "_bsGoods"),
|
|
85
122
|
// 过滤组件id
|
|
86
123
|
name: item.name,
|
|
87
124
|
// 过滤组件名称
|
|
88
|
-
filterComponentType:
|
|
89
|
-
};
|
|
125
|
+
filterComponentType: 'Input'
|
|
126
|
+
}];
|
|
90
127
|
});
|
|
91
128
|
this.name = options.name;
|
|
92
129
|
this.id = options.id;
|
|
@@ -94,43 +131,28 @@ var BsGoods = /*#__PURE__*/_createClass(function BsGoods(options) {
|
|
|
94
131
|
this.formField = "".concat(options.id, "_bsGoods");
|
|
95
132
|
this.type = options.type;
|
|
96
133
|
this.effects = options === null || options === void 0 ? void 0 : options.effects;
|
|
97
|
-
this.isCombinationComponent =
|
|
134
|
+
this.isCombinationComponent = true;
|
|
98
135
|
this.canSort = false;
|
|
99
|
-
this.children =
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
})), new BsChildSku(_objectSpread(_objectSpread({}, options), {}, {
|
|
109
|
-
name: "sku编码",
|
|
110
|
-
id: "".concat(options.id, "_bsGoods")
|
|
111
|
-
})), new BsChildMoney(_objectSpread(_objectSpread({}, options), {}, {
|
|
112
|
-
name: "实付金额",
|
|
113
|
-
id: "".concat(options.id, "_bsGoods")
|
|
114
|
-
})), new BsChildNumber(_objectSpread(_objectSpread({}, options), {}, {
|
|
115
|
-
name: "数量",
|
|
116
|
-
id: "".concat(options.id, "_bsGoods")
|
|
117
|
-
})), new BsChildShare(_objectSpread(_objectSpread({}, options), {}, {
|
|
118
|
-
name: "分摊价",
|
|
119
|
-
id: "".concat(options.id, "_bsGoods")
|
|
120
|
-
})), new BsChildType(_objectSpread(_objectSpread({}, options), {}, {
|
|
121
|
-
name: "赠品类型",
|
|
122
|
-
id: "".concat(options.id, "_bsGoods")
|
|
123
|
-
}))];
|
|
136
|
+
this.children = ((options === null || options === void 0 ? void 0 : (_options$componentCon = options.componentConfig) === null || _options$componentCon === void 0 ? void 0 : _options$componentCon.showHeader) || []).reduce(function (prv, next) {
|
|
137
|
+
if (childHeaderMap[next]) {
|
|
138
|
+
prv.push(new childHeaderMap[next].component(_objectSpread(_objectSpread({}, options), {}, {
|
|
139
|
+
name: childHeaderMap[next].name,
|
|
140
|
+
id: "".concat(options.id, "_bsGoods_").concat(childHeaderMap[next].key)
|
|
141
|
+
})));
|
|
142
|
+
}
|
|
143
|
+
return prv;
|
|
144
|
+
}, []);
|
|
124
145
|
this.componentConfig = options === null || options === void 0 ? void 0 : options.componentConfig;
|
|
125
|
-
this.rules = this !== null && this !== void 0 && (_this$
|
|
146
|
+
this.rules = this !== null && this !== void 0 && (_this$componentConfig3 = this.componentConfig) !== null && _this$componentConfig3 !== void 0 && _this$componentConfig3.required ? [{
|
|
126
147
|
required: true,
|
|
127
148
|
validator: function validator(_, value) {
|
|
128
|
-
|
|
129
|
-
|
|
149
|
+
var _value$bsGoods;
|
|
150
|
+
if (!value || !(value !== null && value !== void 0 && (_value$bsGoods = value.bsGoods) !== null && _value$bsGoods !== void 0 && _value$bsGoods.length)) {
|
|
151
|
+
return Promise.reject(new Error('请选择bs商品'));
|
|
130
152
|
}
|
|
131
153
|
return Promise.resolve();
|
|
132
154
|
}
|
|
133
155
|
}] : [];
|
|
134
|
-
this.dataType =
|
|
156
|
+
this.dataType = 'object';
|
|
135
157
|
});
|
|
136
158
|
export default BsGoods;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { ComponentInterface, PickOption, ColumnConfig, Record } from
|
|
2
|
-
import React from
|
|
3
|
-
import { ExpressData } from
|
|
4
|
-
import Express from
|
|
5
|
-
import ExpressCode from
|
|
1
|
+
import { ComponentInterface, PickOption, ColumnConfig, Record } from '../../../type';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { ExpressData } from '@kmkf-fe-packages/kmkf-utils';
|
|
4
|
+
import Express from '../../Express';
|
|
5
|
+
import ExpressCode from '../../ExpressCode';
|
|
6
6
|
declare class BsLogistics implements ComponentInterface {
|
|
7
7
|
name: string;
|
|
8
8
|
id: string;
|
|
9
9
|
sortField: string;
|
|
10
10
|
type: string;
|
|
11
11
|
rules: any[];
|
|
12
|
-
componentConfig: ComponentInterface[
|
|
12
|
+
componentConfig: ComponentInterface['componentConfig'];
|
|
13
13
|
expressDateInstance: InstanceType<typeof ExpressData>;
|
|
14
14
|
express: Express;
|
|
15
15
|
expressCode: ExpressCode;
|
|
@@ -17,7 +17,7 @@ declare class BsLogistics implements ComponentInterface {
|
|
|
17
17
|
formField: string;
|
|
18
18
|
canSort: boolean;
|
|
19
19
|
children: ComponentInterface[];
|
|
20
|
-
dataType: ComponentInterface[
|
|
20
|
+
dataType: ComponentInterface['dataType'];
|
|
21
21
|
constructor(options: PickOption);
|
|
22
22
|
editRender: (p: any) => React.JSX.Element;
|
|
23
23
|
renderClient: (record: Record) => React.JSX.Element;
|
|
@@ -8,9 +8,9 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
|
|
|
8
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
9
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
10
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
|
|
12
|
-
import { ExpressData } from
|
|
13
|
-
import { ExpressLogistics } from
|
|
11
|
+
import React from 'react';
|
|
12
|
+
import { ExpressData } from '@kmkf-fe-packages/kmkf-utils';
|
|
13
|
+
import { ExpressLogistics } from '@kmkf-fe-packages/basic-components';
|
|
14
14
|
import Express from "../../Express";
|
|
15
15
|
import ExpressCode from "../../ExpressCode";
|
|
16
16
|
import GetFormItem from "../../GetFormItem";
|
|
@@ -66,9 +66,9 @@ var BsLogistics = /*#__PURE__*/_createClass(function BsLogistics(options) {
|
|
|
66
66
|
});
|
|
67
67
|
_defineProperty(this, "filterConfig", function (item) {
|
|
68
68
|
return [_this.express.filterConfig(_objectSpread(_objectSpread({}, item), {}, {
|
|
69
|
-
subKey:
|
|
69
|
+
subKey: 'bsLogisticsCompany'
|
|
70
70
|
})), _this.expressCode.filterConfig(_objectSpread(_objectSpread({}, item), {}, {
|
|
71
|
-
subKey:
|
|
71
|
+
subKey: 'bsLogisticsCode'
|
|
72
72
|
}))];
|
|
73
73
|
});
|
|
74
74
|
this.name = options.name;
|
|
@@ -79,33 +79,33 @@ var BsLogistics = /*#__PURE__*/_createClass(function BsLogistics(options) {
|
|
|
79
79
|
this.componentConfig = options.componentConfig;
|
|
80
80
|
this.expressDateInstance = ExpressData.getInstance();
|
|
81
81
|
this.express = new Express(_objectSpread(_objectSpread({}, options), {}, {
|
|
82
|
-
name:
|
|
82
|
+
name: '快递物流公司',
|
|
83
83
|
id: "".concat(this.id, "_bsLogisticsCompany")
|
|
84
84
|
}));
|
|
85
85
|
this.expressCode = new ExpressCode(_objectSpread(_objectSpread({}, options), {}, {
|
|
86
|
-
name:
|
|
86
|
+
name: '快递物流单号',
|
|
87
87
|
id: "".concat(this.id, "_bsLogisticsCode")
|
|
88
88
|
}));
|
|
89
89
|
this.isCombinationComponent = true;
|
|
90
90
|
this.canSort = false;
|
|
91
|
-
this.dataType =
|
|
91
|
+
this.dataType = 'object';
|
|
92
92
|
this.children = [this.express, this.expressCode];
|
|
93
93
|
this.rules = (_this$componentConfig3 = this.componentConfig) !== null && _this$componentConfig3 !== void 0 && _this$componentConfig3.required ? [{
|
|
94
94
|
validator: function validator(_, value) {
|
|
95
95
|
var _this$componentConfig4;
|
|
96
96
|
if ((_this$componentConfig4 = _this.componentConfig) !== null && _this$componentConfig4 !== void 0 && _this$componentConfig4.isSingle) {
|
|
97
97
|
var _this$componentConfig5, _this$componentConfig6;
|
|
98
|
-
if (((_this$componentConfig5 = _this.componentConfig) === null || _this$componentConfig5 === void 0 ? void 0 : _this$componentConfig5.
|
|
99
|
-
return Promise.reject(new Error(
|
|
100
|
-
} else if (((_this$componentConfig6 = _this.componentConfig) === null || _this$componentConfig6 === void 0 ? void 0 : _this$componentConfig6.
|
|
101
|
-
return Promise.reject(new Error(
|
|
98
|
+
if (((_this$componentConfig5 = _this.componentConfig) === null || _this$componentConfig5 === void 0 ? void 0 : _this$componentConfig5.showHeader) === 'EXPRESS_COMPANY' && !(value !== null && value !== void 0 && value.company)) {
|
|
99
|
+
return Promise.reject(new Error('请选择物流公司'));
|
|
100
|
+
} else if (((_this$componentConfig6 = _this.componentConfig) === null || _this$componentConfig6 === void 0 ? void 0 : _this$componentConfig6.showHeader) === 'EXPRESS_WAYBILL_CODE' && !(value !== null && value !== void 0 && value.order)) {
|
|
101
|
+
return Promise.reject(new Error('请输入物流单号'));
|
|
102
102
|
}
|
|
103
103
|
} else {
|
|
104
104
|
if (!(value !== null && value !== void 0 && value.company)) {
|
|
105
|
-
return Promise.reject(new Error(
|
|
105
|
+
return Promise.reject(new Error('请选择物流公司'));
|
|
106
106
|
}
|
|
107
107
|
if (!(value !== null && value !== void 0 && value.order)) {
|
|
108
|
-
return Promise.reject(new Error(
|
|
108
|
+
return Promise.reject(new Error('请输入物流单号'));
|
|
109
109
|
}
|
|
110
110
|
}
|
|
111
111
|
return Promise.resolve();
|
|
@@ -1,18 +1,21 @@
|
|
|
1
|
-
import { ComponentInterface, PickOption, ColumnConfig, Record } from
|
|
2
|
-
import React from
|
|
1
|
+
import { ComponentInterface, PickOption, ColumnConfig, Record } from '../../../type';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { BsType, BsMemo } from '../common/index';
|
|
3
4
|
declare class BsReissue implements ComponentInterface {
|
|
4
5
|
name: string;
|
|
5
6
|
id: string;
|
|
6
7
|
sortField: string;
|
|
7
8
|
type: string;
|
|
8
9
|
rules: any[];
|
|
9
|
-
componentConfig: ComponentInterface[
|
|
10
|
-
effects: ComponentInterface[
|
|
10
|
+
componentConfig: ComponentInterface['componentConfig'];
|
|
11
|
+
effects: ComponentInterface['effects'];
|
|
11
12
|
isCombinationComponent: boolean;
|
|
12
13
|
formField: string;
|
|
13
14
|
canSort: boolean;
|
|
14
15
|
children: ComponentInterface[];
|
|
15
|
-
dataType: ComponentInterface[
|
|
16
|
+
dataType: ComponentInterface['dataType'];
|
|
17
|
+
bsType: BsType;
|
|
18
|
+
bsMemo: BsMemo;
|
|
16
19
|
constructor(options: PickOption);
|
|
17
20
|
renderClient: (record: any) => React.JSX.Element | null;
|
|
18
21
|
renderPc: () => null;
|
|
@@ -21,14 +24,20 @@ declare class BsReissue implements ComponentInterface {
|
|
|
21
24
|
renderExport: () => null;
|
|
22
25
|
editRender: (p: any) => React.JSX.Element;
|
|
23
26
|
filterConfig: (item: ColumnConfig) => ({
|
|
24
|
-
searchDefaultConditions: "
|
|
27
|
+
searchDefaultConditions: "in";
|
|
25
28
|
type: string;
|
|
26
29
|
id: string;
|
|
27
30
|
name: string;
|
|
28
31
|
filterComponentType: "Cascader";
|
|
29
32
|
props: {
|
|
30
33
|
options: any[] | undefined;
|
|
34
|
+
fieldNames: {
|
|
35
|
+
label: string;
|
|
36
|
+
value: string;
|
|
37
|
+
children: string;
|
|
38
|
+
};
|
|
31
39
|
};
|
|
40
|
+
formatFilterValue: (val: Array<string>) => string[] | undefined;
|
|
32
41
|
filterFn: (value: string) => (i: Record) => boolean;
|
|
33
42
|
} | {
|
|
34
43
|
searchDefaultConditions: "like";
|
|
@@ -37,6 +46,7 @@ declare class BsReissue implements ComponentInterface {
|
|
|
37
46
|
name: string;
|
|
38
47
|
filterComponentType: "Input";
|
|
39
48
|
props?: undefined;
|
|
49
|
+
formatFilterValue?: undefined;
|
|
40
50
|
filterFn?: undefined;
|
|
41
51
|
})[];
|
|
42
52
|
}
|
|
@@ -1,4 +1,10 @@
|
|
|
1
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 _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
3
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
4
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
5
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
6
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
7
|
+
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; }
|
|
2
8
|
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
9
|
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
10
|
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); }
|
|
@@ -8,17 +14,60 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
|
|
|
8
14
|
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
15
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
10
16
|
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
|
|
17
|
+
import React from 'react';
|
|
12
18
|
import GetFormItem from "../../GetFormItem";
|
|
13
|
-
import { GoodImage } from "../../Common";
|
|
14
19
|
import ItemView from "../../../commonComponents/ItemView";
|
|
15
|
-
import { isNull, filterFn as _filterFn } from
|
|
16
|
-
import { BsReissue as Reissue } from
|
|
20
|
+
import { isNull, filterFn as _filterFn } from '@kmkf-fe-packages/kmkf-utils';
|
|
21
|
+
import { BsReissue as Reissue } from '@kmkf-fe-packages/basic-components';
|
|
17
22
|
import { SYMBOL } from "../../../constant";
|
|
18
|
-
import {
|
|
23
|
+
import { BsGoodsTable } from "../../Common";
|
|
24
|
+
import { BsType, BsMemo, BsHeaderPic, BsHeaderName, BsHeaderCode, BsHeaderSku, BsHeaderMoney, BsHeaderNumber, BsHeaderShare, BsHeaderType } from "../common/index";
|
|
25
|
+
var childHeaderMap = {
|
|
26
|
+
pic: {
|
|
27
|
+
component: BsHeaderPic,
|
|
28
|
+
name: '图片',
|
|
29
|
+
key: 'pic'
|
|
30
|
+
},
|
|
31
|
+
name: {
|
|
32
|
+
component: BsHeaderName,
|
|
33
|
+
name: '名称',
|
|
34
|
+
key: 'name'
|
|
35
|
+
},
|
|
36
|
+
code: {
|
|
37
|
+
component: BsHeaderCode,
|
|
38
|
+
name: '编码',
|
|
39
|
+
key: 'code'
|
|
40
|
+
},
|
|
41
|
+
sku: {
|
|
42
|
+
component: BsHeaderSku,
|
|
43
|
+
name: 'sku编码',
|
|
44
|
+
key: 'sku'
|
|
45
|
+
},
|
|
46
|
+
money: {
|
|
47
|
+
component: BsHeaderMoney,
|
|
48
|
+
name: '实付金额',
|
|
49
|
+
key: 'money'
|
|
50
|
+
},
|
|
51
|
+
number: {
|
|
52
|
+
component: BsHeaderNumber,
|
|
53
|
+
name: '数量',
|
|
54
|
+
key: 'number'
|
|
55
|
+
},
|
|
56
|
+
share: {
|
|
57
|
+
component: BsHeaderShare,
|
|
58
|
+
name: '分摊价',
|
|
59
|
+
key: 'share'
|
|
60
|
+
},
|
|
61
|
+
type: {
|
|
62
|
+
component: BsHeaderType,
|
|
63
|
+
name: '赠品类型',
|
|
64
|
+
key: 'giftType'
|
|
65
|
+
}
|
|
66
|
+
};
|
|
19
67
|
var BsReissue = /*#__PURE__*/_createClass(function BsReissue(options) {
|
|
20
68
|
var _this = this,
|
|
21
|
-
|
|
69
|
+
_options$componentCon,
|
|
70
|
+
_this$componentConfig3;
|
|
22
71
|
_classCallCheck(this, BsReissue);
|
|
23
72
|
_defineProperty(this, "name", void 0);
|
|
24
73
|
_defineProperty(this, "id", void 0);
|
|
@@ -32,15 +81,19 @@ var BsReissue = /*#__PURE__*/_createClass(function BsReissue(options) {
|
|
|
32
81
|
_defineProperty(this, "canSort", void 0);
|
|
33
82
|
_defineProperty(this, "children", void 0);
|
|
34
83
|
_defineProperty(this, "dataType", void 0);
|
|
84
|
+
_defineProperty(this, "bsType", void 0);
|
|
85
|
+
_defineProperty(this, "bsMemo", void 0);
|
|
35
86
|
_defineProperty(this, "renderClient", function (record) {
|
|
36
|
-
|
|
87
|
+
var _this$componentConfig;
|
|
88
|
+
console.log('bsreissue', record);
|
|
89
|
+
return !isNull(record === null || record === void 0 ? void 0 : record["".concat(_this.id)]) ? /*#__PURE__*/React.createElement(React.Fragment, null, _this.bsType.renderClient(record), _this.bsMemo.renderClient(record), /*#__PURE__*/React.createElement(ItemView, {
|
|
37
90
|
id: _this.id,
|
|
38
91
|
label: _this.name,
|
|
39
|
-
value: /*#__PURE__*/React.createElement(
|
|
40
|
-
list: record === null || record === void 0 ? void 0 : record[_this.id],
|
|
41
|
-
|
|
92
|
+
value: /*#__PURE__*/React.createElement(BsGoodsTable, {
|
|
93
|
+
list: (record === null || record === void 0 ? void 0 : record["".concat(_this.id)].bsReissueGoods) || [],
|
|
94
|
+
showHeader: ((_this$componentConfig = _this.componentConfig) === null || _this$componentConfig === void 0 ? void 0 : _this$componentConfig.showHeader) || []
|
|
42
95
|
})
|
|
43
|
-
}) : null;
|
|
96
|
+
})) : null;
|
|
44
97
|
});
|
|
45
98
|
_defineProperty(this, "renderPc", function () {
|
|
46
99
|
return null;
|
|
@@ -55,7 +108,7 @@ var BsReissue = /*#__PURE__*/_createClass(function BsReissue(options) {
|
|
|
55
108
|
return null;
|
|
56
109
|
});
|
|
57
110
|
_defineProperty(this, "editRender", function (p) {
|
|
58
|
-
var _this$
|
|
111
|
+
var _this$componentConfig2, _this$effects, _this$effects2;
|
|
59
112
|
return /*#__PURE__*/React.createElement(GetFormItem, {
|
|
60
113
|
title: _this.name,
|
|
61
114
|
name: _this.id,
|
|
@@ -63,7 +116,7 @@ var BsReissue = /*#__PURE__*/_createClass(function BsReissue(options) {
|
|
|
63
116
|
required: false,
|
|
64
117
|
hidden: p === null || p === void 0 ? void 0 : p.hidden,
|
|
65
118
|
component: /*#__PURE__*/React.createElement(Reissue, _extends({}, _this.componentConfig, {
|
|
66
|
-
maxLength: ((_this$
|
|
119
|
+
maxLength: ((_this$componentConfig2 = _this.componentConfig) === null || _this$componentConfig2 === void 0 ? void 0 : _this$componentConfig2.maxLength) || 20,
|
|
67
120
|
shopId: (_this$effects = _this.effects) === null || _this$effects === void 0 ? void 0 : _this$effects.shopId,
|
|
68
121
|
shopList: ((_this$effects2 = _this.effects) === null || _this$effects2 === void 0 ? void 0 : _this$effects2.shopList) || [],
|
|
69
122
|
width: "90%"
|
|
@@ -71,15 +124,25 @@ var BsReissue = /*#__PURE__*/_createClass(function BsReissue(options) {
|
|
|
71
124
|
});
|
|
72
125
|
});
|
|
73
126
|
_defineProperty(this, "filterConfig", function (item) {
|
|
74
|
-
var _item$
|
|
127
|
+
var _item$templateConfig;
|
|
75
128
|
return [{
|
|
76
|
-
searchDefaultConditions: SYMBOL.
|
|
129
|
+
searchDefaultConditions: SYMBOL.in,
|
|
77
130
|
type: item.type,
|
|
78
131
|
id: "".concat(item.id, "_bsReissueType"),
|
|
79
|
-
name: "".concat(item.name, "-\
|
|
80
|
-
filterComponentType:
|
|
132
|
+
name: "".concat(item.name, "-\u8865\u53D1\u7C7B\u578B"),
|
|
133
|
+
filterComponentType: 'Cascader',
|
|
81
134
|
props: {
|
|
82
|
-
options: item === null || item === void 0 ? void 0 : (_item$
|
|
135
|
+
options: item === null || item === void 0 ? void 0 : (_item$templateConfig = item.templateConfig) === null || _item$templateConfig === void 0 ? void 0 : _item$templateConfig.reasonList,
|
|
136
|
+
fieldNames: {
|
|
137
|
+
label: 'label',
|
|
138
|
+
value: 'value',
|
|
139
|
+
children: 'children'
|
|
140
|
+
}
|
|
141
|
+
},
|
|
142
|
+
formatFilterValue: function formatFilterValue(val) {
|
|
143
|
+
if ((val === null || val === void 0 ? void 0 : val.length) > 0) {
|
|
144
|
+
return [val[val.length - 1]];
|
|
145
|
+
}
|
|
83
146
|
},
|
|
84
147
|
filterFn: function filterFn(value) {
|
|
85
148
|
return function (i) {
|
|
@@ -91,7 +154,7 @@ var BsReissue = /*#__PURE__*/_createClass(function BsReissue(options) {
|
|
|
91
154
|
type: item.type,
|
|
92
155
|
id: "".concat(item.id, "_bsReissueGoods"),
|
|
93
156
|
name: "".concat(_this.name),
|
|
94
|
-
filterComponentType:
|
|
157
|
+
filterComponentType: 'Input'
|
|
95
158
|
}];
|
|
96
159
|
});
|
|
97
160
|
this.name = options.name;
|
|
@@ -100,50 +163,36 @@ var BsReissue = /*#__PURE__*/_createClass(function BsReissue(options) {
|
|
|
100
163
|
this.formField = "".concat(options.id);
|
|
101
164
|
this.type = options.type;
|
|
102
165
|
this.effects = options === null || options === void 0 ? void 0 : options.effects;
|
|
103
|
-
this.isCombinationComponent =
|
|
166
|
+
this.isCombinationComponent = true;
|
|
104
167
|
this.canSort = false;
|
|
105
|
-
this.
|
|
106
|
-
id: "".concat(options.id, "
|
|
107
|
-
name:
|
|
108
|
-
}))
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
id: "".concat(options.id, "_bsReissueGoods")
|
|
123
|
-
})), new BsChildMoney(_objectSpread(_objectSpread({}, options), {}, {
|
|
124
|
-
name: "实付金额",
|
|
125
|
-
id: "".concat(options.id, "_bsReissueGoods")
|
|
126
|
-
})), new BsChildNumber(_objectSpread(_objectSpread({}, options), {}, {
|
|
127
|
-
name: "数量",
|
|
128
|
-
id: "".concat(options.id, "_bsReissueGoods")
|
|
129
|
-
})), new BsChildShare(_objectSpread(_objectSpread({}, options), {}, {
|
|
130
|
-
name: "分摊价",
|
|
131
|
-
id: "".concat(options.id, "_bsReissueGoods")
|
|
132
|
-
})), new BsChildType(_objectSpread(_objectSpread({}, options), {}, {
|
|
133
|
-
name: "赠品类型",
|
|
134
|
-
id: "".concat(options.id, "_bsReissueGoods")
|
|
135
|
-
}))];
|
|
168
|
+
this.bsType = new BsType(_objectSpread(_objectSpread({}, options), {}, {
|
|
169
|
+
id: "".concat(options.id, "_bsReissueType_type"),
|
|
170
|
+
name: '补发类型'
|
|
171
|
+
}));
|
|
172
|
+
this.bsMemo = new BsMemo(_objectSpread(_objectSpread({}, options), {}, {
|
|
173
|
+
id: "".concat(options.id, "_bsReissueType_memo"),
|
|
174
|
+
name: '补发备注'
|
|
175
|
+
}));
|
|
176
|
+
this.children = [this.bsType, this.bsMemo].concat(_toConsumableArray(((options === null || options === void 0 ? void 0 : (_options$componentCon = options.componentConfig) === null || _options$componentCon === void 0 ? void 0 : _options$componentCon.showHeader) || []).reduce(function (prv, next) {
|
|
177
|
+
if (childHeaderMap[next]) {
|
|
178
|
+
prv.push(new childHeaderMap[next].component(_objectSpread(_objectSpread({}, options), {}, {
|
|
179
|
+
name: childHeaderMap[next].name,
|
|
180
|
+
id: "".concat(options.id, "_bsReissueGoods_").concat(childHeaderMap[next].key)
|
|
181
|
+
})));
|
|
182
|
+
}
|
|
183
|
+
return prv;
|
|
184
|
+
}, [])));
|
|
136
185
|
this.componentConfig = options === null || options === void 0 ? void 0 : options.componentConfig;
|
|
137
|
-
this.rules = this !== null && this !== void 0 && (_this$
|
|
186
|
+
this.rules = this !== null && this !== void 0 && (_this$componentConfig3 = this.componentConfig) !== null && _this$componentConfig3 !== void 0 && _this$componentConfig3.required ? [{
|
|
138
187
|
required: true,
|
|
139
188
|
validator: function validator(_, value) {
|
|
140
189
|
var _value$bsReissueGoods;
|
|
141
190
|
if (!value || !(value !== null && value !== void 0 && (_value$bsReissueGoods = value.bsReissueGoods) !== null && _value$bsReissueGoods !== void 0 && _value$bsReissueGoods.length)) {
|
|
142
|
-
return Promise.reject(new Error(
|
|
191
|
+
return Promise.reject(new Error('请选择bs补发商品'));
|
|
143
192
|
}
|
|
144
193
|
return Promise.resolve();
|
|
145
194
|
}
|
|
146
195
|
}] : [];
|
|
147
|
-
this.dataType =
|
|
196
|
+
this.dataType = 'object';
|
|
148
197
|
});
|
|
149
198
|
export default BsReissue;
|
|
@@ -1,19 +1,20 @@
|
|
|
1
|
-
import { ComponentInterface, PickOption, ALignType, Record } from
|
|
2
|
-
import React from
|
|
1
|
+
import { ComponentInterface, PickOption, ALignType, Record } from '../../../type';
|
|
2
|
+
import React from 'react';
|
|
3
3
|
declare class BsChildCode implements ComponentInterface {
|
|
4
4
|
name: string;
|
|
5
5
|
id: string;
|
|
6
6
|
sortField: string;
|
|
7
7
|
type: string;
|
|
8
|
-
componentConfig: ComponentInterface[
|
|
8
|
+
componentConfig: ComponentInterface['componentConfig'];
|
|
9
9
|
align: ALignType;
|
|
10
10
|
width: number;
|
|
11
11
|
isCombinationComponent: boolean;
|
|
12
12
|
formField: string;
|
|
13
13
|
canSort: boolean;
|
|
14
14
|
children: ComponentInterface[];
|
|
15
|
-
dataType: ComponentInterface[
|
|
15
|
+
dataType: ComponentInterface['dataType'];
|
|
16
16
|
constructor(options: PickOption);
|
|
17
|
+
getParentId: () => string;
|
|
17
18
|
renderClient: (record: any) => React.JSX.Element | null;
|
|
18
19
|
renderPc: (value: unknown, record: Record) => React.JSX.Element;
|
|
19
20
|
renderLog: (r: Record) => React.JSX.Element | null;
|