uepay-mesh 4.0.10 → 4.0.13

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,92 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+
8
+ require("core-js/modules/web.dom.iterable.js");
9
+
10
+ var _react = _interopRequireWildcard(require("react"));
11
+
12
+ var _antd = require("antd");
13
+
14
+ var _ExclamationCircleOutlined = _interopRequireDefault(require("@ant-design/icons/lib/icons/ExclamationCircleOutlined"));
15
+
16
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17
+
18
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
19
+
20
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
21
+
22
+ const {
23
+ warning
24
+ } = _antd.Modal;
25
+
26
+ function Empty() {}
27
+
28
+ ;
29
+ /**
30
+ *
31
+ * @param title
32
+ * @param content
33
+ * @param delayTip {string} 延遲提示的信息
34
+ * @param delaySecond {number} 默認延遲時間 秒
35
+ * @param onCancel
36
+ * @param onComplete
37
+ */
38
+
39
+ function delayTip(title, content) {
40
+ let delayTip = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '執行';
41
+ let delaySecond = arguments.length > 3 ? arguments[3] : undefined;
42
+ let onComplete = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : Empty;
43
+ let onCancel = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : Empty;
44
+
45
+ function handleDelayComplete() {
46
+ instance.destroy();
47
+ onComplete();
48
+ }
49
+
50
+ const instance = warning({
51
+ title: title,
52
+ icon: /*#__PURE__*/_react.default.createElement(_ExclamationCircleOutlined.default, null),
53
+ content: /*#__PURE__*/_react.default.createElement(_antd.Spin, null, /*#__PURE__*/_react.default.createElement(_antd.Alert, {
54
+ message: content,
55
+ type: "info"
56
+ })),
57
+ okText: /*#__PURE__*/_react.default.createElement(DelayBtn, {
58
+ delayTip: delayTip,
59
+ delaySecond: delaySecond,
60
+ onDelayComplete: handleDelayComplete
61
+ }),
62
+ okType: 'ghost',
63
+ onOk: onCancel
64
+ });
65
+ }
66
+
67
+ var _default = delayTip;
68
+ exports.default = _default;
69
+
70
+ function DelayBtn(_ref) {
71
+ let {
72
+ delayTip,
73
+ delaySecond,
74
+ onDelayComplete
75
+ } = _ref;
76
+ const [delay, setDelay] = (0, _react.useState)(delaySecond);
77
+ (0, _react.useEffect)(() => {
78
+ const idl = setInterval(() => {
79
+ setDelay(prev => {
80
+ const now = prev - 1;
81
+
82
+ if (0 === now) {
83
+ onDelayComplete();
84
+ clearInterval(idl);
85
+ }
86
+
87
+ return now;
88
+ });
89
+ }, 1000);
90
+ }, []);
91
+ return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, "\u53D6\u6D88(", delay, "\u79D2\u540E", delayTip, ")");
92
+ }
@@ -5,8 +5,6 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.OptValidateUtil = exports.OptTypeList = exports.OptTypeDict = exports.OptType = exports.OptCombineUtil = void 0;
7
7
 
