Pre Merge pull request !672 from AyaoJies/AyaoJies

pull/672/MERGE
AyaoJies 2025-01-20 16:17:36 +00:00 committed by Gitee
commit 46922d177c
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
29 changed files with 7560 additions and 5958 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,7 @@
import request from '@/config/axios'
export interface FilePageReqVO extends PageParam {
parentId?: number
path?: string
type?: string
createTime?: Date[]
@ -16,11 +17,16 @@ export interface FilePresignedUrlRespVO {
url: string
}
// 查询文件列表
// 查询文件列表(列表显示)
export const getFilePage = (params: FilePageReqVO) => {
return request.get({ url: '/infra/file/page', params })
}
// 查询文件列表(窗口显示)
export const getFileList = (params: FilePageReqVO) => {
return request.get({ url: '/infra/file/list', params })
}
// 删除文件
export const deleteFile = (id: number) => {
return request.delete({ url: '/infra/file/delete?id=' + id })

View File

@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="200px" height="200.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M661.944889 73.144889H146.289778a36.679111 36.679111 0 0 0-36.579556 36.565333v804.579556a36.679111 36.679111 0 0 0 36.579556 36.565333h731.420444a36.679111 36.679111 0 0 0 36.579556-36.565333v-588.8L661.944889 73.144889z" fill="#F2733D" /><path d="M661.944889 288.910222a36.679111 36.679111 0 0 0 36.565333 36.579556h215.779556L661.944889 73.144889v215.765333z" fill="#EF8F6F" /><path d="M512 420.565333h-140.8v354.744889h91.434667v-124.344889h53.020444c104.234667 0 166.4-43.875556 166.4-118.855111-1.820444-73.144889-58.510222-111.544889-170.055111-111.544889z m-49.365333 62.179556h43.875555c60.344889 0 84.124444 14.620444 84.124445 51.2 0 38.4-27.434667 56.689778-82.289778 56.689778H460.8v-107.889778h1.834667z" fill="#FFFFFF" /></svg>

After

Width:  |  Height:  |  Size: 1009 B

View File

@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="200px" height="200.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M661.944889 73.144889H146.289778a36.679111 36.679111 0 0 0-36.579556 36.565333v804.579556a36.679111 36.679111 0 0 0 36.579556 36.565333h731.420444a36.679111 36.679111 0 0 0 36.579556-36.565333v-588.8L661.944889 73.144889z" fill="#30A8FF" /><path d="M661.944889 288.910222a36.679111 36.679111 0 0 0 36.565333 36.579556h215.779556L661.944889 73.144889v215.765333z" fill="#84CBFF" /><path d="M292.565333 415.089778h-84.110222v354.744889h56.689778v-124.344889H294.4c62.165333 0 98.744889-43.889778 98.744889-118.855111 0-73.144889-34.744889-111.544889-100.579556-111.544889z m-27.420444 62.165333h23.765333c34.744889 0 47.544889 14.634667 47.544889 51.2 0 38.4-14.620444 56.689778-45.710222 56.689778h-25.6v-107.889778z m279.765333 93.255111L512 552.248889l-1.834667-1.834667c-20.110222-10.965333-34.730667-20.110222-34.730666-42.055111 0-20.110222 10.965333-32.910222 31.075555-32.910222 18.289778 0 32.924444 9.130667 49.379556 27.420444l3.655111 3.655111 29.255111-49.365333-1.834667-1.834667C566.855111 426.055111 537.6 409.6 506.510222 409.6c-51.2 0-87.765333 43.889778-87.765333 104.234667 0 54.855111 27.420444 82.275556 51.2 96.910222l34.744889 21.944889c20.110222 12.8 32.910222 20.110222 32.910222 42.055111 0 23.765333-12.8 36.565333-34.744889 36.565333-20.110222 0-42.055111-14.620444-58.510222-36.565333l-3.655111-3.655111-32.924445 54.855111 1.834667 1.820444c23.765333 32.924444 58.510222 53.034667 91.434667 53.034667 54.855111 0 93.255111-43.889778 93.255111-107.889778 1.820444-51.2-14.634667-82.275556-49.379556-102.4z m157.255111-155.420444h-71.310222v354.744889H704c76.8 0 122.510222-65.834667 122.510222-179.2 0-111.544889-43.875556-175.544889-124.344889-175.544889z m-14.620444 64h10.965333c47.544889 0 71.324444 36.565333 71.324445 113.365333s-23.779556 115.2-71.324445 115.2h-10.965333V479.089778z" fill="#FFFFFF" /></svg>

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="200px" height="200.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M661.944889 73.144889H146.289778a36.679111 36.679111 0 0 0-36.579556 36.565333v804.579556a36.679111 36.679111 0 0 0 36.579556 36.565333h731.420444a36.679111 36.679111 0 0 0 36.579556-36.565333v-588.8L661.944889 73.144889z" fill="#5BC0E5" /><path d="M661.944889 288.910222a36.679111 36.679111 0 0 0 36.565333 36.579556h215.779556L661.944889 73.144889v215.765333z" fill="#7EDCFE" /><path d="M336.455111 570.510222L303.544889 550.4l-1.834667-1.834667c-20.110222-10.965333-34.744889-20.110222-34.744889-40.220444s10.979556-32.910222 31.089778-32.910222c18.289778 0 32.910222 9.130667 49.379556 27.420444l3.655111 3.655111 29.255111-49.365333-1.834667-1.834667C358.4 426.055111 329.144889 409.6 298.055111 409.6c-51.2 0-87.765333 43.889778-87.765333 104.234667 0 54.855111 27.420444 82.275556 51.2 96.910222l34.744889 21.944889c20.110222 12.8 32.910222 20.110222 32.910222 42.055111 0 23.765333-12.8 36.565333-34.744889 36.565333-20.110222 0-42.055111-14.620444-58.510222-36.565333l-3.655111-3.655111-32.924445 54.855111 1.834667 1.820444c23.765333 32.924444 58.510222 53.034667 91.420444 53.034667 54.869333 0 93.269333-43.889778 93.269334-107.889778 1.820444-51.2-14.634667-82.275556-49.379556-102.4z m181.034667 16.455111c-3.655111 20.124444-7.324444 38.4-10.979556 58.524445-1.820444 12.8-5.475556 25.6-7.310222 40.220444-3.655111-14.620444-5.489778-31.075556-7.310222-45.710222-3.655111-16.455111-5.489778-34.744889-9.144889-53.034667l-32.910222-171.875555h-58.524445l76.8 354.744889h62.179556l76.8-354.744889H550.4L517.489778 586.951111z m202.965333-16.455111v64h43.889778v64c-5.489778 7.324444-16.455111 10.979556-27.434667 10.979556-43.875556 0-69.475556-42.055111-69.475555-117.034667 0-71.310222 25.6-115.2 65.820444-115.2 21.944889 0 34.744889 14.634667 45.710222 27.434667l3.669334 3.655111 29.255111-51.2-1.834667-1.834667C789.944889 424.248889 762.510222 409.6 731.448889 409.6c-71.324444 0-120.689778 76.8-120.689778 184.689778 0 111.544889 47.544889 182.855111 120.689778 182.855111 32.910222 0 62.165333-16.455111 82.275555-43.889778V570.510222h-93.255111z" fill="#FFFFFF" /></svg>

After

Width:  |  Height:  |  Size: 2.3 KiB

View File

@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="200px" height="200.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M661.944889 73.144889H146.289778a36.679111 36.679111 0 0 0-36.579556 36.565333v804.579556a36.679111 36.679111 0 0 0 36.579556 36.565333h731.420444a36.679111 36.679111 0 0 0 36.579556-36.565333v-588.8L661.944889 73.144889z" fill="#F87E0C" /><path d="M661.944889 288.910222a36.679111 36.679111 0 0 0 36.565333 36.579556h215.779556L661.944889 73.144889v215.765333z" fill="#F79341" /><path d="M475.434667 415.089778h-95.089778L256 769.834667h85.944889l27.420444-89.6h118.869334l27.420444 89.6h87.779556l-128-351.089778v-3.655111z m-49.379556 67.655111c3.655111 12.8 7.310222 23.765333 10.979556 36.565333 7.310222 23.779556 12.8 45.724444 20.110222 67.655111l9.144889 32.924445h-80.455111l9.130666-32.924445a3206.215111 3206.215111 0 0 0 31.089778-104.220444z m210.289778-67.655111h84.110222v354.744889h-84.110222V415.089778z" fill="#FFFFFF" /></svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="200px" height="200.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M661.944889 73.144889H146.289778a36.679111 36.679111 0 0 0-36.579556 36.565333v804.579556a36.679111 36.679111 0 0 0 36.579556 36.565333h731.420444a36.679111 36.679111 0 0 0 36.579556-36.565333v-588.8L661.944889 73.144889z" fill="#8450EA" /><path d="M661.944889 288.910222a36.679111 36.679111 0 0 0 36.565333 36.579556h215.779556L661.944889 73.144889v215.765333z" fill="#9C72ED" /><path d="M696.689778 694.855111V418.744889c0-5.489778 0-9.144889-1.834667-14.634667-5.489778-20.110222-25.6-31.075556-45.710222-25.6L394.951111 449.848889c-16.455111 5.475556-27.420444 20.110222-27.420444 38.4v243.2c-12.8-1.834667-29.255111-1.834667-43.889778 5.475555-31.089778 14.634667-47.544889 47.544889-34.744889 73.144889 10.979556 25.6 47.544889 34.744889 78.634667 20.110223 16.455111-7.310222 29.255111-20.110222 34.744889-34.730667V793.6c3.655111-9.144889 3.655111-20.110222 1.820444-29.255111V625.351111l254.179556-69.475555V665.6c-12.8-3.655111-29.255111-1.834667-43.889778 5.489778-31.089778 14.620444-47.544889 47.544889-34.744889 73.144889 10.979556 25.6 47.544889 34.730667 78.634667 20.110222 16.455111-7.310222 29.255111-21.944889 34.744888-36.579556v-1.820444c5.475556-10.979556 7.310222-21.944889 3.655112-31.089778z m-36.579556-179.2l-252.344889 69.489778V522.951111c3.669333 0 7.324444 0 9.144889-1.820444l243.2-67.655111v62.165333z" fill="#FFFFFF" /></svg>

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="200px" height="200.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M661.944889 73.144889H146.289778a36.679111 36.679111 0 0 0-36.579556 36.565333v804.579556a36.679111 36.679111 0 0 0 36.579556 36.565333h731.420444a36.679111 36.679111 0 0 0 36.579556-36.565333v-588.8L661.944889 73.144889z" fill="#1DB87B" /><path d="M661.944889 288.910222a36.679111 36.679111 0 0 0 36.565333 36.579556h215.779556L661.944889 73.144889v215.765333z" fill="#63CE9E" /><path d="M568.689778 596.110222l113.365333-175.544889h-96.910222l-40.234667 73.144889c-9.144889 14.634667-16.455111 31.089778-25.6 51.2-5.475556-9.144889-9.144889-18.275556-14.620444-25.6-5.489778-9.144889-10.979556-18.275556-14.634667-25.6l-43.889778-73.144889h-102.4l113.379556 171.889778-120.689778 182.855111H435.2l45.710222-78.620444c9.144889-14.634667 16.455111-31.089778 29.255111-53.034667 5.489778 9.144889 9.144889 16.455111 14.634667 23.779556 5.489778 9.130667 10.965333 20.110222 16.455111 29.255111l47.544889 78.620444h102.4l-122.510222-179.2z" fill="#FFFFFF" /></svg>

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="200px" height="200.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M661.944889 73.144889H146.289778a36.679111 36.679111 0 0 0-36.579556 36.565333v804.579556a36.679111 36.679111 0 0 0 36.579556 36.565333h731.420444a36.679111 36.679111 0 0 0 36.579556-36.565333v-588.8L661.944889 73.144889z" fill="#278EFF" /><path d="M661.944889 288.910222a36.679111 36.679111 0 0 0 36.565333 36.579556h215.779556L661.944889 73.144889v215.765333z" fill="#5CB2FF" /><path d="M365.710222 634.510222H409.6v64c-5.489778 7.324444-16.455111 10.979556-27.434667 10.979556-43.875556 0-69.475556-42.055111-69.475555-117.034667 0-71.310222 25.6-115.2 65.820444-115.2 21.944889 0 34.744889 14.634667 45.724445 27.434667l3.655111 3.655111 29.255111-51.2-1.834667-1.834667C435.2 424.248889 407.765333 409.6 376.689778 409.6 305.351111 409.6 256 486.4 256 594.289778c0 111.544889 47.544889 182.855111 120.689778 182.855111 32.910222 0 62.165333-16.455111 82.275555-43.889778V570.510222h-93.255111v64z m140.8-219.420444H563.2v354.744889h-56.689778V415.089778z m266.979556 65.820444v-65.820444H614.4v354.744889h56.689778v-140.8h87.765333V563.2h-87.765333v-82.289778h102.4z" fill="#FFFFFF" /></svg>

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="200px" height="200.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M661.944889 73.144889H146.289778a36.679111 36.679111 0 0 0-36.579556 36.565333v804.579556a36.679111 36.679111 0 0 0 36.579556 36.565333h731.420444a36.679111 36.679111 0 0 0 36.579556-36.565333v-588.8L661.944889 73.144889z" fill="#8DDE83" /><path d="M661.944889 288.910222a36.679111 36.679111 0 0 0 36.565333 36.579556h215.779556L661.944889 73.144889v215.765333z" fill="#BCFFB3" /><path d="M332.8 605.255111l-31.089778-10.965333 104.234667-32.924445v-71.310222L204.8 568.689778v53.020444l201.144889 78.634667v-71.310222L332.8 605.255111z m106.055111 193.834667h58.510222l80.469334-362.055111h-58.524445l-80.455111 362.055111zM819.2 566.855111l-201.144889-76.8v71.310222l73.144889 21.944889 31.089778 10.979556-104.234667 34.744889v71.310222L819.2 621.710222v-54.855111z" fill="#FFFFFF" /></svg>

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="200px" height="200.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M413.742545 118.946909c0-27.136 21.992727-49.128727 49.105455-49.128727h98.280727c27.136 0 49.128727 21.992727 49.128728 49.128727v49.128727H905.076364c31.325091 0 47.662545 14.987636 49.035636 44.962909l0.093091 4.189091c0 32.744727-16.384 49.105455-49.128727 49.105455H118.923636c-31.325091 0-47.662545-14.964364-49.035636-44.939636L69.818182 217.204364c0-32.744727 16.384-49.105455 49.128727-49.105455h294.795636V118.923636z" fill="#E63832" /><path d="M831.348364 315.485091L789.201455 863.418182A98.257455 98.257455 0 0 1 691.2 954.181818H332.8c-51.362909 0-94.045091-39.563636-97.978182-90.763636L192.651636 315.508364h638.696728z m-427.426909 173.917091a36.840727 36.840727 0 0 0-34.909091 38.656l11.613091 220.811636a36.840727 36.840727 0 1 0 73.588363-3.84l-11.496727-220.788363a36.840727 36.840727 0 0 0-38.749091-34.909091l-0.046545 0.069818z m211.944727 0a36.840727 36.840727 0 0 0-38.725818 34.839273l-11.543273 220.788363a36.840727 36.840727 0 1 0 73.611636 3.84l11.543273-220.811636a36.840727 36.840727 0 0 0-34.909091-38.702546v0.046546z" fill="#FF5E59" /></svg>

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="200px" height="200.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M661.944889 82.289778H146.289778a36.679111 36.679111 0 0 0-36.579556 36.565333V923.448889a36.679111 36.679111 0 0 0 36.579556 36.565333h731.420444a36.679111 36.679111 0 0 0 36.579556-36.565333v-588.8L661.944889 82.289778z" fill="#FCD165" /><path d="M259.697778 724.295111c21.191111 0 38.272-4.437333 51.228444-13.312a68.152889 68.152889 0 0 0 26.808889-35.328c3.669333-11.235556 5.504-27.264 5.504-48.128V468.024889h-50.702222v162.773333c0 20.394667-2.360889 33.834667-7.054222 40.305778-4.693333 6.471111-12.714667 9.713778-24.064 9.713778-11.235556 0-19.584-4.536889-25.088-13.582222-3.669333-5.959111-5.788444-16.156444-6.357334-30.592l-47.957333 5.504c0.113778 26.922667 6.869333 47.345778 20.280889 61.269333 13.411556 13.923556 32.540444 20.878222 57.400889 20.878222z m172.558222-4.295111v-95.047111h33.166222c23.04 0 40.618667-1.208889 52.764445-3.612445 8.931556-1.948444 17.735111-5.930667 26.382222-11.946666 8.647111-6.016 15.786667-14.293333 21.404444-24.832 5.603556-10.538667 8.419556-23.552 8.419556-39.011556 0-20.053333-4.878222-36.408889-14.606222-49.066666-9.742222-12.657778-21.831111-20.892444-36.266667-24.675556-9.400889-2.517333-29.568-3.783111-60.501333-3.783111h-81.635556v251.975111h50.872889z m27.832889-137.841778h-27.832889v-71.495111h28.700444c16.042667 0.085333 26.88 0.654222 32.483556 1.706667 8.248889 1.493333 15.075556 5.219556 20.451556 11.178666 5.390222 5.959111 8.078222 13.511111 8.078222 22.684445 0 7.452444-1.92 13.980444-5.76 19.598222-3.84 5.617778-9.130667 9.742222-15.900445 12.373333-6.755556 2.631111-20.167111 3.953778-40.220444 3.953778z m259.171555 142.136889c20.750222 0 41.230222-3.925333 61.44-11.776 20.238222-7.850667 35.669333-16.924444 46.336-27.235555v-100.380445h-109.653333v42.453333h58.254222v31.971556c-7.68 5.959111-16.867556 11.022222-27.591111 15.217778a87.608889 87.608889 0 0 1-32.042666 6.257778c-21.546667 0-38.968889-7.466667-52.252445-22.414223-13.297778-14.961778-19.939556-37.390222-19.939555-67.299555 0-27.733333 6.556444-48.64 19.683555-62.72 13.112889-14.108444 30.791111-21.148444 53.020445-21.148445 14.663111 0 26.894222 3.584 36.693333 10.737778 9.799111 7.168 16.469333 16.924444 20.024889 29.297778l50.531555-9.443556c-5.034667-23.139556-16.355556-41.272889-33.948444-54.4-17.578667-13.112889-42.026667-19.683556-73.301333-19.683555-24.064 0-44.174222 4.181333-60.330667 12.558222-21.191111 10.88-37.290667 26.524444-48.298667 46.919111-10.993778 20.394667-16.497778 43.704889-16.497778 69.944889 0 24.177778 4.935111 46.549333 14.791112 67.128889 9.841778 20.565333 24.576 36.366222 44.16 47.431111 19.598222 11.050667 42.567111 16.583111 68.920888 16.583111z" fill="#FFFFFF" /><path d="M661.944889 298.055111a36.679111 36.679111 0 0 0 36.565333 36.579556h215.779556L661.944889 82.289778v215.765333z" fill="#FFE3A6" /></svg>

After

Width:  |  Height:  |  Size: 3.0 KiB

View File

@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="200px" height="200.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M661.944889 82.289778H146.289778a36.679111 36.679111 0 0 0-36.579556 36.565333V923.448889a36.679111 36.679111 0 0 0 36.579556 36.565333h731.420444a36.679111 36.679111 0 0 0 36.579556-36.565333v-588.8L661.944889 82.289778z" fill="#6A90FF" /><path d="M661.944889 298.055111a36.679111 36.679111 0 0 0 36.565333 36.579556h215.779556L661.944889 82.289778v215.765333z" fill="#94AFFF" /><path d="M521.144889 705.834667l-84.110222 84.110222a8.832 8.832 0 0 1-12.8 0L320 685.710222c-1.834667-1.820444-1.834667-5.475556-1.834667-7.310222s0-3.655111 1.834667-7.310222l84.110222-84.124445-38.4-38.4-84.110222 84.124445c-12.8 12.8-18.289778 27.420444-18.289778 45.710222s7.324444 32.910222 18.289778 45.710222l104.234667 104.234667c12.8 12.8 29.255111 18.289778 45.710222 18.289778s32.910222-5.489778 45.710222-18.289778l84.110222-84.110222-40.220444-38.4z m-18.289778-217.6l84.110222-84.124445a8.832 8.832 0 0 1 12.8 0l104.234667 104.234667c1.834667 1.820444 1.834667 5.489778 1.834667 7.310222 0 1.834667 0 3.655111-1.834667 7.310222l-82.289778 82.289778 38.4 38.4 84.124445-84.110222c12.8-12.8 18.275556-27.434667 18.275555-45.710222 0-18.289778-7.310222-32.924444-18.275555-45.724445l-106.069334-102.4a64.028444 64.028444 0 0 0-91.420444 0l-84.110222 84.124445 40.220444 38.4z" fill="#FFFFFF" /><path d="M426.097778 644.209778l146.104889-146.104889 38.784 38.769778L464.881778 682.951111z" fill="#FFFFFF" /></svg>

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="200px" height="200.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M69.818182 135.098182C69.748364 111.988364 87.179636 93.207273 108.753455 93.090909h303.802181c17.221818 0 32.349091 12.008727 37.422546 29.998546l11.217454 40.075636H940.916364c22.318545 0 39.959273 17.896727 39.959272 39.354182v645.492363c0 21.946182-18.152727 39.330909-39.959272 39.330909H109.777455A39.68 39.68 0 0 1 69.818182 848.011636V135.098182z" fill="#3866FF" /><path d="M940.916364 957.160727H109.777455c-22.318545 0-39.959273-20.48-39.959273-45.032727v-584.843636c0-25.134545 18.152727-45.032727 39.959273-45.032728H940.916364c22.318545 0 39.959273 20.48 39.959272 45.032728v584.843636c0 25.134545-18.152727 45.032727-39.959272 45.032727z" fill="#6287FF" /><path d="M783.499636 390.120727C773.585455 380.276364 757.806545 372.363636 742.004364 372.363636c-17.803636 0-33.605818 7.912727-45.474909 19.735273l-229.236364 228.957091c-1.978182 1.978182-1.978182 3.956364-3.956364 5.911273-3.956364 19.758545-29.649455 100.677818-29.649454 102.632727-1.978182 3.956364 0 7.912727 1.978182 11.869091 3.956364 3.956364 7.912727 3.956364 11.86909 1.954909 0 0 84.968727-27.624727 100.77091-31.581091 1.978182 0 3.956364-1.954909 3.956363-1.954909 9.890909-9.890909 217.390545-215.156364 231.237818-228.957091 13.824-11.869091 19.781818-27.648 21.736728-45.405091 0-17.757091-7.912727-33.559273-21.736728-45.381818z" fill="#FFFFFF" /><path d="M269.963636 791.272727m34.909091 0l488.727273 0q34.909091 0 34.909091 34.909091l0 0q0 34.909091-34.909091 34.909091l-488.727273 0q-34.909091 0-34.909091-34.909091l0 0q0-34.909091 34.909091-34.909091Z" fill="#FFFFFF" /></svg>

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="200px" height="200.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M661.944889 82.289778H146.289778a36.679111 36.679111 0 0 0-36.579556 36.565333V923.448889a36.679111 36.679111 0 0 0 36.579556 36.565333h731.420444a36.679111 36.679111 0 0 0 36.579556-36.565333v-588.8L661.944889 82.289778z" fill="#EC5C59" /><path d="M661.944889 298.055111a36.679111 36.679111 0 0 0 36.565333 36.579556h215.779556L661.944889 82.289778v215.765333z" fill="#EA8B8B" /><path d="M298.055111 424.234667h-84.110222V778.951111h56.689778V654.648889h29.255111c62.165333 0 98.744889-43.889778 98.744889-118.869333-1.834667-73.130667-34.744889-111.530667-100.579556-111.530667zM268.8 486.4h23.765333c34.744889 0 47.544889 14.634667 47.544889 51.2 0 38.4-14.620444 56.689778-45.710222 56.689778h-25.6V486.4z m235.889778-62.165333H433.351111V778.951111h73.144889c76.8 0 122.524444-65.820444 122.524444-179.2 0-111.530667-43.889778-175.530667-124.344888-175.530667z m-14.634667 64h10.979556c47.530667 0 71.310222 36.565333 71.310222 113.365333s-23.779556 115.2-71.310222 115.2h-10.979556V488.234667z m338.289778 1.820444V424.248889H669.255111V778.951111h56.689778v-140.8h87.765333v-65.820444h-87.765333v-82.289778h102.4z" fill="#FFFFFF" /></svg>

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="200px" height="200.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M661.944889 73.144889H146.289778a36.679111 36.679111 0 0 0-36.579556 36.565333v804.579556a36.679111 36.679111 0 0 0 36.579556 36.565333h731.420444a36.679111 36.679111 0 0 0 36.579556-36.565333v-588.8L661.944889 73.144889z" fill="#FCCC5A" /><path d="M661.944889 288.910222a36.679111 36.679111 0 0 0 36.565333 36.579556h215.779556L661.944889 73.144889v215.765333z" fill="#FFD980" /><path d="M347.434667 420.565333V486.4h118.855111v288.910222h91.420444V486.4h118.855111v-65.834667z" fill="#FFFFFF" /></svg>

After

Width:  |  Height:  |  Size: 770 B

View File

@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="200px" height="200.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M661.944889 82.289778H146.289778a36.679111 36.679111 0 0 0-36.579556 36.565333V923.448889a36.679111 36.679111 0 0 0 36.579556 36.565333h731.420444a36.679111 36.679111 0 0 0 36.579556-36.565333v-588.8L661.944889 82.289778z" fill="#8095FF" /><path d="M615.210667 398.222222c20.437333 0 37.148444 20.437333 39.011555 42.737778v284.302222C654.222222 749.411556 637.496889 768 617.059556 768H278.940444C258.503111 768 241.777778 749.411556 241.777778 725.262222v-284.302222C241.777778 416.810667 258.503111 398.222222 278.940444 398.222222z m-40.874667 89.187556h-105.898667v42.737778h105.898667v-42.737778z" fill="#FFFFFF" /><path d="M768.796444 478.805333c-9.585778-7.210667-21.091556-10.808889-32.597333-9.016889l-93.966222 19.825778C624.981333 493.226667 611.555556 511.246222 611.555556 531.072v104.533333c0 19.825778 13.425778 37.859556 30.677333 41.457778L736.199111 696.888889h7.68c9.585778 0 17.251556-3.598222 24.917333-9.016889 9.585778-7.210667 13.425778-19.825778 13.425778-32.426667V511.232c0-12.615111-3.84-23.424-13.425778-32.440889z" fill="#FFFFFF" opacity=".8" /><path d="M661.944889 298.055111a36.679111 36.679111 0 0 0 36.565333 36.579556h215.779556L661.944889 82.289778v215.765333z" fill="#B6C6FF" /></svg>

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="200px" height="200.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M661.944889 73.144889H146.289778a36.679111 36.679111 0 0 0-36.579556 36.565333v804.579556a36.679111 36.679111 0 0 0 36.579556 36.565333h731.420444a36.679111 36.679111 0 0 0 36.579556-36.565333v-588.8L661.944889 73.144889z" fill="#ACACAC" /><path d="M661.944889 288.910222a36.679111 36.679111 0 0 0 36.565333 36.579556h215.779556L661.944889 73.144889v215.765333z" fill="#BFBCBC" /><path d="M504.689778 693.034667c-12.8 0-25.6 5.475556-32.924445 14.620444-9.130667 9.144889-14.620444 21.944889-14.620444 36.579556 0 27.420444 20.110222 49.365333 47.544889 49.365333 25.6 0 47.544889-21.944889 47.544889-49.365333 0-14.634667-5.489778-25.6-14.634667-34.744889-9.144889-10.979556-20.110222-16.455111-32.910222-16.455111z m5.475555-341.944889c-40.220444 0-76.8 18.275556-106.055111 51.2l-10.965333 12.8 47.544889 43.875555 10.965333-12.8c14.634667-18.275556 34.744889-27.420444 54.855111-27.420444 12.8 0 23.779556 3.655111 29.255111 10.965333 5.489778 7.324444 9.144889 16.455111 9.144889 29.255111 0 21.944889-14.620444 40.234667-31.075555 60.344889-23.779556 29.255111-53.034667 67.655111-45.724445 124.344889l1.834667 14.634667h69.489778L537.6 640c-3.655111-34.744889 14.634667-58.510222 36.565333-85.944889 20.124444-25.6 43.889778-54.855111 43.889778-96.910222 0-64-43.889778-106.055111-107.889778-106.055111z" fill="#FFFFFF" /></svg>

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="200px" height="200.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M926.952727 910.615273H95.813818a39.68 39.68 0 0 1-39.959273-39.330909V225.792c0-21.969455 18.152727-39.330909 39.959273-39.330909H926.952727c22.318545 0 39.959273 17.873455 39.959273 39.330909v645.492364c0 21.946182-18.152727 39.330909-39.959273 39.330909z" fill="#FFA000" /><path d="M499.712 373.294545H55.854545V158.394182c-0.069818-23.109818 17.338182-41.890909 38.935273-42.007273h303.802182c17.221818 0 32.349091 12.008727 37.422545 29.998546l63.697455 226.955636z" fill="#FFA000" /><path d="M858.763636 863.883636H187.345455c-21.248 0-38.074182-17.664-38.074182-38.865454V295.400727c0-21.713455 17.291636-38.865455 38.074182-38.865454H858.763636c21.271273 0 38.074182 17.687273 38.074182 38.865454V825.018182c0.465455 21.201455-16.802909 38.865455-38.074182 38.865454z" fill="#FFFFFF" /><path d="M926.952727 910.615273H95.813818c-22.318545 0-39.959273-17.710545-39.959273-38.958546V365.568c0-21.76 18.152727-38.958545 39.959273-38.958545H926.952727c22.318545 0 39.959273 17.710545 39.959273 38.958545v506.088727c0 21.76-18.152727 38.958545-39.959273 38.958546z" fill="#FFCA28" /><path d="M363.496727 486.260364H145.873455c-10.752 0-19.944727-9.332364-19.944728-21.410909 0-11.543273 8.704-21.434182 19.944728-21.434182h217.111272c10.705455 0 19.921455 9.332364 19.921455 21.434182 0 11.543273-8.704 21.434182-19.409455 21.434181z m0 144.034909H145.873455c-10.752 0-19.944727-9.355636-19.944728-21.434182 0-12.101818 8.704-21.457455 19.944728-21.457455h217.111272c10.705455 0 19.921455 9.355636 19.921455 21.457455s-8.704 21.434182-19.409455 21.434182z" fill="#FFF8E1" /></svg>

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="200px" height="200.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M661.944889 73.144889H146.289778a36.679111 36.679111 0 0 0-36.579556 36.565333v804.579556a36.679111 36.679111 0 0 0 36.579556 36.565333h731.420444a36.679111 36.679111 0 0 0 36.579556-36.565333v-588.8L661.944889 73.144889z" fill="#108EE9" /><path d="M661.944889 288.910222a36.679111 36.679111 0 0 0 36.565333 36.579556h215.779556L661.944889 73.144889v215.765333z" fill="#57A1F2" /><path d="M647.310222 420.565333l-27.420444 171.889778c-3.655111 31.089778-9.144889 64-12.8 96.910222a594.858667 594.858667 0 0 0-5.489778-25.6c-5.489778-23.765333-9.144889-47.530667-14.634667-69.475555L546.744889 420.551111h-64l-40.234667 171.889778c-7.310222 32.910222-12.8 64-18.275555 95.089778l-5.489778-43.889778c-1.834667-16.455111-5.489778-34.744889-7.310222-51.2l-31.089778-171.889778h-78.634667l67.655111 354.744889H460.8l38.4-175.544889c3.655111-21.930667 9.144889-43.875556 12.8-65.820444 3.655111 20.110222 7.310222 40.220444 12.8 65.820444l40.234667 173.724445h91.420444l64-351.089778v-3.655111h-73.144889v1.820444z" fill="#FFFFFF" /></svg>

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="200px" height="200.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M46.661818 848.290909L46.545455 726.667636l85.154909-346.554181h766.301091a52.875636 52.875636 0 0 1 50.664727 67.84l-23.505455 79.499636-83.013818 333.591273a52.875636 52.875636 0 0 1-51.293091 40.145454H99.537455a52.945455 52.945455 0 0 1-52.875637-52.898909z" fill="#FFEBC0" /><path d="M121.157818 446.533818L46.661818 726.109091V189.719273C46.661818 162.071273 68.608 139.636364 95.627636 139.636364h232.587637a48.011636 48.011636 0 0 1 34.583272 14.661818l100.282182 102.586182a9.565091 9.565091 0 0 0 6.912 2.955636H820.130909c26.973091 0 48.919273 22.481455 48.919273 50.129455v70.144H206.196364a88.645818 88.645818 0 0 0-84.992 66.466909l-0.069819-0.046546z" fill="#FFA000" /><path d="M928.465455 420.189091H206.196364c-22.272 0.232727-41.658182 15.383273-47.220364 36.980364L61.300364 837.934545a51.037091 51.037091 0 0 0 8.354909 43.566546c9.122909 12.334545 23.528727 19.642182 38.865454 19.688727h722.269091a49.245091 49.245091 0 0 0 47.220364-36.980363l97.675636-380.765091a50.664727 50.664727 0 0 0-8.308363-43.566546 48.174545 48.174545 0 0 0-38.912-19.688727z" fill="#FFCA28" /><path d="M594.850909 538.926545l155.810909 107.752728a15.872 15.872 0 0 1 0.093091 26.042182l-155.624727 108.846545a10.565818 10.565818 0 0 1-16.663273-8.680727v-57.646546h-221.323636a10.565818 10.565818 0 0 1-10.589091-10.565818l-0.209455-88.669091c0-4.747636 3.188364-8.913455 7.773091-10.193454l2.792727-0.418909h221.323637V547.607273a10.565818 10.565818 0 0 1 16.616727-8.657455z" fill="#FFFFFF" /></svg>

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="200px" height="200.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M661.944889 73.144889H146.289778a36.679111 36.679111 0 0 0-36.579556 36.565333v804.579556a36.679111 36.679111 0 0 0 36.579556 36.565333h731.420444a36.679111 36.679111 0 0 0 36.579556-36.565333v-588.8L661.944889 73.144889z" fill="#FCD165" /><path d="M661.944889 288.910222a36.679111 36.679111 0 0 0 36.565333 36.579556h215.779556L661.944889 73.144889v215.765333z" fill="#FFE3A6" /><path d="M334.634667 73.144889h73.130666v73.144889H334.648889V73.144889z m73.130666 73.144889h73.144889v73.144889h-73.144889v-73.144889z m-73.130666 73.144889h73.130666v73.130666H334.648889V219.448889z m73.130666 73.130666h73.144889v73.144889h-73.144889v-73.144889z m-73.130666 73.144889h73.130666v73.144889H334.648889v-73.144889z m109.710222 329.144889H371.2a36.679111 36.679111 0 0 1-36.565333-36.565333V548.551111h146.275555v109.724445c0 20.110222-14.620444 36.565333-36.565333 36.565333z m-36.579556-256h73.144889V512h-73.144889v-73.144889z" fill="#FFFFFF" /></svg>

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@ -79,6 +79,7 @@ const message = useMessage() // 消息弹窗
const emit = defineEmits(['update:modelValue'])
const props = defineProps({
parentId: propTypes.number.def(-1), //
modelValue: propTypes.oneOfType<string | string[]>([String, Array<String>]).isRequired,
fileType: propTypes.array.def(['doc', 'xls', 'ppt', 'txt', 'pdf']), // , ['png', 'jpg', 'jpeg']
fileSize: propTypes.number.def(5), // (MB)
@ -95,7 +96,7 @@ const uploadList = ref<UploadUserFile[]>([])
const fileList = ref<UploadUserFile[]>([])
const uploadNumber = ref<number>(0)
const { uploadUrl, httpRequest } = useUpload()
const { uploadUrl, httpRequest } = useUpload(props.parentId)
//
const beforeUpload: UploadProps['beforeUpload'] = (file: UploadRawFile) => {

View File

@ -70,6 +70,7 @@ type FileTypes =
//
const props = defineProps({
parentId: propTypes.number.def(-1), //
modelValue: propTypes.string.def(''),
drag: propTypes.bool.def(true), // ==> true
disabled: propTypes.bool.def(false), // ==> false
@ -99,7 +100,7 @@ const deleteImg = () => {
emit('update:modelValue', '')
}
const { uploadUrl, httpRequest } = useUpload()
const { uploadUrl, httpRequest } = useUpload(props.parentId)
const editImg = () => {
const dom = document.querySelector(`#${uuid.value} .el-upload__input`)

View File

@ -73,6 +73,7 @@ type FileTypes =
| 'image/x-icon'
const props = defineProps({
parentId: propTypes.number.def(-1), //
modelValue: propTypes.oneOfType<string | string[]>([String, Array<String>]).isRequired,
drag: propTypes.bool.def(true), // ==> true
disabled: propTypes.bool.def(false), // ==> false
@ -84,7 +85,7 @@ const props = defineProps({
borderradius: propTypes.string.def('8px') // ==> 8px
})
const { uploadUrl, httpRequest } = useUpload()
const { uploadUrl, httpRequest } = useUpload(props.parentId)
const fileList = ref<UploadUserFile[]>([])
const uploadNumber = ref<number>(0)

View File

@ -10,7 +10,8 @@ export const getUploadUrl = (): string => {
return import.meta.env.VITE_BASE_URL + import.meta.env.VITE_API_URL + '/infra/file/upload'
}
export const useUpload = () => {
export const useUpload = (parentId:number = -1) => {
console.log("useUpload",parentId)
// 后端上传地址
const uploadUrl = getUploadUrl()
// 是否使用前端直连上传
@ -25,14 +26,14 @@ export const useUpload = () => {
const presignedInfo = await FileApi.getFilePresignedUrl(fileName)
// 1.3 上传文件(不能使用 ElUpload 的 ajaxUpload 方法的原因:其使用的是 FormData 上传Minio 不支持)
return axios
.put(presignedInfo.uploadUrl, options.file, {
.put(parentId, presignedInfo.uploadUrl, options.file, {
headers: {
'Content-Type': options.file.type
}
})
.then(() => {
// 1.4. 记录文件信息到后端(异步)
createFile(presignedInfo, fileName, options.file)
createFile(parentId, presignedInfo, fileName, options.file)
// 通知成功,数据格式保持与后端上传的返回结果一致
return { data: presignedInfo.url }
})
@ -40,7 +41,7 @@ export const useUpload = () => {
// 模式二:后端上传
// 重写 el-upload httpRequest 文件上传成功会走成功的钩子,失败走失败的钩子
return new Promise((resolve, reject) => {
FileApi.updateFile({ file: options.file })
FileApi.updateFile({ parentId:parentId, file: options.file })
.then((res) => {
if (res.code === 0) {
resolve(res)
@ -67,8 +68,9 @@ export const useUpload = () => {
* @param name
* @param file
*/
function createFile(vo: FileApi.FilePresignedUrlRespVO, name: string, file: UploadRawFile) {
function createFile(vo: FileApi.FilePresignedUrlRespVO, name: string, file: UploadRawFile, parentId:number = -1) {
const fileVo = {
parentId: parentId,
configId: vo.configId,
url: vo.url,
path: name,

View File

@ -41,15 +41,19 @@ const message = useMessage() // 消息弹窗
const dialogVisible = ref(false) //
const formLoading = ref(false) //
const fileList = ref([]) //
const data = ref({ path: '' })
const data = ref({ parentId: -1, path: '' })
const uploadRef = ref()
const { uploadUrl, httpRequest } = useUpload()
const uploadUrl = ref("")
const httpRequest = ref()
/** 打开弹窗 */
const open = async () => {
dialogVisible.value = true
resetForm()
const open = async (parentId: number = -1) => {
const uploadInfo = useUpload(parentId)
uploadUrl.value = uploadInfo.uploadUrl
httpRequest.value = uploadInfo.httpRequest
dialogVisible.value = true
resetForm()
}
defineExpose({ open }) // open

View File

@ -0,0 +1,84 @@
<template>
<div>
<div :style="'width:'+(width+2)+'px;height:'+(height+2)+'px;padding:1px'">
<el-image :src='`${fileTypes[type]}`' fit="cover" :style="'width:'+(width-2)+'px;height:'+(height-2)+'px;'" />
</div>
<div :title="fileName" :style="'width:'+(width-2)+'px;font-size:'+fontSize+'px'" class="fileName">{{fileName}}</div>
</div>
</template>
<script lang="ts" setup>
import { propTypes } from '@/utils/propTypes'
defineOptions({ name: 'InfraIconForFiles' })
const props = defineProps({
type: propTypes.string.def('other'),
fileName: propTypes.string.isRequired,
width: propTypes.number.def(6),
height: propTypes.number.def(6),
fontSize:propTypes.number.def(0.7)
})
import deleteFile from "@/assets/svgs/file_type_svg/huishouzhan.svg"
import rename from "@/assets/svgs/file_type_svg/mingming.svg"
import move from "@/assets/svgs/file_type_svg/yidongwenjian.svg"
import ai from "@/assets/svgs/file_type_svg/ai.svg"
import excel from "@/assets/svgs/file_type_svg/excel.svg"
import gif from "@/assets/svgs/file_type_svg/gif.svg"
import html from "@/assets/svgs/file_type_svg/html.svg"
import image from "@/assets/svgs/file_type_svg/image.svg"
import pdf from "@/assets/svgs/file_type_svg/pdf.svg"
import ppt from "@/assets/svgs/file_type_svg/PPT.svg"
import psd from "@/assets/svgs/file_type_svg/PSD.svg"
import video from "@/assets/svgs/file_type_svg/video.svg"
import svg from "@/assets/svgs/file_type_svg/SVG.svg"
import txt from "@/assets/svgs/file_type_svg/txt.svg"
import other from "@/assets/svgs/file_type_svg/weizhiwenjian.svg"
import folder from "@/assets/svgs/file_type_svg/wenjianjia.svg"
import word from "@/assets/svgs/file_type_svg/word.svg"
import zip from "@/assets/svgs/file_type_svg/zip.svg"
import audio from "@/assets/svgs/file_type_svg/audio.svg"
const fileTypes = ref({
'delete': deleteFile,
'rename': rename,
'move': move,
'ai': ai,
'excel': excel,
'gif': gif,
'html': html,
'image/png': image,
'pdf': pdf,
'ppt': ppt,
'psd': psd,
'video': video,
'svg': svg,
'txt': txt,
'other': other,
'folder': folder,
'word': word,
'zip': zip,
'audio': audio
})
</script>
<style scoped>
.image {
margin: auto;
}
.fileName {
text-align: center;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
word-break: break-all;
}
</style>

View File

@ -1,143 +1,226 @@
<template>
<doc-alert title="上传下载" url="https://doc.iocoder.cn/file/" />
<!-- 搜索 -->
<ContentWrap>
<el-form
class="-mb-15px"
:model="queryParams"
ref="queryFormRef"
:inline="true"
label-width="68px"
>
<el-form-item label="文件路径" prop="path">
<el-input
v-model="queryParams.path"
placeholder="请输入文件路径"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="文件类型" prop="type" width="80">
<el-input
v-model="queryParams.type"
placeholder="请输入文件类型"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="创建时间" prop="createTime">
<el-date-picker
v-model="queryParams.createTime"
value-format="YYYY-MM-DD HH:mm:ss"
type="daterange"
start-placeholder="开始日期"
end-placeholder="结束日期"
:default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
class="!w-240px"
/>
</el-form-item>
<el-form-item>
<el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button>
<el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
<el-button type="primary" plain @click="openForm">
<Icon icon="ep:upload" class="mr-5px" /> 上传文件
</el-button>
</el-form-item>
</el-form>
</ContentWrap>
<doc-alert title="上传下载" url="https://doc.iocoder.cn/file/" />
<!-- 搜索 -->
<div v-if="!showWindow">
<ContentWrap>
<el-form
class="-mb-15px"
:model="queryParams"
ref="queryFormRef"
:inline="true"
label-width="68px"
>
<el-form-item label="文件路径" prop="path">
<el-input
v-model="queryParams.path"
placeholder="请输入文件路径"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="文件类型" prop="type" width="80">
<el-input
v-model="queryParams.type"
placeholder="请输入文件类型"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="创建时间" prop="createTime">
<el-date-picker
v-model="queryParams.createTime"
value-format="YYYY-MM-DD HH:mm:ss"
type="daterange"
start-placeholder="开始日期"
end-placeholder="结束日期"
:default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
class="!w-240px"
/>
</el-form-item>
<el-form-item>
<el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button>
<el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
<el-button type="primary" plain @click="openForm">
<Icon icon="ep:upload" class="mr-5px" /> 上传文件
</el-button>
<el-button @click="updateShow"><Icon icon="ep:folder-opened" class="mr-5px" /> 窗口显示</el-button>
</el-form-item>
</el-form>
</ContentWrap>
<!-- 列表 -->
<ContentWrap>
<el-table v-loading="loading" :data="list">
<el-table-column label="文件名" align="center" prop="name" :show-overflow-tooltip="true" />
<el-table-column label="文件路径" align="center" prop="path" :show-overflow-tooltip="true" />
<el-table-column label="URL" align="center" prop="url" :show-overflow-tooltip="true" />
<el-table-column
label="文件大小"
align="center"
prop="size"
width="120"
:formatter="fileSizeFormatter"
/>
<el-table-column label="文件类型" align="center" prop="type" width="180px" />
<el-table-column label="文件内容" align="center" prop="url" width="110px">
<template #default="{ row }">
<el-image
v-if="row.type.includes('image')"
class="h-80px w-80px"
lazy
:src="row.url"
:preview-src-list="[row.url]"
preview-teleported
fit="cover"
/>
<el-link
v-else-if="row.type.includes('pdf')"
type="primary"
:href="row.url"
:underline="false"
target="_blank"
>预览</el-link
>
<el-link v-else type="primary" download :href="row.url" :underline="false" target="_blank"
>下载</el-link
>
</template>
</el-table-column>
<el-table-column
label="上传时间"
align="center"
prop="createTime"
width="180"
:formatter="dateFormatter"
/>
<el-table-column label="操作" align="center">
<template #default="scope">
<el-button link type="primary" @click="copyToClipboard(scope.row.url)">
复制链接
</el-button>
<el-button
link
type="danger"
@click="handleDelete(scope.row.id)"
v-hasPermi="['infra:file:delete']"
>
删除
</el-button>
</template>
</el-table-column>
</el-table>
<!-- 分页 -->
<Pagination
:total="total"
v-model:page="queryParams.pageNo"
v-model:limit="queryParams.pageSize"
@pagination="getList"
/>
</ContentWrap>
</div>
<div v-else>
<ContentWrap>
<div>
<el-form class="-mb-15px" :model="queryParams" ref="queryFormRef" :inline="true" label-width="68px">
<el-form-item label="文件名称" prop="path">
<el-input
v-model="queryParams.name"
placeholder="请输入文件名称"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="文件类型" prop="type" width="80">
<el-input
v-model="queryParams.type"
placeholder="请输入文件类型"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="创建时间" prop="createTime">
<el-date-picker
v-model="queryParams.createTime"
value-format="YYYY-MM-DD HH:mm:ss"
type="daterange"
start-placeholder="开始日期"
end-placeholder="结束日期"
:default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
class="!w-240px"
/>
</el-form-item>
<el-form-item>
<el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button>
<el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
<el-button type="primary" plain @click="openForm">
<Icon icon="ep:upload" class="mr-5px" /> 上传文件
</el-button>
<el-button @click="createFolder"><Icon icon="ep:folder-add" class="mr-5px" /> 新文件夹</el-button>
<el-button @click="updateShow"><Icon icon="fa-solid:list" class="mr-5px" /> 列表显示</el-button>
</el-form-item>
</el-form>
</div>
<div>
</div>
</ContentWrap>
<!-- 窗口显示 -->
<ContentWrap>
<div>
<span v-for="item in nowPath" :key="item.id">
<el-button type="text" @click="beforeGetList(item.id)"> {{item.name}} / </el-button>
</span>
<div v-loading="loading" style="margin-top: 10px;user-select: none;">
<div v-for="item in list" :key="item.id" style="display: inline-block;cursor: pointer;">
<div v-if="item.type==='folder'" style="margin-left: 15px;display: inline-block;cursor: pointer;">
<IconForFiles :type="item.type" :fileName="item.name" :width='100'
:height='100' :fontSize="14" @click="beforeGetList(item)" @contextmenu.prevent="beforeOperate(item)"/>
</div>
</div>
<div v-for="item in list" :key="item.id" style="display: inline-block;cursor: pointer;">
<div v-if="item.type!=='folder'" style="margin-left: 15px;display: inline-block;cursor: pointer;">
<IconForFiles :src="item.type" :fileName="item.name" :width='100'
:height='100' :fontSize="14" @click="beforeGetList(item)" @contextmenu.prevent="beforeOperate(item)"/>
</div>
</div>
</div>
</div>
</ContentWrap>
</div>
<!-- 列表 -->
<ContentWrap>
<el-table v-loading="loading" :data="list">
<el-table-column label="文件名" align="center" prop="name" :show-overflow-tooltip="true" />
<el-table-column label="文件路径" align="center" prop="path" :show-overflow-tooltip="true" />
<el-table-column label="URL" align="center" prop="url" :show-overflow-tooltip="true" />
<el-table-column
label="文件大小"
align="center"
prop="size"
width="120"
:formatter="fileSizeFormatter"
/>
<el-table-column label="文件类型" align="center" prop="type" width="180px" />
<el-table-column label="文件内容" align="center" prop="url" width="110px">
<template #default="{ row }">
<el-image
v-if="row.type.includes('image')"
class="h-80px w-80px"
lazy
:src="row.url"
:preview-src-list="[row.url]"
preview-teleported
fit="cover"
/>
<el-link
v-else-if="row.type.includes('pdf')"
type="primary"
:href="row.url"
:underline="false"
target="_blank"
>预览</el-link
>
<el-link v-else type="primary" download :href="row.url" :underline="false" target="_blank"
>下载</el-link
>
</template>
</el-table-column>
<el-table-column
label="上传时间"
align="center"
prop="createTime"
width="180"
:formatter="dateFormatter"
/>
<el-table-column label="操作" align="center">
<template #default="scope">
<el-button link type="primary" @click="copyToClipboard(scope.row.url)">
复制链接
</el-button>
<el-button
link
type="danger"
@click="handleDelete(scope.row.id)"
v-hasPermi="['infra:file:delete']"
>
删除
</el-button>
</template>
</el-table-column>
</el-table>
<!-- 分页 -->
<Pagination
:total="total"
v-model:page="queryParams.pageNo"
v-model:limit="queryParams.pageSize"
@pagination="getList"
/>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<FileForm ref="formRef" @success="getList" />
<!-- 表单弹窗添加/修改 -->
<FileForm ref="formRef" @success="getList" />
</template>
<script lang="ts" setup>
import { fileSizeFormatter } from '@/utils'
import { dateFormatter } from '@/utils/formatTime'
import * as FileApi from '@/api/infra/file'
import FileForm from './FileForm.vue'
import IconForFiles from './IconForFiles.vue'
defineOptions({ name: 'InfraFile' })
const showWindow = ref(false)
const parentId = ref(showWindow.value ? 0 : -1)
const message = useMessage() //
const { t } = useI18n() //
const loading = ref(true) //
const total = ref(0) //
const list = ref([]) //
const nowPath = ref([{id:0,name:"根目录"}])
const fileInfo = ref({}) //
const queryParams = reactive({
pageNo: 1,
pageSize: 10,
parentId: parentId.value,
name: undefined,
type: undefined,
path: undefined,
@ -149,9 +232,13 @@ const queryFormRef = ref() // 搜索的表单
const getList = async () => {
loading.value = true
try {
const data = await FileApi.getFilePage(queryParams)
list.value = data.list
total.value = data.total
if (!showWindow.value) {
const data = await FileApi.getFilePage(queryParams)
list.value = data.list
total.value = data.total
} else {
list.value = await FileApi.getFileList(queryParams)
}
} finally {
loading.value = false
}
@ -172,7 +259,7 @@ const resetQuery = () => {
/** 添加/修改操作 */
const formRef = ref()
const openForm = () => {
formRef.value.open()
formRef.value.open(queryParams.parentId)
}
/** 复制到剪贴板方法 */
@ -199,4 +286,110 @@ const handleDelete = async (id: number) => {
onMounted(() => {
getList()
})
const updateShow = () => {
showWindow.value = !showWindow.value
if (showWindow.value) {
if (parentId.value === -1) {
parentId.value = 0
}
queryParams.parentId = parentId.value
} else {
parentId.value = queryParams.parentId
queryParams.parentId = -1
}
getList()
}
const createFolder = async () => {
ElMessageBox.prompt('请输入文件名', 'Tip', {
confirmButtonText: '确定',
cancelButtonText: '取消',
inputPattern:
/^.+$/,
inputErrorMessage: '请输入合法的文件夹名称',
}).then( async ({ value }) => {
const params = {
parentId: queryParams.parentId,
name: value,
url: "/",
path: "/",
configId: 0,
size: 1,
type: "folder"
}
await FileApi.createFile(params)
ElMessage({
type: 'success',
message: `创建文件夹成功`,
})
getList()
})
.catch(() => {
ElMessage({
type: 'info',
message: '创建文件夹失败',
})
})
}
//
const beforeGetList = (target) => {
if(typeof target == 'number') {
let isTrue = false
for(let i = 0; i < nowPath.value.length; i++) {
if(isTrue) {
nowPath.value.splice(i, 9999999)
} else {
if(nowPath.value[i].id === target) {
isTrue = true
parentId.value = target
queryParams.parentId = target
}
}
}
getList()
} else if (target.type === 'folder') {
parentId.value = target.id
queryParams.parentId = target.id
nowPath.value.push(target)
getList()
} else {
console.log('target', target)
const link = document.createElement('a')
link.href = target.url
link.download = target.name
link.target = '_blank'
link.style.display = 'none'
document.body.append(link)
link.click()
message.success("开始下载文件")
}
}
const getNowPath = () => {
let path = ''
for (let i = 0; i < nowPath.value.length; i++) {
path += nowPath.value[i] + '/'
}
return path
}
const beforeOperate = (item) => {
target.value = item
getTargetFileInfo(item.name)
}
const getTargetFileInfo = (item) => {
fileInfo.value = item
}
</script>