@kmkf-fe-packages/services-components 0.8.18-alpha.3 → 0.8.18-alpha.6
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.
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { ComponentInterface, PickOption, ColumnConfig, Record } from "../../type";
|
|
2
|
+
import React from "react";
|
|
3
|
+
declare class FlowMarkSelect implements ComponentInterface {
|
|
4
|
+
name: string;
|
|
5
|
+
id: string;
|
|
6
|
+
sortField: string;
|
|
7
|
+
type: string;
|
|
8
|
+
rules: any[];
|
|
9
|
+
componentConfig: ComponentInterface["componentConfig"];
|
|
10
|
+
effects: ComponentInterface["effects"];
|
|
11
|
+
workOrderStatus: any;
|
|
12
|
+
isCombinationComponent: boolean;
|
|
13
|
+
formField: string;
|
|
14
|
+
canSort: boolean;
|
|
15
|
+
children: ComponentInterface[];
|
|
16
|
+
dataType: ComponentInterface["dataType"];
|
|
17
|
+
options: ComponentInterface["options"];
|
|
18
|
+
constructor(options: PickOption);
|
|
19
|
+
renderPc: (value: any, record: Record) => React.JSX.Element;
|
|
20
|
+
renderLog: (r: Record) => React.JSX.Element | null;
|
|
21
|
+
getComponentValue: (r: Record) => any;
|
|
22
|
+
renderExport: (value: any, record: Record) => any;
|
|
23
|
+
renderClient: () => null;
|
|
24
|
+
editRender: (p: any) => React.JSX.Element;
|
|
25
|
+
filterConfig: (item: ColumnConfig) => {
|
|
26
|
+
searchDefaultConditions: "in";
|
|
27
|
+
type: string;
|
|
28
|
+
id: string;
|
|
29
|
+
name: string;
|
|
30
|
+
filterComponentType: "MultipleSelect";
|
|
31
|
+
props: {
|
|
32
|
+
options: {
|
|
33
|
+
label: any;
|
|
34
|
+
value: string;
|
|
35
|
+
}[];
|
|
36
|
+
};
|
|
37
|
+
filterFn: (value: string[]) => (i: Record) => boolean;
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
export default FlowMarkSelect;
|
|
@@ -0,0 +1,165 @@
|
|
|
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 { ApaasSelect } from "@kmkf-fe-packages/basic-components";
|
|
11
|
+
import { filterFn as _filterFn } from "@kmkf-fe-packages/kmkf-utils";
|
|
12
|
+
import GetFormItem from "../GetFormItem";
|
|
13
|
+
import get from "lodash/get";
|
|
14
|
+
import { SYMBOL } from "../../constant";
|
|
15
|
+
var FlowMarkSelect = /*#__PURE__*/_createClass(function FlowMarkSelect(options) {
|
|
16
|
+
var _this = this,
|
|
17
|
+
_Object$keys2;
|
|
18
|
+
_classCallCheck(this, FlowMarkSelect);
|
|
19
|
+
_defineProperty(this, "name", void 0);
|
|
20
|
+
_defineProperty(this, "id", void 0);
|
|
21
|
+
_defineProperty(this, "sortField", void 0);
|
|
22
|
+
_defineProperty(this, "type", void 0);
|
|
23
|
+
_defineProperty(this, "rules", void 0);
|
|
24
|
+
_defineProperty(this, "componentConfig", void 0);
|
|
25
|
+
_defineProperty(this, "effects", void 0);
|
|
26
|
+
_defineProperty(this, "workOrderStatus", void 0);
|
|
27
|
+
_defineProperty(this, "isCombinationComponent", void 0);
|
|
28
|
+
_defineProperty(this, "formField", void 0);
|
|
29
|
+
_defineProperty(this, "canSort", void 0);
|
|
30
|
+
_defineProperty(this, "children", void 0);
|
|
31
|
+
_defineProperty(this, "dataType", void 0);
|
|
32
|
+
_defineProperty(this, "options", void 0);
|
|
33
|
+
_defineProperty(this, "renderPc", function (value, record) {
|
|
34
|
+
var status = get(_this.workOrderStatus, record === null || record === void 0 ? void 0 : record["".concat(_this.id)]);
|
|
35
|
+
return status ?
|
|
36
|
+
/*#__PURE__*/
|
|
37
|
+
// <Dropdown overlay={this.renderMenu(record)}>
|
|
38
|
+
React.createElement("span", {
|
|
39
|
+
style: {
|
|
40
|
+
color: status.color
|
|
41
|
+
}
|
|
42
|
+
}, status === null || status === void 0 ? void 0 : status.label) :
|
|
43
|
+
/*#__PURE__*/
|
|
44
|
+
// </Dropdown>
|
|
45
|
+
React.createElement("span", null, "--");
|
|
46
|
+
});
|
|
47
|
+
_defineProperty(this, "renderLog", function (r) {
|
|
48
|
+
var status = get(_this.workOrderStatus, r === null || r === void 0 ? void 0 : r["".concat(_this.id)]);
|
|
49
|
+
if (!status) return null;
|
|
50
|
+
return _this.renderPc(undefined, r);
|
|
51
|
+
});
|
|
52
|
+
_defineProperty(this, "getComponentValue", function (r) {
|
|
53
|
+
var status = get(_this.workOrderStatus, r === null || r === void 0 ? void 0 : r["".concat(_this.id)]);
|
|
54
|
+
return status;
|
|
55
|
+
});
|
|
56
|
+
_defineProperty(this, "renderExport", function (value, record) {
|
|
57
|
+
var status = get(_this.workOrderStatus, record === null || record === void 0 ? void 0 : record["".concat(_this.id)]);
|
|
58
|
+
return status ? status === null || status === void 0 ? void 0 : status.label : "--";
|
|
59
|
+
});
|
|
60
|
+
_defineProperty(this, "renderClient", function () {
|
|
61
|
+
return null;
|
|
62
|
+
});
|
|
63
|
+
_defineProperty(this, "editRender", function (p) {
|
|
64
|
+
var _this$componentConfig, _this$componentConfig2;
|
|
65
|
+
return /*#__PURE__*/React.createElement(GetFormItem, {
|
|
66
|
+
title: _this.name,
|
|
67
|
+
name: _this.id,
|
|
68
|
+
rules: _this.rules,
|
|
69
|
+
hidden: p === null || p === void 0 ? void 0 : p.hidden,
|
|
70
|
+
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,
|
|
71
|
+
component: /*#__PURE__*/React.createElement(ApaasSelect, _extends({}, _this.componentConfig, {
|
|
72
|
+
placeholder: "\u8BF7\u8F93\u5165".concat(_this.name),
|
|
73
|
+
showSearch: true
|
|
74
|
+
}))
|
|
75
|
+
});
|
|
76
|
+
});
|
|
77
|
+
_defineProperty(this, "filterConfig", function (item) {
|
|
78
|
+
var _Object$keys;
|
|
79
|
+
return {
|
|
80
|
+
searchDefaultConditions: SYMBOL.in,
|
|
81
|
+
type: item.type,
|
|
82
|
+
id: item.id,
|
|
83
|
+
// 过滤组件id
|
|
84
|
+
name: item.name,
|
|
85
|
+
// 过滤组件名称
|
|
86
|
+
filterComponentType: "MultipleSelect",
|
|
87
|
+
props: {
|
|
88
|
+
options: (_Object$keys = Object.keys(_this.workOrderStatus)) === null || _Object$keys === void 0 ? void 0 : _Object$keys.map(function (item) {
|
|
89
|
+
return {
|
|
90
|
+
label: _this.workOrderStatus[item].label,
|
|
91
|
+
value: item
|
|
92
|
+
};
|
|
93
|
+
})
|
|
94
|
+
},
|
|
95
|
+
filterFn: function filterFn(value) {
|
|
96
|
+
return function (i) {
|
|
97
|
+
return value === null || value === void 0 ? void 0 : value.includes(_filterFn.filterTableListItemColumnValue(i, item.id, ""));
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
});
|
|
102
|
+
this.name = options.name;
|
|
103
|
+
this.id = options.id;
|
|
104
|
+
this.sortField = options.id;
|
|
105
|
+
this.formField = options.id;
|
|
106
|
+
this.type = options.type;
|
|
107
|
+
this.componentConfig = options.componentConfig;
|
|
108
|
+
this.effects = options.effects;
|
|
109
|
+
this.rules = [];
|
|
110
|
+
this.isCombinationComponent = false;
|
|
111
|
+
this.canSort = true;
|
|
112
|
+
this.children = [];
|
|
113
|
+
this.workOrderStatus = {
|
|
114
|
+
WAITING: {
|
|
115
|
+
label: "待处理",
|
|
116
|
+
color: "#faad14",
|
|
117
|
+
bgColor: "#faad14"
|
|
118
|
+
},
|
|
119
|
+
HANDLING: {
|
|
120
|
+
label: "处理中",
|
|
121
|
+
color: "#1890ff",
|
|
122
|
+
bgColor: "#1890ff"
|
|
123
|
+
},
|
|
124
|
+
STOPPING: {
|
|
125
|
+
label: "暂停中",
|
|
126
|
+
color: "#ff4d4f",
|
|
127
|
+
bgColor: "#ff4d4f"
|
|
128
|
+
},
|
|
129
|
+
COMPLETED: {
|
|
130
|
+
label: "已完成",
|
|
131
|
+
color: "#73d13d",
|
|
132
|
+
bgColor: "#73d13d"
|
|
133
|
+
},
|
|
134
|
+
CLOSED: {
|
|
135
|
+
label: "已关闭",
|
|
136
|
+
color: "rgba(0, 0, 0, 0.65)",
|
|
137
|
+
bgColor: "rgba(0, 0, 0, 0.04);"
|
|
138
|
+
}
|
|
139
|
+
};
|
|
140
|
+
this.dataType = "string";
|
|
141
|
+
this.options = (_Object$keys2 = Object.keys(this.workOrderStatus)) === null || _Object$keys2 === void 0 ? void 0 : _Object$keys2.map(function (item) {
|
|
142
|
+
return {
|
|
143
|
+
label: _this.workOrderStatus[item].label,
|
|
144
|
+
value: item
|
|
145
|
+
};
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
// renderMenu = (record: Record) => {
|
|
149
|
+
// const menu = (
|
|
150
|
+
// <Menu
|
|
151
|
+
// onClick={({ key }) => {
|
|
152
|
+
// typeof this?.effects?.handleChangeSingleWorkOrderStatus === 'function' && this?.effects?.handleChangeSingleWorkOrderStatus(key, record)
|
|
153
|
+
// }}
|
|
154
|
+
// >
|
|
155
|
+
// <Menu.Item key="HANDLING">处理中</Menu.Item>
|
|
156
|
+
// <Menu.Item key="STOPPING">暂停中</Menu.Item>
|
|
157
|
+
// <Menu.Item key="COMPLETED">已完成</Menu.Item>
|
|
158
|
+
// <Menu.Item key="WAITING">待处理</Menu.Item>
|
|
159
|
+
// </Menu>
|
|
160
|
+
// );
|
|
161
|
+
// return menu;
|
|
162
|
+
// };
|
|
163
|
+
);
|
|
164
|
+
|
|
165
|
+
export default FlowMarkSelect;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kmkf-fe-packages/services-components",
|
|
3
|
-
"version": "0.8.18-alpha.
|
|
3
|
+
"version": "0.8.18-alpha.6",
|
|
4
4
|
"module": "dist/esm/index.js",
|
|
5
5
|
"typings": "dist/esm/index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -26,8 +26,8 @@
|
|
|
26
26
|
"father": "^4.1.7"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@kmkf-fe-packages/basic-components": "^0.8.18-alpha.
|
|
30
|
-
"@kmkf-fe-packages/kmkf-utils": "^0.8.
|
|
29
|
+
"@kmkf-fe-packages/basic-components": "^0.8.18-alpha.6",
|
|
30
|
+
"@kmkf-fe-packages/kmkf-utils": "^0.8.18-alpha.6"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
33
33
|
"@ant-design/icons": "^4.7.0",
|
|
@@ -40,5 +40,5 @@
|
|
|
40
40
|
"gitHooks": {
|
|
41
41
|
"pre-commit": "lint-staged"
|
|
42
42
|
},
|
|
43
|
-
"gitHead": "
|
|
43
|
+
"gitHead": "057c92caa76b60bdf5348c049b4d2eed5cde444e"
|
|
44
44
|
}
|