8
- var _serverEnums = require("./serverEnums");
9
-
10
8
  /**
11
9
  * 表單、表格權限控制相關的數據和相關識別功能。
12
10
  * 所有的權限識別配置都使用2進制占位的方式實現=>1、10、100、1000、10000。位真則具備該權限。
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.PipeType = void 0;
7
+
8
+ /**
9
+ * 客戶端進行操作時分配的綫程類型
10
+ * @type {{MulitWorker: number, CoreNio: number, SingleWorker: number}}
11
+ */
12
+ const PipeType = {
13
+ /**
14
+ * 非柱塞類型,服務端會盡最大能力提供綫程支持此操作
15
+ */
16
+ CoreNio: {
17
+ value: 0,
18
+ label: '核心綫程',
19
+ tip: '非柱塞類型,服務端會盡最大能力提供綫程支持此操作'
20
+ },
21
+
22
+ /**
23
+ * 單一工作綫程。所有該類任務都會放置到一個異步隊列中,任務等待前序任務執行完畢后才會繼續執行
24
+ */
25
+ SingleWorker: {
26
+ value: 1,
27
+ label: '單一工作綫程',
28
+ tip: '單一工作綫程。所有該類任務都會放置到一個異步隊列中,任務等待前序任務執行完畢后才會繼續執行, 隊列超過一定長度會拒絕服務,前端重新等待'
29
+ },
30
+
31
+ /**
32
+ * 和SingleWorker的工作機制類似,只是更加
33
+ */
34
+ MulitWorker: {
35
+ value: 2,
36
+ label: '多個工作綫程',
37
+ tip: 'SingleWorker的工作機制類似,只是使用多個隊列在處理'
38
+ }
39
+ };
40
+ exports.PipeType = PipeType;
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.updateWithId = exports.updateWithClassDes = exports.listQueryWithId = exports.listQueryWithClassDes = exports.getCollectById = exports.formWithId = exports.formWithClassDes = exports.downloadWithId = exports.downloadWithClassDes = exports.deleteWithId = exports.deleteWithClassDes = exports.batchUpdateWithId = exports.batchUpdateWithClassDes = exports.batchAddWithId = exports.batchAddWithClassDes = exports.addWithId = exports.addWithClassDes = void 0;
6
+ exports.updateWithId = exports.updateWithClassDes = exports.listQueryWithId = exports.listQueryWithClassDes = exports.getCollectById = exports.formWithId = exports.formWithClassDes = exports.deleteWithId = exports.deleteWithClassDes = exports.batchUpdateWithId = exports.batchUpdateWithClassDes = exports.batchAddWithId = exports.batchAddWithClassDes = exports.addWithId = exports.addWithClassDes = void 0;
7
7
 
8
8
  require("core-js/modules/es6.regexp.search.js");
9
9
 
@@ -67,7 +67,8 @@ const listQueryWithId = _ref3 => {
67
67
  collectId,
68
68
  search = false,
69
69
  sorter = false,
70
- page = false
70
+ page = false,
71
+ pipe = 0
71
72
  } = _ref3;
