venus-design 1.0.26 → 1.0.28

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.
@@ -11,13 +11,6 @@ var SelectApprovalUser = function SelectApprovalUser(props) {
11
11
  var children = [];
12
12
  var tagdata = [];
13
13
  if (props.users != undefined) {
14
- /*if(props.users.rolename!="未选择角色"&&props.users.rolename[0].rolecode!=undefined){
15
- for (let i = 0; i <props.users.rolename[0].rolecode.length ; i++) {
16
- tagdata.push(props.users.rolename[0].rolecode[i]);
17
- selectType=="moren"? options.push(props.users.rolename[0].rolecode[i]):"";
18
- children.push(<Option selected key={props.users.rolename[0].rolecode[i]}>{props.users.rolename[0].rolename[i]}</Option>);
19
- }
20
- }*/
21
14
  if (props.users.username != "未选择人员" && props.users.username[0].userid != undefined) {
22
15
  for (var i = 0; i < props.users.username[0].userid.length; i++) {
23
16
  if (props.users.username[0].userid[i] != "") {
@@ -19,6 +19,10 @@ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key i
19
19
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
20
20
  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); }
21
21
  function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
22
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
23
+ 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."); }
24
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
25
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
22
26
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
23
27
  function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
24
28
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
@@ -99,109 +103,106 @@ export default /*#__PURE__*/React.forwardRef(function (props, ref) {
99
103
  _useState30 = _slicedToArray(_useState29, 2),
100
104
  idS = _useState30[0],
101
105
  setIds = _useState30[1];
102
- //查询流程配置
103
106
  var findByOption = /*#__PURE__*/function () {
104
107
  var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(record, code, name) {
105
- var idService, res, res1, options, i, userLi, _i, projectname, name1;
108
+ var _record$id, _userRes$data, rawId, hasAmpersand, serviceId, flowRes, _flowRes$data, workflowcode, formid, columnlist, userRes, _ref2, rolename, username, _selectType, options, _rolename$0$rolecode, _rolename$, _username$0$userid, _username$, users, defaultName;
106
109
  return _regeneratorRuntime().wrap(function _callee$(_context) {
107
110
  while (1) switch (_context.prev = _context.next) {
108
111
  case 0:
109
- idService = record.id;
110
- if (idService.indexOf("&") > -1) {
111
- setserviceid(idService.substring(0, idService.indexOf("&")));
112
- setIds(true);
113
- } else {
114
- setserviceid(idService);
115
- }
116
- //查询流程配置
117
- _context.next = 4;
112
+ _context.prev = 0;
113
+ // 1. 解析 serviceId
114
+ rawId = (_record$id = record === null || record === void 0 ? void 0 : record.id) !== null && _record$id !== void 0 ? _record$id : '';
115
+ hasAmpersand = rawId.includes('&');
116
+ serviceId = hasAmpersand ? rawId.split('&')[0] : rawId;
117
+ setserviceid(serviceId);
118
+ setIds(hasAmpersand);
119
+
120
+ // 2. 查询流程配置
121
+ _context.next = 8;
118
122
  return findByOptionCode(code);
119
- case 4:
120
- res = _context.sent;
121
- if (!(res && res.success)) {
122
- _context.next = 18;
123
+ case 8:
124
+ flowRes = _context.sent;
125
+ if (!(!(flowRes !== null && flowRes !== void 0 && flowRes.success) || !flowRes.data)) {
126
+ _context.next = 13;
123
127
  break;
124
128
  }
125
- if (!res.data) {
126
- _context.next = 14;
129
+ _message.warning("\u672A\u627E\u5230\u6D41\u7A0B\u914D\u7F6E\u7F16\u7801\u4E3A ".concat(code, " \u7684\u4FE1\u606F"));
130
+ setDefaultName(record, name);
131
+ return _context.abrupt("return");
132
+ case 13:
133
+ _flowRes$data = flowRes.data, workflowcode = _flowRes$data.workflowcode, formid = _flowRes$data.formid, columnlist = _flowRes$data.columnlist;
134
+ setdefineid(formid !== null && formid !== void 0 ? formid : -1);
135
+ if (formid == null && columnlist) settablename(columnlist);
136
+
137
+ // 3. 查询审批人
138
+ _context.next = 18;
139
+ return findByUserid(workflowcode, record);
140
+ case 18:
141
+ userRes = _context.sent;
142
+ if (userRes !== null && userRes !== void 0 && userRes.success) {
143
+ _context.next = 23;
127
144
  break;
128
145
  }
129
- _context.next = 9;
130
- return findByUserid(res.data.workflowcode, record);
131
- case 9:
132
- res1 = _context.sent;
146
+ _message.error('查询候选人失败!');
147
+ setDefaultName(record, name);
148
+ return _context.abrupt("return");
149
+ case 23:
150
+ _ref2 = (_userRes$data = userRes.data) !== null && _userRes$data !== void 0 ? _userRes$data : {}, rolename = _ref2.rolename, username = _ref2.username, _selectType = _ref2.selectType;
151
+ setuserdata(userRes.data);
152
+ setSelectType(_selectType);
153
+
154
+ // 4. 构建 options
133
155
  options = [];
134
- if (res1 && res1.success) {
135
- setuserdata(res1.data);
136
- setSelectType(res1.data.selectType);
137
- if (res1.data != undefined) {
138
- if (res1.data.rolename != "未选择角色") {
139
- for (i = 0; i < res1.data.rolename[0].rolecode.length; i++) {
140
- options.push(res1.data.rolename[0].rolecode[i]);
141
- }
142
- }
143
- if (res1.data.username != "未选择人员") {
144
- if (res1.data.username[0].userid != null && res1.data.selectType == "moren") {
145
- userLi = res1.data.username[0].userid;
146
- form.setFieldsValue({
147
- person: userLi
148
- });
149
- }
150
- for (_i = 0; _i < res1.data.username[0].userid.length; _i++) {
151
- options.push(res1.data.username[0].userid[_i]);
152
- }
153
- }
154
- }
155
- setdata(res.data);
156
- if (record != undefined) {
157
- projectname = "";
158
- if (props.project != undefined && props.project != null) {
159
- projectname += props.project.projectName;
160
- } else {
161
- projectname = name;
162
- }
163
- name1 = name ? name : "送审" + "【" + record.data.commissionNo + "】" + moment().format("YYYY-MM-DD hh:mm:ss");
156
+ if (rolename && rolename !== '未选择角色') {
157
+ options.push.apply(options, _toConsumableArray((_rolename$0$rolecode = (_rolename$ = rolename[0]) === null || _rolename$ === void 0 ? void 0 : _rolename$.rolecode) !== null && _rolename$0$rolecode !== void 0 ? _rolename$0$rolecode : []));
158
+ }
159
+ if (username && username !== '未选择人员') {
160
+ users = (_username$0$userid = (_username$ = username[0]) === null || _username$ === void 0 ? void 0 : _username$.userid) !== null && _username$0$userid !== void 0 ? _username$0$userid : [];
161
+ if (_selectType === 'moren' && users.length) {
164
162
  form.setFieldsValue({
165
- name: name1
163
+ person: users
166
164
  });
167
- setload(false);
168
165
  }
169
- } else {
170
- _message.error("查询候选人失败!");
166
+ options.push.apply(options, _toConsumableArray(users));
171
167
  }
172
- _context.next = 15;
173
- break;
174
- case 14:
175
- _message.warning("没有找到流程配置编码为" + code + "的相关信息");
176
- case 15:
177
- if (res.data != null && res.data.formid != null) {
178
- setdefineid(res.data.formid);
179
- } else {
180
- setdefineid(-1);
181
- if (res.data != null) {
182
- settablename(res.data.columnlist);
183
- } else {
184
- _message.warning("没有配置审批页面显示列!");
185
- }
186
- }
187
- _context.next = 21;
188
- break;
189
- case 18:
190
- name1 = name ? name : "送审" + "【" + record.data.commissionNo + "】" + moment().format("YYYY-MM-DD hh:mm:ss");
168
+ // 5. 设置表单名称
169
+ defaultName = name || buildDefaultName(record);
191
170
  form.setFieldsValue({
192
- name: name1
171
+ name: defaultName
193
172
  });
173
+ setdata(flowRes.data);
174
+ case 32:
175
+ _context.prev = 32;
194
176
  setload(false);
195
- case 21:
177
+ return _context.finish(32);
178
+ case 35:
196
179
  case "end":
197
180
  return _context.stop();
198
181
  }
199
- }, _callee);
182
+ }, _callee, null, [[0,, 32, 35]]);
200
183
  }));
201
184
  return function findByOption(_x, _x2, _x3) {
202
185
  return _ref.apply(this, arguments);
203
186
  };
204
187
  }();
188
+
189
+ // 抽离:设置默认名称
190
+ function setDefaultName(record, name) {
191
+ var defaultName = name || buildDefaultName(record);
192
+ form.setFieldsValue({
193
+ name: defaultName
194
+ });
195
+ setload(false);
196
+ }
197
+
198
+ // 抽离:构造默认名称
199
+ function buildDefaultName(record) {
200
+ var _props$project, _record$data;
201
+ var projectName = (_props$project = props.project) === null || _props$project === void 0 ? void 0 : _props$project.projectName;
202
+ var commissionNo = record === null || record === void 0 || (_record$data = record.data) === null || _record$data === void 0 ? void 0 : _record$data.commissionNo;
203
+ var timestamp = moment().format('YYYY-MM-DD HH:mm:ss');
204
+ return projectName ? "\u9001\u5BA1\u3010".concat(commissionNo, "\u3011").concat(timestamp) : "\u9001\u5BA1\u3010".concat(commissionNo, "\u3011").concat(timestamp);
205
+ }
205
206
  //取消
206
207
  var onCancel = function onCancel() {
207
208
  setVisible(false);
@@ -212,9 +213,13 @@ export default /*#__PURE__*/React.forwardRef(function (props, ref) {
212
213
  props.onCancel();
213
214
  }
214
215
  };
216
+ /**
217
+ * 发起送审
218
+ * @param val
219
+ */
215
220
  var _onOk = function onOk(val) {
216
221
  setokload(true);
217
- onStartInstance(data.workflowcode, val.name, serviceid, defineid, tablename, val.memo, val.person, data.operationname);
222
+ onStartInstance(data.workflowcode, val.name, serviceid, defineid, tablename, val.memo);
218
223
  };
219
224
  /**
220
225
  * 发起送审
@@ -228,8 +233,8 @@ export default /*#__PURE__*/React.forwardRef(function (props, ref) {
228
233
  * @param operationname
229
234
  */
230
235
  var onStartInstance = /*#__PURE__*/function () {
231
- var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(key, instanceName, id, defineid, tablename, memo, persong, operationname) {
232
- var firstPerson, flagWf, res, _res;
236
+ var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(key, instanceName, id, defineid, tablename, memo) {
237
+ var firstPerson, flagWf, res, wfData, _res;
233
238
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
234
239
  while (1) switch (_context2.prev = _context2.next) {
235
240
  case 0:
@@ -250,7 +255,6 @@ export default /*#__PURE__*/React.forwardRef(function (props, ref) {
250
255
  _message.success("送审成功!");
251
256
  flagWf = true;
252
257
  setokload(false);
253
- //const editUser = await editCandateGroupsOrUsers(firstPerson,res.message);
254
258
  setVisible(false);
255
259
  //刷新状态
256
260
  if (!(urlUpdateStatus != undefined && urlUpdateStatus != null)) {
@@ -265,22 +269,42 @@ export default /*#__PURE__*/React.forwardRef(function (props, ref) {
265
269
  case 16:
266
270
  _message.error("请检查流程是否部署!");
267
271
  case 17:
268
- _context2.next = 33;
272
+ _context2.next = 34;
269
273
  break;
270
274
  case 19:
271
- _context2.next = 21;
272
- return startData(key, instanceName, id, defineid, tablename, memo, url, prefix, operationname, urlUpdateStatus, _objectSpread(_objectSpread({}, record.data), {}, {
273
- currentState: props.currentState != undefined ? props.currentState : "",
274
- modifyState: props.modifyState != undefined ? props.modifyState : "",
275
- isProjectBG: props.isProjectBG != undefined ? props.isProjectBG : false
276
- }), firstPerson, props.statusList, actionId, record.data.businessKey, props.dataViewIid != undefined ? props.dataViewIid : "-1", props.dataSceneIid != undefined ? props.dataSceneIid : "-1",
277
- //场景标识
278
- props.serviceUrl != undefined ? props.serviceUrl : "", props.componentUrl != undefined ? props.componentUrl : null //组件地址
279
- );
280
- case 21:
275
+ //启动流程数据
276
+ wfData = {
277
+ processDefinitionKey: key,
278
+ instanceName: instanceName,
279
+ formId: defineid,
280
+ tableName: tablename,
281
+ dataId: id,
282
+ businessKey: record.data.businessKey,
283
+ memo: memo,
284
+ url: url,
285
+ prefix: prefix,
286
+ firstPerson: firstPerson,
287
+ urlUpdateStatus: urlUpdateStatus,
288
+ stateList: props.statusList,
289
+ actionId: actionId,
290
+ dataViewIid: props.dataViewIid != undefined ? props.dataViewIid : "-1",
291
+ dataSceneIid: props.dataSceneIid != undefined ? props.dataSceneIid : "-1",
292
+ serviceUrl: props.serviceUrl != undefined ? props.serviceUrl : "",
293
+ componentUrl: props.componentUrl != undefined ? props.componentUrl : null,
294
+ //组件地址
295
+ ownerAppCode: data.ownerAppCode != undefined ? data.ownerAppCode : "",
296
+ vis: _objectSpread(_objectSpread({}, record.data), {}, {
297
+ currentState: props.currentState != undefined ? props.currentState : "",
298
+ modifyState: props.modifyState != undefined ? props.modifyState : "",
299
+ isProjectBG: props.isProjectBG != undefined ? props.isProjectBG : false
300
+ })
301
+ }; //启动流程
302
+ _context2.next = 22;
303
+ return startData(wfData);
304
+ case 22:
281
305
  _res = _context2.sent;
282
306
  if (!(_res && _res.success)) {
283
- _context2.next = 32;
307
+ _context2.next = 33;
284
308
  break;
285
309
  }
286
310
  _message.success("送审成功!");
@@ -289,40 +313,52 @@ export default /*#__PURE__*/React.forwardRef(function (props, ref) {
289
313
  setVisible(false);
290
314
  //刷新状态
291
315
  if (!(urlUpdateStatus != undefined && urlUpdateStatus != null)) {
292
- _context2.next = 30;
316
+ _context2.next = 31;
293
317
  break;
294
318
  }
295
- _context2.next = 30;
319
+ _context2.next = 31;
296
320
  return SubmitDataStatus(record.id, props.statusList[0], urlUpdateStatus, prefix);
297
- case 30:
298
- _context2.next = 33;
321
+ case 31:
322
+ _context2.next = 34;
299
323
  break;
300
- case 32:
301
- _message.error("请检查流程是否部署!");
302
324
  case 33:
303
- props.callback(flagWf);
325
+ _message.error("请检查流程是否部署!");
304
326
  case 34:
327
+ //刷新列表
328
+ props.callback(flagWf);
329
+ case 35:
305
330
  case "end":
306
331
  return _context2.stop();
307
332
  }
308
333
  }, _callee2);
309
334
  }));
310
- return function onStartInstance(_x4, _x5, _x6, _x7, _x8, _x9, _x10, _x11) {
311
- return _ref2.apply(this, arguments);
335
+ return function onStartInstance(_x4, _x5, _x6, _x7, _x8, _x9) {
336
+ return _ref3.apply(this, arguments);
312
337
  };
313
338
  }();
339
+
340
+ // 暴露方法:添加送审
314
341
  useImperativeHandle(ref, function () {
315
342
  return {
316
343
  addFn: addFn
317
344
  };
318
345
  });
346
+ /**
347
+ * 弹出送审弹窗
348
+ */
319
349
  useEffect(function () {
320
350
  if (userdata) {
321
351
  setVisible(true);
322
352
  }
323
353
  }, [userdata]);
354
+ /**
355
+ * 添加送审
356
+ * @param record
357
+ * @param code
358
+ * @param name
359
+ */
324
360
  var addFn = /*#__PURE__*/function () {
325
- var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(record, code, name) {
361
+ var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(record, code, name) {
326
362
  return _regeneratorRuntime().wrap(function _callee3$(_context3) {
327
363
  while (1) switch (_context3.prev = _context3.next) {
328
364
  case 0:
@@ -345,8 +381,8 @@ export default /*#__PURE__*/React.forwardRef(function (props, ref) {
345
381
  }
346
382
  }, _callee3);
347
383
  }));
348
- return function addFn(_x12, _x13, _x14) {
349
- return _ref3.apply(this, arguments);
384
+ return function addFn(_x10, _x11, _x12) {
385
+ return _ref4.apply(this, arguments);
350
386
  };
351
387
  }();
352
388
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(StyleProvider, {
@@ -1,4 +1,5 @@
1
- export declare function startData(key: string, instanceName: string, id: string, defineid: number, tablename: string, memo: string, url: string, prefix: string, operationname: string, urlUpdateStatus: string, vis: any, firstPerson: any, stateList: any, actionId: string, businessKey: string, dataViewIid: string, dataSceneIid: string, serviceUrl: string, componentUrl: string): Promise<any>;
1
+ import { StartPayload } from './types';
2
+ export declare function startData(data: StartPayload): Promise<any>;
2
3
  export declare function updateProcessInstance(instanceName: string, memo: string, firstPerson: any, proId: string): Promise<any>;
3
4
  export declare function editCandateGroupsOrUsers(person: any, instanceid: string): Promise<any>;
4
5
  export declare function findByOptionCode(code: string): Promise<any>;
@@ -6,25 +6,20 @@ import { request } from "./..";
6
6
  /*
7
7
  * 启动流程部署记录
8
8
  */
9
- export function startData(_x, _x2, _x3, _x4, _x5, _x6, _x7, _x8, _x9, _x10, _x11, _x12, _x13, _x14, _x15, _x16, _x17, _x18, _x19) {
9
+ export function startData(_x) {
10
10
  return _startData.apply(this, arguments);
11
11
  }
12
12
  /*
13
13
  * 退回的流程重新发起
14
14
  */
15
15
  function _startData() {
16
- _startData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(key, instanceName, id, defineid, tablename, memo, url, prefix, operationname, urlUpdateStatus, vis, firstPerson, stateList, actionId, businessKey, dataViewIid, dataSceneIid, serviceUrl, componentUrl) {
16
+ _startData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(data) {
17
17
  return _regeneratorRuntime().wrap(function _callee$(_context) {
18
18
  while (1) switch (_context.prev = _context.next) {
19
19
  case 0:
20
- return _context.abrupt("return", request("/wfprocessinstance/startProcessByKey?instanceName=".concat(instanceName, "&defineid=").concat(defineid, "&tablename=").concat(tablename, "&businessKey=").concat(businessKey, "&processDefinitionKey=").concat(key, "&memo=").concat(memo, "&url=").concat(url, "&prefix=").concat(prefix, "&operation=").concat(operationname, "&urlUpdateStatus=").concat(urlUpdateStatus, "&actionId=").concat(actionId, "&dataViewIid=").concat(dataViewIid, "&dataSceneIid=").concat(dataSceneIid, "&serviceUrl=").concat(serviceUrl, "&componentUrl=").concat(componentUrl), {
20
+ return _context.abrupt("return", request("/wfprocessinstance/startProcessByKey", {
21
21
  method: 'post',
22
- data: {
23
- vis: vis,
24
- firstPerson: firstPerson,
25
- stateList: stateList,
26
- id: id
27
- },
22
+ data: data,
28
23
  prefix: '/workflow'
29
24
  }));
30
25
  case 1:
@@ -35,7 +30,7 @@ function _startData() {
35
30
  }));
36
31
  return _startData.apply(this, arguments);
37
32
  }
38
- export function updateProcessInstance(_x20, _x21, _x22, _x23) {
33
+ export function updateProcessInstance(_x2, _x3, _x4, _x5) {
39
34
  return _updateProcessInstance.apply(this, arguments);
40
35
  }
41
36
 
@@ -62,7 +57,7 @@ function _updateProcessInstance() {
62
57
  }));
63
58
  return _updateProcessInstance.apply(this, arguments);
64
59
  }
65
- export function editCandateGroupsOrUsers(_x24, _x25) {
60
+ export function editCandateGroupsOrUsers(_x6, _x7) {
66
61
  return _editCandateGroupsOrUsers.apply(this, arguments);
67
62
  }
68
63
  /*
@@ -85,7 +80,7 @@ function _editCandateGroupsOrUsers() {
85
80
  }));
86
81
  return _editCandateGroupsOrUsers.apply(this, arguments);
87
82
  }
88
- export function findByOptionCode(_x26) {
83
+ export function findByOptionCode(_x8) {
89
84
  return _findByOptionCode.apply(this, arguments);
90
85
  }
91
86
  //查询节点人员
@@ -106,7 +101,7 @@ function _findByOptionCode() {
106
101
  }));
107
102
  return _findByOptionCode.apply(this, arguments);
108
103
  }
109
- export function findByUserid(_x27, _x28) {
104
+ export function findByUserid(_x9, _x10) {
110
105
  return _findByUserid.apply(this, arguments);
111
106
  }
112
107
  //查询流程定义
@@ -128,7 +123,7 @@ function _findByUserid() {
128
123
  }));
129
124
  return _findByUserid.apply(this, arguments);
130
125
  }
131
- export function findBydefineId(_x29) {
126
+ export function findBydefineId(_x11) {
132
127
  return _findBydefineId.apply(this, arguments);
133
128
  }
134
129
  //查询表名
@@ -149,7 +144,7 @@ function _findBydefineId() {
149
144
  }));
150
145
  return _findBydefineId.apply(this, arguments);
151
146
  }
152
- export function findTableByFormid(_x30) {
147
+ export function findTableByFormid(_x12) {
153
148
  return _findTableByFormid.apply(this, arguments);
154
149
  }
155
150
 
@@ -173,7 +168,7 @@ function _findTableByFormid() {
173
168
  }));
174
169
  return _findTableByFormid.apply(this, arguments);
175
170
  }
176
- export function SubmitDataStatus(_x31, _x32, _x33, _x34) {
171
+ export function SubmitDataStatus(_x13, _x14, _x15, _x16) {
177
172
  return _SubmitDataStatus.apply(this, arguments);
178
173
  }
179
174
  function _SubmitDataStatus() {
@@ -0,0 +1,40 @@
1
+ export interface RoleItem {
2
+ roleCode: string;
3
+ roleName: string;
4
+ }
5
+ export interface UserItem {
6
+ userId: string;
7
+ userName: string;
8
+ }
9
+ export interface CandidateData {
10
+ selectType: 'free' | 'moren';
11
+ roles?: RoleItem[];
12
+ users?: UserItem[];
13
+ }
14
+ export interface WfConfig {
15
+ workflowCode: string;
16
+ formId?: number;
17
+ columnList?: string;
18
+ ownerAppCode?: string;
19
+ }
20
+ export interface StartPayload {
21
+ processDefinitionKey: string;
22
+ instanceName: string;
23
+ formId: number;
24
+ tableName: string;
25
+ dataId: string;
26
+ businessKey: string;
27
+ memo: string;
28
+ url: string;
29
+ prefix: string;
30
+ firstPerson: string[];
31
+ urlUpdateStatus: string;
32
+ stateList: string[];
33
+ actionId: string;
34
+ dataViewIid: string;
35
+ dataSceneIid: string;
36
+ serviceUrl: string;
37
+ componentUrl: string;
38
+ ownerAppCode: string;
39
+ vis: Record<string, unknown>;
40
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -5,7 +5,6 @@ export default class FilterPanel {
5
5
  private wrap;
6
6
  private curHeader?;
7
7
  private filterMap;
8
- private root;
9
8
  constructor(ctx: Context);
10
9
  show(h: CellHeader): Promise<void>;
11
10
  private applyFilter;
@@ -27,9 +27,7 @@ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key i
27
27
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
28
28
  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); }
29
29
  import React, { useState } from 'react';
30
- import ReactDOM from 'react-dom/client';
31
- // 你的类型
32
-
30
+ import ReactDOM from 'react-dom';
33
31
  import { computePosition, offset, flip, shift } from '@floating-ui/dom';
34
32
  import moment from 'moment';
35
33
  var FilterPanel = /*#__PURE__*/function () {
@@ -37,12 +35,10 @@ var FilterPanel = /*#__PURE__*/function () {
37
35
  var _this = this;
38
36
  _classCallCheck(this, FilterPanel);
39
37
  _defineProperty(this, "ctx", void 0);
40
- _defineProperty(this, "wrap", void 0);
38
+ _defineProperty(this, "wrap", document.createElement('div'));
41
39
  _defineProperty(this, "curHeader", void 0);
42
40
  _defineProperty(this, "filterMap", new Map());
43
- _defineProperty(this, "root", null);
44
41
  this.ctx = ctx;
45
- this.wrap = document.createElement('div'); // 仍用原生节点当浮层容器
46
42
  document.body.appendChild(this.wrap);
47
43
  this.ctx.on('filterClick', function (h) {
48
44
  return _this.show(h);
@@ -86,9 +82,9 @@ var FilterPanel = /*#__PURE__*/function () {
86
82
  start: '',
87
83
  end: ''
88
84
  } : ''
89
- }; // 用 React 渲染
90
- this.root = ReactDOM.createRoot(this.wrap);
91
- this.root.render( /*#__PURE__*/React.createElement(_ConfigProvider, null, /*#__PURE__*/React.createElement(AntFilterContent, {
85
+ };
86
+ /* React 16 用 ReactDOM.render */
87
+ ReactDOM.render( /*#__PURE__*/React.createElement(_ConfigProvider, null, /*#__PURE__*/React.createElement(AntFilterContent, {
92
88
  type: type,
93
89
  column: col,
94
90
  lastValue: last.val,
@@ -98,9 +94,9 @@ var FilterPanel = /*#__PURE__*/function () {
98
94
  onReset: function onReset() {
99
95
  return _this2.applyFilter(undefined);
100
96
  }
101
- })));
97
+ })), this.wrap);
102
98
 
103
- // 浮层定位仍用 floating-ui
99
+ /* 定位照旧 */
104
100
  this.wrap.style.position = 'absolute';
105
101
  this.wrap.style.zIndex = '2000';
106
102
  btn = h.filterBtnRect;
@@ -119,14 +115,14 @@ var FilterPanel = /*#__PURE__*/function () {
119
115
  };
120
116
  }
121
117
  };
122
- _context.next = 13;
118
+ _context.next = 12;
123
119
  return computePosition(virtualEl, this.wrap, {
124
120
  placement: 'bottom-end',
125
121
  middleware: [offset(4), flip(), shift({
126
122
  padding: 4
127
123
  })]
128
124
  });
129
- case 13:
125
+ case 12:
130
126
  _yield$computePositio = _context.sent;
131
127
  x = _yield$computePositio.x;
132
128
  y = _yield$computePositio.y;
@@ -134,7 +130,7 @@ var FilterPanel = /*#__PURE__*/function () {
134
130
  left: "".concat(x, "px"),
135
131
  top: "".concat(y, "px")
136
132
  });
137
- case 17:
133
+ case 16:
138
134
  case "end":
139
135
  return _context.stop();
140
136
  }
@@ -167,10 +163,8 @@ var FilterPanel = /*#__PURE__*/function () {
167
163
  }, {
168
164
  key: "hide",
169
165
  value: function hide() {
170
- if (this.root) {
171
- this.root.unmount();
172
- this.root = null;
173
- }
166
+ /* React 16 卸载方式 */
167
+ ReactDOM.unmountComponentAtNode(this.wrap);
174
168
  }
175
169
  }, {
176
170
  key: "destroy",
@@ -181,7 +175,7 @@ var FilterPanel = /*#__PURE__*/function () {
181
175
  }]);
182
176
  return FilterPanel;
183
177
  }();
184
- /* *************** 以下为 AntD 写的 UI 部分 *************** */
178
+ /* **************** UI 部分(无需改动) **************** */
185
179
  export { FilterPanel as default };
186
180
  function AntFilterContent(_ref) {
187
181
  var type = _ref.type,
@@ -201,8 +195,6 @@ function AntFilterContent(_ref) {
201
195
  _useState6 = _slicedToArray(_useState5, 2),
202
196
  checked = _useState6[0],
203
197
  setChecked = _useState6[1];
204
-
205
- // select 场景:把 options 提出来
206
198
  var options = React.useMemo(function () {
207
199
  var _column$editorProps;
208
200
  if (type !== 'select') return [];
@@ -217,10 +209,10 @@ function AntFilterContent(_ref) {
217
209
  style: {
218
210
  padding: 12,
219
211
  width: type === 'date' ? 280 : 200,
220
- backgroundColor: '#fff',
212
+ background: '#fff',
221
213
  borderRadius: 8,
222
214
  marginTop: 6,
223
- boxShadow: '0 2px 8px rgba(0, 0, 0, 0.15)'
215
+ boxShadow: '0 2px 8px rgba(0,0,0,0.15)'
224
216
  }
225
217
  }, type === 'text' && /*#__PURE__*/React.createElement(_Input, {
226
218
  placeholder: "\u5173\u952E\u5B57",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "venus-design",
3
- "version": "1.0.26",
3
+ "version": "1.0.28",
4
4
  "description": "venus all compoments",
5
5
  "module": "dist/index.js",
6
6
  "types": "dist/index.d.ts",