@zhubangyun/lowcode-core 6.3.25 → 6.4.4
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/index.d.ts +1 -1
- package/es/index.js +5 -5
- package/es/index.less +0 -1
- package/es/utils/api/form-api/form-api.utils.js +4 -0
- package/es/utils/api/form-api.d.ts +0 -1
- package/es/utils/api/form-api.js +4 -37
- package/es/utils/api/rest-api.d.ts +1 -0
- package/es/utils/api/rest-api.js +125 -108
- package/es/utils/api/script-api.d.ts +1 -1
- package/es/utils/cache/cache.load-data.d.ts +1 -0
- package/es/utils/cache/cache.load-data.js +41 -0
- package/es/utils/cache/cache.page-permission.d.ts +1 -0
- package/es/utils/cache/cache.page-permission.js +28 -0
- package/es/utils/cache/cache.page-print.d.ts +1 -0
- package/es/utils/cache/cache.page-print.js +25 -0
- package/es/utils/cache/cache.page-schema.d.ts +1 -0
- package/es/utils/cache/cache.page-schema.js +96 -0
- package/es/utils/cache/cache.print.js +0 -0
- package/es/utils/cache/index.d.ts +5 -6
- package/es/utils/cache/index.js +19 -32
- package/es/utils/cache/index_db_cache.d.ts +11 -6
- package/es/utils/cache/index_db_cache.js +57 -5
- package/es/utils/page/index.js +1 -1
- package/es/utils/page/page-form-data-manager.d.ts +2 -1
- package/es/utils/page/page-layout.d.ts +1 -1
- package/es/utils/page/page-load-schema.js +33 -15
- package/es/utils/page/page-render.js +5 -1
- package/es/utils/page/page-schema-utils.js +1 -1
- package/es/utils/page/print-form.js +2 -4
- package/lib/index.d.ts +1 -1
- package/lib/index.js +6 -6
- package/lib/index.less +0 -1
- package/lib/utils/api/form-api/form-api.utils.js +4 -0
- package/lib/utils/api/form-api.d.ts +0 -1
- package/lib/utils/api/form-api.js +4 -37
- package/lib/utils/api/rest-api.d.ts +1 -0
- package/lib/utils/api/rest-api.js +125 -108
- package/lib/utils/api/script-api.d.ts +1 -1
- package/lib/utils/cache/cache.load-data.d.ts +1 -0
- package/lib/utils/cache/cache.load-data.js +44 -0
- package/lib/utils/cache/cache.page-permission.d.ts +1 -0
- package/lib/utils/cache/cache.page-permission.js +33 -0
- package/lib/utils/cache/cache.page-print.d.ts +1 -0
- package/lib/utils/cache/cache.page-print.js +30 -0
- package/lib/utils/cache/cache.page-schema.d.ts +1 -0
- package/lib/utils/cache/cache.page-schema.js +101 -0
- package/lib/utils/cache/cache.print.js +1 -0
- package/lib/utils/cache/index.d.ts +5 -6
- package/lib/utils/cache/index.js +23 -35
- package/lib/utils/cache/index_db_cache.d.ts +11 -6
- package/lib/utils/cache/index_db_cache.js +61 -6
- package/lib/utils/page/index.js +1 -1
- package/lib/utils/page/page-form-data-manager.d.ts +2 -1
- package/lib/utils/page/page-layout.d.ts +1 -1
- package/lib/utils/page/page-load-schema.js +32 -14
- package/lib/utils/page/page-render.js +5 -1
- package/lib/utils/page/page-schema-utils.js +1 -1
- package/lib/utils/page/print-form.js +2 -4
- package/package.json +1 -1
package/es/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import "./index.less";
|
|
2
2
|
import * as lodash from "lodash";
|
|
3
|
+
import utils from "./utils/index";
|
|
3
4
|
export { LoadMaterials } from "./components/load-materials";
|
|
4
5
|
export { PageLoading } from "./components/page-loading";
|
|
5
6
|
export { RestApi, RestFormApi, apiRequest } from "./utils/api";
|
|
6
7
|
export { Layout } from "./components/layout";
|
|
7
8
|
export { ReactRender } from "./components/react-render";
|
|
8
|
-
import utils from "./utils/index";
|
|
9
9
|
export { utils, lodash };
|
package/es/index.js
CHANGED
|
@@ -2,16 +2,16 @@ import _message from "antd/es/message";
|
|
|
2
2
|
import "./index.less";
|
|
3
3
|
import { ReactRender } from "./components/react-render";
|
|
4
4
|
import * as lodash from "lodash";
|
|
5
|
-
export { LoadMaterials } from "./components/load-materials";
|
|
6
|
-
export { PageLoading } from "./components/page-loading";
|
|
7
|
-
export { RestApi, RestFormApi, apiRequest } from "./utils/api";
|
|
8
|
-
export { Layout } from "./components/layout";
|
|
9
|
-
export { ReactRender } from "./components/react-render";
|
|
10
5
|
import utils from "./utils/index";
|
|
11
6
|
import { uniBridge } from "./utils/uni-bridge";
|
|
12
7
|
import { initBarHeight } from "./init/init.bar-height";
|
|
13
8
|
import { initScrollSize } from "./init/init.scroll-size";
|
|
14
9
|
import { initMobileClass } from "./init/init.mobile-class";
|
|
10
|
+
export { LoadMaterials } from "./components/load-materials";
|
|
11
|
+
export { PageLoading } from "./components/page-loading";
|
|
12
|
+
export { RestApi, RestFormApi, apiRequest } from "./utils/api";
|
|
13
|
+
export { Layout } from "./components/layout";
|
|
14
|
+
export { ReactRender } from "./components/react-render";
|
|
15
15
|
// @ts-ignore
|
|
16
16
|
window.__ReactRender = ReactRender;
|
|
17
17
|
// @ts-ignore
|
package/es/index.less
CHANGED
|
@@ -7,10 +7,14 @@ import { isLocalhost } from "../../common";
|
|
|
7
7
|
import { formApiAssembleEntity } from "./form-api.assemble-entity";
|
|
8
8
|
import { isTemplateHost } from "../../util.common";
|
|
9
9
|
var SimpleSerialFieldNames = ["parent", "instance"];
|
|
10
|
+
var IgnoreFieldNames = ["createdAt", "createdBy", "updatedAt", "updatedBy"];
|
|
10
11
|
export function convertSaveData(data) {
|
|
11
12
|
if (!data) return data;
|
|
12
13
|
var seen = new WeakSet(); // WeakSet 只存储对象,非常适合检测引用
|
|
13
14
|
return JSON.parse(JSON.stringify(data, function (key, value) {
|
|
15
|
+
if (IgnoreFieldNames.includes(key)) {
|
|
16
|
+
return undefined;
|
|
17
|
+
}
|
|
14
18
|
if (value == null) {
|
|
15
19
|
return null;
|
|
16
20
|
} else if (Array.isArray(value)) {
|
|
@@ -6,7 +6,6 @@ export declare class RestFormApi<DataType> extends RestApi<DataType> {
|
|
|
6
6
|
private readonly fieldId?;
|
|
7
7
|
private readonly mock;
|
|
8
8
|
private initialized;
|
|
9
|
-
private schema;
|
|
10
9
|
constructor(formId: string, fieldId?: string, mock?: boolean);
|
|
11
10
|
initialize(): Promise<boolean>;
|
|
12
11
|
handleRequestConfig(config: AxiosRequestConfig): Promise<void>;
|
package/es/utils/api/form-api.js
CHANGED
|
@@ -4,7 +4,6 @@ import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
|
4
4
|
import { RestApi } from "./rest-api";
|
|
5
5
|
import { assembleAssociationField, convertSaveData, handleFilterRules } from "./form-api/form-api.utils";
|
|
6
6
|
import { formApi } from "../cache";
|
|
7
|
-
import { getSchemaFromCache } from "./schema-api";
|
|
8
7
|
import { uuid, uuidVersion } from "../common";
|
|
9
8
|
export function getFormApi(_x, _x2, _x3) {
|
|
10
9
|
return _getFormApi.apply(this, arguments);
|
|
@@ -46,7 +45,6 @@ export var RestFormApi = /*#__PURE__*/function (_RestApi) {
|
|
|
46
45
|
_this.fieldId = void 0;
|
|
47
46
|
_this.mock = void 0;
|
|
48
47
|
_this.initialized = false;
|
|
49
|
-
_this.schema = void 0;
|
|
50
48
|
_this.formId = formId;
|
|
51
49
|
_this.fieldId = fieldId;
|
|
52
50
|
_this.mock = !!mock;
|
|
@@ -56,41 +54,10 @@ export var RestFormApi = /*#__PURE__*/function (_RestApi) {
|
|
|
56
54
|
var _proto = RestFormApi.prototype;
|
|
57
55
|
_proto.initialize = /*#__PURE__*/function () {
|
|
58
56
|
var _initialize = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
59
|
-
var _this2 = this;
|
|
60
|
-
var res, _this$schema, _this$schema$children, _this$schema$children2;
|
|
61
57
|
return _regeneratorRuntime.wrap(function (_context) {
|
|
62
58
|
while (1) switch (_context.prev = _context.next) {
|
|
63
59
|
case 0:
|
|
64
|
-
|
|
65
|
-
try {
|
|
66
|
-
res = getSchemaFromCache(this.formId, this.mock);
|
|
67
|
-
this.schema = res === null || res === void 0 ? void 0 : res.data;
|
|
68
|
-
this.initialized = !!this.schema;
|
|
69
|
-
if (this.initialized) {
|
|
70
|
-
this.title = (_this$schema = this.schema) === null || _this$schema === void 0 ? void 0 : (_this$schema$children = _this$schema.children[0]) === null || _this$schema$children === void 0 ? void 0 : (_this$schema$children2 = _this$schema$children.props) === null || _this$schema$children2 === void 0 ? void 0 : _this$schema$children2.label;
|
|
71
|
-
if (this.fieldId) {
|
|
72
|
-
JSON.stringify(this.schema, function (key, value) {
|
|
73
|
-
var _value$props;
|
|
74
|
-
if (key == "fdmSchema") {
|
|
75
|
-
return undefined;
|
|
76
|
-
}
|
|
77
|
-
if ((value === null || value === void 0 ? void 0 : (_value$props = value.props) === null || _value$props === void 0 ? void 0 : _value$props.fieldId) === _this2.fieldId) {
|
|
78
|
-
if (value.props.label) {
|
|
79
|
-
_this2.title += "." + value.props.label;
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
return value;
|
|
83
|
-
});
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
} catch (e) {
|
|
87
|
-
console.log("获取schema失败!", {
|
|
88
|
-
formId: this.formId,
|
|
89
|
-
field: this.fieldId,
|
|
90
|
-
mock: this.mock
|
|
91
|
-
}, e);
|
|
92
|
-
}
|
|
93
|
-
}
|
|
60
|
+
this.initialized = true;
|
|
94
61
|
return _context.abrupt("return", this.initialized);
|
|
95
62
|
case 1:
|
|
96
63
|
case "end":
|
|
@@ -241,7 +208,7 @@ export var RestFormApi = /*#__PURE__*/function (_RestApi) {
|
|
|
241
208
|
}();
|
|
242
209
|
_proto.labelToValue = /*#__PURE__*/function () {
|
|
243
210
|
var _labelToValue = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee5(data, options) {
|
|
244
|
-
var
|
|
211
|
+
var _this2 = this;
|
|
245
212
|
var config, res;
|
|
246
213
|
return _regeneratorRuntime.wrap(function (_context5) {
|
|
247
214
|
while (1) switch (_context5.prev = _context5.next) {
|
|
@@ -258,8 +225,8 @@ export var RestFormApi = /*#__PURE__*/function (_RestApi) {
|
|
|
258
225
|
res.data.forEach(function (item) {
|
|
259
226
|
item.id = uuid();
|
|
260
227
|
item.form = {
|
|
261
|
-
id:
|
|
262
|
-
fieldId:
|
|
228
|
+
id: _this2.formId,
|
|
229
|
+
fieldId: _this2.fieldId
|
|
263
230
|
};
|
|
264
231
|
});
|
|
265
232
|
}
|
|
@@ -45,6 +45,7 @@ export declare abstract class BaseRestApi<DataType> {
|
|
|
45
45
|
*/
|
|
46
46
|
getById(id: string, options?: BaseRequestOptions<DataType>): Promise<OneResult<DataType>>;
|
|
47
47
|
save(data: DataType, options?: BaseRequestOptions<DataType>): Promise<OneResult<DataType>>;
|
|
48
|
+
saveMany(data: DataType, options?: BaseRequestOptions<DataType>): Promise<OneResult<DataType>>;
|
|
48
49
|
/**
|
|
49
50
|
* 创建
|
|
50
51
|
*/
|
package/es/utils/api/rest-api.js
CHANGED
|
@@ -146,6 +146,23 @@ export var BaseRestApi = /*#__PURE__*/function () {
|
|
|
146
146
|
return _save.apply(this, arguments);
|
|
147
147
|
}
|
|
148
148
|
return save;
|
|
149
|
+
}();
|
|
150
|
+
_proto.saveMany = /*#__PURE__*/function () {
|
|
151
|
+
var _saveMany = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee4(data, options) {
|
|
152
|
+
return _regeneratorRuntime.wrap(function (_context4) {
|
|
153
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
154
|
+
case 0:
|
|
155
|
+
return _context4.abrupt("return", this.save(data, options));
|
|
156
|
+
case 1:
|
|
157
|
+
case "end":
|
|
158
|
+
return _context4.stop();
|
|
159
|
+
}
|
|
160
|
+
}, _callee4, this);
|
|
161
|
+
}));
|
|
162
|
+
function saveMany(_x6, _x7) {
|
|
163
|
+
return _saveMany.apply(this, arguments);
|
|
164
|
+
}
|
|
165
|
+
return saveMany;
|
|
149
166
|
}()
|
|
150
167
|
/**
|
|
151
168
|
* 创建
|
|
@@ -154,42 +171,42 @@ export var BaseRestApi = /*#__PURE__*/function () {
|
|
|
154
171
|
_proto.create =
|
|
155
172
|
/*#__PURE__*/
|
|
156
173
|
function () {
|
|
157
|
-
var _create = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function
|
|
174
|
+
var _create = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee5(data, options) {
|
|
158
175
|
var _this$handleRequestCo4;
|
|
159
176
|
var config, res, _options$onError3, _options$onSuccess3;
|
|
160
|
-
return _regeneratorRuntime.wrap(function (
|
|
161
|
-
while (1) switch (
|
|
177
|
+
return _regeneratorRuntime.wrap(function (_context5) {
|
|
178
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
162
179
|
case 0:
|
|
163
180
|
config = {};
|
|
164
|
-
|
|
181
|
+
_context5.next = 1;
|
|
165
182
|
return (_this$handleRequestCo4 = this.handleRequestConfig) === null || _this$handleRequestCo4 === void 0 ? void 0 : _this$handleRequestCo4.call(this, config);
|
|
166
183
|
case 1:
|
|
167
|
-
|
|
184
|
+
_context5.next = 2;
|
|
168
185
|
return this.request.post("", data, config);
|
|
169
186
|
case 2:
|
|
170
|
-
res =
|
|
187
|
+
res = _context5.sent;
|
|
171
188
|
if (res.success) {
|
|
172
|
-
|
|
189
|
+
_context5.next = 4;
|
|
173
190
|
break;
|
|
174
191
|
}
|
|
175
192
|
this.showError("\u65B0\u589E\u5931\u8D25!", res).then();
|
|
176
|
-
|
|
193
|
+
_context5.next = 3;
|
|
177
194
|
return options === null || options === void 0 ? void 0 : (_options$onError3 = options.onError) === null || _options$onError3 === void 0 ? void 0 : _options$onError3.call(options, res);
|
|
178
195
|
case 3:
|
|
179
|
-
|
|
196
|
+
_context5.next = 5;
|
|
180
197
|
break;
|
|
181
198
|
case 4:
|
|
182
|
-
|
|
199
|
+
_context5.next = 5;
|
|
183
200
|
return options === null || options === void 0 ? void 0 : (_options$onSuccess3 = options.onSuccess) === null || _options$onSuccess3 === void 0 ? void 0 : _options$onSuccess3.call(options, res);
|
|
184
201
|
case 5:
|
|
185
|
-
return
|
|
202
|
+
return _context5.abrupt("return", res);
|
|
186
203
|
case 6:
|
|
187
204
|
case "end":
|
|
188
|
-
return
|
|
205
|
+
return _context5.stop();
|
|
189
206
|
}
|
|
190
|
-
},
|
|
207
|
+
}, _callee5, this);
|
|
191
208
|
}));
|
|
192
|
-
function create(
|
|
209
|
+
function create(_x8, _x9) {
|
|
193
210
|
return _create.apply(this, arguments);
|
|
194
211
|
}
|
|
195
212
|
return create;
|
|
@@ -201,42 +218,42 @@ export var BaseRestApi = /*#__PURE__*/function () {
|
|
|
201
218
|
_proto.update =
|
|
202
219
|
/*#__PURE__*/
|
|
203
220
|
function () {
|
|
204
|
-
var _update = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function
|
|
221
|
+
var _update = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee6(id, data, options) {
|
|
205
222
|
var _this$handleRequestCo5;
|
|
206
223
|
var config, res, _options$onError4, _options$onSuccess4;
|
|
207
|
-
return _regeneratorRuntime.wrap(function (
|
|
208
|
-
while (1) switch (
|
|
224
|
+
return _regeneratorRuntime.wrap(function (_context6) {
|
|
225
|
+
while (1) switch (_context6.prev = _context6.next) {
|
|
209
226
|
case 0:
|
|
210
227
|
config = {};
|
|
211
|
-
|
|
228
|
+
_context6.next = 1;
|
|
212
229
|
return (_this$handleRequestCo5 = this.handleRequestConfig) === null || _this$handleRequestCo5 === void 0 ? void 0 : _this$handleRequestCo5.call(this, config);
|
|
213
230
|
case 1:
|
|
214
|
-
|
|
231
|
+
_context6.next = 2;
|
|
215
232
|
return this.request.put(String(id), data, config);
|
|
216
233
|
case 2:
|
|
217
|
-
res =
|
|
234
|
+
res = _context6.sent;
|
|
218
235
|
if (res.success) {
|
|
219
|
-
|
|
236
|
+
_context6.next = 4;
|
|
220
237
|
break;
|
|
221
238
|
}
|
|
222
239
|
this.showError("\u66F4\u65B0\u5931\u8D25!", res).then();
|
|
223
|
-
|
|
240
|
+
_context6.next = 3;
|
|
224
241
|
return options === null || options === void 0 ? void 0 : (_options$onError4 = options.onError) === null || _options$onError4 === void 0 ? void 0 : _options$onError4.call(options, res);
|
|
225
242
|
case 3:
|
|
226
|
-
|
|
243
|
+
_context6.next = 5;
|
|
227
244
|
break;
|
|
228
245
|
case 4:
|
|
229
|
-
|
|
246
|
+
_context6.next = 5;
|
|
230
247
|
return options === null || options === void 0 ? void 0 : (_options$onSuccess4 = options.onSuccess) === null || _options$onSuccess4 === void 0 ? void 0 : _options$onSuccess4.call(options, res);
|
|
231
248
|
case 5:
|
|
232
|
-
return
|
|
249
|
+
return _context6.abrupt("return", res);
|
|
233
250
|
case 6:
|
|
234
251
|
case "end":
|
|
235
|
-
return
|
|
252
|
+
return _context6.stop();
|
|
236
253
|
}
|
|
237
|
-
},
|
|
254
|
+
}, _callee6, this);
|
|
238
255
|
}));
|
|
239
|
-
function update(
|
|
256
|
+
function update(_x0, _x1, _x10) {
|
|
240
257
|
return _update.apply(this, arguments);
|
|
241
258
|
}
|
|
242
259
|
return update;
|
|
@@ -248,55 +265,55 @@ export var BaseRestApi = /*#__PURE__*/function () {
|
|
|
248
265
|
_proto.deleteById =
|
|
249
266
|
/*#__PURE__*/
|
|
250
267
|
function () {
|
|
251
|
-
var _deleteById = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function
|
|
268
|
+
var _deleteById = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee7(id, options) {
|
|
252
269
|
var _this$handleRequestCo6;
|
|
253
270
|
var config, res, _options$onError5, _options$onSuccess5;
|
|
254
|
-
return _regeneratorRuntime.wrap(function (
|
|
255
|
-
while (1) switch (
|
|
271
|
+
return _regeneratorRuntime.wrap(function (_context7) {
|
|
272
|
+
while (1) switch (_context7.prev = _context7.next) {
|
|
256
273
|
case 0:
|
|
257
274
|
config = {};
|
|
258
|
-
|
|
275
|
+
_context7.next = 1;
|
|
259
276
|
return (_this$handleRequestCo6 = this.handleRequestConfig) === null || _this$handleRequestCo6 === void 0 ? void 0 : _this$handleRequestCo6.call(this, config);
|
|
260
277
|
case 1:
|
|
261
|
-
|
|
278
|
+
_context7.next = 2;
|
|
262
279
|
return this.request["delete"](String(id), config);
|
|
263
280
|
case 2:
|
|
264
|
-
res =
|
|
281
|
+
res = _context7.sent;
|
|
265
282
|
if (res.success) {
|
|
266
|
-
|
|
283
|
+
_context7.next = 4;
|
|
267
284
|
break;
|
|
268
285
|
}
|
|
269
286
|
this.showError("\u5220\u9664{" + id + "}\u5931\u8D25!", res).then();
|
|
270
|
-
|
|
287
|
+
_context7.next = 3;
|
|
271
288
|
return options === null || options === void 0 ? void 0 : (_options$onError5 = options.onError) === null || _options$onError5 === void 0 ? void 0 : _options$onError5.call(options, res);
|
|
272
289
|
case 3:
|
|
273
|
-
|
|
290
|
+
_context7.next = 5;
|
|
274
291
|
break;
|
|
275
292
|
case 4:
|
|
276
|
-
|
|
293
|
+
_context7.next = 5;
|
|
277
294
|
return options === null || options === void 0 ? void 0 : (_options$onSuccess5 = options.onSuccess) === null || _options$onSuccess5 === void 0 ? void 0 : _options$onSuccess5.call(options, res);
|
|
278
295
|
case 5:
|
|
279
|
-
return
|
|
296
|
+
return _context7.abrupt("return", res);
|
|
280
297
|
case 6:
|
|
281
298
|
case "end":
|
|
282
|
-
return
|
|
299
|
+
return _context7.stop();
|
|
283
300
|
}
|
|
284
|
-
},
|
|
301
|
+
}, _callee7, this);
|
|
285
302
|
}));
|
|
286
|
-
function deleteById(
|
|
303
|
+
function deleteById(_x11, _x12) {
|
|
287
304
|
return _deleteById.apply(this, arguments);
|
|
288
305
|
}
|
|
289
306
|
return deleteById;
|
|
290
307
|
}();
|
|
291
308
|
_proto["delete"] = /*#__PURE__*/function () {
|
|
292
|
-
var _delete2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function
|
|
309
|
+
var _delete2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee8(data, options) {
|
|
293
310
|
var _this$handleRequestCo7;
|
|
294
311
|
var config, arrayData, idValue, res, _options$onError6, _options$onSuccess6;
|
|
295
|
-
return _regeneratorRuntime.wrap(function (
|
|
296
|
-
while (1) switch (
|
|
312
|
+
return _regeneratorRuntime.wrap(function (_context8) {
|
|
313
|
+
while (1) switch (_context8.prev = _context8.next) {
|
|
297
314
|
case 0:
|
|
298
315
|
config = {};
|
|
299
|
-
|
|
316
|
+
_context8.next = 1;
|
|
300
317
|
return (_this$handleRequestCo7 = this.handleRequestConfig) === null || _this$handleRequestCo7 === void 0 ? void 0 : _this$handleRequestCo7.call(this, config);
|
|
301
318
|
case 1:
|
|
302
319
|
arrayData = [];
|
|
@@ -310,133 +327,133 @@ export var BaseRestApi = /*#__PURE__*/function () {
|
|
|
310
327
|
return !!item;
|
|
311
328
|
});
|
|
312
329
|
if (!(arrayData.length == 0)) {
|
|
313
|
-
|
|
330
|
+
_context8.next = 2;
|
|
314
331
|
break;
|
|
315
332
|
}
|
|
316
333
|
throw new Error("删除对象不可为空!");
|
|
317
334
|
case 2:
|
|
318
|
-
|
|
335
|
+
_context8.next = 3;
|
|
319
336
|
return this.request.post("remove", arrayData, config);
|
|
320
337
|
case 3:
|
|
321
|
-
res =
|
|
338
|
+
res = _context8.sent;
|
|
322
339
|
if (res.success) {
|
|
323
|
-
|
|
340
|
+
_context8.next = 5;
|
|
324
341
|
break;
|
|
325
342
|
}
|
|
326
343
|
this.showError("\u5220\u9664\u5931\u8D25!", res).then();
|
|
327
|
-
|
|
344
|
+
_context8.next = 4;
|
|
328
345
|
return options === null || options === void 0 ? void 0 : (_options$onError6 = options.onError) === null || _options$onError6 === void 0 ? void 0 : _options$onError6.call(options, res);
|
|
329
346
|
case 4:
|
|
330
|
-
|
|
347
|
+
_context8.next = 6;
|
|
331
348
|
break;
|
|
332
349
|
case 5:
|
|
333
|
-
|
|
350
|
+
_context8.next = 6;
|
|
334
351
|
return options === null || options === void 0 ? void 0 : (_options$onSuccess6 = options.onSuccess) === null || _options$onSuccess6 === void 0 ? void 0 : _options$onSuccess6.call(options, res);
|
|
335
352
|
case 6:
|
|
336
|
-
return
|
|
353
|
+
return _context8.abrupt("return", res);
|
|
337
354
|
case 7:
|
|
338
355
|
case "end":
|
|
339
|
-
return
|
|
356
|
+
return _context8.stop();
|
|
340
357
|
}
|
|
341
|
-
},
|
|
358
|
+
}, _callee8, this);
|
|
342
359
|
}));
|
|
343
|
-
function _delete(
|
|
360
|
+
function _delete(_x13, _x14) {
|
|
344
361
|
return _delete2.apply(this, arguments);
|
|
345
362
|
}
|
|
346
363
|
return _delete;
|
|
347
364
|
}();
|
|
348
365
|
_proto["export"] = /*#__PURE__*/function () {
|
|
349
|
-
var _export2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function
|
|
366
|
+
var _export2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee9(data, options) {
|
|
350
367
|
var _this$handleRequestCo8;
|
|
351
368
|
var config, res, _options$onError7, _options$onSuccess7;
|
|
352
|
-
return _regeneratorRuntime.wrap(function (
|
|
353
|
-
while (1) switch (
|
|
369
|
+
return _regeneratorRuntime.wrap(function (_context9) {
|
|
370
|
+
while (1) switch (_context9.prev = _context9.next) {
|
|
354
371
|
case 0:
|
|
355
372
|
config = {};
|
|
356
|
-
|
|
373
|
+
_context9.next = 1;
|
|
357
374
|
return (_this$handleRequestCo8 = this.handleRequestConfig) === null || _this$handleRequestCo8 === void 0 ? void 0 : _this$handleRequestCo8.call(this, config);
|
|
358
375
|
case 1:
|
|
359
|
-
|
|
376
|
+
_context9.next = 2;
|
|
360
377
|
return this.request.post("/export", data, config);
|
|
361
378
|
case 2:
|
|
362
|
-
res =
|
|
379
|
+
res = _context9.sent;
|
|
363
380
|
if (res.success) {
|
|
364
|
-
|
|
381
|
+
_context9.next = 4;
|
|
365
382
|
break;
|
|
366
383
|
}
|
|
367
384
|
this.showError("\u5BFC\u51FA\u5931\u8D25!", res).then();
|
|
368
|
-
|
|
385
|
+
_context9.next = 3;
|
|
369
386
|
return options === null || options === void 0 ? void 0 : (_options$onError7 = options.onError) === null || _options$onError7 === void 0 ? void 0 : _options$onError7.call(options, res);
|
|
370
387
|
case 3:
|
|
371
|
-
|
|
388
|
+
_context9.next = 5;
|
|
372
389
|
break;
|
|
373
390
|
case 4:
|
|
374
|
-
|
|
391
|
+
_context9.next = 5;
|
|
375
392
|
return options === null || options === void 0 ? void 0 : (_options$onSuccess7 = options.onSuccess) === null || _options$onSuccess7 === void 0 ? void 0 : _options$onSuccess7.call(options, res);
|
|
376
393
|
case 5:
|
|
377
|
-
return
|
|
394
|
+
return _context9.abrupt("return", res);
|
|
378
395
|
case 6:
|
|
379
396
|
case "end":
|
|
380
|
-
return
|
|
397
|
+
return _context9.stop();
|
|
381
398
|
}
|
|
382
|
-
},
|
|
399
|
+
}, _callee9, this);
|
|
383
400
|
}));
|
|
384
|
-
function _export(
|
|
401
|
+
function _export(_x15, _x16) {
|
|
385
402
|
return _export2.apply(this, arguments);
|
|
386
403
|
}
|
|
387
404
|
return _export;
|
|
388
405
|
}();
|
|
389
406
|
_proto["import"] = /*#__PURE__*/function () {
|
|
390
|
-
var _import2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function
|
|
407
|
+
var _import2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee0(data, options) {
|
|
391
408
|
var _this$handleRequestCo9;
|
|
392
409
|
var config, res, _options$onError8, _options$onSuccess8;
|
|
393
|
-
return _regeneratorRuntime.wrap(function (
|
|
394
|
-
while (1) switch (
|
|
410
|
+
return _regeneratorRuntime.wrap(function (_context0) {
|
|
411
|
+
while (1) switch (_context0.prev = _context0.next) {
|
|
395
412
|
case 0:
|
|
396
413
|
config = {};
|
|
397
|
-
|
|
414
|
+
_context0.next = 1;
|
|
398
415
|
return (_this$handleRequestCo9 = this.handleRequestConfig) === null || _this$handleRequestCo9 === void 0 ? void 0 : _this$handleRequestCo9.call(this, config);
|
|
399
416
|
case 1:
|
|
400
|
-
|
|
417
|
+
_context0.next = 2;
|
|
401
418
|
return this.request.post("import", data, config);
|
|
402
419
|
case 2:
|
|
403
|
-
res =
|
|
420
|
+
res = _context0.sent;
|
|
404
421
|
if (res.success) {
|
|
405
|
-
|
|
422
|
+
_context0.next = 4;
|
|
406
423
|
break;
|
|
407
424
|
}
|
|
408
425
|
this.showError("\u5BFC\u5165\u5931\u8D25!", res).then();
|
|
409
|
-
|
|
426
|
+
_context0.next = 3;
|
|
410
427
|
return options === null || options === void 0 ? void 0 : (_options$onError8 = options.onError) === null || _options$onError8 === void 0 ? void 0 : _options$onError8.call(options, res);
|
|
411
428
|
case 3:
|
|
412
|
-
|
|
429
|
+
_context0.next = 5;
|
|
413
430
|
break;
|
|
414
431
|
case 4:
|
|
415
|
-
|
|
432
|
+
_context0.next = 5;
|
|
416
433
|
return options === null || options === void 0 ? void 0 : (_options$onSuccess8 = options.onSuccess) === null || _options$onSuccess8 === void 0 ? void 0 : _options$onSuccess8.call(options, res);
|
|
417
434
|
case 5:
|
|
418
|
-
return
|
|
435
|
+
return _context0.abrupt("return", res);
|
|
419
436
|
case 6:
|
|
420
437
|
case "end":
|
|
421
|
-
return
|
|
438
|
+
return _context0.stop();
|
|
422
439
|
}
|
|
423
|
-
},
|
|
440
|
+
}, _callee0, this);
|
|
424
441
|
}));
|
|
425
|
-
function _import(
|
|
442
|
+
function _import(_x17, _x18) {
|
|
426
443
|
return _import2.apply(this, arguments);
|
|
427
444
|
}
|
|
428
445
|
return _import;
|
|
429
446
|
}();
|
|
430
447
|
_proto.showError = /*#__PURE__*/function () {
|
|
431
|
-
var _showError = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function
|
|
448
|
+
var _showError = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee1(type, res) {
|
|
432
449
|
var msg, props, _t;
|
|
433
|
-
return _regeneratorRuntime.wrap(function (
|
|
434
|
-
while (1) switch (
|
|
450
|
+
return _regeneratorRuntime.wrap(function (_context1) {
|
|
451
|
+
while (1) switch (_context1.prev = _context1.next) {
|
|
435
452
|
case 0:
|
|
436
453
|
msg = res.message;
|
|
437
|
-
|
|
454
|
+
_context1.prev = 1;
|
|
438
455
|
if (!msg) {
|
|
439
|
-
|
|
456
|
+
_context1.next = 4;
|
|
440
457
|
break;
|
|
441
458
|
}
|
|
442
459
|
props = JSON.parse(msg);
|
|
@@ -445,31 +462,31 @@ export var BaseRestApi = /*#__PURE__*/function () {
|
|
|
445
462
|
props.title = "" + this.title + type;
|
|
446
463
|
}
|
|
447
464
|
if (!(props.type == "message")) {
|
|
448
|
-
|
|
465
|
+
_context1.next = 2;
|
|
449
466
|
break;
|
|
450
467
|
}
|
|
451
468
|
_message.error(props);
|
|
452
|
-
return
|
|
469
|
+
return _context1.abrupt("return");
|
|
453
470
|
case 2:
|
|
454
471
|
if (!(props.type == "modal")) {
|
|
455
|
-
|
|
472
|
+
_context1.next = 3;
|
|
456
473
|
break;
|
|
457
474
|
}
|
|
458
475
|
_Modal.error(props);
|
|
459
|
-
return
|
|
476
|
+
return _context1.abrupt("return");
|
|
460
477
|
case 3:
|
|
461
478
|
if (!(props.type == "notification")) {
|
|
462
|
-
|
|
479
|
+
_context1.next = 4;
|
|
463
480
|
break;
|
|
464
481
|
}
|
|
465
482
|
_notification.error(props);
|
|
466
|
-
return
|
|
483
|
+
return _context1.abrupt("return");
|
|
467
484
|
case 4:
|
|
468
|
-
|
|
485
|
+
_context1.next = 6;
|
|
469
486
|
break;
|
|
470
487
|
case 5:
|
|
471
|
-
|
|
472
|
-
_t =
|
|
488
|
+
_context1.prev = 5;
|
|
489
|
+
_t = _context1["catch"](1);
|
|
473
490
|
console.error("" + this.title + type + (msg || ""));
|
|
474
491
|
_Modal.error({
|
|
475
492
|
title: "" + this.title + type,
|
|
@@ -481,11 +498,11 @@ export var BaseRestApi = /*#__PURE__*/function () {
|
|
|
481
498
|
});
|
|
482
499
|
case 6:
|
|
483
500
|
case "end":
|
|
484
|
-
return
|
|
501
|
+
return _context1.stop();
|
|
485
502
|
}
|
|
486
|
-
},
|
|
503
|
+
}, _callee1, this, [[1, 5]]);
|
|
487
504
|
}));
|
|
488
|
-
function showError(
|
|
505
|
+
function showError(_x19, _x20) {
|
|
489
506
|
return _showError.apply(this, arguments);
|
|
490
507
|
}
|
|
491
508
|
return showError;
|
|
@@ -507,16 +524,16 @@ export var RestApi = /*#__PURE__*/function (_BaseRestApi2) {
|
|
|
507
524
|
_inheritsLoose(RestApi, _BaseRestApi2);
|
|
508
525
|
var _proto2 = RestApi.prototype;
|
|
509
526
|
_proto2.handleRequestConfig = /*#__PURE__*/function () {
|
|
510
|
-
var _handleRequestConfig = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function
|
|
511
|
-
return _regeneratorRuntime.wrap(function (
|
|
512
|
-
while (1) switch (
|
|
527
|
+
var _handleRequestConfig = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee10(config) {
|
|
528
|
+
return _regeneratorRuntime.wrap(function (_context10) {
|
|
529
|
+
while (1) switch (_context10.prev = _context10.next) {
|
|
513
530
|
case 0:
|
|
514
531
|
case "end":
|
|
515
|
-
return
|
|
532
|
+
return _context10.stop();
|
|
516
533
|
}
|
|
517
|
-
},
|
|
534
|
+
}, _callee10);
|
|
518
535
|
}));
|
|
519
|
-
function handleRequestConfig(
|
|
536
|
+
function handleRequestConfig(_x21) {
|
|
520
537
|
return _handleRequestConfig.apply(this, arguments);
|
|
521
538
|
}
|
|
522
539
|
return handleRequestConfig;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function loadDts(): Promise<any
|
|
1
|
+
export declare function loadDts(): Promise<any>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
declare function cacheLoadSchemas(): Promise<any>;
|