@cloudbase/lowcode-builder 1.8.52 → 1.8.53
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/lib/builder/mp/materials.js +1 -1
- package/package.json +2 -2
- package/template/html/index.html.ejs +5 -4
- package/template/mp/app.js +11 -5
- package/template/mp/common/placeholder/index.json +4 -0
- package/template/mp/common/placeholder/index.ts +1 -0
- package/template/mp/common/placeholder/index.wxml +1 -0
- package/template/mp/common/placeholder/index.wxss +1 -0
- package/template/mp/common/query.js +12 -4
- package/template/mp/common/weapp-page.js +11 -6
|
@@ -296,7 +296,7 @@ async function generateCompositeComponent(ctx, compositedComp, compLibCommonReso
|
|
|
296
296
|
.map((m) => m.name),
|
|
297
297
|
eventHandlers: (0, util_3.createEventHandlers)(compositeCtx, componentInstances, weapps_core_1.COMPONENT_API_PREFIX),
|
|
298
298
|
// protectEventKeys: builtinMpEvents,
|
|
299
|
-
emitEvents: compositedComp.emitEvents.map((evt) => evt.eventName),
|
|
299
|
+
emitEvents: (compositedComp.emitEvents || []).map((evt) => evt.eventName),
|
|
300
300
|
widgetProps: (0, util_3.createWidgetProps)(compositeCtx, componentInstances),
|
|
301
301
|
compApi: weapps_core_1.COMPONENT_API_PREFIX,
|
|
302
302
|
jsonSchemaType2jsClass: mp_1.jsonSchemaType2jsClass,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudbase/lowcode-builder",
|
|
3
|
-
"version": "1.8.
|
|
3
|
+
"version": "1.8.53",
|
|
4
4
|
"description": "云开发 Tencent CloudBase Framework Low Code Plugin,将低码配置生成完整项目并一键部署云开发资源。",
|
|
5
5
|
"author": "yhsunshining@gmail.com",
|
|
6
6
|
"homepage": "https://github.com/TencentCloudBase/cloudbase-framework#readme",
|
|
@@ -89,4 +89,4 @@
|
|
|
89
89
|
"webpack-dev-server": "^4.7.3",
|
|
90
90
|
"worker-loader": "^3.0.8"
|
|
91
91
|
}
|
|
92
|
-
}
|
|
92
|
+
}
|
|
@@ -450,9 +450,7 @@
|
|
|
450
450
|
</div>
|
|
451
451
|
<% }%>
|
|
452
452
|
</div>
|
|
453
|
-
<%
|
|
454
|
-
<script src="<%=jsApi %>"></script>
|
|
455
|
-
<% })%> <% if(canUseVite){ %>
|
|
453
|
+
<% if(canUseVite){ %>
|
|
456
454
|
<script type="module" src="/src/index.jsx"></script>
|
|
457
455
|
<% } %> <% if(!isAdminPortal){ %>
|
|
458
456
|
<script src="/weda-config/weda-private.js"></script>
|
|
@@ -538,11 +536,14 @@
|
|
|
538
536
|
cdnEndpoints.cdngo
|
|
539
537
|
%>/lcap/lcap-resource-cdngo/-/release/_url/qcloud/lowcode/static/ide/assets/js/babel.min.js"
|
|
540
538
|
></script>
|
|
539
|
+
<% jsApis.forEach(function(jsApi){%>
|
|
540
|
+
<script src="<%=jsApi %>"></script>
|
|
541
|
+
<% })%>
|
|
541
542
|
<script
|
|
542
543
|
crossorigin
|
|
543
544
|
src="<%=
|
|
544
545
|
cdnEndpoints.cdngo
|
|
545
|
-
%>/lcap/lcap-resource-cdngo/-/0.1.4/_files/static/weda-render/main.
|
|
546
|
+
%>/lcap/lcap-resource-cdngo/-/0.1.4/_files/static/weda-render/main.24b6f4f560a5d284c4ff.bundle.js"
|
|
546
547
|
></script>
|
|
547
548
|
</body>
|
|
548
549
|
</html>
|
package/template/mp/app.js
CHANGED
|
@@ -131,11 +131,17 @@ App({
|
|
|
131
131
|
} finally {
|
|
132
132
|
for (const queryId in app.dataset?.query || {}) {
|
|
133
133
|
if (app.dataset.query[queryId]?._schema?.trigger === 'auto') {
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
134
|
+
/**
|
|
135
|
+
* query 初始化不阻塞生命周期
|
|
136
|
+
*/
|
|
137
|
+
Promise.resolve()
|
|
138
|
+
.then(async () => {
|
|
139
|
+
await app.dataset?.query?.[queryId]?.initPromise;
|
|
140
|
+
return app.dataset?.query?.[queryId]?.trigger?.();
|
|
141
|
+
})
|
|
142
|
+
.catch((e) => {
|
|
143
|
+
console.error(`query ${queryId} 初始化失败:`, e);
|
|
144
|
+
});
|
|
139
145
|
}
|
|
140
146
|
}
|
|
141
147
|
resolve();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Component({})
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<block></block>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/* common/placeholder/index.wxss */
|
|
@@ -9,7 +9,8 @@ export class Query {
|
|
|
9
9
|
#disposes = [];
|
|
10
10
|
#dataBinds = {};
|
|
11
11
|
#triggered = false;
|
|
12
|
-
|
|
12
|
+
initPromise;
|
|
13
|
+
#initedResolver = (value) => {};
|
|
13
14
|
#paramsRef = observable({ current: null });
|
|
14
15
|
#currentRequestKey = null;
|
|
15
16
|
#observableValue = observable({ data: null, error: null, isFetching: false });
|
|
@@ -22,24 +23,31 @@ export class Query {
|
|
|
22
23
|
trigger: schema.trigger,
|
|
23
24
|
};
|
|
24
25
|
this.#context = context;
|
|
26
|
+
|
|
27
|
+
this.initPromise = new Promise((resolve) => {
|
|
28
|
+
this.#initedResolver = resolve;
|
|
29
|
+
});
|
|
30
|
+
|
|
25
31
|
if (this.#schema?.trigger === 'auto') {
|
|
26
32
|
this.#disposes.push(
|
|
27
33
|
autorun(
|
|
28
34
|
(r) => {
|
|
29
35
|
try {
|
|
30
36
|
const data = this.#resolveParams();
|
|
31
|
-
if (this.#
|
|
37
|
+
if (this.#triggered) {
|
|
32
38
|
this.#debounceTrigger(data);
|
|
33
39
|
}
|
|
34
40
|
} catch (e) {
|
|
35
41
|
console.error(e);
|
|
36
42
|
} finally {
|
|
37
|
-
this.#
|
|
43
|
+
this.#initedResolver(true);
|
|
38
44
|
}
|
|
39
45
|
},
|
|
40
46
|
{ delay: 50 },
|
|
41
47
|
),
|
|
42
48
|
);
|
|
49
|
+
} else {
|
|
50
|
+
this.#initedResolver(true);
|
|
43
51
|
}
|
|
44
52
|
this.#paramsRef.current = this.#schema.data;
|
|
45
53
|
this.#dataBinds = Object.entries(this.#schema.dataBinds || {}).reduce((map, [prop, fn]) => {
|
|
@@ -52,7 +60,7 @@ export class Query {
|
|
|
52
60
|
const { $w } = this.#context;
|
|
53
61
|
|
|
54
62
|
this.#action =
|
|
55
|
-
this.#schema.type === 'sql'
|
|
63
|
+
this.#schema.type === 'sql' || this.#schema.type === 'sqlserver'
|
|
56
64
|
? async function (data) {
|
|
57
65
|
const Data = await $w.cloud.callWedaApi({
|
|
58
66
|
action: 'RunPluginQuery',
|
|
@@ -225,12 +225,17 @@ export function createPage({
|
|
|
225
225
|
// eslint-disable-next-line no-restricted-syntax
|
|
226
226
|
for (const queryId in $page.dataset?.query || {}) {
|
|
227
227
|
if ($page.dataset.query[queryId]?._schema?.trigger === 'auto') {
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
228
|
+
/**
|
|
229
|
+
* query 初始化不阻塞生命周期
|
|
230
|
+
*/
|
|
231
|
+
Promise.resolve()
|
|
232
|
+
.then(async () => {
|
|
233
|
+
await $page.dataset.query[queryId]?.initPromise;
|
|
234
|
+
return $page.dataset.query[queryId].trigger();
|
|
235
|
+
})
|
|
236
|
+
.catch((e) => {
|
|
237
|
+
console.error(`query ${queryId} 初始化失败:`, e);
|
|
238
|
+
});
|
|
234
239
|
}
|
|
235
240
|
}
|
|
236
241
|
resolve();
|