|
|
|
@ -10,7 +10,7 @@ import { FormSchema } from '/@/components/Table';
@@ -10,7 +10,7 @@ import { FormSchema } from '/@/components/Table';
|
|
|
|
|
import { getFileSize } from '/@/utils/file/download'; |
|
|
|
|
import { h } from 'vue'; |
|
|
|
|
import { useGlobSetting } from '/@/hooks/setting'; |
|
|
|
|
import { Tag, Button } from 'ant-design-vue'; |
|
|
|
|
import { Button } from 'ant-design-vue'; |
|
|
|
|
const { filePreviewUrl = '' } = useGlobSetting(); |
|
|
|
|
import { Api } from '/@/api/platform/system/controller/file'; |
|
|
|
|
import { encodeURL } from 'js-base64'; |
|
|
|
@ -34,11 +34,10 @@ export const columns: BasicColumn[] = [
@@ -34,11 +34,10 @@ export const columns: BasicColumn[] = [
|
|
|
|
|
width: 380, |
|
|
|
|
customRender: ({ record }) => { |
|
|
|
|
const url = encodeURL(`${getCloudProxyUrl()}${Api.get}/${record.bucketName}/${record.fileName}`); |
|
|
|
|
return record.fileName ? h(Button, { |
|
|
|
|
return h(Button, { |
|
|
|
|
type: 'link', |
|
|
|
|
target: '_blank', |
|
|
|
|
href: `${filePreviewUrl}/onlinePreview?url=${encodeURIComponent(url)}` }, () => record.fileName) |
|
|
|
|
: h(Tag, { color: 'red' }, () => '暂无文件'); |
|
|
|
|
href: `${filePreviewUrl}/onlinePreview?url=${encodeURIComponent(url)}` }, () => record.fileName); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|