This commit is contained in:
2023-06-12 15:58:47 +08:00
parent 2839c0cf7a
commit df4f650c44
7 changed files with 101 additions and 71 deletions

View File

@@ -47,7 +47,16 @@ const emit = defineEmits([
"update:selectedKeys",
"update:selectedKey",
]);
function toThousands(num: number | string) {
if(typeof num == "string"){
num = parseFloat(num || '0')
}
let xs = num.toString().split(".")[1]
let zs = num.toString().split(".")[0]
let jg = (zs || 0).toString().replace(/(\d)(?=(?:\d{3})+$)/g, '$1,') + (xs ? "." + xs : "");
console.log(jg)
return jg;
}
const props = withDefaults(defineProps<TableRowProps>(), {
checkbox: false,
childrenColumnName: "children",
@@ -606,7 +615,8 @@ const radioProps = props.getRadioProps(props.data, props.index);
:content="data[column.key]"
:isAutoShow="true"
>
{{ data[column.key] }}
{{ column.qfw ? toThousands(data[column.key]) : data[column.key] }}
</lay-tooltip>
<template v-else>
<template v-if="column.edit">