@kmkf-fe-packages/services-components 0.8.17-alpha.8 → 0.8.17
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/README.md +3 -3
- package/dist/esm/components/BS/BsReturn/index.d.ts +54 -0
- package/dist/esm/components/BS/BsReturn/index.js +150 -0
- package/dist/esm/components/BS/DeliveryNo/index.d.ts +32 -0
- package/dist/esm/components/BS/DeliveryNo/index.js +137 -0
- package/dist/esm/components/BS/common/BsHeaderGood.d.ts +4 -4
- package/dist/esm/components/BS/common/BsHeaderGood.js +43 -36
- package/dist/esm/components/BS/common/BsMemo.d.ts +4 -4
- package/dist/esm/components/BS/common/BsMemo.js +15 -14
- package/dist/esm/components/BS/common/BsType.d.ts +4 -4
- package/dist/esm/components/BS/common/BsType.js +13 -12
- package/dist/esm/components/Calculation/index.d.ts +31 -0
- package/dist/esm/components/Calculation/index.js +97 -0
- package/dist/esm/components/Common/index.d.ts +1 -0
- package/dist/esm/components/Common/index.js +73 -29
- package/dist/esm/components/CommonMultiStatus/index.d.ts +32 -0
- package/dist/esm/components/CommonMultiStatus/index.js +163 -0
- package/dist/esm/components/CommonSystemOrder/index.d.ts +32 -0
- package/dist/esm/components/CommonSystemOrder/index.js +152 -0
- package/dist/esm/components/CommonTradeId/index.js +1 -4
- package/dist/esm/components/GetFormItem/index.d.ts +4 -2
- package/dist/esm/components/GetFormItem/index.js +10 -3
- package/dist/esm/components/HandlerDeadLine/index.d.ts +43 -0
- package/dist/esm/components/HandlerDeadLine/index.js +85 -0
- package/dist/esm/components/HandlerDeadLine/index.less +3 -0
- package/dist/esm/components/NodeDeadLine/index.d.ts +43 -0
- package/dist/esm/components/NodeDeadLine/index.js +85 -0
- package/dist/esm/components/NodeDeadLine/index.less +3 -0
- package/dist/esm/components/NodeStayDuration/index.d.ts +26 -0
- package/dist/esm/components/NodeStayDuration/index.js +61 -0
- package/dist/esm/components/NodeStayDuration/index.less +3 -0
- package/dist/esm/components/ShopInput/index.d.ts +1 -0
- package/dist/esm/components/ShopInput/index.js +2 -0
- package/dist/esm/components/StatusSelect/index.js +6 -6
- package/dist/esm/components/TextArea/index.d.ts +3 -3
- package/dist/esm/components/TextArea/index.js +9 -9
- package/dist/esm/factory.d.ts +2 -2
- package/dist/esm/factory.js +17 -3
- package/dist/esm/index.d.ts +7 -0
- package/dist/esm/index.js +7 -0
- package/dist/esm/type.d.ts +2 -1
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
###
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
### 关于组件后缀
|
|
2
|
+
- 针对于自定义组件的后缀,在提交的时候是以组件类型的驼峰式来命名的
|
|
3
|
+
-
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { ComponentInterface, PickOption, ColumnConfig, Record } from "../../../type";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { BsType, BsMemo, BsHeaderGood } from "../common/index";
|
|
4
|
+
declare class BsReturn implements ComponentInterface {
|
|
5
|
+
name: string;
|
|
6
|
+
id: string;
|
|
7
|
+
sortField: string;
|
|
8
|
+
type: string;
|
|
9
|
+
rules: any[];
|
|
10
|
+
componentConfig: ComponentInterface["componentConfig"];
|
|
11
|
+
effects: ComponentInterface["effects"];
|
|
12
|
+
isCombinationComponent: boolean;
|
|
13
|
+
formField: string;
|
|
14
|
+
canSort: boolean;
|
|
15
|
+
children: ComponentInterface[];
|
|
16
|
+
dataType: ComponentInterface["dataType"];
|
|
17
|
+
bsType: BsType;
|
|
18
|
+
bsMemo: BsMemo;
|
|
19
|
+
reissueGoods: BsHeaderGood;
|
|
20
|
+
constructor(options: PickOption);
|
|
21
|
+
renderClient: (record: any) => React.JSX.Element | null;
|
|
22
|
+
renderPc: () => null;
|
|
23
|
+
renderLog: (r: Record) => React.JSX.Element;
|
|
24
|
+
getComponentValue: (r: Record) => any;
|
|
25
|
+
renderExport: () => null;
|
|
26
|
+
editRender: (p: any) => React.JSX.Element;
|
|
27
|
+
filterConfig: (item: ColumnConfig) => ({
|
|
28
|
+
searchDefaultConditions: "in";
|
|
29
|
+
type: string;
|
|
30
|
+
id: string;
|
|
31
|
+
name: string;
|
|
32
|
+
filterComponentType: "Cascader";
|
|
33
|
+
props: {
|
|
34
|
+
options: any[] | undefined;
|
|
35
|
+
fieldNames: {
|
|
36
|
+
label: string;
|
|
37
|
+
value: string;
|
|
38
|
+
children: string;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
formatFilterValue: (val: Array<string>) => string[] | undefined;
|
|
42
|
+
filterFn: (value: string) => (i: Record) => boolean;
|
|
43
|
+
} | {
|
|
44
|
+
searchDefaultConditions: "like";
|
|
45
|
+
type: string;
|
|
46
|
+
id: string;
|
|
47
|
+
name: string;
|
|
48
|
+
filterComponentType: "Input";
|
|
49
|
+
props?: undefined;
|
|
50
|
+
formatFilterValue?: undefined;
|
|
51
|
+
filterFn?: undefined;
|
|
52
|
+
})[];
|
|
53
|
+
}
|
|
54
|
+
export default BsReturn;
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
4
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
5
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
6
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
7
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
8
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
9
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
10
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
11
|
+
import React from "react";
|
|
12
|
+
import GetFormItem from "../../GetFormItem";
|
|
13
|
+
import ItemView from "../../../commonComponents/ItemView";
|
|
14
|
+
import { isNull, filterFn as _filterFn } from "@kmkf-fe-packages/kmkf-utils";
|
|
15
|
+
import { BsReturn as BsReturnGoods } from "@kmkf-fe-packages/basic-components";
|
|
16
|
+
import { SYMBOL } from "../../../constant";
|
|
17
|
+
import { BsGoodsTable } from "../../Common";
|
|
18
|
+
import { BsType, BsMemo, BsHeaderGood } from "../common/index";
|
|
19
|
+
var BsReturn = /*#__PURE__*/_createClass(function BsReturn(options) {
|
|
20
|
+
var _this = this,
|
|
21
|
+
_this$componentConfig4;
|
|
22
|
+
_classCallCheck(this, BsReturn);
|
|
23
|
+
_defineProperty(this, "name", void 0);
|
|
24
|
+
_defineProperty(this, "id", void 0);
|
|
25
|
+
_defineProperty(this, "sortField", void 0);
|
|
26
|
+
_defineProperty(this, "type", void 0);
|
|
27
|
+
_defineProperty(this, "rules", void 0);
|
|
28
|
+
_defineProperty(this, "componentConfig", void 0);
|
|
29
|
+
_defineProperty(this, "effects", void 0);
|
|
30
|
+
_defineProperty(this, "isCombinationComponent", void 0);
|
|
31
|
+
_defineProperty(this, "formField", void 0);
|
|
32
|
+
_defineProperty(this, "canSort", void 0);
|
|
33
|
+
_defineProperty(this, "children", void 0);
|
|
34
|
+
_defineProperty(this, "dataType", void 0);
|
|
35
|
+
_defineProperty(this, "bsType", void 0);
|
|
36
|
+
_defineProperty(this, "bsMemo", void 0);
|
|
37
|
+
_defineProperty(this, "reissueGoods", void 0);
|
|
38
|
+
_defineProperty(this, "renderClient", function (record) {
|
|
39
|
+
var _this$componentConfig;
|
|
40
|
+
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), record !== null && record !== void 0 && record["".concat(_this.id)].bsReturnGoods.length ? /*#__PURE__*/React.createElement(ItemView, {
|
|
41
|
+
id: _this.id,
|
|
42
|
+
label: _this.name,
|
|
43
|
+
value: /*#__PURE__*/React.createElement(BsGoodsTable, {
|
|
44
|
+
list: (record === null || record === void 0 ? void 0 : record["".concat(_this.id)].bsReturnGoods) || [],
|
|
45
|
+
showHeader: ((_this$componentConfig = _this.componentConfig) === null || _this$componentConfig === void 0 ? void 0 : _this$componentConfig.showHeader) || []
|
|
46
|
+
})
|
|
47
|
+
}) : null) : null;
|
|
48
|
+
});
|
|
49
|
+
_defineProperty(this, "renderPc", function () {
|
|
50
|
+
return null;
|
|
51
|
+
});
|
|
52
|
+
_defineProperty(this, "renderLog", function (r) {
|
|
53
|
+
var _this$componentConfig2;
|
|
54
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", null, "\u5907\u6CE8\u7C7B\u578B:", _this.bsType.renderLog(r)), /*#__PURE__*/React.createElement("div", null, "\u5907\u6CE8\u4FE1\u606F:", _this.bsMemo.renderLog(r)), /*#__PURE__*/React.createElement("div", null, "\u5546\u54C1\uFF1A", /*#__PURE__*/React.createElement(BsGoodsTable, {
|
|
55
|
+
list: (r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_bsReturnGoods")]) || [],
|
|
56
|
+
showHeader: ((_this$componentConfig2 = _this.componentConfig) === null || _this$componentConfig2 === void 0 ? void 0 : _this$componentConfig2.showHeader) || []
|
|
57
|
+
})));
|
|
58
|
+
});
|
|
59
|
+
_defineProperty(this, "getComponentValue", function (r) {
|
|
60
|
+
return r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_bsReturnGoods")];
|
|
61
|
+
});
|
|
62
|
+
_defineProperty(this, "renderExport", function () {
|
|
63
|
+
return null;
|
|
64
|
+
});
|
|
65
|
+
_defineProperty(this, "editRender", function (p) {
|
|
66
|
+
var _this$componentConfig3, _this$effects, _this$effects2, _this$effects3;
|
|
67
|
+
return /*#__PURE__*/React.createElement(GetFormItem, {
|
|
68
|
+
title: _this.name,
|
|
69
|
+
name: _this.id,
|
|
70
|
+
rules: _this.rules,
|
|
71
|
+
required: false,
|
|
72
|
+
hidden: p === null || p === void 0 ? void 0 : p.hidden,
|
|
73
|
+
component: /*#__PURE__*/React.createElement(BsReturnGoods, _extends({}, _this.componentConfig, {
|
|
74
|
+
maxLength: ((_this$componentConfig3 = _this.componentConfig) === null || _this$componentConfig3 === void 0 ? void 0 : _this$componentConfig3.maxLength) || 20,
|
|
75
|
+
shopId: (_this$effects = _this.effects) === null || _this$effects === void 0 ? void 0 : _this$effects.shopId,
|
|
76
|
+
shopList: ((_this$effects2 = _this.effects) === null || _this$effects2 === void 0 ? void 0 : _this$effects2.shopList) || [],
|
|
77
|
+
companyKey: (_this$effects3 = _this.effects) === null || _this$effects3 === void 0 ? void 0 : _this$effects3.companyKey,
|
|
78
|
+
width: "90%"
|
|
79
|
+
}))
|
|
80
|
+
});
|
|
81
|
+
});
|
|
82
|
+
_defineProperty(this, "filterConfig", function (item) {
|
|
83
|
+
var _item$templateConfig;
|
|
84
|
+
return [{
|
|
85
|
+
searchDefaultConditions: SYMBOL.in,
|
|
86
|
+
type: item.type,
|
|
87
|
+
id: "".concat(item.id, "_bsReturnType"),
|
|
88
|
+
name: "".concat(item.name, "-\u9000\u8D27\u7C7B\u578B"),
|
|
89
|
+
filterComponentType: "Cascader",
|
|
90
|
+
props: {
|
|
91
|
+
options: item === null || item === void 0 ? void 0 : (_item$templateConfig = item.templateConfig) === null || _item$templateConfig === void 0 ? void 0 : _item$templateConfig.reasonList,
|
|
92
|
+
fieldNames: {
|
|
93
|
+
label: "label",
|
|
94
|
+
value: "value",
|
|
95
|
+
children: "children"
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
formatFilterValue: function formatFilterValue(val) {
|
|
99
|
+
if ((val === null || val === void 0 ? void 0 : val.length) > 0) {
|
|
100
|
+
return [val[val.length - 1]];
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
filterFn: function filterFn(value) {
|
|
104
|
+
return function (i) {
|
|
105
|
+
return _filterFn.filterSplitComma(_filterFn.filterTableListItemColumnValue(i, item.id, "bsReturnType"), value);
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
}, {
|
|
109
|
+
searchDefaultConditions: SYMBOL.like,
|
|
110
|
+
type: item.type,
|
|
111
|
+
id: "".concat(item.id, "_bsReturnGoods"),
|
|
112
|
+
name: "".concat(_this.name),
|
|
113
|
+
filterComponentType: "Input"
|
|
114
|
+
}];
|
|
115
|
+
});
|
|
116
|
+
this.name = options.name;
|
|
117
|
+
this.id = options.id;
|
|
118
|
+
this.sortField = "".concat(options.id);
|
|
119
|
+
this.formField = "".concat(options.id);
|
|
120
|
+
this.type = options.type;
|
|
121
|
+
this.effects = options === null || options === void 0 ? void 0 : options.effects;
|
|
122
|
+
this.isCombinationComponent = true;
|
|
123
|
+
this.canSort = false;
|
|
124
|
+
this.bsType = new BsType(_objectSpread(_objectSpread({}, options), {}, {
|
|
125
|
+
id: "".concat(options.id, "_bsReturnType"),
|
|
126
|
+
name: "退货类型"
|
|
127
|
+
}));
|
|
128
|
+
this.bsMemo = new BsMemo(_objectSpread(_objectSpread({}, options), {}, {
|
|
129
|
+
id: "".concat(options.id, "_bsReturnType_memo"),
|
|
130
|
+
name: "退货备注"
|
|
131
|
+
}));
|
|
132
|
+
this.reissueGoods = new BsHeaderGood(_objectSpread(_objectSpread({}, options), {}, {
|
|
133
|
+
id: "".concat(options.id, "_bsReturnGoods"),
|
|
134
|
+
name: "商品信息"
|
|
135
|
+
}));
|
|
136
|
+
this.children = [this.bsType, this.bsMemo, this.reissueGoods];
|
|
137
|
+
this.componentConfig = options === null || options === void 0 ? void 0 : options.componentConfig;
|
|
138
|
+
this.rules = this !== null && this !== void 0 && (_this$componentConfig4 = this.componentConfig) !== null && _this$componentConfig4 !== void 0 && _this$componentConfig4.required ? [{
|
|
139
|
+
required: true,
|
|
140
|
+
validator: function validator(_, value) {
|
|
141
|
+
var _value$bsReturnGoods;
|
|
142
|
+
if (!value || !(value !== null && value !== void 0 && (_value$bsReturnGoods = value.bsReturnGoods) !== null && _value$bsReturnGoods !== void 0 && _value$bsReturnGoods.length)) {
|
|
143
|
+
return Promise.reject(new Error("请选择bs退货商品"));
|
|
144
|
+
}
|
|
145
|
+
return Promise.resolve();
|
|
146
|
+
}
|
|
147
|
+
}] : [];
|
|
148
|
+
this.dataType = "object";
|
|
149
|
+
});
|
|
150
|
+
export default BsReturn;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { ComponentInterface, PickOption, ColumnConfig, ALignType, Record } from "../../../type";
|
|
2
|
+
import React from "react";
|
|
3
|
+
declare class DeliveryNo implements ComponentInterface {
|
|
4
|
+
name: string;
|
|
5
|
+
id: string;
|
|
6
|
+
sortField: string;
|
|
7
|
+
type: string;
|
|
8
|
+
rules: any[];
|
|
9
|
+
componentConfig: ComponentInterface["componentConfig"];
|
|
10
|
+
align: ALignType;
|
|
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: any, record: Record) => React.JSX.Element;
|
|
19
|
+
renderLog: (r: Record) => React.JSX.Element | null;
|
|
20
|
+
getComponentValue: (r: Record) => any;
|
|
21
|
+
renderExport: (value: any, record: any) => any;
|
|
22
|
+
editRender: (p: any) => React.JSX.Element;
|
|
23
|
+
filterConfig: (item: ColumnConfig) => {
|
|
24
|
+
searchDefaultConditions: "like";
|
|
25
|
+
type: string;
|
|
26
|
+
id: string;
|
|
27
|
+
name: string;
|
|
28
|
+
filterComponentType: "Input";
|
|
29
|
+
filterFn: (value: string) => (i: Record) => boolean;
|
|
30
|
+
}[];
|
|
31
|
+
}
|
|
32
|
+
export default DeliveryNo;
|
|
@@ -0,0 +1,137 @@
|
|
|
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 _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
|
+
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
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
5
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
6
|
+
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; }
|
|
7
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
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
|
+
import React from "react";
|
|
10
|
+
import some from "lodash/some";
|
|
11
|
+
import GetFormItem from "../../GetFormItem";
|
|
12
|
+
import { CommonOrderContent } from "../../Common";
|
|
13
|
+
import { CommonSystemOrder } from "@kmkf-fe-packages/basic-components";
|
|
14
|
+
import ItemView from "../../../commonComponents/ItemView";
|
|
15
|
+
import { isNull, filterFn as _filterFn } from "@kmkf-fe-packages/kmkf-utils";
|
|
16
|
+
import { SYMBOL } from "../../../constant";
|
|
17
|
+
var typeMap = {
|
|
18
|
+
BS_DELIVERY_NO: {
|
|
19
|
+
key: "deliveryNoList",
|
|
20
|
+
code: "deliveryNoIds"
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
var DeliveryNo = /*#__PURE__*/_createClass(function DeliveryNo(options) {
|
|
24
|
+
var _this = this,
|
|
25
|
+
_typeMap$options$type,
|
|
26
|
+
_typeMap$options$type2,
|
|
27
|
+
_this$componentConfig3;
|
|
28
|
+
_classCallCheck(this, DeliveryNo);
|
|
29
|
+
_defineProperty(this, "name", void 0);
|
|
30
|
+
_defineProperty(this, "id", void 0);
|
|
31
|
+
_defineProperty(this, "sortField", void 0);
|
|
32
|
+
_defineProperty(this, "type", void 0);
|
|
33
|
+
_defineProperty(this, "rules", void 0);
|
|
34
|
+
_defineProperty(this, "componentConfig", void 0);
|
|
35
|
+
_defineProperty(this, "align", void 0);
|
|
36
|
+
_defineProperty(this, "isCombinationComponent", void 0);
|
|
37
|
+
_defineProperty(this, "formField", void 0);
|
|
38
|
+
_defineProperty(this, "canSort", void 0);
|
|
39
|
+
_defineProperty(this, "children", void 0);
|
|
40
|
+
_defineProperty(this, "dataType", void 0);
|
|
41
|
+
_defineProperty(this, "renderClient", function (record) {
|
|
42
|
+
var isShow = Array.isArray(record === null || record === void 0 ? void 0 : record[_this.id]) ? some(record === null || record === void 0 ? void 0 : record[_this.id], function (item) {
|
|
43
|
+
return !isNull(item);
|
|
44
|
+
}) : false;
|
|
45
|
+
return isShow ? /*#__PURE__*/React.createElement(ItemView, {
|
|
46
|
+
id: _this.id,
|
|
47
|
+
label: _this.name,
|
|
48
|
+
value: /*#__PURE__*/React.createElement(CommonOrderContent, {
|
|
49
|
+
list: record === null || record === void 0 ? void 0 : record[_this.id],
|
|
50
|
+
type: 1
|
|
51
|
+
})
|
|
52
|
+
}) : null;
|
|
53
|
+
});
|
|
54
|
+
_defineProperty(this, "renderPc", function (value, record) {
|
|
55
|
+
var _typeMap$_this$type;
|
|
56
|
+
var list = record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_").concat((_typeMap$_this$type = typeMap[_this.type]) === null || _typeMap$_this$type === void 0 ? void 0 : _typeMap$_this$type.key)];
|
|
57
|
+
//兼容多个商品
|
|
58
|
+
return /*#__PURE__*/React.createElement("span", {
|
|
59
|
+
onClick: function onClick(e) {
|
|
60
|
+
return e.stopPropagation();
|
|
61
|
+
}
|
|
62
|
+
}, /*#__PURE__*/React.createElement(CommonOrderContent, {
|
|
63
|
+
list: list,
|
|
64
|
+
type: 1
|
|
65
|
+
}));
|
|
66
|
+
});
|
|
67
|
+
_defineProperty(this, "renderLog", function (r) {
|
|
68
|
+
var _typeMap$_this$type2;
|
|
69
|
+
var list = r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_").concat((_typeMap$_this$type2 = typeMap[_this.type]) === null || _typeMap$_this$type2 === void 0 ? void 0 : _typeMap$_this$type2.key)];
|
|
70
|
+
if (isNull(list)) return null;
|
|
71
|
+
return _this.renderPc(undefined, r);
|
|
72
|
+
});
|
|
73
|
+
_defineProperty(this, "getComponentValue", function (r) {
|
|
74
|
+
var _typeMap$_this$type3;
|
|
75
|
+
return r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_").concat((_typeMap$_this$type3 = typeMap[_this.type]) === null || _typeMap$_this$type3 === void 0 ? void 0 : _typeMap$_this$type3.key)];
|
|
76
|
+
});
|
|
77
|
+
_defineProperty(this, "renderExport", function (value, record) {
|
|
78
|
+
var _typeMap$_this$type4;
|
|
79
|
+
var list = record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_").concat((_typeMap$_this$type4 = typeMap[_this.type]) === null || _typeMap$_this$type4 === void 0 ? void 0 : _typeMap$_this$type4.key)];
|
|
80
|
+
return (list || []).map(function (item) {
|
|
81
|
+
return item === null || item === void 0 ? void 0 : item.deliveryNo;
|
|
82
|
+
}).join(",");
|
|
83
|
+
});
|
|
84
|
+
_defineProperty(this, "editRender", function (p) {
|
|
85
|
+
var _this$componentConfig, _this$componentConfig2;
|
|
86
|
+
return /*#__PURE__*/React.createElement(GetFormItem, {
|
|
87
|
+
title: _this.name,
|
|
88
|
+
name: _this.id,
|
|
89
|
+
rules: _this.rules,
|
|
90
|
+
hidden: p === null || p === void 0 ? void 0 : p.hidden,
|
|
91
|
+
required: (_this$componentConfig = (_this$componentConfig2 = _this.componentConfig) === null || _this$componentConfig2 === void 0 ? void 0 : _this$componentConfig2.required) !== null && _this$componentConfig !== void 0 ? _this$componentConfig : false,
|
|
92
|
+
component: /*#__PURE__*/React.createElement(CommonSystemOrder, _extends({}, _this.componentConfig, {
|
|
93
|
+
type: 1
|
|
94
|
+
}))
|
|
95
|
+
});
|
|
96
|
+
});
|
|
97
|
+
_defineProperty(this, "filterConfig", function (item) {
|
|
98
|
+
var _typeMap$_this$type5;
|
|
99
|
+
return [{
|
|
100
|
+
searchDefaultConditions: SYMBOL.like,
|
|
101
|
+
type: item.type,
|
|
102
|
+
id: "".concat(item.id, "_").concat((_typeMap$_this$type5 = typeMap[_this.type]) === null || _typeMap$_this$type5 === void 0 ? void 0 : _typeMap$_this$type5.code),
|
|
103
|
+
name: "".concat(_this.name),
|
|
104
|
+
filterComponentType: "Input",
|
|
105
|
+
filterFn: function filterFn(value) {
|
|
106
|
+
return function (i) {
|
|
107
|
+
var _typeMap$_this$type6;
|
|
108
|
+
return _filterFn.filterSplitComma(_filterFn.filterTableListItemColumnValue(i, item.id, (_typeMap$_this$type6 = typeMap[_this.type]) === null || _typeMap$_this$type6 === void 0 ? void 0 : _typeMap$_this$type6.code), value);
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
}];
|
|
112
|
+
});
|
|
113
|
+
this.name = options.name;
|
|
114
|
+
this.id = options.id;
|
|
115
|
+
this.sortField = "".concat(options.id, "_").concat((_typeMap$options$type = typeMap[options.type]) === null || _typeMap$options$type === void 0 ? void 0 : _typeMap$options$type.key);
|
|
116
|
+
this.formField = "".concat(options.id, "_").concat((_typeMap$options$type2 = typeMap[options.type]) === null || _typeMap$options$type2 === void 0 ? void 0 : _typeMap$options$type2.key);
|
|
117
|
+
this.type = options.type;
|
|
118
|
+
this.componentConfig = options.componentConfig;
|
|
119
|
+
this.isCombinationComponent = false;
|
|
120
|
+
this.canSort = false;
|
|
121
|
+
this.children = [];
|
|
122
|
+
this.dataType = "object";
|
|
123
|
+
this.rules = (_this$componentConfig3 = this.componentConfig) !== null && _this$componentConfig3 !== void 0 && _this$componentConfig3.required ? [{
|
|
124
|
+
required: true,
|
|
125
|
+
validator: function validator(_, value) {
|
|
126
|
+
var hasNo = (value || []).some(function (item) {
|
|
127
|
+
return item.deliveryNo;
|
|
128
|
+
});
|
|
129
|
+
if (!hasNo) {
|
|
130
|
+
return Promise.reject(new Error("\u81F3\u5C11\u586B\u5199\u4E00\u4E2A\u5B8C\u6574\u7684\u51FA\u5E93\u5355"));
|
|
131
|
+
}
|
|
132
|
+
return Promise.resolve();
|
|
133
|
+
}
|
|
134
|
+
}] : [];
|
|
135
|
+
this.align = "left";
|
|
136
|
+
});
|
|
137
|
+
export default DeliveryNo;
|
|
@@ -1,18 +1,18 @@
|
|
|
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 BsHeaderGods 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
|
itemKey: any;
|
|
17
17
|
constructor(options: PickOption);
|
|
18
18
|
getParentId: () => string;
|
|
@@ -17,63 +17,69 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
|
|
|
17
17
|
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; }
|
|
18
18
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
19
19
|
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); }
|
|
20
|
-
import React from
|
|
20
|
+
import React from "react";
|
|
21
21
|
import ItemView from "../../../commonComponents/ItemView";
|
|
22
|
-
import { isNull } from
|
|
22
|
+
import { isNull } from "@kmkf-fe-packages/kmkf-utils";
|
|
23
23
|
import { BsHeaderPic, BsHeaderChild } from "./index";
|
|
24
24
|
var HeaderMap = {
|
|
25
25
|
mark: {
|
|
26
26
|
component: BsHeaderChild,
|
|
27
|
-
name:
|
|
28
|
-
key:
|
|
27
|
+
name: "商品标记",
|
|
28
|
+
key: "mark",
|
|
29
29
|
width: 140
|
|
30
30
|
},
|
|
31
|
+
skuName: {
|
|
32
|
+
component: BsHeaderChild,
|
|
33
|
+
name: "sku名称",
|
|
34
|
+
key: "skuName",
|
|
35
|
+
width: 200
|
|
36
|
+
},
|
|
31
37
|
pic: {
|
|
32
38
|
component: BsHeaderPic,
|
|
33
|
-
name:
|
|
34
|
-
key:
|
|
39
|
+
name: "图片",
|
|
40
|
+
key: "pic",
|
|
35
41
|
width: 70
|
|
36
42
|
},
|
|
37
43
|
name: {
|
|
38
44
|
component: BsHeaderChild,
|
|
39
|
-
name:
|
|
40
|
-
key:
|
|
45
|
+
name: "名称",
|
|
46
|
+
key: "name",
|
|
41
47
|
width: 200
|
|
42
48
|
},
|
|
43
49
|
code: {
|
|
44
50
|
component: BsHeaderChild,
|
|
45
|
-
name:
|
|
46
|
-
key:
|
|
51
|
+
name: "编码",
|
|
52
|
+
key: "code",
|
|
47
53
|
width: 100
|
|
48
54
|
},
|
|
49
55
|
sku: {
|
|
50
56
|
component: BsHeaderChild,
|
|
51
|
-
name:
|
|
52
|
-
key:
|
|
57
|
+
name: "sku编码",
|
|
58
|
+
key: "sku",
|
|
53
59
|
width: 140
|
|
54
60
|
},
|
|
55
61
|
money: {
|
|
56
62
|
component: BsHeaderChild,
|
|
57
|
-
name:
|
|
58
|
-
key:
|
|
63
|
+
name: "实付金额",
|
|
64
|
+
key: "money",
|
|
59
65
|
width: 140
|
|
60
66
|
},
|
|
61
67
|
number: {
|
|
62
68
|
component: BsHeaderChild,
|
|
63
|
-
name:
|
|
64
|
-
key:
|
|
69
|
+
name: "数量",
|
|
70
|
+
key: "number",
|
|
65
71
|
width: 100
|
|
66
72
|
},
|
|
67
73
|
share: {
|
|
68
74
|
component: BsHeaderChild,
|
|
69
|
-
name:
|
|
70
|
-
key:
|
|
75
|
+
name: "分摊价",
|
|
76
|
+
key: "share",
|
|
71
77
|
width: 120
|
|
72
78
|
},
|
|
73
79
|
type: {
|
|
74
80
|
component: BsHeaderChild,
|
|
75
|
-
name:
|
|
76
|
-
key:
|
|
81
|
+
name: "赠品类型",
|
|
82
|
+
key: "type",
|
|
77
83
|
width: 150
|
|
78
84
|
}
|
|
79
85
|
};
|
|
@@ -94,7 +100,7 @@ var BsHeaderGods = /*#__PURE__*/_createClass(function BsHeaderGods(options) {
|
|
|
94
100
|
_defineProperty(this, "dataType", void 0);
|
|
95
101
|
_defineProperty(this, "itemKey", void 0);
|
|
96
102
|
_defineProperty(this, "getParentId", function () {
|
|
97
|
-
var _this$id$split = _this.id.split(
|
|
103
|
+
var _this$id$split = _this.id.split("_"),
|
|
98
104
|
_this$id$split2 = _slicedToArray(_this$id$split, 3),
|
|
99
105
|
key = _this$id$split2[0],
|
|
100
106
|
name = _this$id$split2[1],
|
|
@@ -110,7 +116,7 @@ var BsHeaderGods = /*#__PURE__*/_createClass(function BsHeaderGods(options) {
|
|
|
110
116
|
});
|
|
111
117
|
_defineProperty(this, "renderPc", function (value, record) {
|
|
112
118
|
var _this$getComponentVal;
|
|
113
|
-
return /*#__PURE__*/React.createElement("span", null, (_this$getComponentVal = _this.getComponentValue(record)) !== null && _this$getComponentVal !== void 0 ? _this$getComponentVal :
|
|
119
|
+
return /*#__PURE__*/React.createElement("span", null, (_this$getComponentVal = _this.getComponentValue(record)) !== null && _this$getComponentVal !== void 0 ? _this$getComponentVal : "--");
|
|
114
120
|
});
|
|
115
121
|
_defineProperty(this, "renderLog", function (r) {
|
|
116
122
|
var id = _this.getParentId();
|
|
@@ -120,14 +126,14 @@ var BsHeaderGods = /*#__PURE__*/_createClass(function BsHeaderGods(options) {
|
|
|
120
126
|
_defineProperty(this, "getComponentValue", function (r) {
|
|
121
127
|
var id = _this.getParentId();
|
|
122
128
|
var list = ((r === null || r === void 0 ? void 0 : r[id]) || []).reduce(function (prv, next) {
|
|
123
|
-
next[
|
|
129
|
+
next["money"] && prv.push(next["money"]);
|
|
124
130
|
return prv;
|
|
125
131
|
}, []);
|
|
126
|
-
return list.join(
|
|
132
|
+
return list.join(",");
|
|
127
133
|
});
|
|
128
134
|
_defineProperty(this, "renderExport", function (value, record) {
|
|
129
135
|
var _this$getComponentVal2;
|
|
130
|
-
return (_this$getComponentVal2 = _this.getComponentValue(record)) !== null && _this$getComponentVal2 !== void 0 ? _this$getComponentVal2 :
|
|
136
|
+
return (_this$getComponentVal2 = _this.getComponentValue(record)) !== null && _this$getComponentVal2 !== void 0 ? _this$getComponentVal2 : "--";
|
|
131
137
|
});
|
|
132
138
|
_defineProperty(this, "editRender", function () {
|
|
133
139
|
return null;
|
|
@@ -141,21 +147,22 @@ var BsHeaderGods = /*#__PURE__*/_createClass(function BsHeaderGods(options) {
|
|
|
141
147
|
this.formField = options.id;
|
|
142
148
|
this.type = options.type;
|
|
143
149
|
this.componentConfig = options.componentConfig;
|
|
144
|
-
this.align =
|
|
150
|
+
this.align = "left";
|
|
145
151
|
this.width = 200;
|
|
146
152
|
this.isCombinationComponent = true;
|
|
147
153
|
this.canSort = false;
|
|
148
|
-
this.dataType =
|
|
154
|
+
this.dataType = "string";
|
|
149
155
|
this.itemKey = {
|
|
150
|
-
mark:
|
|
151
|
-
pic:
|
|
152
|
-
name:
|
|
153
|
-
code:
|
|
154
|
-
sku:
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
156
|
+
mark: "商品标记",
|
|
157
|
+
pic: "图片",
|
|
158
|
+
name: "名称",
|
|
159
|
+
code: "编码",
|
|
160
|
+
sku: "sku编码",
|
|
161
|
+
skuName: "sku名称",
|
|
162
|
+
money: "实付金额",
|
|
163
|
+
number: "数量",
|
|
164
|
+
share: "分摊价",
|
|
165
|
+
type: "赠品类型"
|
|
159
166
|
};
|
|
160
167
|
this.children = _toConsumableArray(Object.keys(HeaderMap).reduce(function (prv, key) {
|
|
161
168
|
var _options$componentCon, _options$componentCon2;
|
|
@@ -1,18 +1,18 @@
|
|
|
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 BsMemo 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
17
|
getParentId: () => string;
|
|
18
18
|
renderClient: (r: any) => React.JSX.Element | null;
|