Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit0fef66b

Browse files
fix: query fails when trigger on page load and using comp method inside
1 parent7589be4 commit0fef66b

File tree

2 files changed

+122
-113
lines changed

2 files changed

+122
-113
lines changed

‎client/packages/lowcoder-core/lib/index.js‎

Lines changed: 117 additions & 112 deletions
Original file line numberDiff line numberDiff line change
@@ -1,118 +1,118 @@
11
import _ from 'lodash';
22
import { serialize, compile, middleware, prefixer, stringify } from 'stylis';
33

4-
/******************************************************************************
5-
Copyright (c) Microsoft Corporation.
6-
7-
Permission to use, copy, modify, and/or distribute this software for any
8-
purpose with or without fee is hereby granted.
9-
10-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
11-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
12-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
13-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
14-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
15-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
16-
PERFORMANCE OF THIS SOFTWARE.
17-
***************************************************************************** */
18-
/* global Reflect, Promise, SuppressedError, Symbol */
19-
20-
var extendStatics = function(d, b) {
21-
extendStatics = Object.setPrototypeOf ||
22-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
23-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
24-
return extendStatics(d, b);
25-
};
26-
27-
function __extends(d, b) {
28-
if (typeof b !== "function" && b !== null)
29-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
30-
extendStatics(d, b);
31-
function __() { this.constructor = d; }
32-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
33-
}
34-
35-
var __assign = function() {
36-
__assign = Object.assign || function __assign(t) {
37-
for (var s, i = 1, n = arguments.length; i < n; i++) {
38-
s = arguments[i];
39-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
40-
}
41-
return t;
42-
};
43-
return __assign.apply(this, arguments);
44-
};
45-
46-
function __rest(s, e) {
47-
var t = {};
48-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
49-
t[p] = s[p];
50-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
51-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
52-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
53-
t[p[i]] = s[p[i]];
54-
}
55-
return t;
56-
}
57-
58-
function __decorate(decorators, target, key, desc) {
59-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
60-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
61-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
62-
return c > 3 && r && Object.defineProperty(target, key, r), r;
63-
}
64-
65-
function __awaiter(thisArg, _arguments, P, generator) {
66-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
67-
return new (P || (P = Promise))(function (resolve, reject) {
68-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
69-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
70-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
71-
step((generator = generator.apply(thisArg, _arguments || [])).next());
72-
});
73-
}
74-
75-
function __generator(thisArg, body) {
76-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
77-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
78-
function verb(n) { return function (v) { return step([n, v]); }; }
79-
function step(op) {
80-
if (f) throw new TypeError("Generator is already executing.");
81-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
82-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
83-
if (y = 0, t) op = [op[0] & 2, t.value];
84-
switch (op[0]) {
85-
case 0: case 1: t = op; break;
86-
case 4: _.label++; return { value: op[1], done: false };
87-
case 5: _.label++; y = op[1]; op = [0]; continue;
88-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
89-
default:
90-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
91-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
92-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
93-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
94-
if (t[2]) _.ops.pop();
95-
_.trys.pop(); continue;
96-
}
97-
op = body.call(thisArg, _);
98-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
99-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
100-
}
101-
}
102-
103-
function __spreadArray(to, from, pack) {
104-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
105-
if (ar || !(i in from)) {
106-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
107-
ar[i] = from[i];
108-
}
109-
}
110-
return to.concat(ar || Array.prototype.slice.call(from));
111-
}
112-
113-
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
114-
var e = new Error(message);
115-
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
4+
/******************************************************************************
5+
Copyright (c) Microsoft Corporation.
6+
7+
Permission to use, copy, modify, and/or distribute this software for any
8+
purpose with or without fee is hereby granted.
9+
10+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
11+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
12+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
13+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
14+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
15+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
16+
PERFORMANCE OF THIS SOFTWARE.
17+
***************************************************************************** */
18+
/* global Reflect, Promise, SuppressedError, Symbol */
19+
20+
var extendStatics = function(d, b) {
21+
extendStatics = Object.setPrototypeOf ||
22+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
23+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
24+
return extendStatics(d, b);
25+
};
26+
27+
function __extends(d, b) {
28+
if (typeof b !== "function" && b !== null)
29+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
30+
extendStatics(d, b);
31+
function __() { this.constructor = d; }
32+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
33+
}
34+
35+
var __assign = function() {
36+
__assign = Object.assign || function __assign(t) {
37+
for (var s, i = 1, n = arguments.length; i < n; i++) {
38+
s = arguments[i];
39+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
40+
}
41+
return t;
42+
};
43+
return __assign.apply(this, arguments);
44+
};
45+
46+
function __rest(s, e) {
47+
var t = {};
48+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
49+
t[p] = s[p];
50+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
51+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
52+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
53+
t[p[i]] = s[p[i]];
54+
}
55+
return t;
56+
}
57+
58+
function __decorate(decorators, target, key, desc) {
59+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
60+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
61+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
62+
return c > 3 && r && Object.defineProperty(target, key, r), r;
63+
}
64+
65+
function __awaiter(thisArg, _arguments, P, generator) {
66+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
67+
return new (P || (P = Promise))(function (resolve, reject) {
68+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
69+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
70+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
71+
step((generator = generator.apply(thisArg, _arguments || [])).next());
72+
});
73+
}
74+
75+
function __generator(thisArg, body) {
76+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
77+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
78+
function verb(n) { return function (v) { return step([n, v]); }; }
79+
function step(op) {
80+
if (f) throw new TypeError("Generator is already executing.");
81+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
82+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
83+
if (y = 0, t) op = [op[0] & 2, t.value];
84+
switch (op[0]) {
85+
case 0: case 1: t = op; break;
86+
case 4: _.label++; return { value: op[1], done: false };
87+
case 5: _.label++; y = op[1]; op = [0]; continue;
88+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
89+
default:
90+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
91+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
92+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
93+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
94+
if (t[2]) _.ops.pop();
95+
_.trys.pop(); continue;
96+
}
97+
op = body.call(thisArg, _);
98+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
99+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
100+
}
101+
}
102+
103+
function __spreadArray(to, from, pack) {
104+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
105+
if (ar || !(i in from)) {
106+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
107+
ar[i] = from[i];
108+
}
109+
}
110+
return to.concat(ar || Array.prototype.slice.call(from));
111+
}
112+
113+
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
114+
var e = new Error(message);
115+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
116116
};
117117

118118
function isEqualArgs(args, cacheArgs, equals) {
@@ -1776,6 +1776,11 @@ var CodeNode = /** @class */ (function (_super) {
17761776
value.triggerType === "manual") {
17771777
return;
17781778
}
1779+
// wait for lazy loaded comps to load before executing query on page load
1780+
if (!Object.keys(value).length) {
1781+
isFetching_1 = true;
1782+
ready_1 = false;
1783+
}
17791784
if (_.has(value, IS_FETCHING_FIELD)) {
17801785
isFetching_1 = isFetching_1 || value.isFetching === true;
17811786
}

‎client/packages/lowcoder-core/src/eval/codeNode.tsx‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,11 @@ export class CodeNode extends AbstractNode<ValueAndMsg<unknown>> {
172172
){
173173
return;
174174
}
175-
175+
// wait for lazy loaded comps to load before executing query on page load
176+
if(!Object.keys(value).length){
177+
isFetching=true;
178+
ready=false;
179+
}
176180
if(_.has(value,IS_FETCHING_FIELD)){
177181
isFetching=isFetching||value.isFetching===true;
178182
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp