运费模板性能优化。区域选择使用懒加载

This commit is contained in:
jason
2023-05-22 23:10:22 +08:00
parent 855e4d3d02
commit af2fb4bf5f
5 changed files with 158 additions and 45 deletions

View File

@ -194,3 +194,17 @@ export const convertToInteger = (num: number | string | undefined): number => {
// TODO 分转元后还有小数则四舍五入
return Math.round(parsedNumber * 100)
}
/**
* 元转分
*/
export const yuanToFen = (amount: string | number): number => {
return Math.round(Number(amount) * 100)
}
/**
* 分转元
*/
export const fenToYuan = (amount: string | number): number => {
return Number((Number(amount) / 100).toFixed(2))
}

View File

@ -11,7 +11,8 @@ const DEFAULT_CONFIG: TreeHelperConfig = {
export const defaultProps = {
children: 'children',
label: 'name',
value: 'id'
value: 'id',
isLeaf: 'leaf'
}
const getConfig = (config: Partial<TreeHelperConfig>) => Object.assign({}, DEFAULT_CONFIG, config)