@cloudbase/lowcode-builder 1.8.14 → 1.8.15

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloudbase/lowcode-builder",
3
- "version": "1.8.14",
3
+ "version": "1.8.15",
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",
@@ -38,8 +38,8 @@
38
38
  "url": "https://github.com/TencentCloudBase/cloudbase-framework/issues"
39
39
  },
40
40
  "dependencies": {
41
- "@cloudbase/cals": "^1.0.9",
42
- "@cloudbase/lowcode-generator": "^1.8.5",
41
+ "@cloudbase/cals": "^1.0.10",
42
+ "@cloudbase/lowcode-generator": "^1.8.6",
43
43
  "axios": "^0.21.0",
44
44
  "browserfs": "^1.4.3",
45
45
  "browserify-zlib": "^0.2.0",
@@ -551,7 +551,7 @@
551
551
  crossorigin
552
552
  src="<%=
553
553
  cdnEndpoints.cdngo
554
- %>/lcap/lcap-resource-cdngo/-/0.1.4/_files/static/weda-render/main.4e08e64803c057479d66.bundle.js"
554
+ %>/lcap/lcap-resource-cdngo/-/0.1.4/_files/static/weda-render/main.3782fa615eda8e028fe2.bundle.js"
555
555
  ></script>
556
556
  </body>
557
557
  </html>
@@ -12,7 +12,6 @@ export class Query {
12
12
  this._observableValue = observable({ data: null, error: null });
13
13
  this._eventHandlerMap = {};
14
14
  const { looseError = false } = options;
15
- const { $w } = context;
16
15
  this._schema = schema;
17
16
  this._context = context;
18
17
  if (this._schema?.trigger === 'auto') {
@@ -32,22 +31,9 @@ export class Query {
32
31
  ),
33
32
  );
34
33
  }
35
- const baseParam = {
36
- dataSourceName: this._schema.dataSourceName,
37
- };
38
- if (this._schema?.type === 'sql') {
39
- baseParam.sqlTemplateId = this._schema.methodName;
40
- } else {
41
- baseParam.methodName = this._schema.methodName;
42
- }
43
34
  this._paramsRef.current = this._schema.data;
44
35
  this._dataBinds = this._schema.dataBinds;
45
- this._action = async (data) => {
46
- return $w.cloud.callDataSource({
47
- ...baseParam,
48
- params: data,
49
- });
50
- };
36
+ this._action = this._schema.handler;
51
37
  this._eventHandlerMap = Object.entries(
52
38
  createEventHandlers(this._schema.eventHandlers || {}, {
53
39
  looseError: looseError,
@@ -63,25 +49,6 @@ export class Query {
63
49
  _getInstance: () => this._context.$page || this._context.$app,
64
50
  },
65
51
  );
66
- // this._emit = async (trigger, eventData, originalEvent?) =>
67
- // generateEmit($w)(
68
- // trigger,
69
- // generateListnerInstances(
70
- // {
71
- // $app,
72
- // $page,
73
- // actionsMap: (this._context as any).actionsMap,
74
- // },
75
- // this._schema.listeners || [],
76
- // ),
77
- // eventData,
78
- // {},
79
- // originalEvent,
80
- // {},
81
- // {},
82
- // $w.page.id,
83
- // true,
84
- // );
85
52
  return this;
86
53
  }
87
54
  get id() {
@@ -153,7 +120,7 @@ export class Query {
153
120
  },
154
121
  $w: this._context.$w,
155
122
  // may be additional scope
156
- })?.params;
123
+ });
157
124
  }
158
125
  async _emit(eventName, data) {
159
126
  return this._eventHandlerMap[getMpEventHandlerName(this.id, eventName)]?.(
@@ -177,7 +177,7 @@ export function createEventHandlers(
177
177
  if (app.__internal__?.env?.type !== 'production') {
178
178
  app.showModal({
179
179
  title: `事件响应失败`,
180
- content: error.message || '',
180
+ content: error.message || error.errMsg || '',
181
181
  showCancel: false,
182
182
  });
183
183
  } else {
@@ -59,8 +59,9 @@ const dataBinds = {<% Object.entries(dataBinds).map(([id, widgetBinds])=>{%>
59
59
  }
60
60
 
61
61
  const query = {<% Object.entries(query).map(([id, item])=>{%>
62
- <%= id %>: { <% const {dataBinds={}, eventHandlers, ...rest } = item %>
62
+ <%= id %>: { <% const {dataBinds={}, eventHandlers, handler, ...rest } = item %>
63
63
  ...(<%= stringifyObj(rest, {depth: null}) %>),
64
+ handler: <%= handler %>,
64
65
  dataBinds: {<%= printBoundData(dataBinds) %>},
65
66
  eventHandlers: {<% printEventHandler(eventHandlers) %>}
66
67
  },<%}) %>