@meta2d/core 1.0.97 → 1.0.98
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 +1 -1
- package/src/canvas/canvas.js +1 -0
- package/src/canvas/canvas.js.map +1 -1
- package/src/core.js +23 -10
- package/src/core.js.map +1 -1
- package/src/pen/render.js +5 -5
- package/src/pen/render.js.map +1 -1
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
|
|
548
|
-
content
|
|
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.
|
|
2692
|
-
if (
|
|
2693
|
-
|
|
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
|
-
|
|
2697
|
-
|
|
2698
|
-
|
|
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
|
}
|