|
@@ -2,7 +2,7 @@
|
|
|
import { ContentWrap } from '@/components/ContentWrap'
|
|
|
import { Search } from '@/components/Search'
|
|
|
import { useI18n } from '@/hooks/web/useI18n'
|
|
|
-import { ElButton, ElTooltip } from 'element-plus'
|
|
|
+import { ElButton, ElTooltip, ElMessage, ElButtonGroup } from 'element-plus'
|
|
|
import { Table } from '@/components/Table'
|
|
|
import { getTableListApi, delTableListApi, saveTableApi } from '@/api/manage/file'
|
|
|
import { useTable } from '@/hooks/web/useTable'
|
|
@@ -18,7 +18,6 @@ import { FileData } from '@/api/manage/types'
|
|
|
import Write from './components/Write.vue'
|
|
|
import { useIcon } from '@/hooks/web/useIcon'
|
|
|
import { Qrcode } from '@/components/Qrcode'
|
|
|
-
|
|
|
defineOptions({
|
|
|
name: 'FilePage'
|
|
|
})
|
|
@@ -47,7 +46,7 @@ const { tableRegister, tableState, tableMethods } = useTable({
|
|
|
})
|
|
|
return {
|
|
|
list: res.data.list,
|
|
|
- total: res.data.total
|
|
|
+ total: res.data.totalCount
|
|
|
}
|
|
|
},
|
|
|
fetchDelApi: async () => {
|
|
@@ -77,7 +76,7 @@ const crudSchemas: CrudSchema[] = [
|
|
|
{
|
|
|
field: 'name',
|
|
|
label: '名称',
|
|
|
-
|
|
|
+ minWidth: 100,
|
|
|
table: {
|
|
|
hidden: false
|
|
|
},
|
|
@@ -90,6 +89,7 @@ const crudSchemas: CrudSchema[] = [
|
|
|
{
|
|
|
field: 'version',
|
|
|
label: '版本号',
|
|
|
+ minWidth: 100,
|
|
|
search: {
|
|
|
hidden: true
|
|
|
},
|
|
@@ -100,6 +100,7 @@ const crudSchemas: CrudSchema[] = [
|
|
|
{
|
|
|
field: 'code',
|
|
|
label: '版本序列号',
|
|
|
+ minWidth: 100,
|
|
|
table: {
|
|
|
hidden: false
|
|
|
},
|
|
@@ -113,6 +114,7 @@ const crudSchemas: CrudSchema[] = [
|
|
|
{
|
|
|
field: 'fileName',
|
|
|
label: '文件名',
|
|
|
+ minWidth: 120,
|
|
|
table: {
|
|
|
hidden: false
|
|
|
},
|
|
@@ -123,7 +125,7 @@ const crudSchemas: CrudSchema[] = [
|
|
|
{
|
|
|
field: 'virtualPath',
|
|
|
label: '文件链接',
|
|
|
-
|
|
|
+ minWidth: 120,
|
|
|
search: {
|
|
|
hidden: true
|
|
|
},
|
|
@@ -138,7 +140,7 @@ const crudSchemas: CrudSchema[] = [
|
|
|
componentProps: {
|
|
|
action: '/api/sysApk/uploadFile',
|
|
|
limit: 1,
|
|
|
- class: 'productUploader',
|
|
|
+ class: 'filePageUploader',
|
|
|
headers: {
|
|
|
token: getStorage('token')
|
|
|
},
|
|
@@ -163,6 +165,7 @@ const crudSchemas: CrudSchema[] = [
|
|
|
{
|
|
|
field: 'filePath',
|
|
|
label: '文件路径',
|
|
|
+ minWidth: 120,
|
|
|
search: {
|
|
|
hidden: true
|
|
|
},
|
|
@@ -176,6 +179,7 @@ const crudSchemas: CrudSchema[] = [
|
|
|
{
|
|
|
field: 'content',
|
|
|
label: '版本更新说明',
|
|
|
+ minWidth: 120,
|
|
|
search: {
|
|
|
hidden: true
|
|
|
},
|
|
@@ -194,6 +198,7 @@ const crudSchemas: CrudSchema[] = [
|
|
|
{
|
|
|
field: 'remark',
|
|
|
label: '备注',
|
|
|
+ minWidth: 120,
|
|
|
search: {
|
|
|
hidden: true
|
|
|
},
|
|
@@ -212,6 +217,7 @@ const crudSchemas: CrudSchema[] = [
|
|
|
{
|
|
|
field: 'createTime',
|
|
|
label: '创建时间',
|
|
|
+ minWidth: 160,
|
|
|
table: {
|
|
|
hidden: false
|
|
|
},
|
|
@@ -224,7 +230,7 @@ const crudSchemas: CrudSchema[] = [
|
|
|
},
|
|
|
{
|
|
|
field: 'action',
|
|
|
- width: '250px',
|
|
|
+ width: '200px',
|
|
|
label: '操作',
|
|
|
search: {
|
|
|
hidden: true
|
|
@@ -237,26 +243,22 @@ const crudSchemas: CrudSchema[] = [
|
|
|
},
|
|
|
table: {
|
|
|
hidden: false,
|
|
|
+ fixed: 'right',
|
|
|
slots: {
|
|
|
default: (data: any) => {
|
|
|
return (
|
|
|
- <>
|
|
|
+ <ElButtonGroup>
|
|
|
<ElTooltip content="二维码">
|
|
|
- <ElButton text icon={QRIcon} onClick={() => showQrCode(data)}></ElButton>
|
|
|
+ <ElButton text icon={QRIcon} onClick={() => showQrCode(data.row)} />
|
|
|
</ElTooltip>
|
|
|
<ElTooltip content="下载">
|
|
|
- <ElButton text icon={DownLoadIcon} onClick={() => downloadFile(data)}></ElButton>
|
|
|
+ <ElButton text icon={DownLoadIcon} onClick={() => downloadFile(data.row)} />
|
|
|
</ElTooltip>
|
|
|
<ElTooltip content="复制链接">
|
|
|
- <ElButton text icon={copyIcon}></ElButton>
|
|
|
+ <ElButton text icon={copyIcon} onClick={() => onCopy(data.row)} />
|
|
|
</ElTooltip>
|
|
|
- <ElButton
|
|
|
- icon={DeleteIcon}
|
|
|
- text
|
|
|
- type="danger"
|
|
|
- onClick={() => delData(data[0].row)}
|
|
|
- ></ElButton>
|
|
|
- </>
|
|
|
+ <ElButton icon={DeleteIcon} text type="danger" onClick={() => delData(data.row)} />
|
|
|
+ </ElButtonGroup>
|
|
|
)
|
|
|
}
|
|
|
}
|
|
@@ -330,9 +332,17 @@ const showQrCode = (row: FileData) => {
|
|
|
}
|
|
|
|
|
|
const downloadFile = (row: FileData) => {
|
|
|
- console.log(row)
|
|
|
window.open(row.virtualPath)
|
|
|
}
|
|
|
+
|
|
|
+const onCopy = (row: FileData) => {
|
|
|
+ navigator.clipboard.writeText(row.virtualPath).then(() => {
|
|
|
+ ElMessage({
|
|
|
+ message: '复制成功!',
|
|
|
+ type: 'success'
|
|
|
+ })
|
|
|
+ })
|
|
|
+}
|
|
|
</script>
|
|
|
|
|
|
<template>
|
|
@@ -388,4 +398,7 @@ const downloadFile = (row: FileData) => {
|
|
|
display: inline-block;
|
|
|
margin-right: 12px;
|
|
|
}
|
|
|
+.filePageUploader {
|
|
|
+ width: 100%;
|
|
|
+}
|
|
|
</style>
|