Issues #174: done.

This commit is contained in:
chiayin
2023-11-02 17:35:43 +08:00
parent 89f0ef9a5a
commit 0be3bcfdd0
3 changed files with 105 additions and 28 deletions

View File

@@ -105,8 +105,8 @@ export default defineStore('allMapDataStore', {
break;
case 'float':
// Decimal.ROUND_UP|0: 無條件進位; Decimal.ROUND_DOWN|1: 無條件捨去。
att.min = att.min !== null ? Number(new Decimal(att.min).toFixed(2, 0)) : null;
att.max = att.max !== null ? Number(new Decimal(att.max).toFixed(2, 1)) : null;
att.min = att.min !== null ? Number(new Decimal(att.min).toFixed(2, 1)) : null;
att.max = att.max !== null ? Number(new Decimal(att.max).toFixed(2, 0)) : null;
break
default:
break;
@@ -244,6 +244,10 @@ export default defineStore('allMapDataStore', {
let min = this.allFilterTimeframe.x_axis.min;
let max = this.allFilterTimeframe.x_axis.max;
// 給 Chart.js 原始資料,格式不同的畫會錯誤輸出
this.allFilterTimeframe.x_axis.min_base = min;
this.allFilterTimeframe.x_axis.max_base = max;
// 轉成無秒的時間格式
this.allFilterTimeframe.x_axis.min = min !== null ? moment(min).format('YYYY/MM/DD HH:mm') : null;
this.allFilterTimeframe.x_axis.max = max !== null ? moment(max).format('YYYY/MM/DD HH:mm') : null;
} catch(error) {