@kmkf-fe-packages/services-components 0.11.0-alpha.1 → 0.11.0-alpha.10
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/BsLogistics/index.d.ts +7 -7
- package/dist/esm/components/BS/BsLogistics/index.js +30 -26
- package/dist/esm/components/BS/BsSystemOrder/index.js +31 -14
- package/dist/esm/components/BS/common/expressCode.d.ts +1 -0
- package/dist/esm/components/BS/common/expressCode.js +13 -3
- package/dist/esm/components/BS/common/expressCompany.d.ts +7 -6
- package/dist/esm/components/BS/common/expressCompany.js +24 -13
- package/dist/esm/components/Common/index.d.ts +1 -1
- package/dist/esm/components/Common/index.js +13 -4
- package/dist/esm/components/CommonMultiStatus/index.d.ts +4 -4
- package/dist/esm/components/CommonMultiStatus/index.js +50 -31
- package/dist/esm/components/CommonSystemOrder/index.d.ts +4 -4
- package/dist/esm/components/CommonSystemOrder/index.js +48 -50
- package/dist/esm/components/CompletedUser/index.js +1 -1
- package/dist/esm/components/FlowMarkSelect/index.js +1 -1
- package/dist/esm/components/Handler/index.js +1 -1
- package/dist/esm/components/Input/index.js +18 -0
- package/dist/esm/components/PlatForm/index.d.ts +2 -2
- package/dist/esm/components/PlatForm/index.js +2 -2
- package/dist/esm/components/ShopInput/index.js +1 -1
- package/dist/esm/components/StatusSelect/index.d.ts +5 -5
- package/dist/esm/components/StatusSelect/index.js +37 -51
- package/dist/esm/components/Submitter/index.js +1 -1
- package/dist/esm/components/WLN/WlnGoods/index.js +4 -3
- package/dist/esm/factory.d.ts +3 -3
- package/dist/esm/factory.js +91 -90
- package/dist/esm/type.d.ts +2 -0
- package/package.json +4 -4
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { ComponentInterface, PickOption, ColumnConfig, ALignType, Record } from
|
|
2
|
-
import React from
|
|
1
|
+
import { ComponentInterface, PickOption, ColumnConfig, ALignType, Record } from "../../type";
|
|
2
|
+
import React from "react";
|
|
3
3
|
declare class CommonSystemOrder implements ComponentInterface {
|
|
4
4
|
name: string;
|
|
5
5
|
id: string;
|
|
6
6
|
sortField: string;
|
|
7
7
|
type: string;
|
|
8
8
|
rules: any[];
|
|
9
|
-
componentConfig: ComponentInterface[
|
|
9
|
+
componentConfig: ComponentInterface["componentConfig"];
|
|
10
10
|
align: ALignType;
|
|
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
|
renderClient: (record: any) => React.JSX.Element | null;
|
|
18
18
|
renderPc: (value: any, record: Record) => React.JSX.Element;
|
|
@@ -6,42 +6,42 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
|
|
|
6
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
7
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
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
|
-
import React from
|
|
10
|
-
import some from
|
|
9
|
+
import React from "react";
|
|
10
|
+
import some from "lodash/some";
|
|
11
11
|
import GetFormItem from "../GetFormItem";
|
|
12
12
|
import { CommonOrderContent } from "../Common";
|
|
13
|
-
import { CommonSystemOrder as SystemOrder } from
|
|
13
|
+
import { CommonSystemOrder as SystemOrder } from "@kmkf-fe-packages/basic-components";
|
|
14
14
|
import ItemView from "../../commonComponents/ItemView";
|
|
15
|
-
import { isNull, filterFn as _filterFn } from
|
|
15
|
+
import { isNull, filterFn as _filterFn } from "@kmkf-fe-packages/kmkf-utils";
|
|
16
16
|
import { SYMBOL } from "../../constant";
|
|
17
17
|
var typeMap = {
|
|
18
18
|
BS_DELIVERY_NO: {
|
|
19
|
-
key:
|
|
20
|
-
code:
|
|
21
|
-
name:
|
|
19
|
+
key: "deliveryNoList",
|
|
20
|
+
code: "deliveryNoIds",
|
|
21
|
+
name: "出库单",
|
|
22
22
|
type: 1,
|
|
23
|
-
valueKey:
|
|
23
|
+
valueKey: "deliveryNo"
|
|
24
24
|
},
|
|
25
25
|
RETURN_GOODS_TRADE_ID: {
|
|
26
|
-
key:
|
|
27
|
-
code:
|
|
28
|
-
name:
|
|
26
|
+
key: "returnGoodsTradeItemList",
|
|
27
|
+
code: "returnGoodsTradeIdList",
|
|
28
|
+
name: "退货单id",
|
|
29
29
|
type: 2,
|
|
30
|
-
valueKey:
|
|
30
|
+
valueKey: "returnGoodsTradeId"
|
|
31
31
|
},
|
|
32
32
|
REISSUE_TRADE_ID: {
|
|
33
|
-
key:
|
|
34
|
-
code:
|
|
35
|
-
name:
|
|
33
|
+
key: "tradeItemList",
|
|
34
|
+
code: "tradeIdList",
|
|
35
|
+
name: "补发单id",
|
|
36
36
|
type: 3,
|
|
37
|
-
valueKey:
|
|
37
|
+
valueKey: "billNo"
|
|
38
38
|
},
|
|
39
39
|
EXCHANGE_TRADE_ID: {
|
|
40
|
-
key:
|
|
41
|
-
code:
|
|
42
|
-
name:
|
|
40
|
+
key: "tradeItemList",
|
|
41
|
+
code: "tradeIdList",
|
|
42
|
+
name: "换货单id",
|
|
43
43
|
type: 4,
|
|
44
|
-
valueKey:
|
|
44
|
+
valueKey: "billNo"
|
|
45
45
|
}
|
|
46
46
|
};
|
|
47
47
|
var CommonSystemOrder = /*#__PURE__*/_createClass(function CommonSystemOrder(options) {
|
|
@@ -63,8 +63,7 @@ var CommonSystemOrder = /*#__PURE__*/_createClass(function CommonSystemOrder(opt
|
|
|
63
63
|
_defineProperty(this, "children", void 0);
|
|
64
64
|
_defineProperty(this, "dataType", void 0);
|
|
65
65
|
_defineProperty(this, "renderClient", function (record) {
|
|
66
|
-
var _typeMap$_this$type
|
|
67
|
-
console.log('record', 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)]);
|
|
66
|
+
var _typeMap$_this$type;
|
|
68
67
|
var isShow = Array.isArray(record === null || record === void 0 ? void 0 : record[_this.id]) ? some(record === null || record === void 0 ? void 0 : record[_this.id], function (item) {
|
|
69
68
|
return !isNull(item);
|
|
70
69
|
}) : false;
|
|
@@ -73,14 +72,13 @@ var CommonSystemOrder = /*#__PURE__*/_createClass(function CommonSystemOrder(opt
|
|
|
73
72
|
label: _this.name,
|
|
74
73
|
value: /*#__PURE__*/React.createElement(CommonOrderContent, {
|
|
75
74
|
list: record === null || record === void 0 ? void 0 : record[_this.id],
|
|
76
|
-
valueKey: (_typeMap$_this$
|
|
75
|
+
valueKey: (_typeMap$_this$type = typeMap[_this.type]) === null || _typeMap$_this$type === void 0 ? void 0 : _typeMap$_this$type.valueKey
|
|
77
76
|
})
|
|
78
77
|
}) : null;
|
|
79
78
|
});
|
|
80
79
|
_defineProperty(this, "renderPc", function (value, record) {
|
|
81
|
-
var _typeMap$_this$
|
|
82
|
-
var list = record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_").concat((_typeMap$_this$
|
|
83
|
-
console.log('renderPc', typeMap, list);
|
|
80
|
+
var _typeMap$_this$type2, _typeMap$_this$type3, _typeMap$_this$type4;
|
|
81
|
+
var list = record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_").concat((_typeMap$_this$type2 = typeMap[_this.type]) === null || _typeMap$_this$type2 === void 0 ? void 0 : _typeMap$_this$type2.key)];
|
|
84
82
|
//兼容多个商品
|
|
85
83
|
return /*#__PURE__*/React.createElement("span", {
|
|
86
84
|
onClick: function onClick(e) {
|
|
@@ -88,30 +86,30 @@ var CommonSystemOrder = /*#__PURE__*/_createClass(function CommonSystemOrder(opt
|
|
|
88
86
|
}
|
|
89
87
|
}, /*#__PURE__*/React.createElement(CommonOrderContent, {
|
|
90
88
|
list: list,
|
|
91
|
-
type: (_typeMap$_this$
|
|
92
|
-
valueKey: (_typeMap$_this$
|
|
89
|
+
type: (_typeMap$_this$type3 = typeMap[_this.type]) === null || _typeMap$_this$type3 === void 0 ? void 0 : _typeMap$_this$type3.type,
|
|
90
|
+
valueKey: (_typeMap$_this$type4 = typeMap[_this.type]) === null || _typeMap$_this$type4 === void 0 ? void 0 : _typeMap$_this$type4.valueKey
|
|
93
91
|
}));
|
|
94
92
|
});
|
|
95
93
|
_defineProperty(this, "renderLog", function (r) {
|
|
96
|
-
var _typeMap$_this$
|
|
97
|
-
var list = r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_").concat((_typeMap$_this$
|
|
94
|
+
var _typeMap$_this$type5;
|
|
95
|
+
var list = r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_").concat((_typeMap$_this$type5 = typeMap[_this.type]) === null || _typeMap$_this$type5 === void 0 ? void 0 : _typeMap$_this$type5.key)];
|
|
98
96
|
if (isNull(list)) return null;
|
|
99
97
|
return _this.renderPc(undefined, r);
|
|
100
98
|
});
|
|
101
99
|
_defineProperty(this, "getComponentValue", function (r) {
|
|
102
|
-
var _typeMap$_this$
|
|
103
|
-
return r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_").concat((_typeMap$_this$
|
|
100
|
+
var _typeMap$_this$type6;
|
|
101
|
+
return r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_").concat((_typeMap$_this$type6 = typeMap[_this.type]) === null || _typeMap$_this$type6 === void 0 ? void 0 : _typeMap$_this$type6.key)];
|
|
104
102
|
});
|
|
105
103
|
_defineProperty(this, "renderExport", function (value, record) {
|
|
106
|
-
var _typeMap$_this$
|
|
107
|
-
var list = record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_").concat((_typeMap$_this$
|
|
104
|
+
var _typeMap$_this$type7;
|
|
105
|
+
var list = record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_").concat((_typeMap$_this$type7 = typeMap[_this.type]) === null || _typeMap$_this$type7 === void 0 ? void 0 : _typeMap$_this$type7.key)];
|
|
108
106
|
return (list || []).map(function (item) {
|
|
109
|
-
var _typeMap$_this$
|
|
110
|
-
return item === null || item === void 0 ? void 0 : item[(_typeMap$_this$
|
|
111
|
-
}).join(
|
|
107
|
+
var _typeMap$_this$type8;
|
|
108
|
+
return item === null || item === void 0 ? void 0 : item[(_typeMap$_this$type8 = typeMap[_this.type]) === null || _typeMap$_this$type8 === void 0 ? void 0 : _typeMap$_this$type8.valueKey];
|
|
109
|
+
}).join(",");
|
|
112
110
|
});
|
|
113
111
|
_defineProperty(this, "editRender", function (p) {
|
|
114
|
-
var _this$componentConfig, _this$componentConfig2, _typeMap$_this$
|
|
112
|
+
var _this$componentConfig, _this$componentConfig2, _typeMap$_this$type9;
|
|
115
113
|
return /*#__PURE__*/React.createElement(GetFormItem, {
|
|
116
114
|
title: _this.name,
|
|
117
115
|
name: _this.id,
|
|
@@ -119,22 +117,22 @@ var CommonSystemOrder = /*#__PURE__*/_createClass(function CommonSystemOrder(opt
|
|
|
119
117
|
hidden: p === null || p === void 0 ? void 0 : p.hidden,
|
|
120
118
|
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,
|
|
121
119
|
component: /*#__PURE__*/React.createElement(SystemOrder, _extends({}, _this.componentConfig, {
|
|
122
|
-
type: (_typeMap$_this$
|
|
120
|
+
type: (_typeMap$_this$type9 = typeMap[_this.type]) === null || _typeMap$_this$type9 === void 0 ? void 0 : _typeMap$_this$type9.type
|
|
123
121
|
}))
|
|
124
122
|
});
|
|
125
123
|
});
|
|
126
124
|
_defineProperty(this, "filterConfig", function (item) {
|
|
127
|
-
var _typeMap$_this$
|
|
125
|
+
var _typeMap$_this$type10;
|
|
128
126
|
return {
|
|
129
127
|
searchDefaultConditions: SYMBOL.like,
|
|
130
128
|
type: item.type,
|
|
131
|
-
id: "".concat(item.id, "_").concat((_typeMap$_this$
|
|
129
|
+
id: "".concat(item.id, "_").concat((_typeMap$_this$type10 = typeMap[_this.type]) === null || _typeMap$_this$type10 === void 0 ? void 0 : _typeMap$_this$type10.code),
|
|
132
130
|
name: "".concat(_this.name),
|
|
133
|
-
filterComponentType:
|
|
131
|
+
filterComponentType: "Input",
|
|
134
132
|
filterFn: function filterFn(value) {
|
|
135
133
|
return function (i) {
|
|
136
|
-
var _typeMap$_this$
|
|
137
|
-
return _filterFn.filterSplitComma(_filterFn.filterTableListItemColumnValue(i, item.id, (_typeMap$_this$
|
|
134
|
+
var _typeMap$_this$type11;
|
|
135
|
+
return _filterFn.filterSplitComma(_filterFn.filterTableListItemColumnValue(i, item.id, (_typeMap$_this$type11 = typeMap[_this.type]) === null || _typeMap$_this$type11 === void 0 ? void 0 : _typeMap$_this$type11.code), value);
|
|
138
136
|
};
|
|
139
137
|
}
|
|
140
138
|
};
|
|
@@ -148,21 +146,21 @@ var CommonSystemOrder = /*#__PURE__*/_createClass(function CommonSystemOrder(opt
|
|
|
148
146
|
this.isCombinationComponent = false;
|
|
149
147
|
this.canSort = false;
|
|
150
148
|
this.children = [];
|
|
151
|
-
this.dataType =
|
|
149
|
+
this.dataType = "object";
|
|
152
150
|
this.rules = (_this$componentConfig3 = this.componentConfig) !== null && _this$componentConfig3 !== void 0 && _this$componentConfig3.required ? [{
|
|
153
151
|
required: true,
|
|
154
152
|
validator: function validator(_, value) {
|
|
155
153
|
var hasNo = (value || []).some(function (item) {
|
|
156
|
-
var _typeMap$_this$
|
|
157
|
-
return item[(_typeMap$_this$
|
|
154
|
+
var _typeMap$_this$type12;
|
|
155
|
+
return item[(_typeMap$_this$type12 = typeMap[_this.type]) === null || _typeMap$_this$type12 === void 0 ? void 0 : _typeMap$_this$type12.valueKey];
|
|
158
156
|
});
|
|
159
157
|
if (!hasNo) {
|
|
160
|
-
var _typeMap$_this$
|
|
161
|
-
return Promise.reject(new Error("\u81F3\u5C11\u586B\u5199\u4E00\u4E2A\u5B8C\u6574\u7684".concat((_typeMap$_this$
|
|
158
|
+
var _typeMap$_this$type13;
|
|
159
|
+
return Promise.reject(new Error("\u81F3\u5C11\u586B\u5199\u4E00\u4E2A\u5B8C\u6574\u7684".concat((_typeMap$_this$type13 = typeMap[_this.type]) === null || _typeMap$_this$type13 === void 0 ? void 0 : _typeMap$_this$type13.name)));
|
|
162
160
|
}
|
|
163
161
|
return Promise.resolve();
|
|
164
162
|
}
|
|
165
163
|
}] : [];
|
|
166
|
-
this.align =
|
|
164
|
+
this.align = "left";
|
|
167
165
|
});
|
|
168
166
|
export default CommonSystemOrder;
|
|
@@ -65,7 +65,7 @@ var CompletedUser = /*#__PURE__*/_createClass(function CompletedUser(options) {
|
|
|
65
65
|
};
|
|
66
66
|
});
|
|
67
67
|
this.name = "完成人";
|
|
68
|
-
this.id = "completedUserName";
|
|
68
|
+
this.id = (options === null || options === void 0 ? void 0 : options.id) || "completedUserName";
|
|
69
69
|
this.sortField = "completedUserName";
|
|
70
70
|
this.formField = "completedUserName";
|
|
71
71
|
this.type = "COMPLETED_USER_INPUT";
|
|
@@ -134,7 +134,7 @@ var FlowMarkSelect = /*#__PURE__*/_createClass(function FlowMarkSelect(options)
|
|
|
134
134
|
};
|
|
135
135
|
});
|
|
136
136
|
this.name = "标记";
|
|
137
|
-
this.id = "markFlag";
|
|
137
|
+
this.id = (options === null || options === void 0 ? void 0 : options.id) || "markFlag";
|
|
138
138
|
this.sortField = "markFlag";
|
|
139
139
|
this.formField = "markFlag";
|
|
140
140
|
this.type = "FLOW_MARK_SELECT";
|
|
@@ -75,7 +75,7 @@ var Handler = /*#__PURE__*/_createClass(function Handler(options) {
|
|
|
75
75
|
};
|
|
76
76
|
});
|
|
77
77
|
this.name = "处理人";
|
|
78
|
-
this.id = "handlerList";
|
|
78
|
+
this.id = (options === null || options === void 0 ? void 0 : options.id) || "handlerList";
|
|
79
79
|
this.sortField = "handlerList";
|
|
80
80
|
this.formField = "handlerList";
|
|
81
81
|
this.type = "HANDLER_INPUT";
|
|
@@ -103,6 +103,24 @@ var BasicInput = /*#__PURE__*/_createClass(function BasicInput(options) {
|
|
|
103
103
|
if (testList.length && !isTest) {
|
|
104
104
|
return Promise.reject(new Error("请填写正确的格式"));
|
|
105
105
|
}
|
|
106
|
+
// if (this.componentConfig?.rulesOptions?.length) {
|
|
107
|
+
// const rulesList = this.componentConfig?.rulesOptions.filter(
|
|
108
|
+
// (item: any) =>
|
|
109
|
+
// (this.componentConfig?.selectRules || []).includes(item.id)
|
|
110
|
+
// );
|
|
111
|
+
|
|
112
|
+
// const hasRule = rulesList.some((item) => {
|
|
113
|
+
// const reg = new RegExp(item.value);
|
|
114
|
+
// return reg.test(value);
|
|
115
|
+
// });
|
|
116
|
+
// if (rulesList.length && !hasRule) {
|
|
117
|
+
// const rulesItem = rulesList.find((item) => {
|
|
118
|
+
// const reg = new RegExp(item.value);
|
|
119
|
+
// return !reg.test(value);
|
|
120
|
+
// });
|
|
121
|
+
// return Promise.reject(new Error(rulesItem?.errorText));
|
|
122
|
+
// }
|
|
123
|
+
// }
|
|
106
124
|
return Promise.resolve();
|
|
107
125
|
}
|
|
108
126
|
}];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { ComponentInterface, ColumnConfig, Record } from '../../type';
|
|
2
|
+
import { ComponentInterface, ColumnConfig, Record, PickOption } from '../../type';
|
|
3
3
|
import { PlatData } from '@kmkf-fe-packages/kmkf-utils';
|
|
4
4
|
declare class PlatForm implements ComponentInterface {
|
|
5
5
|
name: string;
|
|
@@ -14,7 +14,7 @@ declare class PlatForm implements ComponentInterface {
|
|
|
14
14
|
platInstance: InstanceType<typeof PlatData>;
|
|
15
15
|
dataType: ComponentInterface['dataType'];
|
|
16
16
|
options: ComponentInterface['options'];
|
|
17
|
-
constructor();
|
|
17
|
+
constructor(options: PickOption);
|
|
18
18
|
renderPc: (value: any, record: Record) => React.JSX.Element;
|
|
19
19
|
renderExport: (value: any, record: Record) => string;
|
|
20
20
|
renderLog: (r: Record) => React.JSX.Element | null;
|
|
@@ -8,7 +8,7 @@ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input ==
|
|
|
8
8
|
import React from 'react';
|
|
9
9
|
import { PlatData, filterFn as _filterFn, isNull } from '@kmkf-fe-packages/kmkf-utils';
|
|
10
10
|
import { SYMBOL } from "../../constant";
|
|
11
|
-
var PlatForm = /*#__PURE__*/_createClass(function PlatForm() {
|
|
11
|
+
var PlatForm = /*#__PURE__*/_createClass(function PlatForm(options) {
|
|
12
12
|
var _this = this;
|
|
13
13
|
_classCallCheck(this, PlatForm);
|
|
14
14
|
_defineProperty(this, "name", void 0);
|
|
@@ -65,7 +65,7 @@ var PlatForm = /*#__PURE__*/_createClass(function PlatForm() {
|
|
|
65
65
|
};
|
|
66
66
|
});
|
|
67
67
|
this.name = "平台";
|
|
68
|
-
this.id = "platform";
|
|
68
|
+
this.id = (options === null || options === void 0 ? void 0 : options.id) || "platform";
|
|
69
69
|
this.type = "PLATFORM_INPUT";
|
|
70
70
|
this.sortField = 'platform';
|
|
71
71
|
this.formField = 'platform';
|
|
@@ -87,7 +87,7 @@ var ShopInput = /*#__PURE__*/_createClass(function ShopInput(options) {
|
|
|
87
87
|
};
|
|
88
88
|
});
|
|
89
89
|
this.name = "店铺名称";
|
|
90
|
-
this.id = "shopName";
|
|
90
|
+
this.id = (options === null || options === void 0 ? void 0 : options.id) || "shopName";
|
|
91
91
|
this.type = "SHOP_INPUT";
|
|
92
92
|
this.sortField = "shopName";
|
|
93
93
|
this.formField = "shopName";
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { ComponentInterface, PickOption, ColumnConfig, Record } from
|
|
2
|
-
import React from
|
|
1
|
+
import { ComponentInterface, PickOption, ColumnConfig, Record } from '../../type';
|
|
2
|
+
import React from 'react';
|
|
3
3
|
declare class StatusSelect implements ComponentInterface {
|
|
4
4
|
name: string;
|
|
5
5
|
id: string;
|
|
6
6
|
sortField: string;
|
|
7
7
|
type: string;
|
|
8
8
|
rules: any[];
|
|
9
|
-
componentConfig: ComponentInterface[
|
|
9
|
+
componentConfig: ComponentInterface['componentConfig'];
|
|
10
10
|
isCombinationComponent: boolean;
|
|
11
11
|
formField: string;
|
|
12
12
|
canSort: boolean;
|
|
13
13
|
children: ComponentInterface[];
|
|
14
|
-
dataType: ComponentInterface[
|
|
15
|
-
options: ComponentInterface[
|
|
14
|
+
dataType: ComponentInterface['dataType'];
|
|
15
|
+
options: ComponentInterface['options'];
|
|
16
16
|
constructor(options: PickOption);
|
|
17
17
|
editRender: (p: any) => React.JSX.Element;
|
|
18
18
|
renderClient: (record: any) => React.JSX.Element | null;
|
|
@@ -8,69 +8,55 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
|
|
|
8
8
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
9
9
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
10
10
|
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
11
|
-
import React from
|
|
12
|
-
import { CommonStatus } from
|
|
11
|
+
import React from 'react';
|
|
12
|
+
import { CommonStatus } from '@kmkf-fe-packages/basic-components';
|
|
13
13
|
import GetFormItem from "../GetFormItem";
|
|
14
14
|
import ItemView from "../../commonComponents/ItemView";
|
|
15
|
-
import { isNull, filterFn as _filterFn } from
|
|
15
|
+
import { isNull, filterFn as _filterFn } from '@kmkf-fe-packages/kmkf-utils';
|
|
16
16
|
import { SYMBOL } from "../../constant";
|
|
17
17
|
// const statusOptions: Array<{ value: string }> = [{ value: '成功' }, { value: '失败' }]
|
|
18
18
|
var selectTypeMap = {
|
|
19
19
|
REISSUE_STATUS: {
|
|
20
20
|
options: [{
|
|
21
|
-
value:
|
|
22
|
-
label:
|
|
23
|
-
color:
|
|
24
|
-
}, {
|
|
25
|
-
value: "失败",
|
|
26
|
-
label: "失败",
|
|
27
|
-
color: "#ff4d4f"
|
|
28
|
-
}],
|
|
29
|
-
key: "reissueStatusValue",
|
|
30
|
-
info: "reissueReason",
|
|
31
|
-
failValue: "失败"
|
|
32
|
-
},
|
|
33
|
-
EXCHANGE_STATUS: {
|
|
34
|
-
options: [{
|
|
35
|
-
value: "成功",
|
|
36
|
-
label: "成功",
|
|
37
|
-
color: "#52c41a"
|
|
21
|
+
value: '成功',
|
|
22
|
+
label: '成功',
|
|
23
|
+
color: '#52c41a'
|
|
38
24
|
}, {
|
|
39
|
-
value:
|
|
40
|
-
label:
|
|
41
|
-
color:
|
|
25
|
+
value: '失败',
|
|
26
|
+
label: '失败',
|
|
27
|
+
color: '#ff4d4f'
|
|
42
28
|
}],
|
|
43
|
-
key:
|
|
44
|
-
info:
|
|
45
|
-
failValue:
|
|
29
|
+
key: 'reissueStatusValue',
|
|
30
|
+
info: 'reissueReason',
|
|
31
|
+
failValue: '失败'
|
|
46
32
|
},
|
|
47
33
|
ADJUST_WORK_ORDER_STATUS: {
|
|
48
34
|
options: [{
|
|
49
|
-
value:
|
|
50
|
-
label:
|
|
51
|
-
color:
|
|
35
|
+
value: '成功',
|
|
36
|
+
label: '成功',
|
|
37
|
+
color: '#52c41a'
|
|
52
38
|
}, {
|
|
53
|
-
value:
|
|
54
|
-
label:
|
|
55
|
-
color:
|
|
39
|
+
value: '失败',
|
|
40
|
+
label: '失败',
|
|
41
|
+
color: '#ff4d4f'
|
|
56
42
|
}],
|
|
57
|
-
key:
|
|
58
|
-
info:
|
|
59
|
-
failValue:
|
|
43
|
+
key: 'adjustWorkOrderStatusValue',
|
|
44
|
+
info: 'adjustWorkOrderReason',
|
|
45
|
+
failValue: '失败'
|
|
60
46
|
},
|
|
61
47
|
CREATE_STATUS: {
|
|
62
48
|
options: [{
|
|
63
|
-
value:
|
|
64
|
-
label:
|
|
65
|
-
color:
|
|
49
|
+
value: '成功',
|
|
50
|
+
label: '成功',
|
|
51
|
+
color: '#52c41a'
|
|
66
52
|
}, {
|
|
67
|
-
value:
|
|
68
|
-
label:
|
|
69
|
-
color:
|
|
53
|
+
value: '失败',
|
|
54
|
+
label: '失败',
|
|
55
|
+
color: '#ff4d4f'
|
|
70
56
|
}],
|
|
71
|
-
key:
|
|
72
|
-
info:
|
|
73
|
-
failValue:
|
|
57
|
+
key: 'createStatusValue',
|
|
58
|
+
info: 'createReason',
|
|
59
|
+
failValue: '失败'
|
|
74
60
|
},
|
|
75
61
|
INVOICE_STATUS: {
|
|
76
62
|
options: [{
|
|
@@ -121,7 +107,7 @@ var StatusSelect = /*#__PURE__*/_createClass(function StatusSelect(options) {
|
|
|
121
107
|
var status = record === null || record === void 0 ? void 0 : (_record$_this$id = record[_this.id]) === null || _record$_this$id === void 0 ? void 0 : _record$_this$id.status;
|
|
122
108
|
var statusColor = ((_selectTypeMap$_this$ = selectTypeMap[_this.type].options.find(function (item) {
|
|
123
109
|
return item.value === status;
|
|
124
|
-
})) === null || _selectTypeMap$_this$ === void 0 ? void 0 : _selectTypeMap$_this$.color) ||
|
|
110
|
+
})) === null || _selectTypeMap$_this$ === void 0 ? void 0 : _selectTypeMap$_this$.color) || '#000';
|
|
125
111
|
return !isNull(record === null || record === void 0 ? void 0 : (_record$_this$id2 = record[_this.id]) === null || _record$_this$id2 === void 0 ? void 0 : _record$_this$id2.status) ? /*#__PURE__*/React.createElement(ItemView, {
|
|
126
112
|
id: _this.id,
|
|
127
113
|
label: _this.name,
|
|
@@ -129,7 +115,7 @@ var StatusSelect = /*#__PURE__*/_createClass(function StatusSelect(options) {
|
|
|
129
115
|
style: {
|
|
130
116
|
color: statusColor
|
|
131
117
|
}
|
|
132
|
-
}, record === null || record === void 0 ? void 0 : (_record$_this$id3 = record[_this.id]) === null || _record$_this$id3 === void 0 ? void 0 : _record$_this$id3.status), /*#__PURE__*/React.createElement("div", null, (record === null || record === void 0 ? void 0 : (_record$_this$id4 = record[_this.id]) === null || _record$_this$id4 === void 0 ? void 0 : _record$_this$id4.reason) ||
|
|
118
|
+
}, record === null || record === void 0 ? void 0 : (_record$_this$id3 = record[_this.id]) === null || _record$_this$id3 === void 0 ? void 0 : _record$_this$id3.status), /*#__PURE__*/React.createElement("div", null, (record === null || record === void 0 ? void 0 : (_record$_this$id4 = record[_this.id]) === null || _record$_this$id4 === void 0 ? void 0 : _record$_this$id4.reason) || ''))
|
|
133
119
|
}) : null;
|
|
134
120
|
});
|
|
135
121
|
_defineProperty(this, "renderPc", function (value, record) {
|
|
@@ -137,12 +123,12 @@ var StatusSelect = /*#__PURE__*/_createClass(function StatusSelect(options) {
|
|
|
137
123
|
var status = record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_").concat(selectTypeMap[_this.type].key)];
|
|
138
124
|
var statusColor = ((_selectTypeMap$_this$2 = selectTypeMap[_this.type].options.find(function (item) {
|
|
139
125
|
return item.value === status;
|
|
140
|
-
})) === null || _selectTypeMap$_this$2 === void 0 ? void 0 : _selectTypeMap$_this$2.color) ||
|
|
126
|
+
})) === null || _selectTypeMap$_this$2 === void 0 ? void 0 : _selectTypeMap$_this$2.color) || '#000';
|
|
141
127
|
return !isNull(status) ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
142
128
|
style: {
|
|
143
129
|
color: statusColor
|
|
144
130
|
}
|
|
145
|
-
}, record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_").concat(selectTypeMap[_this.type].key)]), /*#__PURE__*/React.createElement("div", null, (record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_").concat(selectTypeMap[_this.type].info)]) ||
|
|
131
|
+
}, record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_").concat(selectTypeMap[_this.type].key)]), /*#__PURE__*/React.createElement("div", null, (record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_").concat(selectTypeMap[_this.type].info)]) || '')) : '--';
|
|
146
132
|
});
|
|
147
133
|
_defineProperty(this, "renderLog", function (r) {
|
|
148
134
|
if (isNull(r === null || r === void 0 ? void 0 : r["".concat(_this.id, "_").concat(selectTypeMap[_this.type].key)])) return null;
|
|
@@ -153,7 +139,7 @@ var StatusSelect = /*#__PURE__*/_createClass(function StatusSelect(options) {
|
|
|
153
139
|
});
|
|
154
140
|
_defineProperty(this, "renderExport", function (value, record) {
|
|
155
141
|
var _record;
|
|
156
|
-
return (_record = record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_").concat(selectTypeMap[_this.type].key)]) !== null && _record !== void 0 ? _record :
|
|
142
|
+
return (_record = record === null || record === void 0 ? void 0 : record["".concat(_this.id, "_").concat(selectTypeMap[_this.type].key)]) !== null && _record !== void 0 ? _record : '--';
|
|
157
143
|
});
|
|
158
144
|
_defineProperty(this, "filterConfig", function (item) {
|
|
159
145
|
return {
|
|
@@ -163,7 +149,7 @@ var StatusSelect = /*#__PURE__*/_createClass(function StatusSelect(options) {
|
|
|
163
149
|
// 过滤组件id
|
|
164
150
|
name: item.name,
|
|
165
151
|
// 过滤组件名称
|
|
166
|
-
filterComponentType:
|
|
152
|
+
filterComponentType: 'MultipleSelect',
|
|
167
153
|
props: {
|
|
168
154
|
options: selectTypeMap[_this.type].options
|
|
169
155
|
},
|
|
@@ -186,7 +172,7 @@ var StatusSelect = /*#__PURE__*/_createClass(function StatusSelect(options) {
|
|
|
186
172
|
this.isCombinationComponent = false;
|
|
187
173
|
this.canSort = true;
|
|
188
174
|
this.children = [];
|
|
189
|
-
this.dataType =
|
|
175
|
+
this.dataType = 'string';
|
|
190
176
|
this.options = selectTypeMap[options.type].options;
|
|
191
177
|
});
|
|
192
178
|
export default StatusSelect;
|
|
@@ -73,7 +73,7 @@ var Submitter = /*#__PURE__*/_createClass(function Submitter(options) {
|
|
|
73
73
|
};
|
|
74
74
|
});
|
|
75
75
|
this.name = "提交人";
|
|
76
|
-
this.id = "submitter";
|
|
76
|
+
this.id = (options === null || options === void 0 ? void 0 : options.id) || "submitter";
|
|
77
77
|
this.type = "OPERATOR_INPUT";
|
|
78
78
|
this.sortField = "submitter";
|
|
79
79
|
this.formField = "submitter";
|
|
@@ -34,12 +34,12 @@ var WlnGoods = /*#__PURE__*/_createClass(function WlnGoods(options) {
|
|
|
34
34
|
_defineProperty(this, "dataType", void 0);
|
|
35
35
|
_defineProperty(this, "wlnGoods", void 0);
|
|
36
36
|
_defineProperty(this, "renderClient", function (record) {
|
|
37
|
-
var _this$componentConfig;
|
|
37
|
+
var _record, _this$componentConfig;
|
|
38
38
|
return !isNull(record === null || record === void 0 ? void 0 : record["".concat(_this.id)]) ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ItemView, {
|
|
39
39
|
id: _this.id,
|
|
40
40
|
label: _this.name,
|
|
41
41
|
value: /*#__PURE__*/React.createElement(BsGoodsTable, {
|
|
42
|
-
list: (record === null || record === void 0 ? void 0 : record["".concat(_this.id)]) || [],
|
|
42
|
+
list: (record === null || record === void 0 ? void 0 : (_record = record["".concat(_this.id)]) === null || _record === void 0 ? void 0 : _record.wlnGoods) || [],
|
|
43
43
|
showHeader: ((_this$componentConfig = _this.componentConfig) === null || _this$componentConfig === void 0 ? void 0 : _this$componentConfig.showHeader) || []
|
|
44
44
|
})
|
|
45
45
|
})) : null;
|
|
@@ -106,7 +106,8 @@ var WlnGoods = /*#__PURE__*/_createClass(function WlnGoods(options) {
|
|
|
106
106
|
this.rules = this !== null && this !== void 0 && (_this$componentConfig4 = this.componentConfig) !== null && _this$componentConfig4 !== void 0 && _this$componentConfig4.required ? [{
|
|
107
107
|
required: true,
|
|
108
108
|
validator: function validator(_, value) {
|
|
109
|
-
|
|
109
|
+
var _value$wlnGoods;
|
|
110
|
+
if (!value || !(value !== null && value !== void 0 && (_value$wlnGoods = value.wlnGoods) !== null && _value$wlnGoods !== void 0 && _value$wlnGoods.length)) {
|
|
110
111
|
return Promise.reject(new Error("请选择万里牛商品"));
|
|
111
112
|
}
|
|
112
113
|
return Promise.resolve();
|
package/dist/esm/factory.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { JstLogistics, JstItemSelect, JstSupply, JstSendGood, BasicInput, BasicAddress, BasicCascader, BasicCheckbox, BasicDataTime, BasicSelect, BasicRadio, BasicTextArea, BasicPicture, BasicMultSelect, BasicGrade, BasicRate, BasicFile, BasicPosting, CommonDataTime, TradeId, ShopName, ErpTradeId, BuyerNick, ReceiverName, ReceiverMobile, ReceiverAddress, TradeDateTime, Logistics, ReturnLogistics, ActualPayment, ERemark, AliPay, ItemSelect, ItemId, ItemEnCode, SystemOrderNo, Ordinary, ThirdItemSelect, FlowStatusSelect, FlowMarkSelect, Payment, TemplateSelect, WorkOrderId, PlatForm, ShopInput, Submitter, Handler, CompletedUser, LogisticsInterception, LogisticsTrajectory, FlowWorkOrderId, BsGoods, BsExchange, BsReissue, BsReturn, BsSystemOrder, BsLogistics, StatusSelect, CommonSystemOrder, CommonMultiStatus, Calculation, NodeDeadLine, HandlerDeadLine, NodeStayDuration, WlnGoods } from
|
|
2
|
-
import { PickOption } from
|
|
3
|
-
export declare const factory: (type: string, options: PickOption) => BsGoods | BsLogistics | CommonSystemOrder | JstSendGood | WlnGoods |
|
|
1
|
+
import { JstLogistics, JstItemSelect, JstSupply, JstSendGood, BasicInput, BasicAddress, BasicCascader, BasicCheckbox, BasicDataTime, BasicSelect, BasicRadio, BasicTextArea, BasicPicture, BasicMultSelect, BasicGrade, BasicRate, BasicFile, BasicPosting, CommonDataTime, TradeId, ShopName, ErpTradeId, BuyerNick, ReceiverName, ReceiverMobile, ReceiverAddress, TradeDateTime, Logistics, ReturnLogistics, ActualPayment, ERemark, AliPay, ItemSelect, ItemId, ItemEnCode, SystemOrderNo, Ordinary, ThirdItemSelect, FlowStatusSelect, FlowMarkSelect, Payment, TemplateSelect, WorkOrderId, PlatForm, ShopInput, Submitter, Handler, CompletedUser, LogisticsInterception, LogisticsTrajectory, FlowWorkOrderId, BsGoods, BsExchange, BsReissue, BsReturn, BsSystemOrder, BsLogistics, StatusSelect, CommonSystemOrder, CommonMultiStatus, Calculation, NodeDeadLine, HandlerDeadLine, NodeStayDuration, WlnGoods } from './index';
|
|
2
|
+
import { PickOption } from './type';
|
|
3
|
+
export declare const factory: (type: string, options: PickOption) => BsGoods | BsLogistics | BsSystemOrder | CommonMultiStatus | CommonSystemOrder | CompletedUser | BasicFile | FlowMarkSelect | Handler | HandlerDeadLine | BasicInput | JstSendGood | LogisticsInterception | NodeDeadLine | PlatForm | ShopInput | StatusSelect | Submitter | TradeId | WlnGoods | WorkOrderId | BasicAddress | BasicCascader | BasicCheckbox | BasicDataTime | BasicSelect | BasicRadio | BasicTextArea | BasicPicture | BasicMultSelect | BasicGrade | BasicRate | BasicPosting | CommonDataTime | ErpTradeId | ShopName | BuyerNick | ReceiverName | ReceiverMobile | ReceiverAddress | TradeDateTime | Logistics | ReturnLogistics | ActualPayment | ERemark | AliPay | ItemSelect | ItemId | ItemEnCode | SystemOrderNo | Ordinary | ThirdItemSelect | Payment | JstLogistics | JstItemSelect | JstSupply | BsExchange | BsReissue | BsReturn | FlowStatusSelect | TemplateSelect | LogisticsTrajectory | FlowWorkOrderId | Calculation | NodeStayDuration;
|