@meta2d/core 1.0.84 → 1.0.85

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
@@ -177,18 +177,20 @@ export class Meta2d {
177
177
  this.setBackgroundColor(this.store.theme[theme].background);
178
178
  this.canvas.parentElement.style.background =
179
179
  this.store.theme[theme].parentBackground;
180
- this.store.data.color = this.store.theme[theme].color;
181
180
  this.setOptions({
182
181
  ruleColor: this.store.theme[theme].ruleColor,
183
182
  ruleOptions: this.store.theme[theme].ruleOptions,
184
183
  });
185
184
  // 更新全局的主题css变量
186
- le5leTheme.updateCssRule(this.store.id, theme);
187
- this.canvas.initGlobalStyle();
188
- for (let i = 0; i < this.store.data.pens.length; i++) {
189
- const pen = this.store.data.pens[i];
190
- // 调用pen的主题设置函数,如果单个pen有主题的自定义设置的话
191
- pen.setTheme && pen.setTheme(pen, this.store.styles);
185
+ if (!(this.store.options.themeOnlyCanvas || this.store.data.themeOnlyCanvas)) {
186
+ this.store.data.color = this.store.theme[theme].color;
187
+ le5leTheme.updateCssRule(this.store.id, theme);
188
+ this.canvas.initGlobalStyle();
189
+ for (let i = 0; i < this.store.data.pens.length; i++) {
190
+ const pen = this.store.data.pens[i];
191
+ // 调用pen的主题设置函数,如果单个pen有主题的自定义设置的话
192
+ pen.setTheme && pen.setTheme(pen, this.store.styles);
193
+ }
192
194
  }
193
195
  this.render();
194
196
  }
@@ -2548,7 +2550,17 @@ export class Meta2d {
2548
2550
  const method = sql.method || 'get';
2549
2551
  let _sql = sql.sql;
2550
2552
  if (method === 'list') {
2551
- _sql += ` LIMIT ${sql.pageSize || 20}` + (sql.current > 1 ? (' OFFSET ' + (sql.current - 1) * sql.pageSize) : '');
2553
+ // _sql+= ` LIMIT ${sql.pageSize||20}`+(sql.current>1?(' OFFSET '+(sql.current-1)*sql.pageSize):'');
2554
+ if (sql.dbType === "oracle") {
2555
+ if (!_sql.includes('OFFSET')) {
2556
+ _sql += ` OFFSET ${(sql.current || 1 - 1) * (sql.pageSize || 20)} ROWS FETCH NEXT ${sql.pageSize || 20} ROWS ONLY`;
2557
+ }
2558
+ }
2559
+ else {
2560
+ if (!_sql.includes('LIMIT')) {
2561
+ _sql += ` LIMIT ${sql.pageSize || 20}` + (sql.current > 1 ? (' OFFSET ' + (sql.current - 1) * (sql.pageSize || 20)) : '');
2562
+ }
2563
+ }
2552
2564
  }
2553
2565
  const res = await fetch(`/api/iot/data/sql/${method}`, {
2554
2566
  method: 'POST',