Map Attributes: fix allMapData.js.

This commit is contained in:
chiayin
2023-10-31 16:38:54 +08:00
parent 64fad0a8fe
commit a4ea3bff5d

View File

@@ -97,7 +97,22 @@ export default defineStore('allMapDataStore', {
},
filterAttrs: state => {
if(state.allFilterAttrs !== null){
state.allFilterAttrㄧㄠ
state.allFilterAttrs.map(att => {
switch (att.type) {
case 'date':
att.min = att.min !== null ? moment(att.min).format('YYYY/MM/DD HH:mm') : null;
att.max = att.max !== null ? moment(att.max).format('YYYY/MM/DD HH:mm') : null;
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;
break
default:
break;
}
return att;
});
return state.allFilterAttrs;
}
},