@cloud-app-dev/vidc 1.0.12 → 1.0.16
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/.umirc.ts +18 -11
- package/es/AppLayout/AppHorizontalMenu/index.js +6 -2
- package/es/AppLayout/AppInlineMenu/index.js +9 -3
- package/es/InitialConfig/index.js +0 -1
- package/es/InitialRequest/index.js +4 -2
- package/es/InitialRequest/utils.js +120 -61
- package/es/OrgTree/index.js +6 -5
- package/es/WorkerFlow/Demo.d.ts +2 -0
- package/es/WorkerFlow/Demo.js +34 -0
- package/es/WorkerFlow/Form/Approver.d.ts +2 -0
- package/es/WorkerFlow/Form/Approver.js +7 -0
- package/es/WorkerFlow/Form/Condition.d.ts +2 -0
- package/es/WorkerFlow/Form/Condition.js +7 -0
- package/es/WorkerFlow/Form/FormAuth.d.ts +7 -0
- package/es/WorkerFlow/Form/FormAuth.js +116 -0
- package/es/WorkerFlow/Form/Handle.d.ts +8 -0
- package/es/WorkerFlow/Form/Handle.js +19 -0
- package/es/WorkerFlow/Form/UserSelect.d.ts +7 -0
- package/es/WorkerFlow/Form/UserSelect.js +253 -0
- package/es/WorkerFlow/Form/UserSet.d.ts +9 -0
- package/es/WorkerFlow/Form/UserSet.js +124 -0
- package/es/WorkerFlow/Form/UsersHandleType.d.ts +6 -0
- package/es/WorkerFlow/Form/UsersHandleType.js +30 -0
- package/es/WorkerFlow/Nodes/Add.d.ts +7 -0
- package/es/WorkerFlow/Nodes/Add.js +81 -0
- package/es/WorkerFlow/Nodes/AddOption.d.ts +9 -0
- package/es/WorkerFlow/Nodes/AddOption.js +23 -0
- package/es/WorkerFlow/Nodes/AddOptionList.d.ts +6 -0
- package/es/WorkerFlow/Nodes/AddOptionList.js +44 -0
- package/es/WorkerFlow/Nodes/Approver.d.ts +11 -0
- package/es/WorkerFlow/Nodes/Approver.js +53 -0
- package/es/WorkerFlow/Nodes/Condition.d.ts +9 -0
- package/es/WorkerFlow/Nodes/Condition.js +154 -0
- package/es/WorkerFlow/Nodes/Constants.d.ts +34 -0
- package/es/WorkerFlow/Nodes/Constants.js +110 -0
- package/es/WorkerFlow/Nodes/End.d.ts +6 -0
- package/es/WorkerFlow/Nodes/End.js +16 -0
- package/es/WorkerFlow/Nodes/Handle.d.ts +11 -0
- package/es/WorkerFlow/Nodes/Handle.js +53 -0
- package/es/WorkerFlow/Nodes/Node.d.ts +7 -0
- package/es/WorkerFlow/Nodes/Node.js +26 -0
- package/es/WorkerFlow/Nodes/Notifier.d.ts +11 -0
- package/es/WorkerFlow/Nodes/Notifier.js +58 -0
- package/es/WorkerFlow/Nodes/Render.d.ts +7 -0
- package/es/WorkerFlow/Nodes/Render.js +16 -0
- package/es/WorkerFlow/Nodes/Start.d.ts +11 -0
- package/es/WorkerFlow/Nodes/Start.js +26 -0
- package/es/WorkerFlow/Nodes/TitleElement.d.ts +9 -0
- package/es/WorkerFlow/Nodes/TitleElement.js +92 -0
- package/es/WorkerFlow/Nodes/Wrap.d.ts +13 -0
- package/es/WorkerFlow/Nodes/Wrap.js +29 -0
- package/es/WorkerFlow/OperatorContext.d.ts +4 -0
- package/es/WorkerFlow/OperatorContext.js +3 -0
- package/es/WorkerFlow/Tools.d.ts +8 -0
- package/es/WorkerFlow/Tools.js +80 -0
- package/es/WorkerFlow/XML/CanvasTag.d.ts +3 -0
- package/es/WorkerFlow/XML/CanvasTag.js +126 -0
- package/es/WorkerFlow/XML/EndEvent.d.ts +1 -0
- package/es/WorkerFlow/XML/EndEvent.js +14 -0
- package/es/WorkerFlow/XML/ExclusiveGateway.d.ts +8 -0
- package/es/WorkerFlow/XML/ExclusiveGateway.js +120 -0
- package/es/WorkerFlow/XML/Root.d.ts +1 -0
- package/es/WorkerFlow/XML/Root.js +5 -0
- package/es/WorkerFlow/XML/StartEvent.d.ts +5 -0
- package/es/WorkerFlow/XML/StartEvent.js +28 -0
- package/es/WorkerFlow/XML/UserTask.d.ts +5 -0
- package/es/WorkerFlow/XML/UserTask.js +45 -0
- package/es/WorkerFlow/XML/index.d.ts +3 -0
- package/es/WorkerFlow/XML/index.js +97 -0
- package/es/WorkerFlow/XML/utils.d.ts +4 -0
- package/es/WorkerFlow/XML/utils.js +47 -0
- package/es/WorkerFlow/api.d.ts +8 -0
- package/es/WorkerFlow/api.js +49 -0
- package/es/WorkerFlow/bpmn-mock.bpmn +103 -0
- package/es/WorkerFlow/data.json +83 -0
- package/es/WorkerFlow/index.css +728 -0
- package/es/WorkerFlow/index.d.ts +8 -0
- package/es/WorkerFlow/index.js +223 -0
- package/es/WorkerFlow/interface.d.ts +58 -0
- package/es/WorkerFlow/useDrawer.d.ts +14 -0
- package/es/WorkerFlow/useDrawer.js +77 -0
- package/es/WorkerFlow/useModal.d.ts +14 -0
- package/es/WorkerFlow/useModal.js +79 -0
- package/es/core.d.ts +16 -0
- package/es/index.d.ts +1 -0
- package/es/index.js +2 -1
- package/package.json +7 -2
- package/tsconfig.json +1 -0
- package/es/InitialConfig/index.css +0 -0
- package/es/InitialRequest/index.css +0 -0
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
import _Modal from "@cloud-app-dev/basic-components/es/Modal";
|
|
2
|
+
|
|
3
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
4
|
+
|
|
5
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
6
|
+
|
|
7
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
8
|
+
|
|
9
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
10
|
+
|
|
11
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
12
|
+
|
|
13
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
14
|
+
|
|
15
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
16
|
+
|
|
17
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
18
|
+
|
|
19
|
+
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
20
|
+
|
|
21
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
22
|
+
|
|
23
|
+
import { __awaiter } from "tslib";
|
|
24
|
+
import React, { useMemo, useState } from 'react';
|
|
25
|
+
import EndNode from './Nodes/End';
|
|
26
|
+
import Render from './Nodes/Render';
|
|
27
|
+
import Tools from './Tools';
|
|
28
|
+
import WFC from './OperatorContext';
|
|
29
|
+
import { OptionTypes, NodeTemplates, NodeTypes } from './Nodes/Constants';
|
|
30
|
+
import { transformJsonToXML, exportBpmnFile as _exportBpmnFile } from './XML';
|
|
31
|
+
import { getEndEventId } from './XML/utils';
|
|
32
|
+
import useDrawer from './useDrawer';
|
|
33
|
+
import HandleForm from './Form/Handle';
|
|
34
|
+
import ApproverForm from './Form/Approver';
|
|
35
|
+
import ConditionForm from './Form/Condition';
|
|
36
|
+
import "./index.css";
|
|
37
|
+
var FormMap = {
|
|
38
|
+
1: ApproverForm,
|
|
39
|
+
3: ConditionForm,
|
|
40
|
+
5: HandleForm
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
function WorkFlow(_ref) {
|
|
44
|
+
var _data = _ref.data,
|
|
45
|
+
_ref$form = _ref.form,
|
|
46
|
+
form = _ref$form === void 0 ? [] : _ref$form;
|
|
47
|
+
|
|
48
|
+
var _useState = useState(_data.nodeConfig),
|
|
49
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
50
|
+
config = _useState2[0],
|
|
51
|
+
setConfig = _useState2[1];
|
|
52
|
+
|
|
53
|
+
var drawer = useDrawer();
|
|
54
|
+
|
|
55
|
+
function updateNode() {
|
|
56
|
+
setConfig(Object.assign({}, config));
|
|
57
|
+
} // 链表操作: 几种行为, 添加行为,删除行为,点击行为 pRef.childNode -> objRef.childNode -> 后继
|
|
58
|
+
// 添加节点
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
function onAddNode(type, pRef, objRef) {
|
|
62
|
+
var o = objRef.childNode;
|
|
63
|
+
|
|
64
|
+
if (type === OptionTypes.APPROVER) {
|
|
65
|
+
objRef.childNode = Object.assign(Object.assign({}, NodeTemplates[OptionTypes.APPROVER]()), {
|
|
66
|
+
childNode: o
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
if (type === OptionTypes.HANDLE) {
|
|
71
|
+
objRef.childNode = Object.assign(Object.assign({}, NodeTemplates[OptionTypes.HANDLE]()), {
|
|
72
|
+
childNode: o
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
if (type === OptionTypes.NOTIFIER) {
|
|
77
|
+
objRef.childNode = Object.assign(Object.assign({}, NodeTemplates[OptionTypes.NOTIFIER]()), {
|
|
78
|
+
childNode: o
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
if (type === OptionTypes.CONDITION) {
|
|
83
|
+
objRef.childNode = Object.assign(Object.assign({}, NodeTemplates[OptionTypes.CONDITION]()), {
|
|
84
|
+
conditionNodes: [Object.assign(Object.assign({}, NodeTemplates[OptionTypes.BRANCH]()), {
|
|
85
|
+
nodeName: '条件1',
|
|
86
|
+
priorityLevel: 1,
|
|
87
|
+
childNode: o
|
|
88
|
+
}), Object.assign(Object.assign({}, NodeTemplates[OptionTypes.BRANCH]()), {
|
|
89
|
+
nodeName: '条件2',
|
|
90
|
+
priorityLevel: 2
|
|
91
|
+
})]
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
if (type === OptionTypes.BRANCH) {
|
|
96
|
+
objRef.conditionNodes.push(Object.assign(Object.assign({}, NodeTemplates[NodeTypes.BRANCH]()), {
|
|
97
|
+
priorityLevel: objRef.conditionNodes.length + 1
|
|
98
|
+
}));
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
updateNode();
|
|
102
|
+
} // 删除节点
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
function onDeleteNode(pRef, objRef, type, index) {
|
|
106
|
+
var _this = this;
|
|
107
|
+
|
|
108
|
+
var options = {
|
|
109
|
+
title: "\u662F\u5426\u5220\u9664\u8282\u70B9\"".concat(objRef.nodeName, "\"\uFF1F"),
|
|
110
|
+
okText: '确定',
|
|
111
|
+
cancelText: '取消'
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
var onOk = function onOk() {
|
|
115
|
+
return __awaiter(_this, void 0, void 0, /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
|
|
116
|
+
var newObj;
|
|
117
|
+
return regeneratorRuntime.wrap(function _callee$(_context) {
|
|
118
|
+
while (1) {
|
|
119
|
+
switch (_context.prev = _context.next) {
|
|
120
|
+
case 0:
|
|
121
|
+
if (type === NodeTypes.BRANCH) {
|
|
122
|
+
console.log(_toConsumableArray(objRef.conditionNodes), index);
|
|
123
|
+
objRef.conditionNodes.splice(index, 1);
|
|
124
|
+
console.log(objRef.conditionNodes);
|
|
125
|
+
} else {
|
|
126
|
+
newObj = objRef.childNode;
|
|
127
|
+
pRef.childNode = newObj;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
updateNode();
|
|
131
|
+
|
|
132
|
+
case 2:
|
|
133
|
+
case "end":
|
|
134
|
+
return _context.stop();
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}, _callee);
|
|
138
|
+
}));
|
|
139
|
+
};
|
|
140
|
+
|
|
141
|
+
_Modal.confirm(Object.assign(Object.assign({}, options), {
|
|
142
|
+
onOk: onOk
|
|
143
|
+
}));
|
|
144
|
+
} // 获取节点
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
function onSelectNode(pRef, objRef) {
|
|
148
|
+
var data = {};
|
|
149
|
+
var currentNode = {
|
|
150
|
+
current: objRef,
|
|
151
|
+
prev: pRef
|
|
152
|
+
};
|
|
153
|
+
var formKeys = Object.keys(FormMap);
|
|
154
|
+
|
|
155
|
+
var onChange = function onChange(options) {
|
|
156
|
+
data = Object.assign(Object.assign({}, data), options);
|
|
157
|
+
console.log(data);
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
var onOk = function onOk() {
|
|
161
|
+
objRef.nodeUserList = data.nodeUserList || [];
|
|
162
|
+
objRef.form = data.form || [];
|
|
163
|
+
objRef.userType = data.userType;
|
|
164
|
+
objRef.usersHandType = data.usersHandType;
|
|
165
|
+
objRef.owner = data.nodeUserList.map(function (v) {
|
|
166
|
+
return v.name;
|
|
167
|
+
}).join(',');
|
|
168
|
+
drawer.close();
|
|
169
|
+
console.log(objRef, data);
|
|
170
|
+
updateNode();
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
if (formKeys.map(function (v) {
|
|
174
|
+
return +v;
|
|
175
|
+
}).includes(objRef.type)) {
|
|
176
|
+
var FormContent = FormMap[objRef.type];
|
|
177
|
+
drawer.open({
|
|
178
|
+
title: objRef.nodeName,
|
|
179
|
+
width: 600,
|
|
180
|
+
content: /*#__PURE__*/React.createElement(FormContent, {
|
|
181
|
+
form: form,
|
|
182
|
+
item: objRef,
|
|
183
|
+
onChange: onChange
|
|
184
|
+
}),
|
|
185
|
+
onOk: onOk
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
console.log('currentNode:', currentNode);
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
var endId = useMemo(function () {
|
|
193
|
+
return getEndEventId(_data);
|
|
194
|
+
}, []);
|
|
195
|
+
return /*#__PURE__*/React.createElement(WFC.Provider, {
|
|
196
|
+
value: {
|
|
197
|
+
config: config,
|
|
198
|
+
form: form,
|
|
199
|
+
updateNode: updateNode,
|
|
200
|
+
onAddNode: onAddNode,
|
|
201
|
+
onDeleteNode: onDeleteNode,
|
|
202
|
+
onSelectNode: onSelectNode
|
|
203
|
+
}
|
|
204
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
205
|
+
className: "worker-flow-container"
|
|
206
|
+
}, /*#__PURE__*/React.createElement("section", {
|
|
207
|
+
className: "worker-flow-design"
|
|
208
|
+
}, /*#__PURE__*/React.createElement(Tools, {
|
|
209
|
+
onCreateXML: function onCreateXML() {
|
|
210
|
+
return transformJsonToXML(_data);
|
|
211
|
+
},
|
|
212
|
+
exportBpmnFile: function exportBpmnFile() {
|
|
213
|
+
return _exportBpmnFile(_data);
|
|
214
|
+
}
|
|
215
|
+
}, /*#__PURE__*/React.createElement(Render, {
|
|
216
|
+
config: config
|
|
217
|
+
}), /*#__PURE__*/React.createElement(EndNode, {
|
|
218
|
+
nodeName: "\u6D41\u7A0B\u7ED3\u675F",
|
|
219
|
+
id: endId
|
|
220
|
+
})))));
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
export default WorkFlow;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
export type NodeType = 0 | 1 | 2 | 3 | 4 | 5 | 9; //0开始,1审核,2抄送,3条件判断,4路由,5办理人,9结束
|
|
2
|
+
export type UserSetType = 1 | 2 | 3 | 4 | 5; //1,指定人员;2,自选人员;3,岗位;4,直属主管;5,连续多级主管;
|
|
3
|
+
export type MutipleUserHandleType = 1 | 2; //1,会签,2,或签
|
|
4
|
+
|
|
5
|
+
export type NodeTypeKey = 'APPROVER' | 'NOTIFIER' | 'BRANCH' | 'CONDITION' | 'HANDLE';
|
|
6
|
+
|
|
7
|
+
export type BpmnTypeKey = 'startEvent' | 'endEvent' | 'exclusiveGateway' | 'userTask' | 'sequenceFlow';
|
|
8
|
+
|
|
9
|
+
export type FormAuthType = 1 | 2 | 3; //1,编辑;2,只读;3,隐藏
|
|
10
|
+
|
|
11
|
+
export type NodeUserType = {
|
|
12
|
+
name: string;
|
|
13
|
+
key: 'userId' | 'groupId'; //用户id 或者 用户分组
|
|
14
|
+
value: string | number;
|
|
15
|
+
type: 'user' | 'system';
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export type WorkerFlowFormType = {
|
|
19
|
+
name: string;
|
|
20
|
+
label: string;
|
|
21
|
+
value: string;
|
|
22
|
+
type: 'input' | 'select';
|
|
23
|
+
auth?: FormAuthType;
|
|
24
|
+
selectType?: 'single' | 'mutiple';
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export type NodeItem = {
|
|
28
|
+
id: string; // ID按规则生成;
|
|
29
|
+
nodeName: string; //节点名称
|
|
30
|
+
nodeUserList?: NodeUserType[]; //审核用户,userTask类型存在切必选
|
|
31
|
+
childNode?: NodeItem; //下一个链接元素
|
|
32
|
+
conditionNodes?: NodeItem[]; //条件判断集合,路由节点存在
|
|
33
|
+
type: NodeType; // 自定义类型
|
|
34
|
+
userType?: UserSetType; //人员设置类型
|
|
35
|
+
usersHandType?: MutipleUserHandleType; //多人时处理类型
|
|
36
|
+
conditionList?: { [key: string]: number | string }[]; //条件对象
|
|
37
|
+
expression?: string; //条件判断模板
|
|
38
|
+
priorityLevel?: number; // 条件优先级
|
|
39
|
+
owner?: string; // 显示审核人员文本
|
|
40
|
+
error?: boolean; // 节点是否出错
|
|
41
|
+
bpmnType: BpmnTypeKey; // 对于bpmn类型
|
|
42
|
+
form?: WorkerFlowFormType[];
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
export interface WorkerFlowContext {
|
|
46
|
+
config: NodeItem;
|
|
47
|
+
form: WorkerFlowFormType[];
|
|
48
|
+
onAddNode: (type: NodeType, pRef: NodeItem, objRef: NodeItem) => void;
|
|
49
|
+
onDeleteNode: (pRef: NodeItem, objRef: NodeItem, type?: NodeType, index?: number) => void;
|
|
50
|
+
onSelectNode: (pRef: NodeItem, objRef: NodeItem) => void;
|
|
51
|
+
updateNode: () => void;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export interface WorkerFlowRequest {
|
|
55
|
+
id: string;
|
|
56
|
+
name: string;
|
|
57
|
+
nodeConfig: NodeItem;
|
|
58
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface IUseDrawerHookState {
|
|
3
|
+
content?: React.ReactNode;
|
|
4
|
+
visible?: boolean;
|
|
5
|
+
title?: React.ReactNode;
|
|
6
|
+
onOk?: () => void;
|
|
7
|
+
width?: number | string;
|
|
8
|
+
className?: string;
|
|
9
|
+
}
|
|
10
|
+
declare function useDrawer(): {
|
|
11
|
+
open: (options: IUseDrawerHookState) => void;
|
|
12
|
+
close: () => void;
|
|
13
|
+
};
|
|
14
|
+
export default useDrawer;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import _Drawer from "@cloud-app-dev/basic-components/es/Drawer";
|
|
2
|
+
|
|
3
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
4
|
+
|
|
5
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
6
|
+
|
|
7
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
8
|
+
|
|
9
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
10
|
+
|
|
11
|
+
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
12
|
+
|
|
13
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
14
|
+
|
|
15
|
+
import React, { useEffect, useMemo, useState } from 'react';
|
|
16
|
+
import ReactDOM from 'react-dom';
|
|
17
|
+
|
|
18
|
+
function useDrawer() {
|
|
19
|
+
var div = useMemo(function () {
|
|
20
|
+
return document.createElement('div');
|
|
21
|
+
}, []);
|
|
22
|
+
|
|
23
|
+
var _useState = useState({
|
|
24
|
+
content: null,
|
|
25
|
+
visible: false,
|
|
26
|
+
title: '',
|
|
27
|
+
onOk: undefined,
|
|
28
|
+
width: undefined,
|
|
29
|
+
className: undefined
|
|
30
|
+
}),
|
|
31
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
32
|
+
state = _useState2[0],
|
|
33
|
+
setState = _useState2[1];
|
|
34
|
+
|
|
35
|
+
useEffect(function () {
|
|
36
|
+
document.body.appendChild(div);
|
|
37
|
+
return function () {
|
|
38
|
+
document.body.removeChild(div);
|
|
39
|
+
ReactDOM.unmountComponentAtNode(div);
|
|
40
|
+
div.remove();
|
|
41
|
+
};
|
|
42
|
+
}, []);
|
|
43
|
+
useEffect(function () {
|
|
44
|
+
ReactDOM.render( /*#__PURE__*/React.createElement(_Drawer, {
|
|
45
|
+
visible: state.visible,
|
|
46
|
+
onOk: state.onOk,
|
|
47
|
+
onClose: close,
|
|
48
|
+
destroyOnClose: true,
|
|
49
|
+
title: state.title,
|
|
50
|
+
width: state.width,
|
|
51
|
+
className: state.className
|
|
52
|
+
}, state.content), div);
|
|
53
|
+
}, [state.content, state.visible, state.title, state.onOk, state.width, state.className]);
|
|
54
|
+
|
|
55
|
+
var open = function open(options) {
|
|
56
|
+
setState(function (old) {
|
|
57
|
+
return Object.assign(Object.assign(Object.assign({}, old), options), {
|
|
58
|
+
visible: true
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
var close = function close() {
|
|
64
|
+
setState(function (old) {
|
|
65
|
+
return Object.assign(Object.assign({}, old), {
|
|
66
|
+
visible: false
|
|
67
|
+
});
|
|
68
|
+
});
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
return {
|
|
72
|
+
open: open,
|
|
73
|
+
close: close
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export default useDrawer;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface IUseModalHookState {
|
|
3
|
+
content?: React.ReactNode;
|
|
4
|
+
visible?: boolean;
|
|
5
|
+
title?: React.ReactNode;
|
|
6
|
+
onOk?: () => void;
|
|
7
|
+
width?: number | string;
|
|
8
|
+
className?: string;
|
|
9
|
+
}
|
|
10
|
+
declare function useModal(): {
|
|
11
|
+
open: (options: IUseModalHookState) => void;
|
|
12
|
+
close: () => void;
|
|
13
|
+
};
|
|
14
|
+
export default useModal;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import _Modal from "@cloud-app-dev/basic-components/es/Modal";
|
|
2
|
+
|
|
3
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
4
|
+
|
|
5
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
6
|
+
|
|
7
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
8
|
+
|
|
9
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
10
|
+
|
|
11
|
+
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
12
|
+
|
|
13
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
14
|
+
|
|
15
|
+
import React, { useEffect, useMemo, useState } from 'react';
|
|
16
|
+
import ReactDOM from 'react-dom';
|
|
17
|
+
|
|
18
|
+
function useModal() {
|
|
19
|
+
var div = useMemo(function () {
|
|
20
|
+
return document.createElement('div');
|
|
21
|
+
}, []);
|
|
22
|
+
|
|
23
|
+
var _useState = useState({
|
|
24
|
+
content: null,
|
|
25
|
+
visible: false,
|
|
26
|
+
title: '',
|
|
27
|
+
onOk: undefined,
|
|
28
|
+
width: undefined,
|
|
29
|
+
className: undefined
|
|
30
|
+
}),
|
|
31
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
32
|
+
state = _useState2[0],
|
|
33
|
+
setState = _useState2[1];
|
|
34
|
+
|
|
35
|
+
useEffect(function () {
|
|
36
|
+
document.body.appendChild(div);
|
|
37
|
+
return function () {
|
|
38
|
+
document.body.removeChild(div);
|
|
39
|
+
ReactDOM.unmountComponentAtNode(div);
|
|
40
|
+
div.remove();
|
|
41
|
+
};
|
|
42
|
+
}, []);
|
|
43
|
+
useEffect(function () {
|
|
44
|
+
ReactDOM.render( /*#__PURE__*/React.createElement(_Modal, {
|
|
45
|
+
okText: "\u786E\u5B9A",
|
|
46
|
+
cancelText: "\u53D6\u6D88",
|
|
47
|
+
visible: state.visible,
|
|
48
|
+
onOk: state.onOk,
|
|
49
|
+
onCancel: close,
|
|
50
|
+
destroyOnClose: true,
|
|
51
|
+
title: state.title,
|
|
52
|
+
width: state.width,
|
|
53
|
+
className: state.className
|
|
54
|
+
}, state.content), div);
|
|
55
|
+
}, [state.content, state.visible, state.title, state.onOk, state.width, state.className]);
|
|
56
|
+
|
|
57
|
+
var open = function open(options) {
|
|
58
|
+
setState(function (old) {
|
|
59
|
+
return Object.assign(Object.assign(Object.assign({}, old), options), {
|
|
60
|
+
visible: true
|
|
61
|
+
});
|
|
62
|
+
});
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
var close = function close() {
|
|
66
|
+
setState(function (old) {
|
|
67
|
+
return Object.assign(Object.assign({}, old), {
|
|
68
|
+
visible: false
|
|
69
|
+
});
|
|
70
|
+
});
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
return {
|
|
74
|
+
open: open,
|
|
75
|
+
close: close
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export default useModal;
|
package/es/core.d.ts
ADDED
package/es/index.d.ts
CHANGED
package/es/index.js
CHANGED
|
@@ -11,4 +11,5 @@ export { default as List } from './List';
|
|
|
11
11
|
export { default as OrgTree } from './OrgTree';
|
|
12
12
|
export { default as PlaceTree } from './PlaceTree';
|
|
13
13
|
export { default as TreeTitle } from './TreeTitle';
|
|
14
|
-
export { default as Upload } from './Upload';
|
|
14
|
+
export { default as Upload } from './Upload';
|
|
15
|
+
export { default as WorkerFlow } from './WorkerFlow';
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"private": false,
|
|
3
3
|
"name": "@cloud-app-dev/vidc",
|
|
4
4
|
"description": "Video Image Data Componennts",
|
|
5
|
-
"version": "1.0.
|
|
5
|
+
"version": "1.0.16",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"start": "dumi dev",
|
|
8
8
|
"docs:build": "dumi build",
|
|
@@ -30,14 +30,19 @@
|
|
|
30
30
|
]
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
+
"@logicflow/core": "^0.7.0",
|
|
34
|
+
"@types/chroma-js": "^2.1.3",
|
|
35
|
+
"bpmn-moddle": "^7.1.2",
|
|
36
|
+
"chroma-js": "^2.1.2",
|
|
33
37
|
"jsencrypt": "^3.2.1",
|
|
34
38
|
"lodash": "^4.17.21",
|
|
35
39
|
"mobx": "^6.3.2",
|
|
36
40
|
"rc-queue-anim": "^2.0.0"
|
|
37
41
|
},
|
|
38
42
|
"devDependencies": {
|
|
39
|
-
"@cloud-app-dev/basic-components": "^1.0.
|
|
43
|
+
"@cloud-app-dev/basic-components": "^1.0.29",
|
|
40
44
|
"@cloud-app-dev/utils": "^1.0.0",
|
|
45
|
+
"@types/bpmn-moddle": "^5.1.5",
|
|
41
46
|
"@types/lodash": "^4.14.172",
|
|
42
47
|
"@umijs/test": "^3.0.5",
|
|
43
48
|
"babel-plugin-import": "^1.13.3",
|
package/tsconfig.json
CHANGED
|
File without changes
|
|
File without changes
|