Map Attributes: Apply, Clear done.

This commit is contained in:
chiayin
2023-10-31 15:29:18 +08:00
parent fdba0abc37
commit 2ac112dbbd
4 changed files with 215 additions and 54 deletions

View File

@@ -97,22 +97,7 @@ export default defineStore('allMapDataStore', {
},
filterAttrs: state => {
if(state.allFilterAttrs !== null){
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;
});
state.allFilterAttrㄧㄠ
return state.allFilterAttrs;
}
},