⚡ Optimize code to avoid duplicate types
This commit is contained in:
parent
bccd926e3f
commit
7d901cf35a
@ -17,6 +17,8 @@ export function useBillTypes(){
|
|||||||
const types = ret.filter(it=>!it.description.toUpperCase().startsWith('ADJUSTMENT'))
|
const types = ret.filter(it=>!it.description.toUpperCase().startsWith('ADJUSTMENT'))
|
||||||
.map(it=>({value: it.type, label: it.description}))
|
.map(it=>({value: it.type, label: it.description}))
|
||||||
setBillTypes(types)
|
setBillTypes(types)
|
||||||
|
// 避免出现多次
|
||||||
|
BillTypesCache.length = 0;
|
||||||
BillTypesCache.push(...types)
|
BillTypesCache.push(...types)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user