uepay-mesh 4.0.21 → 4.0.22-beta-2
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/bpm/bpmForm.js +191 -0
- package/bpm/builder.js +76 -72
- package/bpm/config/serverEnums.js +63 -36
- package/bpm/data/bpm.js +45 -5
- package/bpm/data/request.js +49 -49
- package/bpm/form/flow.js +99 -133
- package/bpm/form/options/approve.js +39 -34
- package/bpm/form/options/revoke.js +5 -2
- package/bpm/form/options.js +27 -11
- package/bpm/form/title.js +42 -42
- package/bpm/list/applicantTable.js +9 -5
- package/bpm/list/completeTable.js +9 -4
- package/bpm/list/waitTable.js +9 -4
- package/bpm/list.js +22 -52
- package/index.d.ts +1 -1
- package/index.js +2 -2
- package/mesh/cell/compare/comparePopoverView.js +46 -0
- package/mesh/cell/compare/input/standardCompare.js +28 -7
- package/mesh/cell/compare/picker/imageUpdatePickerCompare.js +15 -6
- package/mesh/cell/compare/picker/timestampDatePickerCompare.js +13 -3
- package/mesh/cell/compare/select/standardSelectCompare.js +13 -3
- package/mesh/cell/compare/switch/standardSwitchCompare.js +13 -5
- package/mesh/crud/remove.js +1 -1
- package/mesh/form/editAbleForm.js +2 -2
- package/mesh/form/loading/parentPosLoading.js +1 -1
- package/mesh/form/options/bpm/collectStateResponse.js +12 -26
- package/mesh/form/options/btn/tip.js +40 -42
- package/mesh/form/options/submitBtn.js +2 -2
- package/mesh/table/standardTable/thColumn/rowEditAbleCell.js +6 -2
- package/package.json +1 -1
package/bpm/bpmForm.js
ADDED
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
require("core-js/modules/web.dom.iterable.js");
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
var _antd = require("antd");
|
|
10
|
+
var _builder = require("./builder");
|
|
11
|
+
var _bpmSteps = _interopRequireDefault(require("./form/bpmSteps"));
|
|
12
|
+
var _title = _interopRequireDefault(require("./form/title"));
|
|
13
|
+
var _info = _interopRequireDefault(require("./form/info"));
|
|
14
|
+
var _flow = _interopRequireDefault(require("./form/flow"));
|
|
15
|
+
var _collect = _interopRequireDefault(require("./form/collect"));
|
|
16
|
+
var _options = _interopRequireDefault(require("./form/options"));
|
|
17
|
+
var _request = require("./data/request");
|
|
18
|
+
var _local = require("../common/local");
|
|
19
|
+
var _processor = require("./form/processor");
|
|
20
|
+
var _list = require("./list");
|
|
21
|
+
var _standardCompareForm = _interopRequireDefault(require("../mesh/form/standardCompareForm"));
|
|
22
|
+
var _serverEnums = require("./config/serverEnums");
|
|
23
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
24
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
25
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
26
|
+
const {
|
|
27
|
+
Panel
|
|
28
|
+
} = _antd.Collapse;
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
*
|
|
32
|
+
* @param insId
|
|
33
|
+
* @param pageId
|
|
34
|
+
* @param onPageClose
|
|
35
|
+
* @return {*}
|
|
36
|
+
* @constructor
|
|
37
|
+
*/
|
|
38
|
+
const BpmForm = (0, _list.withBpmList)(function (_ref) {
|
|
39
|
+
let {
|
|
40
|
+
content,
|
|
41
|
+
pageId,
|
|
42
|
+
onPageClose,
|
|
43
|
+
bpmListFlush
|
|
44
|
+
} = _ref;
|
|
45
|
+
const [loading, setLoading] = (0, _react.useState)(false),
|
|
46
|
+
[bpm, setBpm] = (0, _react.useState)(null);
|
|
47
|
+
function enLoading() {
|
|
48
|
+
setLoading(true);
|
|
49
|
+
_antd.message.loading('数据处理中......', 30);
|
|
50
|
+
}
|
|
51
|
+
function unLoading() {
|
|
52
|
+
setLoading(false);
|
|
53
|
+
_antd.message.destroy();
|
|
54
|
+
}
|
|
55
|
+
function handleClose() {
|
|
56
|
+
onPageClose(pageId);
|
|
57
|
+
}
|
|
58
|
+
function handleApprove(comment) {
|
|
59
|
+
enLoading();
|
|
60
|
+
(0, _builder.approved)(bpm, comment).then(_ref2 => {
|
|
61
|
+
let {
|
|
62
|
+
suc,
|
|
63
|
+
msg
|
|
64
|
+
} = _ref2;
|
|
65
|
+
unLoading();
|
|
66
|
+
if (suc) {
|
|
67
|
+
_antd.message.success('審批成功');
|
|
68
|
+
bpmListFlush();
|
|
69
|
+
onPageClose(pageId);
|
|
70
|
+
} else {
|
|
71
|
+
_antd.notification.error({
|
|
72
|
+
message: '審批失敗',
|
|
73
|
+
description: msg || (0, _local.errorMessage)()
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
function handleRefuse(comment) {
|
|
79
|
+
enLoading();
|
|
80
|
+
(0, _builder.refuse)(bpm, comment).then(_ref3 => {
|
|
81
|
+
let {
|
|
82
|
+
suc,
|
|
83
|
+
msg
|
|
84
|
+
} = _ref3;
|
|
85
|
+
unLoading();
|
|
86
|
+
if (suc) {
|
|
87
|
+
_antd.message.success('拒絕成功');
|
|
88
|
+
bpmListFlush();
|
|
89
|
+
onPageClose(pageId);
|
|
90
|
+
} else {
|
|
91
|
+
_antd.notification.error({
|
|
92
|
+
message: '拒絕失敗',
|
|
93
|
+
description: msg || (0, _local.errorMessage)()
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
function handleRevoke(comment) {
|
|
99
|
+
enLoading();
|
|
100
|
+
(0, _builder.revoke)(bpm, comment).then(_ref4 => {
|
|
101
|
+
let {
|
|
102
|
+
suc,
|
|
103
|
+
msg
|
|
104
|
+
} = _ref4;
|
|
105
|
+
unLoading();
|
|
106
|
+
if (suc) {
|
|
107
|
+
_antd.message.success('撤回成功');
|
|
108
|
+
bpmListFlush();
|
|
109
|
+
onPageClose(pageId);
|
|
110
|
+
} else {
|
|
111
|
+
_antd.notification.error({
|
|
112
|
+
message: '撤回失敗',
|
|
113
|
+
description: msg || (0, _local.errorMessage)()
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
(0, _react.useEffect)(() => {
|
|
119
|
+
enLoading();
|
|
120
|
+
const {
|
|
121
|
+
insId,
|
|
122
|
+
operation
|
|
123
|
+
} = JSON.parse(decodeURIComponent(atob(content)));
|
|
124
|
+
(0, _builder.getInstanceByInsId)(insId, operation).then(_ref5 => {
|
|
125
|
+
let {
|
|
126
|
+
suc,
|
|
127
|
+
msg,
|
|
128
|
+
bpm
|
|
129
|
+
} = _ref5;
|
|
130
|
+
unLoading();
|
|
131
|
+
if (suc) {
|
|
132
|
+
if (_serverEnums.BpmStepOperation.Waiting === operation) {
|
|
133
|
+
bpm.options[_serverEnums.BpmFormOptions.Approve] = true;
|
|
134
|
+
} else if (_serverEnums.BpmStepOperation.Submitted === operation && "ACTIVITY" === bpm.instance.state) {
|
|
135
|
+
bpm.options[_serverEnums.BpmFormOptions.Revoke] = true;
|
|
136
|
+
}
|
|
137
|
+
setBpm(bpm);
|
|
138
|
+
} else {
|
|
139
|
+
_antd.notification.error({
|
|
140
|
+
message: '獲取流程信息失敗',
|
|
141
|
+
description: msg || (0, _local.errorMessage)()
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
});
|
|
145
|
+
}, []);
|
|
146
|
+
return bpm ? /*#__PURE__*/_react.default.createElement("div", {
|
|
147
|
+
style: ContainStyle
|
|
148
|
+
}, /*#__PURE__*/_react.default.createElement(_title.default, {
|
|
149
|
+
loading: loading,
|
|
150
|
+
bpm: bpm,
|
|
151
|
+
onApprove: handleApprove,
|
|
152
|
+
onRefuse: handleRefuse,
|
|
153
|
+
onRevoke: handleRevoke,
|
|
154
|
+
onClose: handleClose
|
|
155
|
+
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
156
|
+
style: ContextStyle
|
|
157
|
+
}, /*#__PURE__*/_react.default.createElement(_antd.Collapse, {
|
|
158
|
+
defaultActiveKey: ['1'],
|
|
159
|
+
ghost: true
|
|
160
|
+
}, /*#__PURE__*/_react.default.createElement(Panel, {
|
|
161
|
+
key: 1,
|
|
162
|
+
header: "\u8868\u5355\u4FE1\u606F"
|
|
163
|
+
}, /*#__PURE__*/_react.default.createElement(_standardCompareForm.default, {
|
|
164
|
+
collect: bpm.collect,
|
|
165
|
+
data: bpm.data,
|
|
166
|
+
modify: bpm.modify
|
|
167
|
+
})), /*#__PURE__*/_react.default.createElement(Panel, {
|
|
168
|
+
key: 2,
|
|
169
|
+
header: "\u6D41\u7A0B\u4FE1\u606F"
|
|
170
|
+
}, /*#__PURE__*/_react.default.createElement(_flow.default, {
|
|
171
|
+
bpm: bpm
|
|
172
|
+
}))))) : null;
|
|
173
|
+
});
|
|
174
|
+
const ContainStyle = {
|
|
175
|
+
height: '100%',
|
|
176
|
+
'overflow-y': 'hidden'
|
|
177
|
+
};
|
|
178
|
+
const ContextStyle = {
|
|
179
|
+
height: '100%',
|
|
180
|
+
'overflow-y': 'auto'
|
|
181
|
+
};
|
|
182
|
+
BpmForm.tabName = '流程信息';
|
|
183
|
+
BpmForm.getInitialProps = function (_ref6) {
|
|
184
|
+
let {
|
|
185
|
+
query
|
|
186
|
+
} = _ref6;
|
|
187
|
+
return {
|
|
188
|
+
content: query.content
|
|
189
|
+
};
|
|
190
|
+
};
|
|
191
|
+
var _default = exports.default = BpmForm;
|
package/bpm/builder.js
CHANGED
|
@@ -17,6 +17,7 @@ var _bpmDefined = _interopRequireDefault(require("./data/bpmDefined"));
|
|
|
17
17
|
var _request = require("./data/request");
|
|
18
18
|
var _uepayOps = require("uepay-ops2");
|
|
19
19
|
var _serverEnums = require("./config/serverEnums");
|
|
20
|
+
var _bpm = _interopRequireDefault(require("./data/bpm"));
|
|
20
21
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
22
|
function responseProcess(res) {
|
|
22
23
|
if (res && 0 < res.code) {
|
|
@@ -32,16 +33,77 @@ function responseProcess(res) {
|
|
|
32
33
|
};
|
|
33
34
|
}
|
|
34
35
|
}
|
|
36
|
+
function resForBpm(res) {
|
|
37
|
+
if (res && res.code === 1) {
|
|
38
|
+
return {
|
|
39
|
+
suc: true,
|
|
40
|
+
bpm: new _bpm.default(res)
|
|
41
|
+
};
|
|
42
|
+
} else {
|
|
43
|
+
return {
|
|
44
|
+
suc: false,
|
|
45
|
+
msg: res && res.msg || '流程處理失敗!'
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
}
|
|
35
49
|
|
|
36
50
|
/**
|
|
37
51
|
*
|
|
38
52
|
* @param insId
|
|
39
|
-
* @return {Promise<
|
|
53
|
+
* @return {Promise<{
|
|
54
|
+
* suc: boolean,
|
|
55
|
+
* msg: String,
|
|
56
|
+
* data: {label: String, value: String},
|
|
57
|
+
* modify: {label: String, value: String},
|
|
58
|
+
* collect: {ClassDescriptor},
|
|
59
|
+
* instance: {DataMeshBpmInstance},
|
|
60
|
+
* steps: {[DataMeshBpmInstanceStep]}
|
|
61
|
+
* }>}
|
|
40
62
|
*/
|
|
41
|
-
function getInstanceByInsId(insId) {
|
|
42
|
-
return (0, _request.getBpmForm)(insId).then(res =>
|
|
43
|
-
|
|
63
|
+
function getInstanceByInsId(insId, operation) {
|
|
64
|
+
return (0, _request.getBpmForm)(insId, operation).then(res => resForBpm(res));
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* 審批流程
|
|
69
|
+
* @param bpm {Bpm}
|
|
70
|
+
* @param context {String} 森皮説明
|
|
71
|
+
* @return {Promise<{suc: boolean, msg: String}>}
|
|
72
|
+
*/
|
|
73
|
+
function approved(bpm, context) {
|
|
74
|
+
const instanceId = bpm.instance.id;
|
|
75
|
+
return (0, _request.bpmApprove)(instanceId, getCurStepId(bpm), context).then(res => resForBpm(res));
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* 拒絕
|
|
80
|
+
* @param bpm {Bpm}
|
|
81
|
+
* @param context {String} 森皮説明
|
|
82
|
+
* @return {Promise<{suc: boolean, msg: String}>}
|
|
83
|
+
*/
|
|
84
|
+
function refuse(bpm, context) {
|
|
85
|
+
const instanceId = bpm.instance.id;
|
|
86
|
+
return (0, _request.bpmRefuse)(instanceId, getCurStepId(bpm), context).then(res => resForBpm(res));
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* 異步提交流程
|
|
91
|
+
* @param insId {Number}
|
|
92
|
+
* @param opinion {String|Boolean} 撤回意见
|
|
93
|
+
* @return {Promise<{suc: boolean, curUsr: *, bpmCacheId: (number|boolean), bpm: (InstanceBpmImpl|DefinedBpmImpl)} | {suc: boolean}>}
|
|
94
|
+
*/
|
|
95
|
+
function revoke(bpm, context) {
|
|
96
|
+
const instanceId = bpm.instance.id;
|
|
97
|
+
return (0, _request.bpmRevoke)(instanceId, getCurStepId(bpm), context).then(res => resForBpm(res));
|
|
98
|
+
}
|
|
99
|
+
function getCurStepId(bpm) {
|
|
100
|
+
let stepId = null;
|
|
101
|
+
bpm.steps.forEach(step => {
|
|
102
|
+
if (step.stepOperation === _serverEnums.BpmStepOperation.Waiting) {
|
|
103
|
+
stepId = step.id;
|
|
104
|
+
}
|
|
44
105
|
});
|
|
106
|
+
return stepId;
|
|
45
107
|
}
|
|
46
108
|
|
|
47
109
|
/**
|
|
@@ -58,7 +120,7 @@ function getInstanceByInsId(insId) {
|
|
|
58
120
|
*/
|
|
59
121
|
function collectState(collectId, pkData) {
|
|
60
122
|
return (0, _request.bpmCollectState)((0, _uepayOps.getHost)(), collectId, pkData).then(res => {
|
|
61
|
-
|
|
123
|
+
const ret = {};
|
|
62
124
|
if (res && res.code > 0) {
|
|
63
125
|
const {
|
|
64
126
|
bpmDefined,
|
|
@@ -66,21 +128,16 @@ function collectState(collectId, pkData) {
|
|
|
66
128
|
usrDict
|
|
67
129
|
} = res;
|
|
68
130
|
switch (res.state) {
|
|
69
|
-
case
|
|
70
|
-
case
|
|
131
|
+
//case BpmAccessState.Related:
|
|
132
|
+
//case BpmAccessState.Draft:
|
|
71
133
|
case _serverEnums.BpmAccessState.Execute:
|
|
72
|
-
|
|
73
|
-
ret = build({
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
usrDict
|
|
77
|
-
});
|
|
78
|
-
ret.state = res.state;
|
|
134
|
+
//case BpmAccessState.Access:
|
|
135
|
+
//ret = build({bpmDefined, bpmInstance, usrDict});
|
|
136
|
+
ret.state = _serverEnums.BpmAccessState.Execute;
|
|
137
|
+
ret.msg = res.msg;
|
|
79
138
|
break;
|
|
80
139
|
case _serverEnums.BpmAccessState.None:
|
|
81
|
-
ret =
|
|
82
|
-
state: _serverEnums.BpmAccessState.None
|
|
83
|
-
};
|
|
140
|
+
ret.state = _serverEnums.BpmAccessState.None;
|
|
84
141
|
break;
|
|
85
142
|
default:
|
|
86
143
|
ret = {
|
|
@@ -149,59 +206,6 @@ function end(_ref3) {
|
|
|
149
206
|
});
|
|
150
207
|
}
|
|
151
208
|
|
|
152
|
-
/**
|
|
153
|
-
* 審批流程
|
|
154
|
-
* @param insId {Number}
|
|
155
|
-
* @param opinion {String} 流程说明
|
|
156
|
-
* @param formData {Object|Boolean} {{formNodeId: {Number}, 流程执行表单的主键, formData: {String}, 对应的JSON字符串}[]}
|
|
157
|
-
* @param tos
|
|
158
|
-
* @return {Promise<{suc: boolean, curUsr: *, bpmCacheId: (number|boolean), bpm: (InstanceBpmImpl|DefinedBpmImpl)} | {suc: boolean}>}
|
|
159
|
-
*/
|
|
160
|
-
function approved(_ref4) {
|
|
161
|
-
let {
|
|
162
|
-
insId,
|
|
163
|
-
opinion,
|
|
164
|
-
formData = false,
|
|
165
|
-
tos = false
|
|
166
|
-
} = _ref4;
|
|
167
|
-
return (0, _request.bpmApprove)(insId, opinion, formData, tos).then(res => {
|
|
168
|
-
return responseProcess(res);
|
|
169
|
-
});
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
/**
|
|
173
|
-
* 拒絕
|
|
174
|
-
* @param insId
|
|
175
|
-
* @param opinion
|
|
176
|
-
* @param tos
|
|
177
|
-
* @return {Promise<{suc: boolean, curUsr: *, bpmCacheId: (number|boolean), bpm: (InstanceBpmImpl|DefinedBpmImpl)}|{suc: boolean, msg: *}>}
|
|
178
|
-
*/
|
|
179
|
-
function refuse(_ref5) {
|
|
180
|
-
let {
|
|
181
|
-
insId,
|
|
182
|
-
opinion
|
|
183
|
-
} = _ref5;
|
|
184
|
-
return (0, _request.bpmRefuse)(insId, opinion).then(res => {
|
|
185
|
-
return responseProcess(res);
|
|
186
|
-
});
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
/**
|
|
190
|
-
* 異步提交流程
|
|
191
|
-
* @param insId {Number}
|
|
192
|
-
* @param opinion {String|Boolean} 撤回意见
|
|
193
|
-
* @return {Promise<{suc: boolean, curUsr: *, bpmCacheId: (number|boolean), bpm: (InstanceBpmImpl|DefinedBpmImpl)} | {suc: boolean}>}
|
|
194
|
-
*/
|
|
195
|
-
function revoke(_ref6) {
|
|
196
|
-
let {
|
|
197
|
-
insId,
|
|
198
|
-
opinion
|
|
199
|
-
} = _ref6;
|
|
200
|
-
return (0, _request.bpmRevoke)(insId, opinion).then(res => {
|
|
201
|
-
return responseProcess(res);
|
|
202
|
-
});
|
|
203
|
-
}
|
|
204
|
-
|
|
205
209
|
/**
|
|
206
210
|
* @param bpmDefined: {BpmDefined}|boolean 流程定義信息:,
|
|
207
211
|
* @param bpmInstance: {BpmInstance}|boolean 流程實例信息,
|
|
@@ -222,12 +226,12 @@ function revoke(_ref6) {
|
|
|
222
226
|
* isDef(); 返回 true
|
|
223
227
|
* }
|
|
224
228
|
*/
|
|
225
|
-
function build(
|
|
229
|
+
function build(_ref4) {
|
|
226
230
|
let {
|
|
227
231
|
bpmDefined,
|
|
228
232
|
bpmInstance,
|
|
229
233
|
usrDict
|
|
230
|
-
} =
|
|
234
|
+
} = _ref4;
|
|
231
235
|
if (bpmInstance) {
|
|
232
236
|
const {
|
|
233
237
|
instance,
|
|
@@ -3,7 +3,69 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.InsStatus = exports.InsFormTypeName = exports.InsFormType = exports.ExeUsrType = exports.ExeNodeUserOptionsName = exports.ExeNodeUserOptions = exports.ExeNodeStatus = exports.DefNodeType = exports.DefNodeApprovalType = exports.BpmFormOptions = exports.BpmAccessState = void 0;
|
|
6
|
+
exports.InsStatus = exports.InsFormTypeName = exports.InsFormType = exports.ExeUsrType = exports.ExeNodeUserOptionsName = exports.ExeNodeUserOptions = exports.ExeNodeStatus = exports.DefNodeType = exports.DefNodeApprovalType = exports.BpmStepOperation = exports.BpmInstanceState = exports.BpmInstanceAccessDisplayName = exports.BpmInstanceAccess = exports.BpmFormOptions = exports.BpmAccessState = void 0;
|
|
7
|
+
var _submit = _interopRequireDefault(require("../form/options/submit"));
|
|
8
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
9
|
+
/**
|
|
10
|
+
* 審批頁面操作選項
|
|
11
|
+
* @type {{Comment: number, Revoke: number, Submit: number, Close: number, Approve: number}}
|
|
12
|
+
*/
|
|
13
|
+
const BpmFormOptions = exports.BpmFormOptions = {
|
|
14
|
+
/**
|
|
15
|
+
* 可審批
|
|
16
|
+
*/
|
|
17
|
+
Approve: 1,
|
|
18
|
+
/**
|
|
19
|
+
* 可关闭
|
|
20
|
+
*/
|
|
21
|
+
Close: 2,
|
|
22
|
+
/**
|
|
23
|
+
* 可评论
|
|
24
|
+
*/
|
|
25
|
+
Comment: 3,
|
|
26
|
+
/**
|
|
27
|
+
* 可撤销
|
|
28
|
+
*/
|
|
29
|
+
Revoke: 4,
|
|
30
|
+
/**
|
|
31
|
+
* 可以提交
|
|
32
|
+
*/
|
|
33
|
+
Submit: 5,
|
|
34
|
+
/**
|
|
35
|
+
* 可以停止
|
|
36
|
+
*/
|
|
37
|
+
End: 6,
|
|
38
|
+
/**
|
|
39
|
+
* 可以保存
|
|
40
|
+
*/
|
|
41
|
+
Save: 7
|
|
42
|
+
};
|
|
43
|
+
const BpmStepOperation = exports.BpmStepOperation = {
|
|
44
|
+
Submitted: 'Submitted',
|
|
45
|
+
Standby: 'Standby',
|
|
46
|
+
Approved: 'Approved',
|
|
47
|
+
Rejected: 'Rejected',
|
|
48
|
+
Waiting: 'Waiting',
|
|
49
|
+
Revoked: 'Revoked'
|
|
50
|
+
};
|
|
51
|
+
const BpmInstanceState = exports.BpmInstanceState = {
|
|
52
|
+
ACTIVITY: 'ACTIVITY',
|
|
53
|
+
COMPLETE: 'COMPLETE',
|
|
54
|
+
BACKOUT: 'BACKOUT',
|
|
55
|
+
REJECT: 'REJECT'
|
|
56
|
+
};
|
|
57
|
+
const BpmInstanceAccess = exports.BpmInstanceAccess = {
|
|
58
|
+
UPDATE: 'UPDATE',
|
|
59
|
+
INSERT: 'INSERT',
|
|
60
|
+
DELETE: 'DELETE'
|
|
61
|
+
};
|
|
62
|
+
const BpmInstanceAccessDisplayName = exports.BpmInstanceAccessDisplayName = {
|
|
63
|
+
UPDATE: '修改',
|
|
64
|
+
INSERT: '新增',
|
|
65
|
+
DELETE: '刪除'
|
|
66
|
+
};
|
|
67
|
+
//
|
|
68
|
+
|
|
7
69
|
/**
|
|
8
70
|
* 數據集和流程的關聯狀態
|
|
9
71
|
* @type {{Execute: string, Access: string, Error: string, None: string}}
|
|
@@ -131,41 +193,6 @@ const InsFormTypeName = exports.InsFormTypeName = {
|
|
|
131
193
|
Update: '修改'
|
|
132
194
|
};
|
|
133
195
|
|
|
134
|
-
/**
|
|
135
|
-
* 審批頁面操作選項
|
|
136
|
-
* @type {{Comment: number, Revoke: number, Submit: number, Close: number, Approve: number}}
|
|
137
|
-
*/
|
|
138
|
-
const BpmFormOptions = exports.BpmFormOptions = {
|
|
139
|
-
/**
|
|
140
|
-
* 可審批
|
|
141
|
-
*/
|
|
142
|
-
Approve: 1,
|
|
143
|
-
/**
|
|
144
|
-
* 可关闭
|
|
145
|
-
*/
|
|
146
|
-
Close: 2,
|
|
147
|
-
/**
|
|
148
|
-
* 可评论
|
|
149
|
-
*/
|
|
150
|
-
Comment: 3,
|
|
151
|
-
/**
|
|
152
|
-
* 可撤销
|
|
153
|
-
*/
|
|
154
|
-
Revoke: 4,
|
|
155
|
-
/**
|
|
156
|
-
* 可以提交
|
|
157
|
-
*/
|
|
158
|
-
Submit: 5,
|
|
159
|
-
/**
|
|
160
|
-
* 可以停止
|
|
161
|
-
*/
|
|
162
|
-
End: 6,
|
|
163
|
-
/**
|
|
164
|
-
* 可以保存
|
|
165
|
-
*/
|
|
166
|
-
Save: 7
|
|
167
|
-
};
|
|
168
|
-
|
|
169
196
|
/**
|
|
170
197
|
* 流程執行人类型
|
|
171
198
|
* @type {{TODO: string, COMPLETE: string, NOTICE: string, APPLICANT: string}}
|
package/bpm/data/bpm.js
CHANGED
|
@@ -4,12 +4,52 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
+
require("core-js/modules/es6.symbol.js");
|
|
8
|
+
var _serverEnums = require("../config/serverEnums");
|
|
9
|
+
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; }
|
|
10
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
11
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
12
|
class Bpm {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
+
constructor(_ref) {
|
|
14
|
+
let {
|
|
15
|
+
collect,
|
|
16
|
+
instance,
|
|
17
|
+
steps,
|
|
18
|
+
data,
|
|
19
|
+
modify
|
|
20
|
+
} = _ref;
|
|
21
|
+
/**
|
|
22
|
+
* 流程实例信息
|
|
23
|
+
* @type {{ClassDescriptor}|null}
|
|
24
|
+
*/
|
|
25
|
+
_defineProperty(this, "collect", null);
|
|
26
|
+
/**
|
|
27
|
+
* 流程实例信息
|
|
28
|
+
* @type {{DataMeshBpmInstance}|null}
|
|
29
|
+
*/
|
|
30
|
+
_defineProperty(this, "instance", null);
|
|
31
|
+
/**
|
|
32
|
+
* 流程实例信息
|
|
33
|
+
* @type {{[DataMeshBpmInstanceStep]}|null}
|
|
34
|
+
*/
|
|
35
|
+
_defineProperty(this, "steps", null);
|
|
36
|
+
/**
|
|
37
|
+
* 流程实例信息
|
|
38
|
+
* @type {{Object}|null}
|
|
39
|
+
*/
|
|
40
|
+
_defineProperty(this, "data", null);
|
|
41
|
+
/**
|
|
42
|
+
* 流程实例信息
|
|
43
|
+
* @type {{Object}|null}
|
|
44
|
+
*/
|
|
45
|
+
_defineProperty(this, "modify", null);
|
|
46
|
+
_defineProperty(this, "options", {});
|
|
47
|
+
this.collect = collect;
|
|
48
|
+
this.instance = instance;
|
|
49
|
+
this.steps = steps;
|
|
50
|
+
this.data = data;
|
|
51
|
+
this.modify = modify;
|
|
52
|
+
this.options[_serverEnums.BpmFormOptions.Close] = true;
|
|
13
53
|
}
|
|
14
54
|
}
|
|
15
55
|
exports.default = Bpm;
|
package/bpm/data/request.js
CHANGED
|
@@ -60,15 +60,60 @@ const bpmCollectState = (host, collectId, pkData) => {
|
|
|
60
60
|
*
|
|
61
61
|
*/
|
|
62
62
|
exports.bpmCollectState = bpmCollectState;
|
|
63
|
-
const getBpmForm = insId => {
|
|
64
|
-
return
|
|
63
|
+
const getBpmForm = (insId, operation) => {
|
|
64
|
+
//return get(`${getHost()}/api/bpm/execute/usr/form?insId=${insId}`);
|
|
65
|
+
return (0, _net.get)("".concat((0, _uepayOps.getHost)(), "/data/mesh/bpm/ins?insId=").concat(insId, "&operation=").concat(operation));
|
|
65
66
|
};
|
|
66
67
|
|
|
67
68
|
/**
|
|
68
|
-
*
|
|
69
|
+
* 同意流程
|
|
70
|
+
* @param instanceId
|
|
71
|
+
* @param context
|
|
69
72
|
* @return {Promise<Response>}
|
|
70
73
|
*/
|
|
71
74
|
exports.getBpmForm = getBpmForm;
|
|
75
|
+
const bpmApprove = (instanceId, stepId, context) => {
|
|
76
|
+
return (0, _net.post)("".concat((0, _uepayOps.getHost)(), "/data/mesh/bpm/ins/approve"), {
|
|
77
|
+
instanceId,
|
|
78
|
+
stepId,
|
|
79
|
+
context
|
|
80
|
+
});
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* 審批者拒絕流程
|
|
85
|
+
* @param insId
|
|
86
|
+
* @param opinion
|
|
87
|
+
* @return {Promise<Response>}
|
|
88
|
+
*/
|
|
89
|
+
exports.bpmApprove = bpmApprove;
|
|
90
|
+
const bpmRefuse = (instanceId, stepId, context) => {
|
|
91
|
+
return (0, _net.post)("".concat((0, _uepayOps.getHost)(), "/data/mesh/bpm/ins/refuse"), {
|
|
92
|
+
instanceId,
|
|
93
|
+
stepId,
|
|
94
|
+
context
|
|
95
|
+
});
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* 撤回/撤销流程,InsStatus.EXECUTE由ExeUsrStatus.APPLICANT执行。
|
|
100
|
+
* @param insId {Number} 流程实例ID
|
|
101
|
+
* @param opinion {String} 撤销说明
|
|
102
|
+
*/
|
|
103
|
+
exports.bpmRefuse = bpmRefuse;
|
|
104
|
+
const bpmRevoke = (instanceId, stepId, context) => {
|
|
105
|
+
return (0, _net.post)("".concat((0, _uepayOps.getHost)(), "/data/mesh/bpm/ins/revoke"), {
|
|
106
|
+
instanceId,
|
|
107
|
+
stepId,
|
|
108
|
+
context
|
|
109
|
+
});
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* 获取当前各种办理清单
|
|
114
|
+
* @return {Promise<Response>}
|
|
115
|
+
*/
|
|
116
|
+
exports.bpmRevoke = bpmRevoke;
|
|
72
117
|
const getBpmCount = () => {
|
|
73
118
|
return (0, _net.get)("".concat((0, _uepayOps.getHost)(), "/api/bpm/execute/usr/view"));
|
|
74
119
|
};
|
|
@@ -125,58 +170,13 @@ const bpmEnd = insId => {
|
|
|
125
170
|
});
|
|
126
171
|
};
|
|
127
172
|
|
|
128
|
-
/**
|
|
129
|
-
* 同意流程
|
|
130
|
-
* @param insId
|
|
131
|
-
* @param opinion
|
|
132
|
-
* @param formData
|
|
133
|
-
* @param tos
|
|
134
|
-
* @return {Promise<Response>}
|
|
135
|
-
*/
|
|
136
|
-
exports.bpmEnd = bpmEnd;
|
|
137
|
-
const bpmApprove = (insId, opinion, formData, tos) => {
|
|
138
|
-
return (0, _net.post)("".concat((0, _uepayOps.getHost)(), "/api/bpm/execute/usr/approve"), {
|
|
139
|
-
insId,
|
|
140
|
-
opinion,
|
|
141
|
-
formData,
|
|
142
|
-
tos
|
|
143
|
-
});
|
|
144
|
-
};
|
|
145
|
-
|
|
146
|
-
/**
|
|
147
|
-
* 審批者拒絕流程
|
|
148
|
-
* @param insId
|
|
149
|
-
* @param opinion
|
|
150
|
-
* @return {Promise<Response>}
|
|
151
|
-
*/
|
|
152
|
-
exports.bpmApprove = bpmApprove;
|
|
153
|
-
const bpmRefuse = (insId, opinion) => {
|
|
154
|
-
return (0, _net.post)("".concat((0, _uepayOps.getHost)(), "/api/bpm/execute/usr/refuse"), {
|
|
155
|
-
insId,
|
|
156
|
-
opinion
|
|
157
|
-
});
|
|
158
|
-
};
|
|
159
|
-
|
|
160
|
-
/**
|
|
161
|
-
* 撤回/撤销流程,InsStatus.EXECUTE由ExeUsrStatus.APPLICANT执行。
|
|
162
|
-
* @param insId {Number} 流程实例ID
|
|
163
|
-
* @param opinion {String} 撤销说明
|
|
164
|
-
*/
|
|
165
|
-
exports.bpmRefuse = bpmRefuse;
|
|
166
|
-
const bpmRevoke = (insId, opinion) => {
|
|
167
|
-
return (0, _net.post)("".concat((0, _uepayOps.getHost)(), "/api/bpm/execute/usr/revoke"), {
|
|
168
|
-
insId,
|
|
169
|
-
opinion
|
|
170
|
-
});
|
|
171
|
-
};
|
|
172
|
-
|
|
173
173
|
/**
|
|
174
174
|
* 评论,InsStatus.EXECUTE, InsStatus.FINISHED。所有可见人均可执行。
|
|
175
175
|
* @param insId {Number} 流程实例ID
|
|
176
176
|
* @param comment {String} 评论信息
|
|
177
177
|
* @param tos {Number} 评论对象Id列表
|
|
178
178
|
*/
|
|
179
|
-
exports.
|
|
179
|
+
exports.bpmEnd = bpmEnd;
|
|
180
180
|
const bpmComment = (insId, comment, tos) => {
|
|
181
181
|
return (0, _net.post)("".concat((0, _uepayOps.getHost)(), "/api/bpm/execute/usr/comment"), {
|
|
182
182
|
insId,
|