@kmkf-fe-packages/services-components 1.6.0-beta.7 → 1.6.0-beta.8
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.
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import { ComponentInterface, ColumnConfig, Record, PickOption } from
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ComponentInterface, ColumnConfig, Record, PickOption } from "../../type";
|
|
3
3
|
declare class Handler implements ComponentInterface {
|
|
4
4
|
name: string;
|
|
5
5
|
id: string;
|
|
6
6
|
sortField: string;
|
|
7
7
|
type: string;
|
|
8
|
-
componentConfig: ComponentInterface[
|
|
9
|
-
effects: ComponentInterface[
|
|
8
|
+
componentConfig: ComponentInterface["componentConfig"];
|
|
9
|
+
effects: ComponentInterface["effects"];
|
|
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
|
newOptions: () => {
|
|
18
18
|
label: string;
|
|
@@ -39,7 +39,7 @@ declare class Handler implements ComponentInterface {
|
|
|
39
39
|
}[];
|
|
40
40
|
};
|
|
41
41
|
filterFn: (value: string) => (i: Record) => boolean;
|
|
42
|
-
formatFilterValue: (value: any) =>
|
|
42
|
+
formatFilterValue: (value: any) => unknown[];
|
|
43
43
|
};
|
|
44
44
|
}
|
|
45
45
|
export default Handler;
|
|
@@ -17,10 +17,11 @@ 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
|
|
21
|
-
import intersection from
|
|
22
|
-
import { filterFn as _filterFn } from
|
|
20
|
+
import React from "react";
|
|
21
|
+
import intersection from "lodash/intersection";
|
|
22
|
+
import { filterFn as _filterFn } from "@kmkf-fe-packages/kmkf-utils";
|
|
23
23
|
import { SYMBOL } from "../../constant";
|
|
24
|
+
import { uniq } from "lodash";
|
|
24
25
|
var Handler = /*#__PURE__*/_createClass(function Handler(options) {
|
|
25
26
|
var _this = this,
|
|
26
27
|
_this$effects4;
|
|
@@ -51,7 +52,7 @@ var Handler = /*#__PURE__*/_createClass(function Handler(options) {
|
|
|
51
52
|
var value = record === null || record === void 0 ? void 0 : record[_this.id];
|
|
52
53
|
return /*#__PURE__*/React.createElement("span", null, (_value$map$join = value === null || value === void 0 ? void 0 : (_value$map = value.map(function (item) {
|
|
53
54
|
return item.account;
|
|
54
|
-
})) === null || _value$map === void 0 ? void 0 : _value$map.join(
|
|
55
|
+
})) === null || _value$map === void 0 ? void 0 : _value$map.join("、")) !== null && _value$map$join !== void 0 ? _value$map$join : "--");
|
|
55
56
|
});
|
|
56
57
|
_defineProperty(this, "renderLog", function () {
|
|
57
58
|
return null;
|
|
@@ -64,7 +65,7 @@ var Handler = /*#__PURE__*/_createClass(function Handler(options) {
|
|
|
64
65
|
var values = record === null || record === void 0 ? void 0 : record[_this.id];
|
|
65
66
|
return (_values$map$join = values === null || values === void 0 ? void 0 : (_values$map = values.map(function (item) {
|
|
66
67
|
return item.account;
|
|
67
|
-
})) === null || _values$map === void 0 ? void 0 : _values$map.join(
|
|
68
|
+
})) === null || _values$map === void 0 ? void 0 : _values$map.join("、")) !== null && _values$map$join !== void 0 ? _values$map$join : "--";
|
|
68
69
|
});
|
|
69
70
|
_defineProperty(this, "renderClient", function () {
|
|
70
71
|
return null;
|
|
@@ -80,7 +81,7 @@ var Handler = /*#__PURE__*/_createClass(function Handler(options) {
|
|
|
80
81
|
// 过滤组件id
|
|
81
82
|
name: item.name,
|
|
82
83
|
// 过滤组件名称
|
|
83
|
-
filterComponentType:
|
|
84
|
+
filterComponentType: "MultipleSelect",
|
|
84
85
|
props: {
|
|
85
86
|
options: _this.newOptions() || []
|
|
86
87
|
},
|
|
@@ -93,8 +94,8 @@ var Handler = /*#__PURE__*/_createClass(function Handler(options) {
|
|
|
93
94
|
};
|
|
94
95
|
},
|
|
95
96
|
formatFilterValue: function formatFilterValue(value) {
|
|
96
|
-
|
|
97
|
-
var _next$split = next.split(
|
|
97
|
+
var useList = value.reduce(function (prv, next) {
|
|
98
|
+
var _next$split = next.split(":"),
|
|
98
99
|
_next$split2 = _slicedToArray(_next$split, 2),
|
|
99
100
|
val = _next$split2[0],
|
|
100
101
|
groupText = _next$split2[1];
|
|
@@ -111,19 +112,20 @@ var Handler = /*#__PURE__*/_createClass(function Handler(options) {
|
|
|
111
112
|
}
|
|
112
113
|
return prv;
|
|
113
114
|
}, []);
|
|
115
|
+
return uniq(useList);
|
|
114
116
|
}
|
|
115
117
|
};
|
|
116
118
|
});
|
|
117
|
-
this.name = (options === null || options === void 0 ? void 0 : options.name) ||
|
|
118
|
-
this.id = (options === null || options === void 0 ? void 0 : options.id) ||
|
|
119
|
-
this.sortField =
|
|
120
|
-
this.formField =
|
|
121
|
-
this.type =
|
|
119
|
+
this.name = (options === null || options === void 0 ? void 0 : options.name) || "处理人";
|
|
120
|
+
this.id = (options === null || options === void 0 ? void 0 : options.id) || "handlerList";
|
|
121
|
+
this.sortField = "handlerList";
|
|
122
|
+
this.formField = "handlerList";
|
|
123
|
+
this.type = "HANDLER_INPUT";
|
|
122
124
|
this.effects = options === null || options === void 0 ? void 0 : options.effects;
|
|
123
125
|
this.isCombinationComponent = false;
|
|
124
126
|
this.canSort = false;
|
|
125
127
|
this.children = [];
|
|
126
|
-
this.dataType =
|
|
128
|
+
this.dataType = "string";
|
|
127
129
|
this.options = ((_this$effects4 = this.effects) === null || _this$effects4 === void 0 ? void 0 : _this$effects4.userList) || [];
|
|
128
130
|
});
|
|
129
131
|
export default Handler;
|
|
@@ -29,7 +29,7 @@ var WidgetMap = {
|
|
|
29
29
|
};
|
|
30
30
|
var SubForm = /*#__PURE__*/_createClass(function SubForm(options) {
|
|
31
31
|
var _this = this,
|
|
32
|
-
_this$
|
|
32
|
+
_this$componentConfig9;
|
|
33
33
|
_classCallCheck(this, SubForm);
|
|
34
34
|
_defineProperty(this, "name", void 0);
|
|
35
35
|
_defineProperty(this, "id", void 0);
|
|
@@ -45,10 +45,10 @@ var SubForm = /*#__PURE__*/_createClass(function SubForm(options) {
|
|
|
45
45
|
_defineProperty(this, "templateId", void 0);
|
|
46
46
|
_defineProperty(this, "workOrderUniqueKey", void 0);
|
|
47
47
|
_defineProperty(this, "getNewTableHeader", function () {
|
|
48
|
-
var _this$componentConfig, _this$componentConfig2;
|
|
49
|
-
return (_this$componentConfig = _this.componentConfig) === null || _this$componentConfig === void 0 ? void 0 : (_this$componentConfig2 = _this$componentConfig.
|
|
50
|
-
var _this$
|
|
51
|
-
var t = ((_this$
|
|
48
|
+
var _this$componentConfig, _this$componentConfig2, _this$componentConfig3;
|
|
49
|
+
return (_this$componentConfig = _this.componentConfig) === null || _this$componentConfig === void 0 ? void 0 : (_this$componentConfig2 = _this$componentConfig.subConfig) === null || _this$componentConfig2 === void 0 ? void 0 : (_this$componentConfig3 = _this$componentConfig2.correlationList) === null || _this$componentConfig3 === void 0 ? void 0 : _this$componentConfig3.map(function (item) {
|
|
50
|
+
var _this$componentConfig4;
|
|
51
|
+
var t = ((_this$componentConfig4 = _this.componentConfig) === null || _this$componentConfig4 === void 0 ? void 0 : _this$componentConfig4.tableHeader.find(function (v) {
|
|
52
52
|
return v.key === item.key;
|
|
53
53
|
})) || {
|
|
54
54
|
isShow: true,
|
|
@@ -121,15 +121,15 @@ var SubForm = /*#__PURE__*/_createClass(function SubForm(options) {
|
|
|
121
121
|
}) : null;
|
|
122
122
|
});
|
|
123
123
|
_defineProperty(this, "editRender", function (p) {
|
|
124
|
-
var _this$
|
|
124
|
+
var _this$componentConfig5, _this$componentConfig6, _this$componentConfig7, _this$componentConfig8;
|
|
125
125
|
return /*#__PURE__*/React.createElement(GetFormItem, {
|
|
126
126
|
title: _this.name,
|
|
127
127
|
name: _this.id,
|
|
128
128
|
rules: _this.rules,
|
|
129
129
|
hidden: p === null || p === void 0 ? void 0 : p.hidden,
|
|
130
130
|
display: p === null || p === void 0 ? void 0 : p.display,
|
|
131
|
-
required: (_this$
|
|
132
|
-
tooltip: (_this$
|
|
131
|
+
required: (_this$componentConfig5 = (_this$componentConfig6 = _this.componentConfig) === null || _this$componentConfig6 === void 0 ? void 0 : _this$componentConfig6.required) !== null && _this$componentConfig5 !== void 0 ? _this$componentConfig5 : false,
|
|
132
|
+
tooltip: (_this$componentConfig7 = (_this$componentConfig8 = _this.componentConfig) === null || _this$componentConfig8 === void 0 ? void 0 : _this$componentConfig8.tooltip) !== null && _this$componentConfig7 !== void 0 ? _this$componentConfig7 : "",
|
|
133
133
|
component: /*#__PURE__*/React.createElement(SubFormComponent, _this.componentConfig)
|
|
134
134
|
});
|
|
135
135
|
});
|
|
@@ -153,10 +153,10 @@ var SubForm = /*#__PURE__*/_createClass(function SubForm(options) {
|
|
|
153
153
|
this.componentConfig = options.componentConfig;
|
|
154
154
|
this.workOrderUniqueKey = options === null || options === void 0 ? void 0 : options.workOrderUniqueKey;
|
|
155
155
|
this.rules = [{
|
|
156
|
-
required: (_this$
|
|
156
|
+
required: (_this$componentConfig9 = this.componentConfig) === null || _this$componentConfig9 === void 0 ? void 0 : _this$componentConfig9.required,
|
|
157
157
|
validator: function validator(_, value) {
|
|
158
|
-
var _this$
|
|
159
|
-
var result = (_this$
|
|
158
|
+
var _this$componentConfig10, _this$componentConfig11;
|
|
159
|
+
var result = (_this$componentConfig10 = _this.componentConfig) === null || _this$componentConfig10 === void 0 ? void 0 : (_this$componentConfig11 = _this$componentConfig10.tableHeader) === null || _this$componentConfig11 === void 0 ? void 0 : _this$componentConfig11.reduce(function (prv, next) {
|
|
160
160
|
if (next.isRequired && next.isShow && !next.isEdit) {
|
|
161
161
|
prv[next.key] = "".concat(next.name, "\u4E0D\u80FD\u4E3A\u7A7A");
|
|
162
162
|
}
|
package/dist/esm/type.d.ts
CHANGED
|
@@ -173,13 +173,15 @@ export interface ComponentInterface {
|
|
|
173
173
|
rulesOptions?: Array<any>;
|
|
174
174
|
selectRules?: Array<string>;
|
|
175
175
|
logistics?: string;
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
176
|
+
subConfig?: {
|
|
177
|
+
correlationList?: any;
|
|
178
|
+
flowStatus?: string[];
|
|
179
|
+
flowTemplateKey?: any;
|
|
180
|
+
nodeId?: string;
|
|
181
|
+
workOrderTemplateId?: string;
|
|
182
|
+
};
|
|
180
183
|
needFilterShopByPermission?: boolean;
|
|
181
184
|
tableHeader?: any;
|
|
182
|
-
correlationList?: any;
|
|
183
185
|
};
|
|
184
186
|
effects?: {
|
|
185
187
|
queryWorkOrderDetail?: (r: Record) => void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kmkf-fe-packages/services-components",
|
|
3
|
-
"version": "1.6.0-beta.
|
|
3
|
+
"version": "1.6.0-beta.8",
|
|
4
4
|
"module": "dist/esm/index.js",
|
|
5
5
|
"typings": "dist/esm/index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
]
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@kmkf-fe-packages/basic-components": "1.6.0-beta.
|
|
24
|
+
"@kmkf-fe-packages/basic-components": "1.6.0-beta.8",
|
|
25
25
|
"@kmkf-fe-packages/kmkf-utils": "1.6.0-beta.0"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"publishConfig": {
|
|
39
39
|
"access": "public"
|
|
40
40
|
},
|
|
41
|
-
"gitHead": "
|
|
41
|
+
"gitHead": "aed67694931e1a241ff4b4a2a7ee719aad5e05d5",
|
|
42
42
|
"gitHooks": {
|
|
43
43
|
"pre-commit": "lint-staged"
|
|
44
44
|
}
|