提交 bf57be88 authored 作者: 陈志磊's avatar 陈志磊

update

上级 912a9582
...@@ -16,20 +16,35 @@ const listOptions = computed(() => { ...@@ -16,20 +16,35 @@ const listOptions = computed(() => {
}, },
columns: [ columns: [
{ label: '文件名', prop: 'name' }, { label: '文件名', prop: 'name' },
{ label: '大小', prop: 'size' }, {
label: '大小',
prop: 'size',
computed: (row: any) => {
return bytesToSize(row.row.size)
}
},
{ {
label: '状态', label: '状态',
prop: 'status_name' prop: 'status_name',
// computed: (row: any) => { computed: (row: any) => {
// return row.row.status === '0' return row.row.status === '4'
// ? `<span style="color: rgb(170, 2, 49)">${row.row.status_name}</span>` ? `<p><span style="color: rgb(170, 2, 49)">${row.row.status_name}</span><br/><span style="font-size: 12px">${row.row.message}</span></p>`
// : `<span style="color: #00ac27">${row.row.status_name}</span>` : `<span style="color: #00ac27">${row.row.status_name}</span>`
// } }
}, },
{ label: '导入时间', prop: 'created_time' } { label: '导入时间', prop: 'created_time' }
] ]
} }
}) })
const bytesToSize = (bytes: number) => {
if (bytes === 0) return '0 B'
const k = 1000, // or 1024
sizes = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'],
i = Math.floor(Math.log(bytes) / Math.log(k))
return (bytes / Math.pow(k, i)).toPrecision(3) + ' ' + sizes[i]
}
</script> </script>
<template> <template>
<el-dialog <el-dialog
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论