@zhubangyun/lowcode-core 5.4.101 → 5.4.103
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/utils/cache/index.js +2 -2
- package/es/utils/common/SingletonInstanceMap.js +18 -16
- package/es/utils/form/form.api.js +3 -2
- package/es/utils/index.d.ts +0 -2
- package/es/utils/index.js +0 -2
- package/es/utils/page/page.form.d.ts +2 -2
- package/lib/utils/cache/index.js +2 -2
- package/lib/utils/common/SingletonInstanceMap.js +18 -16
- package/lib/utils/form/form.api.js +3 -2
- package/lib/utils/index.d.ts +0 -2
- package/lib/utils/index.js +0 -2
- package/lib/utils/page/page.form.d.ts +2 -2
- package/package.json +1 -1
package/es/utils/cache/index.js
CHANGED
|
@@ -2,9 +2,9 @@ import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
|
2
2
|
import _inheritsLoose from "@babel/runtime/helpers/inheritsLoose";
|
|
3
3
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
4
4
|
import { SingletonInstanceMap } from "../common/SingletonInstanceMap";
|
|
5
|
-
import { request } from "../api";
|
|
6
5
|
import { RestFormApi } from "../form/form.api";
|
|
7
6
|
import { handleFormSchema } from "./schema";
|
|
7
|
+
import { apiRequest } from "../api";
|
|
8
8
|
export var SchemaCache = /*#__PURE__*/function (_SingletonInstanceMap) {
|
|
9
9
|
function SchemaCache() {
|
|
10
10
|
return _SingletonInstanceMap.apply(this, arguments) || this;
|
|
@@ -19,7 +19,7 @@ export var SchemaCache = /*#__PURE__*/function (_SingletonInstanceMap) {
|
|
|
19
19
|
case 0:
|
|
20
20
|
mock = options.mock, pageId = options.pageId;
|
|
21
21
|
_context.next = 3;
|
|
22
|
-
return
|
|
22
|
+
return apiRequest.get("pages/" + pageId + "/schema", {
|
|
23
23
|
params: {
|
|
24
24
|
mock: mock
|
|
25
25
|
}
|
|
@@ -12,15 +12,16 @@ export var SingletonInstanceMap = /*#__PURE__*/function () {
|
|
|
12
12
|
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
13
13
|
while (1) switch (_context2.prev = _context2.next) {
|
|
14
14
|
case 0:
|
|
15
|
+
console.log("getInstance", key, options);
|
|
15
16
|
self = this;
|
|
16
17
|
if (!this.valueMap.has(key)) {
|
|
17
|
-
_context2.next =
|
|
18
|
+
_context2.next = 6;
|
|
18
19
|
break;
|
|
19
20
|
}
|
|
20
21
|
return _context2.abrupt("return", Promise.resolve(this.valueMap.get(key)));
|
|
21
|
-
case
|
|
22
|
+
case 6:
|
|
22
23
|
if (!this.lockMap.get(key)) {
|
|
23
|
-
_context2.next =
|
|
24
|
+
_context2.next = 10;
|
|
24
25
|
break;
|
|
25
26
|
}
|
|
26
27
|
return _context2.abrupt("return", new Promise(function (resolve, reject) {
|
|
@@ -34,31 +35,32 @@ export var SingletonInstanceMap = /*#__PURE__*/function () {
|
|
|
34
35
|
return _context.stop();
|
|
35
36
|
}
|
|
36
37
|
}, _callee);
|
|
37
|
-
})),
|
|
38
|
+
})), 500);
|
|
38
39
|
}));
|
|
39
|
-
case
|
|
40
|
-
_context2.prev =
|
|
40
|
+
case 10:
|
|
41
|
+
_context2.prev = 10;
|
|
41
42
|
this.lockMap.set(key, true);
|
|
42
|
-
|
|
43
|
+
console.log("getInstance.createInstance", key, options);
|
|
44
|
+
_context2.next = 15;
|
|
43
45
|
return this.createInstance(key, options);
|
|
44
|
-
case
|
|
46
|
+
case 15:
|
|
45
47
|
value = _context2.sent;
|
|
46
48
|
this.valueMap.set(key, value);
|
|
47
49
|
this.lockMap.set(key, false);
|
|
48
50
|
return _context2.abrupt("return", Promise.resolve(value));
|
|
49
|
-
case
|
|
50
|
-
_context2.prev =
|
|
51
|
-
_context2.t0 = _context2["catch"](
|
|
51
|
+
case 21:
|
|
52
|
+
_context2.prev = 21;
|
|
53
|
+
_context2.t0 = _context2["catch"](10);
|
|
52
54
|
throw _context2.t0;
|
|
53
|
-
case
|
|
54
|
-
_context2.prev =
|
|
55
|
+
case 24:
|
|
56
|
+
_context2.prev = 24;
|
|
55
57
|
this.lockMap.set(key, false);
|
|
56
|
-
return _context2.finish(
|
|
57
|
-
case
|
|
58
|
+
return _context2.finish(24);
|
|
59
|
+
case 27:
|
|
58
60
|
case "end":
|
|
59
61
|
return _context2.stop();
|
|
60
62
|
}
|
|
61
|
-
}, _callee2, this, [[
|
|
63
|
+
}, _callee2, this, [[10, 21, 24, 27]]);
|
|
62
64
|
}));
|
|
63
65
|
function getInstance(_x, _x2) {
|
|
64
66
|
return _getInstance.apply(this, arguments);
|
|
@@ -44,9 +44,10 @@ export var RestFormApi = /*#__PURE__*/function (_RestApi) {
|
|
|
44
44
|
_context.prev = 12;
|
|
45
45
|
_context.t0 = _context["catch"](4);
|
|
46
46
|
console.log("获取schema失败!", {
|
|
47
|
-
|
|
47
|
+
formId: this.formId,
|
|
48
|
+
field: this.fieldId,
|
|
48
49
|
mock: this.mock
|
|
49
|
-
});
|
|
50
|
+
}, _context.t0);
|
|
50
51
|
throw _context.t0;
|
|
51
52
|
case 16:
|
|
52
53
|
return _context.abrupt("return", this.initialized);
|
package/es/utils/index.d.ts
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import * as cache from "./cache";
|
|
2
1
|
import * as common from "./common";
|
|
3
2
|
import * as api from "./api";
|
|
4
3
|
import * as designer from "./designer";
|
|
5
4
|
import * as page from "./page";
|
|
6
5
|
declare const _default: {
|
|
7
6
|
api: typeof api;
|
|
8
|
-
cache: typeof cache;
|
|
9
7
|
page: typeof page;
|
|
10
8
|
designer: typeof designer;
|
|
11
9
|
common: typeof common;
|
package/es/utils/index.js
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import * as cache from "./cache";
|
|
2
1
|
import * as common from "./common";
|
|
3
2
|
import * as api from "./api";
|
|
4
3
|
import * as designer from "./designer";
|
|
5
4
|
import * as page from "./page";
|
|
6
5
|
export default {
|
|
7
6
|
api: api,
|
|
8
|
-
cache: cache,
|
|
9
7
|
page: page,
|
|
10
8
|
designer: designer,
|
|
11
9
|
common: common
|
package/lib/utils/cache/index.js
CHANGED
|
@@ -7,9 +7,9 @@ var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"))
|
|
|
7
7
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
8
8
|
var _inheritsLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/inheritsLoose"));
|
|
9
9
|
var _SingletonInstanceMap3 = require("../common/SingletonInstanceMap");
|
|
10
|
-
var _api = require("../api");
|
|
11
10
|
var _form = require("../form/form.api");
|
|
12
11
|
var _schema = require("./schema");
|
|
12
|
+
var _api = require("../api");
|
|
13
13
|
var SchemaCache = exports.SchemaCache = /*#__PURE__*/function (_SingletonInstanceMap) {
|
|
14
14
|
function SchemaCache() {
|
|
15
15
|
return _SingletonInstanceMap.apply(this, arguments) || this;
|
|
@@ -24,7 +24,7 @@ var SchemaCache = exports.SchemaCache = /*#__PURE__*/function (_SingletonInstanc
|
|
|
24
24
|
case 0:
|
|
25
25
|
mock = options.mock, pageId = options.pageId;
|
|
26
26
|
_context.next = 3;
|
|
27
|
-
return _api.
|
|
27
|
+
return _api.apiRequest.get("pages/" + pageId + "/schema", {
|
|
28
28
|
params: {
|
|
29
29
|
mock: mock
|
|
30
30
|
}
|
|
@@ -17,15 +17,16 @@ var SingletonInstanceMap = exports.SingletonInstanceMap = /*#__PURE__*/function
|
|
|
17
17
|
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
|
18
18
|
while (1) switch (_context2.prev = _context2.next) {
|
|
19
19
|
case 0:
|
|
20
|
+
console.log("getInstance", key, options);
|
|
20
21
|
self = this;
|
|
21
22
|
if (!this.valueMap.has(key)) {
|
|
22
|
-
_context2.next =
|
|
23
|
+
_context2.next = 6;
|
|
23
24
|
break;
|
|
24
25
|
}
|
|
25
26
|
return _context2.abrupt("return", Promise.resolve(this.valueMap.get(key)));
|
|
26
|
-
case
|
|
27
|
+
case 6:
|
|
27
28
|
if (!this.lockMap.get(key)) {
|
|
28
|
-
_context2.next =
|
|
29
|
+
_context2.next = 10;
|
|
29
30
|
break;
|
|
30
31
|
}
|
|
31
32
|
return _context2.abrupt("return", new Promise(function (resolve, reject) {
|
|
@@ -39,31 +40,32 @@ var SingletonInstanceMap = exports.SingletonInstanceMap = /*#__PURE__*/function
|
|
|
39
40
|
return _context.stop();
|
|
40
41
|
}
|
|
41
42
|
}, _callee);
|
|
42
|
-
})),
|
|
43
|
+
})), 500);
|
|
43
44
|
}));
|
|
44
|
-
case
|
|
45
|
-
_context2.prev =
|
|
45
|
+
case 10:
|
|
46
|
+
_context2.prev = 10;
|
|
46
47
|
this.lockMap.set(key, true);
|
|
47
|
-
|
|
48
|
+
console.log("getInstance.createInstance", key, options);
|
|
49
|
+
_context2.next = 15;
|
|
48
50
|
return this.createInstance(key, options);
|
|
49
|
-
case
|
|
51
|
+
case 15:
|
|
50
52
|
value = _context2.sent;
|
|
51
53
|
this.valueMap.set(key, value);
|
|
52
54
|
this.lockMap.set(key, false);
|
|
53
55
|
return _context2.abrupt("return", Promise.resolve(value));
|
|
54
|
-
case
|
|
55
|
-
_context2.prev =
|
|
56
|
-
_context2.t0 = _context2["catch"](
|
|
56
|
+
case 21:
|
|
57
|
+
_context2.prev = 21;
|
|
58
|
+
_context2.t0 = _context2["catch"](10);
|
|
57
59
|
throw _context2.t0;
|
|
58
|
-
case
|
|
59
|
-
_context2.prev =
|
|
60
|
+
case 24:
|
|
61
|
+
_context2.prev = 24;
|
|
60
62
|
this.lockMap.set(key, false);
|
|
61
|
-
return _context2.finish(
|
|
62
|
-
case
|
|
63
|
+
return _context2.finish(24);
|
|
64
|
+
case 27:
|
|
63
65
|
case "end":
|
|
64
66
|
return _context2.stop();
|
|
65
67
|
}
|
|
66
|
-
}, _callee2, this, [[
|
|
68
|
+
}, _callee2, this, [[10, 21, 24, 27]]);
|
|
67
69
|
}));
|
|
68
70
|
function getInstance(_x, _x2) {
|
|
69
71
|
return _getInstance.apply(this, arguments);
|
|
@@ -49,9 +49,10 @@ var RestFormApi = exports.RestFormApi = /*#__PURE__*/function (_RestApi) {
|
|
|
49
49
|
_context.prev = 12;
|
|
50
50
|
_context.t0 = _context["catch"](4);
|
|
51
51
|
console.log("获取schema失败!", {
|
|
52
|
-
|
|
52
|
+
formId: this.formId,
|
|
53
|
+
field: this.fieldId,
|
|
53
54
|
mock: this.mock
|
|
54
|
-
});
|
|
55
|
+
}, _context.t0);
|
|
55
56
|
throw _context.t0;
|
|
56
57
|
case 16:
|
|
57
58
|
return _context.abrupt("return", this.initialized);
|
package/lib/utils/index.d.ts
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import * as cache from "./cache";
|
|
2
1
|
import * as common from "./common";
|
|
3
2
|
import * as api from "./api";
|
|
4
3
|
import * as designer from "./designer";
|
|
5
4
|
import * as page from "./page";
|
|
6
5
|
declare const _default: {
|
|
7
6
|
api: typeof api;
|
|
8
|
-
cache: typeof cache;
|
|
9
7
|
page: typeof page;
|
|
10
8
|
designer: typeof designer;
|
|
11
9
|
common: typeof common;
|
package/lib/utils/index.js
CHANGED
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
4
|
exports["default"] = void 0;
|
|
5
|
-
var cache = _interopRequireWildcard(require("./cache"));
|
|
6
5
|
var common = _interopRequireWildcard(require("./common"));
|
|
7
6
|
var api = _interopRequireWildcard(require("./api"));
|
|
8
7
|
var designer = _interopRequireWildcard(require("./designer"));
|
|
@@ -11,7 +10,6 @@ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return
|
|
|
11
10
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
|
12
11
|
var _default = exports["default"] = {
|
|
13
12
|
api: api,
|
|
14
|
-
cache: cache,
|
|
15
13
|
page: page,
|
|
16
14
|
designer: designer,
|
|
17
15
|
common: common
|