压缩文件图标显示错误

This commit is contained in:
wangxk 2025-03-14 09:00:42 +08:00
parent 6063376a9a
commit 6dc83b1718
2 changed files with 65 additions and 32 deletions

View File

@ -639,21 +639,6 @@ const loacalselect = ref()
const radio1 = ref() const radio1 = ref()
const diffloding = ref(false) const diffloding = ref(false)
const diffdata: any = ref({}) const diffdata: any = ref({})
function opendifference(row: any) {
diffloding.value = true
compare({ localPath: creatform.value.workPath ? creatform.value.workPath : '/', minioPath: creatform.value.workPath ? creatform.value.workPath : '/' }).then((res: any) => {
if (res.code == 0) {
diffdata.value = res.data
diffloding.value = false
difference.value = true
}
})
minioselect.value = ''
loacalselect.value = ''
radio1.value = ''
}
function differenceClose() { function differenceClose() {
difference.value = false difference.value = false
} }
@ -1101,9 +1086,10 @@ async function submitcreat(formEl: any) {
// //
const patharr = ref([]) const patharr = ref([])
function pathclick(row: any, index: any) { function pathclick(row: any, index: any) {
patharr.value.splice(index + 1) patharr.value.splice(index + 1)
creatform.value.parentId = row.id creatform.value.parentId = row.id
creatform.value.workPath = convertArrayToPath(patharr.value) creatform.value.workPath = convertArrayToPath1(patharr.value)
getdata() getdata()
} }
// //
@ -1160,7 +1146,7 @@ async function submitzip(formEl: any) {
}) })
zipObj.value.ids = idsarr.join(',') zipObj.value.ids = idsarr.join(',')
zipObj.value.parentId = zipParentid.value zipObj.value.parentId = zipParentid.value
gettreedata() // gettreedata()
getdata() getdata()
zipfiles.value = false zipfiles.value = false
compress(zipObj.value).then((res: any) => { compress(zipObj.value).then((res: any) => {
@ -1174,14 +1160,16 @@ async function submitzip(formEl: any) {
}) })
} else { } else {
// loading.value = true // loading.value = true
Decompression({ id: jiezip.value.id, parentId: jiezip.value.parentId, decompressionPath: jieFilearr.value.workPath }).then((res: any) => { Decompression({ id: jiezip.value.id, parentId: zipParentid.value, decompressionPath: jieFilearr.value.workPath?jieFilearr.value.workPath : filetsobj.value.path }).then((res: any) => {
if (res.code == 0) { if (res.code == 0) {
ElMessage.success('解压成功') ElMessage.success('解压成功')
gettreedata() // // gettreedata()
// pathclick({ id: '' }, -1)
getdata() getdata()
zipfiles.value = false zipfiles.value = false
tableIdarr.value.length = 0 tableIdarr.value.length = 0
} }
jieFilearr.value.workPath = ''
}) })
} }
@ -1195,7 +1183,7 @@ function zipClose() {
} }
// //
const listFilesarr = ref([]) const listFilesarr = ref([])
const filetsobj = ref({ const filetsobj:any = ref({
id: '', id: '',
path: '', path: '',
}) })
@ -1203,6 +1191,8 @@ const multipleTableRef = ref()
const jieFilearr: any = ref({}) const jieFilearr: any = ref({})
const jiepatharr: any = ref([]) const jiepatharr: any = ref([])
function gettsfiles() { function gettsfiles() {
filetsobj.value.nodeId = pathid.value
filetsobj.value.taskId = projectId.value
listTsFiles(filetsobj.value).then((res: any) => { listTsFiles(filetsobj.value).then((res: any) => {
listFilesarr.value = res.data listFilesarr.value = res.data
if (res.data[0]) { if (res.data[0]) {
@ -1241,6 +1231,7 @@ function fileSelection(row: any) {
jieFilearr.value = row[0] jieFilearr.value = row[0]
} }
function pathFile(index: any) { function pathFile(index: any) {
jiepatharr.value.splice(index + 1) jiepatharr.value.splice(index + 1)
filetsobj.value.path = convertArrayToPath(jiepatharr.value) filetsobj.value.path = convertArrayToPath(jiepatharr.value)
gettsfiles() gettsfiles()
@ -1293,12 +1284,22 @@ function convertPathToArray(fullPath: string): string[] {
} }
// //
function convertArrayToPath(segments: string[]): string { function convertArrayToPath(segments: string[]): string {
// //
if (segments.length === 0) return '/' if (segments.length === 0) return '/'
// //
return '/' + segments.filter(Boolean).join('/') + '/' return '/' + segments.filter(Boolean).join('/') + '/'
} }
function convertArrayToPath1(segments: string[]): string {
//
if (segments.length === 0) return '/'
//
return '/' + segments.map((item:any) => item.fileName).join('/') + '/'
}
function removeSuffix(filename: any) { function removeSuffix(filename: any) {
// 使 // 使
// //
@ -1410,7 +1411,7 @@ function removeSuffix(filename: any) {
@click="openPreview(scope.row)" src="@/assets/fileimg/mp4.png" alt="" style="cursor: pointer;"> @click="openPreview(scope.row)" src="@/assets/fileimg/mp4.png" alt="" style="cursor: pointer;">
<img v-else-if="scope.row.isFile == 'FOLDER'" src="@/assets/fileimg/wenjianjia.png" alt="" @click="openNode(scope.row)" <img v-else-if="scope.row.isFile == 'FOLDER'" src="@/assets/fileimg/wenjianjia.png" alt="" @click="openNode(scope.row)"
style="cursor: pointer;"> style="cursor: pointer;">
<img v-else-if="getFileExtension(scope.row.fileName) == 'zip'" <img v-else-if="scope.row.type == 'ZIP'"
@click="openPreview(scope.row)" src="@/assets/fileimg/zip.png" alt="" style="cursor: pointer;"> @click="openPreview(scope.row)" src="@/assets/fileimg/zip.png" alt="" style="cursor: pointer;">
<img v-else-if="getFileExtension(scope.row.fileName) == 'mp3'" <img v-else-if="getFileExtension(scope.row.fileName) == 'mp3'"
@click="openPreview(scope.row)" src="@/assets/fileimg/mp3.png" alt="" style="cursor: pointer;"> @click="openPreview(scope.row)" src="@/assets/fileimg/mp3.png" alt="" style="cursor: pointer;">
@ -1575,7 +1576,7 @@ function removeSuffix(filename: any) {
<template #prepend> <template #prepend>
<el-popover :visible="visible" placement="right" :width="400" trigger="click"> <el-popover :visible="visible" placement="right" :width="400" trigger="click">
<template #reference> <template #reference>
<el-icon style="cursor: pointer;" @click="visible = !visible"> <el-icon style="cursor: pointer;" @click="visible = !visible,pathFile(-1)">
<Folder /> <Folder />
</el-icon> </el-icon>
</template> </template>

View File

@ -8,7 +8,7 @@ export default {
import { ref, onMounted, nextTick, defineAsyncComponent } from "vue"; import { ref, onMounted, nextTick, defineAsyncComponent } from "vue";
import { Search } from '@element-plus/icons-vue' import { Search } from '@element-plus/icons-vue'
import { ElMessageBox, ElMessage } from "element-plus"; import { ElMessageBox, ElMessage } from "element-plus";
import { tstaskList, getTsNodesTree, tsFilesPage } from "@/api/datamanagement"; import { tstaskList, getTsNodesTree, tsFilesPage, deleteTsFilesByIds } from "@/api/datamanagement";
import { listLocalAndBackup, compare, uploadToBackup, downloadToLocal, deleteTsFilesById } from "@/api/fileSynchronization"; import { listLocalAndBackup, compare, uploadToBackup, downloadToLocal, deleteTsFilesById } from "@/api/fileSynchronization";
// //
import useFileUpload from "@/components/file/file/useFileUpload"; import useFileUpload from "@/components/file/file/useFileUpload";
@ -438,9 +438,36 @@ function moretablerestore() {
downloadToLocal({ parameterLists: restoreArr.value }).then((res: any) => { downloadToLocal({ parameterLists: restoreArr.value }).then((res: any) => {
if (res.code == '0') { if (res.code == '0') {
ElMessage.success("恢复成功") ElMessage.success("恢复成功")
restoreArr.value.forEach((item: any) => { restoreArr.value.forEach((items: any) => {
minioOnlyFiles.value = minioOnlyFiles.value.filter((item: any) => item.id !== item.id) minioOnlyFiles.value = minioOnlyFiles.value.filter((item: any) => item.id !== items.id)
md5MismatchedFiles.value = md5MismatchedFiles.value.filter((item: any) => item.id !== item.id) md5MismatchedFiles.value = md5MismatchedFiles.value.filter((item: any) => item.id !== items.id)
})
}
})
})
}
function delhuifu() {
ElMessageBox.confirm(
'您确定要删除这些文件/文件夹吗?(删除后将无法恢复)',
'警告',
{
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}
)
.then(() => {
const ids = ref([])
restoreArr.value.forEach((item: any) => {
ids.value.push(item.id)
})
// debugger
deleteTsFilesByIds({ id: ids.value.join(','), type: 'minio' }).then((res: any) => {
if (res.code == '0') {
ElMessage.success("删除成功")
restoreArr.value.forEach((items: any) => {
minioOnlyFiles.value = minioOnlyFiles.value.filter((item: any) => item.id !== items.id)
}) })
} }
}) })
@ -734,7 +761,7 @@ function CloseView() {
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="path" label="路径"></el-table-column> <el-table-column prop="path" label="路径"></el-table-column>
<el-table-column prop="time" width="170" label="修改日期"></el-table-column> <el-table-column prop="formattedTime" width="170" label="修改日期"></el-table-column>
<el-table-column fixed="right" label="操作" width="60" align="center"> <el-table-column fixed="right" label="操作" width="60" align="center">
<template #default="scope"> <template #default="scope">
<span style="display: flex;justify-content:center;"> <span style="display: flex;justify-content:center;">
@ -773,7 +800,7 @@ function CloseView() {
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="path" label="路径"></el-table-column> <el-table-column prop="path" label="路径"></el-table-column>
<el-table-column prop="time" width="170" label="修改日期"></el-table-column> <el-table-column prop="formattedTime" width="170" label="修改日期"></el-table-column>
<el-table-column label="操作" width="80" align="center"> <el-table-column label="操作" width="80" align="center">
<template #default="scope"> <template #default="scope">
<span style="display: flex;justify-content:space-around;"> <span style="display: flex;justify-content:space-around;">
@ -788,8 +815,13 @@ function CloseView() {
</div> </div>
<div class="newContent"> <div class="newContent">
<div class="newContent_title"><span class="newContent_title_text">缺失内容</span> <div class="newContent_title"><span class="newContent_title_text">缺失内容</span>
<el-button type="primary" :disabled="restoreArr.length == 0" <div>
@click="moretablerestore()">恢复</el-button> <el-button type="primary" :disabled="restoreArr.length == 0"
@click="moretablerestore()">恢复</el-button>
<el-button type="primary" :disabled="restoreArr.length == 0"
@click="delhuifu()">删除</el-button>
</div>
</div> </div>
<el-table v-loading="loading" :data="minioOnlyFiles" @selection-change="restoreChange" <el-table v-loading="loading" :data="minioOnlyFiles" @selection-change="restoreChange"
:header-cell-style="{ background: 'rgb(250 250 250)', height: '50px' }" :header-cell-style="{ background: 'rgb(250 250 250)', height: '50px' }"
@ -809,8 +841,8 @@ function CloseView() {
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="path" label="路径"></el-table-column> <el-table-column prop="path" label="路径"></el-table-column>
<el-table-column prop="time" width="170" label="修改日期"></el-table-column> <el-table-column prop="formattedTime" width="170" label="修改日期"></el-table-column>
<el-table-column fixed="right" label="操作" width="120" align="center"> <el-table-column fixed="right" label="操作" width="60" align="center">
<template #default="scope"> <template #default="scope">
<span style="display: flex;justify-content:center;"> <span style="display: flex;justify-content:center;">
<img @click="tablerestore(scope.row)" style="cursor: pointer;" <img @click="tablerestore(scope.row)" style="cursor: pointer;"