@meta2d/core 1.0.97 → 1.0.99

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/src/core.js CHANGED
@@ -542,10 +542,18 @@ export class Meta2d {
542
542
  window.parent.postMessage(JSON.stringify({ name: e.value, data: value }), '*');
543
543
  return;
544
544
  };
545
- this.events[EventAction.Message] = (pen, e) => {
545
+ this.events[EventAction.Message] = (pen, e, params) => {
546
+ let theme = e.params;
547
+ let content = e.value;
548
+ if (!content && params && params.type === 'http') {
549
+ content = params.error.statusText;
550
+ if (!theme) {
551
+ theme = 'error';
552
+ }
553
+ }
546
554
  this.message({
547
- theme: e.params,
548
- content: e.value,
555
+ theme,
556
+ content,
549
557
  ...e.extend,
550
558
  });
551
559
  };
@@ -782,6 +790,9 @@ export class Meta2d {
782
790
  }
783
791
  console.info('http消息发送成功');
784
792
  }
793
+ else {
794
+ this.store.emitter.emit('error', { type: 'http', error: res });
795
+ }
785
796
  }
786
797
  else if (network.protocol === 'mqtt') {
787
798
  const clients = this.mqttClients?.filter((client) => client.options.href === network.url);
@@ -2688,14 +2699,16 @@ export class Meta2d {
2688
2699
  let _sql = sql.sql;
2689
2700
  if (method === 'list') {
2690
2701
  // _sql+= ` LIMIT ${sql.pageSize||20}`+(sql.current>1?(' OFFSET '+(sql.current-1)*sql.pageSize):'');
2691
- if (sql.dbType === "oracle") {
2692
- if (!_sql.includes('OFFSET')) {
2693
- _sql += ` OFFSET ${(sql.current || 1 - 1) * (sql.pageSize || 20)} ROWS FETCH NEXT ${sql.pageSize || 20} ROWS ONLY`;
2702
+ if (sql.pageSize !== -1) {
2703
+ if (sql.dbType === "oracle") {
2704
+ if (!_sql.includes('OFFSET')) {
2705
+ _sql += ` OFFSET ${((sql.current || 1) - 1) * (sql.pageSize || 20)} ROWS FETCH NEXT ${sql.pageSize || 20} ROWS ONLY`;
2706
+ }
2694
2707
  }
2695
- }
2696
- else {
2697
- if (!_sql.includes('LIMIT')) {
2698
- _sql += ` LIMIT ${sql.pageSize || 20}` + (sql.current > 1 ? (' OFFSET ' + (sql.current - 1) * (sql.pageSize || 20)) : '');
2708
+ else {
2709
+ if (!_sql.includes('LIMIT')) {
2710
+ _sql += ` LIMIT ${sql.pageSize || 20}` + (sql.current > 1 ? (' OFFSET ' + (sql.current - 1) * (sql.pageSize || 20)) : '');
2711
+ }
2699
2712
  }
2700
2713
  }
2701
2714
  }