@zhubangyun/lowcode-core 5.12.92 → 6.1.90
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 +44 -28
- package/es/components/page-loading/index.js +4 -1
- package/es/demo/index.js +8 -8
- package/es/index.d.ts +1 -1
- package/es/index.js +41 -2
- package/es/index.less +10 -0
- package/es/style.js +2 -2
- package/es/utils/api/file-api.js +21 -21
- package/es/utils/api/form-api.d.ts +2 -1
- package/es/utils/api/form-api.js +90 -51
- package/es/utils/api/form-api.utils.js +5 -4
- package/es/utils/api/index.d.ts +2 -2
- package/es/utils/api/index.js +1 -0
- package/es/utils/api/rest-api.d.ts +3 -1
- package/es/utils/api/rest-api.js +207 -125
- package/es/utils/api/schema-api.js +5 -5
- package/es/utils/api/schema.util.d.ts +3 -3
- package/es/utils/api/schema.util.js +17 -12
- package/es/utils/api/script-api.js +12 -12
- package/es/utils/api/user-info.js +7 -7
- package/es/utils/cache/index.js +66 -26
- package/es/utils/common/LoadPlugins.js +33 -33
- package/es/utils/common/SingletonInstanceMap.js +21 -21
- package/es/utils/common/index.d.ts +3 -0
- package/es/utils/common/index.js +13 -3
- 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 +9 -6
- package/es/utils/page/page-form-data-manager.d.ts +1 -0
- package/es/utils/page/page-form-data-manager.js +9 -6
- package/es/utils/page/page-form-group.d.ts +1 -0
- package/es/utils/page/page-form-group.js +8 -7
- package/es/utils/page/page-form.d.ts +1 -0
- package/es/utils/page/page-form.js +23 -12
- package/es/utils/page/page-layout.d.ts +3 -0
- package/es/utils/page/page-layout.js +33 -9
- package/es/utils/page/page-load-schema.js +20 -28
- package/es/utils/page/page-render.js +4 -4
- package/es/utils/page/page-show.d.ts +2 -0
- package/es/utils/page/page-show.js +8 -3
- package/es/utils/page/print-form.js +60 -51
- package/es/utils/uni-bridge.d.ts +18 -0
- package/es/utils/uni-bridge.js +130 -0
- package/es/utils/util.common.d.ts +1 -0
- package/es/utils/util.common.js +4 -0
- package/lib/components/load-materials/index.js +45 -30
- package/lib/components/page-loading/index.js +4 -1
- package/lib/demo/index.js +9 -10
- package/lib/index.d.ts +1 -1
- package/lib/index.js +45 -6
- package/lib/index.less +10 -0
- package/lib/style.js +2 -2
- package/lib/utils/api/file-api.js +21 -21
- package/lib/utils/api/form-api.d.ts +2 -1
- package/lib/utils/api/form-api.js +90 -51
- package/lib/utils/api/form-api.utils.js +5 -4
- package/lib/utils/api/index.d.ts +2 -2
- package/lib/utils/api/index.js +2 -2
- package/lib/utils/api/rest-api.d.ts +3 -1
- package/lib/utils/api/rest-api.js +207 -125
- package/lib/utils/api/schema-api.js +5 -5
- package/lib/utils/api/schema.util.d.ts +3 -3
- package/lib/utils/api/schema.util.js +19 -13
- package/lib/utils/api/script-api.js +12 -12
- package/lib/utils/api/user-info.js +7 -7
- package/lib/utils/cache/index.js +65 -25
- package/lib/utils/common/LoadPlugins.js +33 -33
- package/lib/utils/common/SingletonInstanceMap.js +21 -21
- package/lib/utils/common/index.d.ts +3 -0
- package/lib/utils/common/index.js +15 -2
- 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 +10 -8
- package/lib/utils/page/page-form-data-manager.d.ts +1 -0
- package/lib/utils/page/page-form-data-manager.js +10 -8
- package/lib/utils/page/page-form-group.d.ts +1 -0
- package/lib/utils/page/page-form-group.js +9 -9
- package/lib/utils/page/page-form.d.ts +1 -0
- package/lib/utils/page/page-form.js +24 -14
- package/lib/utils/page/page-layout.d.ts +3 -0
- package/lib/utils/page/page-layout.js +34 -11
- package/lib/utils/page/page-load-schema.js +19 -27
- package/lib/utils/page/page-render.js +4 -4
- package/lib/utils/page/page-show.d.ts +2 -0
- package/lib/utils/page/page-show.js +9 -5
- package/lib/utils/page/print-form.js +60 -51
- package/lib/utils/uni-bridge.d.ts +18 -0
- package/lib/utils/uni-bridge.js +135 -0
- package/lib/utils/util.common.d.ts +1 -0
- package/lib/utils/util.common.js +8 -0
- package/package.json +2 -2
|
@@ -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,133 @@ 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
|
-
_proto
|
|
354
|
-
var
|
|
355
|
-
var
|
|
356
|
-
|
|
353
|
+
_proto["export"] = /*#__PURE__*/function () {
|
|
354
|
+
var _export2 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee8(data, options) {
|
|
355
|
+
var _this$handleRequestCo8;
|
|
356
|
+
var config, res, _options$onError7, _options$onSuccess7;
|
|
357
|
+
return _regenerator["default"].wrap(function (_context8) {
|
|
357
358
|
while (1) switch (_context8.prev = _context8.next) {
|
|
359
|
+
case 0:
|
|
360
|
+
config = {};
|
|
361
|
+
_context8.next = 1;
|
|
362
|
+
return (_this$handleRequestCo8 = this.handleRequestConfig) === null || _this$handleRequestCo8 === void 0 ? void 0 : _this$handleRequestCo8.call(this, config);
|
|
363
|
+
case 1:
|
|
364
|
+
_context8.next = 2;
|
|
365
|
+
return this.request.post("/export", data, config);
|
|
366
|
+
case 2:
|
|
367
|
+
res = _context8.sent;
|
|
368
|
+
if (res.success) {
|
|
369
|
+
_context8.next = 4;
|
|
370
|
+
break;
|
|
371
|
+
}
|
|
372
|
+
this.showError("\u5BFC\u51FA\u5931\u8D25!", res).then();
|
|
373
|
+
_context8.next = 3;
|
|
374
|
+
return options === null || options === void 0 ? void 0 : (_options$onError7 = options.onError) === null || _options$onError7 === void 0 ? void 0 : _options$onError7.call(options, res);
|
|
375
|
+
case 3:
|
|
376
|
+
_context8.next = 5;
|
|
377
|
+
break;
|
|
378
|
+
case 4:
|
|
379
|
+
_context8.next = 5;
|
|
380
|
+
return options === null || options === void 0 ? void 0 : (_options$onSuccess7 = options.onSuccess) === null || _options$onSuccess7 === void 0 ? void 0 : _options$onSuccess7.call(options, res);
|
|
381
|
+
case 5:
|
|
382
|
+
return _context8.abrupt("return", res);
|
|
383
|
+
case 6:
|
|
384
|
+
case "end":
|
|
385
|
+
return _context8.stop();
|
|
386
|
+
}
|
|
387
|
+
}, _callee8, this);
|
|
388
|
+
}));
|
|
389
|
+
function _export(_x13, _x14) {
|
|
390
|
+
return _export2.apply(this, arguments);
|
|
391
|
+
}
|
|
392
|
+
return _export;
|
|
393
|
+
}();
|
|
394
|
+
_proto["import"] = /*#__PURE__*/function () {
|
|
395
|
+
var _import2 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee9(data, options) {
|
|
396
|
+
var _this$handleRequestCo9;
|
|
397
|
+
var config, res, _options$onError8, _options$onSuccess8;
|
|
398
|
+
return _regenerator["default"].wrap(function (_context9) {
|
|
399
|
+
while (1) switch (_context9.prev = _context9.next) {
|
|
400
|
+
case 0:
|
|
401
|
+
config = {};
|
|
402
|
+
_context9.next = 1;
|
|
403
|
+
return (_this$handleRequestCo9 = this.handleRequestConfig) === null || _this$handleRequestCo9 === void 0 ? void 0 : _this$handleRequestCo9.call(this, config);
|
|
404
|
+
case 1:
|
|
405
|
+
_context9.next = 2;
|
|
406
|
+
return this.request.post("import", data, config);
|
|
407
|
+
case 2:
|
|
408
|
+
res = _context9.sent;
|
|
409
|
+
if (res.success) {
|
|
410
|
+
_context9.next = 4;
|
|
411
|
+
break;
|
|
412
|
+
}
|
|
413
|
+
this.showError("\u5BFC\u5165\u5931\u8D25!", res).then();
|
|
414
|
+
_context9.next = 3;
|
|
415
|
+
return options === null || options === void 0 ? void 0 : (_options$onError8 = options.onError) === null || _options$onError8 === void 0 ? void 0 : _options$onError8.call(options, res);
|
|
416
|
+
case 3:
|
|
417
|
+
_context9.next = 5;
|
|
418
|
+
break;
|
|
419
|
+
case 4:
|
|
420
|
+
_context9.next = 5;
|
|
421
|
+
return options === null || options === void 0 ? void 0 : (_options$onSuccess8 = options.onSuccess) === null || _options$onSuccess8 === void 0 ? void 0 : _options$onSuccess8.call(options, res);
|
|
422
|
+
case 5:
|
|
423
|
+
return _context9.abrupt("return", res);
|
|
424
|
+
case 6:
|
|
425
|
+
case "end":
|
|
426
|
+
return _context9.stop();
|
|
427
|
+
}
|
|
428
|
+
}, _callee9, this);
|
|
429
|
+
}));
|
|
430
|
+
function _import(_x15, _x16) {
|
|
431
|
+
return _import2.apply(this, arguments);
|
|
432
|
+
}
|
|
433
|
+
return _import;
|
|
434
|
+
}();
|
|
435
|
+
_proto.showError = /*#__PURE__*/function () {
|
|
436
|
+
var _showError = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee0(type, res) {
|
|
437
|
+
var msg, props, _t;
|
|
438
|
+
return _regenerator["default"].wrap(function (_context0) {
|
|
439
|
+
while (1) switch (_context0.prev = _context0.next) {
|
|
358
440
|
case 0:
|
|
359
441
|
msg = res.message;
|
|
360
|
-
|
|
442
|
+
_context0.prev = 1;
|
|
361
443
|
if (!msg) {
|
|
362
|
-
|
|
444
|
+
_context0.next = 4;
|
|
363
445
|
break;
|
|
364
446
|
}
|
|
365
447
|
props = JSON.parse(msg);
|
|
@@ -368,31 +450,31 @@ var BaseRestApi = exports.BaseRestApi = /*#__PURE__*/function () {
|
|
|
368
450
|
props.title = "" + this.title + type;
|
|
369
451
|
}
|
|
370
452
|
if (!(props.type == "message")) {
|
|
371
|
-
|
|
453
|
+
_context0.next = 2;
|
|
372
454
|
break;
|
|
373
455
|
}
|
|
374
456
|
_message2["default"].error(props);
|
|
375
|
-
return
|
|
376
|
-
case
|
|
457
|
+
return _context0.abrupt("return");
|
|
458
|
+
case 2:
|
|
377
459
|
if (!(props.type == "modal")) {
|
|
378
|
-
|
|
460
|
+
_context0.next = 3;
|
|
379
461
|
break;
|
|
380
462
|
}
|
|
381
463
|
_modal["default"].error(props);
|
|
382
|
-
return
|
|
383
|
-
case
|
|
464
|
+
return _context0.abrupt("return");
|
|
465
|
+
case 3:
|
|
384
466
|
if (!(props.type == "notification")) {
|
|
385
|
-
|
|
467
|
+
_context0.next = 4;
|
|
386
468
|
break;
|
|
387
469
|
}
|
|
388
470
|
_notification2["default"].error(props);
|
|
389
|
-
return
|
|
390
|
-
case
|
|
391
|
-
|
|
471
|
+
return _context0.abrupt("return");
|
|
472
|
+
case 4:
|
|
473
|
+
_context0.next = 6;
|
|
392
474
|
break;
|
|
393
|
-
case
|
|
394
|
-
|
|
395
|
-
|
|
475
|
+
case 5:
|
|
476
|
+
_context0.prev = 5;
|
|
477
|
+
_t = _context0["catch"](1);
|
|
396
478
|
console.error("" + this.title + type + (msg || ""));
|
|
397
479
|
_modal["default"].error({
|
|
398
480
|
title: "" + this.title + type,
|
|
@@ -402,13 +484,13 @@ var BaseRestApi = exports.BaseRestApi = /*#__PURE__*/function () {
|
|
|
402
484
|
message: res.message
|
|
403
485
|
})
|
|
404
486
|
});
|
|
405
|
-
case
|
|
487
|
+
case 6:
|
|
406
488
|
case "end":
|
|
407
|
-
return
|
|
489
|
+
return _context0.stop();
|
|
408
490
|
}
|
|
409
|
-
},
|
|
491
|
+
}, _callee0, this, [[1, 5]]);
|
|
410
492
|
}));
|
|
411
|
-
function showError(
|
|
493
|
+
function showError(_x17, _x18) {
|
|
412
494
|
return _showError.apply(this, arguments);
|
|
413
495
|
}
|
|
414
496
|
return showError;
|
|
@@ -430,16 +512,16 @@ var RestApi = exports.RestApi = /*#__PURE__*/function (_BaseRestApi2) {
|
|
|
430
512
|
(0, _inheritsLoose2["default"])(RestApi, _BaseRestApi2);
|
|
431
513
|
var _proto2 = RestApi.prototype;
|
|
432
514
|
_proto2.handleRequestConfig = /*#__PURE__*/function () {
|
|
433
|
-
var _handleRequestConfig = (0, _asyncToGenerator2["default"])(
|
|
434
|
-
return _regenerator["default"].wrap(function
|
|
435
|
-
while (1) switch (
|
|
515
|
+
var _handleRequestConfig = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee1(config) {
|
|
516
|
+
return _regenerator["default"].wrap(function (_context1) {
|
|
517
|
+
while (1) switch (_context1.prev = _context1.next) {
|
|
436
518
|
case 0:
|
|
437
519
|
case "end":
|
|
438
|
-
return
|
|
520
|
+
return _context1.stop();
|
|
439
521
|
}
|
|
440
|
-
},
|
|
522
|
+
}, _callee1);
|
|
441
523
|
}));
|
|
442
|
-
function handleRequestConfig(
|
|
524
|
+
function handleRequestConfig(_x19) {
|
|
443
525
|
return _handleRequestConfig.apply(this, arguments);
|
|
444
526
|
}
|
|
445
527
|
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
|
}
|
|
@@ -4,11 +4,11 @@
|
|
|
4
4
|
* @param callback 返回true 继续往下遍历
|
|
5
5
|
*/
|
|
6
6
|
export declare function forEachSchema(schema: Schema, callback: (child: Schema, index: number, children: any[]) => boolean): void;
|
|
7
|
-
export declare function
|
|
8
|
-
|
|
7
|
+
export declare function findFormSchemas(schema: Schema): Schema[];
|
|
8
|
+
export declare function findFdmSchemas(schema?: Schema): Schema[];
|
|
9
|
+
export interface Schema {
|
|
9
10
|
componentName: string;
|
|
10
11
|
props: any;
|
|
11
12
|
children?: Schema[];
|
|
12
13
|
fdmSchema?: Schema;
|
|
13
14
|
}
|
|
14
|
-
export {};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
|
-
exports.
|
|
4
|
+
exports.findFdmSchemas = findFdmSchemas;
|
|
5
|
+
exports.findFormSchemas = findFormSchemas;
|
|
5
6
|
exports.forEachSchema = forEachSchema;
|
|
6
7
|
/**
|
|
7
8
|
* 遍历schema
|
|
@@ -17,21 +18,26 @@ function forEachSchema(schema, callback) {
|
|
|
17
18
|
}
|
|
18
19
|
});
|
|
19
20
|
}
|
|
20
|
-
function
|
|
21
|
+
function findFormSchemas(schema) {
|
|
22
|
+
var schemas = [];
|
|
21
23
|
forEachSchema(schema, function (child) {
|
|
22
24
|
if (["PageForm", "SubFormField"].includes(child.componentName)) {
|
|
23
|
-
|
|
24
|
-
if (fdm) {
|
|
25
|
-
if (child.fdmSchema) {
|
|
26
|
-
forEachSchema(child.fdmSchema, function (fdmChild) {
|
|
27
|
-
if (fdmChild.componentName == "PageFdm") {
|
|
28
|
-
callback(child);
|
|
29
|
-
}
|
|
30
|
-
return true;
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
}
|
|
25
|
+
schemas.push(child);
|
|
34
26
|
}
|
|
35
27
|
return true;
|
|
36
28
|
});
|
|
29
|
+
return schemas;
|
|
30
|
+
}
|
|
31
|
+
function findFdmSchemas(schema) {
|
|
32
|
+
var schemas = [];
|
|
33
|
+
if (!schema) {
|
|
34
|
+
return schemas;
|
|
35
|
+
}
|
|
36
|
+
forEachSchema(schema, function (child) {
|
|
37
|
+
if (["PageFdm"].includes(child.componentName)) {
|
|
38
|
+
schemas.push(child);
|
|
39
|
+
}
|
|
40
|
+
return true;
|
|
41
|
+
});
|
|
42
|
+
return schemas;
|
|
37
43
|
}
|