@kmkf-fe-packages/services-components 0.7.15-alpha.39 → 0.7.15-alpha.40
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 +28 -18
- package/dist/esm/components/BS/BsGoods/index.d.ts +1 -1
- package/dist/esm/components/BS/BsGoods/index.js +17 -12
- package/dist/esm/components/BS/BsReissue/index.d.ts +3 -0
- package/dist/esm/components/BS/BsReissue/index.js +23 -17
- package/dist/esm/components/BS/common/BsMemo.js +3 -3
- package/dist/esm/components/BS/common/BsType.js +3 -2
- package/dist/esm/components/Common/index.d.ts +5 -0
- package/dist/esm/components/Common/index.js +102 -2
- package/dist/esm/components/File/index.js +2 -2
- package/package.json +4 -4
|
@@ -16,7 +16,7 @@ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _ty
|
|
|
16
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); }
|
|
17
17
|
import React from "react";
|
|
18
18
|
import GetFormItem from "../../GetFormItem";
|
|
19
|
-
import {
|
|
19
|
+
import { BsGoodsTable } from "../../Common";
|
|
20
20
|
import ItemView from "../../../commonComponents/ItemView";
|
|
21
21
|
import { isNull, filterFn as _filterFn } from "@kmkf-fe-packages/kmkf-utils";
|
|
22
22
|
import { BsExchange as Exchange } from "@kmkf-fe-packages/basic-components";
|
|
@@ -147,14 +147,30 @@ var BsExchange = /*#__PURE__*/_createClass(function BsExchange(options) {
|
|
|
147
147
|
_defineProperty(this, "bsType", void 0);
|
|
148
148
|
_defineProperty(this, "bsMemo", void 0);
|
|
149
149
|
_defineProperty(this, "renderClient", function (record) {
|
|
150
|
-
|
|
150
|
+
var _this$componentConfig, _this$componentConfig2, _record, _record$bsExchangeTyp, _this$componentConfig3;
|
|
151
|
+
console.log("bsexchange", record);
|
|
152
|
+
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, {
|
|
151
153
|
id: _this.id,
|
|
152
|
-
label: _this.name,
|
|
153
|
-
value: /*#__PURE__*/React.createElement(
|
|
154
|
-
list: _this.
|
|
155
|
-
|
|
154
|
+
label: "".concat(_this.name, "-\u9000\u56DE"),
|
|
155
|
+
value: /*#__PURE__*/React.createElement(BsGoodsTable, {
|
|
156
|
+
list: (record === null || record === void 0 ? void 0 : record["".concat(_this.id)].bsExchangeReturnGoods) || [],
|
|
157
|
+
showHeader: ((_this$componentConfig = _this.componentConfig) === null || _this$componentConfig === void 0 ? void 0 : _this$componentConfig.showHeader) || []
|
|
156
158
|
})
|
|
157
|
-
})
|
|
159
|
+
}), /*#__PURE__*/React.createElement(ItemView, {
|
|
160
|
+
id: _this.id,
|
|
161
|
+
label: "".concat(_this.name, "-\u6362\u51FA"),
|
|
162
|
+
value: /*#__PURE__*/React.createElement(BsGoodsTable, {
|
|
163
|
+
list: (record === null || record === void 0 ? void 0 : record["".concat(_this.id)].bsExchangeSwapOutGoods) || [],
|
|
164
|
+
showHeader: ((_this$componentConfig2 = _this.componentConfig) === null || _this$componentConfig2 === void 0 ? void 0 : _this$componentConfig2.showHeader) || []
|
|
165
|
+
})
|
|
166
|
+
}), ["3", "4"].includes(record === null || record === void 0 ? void 0 : (_record = record["".concat(_this.id)]) === null || _record === void 0 ? void 0 : (_record$bsExchangeTyp = _record.bsExchangeType) === null || _record$bsExchangeTyp === void 0 ? void 0 : _record$bsExchangeTyp[0]) ? /*#__PURE__*/React.createElement(ItemView, {
|
|
167
|
+
id: _this.id,
|
|
168
|
+
label: "".concat(_this.name, "-\u8D60\u54C1"),
|
|
169
|
+
value: /*#__PURE__*/React.createElement(BsGoodsTable, {
|
|
170
|
+
list: (record === null || record === void 0 ? void 0 : record["".concat(_this.id)].bsExchangeGiftGoods) || [],
|
|
171
|
+
showHeader: ((_this$componentConfig3 = _this.componentConfig) === null || _this$componentConfig3 === void 0 ? void 0 : _this$componentConfig3.showHeader) || []
|
|
172
|
+
})
|
|
173
|
+
}) : null) : null;
|
|
158
174
|
});
|
|
159
175
|
_defineProperty(this, "renderPc", function () {
|
|
160
176
|
return null;
|
|
@@ -169,7 +185,7 @@ var BsExchange = /*#__PURE__*/_createClass(function BsExchange(options) {
|
|
|
169
185
|
return null;
|
|
170
186
|
});
|
|
171
187
|
_defineProperty(this, "editRender", function (p) {
|
|
172
|
-
var _this$
|
|
188
|
+
var _this$componentConfig4, _this$effects, _this$effects2;
|
|
173
189
|
return /*#__PURE__*/React.createElement(GetFormItem, {
|
|
174
190
|
title: _this.name,
|
|
175
191
|
name: _this.id,
|
|
@@ -177,7 +193,7 @@ var BsExchange = /*#__PURE__*/_createClass(function BsExchange(options) {
|
|
|
177
193
|
required: false,
|
|
178
194
|
hidden: p === null || p === void 0 ? void 0 : p.hidden,
|
|
179
195
|
component: /*#__PURE__*/React.createElement(Exchange, _extends({}, _this.componentConfig, {
|
|
180
|
-
maxLength: ((_this$
|
|
196
|
+
maxLength: ((_this$componentConfig4 = _this.componentConfig) === null || _this$componentConfig4 === void 0 ? void 0 : _this$componentConfig4.maxLength) || 20,
|
|
181
197
|
shopId: (_this$effects = _this.effects) === null || _this$effects === void 0 ? void 0 : _this$effects.shopId,
|
|
182
198
|
shopList: ((_this$effects2 = _this.effects) === null || _this$effects2 === void 0 ? void 0 : _this$effects2.shopList) || [],
|
|
183
199
|
width: "90%"
|
|
@@ -233,20 +249,14 @@ var BsExchange = /*#__PURE__*/_createClass(function BsExchange(options) {
|
|
|
233
249
|
name: "换货商品"
|
|
234
250
|
}));
|
|
235
251
|
this.bsType = new BsType(_objectSpread(_objectSpread({}, options), {}, {
|
|
236
|
-
id: "".concat(options.id
|
|
252
|
+
id: "".concat(options.id),
|
|
237
253
|
name: "换货类型"
|
|
238
254
|
}));
|
|
239
255
|
this.bsMemo = new BsMemo(_objectSpread(_objectSpread({}, options), {}, {
|
|
240
|
-
id: "".concat(options.id
|
|
256
|
+
id: "".concat(options.id),
|
|
241
257
|
name: "换货备注"
|
|
242
258
|
}));
|
|
243
|
-
this.children = [
|
|
244
|
-
id: "".concat(options.id, "_bsReissueType"),
|
|
245
|
-
name: "换货类型"
|
|
246
|
-
})), new BsMemo(_objectSpread(_objectSpread({}, options), {}, {
|
|
247
|
-
id: "".concat(options.id, "_bsReissueType"),
|
|
248
|
-
name: "换货备注"
|
|
249
|
-
}))].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) {
|
|
259
|
+
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) {
|
|
250
260
|
if (returnHeaderMap[next]) {
|
|
251
261
|
prv.push(new returnHeaderMap[next].component(_objectSpread(_objectSpread({}, options), {}, {
|
|
252
262
|
name: returnHeaderMap[next].name,
|
|
@@ -14,7 +14,7 @@ declare class BsGoods implements ComponentInterface {
|
|
|
14
14
|
children: ComponentInterface[];
|
|
15
15
|
dataType: ComponentInterface["dataType"];
|
|
16
16
|
constructor(options: PickOption);
|
|
17
|
-
renderClient: (record: any) =>
|
|
17
|
+
renderClient: (record: any) => React.JSX.Element | null;
|
|
18
18
|
renderPc: () => null;
|
|
19
19
|
renderLog: (r: Record) => null;
|
|
20
20
|
getComponentValue: (r: Record) => any;
|
|
@@ -10,8 +10,9 @@ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _ty
|
|
|
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
11
|
import React from "react";
|
|
12
12
|
import GetFormItem from "../../GetFormItem";
|
|
13
|
-
import {
|
|
13
|
+
import { BsGoodsTable } from "../../Common";
|
|
14
14
|
import { BsHeaderPic, BsHeaderName, BsHeaderCode, BsHeaderSku, BsHeaderMoney, BsHeaderNumber, BsHeaderShare, BsHeaderType } from "../common/index";
|
|
15
|
+
import ItemView from "../../../commonComponents/ItemView";
|
|
15
16
|
import { isNull } from "@kmkf-fe-packages/kmkf-utils";
|
|
16
17
|
import { BsGoods as Goods } from "@kmkf-fe-packages/basic-components";
|
|
17
18
|
import { SYMBOL } from "../../../constant";
|
|
@@ -52,7 +53,7 @@ var childHeaderMap = {
|
|
|
52
53
|
var BsGoods = /*#__PURE__*/_createClass(function BsGoods(options) {
|
|
53
54
|
var _this = this,
|
|
54
55
|
_options$componentCon,
|
|
55
|
-
_this$
|
|
56
|
+
_this$componentConfig3;
|
|
56
57
|
_classCallCheck(this, BsGoods);
|
|
57
58
|
_defineProperty(this, "name", void 0);
|
|
58
59
|
_defineProperty(this, "id", void 0);
|
|
@@ -67,12 +68,15 @@ var BsGoods = /*#__PURE__*/_createClass(function BsGoods(options) {
|
|
|
67
68
|
_defineProperty(this, "children", void 0);
|
|
68
69
|
_defineProperty(this, "dataType", void 0);
|
|
69
70
|
_defineProperty(this, "renderClient", function (record) {
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
71
|
+
var _record, _this$componentConfig;
|
|
72
|
+
return !isNull(record === null || record === void 0 ? void 0 : record["".concat(_this.id)]) ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ItemView, {
|
|
73
|
+
id: _this.id,
|
|
74
|
+
label: _this.name,
|
|
75
|
+
value: /*#__PURE__*/React.createElement(BsGoodsTable, {
|
|
76
|
+
list: (record === null || record === void 0 ? void 0 : (_record = record["".concat(_this.id)]) === null || _record === void 0 ? void 0 : _record.bsGoods) || [],
|
|
77
|
+
showHeader: ((_this$componentConfig = _this.componentConfig) === null || _this$componentConfig === void 0 ? void 0 : _this$componentConfig.showHeader) || []
|
|
78
|
+
})
|
|
79
|
+
})) : null;
|
|
76
80
|
});
|
|
77
81
|
_defineProperty(this, "renderPc", function () {
|
|
78
82
|
return null;
|
|
@@ -87,7 +91,7 @@ var BsGoods = /*#__PURE__*/_createClass(function BsGoods(options) {
|
|
|
87
91
|
return null;
|
|
88
92
|
});
|
|
89
93
|
_defineProperty(this, "editRender", function (p) {
|
|
90
|
-
var _this$
|
|
94
|
+
var _this$componentConfig2, _this$effects, _this$effects2;
|
|
91
95
|
return /*#__PURE__*/React.createElement(GetFormItem, {
|
|
92
96
|
title: _this.name,
|
|
93
97
|
name: _this.id,
|
|
@@ -95,7 +99,7 @@ var BsGoods = /*#__PURE__*/_createClass(function BsGoods(options) {
|
|
|
95
99
|
required: false,
|
|
96
100
|
hidden: p === null || p === void 0 ? void 0 : p.hidden,
|
|
97
101
|
component: /*#__PURE__*/React.createElement(Goods, _extends({}, _this.componentConfig, {
|
|
98
|
-
maxLength: ((_this$
|
|
102
|
+
maxLength: ((_this$componentConfig2 = _this.componentConfig) === null || _this$componentConfig2 === void 0 ? void 0 : _this$componentConfig2.maxLength) || 20,
|
|
99
103
|
shopId: (_this$effects = _this.effects) === null || _this$effects === void 0 ? void 0 : _this$effects.shopId,
|
|
100
104
|
shopList: ((_this$effects2 = _this.effects) === null || _this$effects2 === void 0 ? void 0 : _this$effects2.shopList) || [],
|
|
101
105
|
width: "90%"
|
|
@@ -131,10 +135,11 @@ var BsGoods = /*#__PURE__*/_createClass(function BsGoods(options) {
|
|
|
131
135
|
return prv;
|
|
132
136
|
}, []);
|
|
133
137
|
this.componentConfig = options === null || options === void 0 ? void 0 : options.componentConfig;
|
|
134
|
-
this.rules = this !== null && this !== void 0 && (_this$
|
|
138
|
+
this.rules = this !== null && this !== void 0 && (_this$componentConfig3 = this.componentConfig) !== null && _this$componentConfig3 !== void 0 && _this$componentConfig3.required ? [{
|
|
135
139
|
required: true,
|
|
136
140
|
validator: function validator(_, value) {
|
|
137
|
-
|
|
141
|
+
var _value$bsGoods;
|
|
142
|
+
if (!value || !(value !== null && value !== void 0 && (_value$bsGoods = value.bsGoods) !== null && _value$bsGoods !== void 0 && _value$bsGoods.length)) {
|
|
138
143
|
return Promise.reject(new Error("请选择bs商品"));
|
|
139
144
|
}
|
|
140
145
|
return Promise.resolve();
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ComponentInterface, PickOption, ColumnConfig, Record } from "../../../type";
|
|
2
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;
|
|
@@ -13,6 +14,8 @@ declare class BsReissue implements ComponentInterface {
|
|
|
13
14
|
canSort: boolean;
|
|
14
15
|
children: ComponentInterface[];
|
|
15
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;
|
|
@@ -1,12 +1,12 @@
|
|
|
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 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
2
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
5
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."); }
|
|
6
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); }
|
|
7
5
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
8
6
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
9
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; }
|
|
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; }
|
|
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; }
|
|
10
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); }
|
|
11
11
|
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); } }
|
|
12
12
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
@@ -16,11 +16,11 @@ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _ty
|
|
|
16
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); }
|
|
17
17
|
import React from "react";
|
|
18
18
|
import GetFormItem from "../../GetFormItem";
|
|
19
|
-
import { GoodImage } from "../../Common";
|
|
20
19
|
import ItemView from "../../../commonComponents/ItemView";
|
|
21
20
|
import { isNull, filterFn as _filterFn } from "@kmkf-fe-packages/kmkf-utils";
|
|
22
21
|
import { BsReissue as Reissue } from "@kmkf-fe-packages/basic-components";
|
|
23
22
|
import { SYMBOL } from "../../../constant";
|
|
23
|
+
import { BsGoodsTable } from "../../Common";
|
|
24
24
|
import { BsType, BsMemo, BsHeaderPic, BsHeaderName, BsHeaderCode, BsHeaderSku, BsHeaderMoney, BsHeaderNumber, BsHeaderShare, BsHeaderType } from "../common/index";
|
|
25
25
|
var childHeaderMap = {
|
|
26
26
|
pic: {
|
|
@@ -59,7 +59,7 @@ var childHeaderMap = {
|
|
|
59
59
|
var BsReissue = /*#__PURE__*/_createClass(function BsReissue(options) {
|
|
60
60
|
var _this = this,
|
|
61
61
|
_options$componentCon,
|
|
62
|
-
_this$
|
|
62
|
+
_this$componentConfig3;
|
|
63
63
|
_classCallCheck(this, BsReissue);
|
|
64
64
|
_defineProperty(this, "name", void 0);
|
|
65
65
|
_defineProperty(this, "id", void 0);
|
|
@@ -73,15 +73,19 @@ var BsReissue = /*#__PURE__*/_createClass(function BsReissue(options) {
|
|
|
73
73
|
_defineProperty(this, "canSort", void 0);
|
|
74
74
|
_defineProperty(this, "children", void 0);
|
|
75
75
|
_defineProperty(this, "dataType", void 0);
|
|
76
|
+
_defineProperty(this, "bsType", void 0);
|
|
77
|
+
_defineProperty(this, "bsMemo", void 0);
|
|
76
78
|
_defineProperty(this, "renderClient", function (record) {
|
|
77
|
-
|
|
79
|
+
var _this$componentConfig;
|
|
80
|
+
console.log("bsreissue", record);
|
|
81
|
+
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, {
|
|
78
82
|
id: _this.id,
|
|
79
83
|
label: _this.name,
|
|
80
|
-
value: /*#__PURE__*/React.createElement(
|
|
81
|
-
list: record === null || record === void 0 ? void 0 : record[_this.id],
|
|
82
|
-
|
|
84
|
+
value: /*#__PURE__*/React.createElement(BsGoodsTable, {
|
|
85
|
+
list: (record === null || record === void 0 ? void 0 : record["".concat(_this.id)].bsReissueGoods) || [],
|
|
86
|
+
showHeader: ((_this$componentConfig = _this.componentConfig) === null || _this$componentConfig === void 0 ? void 0 : _this$componentConfig.showHeader) || []
|
|
83
87
|
})
|
|
84
|
-
}) : null;
|
|
88
|
+
})) : null;
|
|
85
89
|
});
|
|
86
90
|
_defineProperty(this, "renderPc", function () {
|
|
87
91
|
return null;
|
|
@@ -96,7 +100,7 @@ var BsReissue = /*#__PURE__*/_createClass(function BsReissue(options) {
|
|
|
96
100
|
return null;
|
|
97
101
|
});
|
|
98
102
|
_defineProperty(this, "editRender", function (p) {
|
|
99
|
-
var _this$
|
|
103
|
+
var _this$componentConfig2, _this$effects, _this$effects2;
|
|
100
104
|
return /*#__PURE__*/React.createElement(GetFormItem, {
|
|
101
105
|
title: _this.name,
|
|
102
106
|
name: _this.id,
|
|
@@ -104,7 +108,7 @@ var BsReissue = /*#__PURE__*/_createClass(function BsReissue(options) {
|
|
|
104
108
|
required: false,
|
|
105
109
|
hidden: p === null || p === void 0 ? void 0 : p.hidden,
|
|
106
110
|
component: /*#__PURE__*/React.createElement(Reissue, _extends({}, _this.componentConfig, {
|
|
107
|
-
maxLength: ((_this$
|
|
111
|
+
maxLength: ((_this$componentConfig2 = _this.componentConfig) === null || _this$componentConfig2 === void 0 ? void 0 : _this$componentConfig2.maxLength) || 20,
|
|
108
112
|
shopId: (_this$effects = _this.effects) === null || _this$effects === void 0 ? void 0 : _this$effects.shopId,
|
|
109
113
|
shopList: ((_this$effects2 = _this.effects) === null || _this$effects2 === void 0 ? void 0 : _this$effects2.shopList) || [],
|
|
110
114
|
width: "90%"
|
|
@@ -143,13 +147,15 @@ var BsReissue = /*#__PURE__*/_createClass(function BsReissue(options) {
|
|
|
143
147
|
this.effects = options === null || options === void 0 ? void 0 : options.effects;
|
|
144
148
|
this.isCombinationComponent = true;
|
|
145
149
|
this.canSort = false;
|
|
146
|
-
this.
|
|
147
|
-
id: "".concat(options.id
|
|
150
|
+
this.bsType = new BsType(_objectSpread(_objectSpread({}, options), {}, {
|
|
151
|
+
id: "".concat(options.id),
|
|
148
152
|
name: "补发类型"
|
|
149
|
-
}))
|
|
150
|
-
|
|
153
|
+
}));
|
|
154
|
+
this.bsMemo = new BsMemo(_objectSpread(_objectSpread({}, options), {}, {
|
|
155
|
+
id: "".concat(options.id),
|
|
151
156
|
name: "补发备注"
|
|
152
|
-
}))
|
|
157
|
+
}));
|
|
158
|
+
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) {
|
|
153
159
|
if (childHeaderMap[next]) {
|
|
154
160
|
prv.push(new childHeaderMap[next].component(_objectSpread(_objectSpread({}, options), {}, {
|
|
155
161
|
name: childHeaderMap[next].name,
|
|
@@ -159,7 +165,7 @@ var BsReissue = /*#__PURE__*/_createClass(function BsReissue(options) {
|
|
|
159
165
|
return prv;
|
|
160
166
|
}, [])));
|
|
161
167
|
this.componentConfig = options === null || options === void 0 ? void 0 : options.componentConfig;
|
|
162
|
-
this.rules = this !== null && this !== void 0 && (_this$
|
|
168
|
+
this.rules = this !== null && this !== void 0 && (_this$componentConfig3 = this.componentConfig) !== null && _this$componentConfig3 !== void 0 && _this$componentConfig3.required ? [{
|
|
163
169
|
required: true,
|
|
164
170
|
validator: function validator(_, value) {
|
|
165
171
|
var _value$bsReissueGoods;
|
|
@@ -39,9 +39,9 @@ var BsType = /*#__PURE__*/_createClass(function BsType(options) {
|
|
|
39
39
|
return _this.renderPc(undefined, r);
|
|
40
40
|
});
|
|
41
41
|
_defineProperty(this, "getComponentValue", function (r) {
|
|
42
|
-
var _find, _this$componentConfig;
|
|
43
|
-
var type = r !== null && r !== void 0 && r[_this.id] ? r === null || r === void 0 ? void 0 : r[_this.id][0] : "";
|
|
44
|
-
var memo = r !== null && r !== void 0 && r[_this.id] ? r === null || r === void 0 ? void 0 : r[_this.id][1] : "";
|
|
42
|
+
var _ref, _r$_this$id, _r$_this$id2, _ref2, _r$_this$id3, _r$_this$id4, _find, _this$componentConfig;
|
|
43
|
+
var type = r !== null && r !== void 0 && r[_this.id] ? (_ref = (r === null || r === void 0 ? void 0 : (_r$_this$id = r[_this.id]) === null || _r$_this$id === void 0 ? void 0 : _r$_this$id.bsReissueType) || (r === null || r === void 0 ? void 0 : (_r$_this$id2 = r[_this.id]) === null || _r$_this$id2 === void 0 ? void 0 : _r$_this$id2.bsExchangeType)) === null || _ref === void 0 ? void 0 : _ref[0] : "";
|
|
44
|
+
var memo = r !== null && r !== void 0 && r[_this.id] ? (_ref2 = (r === null || r === void 0 ? void 0 : (_r$_this$id3 = r[_this.id]) === null || _r$_this$id3 === void 0 ? void 0 : _r$_this$id3.bsReissueType) || (r === null || r === void 0 ? void 0 : (_r$_this$id4 = r[_this.id]) === null || _r$_this$id4 === void 0 ? void 0 : _r$_this$id4.bsExchangeType)) === null || _ref2 === void 0 ? void 0 : _ref2[1] : "";
|
|
45
45
|
var children = (_find = (((_this$componentConfig = _this.componentConfig) === null || _this$componentConfig === void 0 ? void 0 : _this$componentConfig.reasonList) || []).find(function (item) {
|
|
46
46
|
return item.value === type;
|
|
47
47
|
})) === null || _find === void 0 ? void 0 : _find.children;
|
|
@@ -40,8 +40,9 @@ var BsType = /*#__PURE__*/_createClass(function BsType(options) {
|
|
|
40
40
|
return _this.renderPc(undefined, r);
|
|
41
41
|
});
|
|
42
42
|
_defineProperty(this, "getComponentValue", function (r) {
|
|
43
|
-
var _find, _this$componentConfig;
|
|
44
|
-
var type = r !== null && r !== void 0 && r[_this.id] ? r === null || r === void 0 ? void 0 : r[_this.id][0] : "";
|
|
43
|
+
var _ref, _r$_this$id, _r$_this$id2, _find, _this$componentConfig;
|
|
44
|
+
var type = r !== null && r !== void 0 && r[_this.id] ? (_ref = (r === null || r === void 0 ? void 0 : (_r$_this$id = r[_this.id]) === null || _r$_this$id === void 0 ? void 0 : _r$_this$id.bsReissueType) || (r === null || r === void 0 ? void 0 : (_r$_this$id2 = r[_this.id]) === null || _r$_this$id2 === void 0 ? void 0 : _r$_this$id2.bsExchangeType)) === null || _ref === void 0 ? void 0 : _ref[0] : "";
|
|
45
|
+
console.log("bstype", r, _this.id, type);
|
|
45
46
|
var text = (_find = (((_this$componentConfig = _this.componentConfig) === null || _this$componentConfig === void 0 ? void 0 : _this$componentConfig.reasonList) || []).find(function (item) {
|
|
46
47
|
return item.value === type;
|
|
47
48
|
})) === null || _find === void 0 ? void 0 : _find.label;
|
|
@@ -21,4 +21,9 @@ export declare const BsGoodImage: ({ item, index }: {
|
|
|
21
21
|
}) => React.JSX.Element;
|
|
22
22
|
export declare const BsExchangeList: ({ list }: any) => React.JSX.Element;
|
|
23
23
|
export declare const BsGoodPic: (list: string[]) => React.JSX.Element[];
|
|
24
|
+
export declare const BsGoodsTable: ({ list, showHeader, text, }: {
|
|
25
|
+
list: any[];
|
|
26
|
+
showHeader: string[];
|
|
27
|
+
text?: string | undefined;
|
|
28
|
+
}) => React.JSX.Element;
|
|
24
29
|
export {};
|
|
@@ -1,11 +1,15 @@
|
|
|
1
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
2
|
+
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."); }
|
|
3
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
4
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
1
5
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
6
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3
7
|
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); }
|
|
4
8
|
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; }
|
|
5
9
|
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
6
10
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
|
-
import { Form, Button, Modal, Tooltip, Space, Image, Popover } from "antd";
|
|
8
|
-
import React, { useState } from "react";
|
|
11
|
+
import { Form, Button, Modal, Tooltip, Space, Image, Popover, Table } from "antd";
|
|
12
|
+
import React, { useState, useMemo } from "react";
|
|
9
13
|
import { ExpressData } from "@kmkf-fe-packages/kmkf-utils";
|
|
10
14
|
import styles from "./index.module.less";
|
|
11
15
|
import defaultImg from "./img/default-img.png";
|
|
@@ -285,4 +289,100 @@ export var BsGoodPic = function BsGoodPic(list) {
|
|
|
285
289
|
src: t
|
|
286
290
|
});
|
|
287
291
|
});
|
|
292
|
+
};
|
|
293
|
+
export var BsGoodsTable = function BsGoodsTable(_ref9) {
|
|
294
|
+
var list = _ref9.list,
|
|
295
|
+
showHeader = _ref9.showHeader,
|
|
296
|
+
_ref9$text = _ref9.text,
|
|
297
|
+
text = _ref9$text === void 0 ? "" : _ref9$text;
|
|
298
|
+
//商品信息
|
|
299
|
+
var GOODS_INFO_COLUMNS = function GOODS_INFO_COLUMNS() {
|
|
300
|
+
var text = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";
|
|
301
|
+
return [{
|
|
302
|
+
dataIndex: "pic",
|
|
303
|
+
title: "\u56FE\u7247",
|
|
304
|
+
align: "center",
|
|
305
|
+
ellipsis: true,
|
|
306
|
+
width: 100,
|
|
307
|
+
render: function render(val) {
|
|
308
|
+
return /*#__PURE__*/React.createElement(Image, {
|
|
309
|
+
width: 60,
|
|
310
|
+
src: val
|
|
311
|
+
});
|
|
312
|
+
}
|
|
313
|
+
}, {
|
|
314
|
+
dataIndex: "name",
|
|
315
|
+
title: "".concat(text, "\u540D\u79F0"),
|
|
316
|
+
align: "center",
|
|
317
|
+
ellipsis: true,
|
|
318
|
+
width: 100
|
|
319
|
+
}, {
|
|
320
|
+
dataIndex: "code",
|
|
321
|
+
title: "".concat(text, "\u7F16\u7801"),
|
|
322
|
+
align: "center",
|
|
323
|
+
ellipsis: true,
|
|
324
|
+
width: 100
|
|
325
|
+
}, {
|
|
326
|
+
dataIndex: "sku",
|
|
327
|
+
title: "".concat(text, "sku\u7F16\u7801"),
|
|
328
|
+
align: "center",
|
|
329
|
+
ellipsis: true,
|
|
330
|
+
width: 100
|
|
331
|
+
}, {
|
|
332
|
+
dataIndex: "money",
|
|
333
|
+
title: "\u5B9E\u4ED8\u91D1\u989D",
|
|
334
|
+
align: "center",
|
|
335
|
+
ellipsis: true,
|
|
336
|
+
width: 100
|
|
337
|
+
}, {
|
|
338
|
+
dataIndex: "number",
|
|
339
|
+
title: "".concat(text, "\u6570\u91CF"),
|
|
340
|
+
align: "center",
|
|
341
|
+
ellipsis: true,
|
|
342
|
+
width: 100,
|
|
343
|
+
render: function render(val, record, index) {
|
|
344
|
+
return /*#__PURE__*/React.createElement("span", null, val);
|
|
345
|
+
}
|
|
346
|
+
}, {
|
|
347
|
+
dataIndex: "share",
|
|
348
|
+
title: "\u5206\u644A\u4EF7",
|
|
349
|
+
align: "center",
|
|
350
|
+
ellipsis: true,
|
|
351
|
+
width: 70
|
|
352
|
+
}, {
|
|
353
|
+
dataIndex: "type",
|
|
354
|
+
title: "\u8D60\u54C1\u7C7B\u578B",
|
|
355
|
+
align: "center",
|
|
356
|
+
ellipsis: true,
|
|
357
|
+
width: 100
|
|
358
|
+
}];
|
|
359
|
+
};
|
|
360
|
+
var newColumns = useMemo(function () {
|
|
361
|
+
var columnList = [{
|
|
362
|
+
dataIndex: "",
|
|
363
|
+
title: "序号",
|
|
364
|
+
align: "center",
|
|
365
|
+
ellipsis: true,
|
|
366
|
+
width: 50,
|
|
367
|
+
render: function render(val, record, index) {
|
|
368
|
+
return /*#__PURE__*/React.createElement("span", null, index + 1);
|
|
369
|
+
}
|
|
370
|
+
}].concat(_toConsumableArray(GOODS_INFO_COLUMNS(text).filter(function (t) {
|
|
371
|
+
return showHeader.includes(t === null || t === void 0 ? void 0 : t.dataIndex);
|
|
372
|
+
})));
|
|
373
|
+
return columnList;
|
|
374
|
+
}, [showHeader, list]);
|
|
375
|
+
return /*#__PURE__*/React.createElement(Table, {
|
|
376
|
+
columns: newColumns,
|
|
377
|
+
dataSource: list,
|
|
378
|
+
rowKey: "id",
|
|
379
|
+
size: "small",
|
|
380
|
+
pagination: false,
|
|
381
|
+
scroll: {
|
|
382
|
+
x: "100%"
|
|
383
|
+
},
|
|
384
|
+
locale: {
|
|
385
|
+
emptyText: "暂无数据"
|
|
386
|
+
}
|
|
387
|
+
});
|
|
288
388
|
};
|
|
@@ -26,7 +26,7 @@ var BasicFile = /*#__PURE__*/_createClass(function BasicFile(options) {
|
|
|
26
26
|
_defineProperty(this, "children", void 0);
|
|
27
27
|
_defineProperty(this, "dataType", void 0);
|
|
28
28
|
_defineProperty(this, "renderPc", function (value, record) {
|
|
29
|
-
var fileList = (record === null || record === void 0 ? void 0 : record["".concat(_this.id
|
|
29
|
+
var fileList = (record === null || record === void 0 ? void 0 : record["".concat(_this.id)]) || [];
|
|
30
30
|
if (!fileList.length) {
|
|
31
31
|
return /*#__PURE__*/React.createElement("span", null, "--");
|
|
32
32
|
}
|
|
@@ -47,7 +47,7 @@ var BasicFile = /*#__PURE__*/_createClass(function BasicFile(options) {
|
|
|
47
47
|
return !isNull(record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_file")]) ? /*#__PURE__*/React.createElement(ItemView, {
|
|
48
48
|
id: _this.id,
|
|
49
49
|
label: _this.name,
|
|
50
|
-
value: _this.renderPc(null, record
|
|
50
|
+
value: _this.renderPc(null, record)
|
|
51
51
|
}) : null;
|
|
52
52
|
});
|
|
53
53
|
_defineProperty(this, "editRender", function () {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kmkf-fe-packages/services-components",
|
|
3
|
-
"version": "0.7.15-alpha.
|
|
3
|
+
"version": "0.7.15-alpha.40",
|
|
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.7.15-alpha.
|
|
30
|
-
"@kmkf-fe-packages/kmkf-utils": "^0.7.15-alpha.
|
|
29
|
+
"@kmkf-fe-packages/basic-components": "^0.7.15-alpha.40",
|
|
30
|
+
"@kmkf-fe-packages/kmkf-utils": "^0.7.15-alpha.40"
|
|
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": "57c6d523ffca6dc56f9593cdd18e89a142971318"
|
|
44
44
|
}
|