@kmkf-fe-packages/services-components 0.7.15-alpha.2 → 0.7.15-alpha.3
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.d.ts +20 -5
- package/dist/esm/components/BS/BsExchange/index.js +59 -38
- package/dist/esm/components/BS/BsGoods/index.d.ts +3 -4
- package/dist/esm/components/BS/BsGoods/index.js +13 -23
- package/dist/esm/components/BS/BsReissue/index.d.ts +21 -6
- package/dist/esm/components/BS/BsReissue/index.js +29 -36
- package/dist/esm/components/BS/common/BsExchangeImage.d.ts +31 -0
- package/dist/esm/components/BS/common/BsExchangeImage.js +126 -0
- package/dist/esm/components/BS/common/BsGoodImage.d.ts +31 -0
- package/dist/esm/components/BS/common/BsGoodImage.js +88 -0
- package/dist/esm/components/BS/common/BsMemo.d.ts +25 -0
- package/dist/esm/components/BS/common/BsMemo.js +76 -0
- package/dist/esm/components/BS/common/BsType.d.ts +35 -0
- package/dist/esm/components/BS/common/{BsPic.js → BsType.js} +40 -49
- package/dist/esm/components/Common/index.d.ts +11 -6
- package/dist/esm/components/Common/index.js +105 -50
- package/dist/esm/components/Common/index.module.less +8 -0
- package/dist/esm/components/File/index.d.ts +7 -8
- package/dist/esm/components/File/index.js +18 -47
- package/dist/esm/components/Input/index.js +3 -0
- package/dist/esm/components/LogisticsTrajectory/index.js +6 -16
- package/dist/esm/factory.d.ts +1 -1
- package/dist/esm/type.d.ts +1 -0
- package/package.json +4 -4
- package/dist/esm/components/BS/common/BsPic.d.ts +0 -43
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { ComponentInterface, PickOption, ColumnConfig, Record } from "../../../type";
|
|
2
2
|
import React from "react";
|
|
3
|
+
import BsExchangeImage from "../common/BsExchangeImage";
|
|
4
|
+
import BsType from "../common/BsType";
|
|
5
|
+
import BsMemo from "../common/BsMemo";
|
|
3
6
|
declare class BsExchange implements ComponentInterface {
|
|
4
7
|
name: string;
|
|
5
8
|
id: string;
|
|
@@ -13,20 +16,32 @@ declare class BsExchange implements ComponentInterface {
|
|
|
13
16
|
canSort: boolean;
|
|
14
17
|
children: ComponentInterface[];
|
|
15
18
|
dataType: ComponentInterface["dataType"];
|
|
19
|
+
goodImage: BsExchangeImage;
|
|
20
|
+
bsType: BsType;
|
|
21
|
+
bsMemo: BsMemo;
|
|
16
22
|
constructor(options: PickOption);
|
|
17
23
|
renderClient: (record: any) => React.JSX.Element | null;
|
|
18
|
-
renderPc: (
|
|
19
|
-
renderLog: (r: Record) =>
|
|
24
|
+
renderPc: () => null;
|
|
25
|
+
renderLog: (r: Record) => null;
|
|
20
26
|
getComponentValue: (r: Record) => any;
|
|
21
27
|
renderExport: (value: any, record: any) => any;
|
|
22
28
|
editRender: (p: any) => React.JSX.Element;
|
|
23
|
-
filterConfig: (item: ColumnConfig) => {
|
|
29
|
+
filterConfig: (item: ColumnConfig) => ({
|
|
30
|
+
searchDefaultConditions: "eq";
|
|
31
|
+
type: string;
|
|
32
|
+
id: string;
|
|
33
|
+
name: string;
|
|
34
|
+
filterComponentType: "Cascader";
|
|
35
|
+
props: {
|
|
36
|
+
options: any[] | undefined;
|
|
37
|
+
};
|
|
38
|
+
filterFn: (value: string) => (i: Record) => boolean;
|
|
39
|
+
} | {
|
|
24
40
|
searchDefaultConditions: "like";
|
|
25
41
|
type: string;
|
|
26
42
|
id: string;
|
|
27
43
|
name: string;
|
|
28
44
|
filterComponentType: "Input";
|
|
29
|
-
|
|
30
|
-
};
|
|
45
|
+
})[];
|
|
31
46
|
}
|
|
32
47
|
export default BsExchange;
|
|
@@ -1,4 +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
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
5
|
+
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
|
+
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
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
8
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
9
|
+
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
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); }
|
|
3
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); } }
|
|
4
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; }
|
|
@@ -10,12 +18,13 @@ import React from "react";
|
|
|
10
18
|
import GetFormItem from "../../GetFormItem";
|
|
11
19
|
import { GoodImage } from "../../Common";
|
|
12
20
|
import ItemView from "../../../commonComponents/ItemView";
|
|
13
|
-
import { isNull
|
|
21
|
+
import { isNull } from "@kmkf-fe-packages/kmkf-utils";
|
|
14
22
|
import { BsExchange as Exchange } from "@kmkf-fe-packages/basic-components";
|
|
15
|
-
import
|
|
23
|
+
import BsExchangeImage from "../common/BsExchangeImage";
|
|
24
|
+
import BsType from "../common/BsType";
|
|
25
|
+
import BsMemo from "../common/BsMemo";
|
|
16
26
|
var BsExchange = /*#__PURE__*/_createClass(function BsExchange(options) {
|
|
17
|
-
var _this = this
|
|
18
|
-
_this$componentConfig2;
|
|
27
|
+
var _this = this;
|
|
19
28
|
_classCallCheck(this, BsExchange);
|
|
20
29
|
_defineProperty(this, "name", void 0);
|
|
21
30
|
_defineProperty(this, "id", void 0);
|
|
@@ -29,29 +38,24 @@ var BsExchange = /*#__PURE__*/_createClass(function BsExchange(options) {
|
|
|
29
38
|
_defineProperty(this, "canSort", void 0);
|
|
30
39
|
_defineProperty(this, "children", void 0);
|
|
31
40
|
_defineProperty(this, "dataType", void 0);
|
|
41
|
+
_defineProperty(this, "goodImage", void 0);
|
|
42
|
+
_defineProperty(this, "bsType", void 0);
|
|
43
|
+
_defineProperty(this, "bsMemo", void 0);
|
|
32
44
|
_defineProperty(this, "renderClient", function (record) {
|
|
33
45
|
return !isNull(record === null || record === void 0 ? void 0 : record[_this.id]) ? /*#__PURE__*/React.createElement(ItemView, {
|
|
34
46
|
id: _this.id,
|
|
35
47
|
label: _this.name,
|
|
36
48
|
value: /*#__PURE__*/React.createElement(GoodImage, {
|
|
37
|
-
list:
|
|
49
|
+
list: _this.getComponentValue(record),
|
|
38
50
|
type: "itemId"
|
|
39
51
|
})
|
|
40
52
|
}) : null;
|
|
41
53
|
});
|
|
42
|
-
_defineProperty(this, "renderPc", function (
|
|
43
|
-
|
|
44
|
-
return /*#__PURE__*/React.createElement("span", null, "--");
|
|
45
|
-
}
|
|
46
|
-
//兼容多个商品
|
|
47
|
-
return /*#__PURE__*/React.createElement(GoodImage, {
|
|
48
|
-
list: record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_bsGoods")],
|
|
49
|
-
type: "itemId"
|
|
50
|
-
});
|
|
54
|
+
_defineProperty(this, "renderPc", function () {
|
|
55
|
+
return null;
|
|
51
56
|
});
|
|
52
57
|
_defineProperty(this, "renderLog", function (r) {
|
|
53
|
-
|
|
54
|
-
return _this.renderPc(undefined, r);
|
|
58
|
+
return null;
|
|
55
59
|
});
|
|
56
60
|
_defineProperty(this, "getComponentValue", function (r) {
|
|
57
61
|
return r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_bsGoods")];
|
|
@@ -79,24 +83,7 @@ var BsExchange = /*#__PURE__*/_createClass(function BsExchange(options) {
|
|
|
79
83
|
});
|
|
80
84
|
});
|
|
81
85
|
_defineProperty(this, "filterConfig", function (item) {
|
|
82
|
-
return
|
|
83
|
-
searchDefaultConditions: SYMBOL.like,
|
|
84
|
-
type: item.type,
|
|
85
|
-
id: "".concat(item.id, "_bsGoods"),
|
|
86
|
-
// 过滤组件id
|
|
87
|
-
name: item.name,
|
|
88
|
-
// 过滤组件名称
|
|
89
|
-
filterComponentType: "Input",
|
|
90
|
-
filterFn: function filterFn(value) {
|
|
91
|
-
return function (i) {
|
|
92
|
-
var _ref2;
|
|
93
|
-
return (_ref2 = _filterFn.filterTableListItemColumnValue(i, item.id, "bsGoods") || []) === null || _ref2 === void 0 ? void 0 : _ref2.some(function (item) {
|
|
94
|
-
var _String;
|
|
95
|
-
return item !== null && item !== void 0 && item.numIid ? (_String = String(item === null || item === void 0 ? void 0 : item.numIid)) === null || _String === void 0 ? void 0 : _String.includes(value) : false;
|
|
96
|
-
});
|
|
97
|
-
};
|
|
98
|
-
}
|
|
99
|
-
};
|
|
86
|
+
return [_this.bsType.filterConfig(item)].concat(_toConsumableArray(_this.goodImage.filterConfig(item)));
|
|
100
87
|
});
|
|
101
88
|
this.name = options.name;
|
|
102
89
|
this.id = options.id;
|
|
@@ -106,17 +93,51 @@ var BsExchange = /*#__PURE__*/_createClass(function BsExchange(options) {
|
|
|
106
93
|
this.effects = options === null || options === void 0 ? void 0 : options.effects;
|
|
107
94
|
this.isCombinationComponent = false;
|
|
108
95
|
this.canSort = false;
|
|
96
|
+
this.goodImage = new BsExchangeImage(_objectSpread(_objectSpread({}, options), {}, {
|
|
97
|
+
id: "".concat(options.id),
|
|
98
|
+
name: "换货商品"
|
|
99
|
+
}));
|
|
100
|
+
this.bsType = new BsType(_objectSpread(_objectSpread({}, options), {}, {
|
|
101
|
+
id: "".concat(options.id, "_bsReissueType"),
|
|
102
|
+
name: "换货类型"
|
|
103
|
+
}));
|
|
104
|
+
this.bsMemo = new BsMemo(_objectSpread(_objectSpread({}, options), {}, {
|
|
105
|
+
id: "".concat(options.id, "_bsReissueType"),
|
|
106
|
+
name: "换货备注"
|
|
107
|
+
}));
|
|
109
108
|
this.children = [];
|
|
110
109
|
this.componentConfig = options === null || options === void 0 ? void 0 : options.componentConfig;
|
|
111
|
-
this.rules =
|
|
110
|
+
this.rules = [{
|
|
112
111
|
required: true,
|
|
113
112
|
validator: function validator(_, value) {
|
|
114
|
-
|
|
115
|
-
|
|
113
|
+
var _value$bsExchangeRetu;
|
|
114
|
+
if (!value || !(value !== null && value !== void 0 && (_value$bsExchangeRetu = value.bsExchangeReturnGoods) !== null && _value$bsExchangeRetu !== void 0 && _value$bsExchangeRetu.length)) {
|
|
115
|
+
return Promise.reject(new Error("请选择bs换货商品"));
|
|
116
|
+
}
|
|
117
|
+
return Promise.resolve();
|
|
118
|
+
}
|
|
119
|
+
}, {
|
|
120
|
+
validator: function validator(_, value) {
|
|
121
|
+
var _value$bsExchangeType;
|
|
122
|
+
if (value && ["2", "4"].includes(value === null || value === void 0 ? void 0 : (_value$bsExchangeType = value.bsExchangeType) === null || _value$bsExchangeType === void 0 ? void 0 : _value$bsExchangeType[0])) {
|
|
123
|
+
var hasMore = ((value === null || value === void 0 ? void 0 : value.bsExchangeReturnGoods) || []).some(function (item) {
|
|
124
|
+
var returnMoney = ((item === null || item === void 0 ? void 0 : item.bsExchangeReturnGoods) || []).reduce(function (prv, next) {
|
|
125
|
+
prv += Number(next.money || 0);
|
|
126
|
+
return prv;
|
|
127
|
+
}, 0);
|
|
128
|
+
var swapOutMoney = ((item === null || item === void 0 ? void 0 : item.bsExchangeSwapOutGoods) || []).reduce(function (prv, next) {
|
|
129
|
+
prv += Number(next.money || 0);
|
|
130
|
+
return prv;
|
|
131
|
+
}, 0);
|
|
132
|
+
return returnMoney < swapOutMoney;
|
|
133
|
+
});
|
|
134
|
+
if (hasMore) {
|
|
135
|
+
return Promise.reject(new Error("换货商品的金额不能大于退回商品的金额"));
|
|
136
|
+
}
|
|
116
137
|
}
|
|
117
138
|
return Promise.resolve();
|
|
118
139
|
}
|
|
119
|
-
}]
|
|
140
|
+
}];
|
|
120
141
|
this.dataType = "object";
|
|
121
142
|
});
|
|
122
143
|
export default BsExchange;
|
|
@@ -14,9 +14,9 @@ declare class BsGoods implements ComponentInterface {
|
|
|
14
14
|
children: ComponentInterface[];
|
|
15
15
|
dataType: ComponentInterface["dataType"];
|
|
16
16
|
constructor(options: PickOption);
|
|
17
|
-
renderClient: (record: any) =>
|
|
18
|
-
renderPc: (value: unknown, record: Record) =>
|
|
19
|
-
renderLog: (r: Record) =>
|
|
17
|
+
renderClient: (record: any) => any;
|
|
18
|
+
renderPc: (value: unknown, record: Record) => any;
|
|
19
|
+
renderLog: (r: Record) => any;
|
|
20
20
|
getComponentValue: (r: Record) => any;
|
|
21
21
|
renderExport: (value: any, record: any) => any;
|
|
22
22
|
editRender: (p: any) => React.JSX.Element;
|
|
@@ -26,7 +26,6 @@ declare class BsGoods implements ComponentInterface {
|
|
|
26
26
|
id: string;
|
|
27
27
|
name: string;
|
|
28
28
|
filterComponentType: "Input";
|
|
29
|
-
filterFn: (value: string) => (i: Record) => any;
|
|
30
29
|
};
|
|
31
30
|
}
|
|
32
31
|
export default BsGoods;
|
|
@@ -8,9 +8,8 @@ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _ty
|
|
|
8
8
|
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
9
9
|
import React from "react";
|
|
10
10
|
import GetFormItem from "../../GetFormItem";
|
|
11
|
-
import {
|
|
12
|
-
import
|
|
13
|
-
import { isNull, filterFn as _filterFn } from "@kmkf-fe-packages/kmkf-utils";
|
|
11
|
+
import { BsGoodImage } from "../../Common";
|
|
12
|
+
import { isNull } from "@kmkf-fe-packages/kmkf-utils";
|
|
14
13
|
import { BsGoods as Goods } from "@kmkf-fe-packages/basic-components";
|
|
15
14
|
import { SYMBOL } from "../../../constant";
|
|
16
15
|
var BsGoods = /*#__PURE__*/_createClass(function BsGoods(options) {
|
|
@@ -30,13 +29,11 @@ var BsGoods = /*#__PURE__*/_createClass(function BsGoods(options) {
|
|
|
30
29
|
_defineProperty(this, "children", void 0);
|
|
31
30
|
_defineProperty(this, "dataType", void 0);
|
|
32
31
|
_defineProperty(this, "renderClient", function (record) {
|
|
33
|
-
return !isNull(record === null || record === void 0 ? void 0 : record[_this.id]) ?
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
type: "itemId"
|
|
39
|
-
})
|
|
32
|
+
return !isNull(record === null || record === void 0 ? void 0 : record[_this.id]) ? record === null || record === void 0 ? void 0 : record["".concat(_this.id)].map(function (item, index) {
|
|
33
|
+
return /*#__PURE__*/React.createElement(BsGoodImage, {
|
|
34
|
+
item: item,
|
|
35
|
+
index: index
|
|
36
|
+
});
|
|
40
37
|
}) : null;
|
|
41
38
|
});
|
|
42
39
|
_defineProperty(this, "renderPc", function (value, record) {
|
|
@@ -44,9 +41,11 @@ var BsGoods = /*#__PURE__*/_createClass(function BsGoods(options) {
|
|
|
44
41
|
return /*#__PURE__*/React.createElement("span", null, "--");
|
|
45
42
|
}
|
|
46
43
|
//兼容多个商品
|
|
47
|
-
return
|
|
48
|
-
|
|
49
|
-
|
|
44
|
+
return record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_bsGoods")].map(function (item, index) {
|
|
45
|
+
return /*#__PURE__*/React.createElement(BsGoodImage, {
|
|
46
|
+
item: item,
|
|
47
|
+
index: index
|
|
48
|
+
});
|
|
50
49
|
});
|
|
51
50
|
});
|
|
52
51
|
_defineProperty(this, "renderLog", function (r) {
|
|
@@ -86,16 +85,7 @@ var BsGoods = /*#__PURE__*/_createClass(function BsGoods(options) {
|
|
|
86
85
|
// 过滤组件id
|
|
87
86
|
name: item.name,
|
|
88
87
|
// 过滤组件名称
|
|
89
|
-
filterComponentType: "Input"
|
|
90
|
-
filterFn: function filterFn(value) {
|
|
91
|
-
return function (i) {
|
|
92
|
-
var _ref2;
|
|
93
|
-
return (_ref2 = _filterFn.filterTableListItemColumnValue(i, item.id, "bsGoods") || []) === null || _ref2 === void 0 ? void 0 : _ref2.some(function (item) {
|
|
94
|
-
var _String;
|
|
95
|
-
return item !== null && item !== void 0 && item.numIid ? (_String = String(item === null || item === void 0 ? void 0 : item.numIid)) === null || _String === void 0 ? void 0 : _String.includes(value) : false;
|
|
96
|
-
});
|
|
97
|
-
};
|
|
98
|
-
}
|
|
88
|
+
filterComponentType: "Input"
|
|
99
89
|
};
|
|
100
90
|
});
|
|
101
91
|
this.name = options.name;
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { ComponentInterface, PickOption, ColumnConfig, Record } from "../../../type";
|
|
2
2
|
import React from "react";
|
|
3
|
+
import BsGoodImage from "../common/BsGoodImage";
|
|
4
|
+
import BsType from "../common/BsType";
|
|
5
|
+
import BsMemo from "../common/BsMemo";
|
|
3
6
|
declare class BsReissue implements ComponentInterface {
|
|
4
7
|
name: string;
|
|
5
8
|
id: string;
|
|
@@ -13,20 +16,32 @@ declare class BsReissue implements ComponentInterface {
|
|
|
13
16
|
canSort: boolean;
|
|
14
17
|
children: ComponentInterface[];
|
|
15
18
|
dataType: ComponentInterface["dataType"];
|
|
19
|
+
goodImage: BsGoodImage;
|
|
20
|
+
bsType: BsType;
|
|
21
|
+
bsMemo: BsMemo;
|
|
16
22
|
constructor(options: PickOption);
|
|
17
23
|
renderClient: (record: any) => React.JSX.Element | null;
|
|
18
|
-
renderPc: (value: unknown, record: Record) =>
|
|
19
|
-
renderLog: (r: Record) =>
|
|
24
|
+
renderPc: (value: unknown, record: Record) => any;
|
|
25
|
+
renderLog: (r: Record) => any;
|
|
20
26
|
getComponentValue: (r: Record) => any;
|
|
21
|
-
renderExport: (
|
|
27
|
+
renderExport: () => null;
|
|
22
28
|
editRender: (p: any) => React.JSX.Element;
|
|
23
|
-
filterConfig: (item: ColumnConfig) => {
|
|
29
|
+
filterConfig: (item: ColumnConfig) => ({
|
|
30
|
+
searchDefaultConditions: "eq";
|
|
31
|
+
type: string;
|
|
32
|
+
id: string;
|
|
33
|
+
name: string;
|
|
34
|
+
filterComponentType: "Cascader";
|
|
35
|
+
props: {
|
|
36
|
+
options: any[] | undefined;
|
|
37
|
+
};
|
|
38
|
+
filterFn: (value: string) => (i: Record) => boolean;
|
|
39
|
+
} | {
|
|
24
40
|
searchDefaultConditions: "like";
|
|
25
41
|
type: string;
|
|
26
42
|
id: string;
|
|
27
43
|
name: string;
|
|
28
44
|
filterComponentType: "Input";
|
|
29
|
-
|
|
30
|
-
};
|
|
45
|
+
})[];
|
|
31
46
|
}
|
|
32
47
|
export default BsReissue;
|
|
@@ -1,4 +1,6 @@
|
|
|
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; }
|
|
2
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); }
|
|
3
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); } }
|
|
4
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; }
|
|
@@ -10,9 +12,11 @@ import React from "react";
|
|
|
10
12
|
import GetFormItem from "../../GetFormItem";
|
|
11
13
|
import { GoodImage } from "../../Common";
|
|
12
14
|
import ItemView from "../../../commonComponents/ItemView";
|
|
13
|
-
import { isNull
|
|
15
|
+
import { isNull } from "@kmkf-fe-packages/kmkf-utils";
|
|
14
16
|
import { BsReissue as Reissue } from "@kmkf-fe-packages/basic-components";
|
|
15
|
-
import
|
|
17
|
+
import BsGoodImage from "../common/BsGoodImage";
|
|
18
|
+
import BsType from "../common/BsType";
|
|
19
|
+
import BsMemo from "../common/BsMemo";
|
|
16
20
|
var BsReissue = /*#__PURE__*/_createClass(function BsReissue(options) {
|
|
17
21
|
var _this = this,
|
|
18
22
|
_this$componentConfig2;
|
|
@@ -29,6 +33,9 @@ var BsReissue = /*#__PURE__*/_createClass(function BsReissue(options) {
|
|
|
29
33
|
_defineProperty(this, "canSort", void 0);
|
|
30
34
|
_defineProperty(this, "children", void 0);
|
|
31
35
|
_defineProperty(this, "dataType", void 0);
|
|
36
|
+
_defineProperty(this, "goodImage", void 0);
|
|
37
|
+
_defineProperty(this, "bsType", void 0);
|
|
38
|
+
_defineProperty(this, "bsMemo", void 0);
|
|
32
39
|
_defineProperty(this, "renderClient", function (record) {
|
|
33
40
|
return !isNull(record === null || record === void 0 ? void 0 : record[_this.id]) ? /*#__PURE__*/React.createElement(ItemView, {
|
|
34
41
|
id: _this.id,
|
|
@@ -40,14 +47,7 @@ var BsReissue = /*#__PURE__*/_createClass(function BsReissue(options) {
|
|
|
40
47
|
}) : null;
|
|
41
48
|
});
|
|
42
49
|
_defineProperty(this, "renderPc", function (value, record) {
|
|
43
|
-
|
|
44
|
-
return /*#__PURE__*/React.createElement("span", null, "--");
|
|
45
|
-
}
|
|
46
|
-
//兼容多个商品
|
|
47
|
-
return /*#__PURE__*/React.createElement(GoodImage, {
|
|
48
|
-
list: record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_bsReissueGoods")],
|
|
49
|
-
type: "itemId"
|
|
50
|
-
});
|
|
50
|
+
return _this.goodImage.renderPc(value, record);
|
|
51
51
|
});
|
|
52
52
|
_defineProperty(this, "renderLog", function (r) {
|
|
53
53
|
if (isNull(r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_bsReissueGoods")])) return null;
|
|
@@ -56,11 +56,8 @@ var BsReissue = /*#__PURE__*/_createClass(function BsReissue(options) {
|
|
|
56
56
|
_defineProperty(this, "getComponentValue", function (r) {
|
|
57
57
|
return r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_bsReissueGoods")];
|
|
58
58
|
});
|
|
59
|
-
_defineProperty(this, "renderExport", function (
|
|
60
|
-
|
|
61
|
-
return (_ref = (record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_bsReissueGoods")]) || []) === null || _ref === void 0 ? void 0 : _ref.map(function (i) {
|
|
62
|
-
return i.numIid;
|
|
63
|
-
}).join("\n");
|
|
59
|
+
_defineProperty(this, "renderExport", function () {
|
|
60
|
+
return null;
|
|
64
61
|
});
|
|
65
62
|
_defineProperty(this, "editRender", function (p) {
|
|
66
63
|
var _this$componentConfig, _this$effects, _this$effects2;
|
|
@@ -79,24 +76,7 @@ var BsReissue = /*#__PURE__*/_createClass(function BsReissue(options) {
|
|
|
79
76
|
});
|
|
80
77
|
});
|
|
81
78
|
_defineProperty(this, "filterConfig", function (item) {
|
|
82
|
-
return
|
|
83
|
-
searchDefaultConditions: SYMBOL.like,
|
|
84
|
-
type: item.type,
|
|
85
|
-
id: "".concat(item.id, "_bsReissueGoods"),
|
|
86
|
-
// 过滤组件id
|
|
87
|
-
name: item.name,
|
|
88
|
-
// 过滤组件名称
|
|
89
|
-
filterComponentType: "Input",
|
|
90
|
-
filterFn: function filterFn(value) {
|
|
91
|
-
return function (i) {
|
|
92
|
-
var _ref2;
|
|
93
|
-
return (_ref2 = _filterFn.filterTableListItemColumnValue(i, item.id, "bsGoods") || []) === null || _ref2 === void 0 ? void 0 : _ref2.some(function (item) {
|
|
94
|
-
var _String;
|
|
95
|
-
return item !== null && item !== void 0 && item.numIid ? (_String = String(item === null || item === void 0 ? void 0 : item.numIid)) === null || _String === void 0 ? void 0 : _String.includes(value) : false;
|
|
96
|
-
});
|
|
97
|
-
};
|
|
98
|
-
}
|
|
99
|
-
};
|
|
79
|
+
return [_this.bsType.filterConfig(item), _this.goodImage.filterConfig(item)];
|
|
100
80
|
});
|
|
101
81
|
this.name = options.name;
|
|
102
82
|
this.id = options.id;
|
|
@@ -106,13 +86,26 @@ var BsReissue = /*#__PURE__*/_createClass(function BsReissue(options) {
|
|
|
106
86
|
this.effects = options === null || options === void 0 ? void 0 : options.effects;
|
|
107
87
|
this.isCombinationComponent = false;
|
|
108
88
|
this.canSort = false;
|
|
109
|
-
this.
|
|
89
|
+
this.goodImage = new BsGoodImage(_objectSpread(_objectSpread({}, options), {}, {
|
|
90
|
+
id: "".concat(options.id, "_bsReissueGoods"),
|
|
91
|
+
name: "补发商品"
|
|
92
|
+
}));
|
|
93
|
+
this.bsType = new BsType(_objectSpread(_objectSpread({}, options), {}, {
|
|
94
|
+
id: "".concat(options.id, "_bsReissueType"),
|
|
95
|
+
name: "补发类型"
|
|
96
|
+
}));
|
|
97
|
+
this.bsMemo = new BsMemo(_objectSpread(_objectSpread({}, options), {}, {
|
|
98
|
+
id: "".concat(options.id, "_bsReissueType"),
|
|
99
|
+
name: "补发备注"
|
|
100
|
+
}));
|
|
101
|
+
this.children = [this.goodImage, this.bsType, this.bsMemo];
|
|
110
102
|
this.componentConfig = options === null || options === void 0 ? void 0 : options.componentConfig;
|
|
111
103
|
this.rules = this !== null && this !== void 0 && (_this$componentConfig2 = this.componentConfig) !== null && _this$componentConfig2 !== void 0 && _this$componentConfig2.required ? [{
|
|
112
104
|
required: true,
|
|
113
105
|
validator: function validator(_, value) {
|
|
114
|
-
|
|
115
|
-
|
|
106
|
+
var _value$bsReissueGoods;
|
|
107
|
+
if (!value || !(value !== null && value !== void 0 && (_value$bsReissueGoods = value.bsReissueGoods) !== null && _value$bsReissueGoods !== void 0 && _value$bsReissueGoods.length)) {
|
|
108
|
+
return Promise.reject(new Error("请选择bs补发商品"));
|
|
116
109
|
}
|
|
117
110
|
return Promise.resolve();
|
|
118
111
|
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { ComponentInterface, PickOption, ColumnConfig, ALignType, Record } from "../../../type";
|
|
2
|
+
import React from "react";
|
|
3
|
+
declare class BsExchangeGoodImage implements ComponentInterface {
|
|
4
|
+
name: string;
|
|
5
|
+
id: string;
|
|
6
|
+
sortField: string;
|
|
7
|
+
type: string;
|
|
8
|
+
componentConfig: ComponentInterface["componentConfig"];
|
|
9
|
+
align: ALignType;
|
|
10
|
+
width: number;
|
|
11
|
+
isCombinationComponent: boolean;
|
|
12
|
+
formField: string;
|
|
13
|
+
canSort: boolean;
|
|
14
|
+
children: ComponentInterface[];
|
|
15
|
+
dataType: ComponentInterface["dataType"];
|
|
16
|
+
constructor(options: PickOption);
|
|
17
|
+
getComponentValue: () => null;
|
|
18
|
+
renderClient: (record: any) => React.JSX.Element | null;
|
|
19
|
+
renderPc: (value: unknown, record: Record) => React.JSX.Element;
|
|
20
|
+
renderLog: (r: Record) => React.JSX.Element | null;
|
|
21
|
+
renderExport: (value: string, record: Record) => null;
|
|
22
|
+
editRender: () => null;
|
|
23
|
+
filterConfig: (item: ColumnConfig) => {
|
|
24
|
+
searchDefaultConditions: "like";
|
|
25
|
+
type: string;
|
|
26
|
+
id: string;
|
|
27
|
+
name: string;
|
|
28
|
+
filterComponentType: "Input";
|
|
29
|
+
}[];
|
|
30
|
+
}
|
|
31
|
+
export default BsExchangeGoodImage;
|
|
@@ -0,0 +1,126 @@
|
|
|
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
|
+
import React from "react";
|
|
9
|
+
import { maxBy } from "lodash";
|
|
10
|
+
import ItemView from "../../../commonComponents/ItemView";
|
|
11
|
+
import { isNull } from "@kmkf-fe-packages/kmkf-utils";
|
|
12
|
+
import { SYMBOL } from "../../../constant";
|
|
13
|
+
import { BsGoodImage as BsGood, BsExchangeList } from "../../Common";
|
|
14
|
+
var BsExchangeGoodImage = /*#__PURE__*/_createClass(function BsExchangeGoodImage(options) {
|
|
15
|
+
var _this = this;
|
|
16
|
+
_classCallCheck(this, BsExchangeGoodImage);
|
|
17
|
+
_defineProperty(this, "name", void 0);
|
|
18
|
+
_defineProperty(this, "id", void 0);
|
|
19
|
+
_defineProperty(this, "sortField", void 0);
|
|
20
|
+
_defineProperty(this, "type", void 0);
|
|
21
|
+
_defineProperty(this, "componentConfig", void 0);
|
|
22
|
+
_defineProperty(this, "align", void 0);
|
|
23
|
+
_defineProperty(this, "width", void 0);
|
|
24
|
+
_defineProperty(this, "isCombinationComponent", void 0);
|
|
25
|
+
_defineProperty(this, "formField", void 0);
|
|
26
|
+
_defineProperty(this, "canSort", void 0);
|
|
27
|
+
_defineProperty(this, "children", void 0);
|
|
28
|
+
_defineProperty(this, "dataType", void 0);
|
|
29
|
+
_defineProperty(this, "getComponentValue", function () {
|
|
30
|
+
return null;
|
|
31
|
+
});
|
|
32
|
+
_defineProperty(this, "renderClient", function (record) {
|
|
33
|
+
return !isNull(record === null || record === void 0 ? void 0 : record[_this.id]) ? /*#__PURE__*/React.createElement(ItemView, {
|
|
34
|
+
id: _this.id,
|
|
35
|
+
label: _this.name,
|
|
36
|
+
value: _this.renderPc(undefined, record)
|
|
37
|
+
}) : null;
|
|
38
|
+
});
|
|
39
|
+
_defineProperty(this, "renderPc", function (value, record) {
|
|
40
|
+
if ((record === null || record === void 0 ? void 0 : record["".concat(_this.id)]) === undefined) {
|
|
41
|
+
return /*#__PURE__*/React.createElement("span", null, "--");
|
|
42
|
+
}
|
|
43
|
+
var type = record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_bsExchangeType")];
|
|
44
|
+
var returnGoods = record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_bsExchangeReturnGoods")];
|
|
45
|
+
var swapOutGoods = record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_bsExchangeSwapOutGoods")];
|
|
46
|
+
var giftGoods = record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_bsExchangeGiftGoods")];
|
|
47
|
+
var newReturnGoods = [];
|
|
48
|
+
if (["1", "3"].includes(type === null || type === void 0 ? void 0 : type[0])) {
|
|
49
|
+
newReturnGoods = returnGoods.reduce(function (prv, next) {
|
|
50
|
+
prv.push({
|
|
51
|
+
returnGood: next,
|
|
52
|
+
swapGood: next
|
|
53
|
+
});
|
|
54
|
+
return prv;
|
|
55
|
+
}, []);
|
|
56
|
+
} else if (["2", "4"].includes(type === null || type === void 0 ? void 0 : type[0])) {
|
|
57
|
+
var maxLen = maxBy(returnGoods, function (t) {
|
|
58
|
+
return t.index;
|
|
59
|
+
});
|
|
60
|
+
var newGoods = Array(maxLen.index).fill({
|
|
61
|
+
returnGood: [],
|
|
62
|
+
swapGood: []
|
|
63
|
+
});
|
|
64
|
+
returnGoods.forEach(function (item) {
|
|
65
|
+
newGoods[item.index].returnGood.push(item);
|
|
66
|
+
});
|
|
67
|
+
swapOutGoods.forEach(function (item) {
|
|
68
|
+
newGoods[item.index].swapGood.push(item);
|
|
69
|
+
});
|
|
70
|
+
newReturnGoods = newGoods;
|
|
71
|
+
}
|
|
72
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(BsExchangeList, {
|
|
73
|
+
list: newReturnGoods
|
|
74
|
+
}), (giftGoods || []).map(function (item, index) {
|
|
75
|
+
return /*#__PURE__*/React.createElement(BsGood, {
|
|
76
|
+
item: item,
|
|
77
|
+
index: index
|
|
78
|
+
});
|
|
79
|
+
}));
|
|
80
|
+
});
|
|
81
|
+
_defineProperty(this, "renderLog", function (r) {
|
|
82
|
+
if (isNull(r === null || r === void 0 ? void 0 : r[_this.id])) return null;
|
|
83
|
+
return _this.renderPc(undefined, r);
|
|
84
|
+
});
|
|
85
|
+
_defineProperty(this, "renderExport", function (value, record) {
|
|
86
|
+
return null;
|
|
87
|
+
});
|
|
88
|
+
_defineProperty(this, "editRender", function () {
|
|
89
|
+
return null;
|
|
90
|
+
});
|
|
91
|
+
_defineProperty(this, "filterConfig", function (item) {
|
|
92
|
+
var subKey = item.subKey;
|
|
93
|
+
return [{
|
|
94
|
+
searchDefaultConditions: SYMBOL.like,
|
|
95
|
+
type: item.type,
|
|
96
|
+
id: "".concat(item.id, "_bsExchangeReturnGoods"),
|
|
97
|
+
name: "".concat(_this.name, "-\u9000\u56DE\u5546\u54C1"),
|
|
98
|
+
filterComponentType: "Input"
|
|
99
|
+
}, {
|
|
100
|
+
searchDefaultConditions: SYMBOL.like,
|
|
101
|
+
type: item.type,
|
|
102
|
+
id: "".concat(item.id, "_bsExchangeSwapOutGoods"),
|
|
103
|
+
name: "".concat(_this.name, "-\u6362\u8D27\u5546\u54C1"),
|
|
104
|
+
filterComponentType: "Input"
|
|
105
|
+
}, {
|
|
106
|
+
searchDefaultConditions: SYMBOL.like,
|
|
107
|
+
type: item.type,
|
|
108
|
+
id: "".concat(item.id, "_bsExchangeGiftGoods"),
|
|
109
|
+
name: "".concat(_this.name, "-\u8D60\u54C1\u5546\u54C1"),
|
|
110
|
+
filterComponentType: "Input"
|
|
111
|
+
}];
|
|
112
|
+
});
|
|
113
|
+
this.name = options.name;
|
|
114
|
+
this.id = options.id;
|
|
115
|
+
this.sortField = options.id;
|
|
116
|
+
this.formField = options.id;
|
|
117
|
+
this.type = options.type;
|
|
118
|
+
this.componentConfig = options.componentConfig;
|
|
119
|
+
this.align = "left";
|
|
120
|
+
this.width = 300;
|
|
121
|
+
this.isCombinationComponent = false;
|
|
122
|
+
this.canSort = true;
|
|
123
|
+
this.dataType = "string";
|
|
124
|
+
this.children = [];
|
|
125
|
+
});
|
|
126
|
+
export default BsExchangeGoodImage;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { ComponentInterface, PickOption, ColumnConfig, ALignType, Record } from "../../../type";
|
|
2
|
+
import React from "react";
|
|
3
|
+
declare class BsGoodImage implements ComponentInterface {
|
|
4
|
+
name: string;
|
|
5
|
+
id: string;
|
|
6
|
+
sortField: string;
|
|
7
|
+
type: string;
|
|
8
|
+
componentConfig: ComponentInterface["componentConfig"];
|
|
9
|
+
align: ALignType;
|
|
10
|
+
width: number;
|
|
11
|
+
isCombinationComponent: boolean;
|
|
12
|
+
formField: string;
|
|
13
|
+
canSort: boolean;
|
|
14
|
+
children: ComponentInterface[];
|
|
15
|
+
dataType: ComponentInterface["dataType"];
|
|
16
|
+
constructor(options: PickOption);
|
|
17
|
+
renderClient: (record: any) => React.JSX.Element | null;
|
|
18
|
+
renderPc: (value: unknown, record: Record) => any;
|
|
19
|
+
renderLog: (r: Record) => any;
|
|
20
|
+
getComponentValue: (r: Record) => any;
|
|
21
|
+
renderExport: (value: string, record: Record) => any;
|
|
22
|
+
editRender: () => null;
|
|
23
|
+
filterConfig: (item: ColumnConfig) => {
|
|
24
|
+
searchDefaultConditions: "like";
|
|
25
|
+
type: string;
|
|
26
|
+
id: string;
|
|
27
|
+
name: string;
|
|
28
|
+
filterComponentType: "Input";
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
export default BsGoodImage;
|