文件管理剩余文件大小按照合适单位显示

This commit is contained in:
fangxiang 2022-12-02 15:10:02 +08:00
parent 4aa7784ec5
commit 768fbf4541
1 changed files with 24 additions and 0 deletions

View File

@ -228,6 +228,30 @@
}} }}
<q-tooltip> {{ props.value }} </q-tooltip> <q-tooltip> {{ props.value }} </q-tooltip>
</div> </div>
<div v-else-if="props.col.name == 'file_size'">
<span v-if="props.row.is_directory"> </span>
<span v-else>
<span
v-if="
Math.floor(props.row.file_size / 1024 / 1024 / 1024) > 0
"
>
{{
(props.row.file_size / 1024 / 1024 / 1024).toFixed(2)
}}GB
</span>
<span
v-else-if="
Math.floor(props.row.file_size / 1024 / 1024) > 0
"
>
{{ (props.row.file_size / 1024 / 1024).toFixed(2) }}MB
</span>
<span v-else>
{{ (props.row.file_size / 1024).toFixed(2) }} KB
</span>
</span>
</div>
<div v-else-if="props.col.name != 'operator'"> <div v-else-if="props.col.name != 'operator'">
{{ props.value }} {{ props.value }}
</div> </div>