Map Attributes: fix allMapData.js.
This commit is contained in:
@@ -97,7 +97,22 @@ export default defineStore('allMapDataStore', {
|
|||||||
},
|
},
|
||||||
filterAttrs: state => {
|
filterAttrs: state => {
|
||||||
if(state.allFilterAttrs !== null){
|
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;
|
return state.allFilterAttrs;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user