@zhubangyun/lowcode-core 5.12.92 → 5.12.161
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/es/components/load-materials/index.js +12 -12
- package/es/demo/index.js +8 -8
- package/es/utils/api/file-api.js +21 -21
- package/es/utils/api/form-api.d.ts +1 -1
- package/es/utils/api/form-api.js +35 -35
- package/es/utils/api/form-api.utils.js +5 -4
- package/es/utils/api/index.d.ts +1 -1
- package/es/utils/api/rest-api.js +116 -116
- package/es/utils/api/schema-api.js +5 -5
- package/es/utils/api/script-api.js +12 -12
- package/es/utils/api/user-info.js +7 -7
- package/es/utils/cache/index.js +14 -14
- package/es/utils/common/LoadPlugins.js +33 -33
- package/es/utils/common/SingletonInstanceMap.js +21 -21
- package/es/utils/designer/assets/assets.parse.js +15 -15
- package/es/utils/designer/assets/assets.typing.js +6 -0
- package/es/utils/designer/engine/index.js +23 -23
- package/es/utils/designer/index.js +7 -7
- package/es/utils/page/index.js +18 -18
- package/es/utils/page/page-form-data-manager-group.js +7 -4
- package/es/utils/page/page-form-data-manager.js +7 -4
- package/es/utils/page/page-form-group.js +6 -5
- package/es/utils/page/page-form.js +12 -11
- package/es/utils/page/page-layout.d.ts +2 -0
- package/es/utils/page/page-layout.js +14 -7
- package/es/utils/page/page-render.js +4 -4
- package/es/utils/page/page-show.js +3 -3
- package/es/utils/page/print-form.js +36 -36
- package/lib/components/load-materials/index.js +13 -14
- package/lib/demo/index.js +9 -10
- package/lib/index.js +1 -2
- package/lib/utils/api/file-api.js +21 -21
- package/lib/utils/api/form-api.d.ts +1 -1
- package/lib/utils/api/form-api.js +35 -35
- package/lib/utils/api/form-api.utils.js +5 -4
- package/lib/utils/api/index.d.ts +1 -1
- package/lib/utils/api/index.js +1 -2
- package/lib/utils/api/rest-api.js +116 -116
- package/lib/utils/api/schema-api.js +5 -5
- package/lib/utils/api/script-api.js +12 -12
- package/lib/utils/api/user-info.js +7 -7
- package/lib/utils/cache/index.js +14 -14
- package/lib/utils/common/LoadPlugins.js +33 -33
- package/lib/utils/common/SingletonInstanceMap.js +21 -21
- package/lib/utils/designer/assets/assets.parse.js +16 -17
- package/lib/utils/designer/assets/assets.typing.js +6 -0
- package/lib/utils/designer/engine/index.js +23 -23
- package/lib/utils/designer/index.js +7 -7
- package/lib/utils/index.js +1 -2
- package/lib/utils/page/index.js +18 -18
- package/lib/utils/page/page-form-data-manager-group.js +8 -6
- package/lib/utils/page/page-form-data-manager.js +8 -6
- package/lib/utils/page/page-form-group.js +7 -7
- package/lib/utils/page/page-form.js +13 -13
- package/lib/utils/page/page-layout.d.ts +2 -0
- package/lib/utils/page/page-layout.js +15 -9
- package/lib/utils/page/page-render.js +4 -4
- package/lib/utils/page/page-show.js +4 -5
- package/lib/utils/page/print-form.js +36 -36
- package/package.json +1 -1
|
@@ -33,25 +33,25 @@ var BaseRestApi = exports.BaseRestApi = /*#__PURE__*/function () {
|
|
|
33
33
|
}
|
|
34
34
|
var _proto = BaseRestApi.prototype;
|
|
35
35
|
_proto.search = /*#__PURE__*/function () {
|
|
36
|
-
var _search = (0, _asyncToGenerator2["default"])(
|
|
36
|
+
var _search = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee(params) {
|
|
37
37
|
var _this$handleRequestCo;
|
|
38
38
|
var config;
|
|
39
|
-
return _regenerator["default"].wrap(function
|
|
39
|
+
return _regenerator["default"].wrap(function (_context) {
|
|
40
40
|
while (1) switch (_context.prev = _context.next) {
|
|
41
41
|
case 0:
|
|
42
42
|
config = {
|
|
43
43
|
params: params
|
|
44
44
|
};
|
|
45
|
-
_context.next =
|
|
45
|
+
_context.next = 1;
|
|
46
46
|
return (_this$handleRequestCo = this.handleRequestConfig) === null || _this$handleRequestCo === void 0 ? void 0 : _this$handleRequestCo.call(this, config);
|
|
47
|
-
case
|
|
48
|
-
_context.next =
|
|
47
|
+
case 1:
|
|
48
|
+
_context.next = 2;
|
|
49
49
|
return this.request.get("", {
|
|
50
50
|
params: params
|
|
51
51
|
});
|
|
52
|
-
case
|
|
52
|
+
case 2:
|
|
53
53
|
return _context.abrupt("return", _context.sent);
|
|
54
|
-
case
|
|
54
|
+
case 3:
|
|
55
55
|
case "end":
|
|
56
56
|
return _context.stop();
|
|
57
57
|
}
|
|
@@ -71,36 +71,36 @@ var BaseRestApi = exports.BaseRestApi = /*#__PURE__*/function () {
|
|
|
71
71
|
_proto.getById =
|
|
72
72
|
/*#__PURE__*/
|
|
73
73
|
function () {
|
|
74
|
-
var _getById = (0, _asyncToGenerator2["default"])(
|
|
74
|
+
var _getById = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee2(id, options) {
|
|
75
75
|
var _this$handleRequestCo2;
|
|
76
76
|
var config, res, _options$onError, _options$onSuccess;
|
|
77
|
-
return _regenerator["default"].wrap(function
|
|
77
|
+
return _regenerator["default"].wrap(function (_context2) {
|
|
78
78
|
while (1) switch (_context2.prev = _context2.next) {
|
|
79
79
|
case 0:
|
|
80
80
|
config = {};
|
|
81
|
-
_context2.next =
|
|
81
|
+
_context2.next = 1;
|
|
82
82
|
return (_this$handleRequestCo2 = this.handleRequestConfig) === null || _this$handleRequestCo2 === void 0 ? void 0 : _this$handleRequestCo2.call(this, config);
|
|
83
|
-
case
|
|
84
|
-
_context2.next =
|
|
83
|
+
case 1:
|
|
84
|
+
_context2.next = 2;
|
|
85
85
|
return this.request.get(String(id), config);
|
|
86
|
-
case
|
|
86
|
+
case 2:
|
|
87
87
|
res = _context2.sent;
|
|
88
88
|
if (res.success) {
|
|
89
|
-
_context2.next =
|
|
89
|
+
_context2.next = 4;
|
|
90
90
|
break;
|
|
91
91
|
}
|
|
92
92
|
this.showError("\u83B7\u53D6{" + id + "}\u5931\u8D25!", res).then();
|
|
93
|
-
_context2.next =
|
|
93
|
+
_context2.next = 3;
|
|
94
94
|
return options === null || options === void 0 ? void 0 : (_options$onError = options.onError) === null || _options$onError === void 0 ? void 0 : _options$onError.call(options, res);
|
|
95
|
-
case
|
|
96
|
-
_context2.next =
|
|
95
|
+
case 3:
|
|
96
|
+
_context2.next = 5;
|
|
97
97
|
break;
|
|
98
|
-
case
|
|
99
|
-
_context2.next =
|
|
98
|
+
case 4:
|
|
99
|
+
_context2.next = 5;
|
|
100
100
|
return options === null || options === void 0 ? void 0 : (_options$onSuccess = options.onSuccess) === null || _options$onSuccess === void 0 ? void 0 : _options$onSuccess.call(options, res);
|
|
101
|
-
case
|
|
101
|
+
case 5:
|
|
102
102
|
return _context2.abrupt("return", res);
|
|
103
|
-
case
|
|
103
|
+
case 6:
|
|
104
104
|
case "end":
|
|
105
105
|
return _context2.stop();
|
|
106
106
|
}
|
|
@@ -112,36 +112,36 @@ var BaseRestApi = exports.BaseRestApi = /*#__PURE__*/function () {
|
|
|
112
112
|
return getById;
|
|
113
113
|
}();
|
|
114
114
|
_proto.save = /*#__PURE__*/function () {
|
|
115
|
-
var _save = (0, _asyncToGenerator2["default"])(
|
|
115
|
+
var _save = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee3(data, options) {
|
|
116
116
|
var _this$handleRequestCo3;
|
|
117
117
|
var config, res, _options$onError2, _options$onSuccess2;
|
|
118
|
-
return _regenerator["default"].wrap(function
|
|
118
|
+
return _regenerator["default"].wrap(function (_context3) {
|
|
119
119
|
while (1) switch (_context3.prev = _context3.next) {
|
|
120
120
|
case 0:
|
|
121
121
|
config = {};
|
|
122
|
-
_context3.next =
|
|
122
|
+
_context3.next = 1;
|
|
123
123
|
return (_this$handleRequestCo3 = this.handleRequestConfig) === null || _this$handleRequestCo3 === void 0 ? void 0 : _this$handleRequestCo3.call(this, config);
|
|
124
|
-
case
|
|
125
|
-
_context3.next =
|
|
124
|
+
case 1:
|
|
125
|
+
_context3.next = 2;
|
|
126
126
|
return this.request.post("save", data, config);
|
|
127
|
-
case
|
|
127
|
+
case 2:
|
|
128
128
|
res = _context3.sent;
|
|
129
129
|
if (res.success) {
|
|
130
|
-
_context3.next =
|
|
130
|
+
_context3.next = 4;
|
|
131
131
|
break;
|
|
132
132
|
}
|
|
133
133
|
this.showError("\u63D0\u4EA4\u5931\u8D25!", res).then();
|
|
134
|
-
_context3.next =
|
|
134
|
+
_context3.next = 3;
|
|
135
135
|
return options === null || options === void 0 ? void 0 : (_options$onError2 = options.onError) === null || _options$onError2 === void 0 ? void 0 : _options$onError2.call(options, res);
|
|
136
|
-
case
|
|
137
|
-
_context3.next =
|
|
136
|
+
case 3:
|
|
137
|
+
_context3.next = 5;
|
|
138
138
|
break;
|
|
139
|
-
case
|
|
140
|
-
_context3.next =
|
|
139
|
+
case 4:
|
|
140
|
+
_context3.next = 5;
|
|
141
141
|
return options === null || options === void 0 ? void 0 : (_options$onSuccess2 = options.onSuccess) === null || _options$onSuccess2 === void 0 ? void 0 : _options$onSuccess2.call(options, res);
|
|
142
|
-
case
|
|
142
|
+
case 5:
|
|
143
143
|
return _context3.abrupt("return", res);
|
|
144
|
-
case
|
|
144
|
+
case 6:
|
|
145
145
|
case "end":
|
|
146
146
|
return _context3.stop();
|
|
147
147
|
}
|
|
@@ -159,36 +159,36 @@ var BaseRestApi = exports.BaseRestApi = /*#__PURE__*/function () {
|
|
|
159
159
|
_proto.create =
|
|
160
160
|
/*#__PURE__*/
|
|
161
161
|
function () {
|
|
162
|
-
var _create = (0, _asyncToGenerator2["default"])(
|
|
162
|
+
var _create = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee4(data, options) {
|
|
163
163
|
var _this$handleRequestCo4;
|
|
164
164
|
var config, res, _options$onError3, _options$onSuccess3;
|
|
165
|
-
return _regenerator["default"].wrap(function
|
|
165
|
+
return _regenerator["default"].wrap(function (_context4) {
|
|
166
166
|
while (1) switch (_context4.prev = _context4.next) {
|
|
167
167
|
case 0:
|
|
168
168
|
config = {};
|
|
169
|
-
_context4.next =
|
|
169
|
+
_context4.next = 1;
|
|
170
170
|
return (_this$handleRequestCo4 = this.handleRequestConfig) === null || _this$handleRequestCo4 === void 0 ? void 0 : _this$handleRequestCo4.call(this, config);
|
|
171
|
-
case
|
|
172
|
-
_context4.next =
|
|
171
|
+
case 1:
|
|
172
|
+
_context4.next = 2;
|
|
173
173
|
return this.request.post("", data, config);
|
|
174
|
-
case
|
|
174
|
+
case 2:
|
|
175
175
|
res = _context4.sent;
|
|
176
176
|
if (res.success) {
|
|
177
|
-
_context4.next =
|
|
177
|
+
_context4.next = 4;
|
|
178
178
|
break;
|
|
179
179
|
}
|
|
180
180
|
this.showError("\u65B0\u589E\u5931\u8D25!", res).then();
|
|
181
|
-
_context4.next =
|
|
181
|
+
_context4.next = 3;
|
|
182
182
|
return options === null || options === void 0 ? void 0 : (_options$onError3 = options.onError) === null || _options$onError3 === void 0 ? void 0 : _options$onError3.call(options, res);
|
|
183
|
-
case
|
|
184
|
-
_context4.next =
|
|
183
|
+
case 3:
|
|
184
|
+
_context4.next = 5;
|
|
185
185
|
break;
|
|
186
|
-
case
|
|
187
|
-
_context4.next =
|
|
186
|
+
case 4:
|
|
187
|
+
_context4.next = 5;
|
|
188
188
|
return options === null || options === void 0 ? void 0 : (_options$onSuccess3 = options.onSuccess) === null || _options$onSuccess3 === void 0 ? void 0 : _options$onSuccess3.call(options, res);
|
|
189
|
-
case
|
|
189
|
+
case 5:
|
|
190
190
|
return _context4.abrupt("return", res);
|
|
191
|
-
case
|
|
191
|
+
case 6:
|
|
192
192
|
case "end":
|
|
193
193
|
return _context4.stop();
|
|
194
194
|
}
|
|
@@ -206,42 +206,42 @@ var BaseRestApi = exports.BaseRestApi = /*#__PURE__*/function () {
|
|
|
206
206
|
_proto.update =
|
|
207
207
|
/*#__PURE__*/
|
|
208
208
|
function () {
|
|
209
|
-
var _update = (0, _asyncToGenerator2["default"])(
|
|
209
|
+
var _update = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee5(id, data, options) {
|
|
210
210
|
var _this$handleRequestCo5;
|
|
211
211
|
var config, res, _options$onError4, _options$onSuccess4;
|
|
212
|
-
return _regenerator["default"].wrap(function
|
|
212
|
+
return _regenerator["default"].wrap(function (_context5) {
|
|
213
213
|
while (1) switch (_context5.prev = _context5.next) {
|
|
214
214
|
case 0:
|
|
215
215
|
config = {};
|
|
216
|
-
_context5.next =
|
|
216
|
+
_context5.next = 1;
|
|
217
217
|
return (_this$handleRequestCo5 = this.handleRequestConfig) === null || _this$handleRequestCo5 === void 0 ? void 0 : _this$handleRequestCo5.call(this, config);
|
|
218
|
-
case
|
|
219
|
-
_context5.next =
|
|
218
|
+
case 1:
|
|
219
|
+
_context5.next = 2;
|
|
220
220
|
return this.request.put(String(id), data, config);
|
|
221
|
-
case
|
|
221
|
+
case 2:
|
|
222
222
|
res = _context5.sent;
|
|
223
223
|
if (res.success) {
|
|
224
|
-
_context5.next =
|
|
224
|
+
_context5.next = 4;
|
|
225
225
|
break;
|
|
226
226
|
}
|
|
227
227
|
this.showError("\u66F4\u65B0\u5931\u8D25!", res).then();
|
|
228
|
-
_context5.next =
|
|
228
|
+
_context5.next = 3;
|
|
229
229
|
return options === null || options === void 0 ? void 0 : (_options$onError4 = options.onError) === null || _options$onError4 === void 0 ? void 0 : _options$onError4.call(options, res);
|
|
230
|
-
case
|
|
231
|
-
_context5.next =
|
|
230
|
+
case 3:
|
|
231
|
+
_context5.next = 5;
|
|
232
232
|
break;
|
|
233
|
-
case
|
|
234
|
-
_context5.next =
|
|
233
|
+
case 4:
|
|
234
|
+
_context5.next = 5;
|
|
235
235
|
return options === null || options === void 0 ? void 0 : (_options$onSuccess4 = options.onSuccess) === null || _options$onSuccess4 === void 0 ? void 0 : _options$onSuccess4.call(options, res);
|
|
236
|
-
case
|
|
236
|
+
case 5:
|
|
237
237
|
return _context5.abrupt("return", res);
|
|
238
|
-
case
|
|
238
|
+
case 6:
|
|
239
239
|
case "end":
|
|
240
240
|
return _context5.stop();
|
|
241
241
|
}
|
|
242
242
|
}, _callee5, this);
|
|
243
243
|
}));
|
|
244
|
-
function update(_x8, _x9,
|
|
244
|
+
function update(_x8, _x9, _x0) {
|
|
245
245
|
return _update.apply(this, arguments);
|
|
246
246
|
}
|
|
247
247
|
return update;
|
|
@@ -253,57 +253,57 @@ var BaseRestApi = exports.BaseRestApi = /*#__PURE__*/function () {
|
|
|
253
253
|
_proto.deleteById =
|
|
254
254
|
/*#__PURE__*/
|
|
255
255
|
function () {
|
|
256
|
-
var _deleteById = (0, _asyncToGenerator2["default"])(
|
|
256
|
+
var _deleteById = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee6(id, options) {
|
|
257
257
|
var _this$handleRequestCo6;
|
|
258
258
|
var config, res, _options$onError5, _options$onSuccess5;
|
|
259
|
-
return _regenerator["default"].wrap(function
|
|
259
|
+
return _regenerator["default"].wrap(function (_context6) {
|
|
260
260
|
while (1) switch (_context6.prev = _context6.next) {
|
|
261
261
|
case 0:
|
|
262
262
|
config = {};
|
|
263
|
-
_context6.next =
|
|
263
|
+
_context6.next = 1;
|
|
264
264
|
return (_this$handleRequestCo6 = this.handleRequestConfig) === null || _this$handleRequestCo6 === void 0 ? void 0 : _this$handleRequestCo6.call(this, config);
|
|
265
|
-
case
|
|
266
|
-
_context6.next =
|
|
265
|
+
case 1:
|
|
266
|
+
_context6.next = 2;
|
|
267
267
|
return this.request["delete"](String(id), config);
|
|
268
|
-
case
|
|
268
|
+
case 2:
|
|
269
269
|
res = _context6.sent;
|
|
270
270
|
if (res.success) {
|
|
271
|
-
_context6.next =
|
|
271
|
+
_context6.next = 4;
|
|
272
272
|
break;
|
|
273
273
|
}
|
|
274
274
|
this.showError("\u5220\u9664{" + id + "}\u5931\u8D25!", res).then();
|
|
275
|
-
_context6.next =
|
|
275
|
+
_context6.next = 3;
|
|
276
276
|
return options === null || options === void 0 ? void 0 : (_options$onError5 = options.onError) === null || _options$onError5 === void 0 ? void 0 : _options$onError5.call(options, res);
|
|
277
|
-
case
|
|
278
|
-
_context6.next =
|
|
277
|
+
case 3:
|
|
278
|
+
_context6.next = 5;
|
|
279
279
|
break;
|
|
280
|
-
case
|
|
281
|
-
_context6.next =
|
|
280
|
+
case 4:
|
|
281
|
+
_context6.next = 5;
|
|
282
282
|
return options === null || options === void 0 ? void 0 : (_options$onSuccess5 = options.onSuccess) === null || _options$onSuccess5 === void 0 ? void 0 : _options$onSuccess5.call(options, res);
|
|
283
|
-
case
|
|
283
|
+
case 5:
|
|
284
284
|
return _context6.abrupt("return", res);
|
|
285
|
-
case
|
|
285
|
+
case 6:
|
|
286
286
|
case "end":
|
|
287
287
|
return _context6.stop();
|
|
288
288
|
}
|
|
289
289
|
}, _callee6, this);
|
|
290
290
|
}));
|
|
291
|
-
function deleteById(
|
|
291
|
+
function deleteById(_x1, _x10) {
|
|
292
292
|
return _deleteById.apply(this, arguments);
|
|
293
293
|
}
|
|
294
294
|
return deleteById;
|
|
295
295
|
}();
|
|
296
296
|
_proto["delete"] = /*#__PURE__*/function () {
|
|
297
|
-
var _delete2 = (0, _asyncToGenerator2["default"])(
|
|
297
|
+
var _delete2 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee7(data, options) {
|
|
298
298
|
var _this$handleRequestCo7;
|
|
299
299
|
var config, arrayData, idValue, res, _options$onError6, _options$onSuccess6;
|
|
300
|
-
return _regenerator["default"].wrap(function
|
|
300
|
+
return _regenerator["default"].wrap(function (_context7) {
|
|
301
301
|
while (1) switch (_context7.prev = _context7.next) {
|
|
302
302
|
case 0:
|
|
303
303
|
config = {};
|
|
304
|
-
_context7.next =
|
|
304
|
+
_context7.next = 1;
|
|
305
305
|
return (_this$handleRequestCo7 = this.handleRequestConfig) === null || _this$handleRequestCo7 === void 0 ? void 0 : _this$handleRequestCo7.call(this, config);
|
|
306
|
-
case
|
|
306
|
+
case 1:
|
|
307
307
|
arrayData = [];
|
|
308
308
|
idValue = (0, _data.transformerId)(data);
|
|
309
309
|
if (!Array.isArray(idValue)) {
|
|
@@ -315,51 +315,51 @@ var BaseRestApi = exports.BaseRestApi = /*#__PURE__*/function () {
|
|
|
315
315
|
return !!item;
|
|
316
316
|
});
|
|
317
317
|
if (!(arrayData.length == 0)) {
|
|
318
|
-
_context7.next =
|
|
318
|
+
_context7.next = 2;
|
|
319
319
|
break;
|
|
320
320
|
}
|
|
321
321
|
throw new Error("删除对象不可为空!");
|
|
322
|
-
case
|
|
323
|
-
_context7.next =
|
|
322
|
+
case 2:
|
|
323
|
+
_context7.next = 3;
|
|
324
324
|
return this.request.post("remove", arrayData, config);
|
|
325
|
-
case
|
|
325
|
+
case 3:
|
|
326
326
|
res = _context7.sent;
|
|
327
327
|
if (res.success) {
|
|
328
|
-
_context7.next =
|
|
328
|
+
_context7.next = 5;
|
|
329
329
|
break;
|
|
330
330
|
}
|
|
331
331
|
this.showError("\u5220\u9664\u5931\u8D25!", res).then();
|
|
332
|
-
_context7.next =
|
|
332
|
+
_context7.next = 4;
|
|
333
333
|
return options === null || options === void 0 ? void 0 : (_options$onError6 = options.onError) === null || _options$onError6 === void 0 ? void 0 : _options$onError6.call(options, res);
|
|
334
|
-
case
|
|
335
|
-
_context7.next =
|
|
334
|
+
case 4:
|
|
335
|
+
_context7.next = 6;
|
|
336
336
|
break;
|
|
337
|
-
case
|
|
338
|
-
_context7.next =
|
|
337
|
+
case 5:
|
|
338
|
+
_context7.next = 6;
|
|
339
339
|
return options === null || options === void 0 ? void 0 : (_options$onSuccess6 = options.onSuccess) === null || _options$onSuccess6 === void 0 ? void 0 : _options$onSuccess6.call(options, res);
|
|
340
|
-
case
|
|
340
|
+
case 6:
|
|
341
341
|
return _context7.abrupt("return", res);
|
|
342
|
-
case
|
|
342
|
+
case 7:
|
|
343
343
|
case "end":
|
|
344
344
|
return _context7.stop();
|
|
345
345
|
}
|
|
346
346
|
}, _callee7, this);
|
|
347
347
|
}));
|
|
348
|
-
function _delete(
|
|
348
|
+
function _delete(_x11, _x12) {
|
|
349
349
|
return _delete2.apply(this, arguments);
|
|
350
350
|
}
|
|
351
351
|
return _delete;
|
|
352
352
|
}();
|
|
353
353
|
_proto.showError = /*#__PURE__*/function () {
|
|
354
|
-
var _showError = (0, _asyncToGenerator2["default"])(
|
|
355
|
-
var msg, props;
|
|
356
|
-
return _regenerator["default"].wrap(function
|
|
354
|
+
var _showError = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee8(type, res) {
|
|
355
|
+
var msg, props, _t;
|
|
356
|
+
return _regenerator["default"].wrap(function (_context8) {
|
|
357
357
|
while (1) switch (_context8.prev = _context8.next) {
|
|
358
358
|
case 0:
|
|
359
359
|
msg = res.message;
|
|
360
360
|
_context8.prev = 1;
|
|
361
361
|
if (!msg) {
|
|
362
|
-
_context8.next =
|
|
362
|
+
_context8.next = 4;
|
|
363
363
|
break;
|
|
364
364
|
}
|
|
365
365
|
props = JSON.parse(msg);
|
|
@@ -368,31 +368,31 @@ var BaseRestApi = exports.BaseRestApi = /*#__PURE__*/function () {
|
|
|
368
368
|
props.title = "" + this.title + type;
|
|
369
369
|
}
|
|
370
370
|
if (!(props.type == "message")) {
|
|
371
|
-
_context8.next =
|
|
371
|
+
_context8.next = 2;
|
|
372
372
|
break;
|
|
373
373
|
}
|
|
374
374
|
_message2["default"].error(props);
|
|
375
375
|
return _context8.abrupt("return");
|
|
376
|
-
case
|
|
376
|
+
case 2:
|
|
377
377
|
if (!(props.type == "modal")) {
|
|
378
|
-
_context8.next =
|
|
378
|
+
_context8.next = 3;
|
|
379
379
|
break;
|
|
380
380
|
}
|
|
381
381
|
_modal["default"].error(props);
|
|
382
382
|
return _context8.abrupt("return");
|
|
383
|
-
case
|
|
383
|
+
case 3:
|
|
384
384
|
if (!(props.type == "notification")) {
|
|
385
|
-
_context8.next =
|
|
385
|
+
_context8.next = 4;
|
|
386
386
|
break;
|
|
387
387
|
}
|
|
388
388
|
_notification2["default"].error(props);
|
|
389
389
|
return _context8.abrupt("return");
|
|
390
|
-
case
|
|
391
|
-
_context8.next =
|
|
390
|
+
case 4:
|
|
391
|
+
_context8.next = 6;
|
|
392
392
|
break;
|
|
393
|
-
case
|
|
394
|
-
_context8.prev =
|
|
395
|
-
|
|
393
|
+
case 5:
|
|
394
|
+
_context8.prev = 5;
|
|
395
|
+
_t = _context8["catch"](1);
|
|
396
396
|
console.error("" + this.title + type + (msg || ""));
|
|
397
397
|
_modal["default"].error({
|
|
398
398
|
title: "" + this.title + type,
|
|
@@ -402,13 +402,13 @@ var BaseRestApi = exports.BaseRestApi = /*#__PURE__*/function () {
|
|
|
402
402
|
message: res.message
|
|
403
403
|
})
|
|
404
404
|
});
|
|
405
|
-
case
|
|
405
|
+
case 6:
|
|
406
406
|
case "end":
|
|
407
407
|
return _context8.stop();
|
|
408
408
|
}
|
|
409
|
-
}, _callee8, this, [[1,
|
|
409
|
+
}, _callee8, this, [[1, 5]]);
|
|
410
410
|
}));
|
|
411
|
-
function showError(
|
|
411
|
+
function showError(_x13, _x14) {
|
|
412
412
|
return _showError.apply(this, arguments);
|
|
413
413
|
}
|
|
414
414
|
return showError;
|
|
@@ -430,8 +430,8 @@ var RestApi = exports.RestApi = /*#__PURE__*/function (_BaseRestApi2) {
|
|
|
430
430
|
(0, _inheritsLoose2["default"])(RestApi, _BaseRestApi2);
|
|
431
431
|
var _proto2 = RestApi.prototype;
|
|
432
432
|
_proto2.handleRequestConfig = /*#__PURE__*/function () {
|
|
433
|
-
var _handleRequestConfig = (0, _asyncToGenerator2["default"])(
|
|
434
|
-
return _regenerator["default"].wrap(function
|
|
433
|
+
var _handleRequestConfig = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee9(config) {
|
|
434
|
+
return _regenerator["default"].wrap(function (_context9) {
|
|
435
435
|
while (1) switch (_context9.prev = _context9.next) {
|
|
436
436
|
case 0:
|
|
437
437
|
case "end":
|
|
@@ -439,7 +439,7 @@ var RestApi = exports.RestApi = /*#__PURE__*/function (_BaseRestApi2) {
|
|
|
439
439
|
}
|
|
440
440
|
}, _callee9);
|
|
441
441
|
}));
|
|
442
|
-
function handleRequestConfig(
|
|
442
|
+
function handleRequestConfig(_x15) {
|
|
443
443
|
return _handleRequestConfig.apply(this, arguments);
|
|
444
444
|
}
|
|
445
445
|
return handleRequestConfig;
|
|
@@ -11,21 +11,21 @@ function getSchema(_x, _x2) {
|
|
|
11
11
|
return _getSchema.apply(this, arguments);
|
|
12
12
|
}
|
|
13
13
|
function _getSchema() {
|
|
14
|
-
_getSchema = (0, _asyncToGenerator2["default"])(
|
|
14
|
+
_getSchema = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee(pageId, mock) {
|
|
15
15
|
var key;
|
|
16
|
-
return _regenerator["default"].wrap(function
|
|
16
|
+
return _regenerator["default"].wrap(function (_context) {
|
|
17
17
|
while (1) switch (_context.prev = _context.next) {
|
|
18
18
|
case 0:
|
|
19
19
|
mock = getMock(mock);
|
|
20
20
|
key = mock ? pageId + ":mock" : pageId;
|
|
21
|
-
_context.next =
|
|
21
|
+
_context.next = 1;
|
|
22
22
|
return _cache.schema.getInstance(key, {
|
|
23
23
|
mock: mock,
|
|
24
24
|
pageId: pageId
|
|
25
25
|
});
|
|
26
|
-
case
|
|
26
|
+
case 1:
|
|
27
27
|
return _context.abrupt("return", _context.sent);
|
|
28
|
-
case
|
|
28
|
+
case 2:
|
|
29
29
|
case "end":
|
|
30
30
|
return _context.stop();
|
|
31
31
|
}
|
|
@@ -10,17 +10,17 @@ function loadDts() {
|
|
|
10
10
|
return _loadDts.apply(this, arguments);
|
|
11
11
|
}
|
|
12
12
|
function _loadDts() {
|
|
13
|
-
_loadDts = (0, _asyncToGenerator2["default"])(
|
|
14
|
-
var api, res;
|
|
15
|
-
return _regenerator["default"].wrap(function
|
|
13
|
+
_loadDts = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee() {
|
|
14
|
+
var api, res, _t;
|
|
15
|
+
return _regenerator["default"].wrap(function (_context) {
|
|
16
16
|
while (1) switch (_context.prev = _context.next) {
|
|
17
17
|
case 0:
|
|
18
18
|
_context.prev = 0;
|
|
19
|
-
_context.next =
|
|
19
|
+
_context.next = 1;
|
|
20
20
|
return (0, _index.getFormApi)("c40772eb-864b-42bb-ae31-9921d8ede97f");
|
|
21
|
-
case
|
|
21
|
+
case 1:
|
|
22
22
|
api = _context.sent;
|
|
23
|
-
_context.next =
|
|
23
|
+
_context.next = 2;
|
|
24
24
|
return api.search({
|
|
25
25
|
pageSize: 1000,
|
|
26
26
|
searchFields: [{
|
|
@@ -29,18 +29,18 @@ function _loadDts() {
|
|
|
29
29
|
value: "dts"
|
|
30
30
|
}]
|
|
31
31
|
});
|
|
32
|
-
case
|
|
32
|
+
case 2:
|
|
33
33
|
res = _context.sent;
|
|
34
34
|
return _context.abrupt("return", res.data || []);
|
|
35
|
-
case
|
|
36
|
-
_context.prev =
|
|
37
|
-
|
|
35
|
+
case 3:
|
|
36
|
+
_context.prev = 3;
|
|
37
|
+
_t = _context["catch"](0);
|
|
38
38
|
return _context.abrupt("return", []);
|
|
39
|
-
case
|
|
39
|
+
case 4:
|
|
40
40
|
case "end":
|
|
41
41
|
return _context.stop();
|
|
42
42
|
}
|
|
43
|
-
}, _callee, null, [[0,
|
|
43
|
+
}, _callee, null, [[0, 3]]);
|
|
44
44
|
}));
|
|
45
45
|
return _loadDts.apply(this, arguments);
|
|
46
46
|
}
|
|
@@ -11,9 +11,9 @@ function getUserinfo() {
|
|
|
11
11
|
return _getUserinfo.apply(this, arguments);
|
|
12
12
|
}
|
|
13
13
|
function _getUserinfo() {
|
|
14
|
-
_getUserinfo = (0, _asyncToGenerator2["default"])(
|
|
14
|
+
_getUserinfo = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee() {
|
|
15
15
|
var userinfo, cache, res;
|
|
16
|
-
return _regenerator["default"].wrap(function
|
|
16
|
+
return _regenerator["default"].wrap(function (_context) {
|
|
17
17
|
while (1) switch (_context.prev = _context.next) {
|
|
18
18
|
case 0:
|
|
19
19
|
userinfo = null;
|
|
@@ -24,18 +24,18 @@ function _getUserinfo() {
|
|
|
24
24
|
} catch (e) {}
|
|
25
25
|
}
|
|
26
26
|
if (userinfo) {
|
|
27
|
-
_context.next =
|
|
27
|
+
_context.next = 2;
|
|
28
28
|
break;
|
|
29
29
|
}
|
|
30
|
-
_context.next =
|
|
30
|
+
_context.next = 1;
|
|
31
31
|
return _index.apiRequest.get("auths/userinfo");
|
|
32
|
-
case
|
|
32
|
+
case 1:
|
|
33
33
|
res = _context.sent;
|
|
34
34
|
if (res.success) {
|
|
35
35
|
sessionStorage.setItem(userinfoKey, JSON.stringify(res.data));
|
|
36
36
|
userinfo = res.data;
|
|
37
37
|
}
|
|
38
|
-
case
|
|
38
|
+
case 2:
|
|
39
39
|
if (userinfo) {
|
|
40
40
|
Object.defineProperty(window, "userinfo", {
|
|
41
41
|
value: userinfo
|
|
@@ -45,7 +45,7 @@ function _getUserinfo() {
|
|
|
45
45
|
});
|
|
46
46
|
}
|
|
47
47
|
return _context.abrupt("return", userinfo);
|
|
48
|
-
case
|
|
48
|
+
case 3:
|
|
49
49
|
case "end":
|
|
50
50
|
return _context.stop();
|
|
51
51
|
}
|
package/lib/utils/cache/index.js
CHANGED
|
@@ -16,28 +16,28 @@ var SchemaCache = exports.SchemaCache = /*#__PURE__*/function (_SingletonInstanc
|
|
|
16
16
|
(0, _inheritsLoose2["default"])(SchemaCache, _SingletonInstanceMap);
|
|
17
17
|
var _proto = SchemaCache.prototype;
|
|
18
18
|
_proto.createInstance = /*#__PURE__*/function () {
|
|
19
|
-
var _createInstance = (0, _asyncToGenerator2["default"])(
|
|
19
|
+
var _createInstance = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee(key, options) {
|
|
20
20
|
var mock, pageId, schemaRes, schema, permissionRes, permission;
|
|
21
|
-
return _regenerator["default"].wrap(function
|
|
21
|
+
return _regenerator["default"].wrap(function (_context) {
|
|
22
22
|
while (1) switch (_context.prev = _context.next) {
|
|
23
23
|
case 0:
|
|
24
24
|
mock = options.mock, pageId = options.pageId;
|
|
25
|
-
_context.next =
|
|
25
|
+
_context.next = 1;
|
|
26
26
|
return _api.apiRequest.get("pages/" + pageId + "/schema", {
|
|
27
27
|
params: {
|
|
28
28
|
mock: mock
|
|
29
29
|
}
|
|
30
30
|
});
|
|
31
|
-
case
|
|
31
|
+
case 1:
|
|
32
32
|
schemaRes = _context.sent;
|
|
33
33
|
schema = schemaRes.data;
|
|
34
34
|
if (!(typeof schema == "object")) {
|
|
35
|
-
_context.next =
|
|
35
|
+
_context.next = 3;
|
|
36
36
|
break;
|
|
37
37
|
}
|
|
38
|
-
_context.next =
|
|
38
|
+
_context.next = 2;
|
|
39
39
|
return _api.apiRequest.get("pages/" + pageId + "/permission");
|
|
40
|
-
case
|
|
40
|
+
case 2:
|
|
41
41
|
permissionRes = _context.sent;
|
|
42
42
|
permission = permissionRes.data;
|
|
43
43
|
if (typeof permission == "object") {
|
|
@@ -46,10 +46,10 @@ var SchemaCache = exports.SchemaCache = /*#__PURE__*/function (_SingletonInstanc
|
|
|
46
46
|
child.props.permission = permission;
|
|
47
47
|
});
|
|
48
48
|
}
|
|
49
|
-
case
|
|
49
|
+
case 3:
|
|
50
50
|
console.log("schemaRes", schemaRes);
|
|
51
51
|
return _context.abrupt("return", schemaRes);
|
|
52
|
-
case
|
|
52
|
+
case 4:
|
|
53
53
|
case "end":
|
|
54
54
|
return _context.stop();
|
|
55
55
|
}
|
|
@@ -76,9 +76,9 @@ var FormApiCache = exports.FormApiCache = /*#__PURE__*/function (_SingletonInsta
|
|
|
76
76
|
(0, _inheritsLoose2["default"])(FormApiCache, _SingletonInstanceMap2);
|
|
77
77
|
var _proto2 = FormApiCache.prototype;
|
|
78
78
|
_proto2.createInstance = /*#__PURE__*/function () {
|
|
79
|
-
var _createInstance2 = (0, _asyncToGenerator2["default"])(
|
|
79
|
+
var _createInstance2 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee2(key, options) {
|
|
80
80
|
var _options, formId, fieldId, mock, formApi;
|
|
81
|
-
return _regenerator["default"].wrap(function
|
|
81
|
+
return _regenerator["default"].wrap(function (_context2) {
|
|
82
82
|
while (1) switch (_context2.prev = _context2.next) {
|
|
83
83
|
case 0:
|
|
84
84
|
if (options === void 0) {
|
|
@@ -86,11 +86,11 @@ var FormApiCache = exports.FormApiCache = /*#__PURE__*/function (_SingletonInsta
|
|
|
86
86
|
}
|
|
87
87
|
_options = options, formId = _options.formId, fieldId = _options.fieldId, mock = _options.mock;
|
|
88
88
|
formApi = new _api.RestFormApi(formId, fieldId, mock);
|
|
89
|
-
_context2.next =
|
|
89
|
+
_context2.next = 1;
|
|
90
90
|
return formApi.initialize();
|
|
91
|
-
case
|
|
91
|
+
case 1:
|
|
92
92
|
return _context2.abrupt("return", formApi);
|
|
93
|
-
case
|
|
93
|
+
case 2:
|
|
94
94
|
case "end":
|
|
95
95
|
return _context2.stop();
|
|
96
96
|
}
|