72
73
  const params = {
73
74
  collectId
@@ -77,67 +78,7 @@ const listQueryWithId = _ref3 => {
77
78
  page && (params.page = page);
78
79
  const json = JSON.stringify(params),
79
80
  encode = encodeURIComponent(json);
80
- return (0, _net.get)("".concat(host, "/data/mesh/execute/query?params=").concat(encode));
81
- };
82
- /**
83
- *
84
- * @param host
85
- * @param collectId
86
- * @param search
87
- * @param sorter
88
- * @param page
89
- * @return {Promise<Response>}
90
- */
91
-
92
-
93
- exports.listQueryWithId = listQueryWithId;
94
-
95
- const downloadWithClassDes = _ref4 => {
96
- let {
97
- host,
98
- collect,
99
- search = false,
100
- sorter = false,
101
- page = false
102
- } = _ref4;
103
- const params = {
104
- collect
105
- };
106
- search && (params.search = search);
107
- sorter && (params.sorter = sorter);
108
- page && (params.page = page);
109
- return (0, _net.post)("".concat(host, "/data/mesh/execute/preview/excel/download"), params);
110
- };
111
- /**
112
- *
113
- * @param host
114
- * @param collectId
115
- * @param search
116
- * @param sorter
117
- * @param page
118
- * @return {Promise<Response>}
119
- */
120
-
121
-
122
- exports.downloadWithClassDes = downloadWithClassDes;
123
-
124
- const downloadWithId = _ref5 => {
125
- let {
126
- host,
127
- collectId,
128
- search = false,
129
- sorter = false,
130
- page = false
131
- } = _ref5;
132
- const params = {
133
- collectId
134
- };
135
- search && (params.search = search);
136
- sorter && (params.sorter = sorter);
137
- page && (params.page = page);
138
- const json = JSON.stringify(params),
139
- encode = encodeURIComponent(json);
140
- return (0, _net.get)("".concat(host, "/data/mesh/execute/excel/download?params=").concat(encode));
81
+ return (0, _net.get)("".concat(host, "/data/mesh/execute/query?params=").concat(encode, "&pipe=").concat(pipe));
141
82
  };
142
83
  /**
143
84
  * 獲取單條數據
@@ -148,14 +89,14 @@ const downloadWithId = _ref5 => {
148
89
  */
149
90
 
150
91
 
151
- exports.downloadWithId = downloadWithId;
92
+ exports.listQueryWithId = listQueryWithId;
152
93
 
153
- const formWithClassDes = _ref6 => {
94
+ const formWithClassDes = _ref4 => {
154
95
  let {
155
96
  host,
156
97
  collect,
157
98
  pkData
158
- } = _ref6;
99
+ } = _ref4;
159
100
  return (0, _net.post)("".concat(host, "/data/mesh/execute/preview/form"), {
160
101
  collect,
161
102
  pkData
@@ -172,12 +113,12 @@ const formWithClassDes = _ref6 => {
172
113
 
173
114
  exports.formWithClassDes = formWithClassDes;
174
115
 
175
- const formWithId = _ref7 => {
116
+ const formWithId = _ref5 => {
176
117
  let {
177
118
  host,
178
119
  collectId,
179
120
  pkData
180
- } = _ref7;
121
+ } = _ref5;
181
122
  return (0, _net.get)("".concat(host, "/data/mesh/execute/form?params=").concat(encodeURIComponent(JSON.stringify({
182
123
  collectId,
183
124
  pkData
@@ -197,7 +138,7 @@ const formWithId = _ref7 => {
197
138
 
198
139
  exports.formWithId = formWithId;
199
140
 
200
- const updateWithClassDes = _ref8 => {
141
+ const updateWithClassDes = _ref6 => {
201
142
  let {
202
143
  host,
203
144
  collect,
@@ -205,7 +146,7 @@ const updateWithClassDes = _ref8 => {
205
146
  pkValue,
206
147
  data,
207
148
  bpm = null
208
- } = _ref8;
149
+ } = _ref6;
209
150
  const dataList = [{
210
151
  data,
211
152
  pkData,
@@ -231,7 +172,7 @@ const updateWithClassDes = _ref8 => {
231
172
 
232
173
  exports.updateWithClassDes = updateWithClassDes;
233
174
 
234
- const updateWithId = _ref9 => {
175
+ const updateWithId = _ref7 => {
235
176
  let {
236
177
  host,
237
178
  collectId,
@@ -239,7 +180,7 @@ const updateWithId = _ref9 => {
239
180
  pkValue,
240
181
  data,
241
182
  bpm = null
242
- } = _ref9;
183
+ } = _ref7;
243
184
  const dataList = [{
244
185
  data,
245
186
  pkData,
@@ -273,13 +214,13 @@ const updateWithId = _ref9 => {
273
214
 
274
215
  exports.updateWithId = updateWithId;
275
216
 
276
- const batchUpdateWithClassDes = _ref10 => {
217
+ const batchUpdateWithClassDes = _ref8 => {
277
218
  let {
278
219
  host,
279
220
  collect,
280
221
  dataList,
281
222
  bpm
282
- } = _ref10;
223
+ } = _ref8;
283
224
  return (0, _net.post)("".concat(host, "/data/mesh/execute/preview/update"), {
284
225
  collect,
285
226
  dataList,
@@ -303,13 +244,13 @@ const batchUpdateWithClassDes = _ref10 => {
303
244
 
304
245
  exports.batchUpdateWithClassDes = batchUpdateWithClassDes;
305
246
 
306
- const batchUpdateWithId = _ref11 => {
247
+ const batchUpdateWithId = _ref9 => {
307
248
  let {
308
249
  host,
309
250
  collectId,
310
251
  dataList,
311
252
  bpm
312
- } = _ref11;
253
+ } = _ref9;
313
254
  return (0, _net.post)("".concat(host, "/data/mesh/execute/update"), {
314
255
  collectId,
315
256
  dataList,
@@ -329,13 +270,13 @@ const batchUpdateWithId = _ref11 => {
329
270
 
330
271
  exports.batchUpdateWithId = batchUpdateWithId;
331
272
 
332
- const addWithId = _ref12 => {
273
+ const addWithId = _ref10 => {
333
274
  let {
334
275
  host,
335
276
  collectId,
336
277
  data,
337
278
  bpm
338
- } = _ref12;
279
+ } = _ref10;
339
280
  const dataList = [{
340
281
  data
341
282
  }];
@@ -357,13 +298,13 @@ const addWithId = _ref12 => {
357
298
 
358
299
  exports.addWithId = addWithId;
359
300
 
360
- const addWithClassDes = _ref13 => {
301
+ const addWithClassDes = _ref11 => {
361
302
  let {
362
303
  host,
363
304
  collect,
364
305
  data,
365
306
  bpm
366
- } = _ref13;
307
+ } = _ref11;
367
308
  const dataList = [{
368
309
  data
369
310
  }];
@@ -385,13 +326,13 @@ const addWithClassDes = _ref13 => {
385
326
 
386
327
  exports.addWithClassDes = addWithClassDes;
387
328
 
388
- const batchAddWithId = _ref14 => {
329
+ const batchAddWithId = _ref12 => {
389
330
  let {
390
331
  host,
391
332
  collectId,
392
333
  dataList,
393
334
  bpm
394
- } = _ref14;
335
+ } = _ref12;
395
336
  return (0, _net.post)("".concat(host, "/data/mesh/execute/add"), {
396
337
  collectId,
397
338
  dataList,
@@ -410,13 +351,13 @@ const batchAddWithId = _ref14 => {
410
351
 
411
352
  exports.batchAddWithId = batchAddWithId;
412
353
 
413
- const batchAddWithClassDes = _ref15 => {
354
+ const batchAddWithClassDes = _ref13 => {
414
355
  let {
415
356
  host,
416
357
  collect,
417
358
  dataList,
418
359
  bpm
419
- } = _ref15;
360
+ } = _ref13;
420
361
  return (0, _net.post)("".concat(host, "/data/mesh/execute/preview/add"), {
421
362
  collect,
422
363
  dataList,
@@ -436,13 +377,13 @@ const batchAddWithClassDes = _ref15 => {
436
377
 
437
378
  exports.batchAddWithClassDes = batchAddWithClassDes;
438
379
 
439
- const deleteWithId = _ref16 => {
380
+ const deleteWithId = _ref14 => {
440
381
  let {
441
382
  host,
442
383
  collectId,
443
384
  bpm,
444
385
  dataList
445
- } = _ref16;
386
+ } = _ref14;
446
387
  return (0, _net.post)("".concat(host, "/data/mesh/execute/delete"), {
447
388
  collectId,
448
389
  dataList,
@@ -462,13 +403,13 @@ const deleteWithId = _ref16 => {
462
403
 
463
404
  exports.deleteWithId = deleteWithId;
464
405
 
465
- const deleteWithClassDes = _ref17 => {
406
+ const deleteWithClassDes = _ref15 => {
466
407
  let {
467
408
  host,
468
409
  collect,
469
410
  bpm,
470
411
  dataList
471
- } = _ref17;
412
+ } = _ref15;
472
413
  return (0, _net.post)("".concat(host, "/data/mesh/execute/preview/delete"), {
473
414
  collect,
474
415
  dataList,
@@ -0,0 +1,69 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.buildExtension = buildExtension;
7
+ exports.combineExtension = combineExtension;
8
+ exports.default = void 0;
9
+
10
+ require("core-js/modules/web.dom.iterable.js");
11
+
12
+ var _clientEnums = require("../../config/clientEnums");
13
+
14
+ /**
15
+ 數據集的擴展對象,此對象僅用於前端解析。他是一個不可變對象
16
+ * @param json {string|boolean} json字符串
17
+ * @constructor
18
+ */
19
+ function Extension(json) {
20
+ this.pipe = _clientEnums.PipeType.CoreNio.value;
21
+ const obj = json ? JSON.parse(json) : {};
22
+ obj.pipe && (this.pipe = obj.pipe);
23
+ }
24
+
25
+ Extension.prototype.toJson = function () {
26
+ return JSON.stringify(this);
27
+ };
28
+ /**
29
+ *
30
+ * @param other {Extension}
31
+ * @param combine {Object}
32
+ */
33
+
34
+
35
+ Extension.prototype.clone = function (other, combine) {
36
+ const keys = Object.keys(other);
37
+
38
+ for (let key of keys) {
39
+ const val = combine[key];
40
+ this[key] = val || other[key];
41
+ }
42
+ };
43
+
44
+ var _default = Extension;
45
+ /**
46
+ *
47
+ * @param json {string|boolean}
48
+ * @return {Extension}
49
+ */
50
+
51
+ exports.default = _default;
52
+
53
+ function buildExtension() {
54
+ let json = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
55
+ return new Extension(json);
56
+ }
57
+ /**
58
+ *
59
+ * @param origin
60
+ * @param combine
61
+ */
62
+
63
+
64
+ function combineExtension(origin) {
65
+ let combine = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
66
+ const target = new Extension(false);
67
+ target.clone(origin, combine);
68
+ return target;
69
+ }
@@ -29,6 +29,8 @@ var _LoadingOutlined = _interopRequireDefault(require("@ant-design/icons/lib/ico
29
29
 
30
30
  var _ExclamationCircleOutlined = _interopRequireDefault(require("@ant-design/icons/lib/icons/ExclamationCircleOutlined"));
31
31
 
32
+ var _delayTip = _interopRequireDefault(require("../../common/model/delayTip"));
33
+
32
34
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
33
35
 
34
36
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
@@ -105,33 +107,38 @@ class OptionsAbleExcel extends _react.default.Component {
105
107
  from: 0,
106
108
  to: 1
107
109
  }
108
- }).then(res => {
109
- if (res && res.total) {
110
- if (ConfirmTotal < res.total) {
111
- _this.showConfirm(res.total);
112
- } else {
113
- _this.download(res.total);
114
- }
115
- } else if (res && 0 === res.total) {
116
- _antd.notification.info({
117
- message: '無下載數據!請修改查詢條件!'
118
- });
119
-
120
- _this.unloading();
121
- } else if (res) {
122
- _antd.notification.error({
123
- message: res.msg || '網絡故障!請稍後再試!'
124
- });
110
+ }).then(this.handleResult);
111
+ });
125
112
 
126
- _this.unloading();
113
+ _defineProperty(this, "handleResult", res => {
114
+ if (res && res.total) {
115
+ if (ConfirmTotal < res.total) {
116
+ this.showConfirm(res.total);
127
117
  } else {
128
- _antd.notification.error({
129
- message: '網絡故障!請稍後再試!'
130
- });
131
-
132
- _this.unloading();
118
+ this.download(res.total);
133
119
  }
134
- });
120
+ } else if (res && 0 === res.total) {
121
+ _antd.notification.info({
122
+ message: '無下載數據!請修改查詢條件!'
123
+ });
124
+
125
+ this.unloading();
126
+ } else if (res && -100 === res.code) {
127
+ (0, _delayTip.default)("查詢隊列已滿", res.msg, '重新下載', 20, this.handleDownload);
128
+ this.unloading();
129
+ } else if (res) {
130
+ _antd.notification.error({
131
+ message: res.msg || '網絡故障!請稍後再試!'
132
+ });
133
+
134
+ this.unloading();
135
+ } else {
136
+ _antd.notification.error({
137
+ message: '網絡故障!請稍後再試!'
138
+ });
139
+
140
+ this.unloading();
141
+ }
135
142
  });
136
143
 
137
144
  _defineProperty(this, "downloadProcess", (type, present, from, to) => {
@@ -324,19 +331,23 @@ class OptionsAbleExcel extends _react.default.Component {
324
331
  sorter,
325
332
  total,
326
333
  cb: (type, rows, colsOptions, rowsOptions) => {
327
- const sheet = _xlsx.default.utils.aoa_to_sheet(rows);
328
-
329
- sheet['!rows'] = rowsOptions;
330
- sheet['!cols'] = colsOptions;
331
- this.setState({
332
- info: {
333
- text: '下載進度100%',
334
- icon: /*#__PURE__*/_react.default.createElement(_CheckCircleOutlined.default, null),
335
- type: 'suc'
336
- },
337
- loading: false
338
- });
339
- writeFile(collect.display, sheet, ModifyName);
334
+ if ('complete' === type) {
335
+ const sheet = _xlsx.default.utils.aoa_to_sheet(rows);
336
+
337
+ sheet['!rows'] = rowsOptions;
338
+ sheet['!cols'] = colsOptions;
339
+ this.setState({
340
+ info: {
341
+ text: '下載進度100%',
342
+ icon: /*#__PURE__*/_react.default.createElement(_CheckCircleOutlined.default, null),
343
+ type: 'suc'
344
+ },
345
+ loading: false
346
+ });
347
+ writeFile(collect.display, sheet, ModifyName);
348
+ } else {
349
+ this.unloading();
350
+ }
340
351
  },
341
352
  processCb: this.downloadProcess
342
353
  });