压缩文件图标显示错误
This commit is contained in:
parent
6063376a9a
commit
6dc83b1718
45
web/src/views/testdata/datamanagement/index.vue
vendored
45
web/src/views/testdata/datamanagement/index.vue
vendored
@ -639,21 +639,6 @@ const loacalselect = ref()
|
||||
const radio1 = ref()
|
||||
const diffloding = ref(false)
|
||||
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() {
|
||||
difference.value = false
|
||||
}
|
||||
@ -1101,9 +1086,10 @@ async function submitcreat(formEl: any) {
|
||||
//路径导航条
|
||||
const patharr = ref([])
|
||||
function pathclick(row: any, index: any) {
|
||||
|
||||
patharr.value.splice(index + 1)
|
||||
creatform.value.parentId = row.id
|
||||
creatform.value.workPath = convertArrayToPath(patharr.value)
|
||||
creatform.value.workPath = convertArrayToPath1(patharr.value)
|
||||
getdata()
|
||||
}
|
||||
// 压缩文件
|
||||
@ -1160,7 +1146,7 @@ async function submitzip(formEl: any) {
|
||||
})
|
||||
zipObj.value.ids = idsarr.join(',')
|
||||
zipObj.value.parentId = zipParentid.value
|
||||
gettreedata()
|
||||
// gettreedata()
|
||||
getdata()
|
||||
zipfiles.value = false
|
||||
compress(zipObj.value).then((res: any) => {
|
||||
@ -1174,14 +1160,16 @@ async function submitzip(formEl: any) {
|
||||
})
|
||||
} else {
|
||||
// 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) {
|
||||
ElMessage.success('解压成功')
|
||||
gettreedata()
|
||||
// // gettreedata()
|
||||
// pathclick({ id: '' }, -1)
|
||||
getdata()
|
||||
zipfiles.value = false
|
||||
tableIdarr.value.length = 0
|
||||
}
|
||||
jieFilearr.value.workPath = ''
|
||||
|
||||
})
|
||||
}
|
||||
@ -1195,7 +1183,7 @@ function zipClose() {
|
||||
}
|
||||
//查询文件夹
|
||||
const listFilesarr = ref([])
|
||||
const filetsobj = ref({
|
||||
const filetsobj:any = ref({
|
||||
id: '',
|
||||
path: '',
|
||||
})
|
||||
@ -1203,6 +1191,8 @@ const multipleTableRef = ref()
|
||||
const jieFilearr: any = ref({})
|
||||
const jiepatharr: any = ref([])
|
||||
function gettsfiles() {
|
||||
filetsobj.value.nodeId = pathid.value
|
||||
filetsobj.value.taskId = projectId.value
|
||||
listTsFiles(filetsobj.value).then((res: any) => {
|
||||
listFilesarr.value = res.data
|
||||
if (res.data[0]) {
|
||||
@ -1241,6 +1231,7 @@ function fileSelection(row: any) {
|
||||
jieFilearr.value = row[0]
|
||||
}
|
||||
function pathFile(index: any) {
|
||||
|
||||
jiepatharr.value.splice(index + 1)
|
||||
filetsobj.value.path = convertArrayToPath(jiepatharr.value)
|
||||
gettsfiles()
|
||||
@ -1293,12 +1284,22 @@ function convertPathToArray(fullPath: string): string[] {
|
||||
}
|
||||
// 路径转换方法(数组转路径)
|
||||
function convertArrayToPath(segments: string[]): string {
|
||||
|
||||
// 处理空数组返回根路径
|
||||
if (segments.length === 0) return '/'
|
||||
|
||||
// 过滤空值并拼接路径
|
||||
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) {
|
||||
// 使用正则表达式匹配文件名中的后缀部分
|
||||
// 这个正则表达式匹配从最后一个点开始到字符串末尾的所有字符
|
||||
@ -1410,7 +1411,7 @@ function removeSuffix(filename: any) {
|
||||
@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)"
|
||||
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;">
|
||||
<img v-else-if="getFileExtension(scope.row.fileName) == 'mp3'"
|
||||
@click="openPreview(scope.row)" src="@/assets/fileimg/mp3.png" alt="" style="cursor: pointer;">
|
||||
@ -1575,7 +1576,7 @@ function removeSuffix(filename: any) {
|
||||
<template #prepend>
|
||||
<el-popover :visible="visible" placement="right" :width="400" trigger="click">
|
||||
<template #reference>
|
||||
<el-icon style="cursor: pointer;" @click="visible = !visible">
|
||||
<el-icon style="cursor: pointer;" @click="visible = !visible,pathFile(-1)">
|
||||
<Folder />
|
||||
</el-icon>
|
||||
</template>
|
||||
|
@ -8,7 +8,7 @@ export default {
|
||||
import { ref, onMounted, nextTick, defineAsyncComponent } from "vue";
|
||||
import { Search } from '@element-plus/icons-vue'
|
||||
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 useFileUpload from "@/components/file/file/useFileUpload";
|
||||
@ -438,9 +438,36 @@ function moretablerestore() {
|
||||
downloadToLocal({ parameterLists: restoreArr.value }).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)
|
||||
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) => {
|
||||
minioOnlyFiles.value = minioOnlyFiles.value.filter((item: any) => item.id !== item.id)
|
||||
md5MismatchedFiles.value = md5MismatchedFiles.value.filter((item: any) => item.id !== item.id)
|
||||
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>
|
||||
</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">
|
||||
<template #default="scope">
|
||||
<span style="display: flex;justify-content:center;">
|
||||
@ -773,7 +800,7 @@ function CloseView() {
|
||||
</template>
|
||||
</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">
|
||||
<template #default="scope">
|
||||
<span style="display: flex;justify-content:space-around;">
|
||||
@ -788,8 +815,13 @@ function CloseView() {
|
||||
</div>
|
||||
<div class="newContent">
|
||||
<div class="newContent_title"><span class="newContent_title_text">缺失内容:</span>
|
||||
<div>
|
||||
<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>
|
||||
<el-table v-loading="loading" :data="minioOnlyFiles" @selection-change="restoreChange"
|
||||
:header-cell-style="{ background: 'rgb(250 250 250)', height: '50px' }"
|
||||
@ -809,8 +841,8 @@ function CloseView() {
|
||||
</template>
|
||||
</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 fixed="right" label="操作" width="120" align="center">
|
||||
<el-table-column prop="formattedTime" width="170" label="修改日期"></el-table-column>
|
||||
<el-table-column fixed="right" label="操作" width="60" align="center">
|
||||
<template #default="scope">
|
||||
<span style="display: flex;justify-content:center;">
|
||||
<img @click="tablerestore(scope.row)" style="cursor: pointer;"
|
||||
|
Loading…
Reference in New Issue
Block a user