预览问题

This commit is contained in:
wangxk 2025-05-23 17:59:36 +08:00
parent dd2c65eabb
commit a2019b093b
3 changed files with 46 additions and 13 deletions

View File

@ -126,3 +126,11 @@ export function compareMinioList(params:any) {
params:params,
});
}
//获取异步
export function automaticFileBackupData(params:any) {
return request({
url: '/experimentalData/ts-files/automaticFileBackupData',
method: 'post',
params:params,
});
}

View File

@ -786,7 +786,7 @@ function tonstatus(){
<el-button type="primary" :loading="tonloading" @click="scan()" style="width: 100%;margin-bottom: 5px;">{{ buttonmsg
}}</el-button>
<el-button type="primary" :loading="tonloading1" @click="upfileZip()"
style="width: 100%;margin-left: 0px;">上传项目包并扫描</el-button>
style="width: 100%;margin-left: 0px;">{{buttonmsg1}}</el-button>
</div>
</div>

View File

@ -9,7 +9,7 @@ import { ref, onMounted, nextTick, defineAsyncComponent, onBeforeUnmount } from
import { Search } from '@element-plus/icons-vue'
import { ElMessageBox, ElMessage } from "element-plus";
import { tstaskList, getTsNodesTree, tsFilesPage, deleteTsFilesByIds } from "@/api/datamanagement";
import { listLocalAndBackup, compare, compareLocalList, automaticFileBackupByIds, compareMd5List, compareMinioList, compareLocal, compareMd5, compareMinio, uploadToBackup, downloadToLocal, deleteTsFilesById, automaticFileBackup, obtainUrl, listBackupTree, listLocalTree } from "@/api/fileSynchronization";
import { listLocalAndBackup, compare, compareLocalList, automaticFileBackupByIds, compareMd5List, compareMinioList, compareLocal, compareMd5, compareMinio, uploadToBackup, downloadToLocal, deleteTsFilesById, automaticFileBackup, obtainUrl, listBackupTree, listLocalTree,automaticFileBackupData } from "@/api/fileSynchronization";
import { debounce } from 'lodash-es';
import Page from '@/components/Pagination/page.vue';
//text
@ -86,7 +86,22 @@ function gettreeTwo() {
getlocaltree()
getminiotree()
}
///
const tonloading = ref(false)
const buttonmsg = ref('文件备份')
function tonstatus(){
//sao
automaticFileBackupData({nodeId:pathid.value,taskId:projectId.value}).then((res:any)=>{
if(res.msg == '1'){
tonloading.value = false
buttonmsg.value = '文件备份'
}else{
tonloading.value = true
buttonmsg.value = '处理中...'
}
})
}
////
function backups() {
ElMessageBox.confirm(
'您确定要将文件/文件夹自动备份到备份空间吗?',
@ -119,6 +134,7 @@ function backups() {
automaticFileBackupByIds(params).then((res: any) => {
if (res.code == 0) {
ElMessage.success(res.msg)
tonstatus()
getlocaltree()
getminiotree()
}
@ -127,6 +143,7 @@ function backups() {
automaticFileBackup(params).then((res: any) => {
if (res.code == 0) {
ElMessage.success(res.msg)
tonstatus()
getlocaltree()
getminiotree()
}
@ -351,6 +368,7 @@ function handleNodeClick(data: any, node: any) {
minioOnlyFiles.value.length = 0
getlocaltree()
getminiotree()
tonstatus()
}
//
const handleCheckChange = (
@ -909,24 +927,31 @@ const title1 = ref('')
const isViewfile = ref(false)
const fileType = ref('')
function openPreview(row: any, type: any) {
debugger
if (getFileExtension(row.fileName) == 'pdf' || getFileExtension(row.fileName) == 'pptx' || getFileExtension(row.fileName) == 'xlsx' || getFileExtension(row.fileName) == 'xls' || getFileExtension(row.fileName) == 'docx' || getFileExtension(row.fileName) == 'doc' || getFileExtension(row.fileName) == 'bin') {
title1.value = row.fileName
ViewfileUrl.value = geturl(row.id, type, true)
// isViewfile.value = true
// fileType.value = getFileExtension(row.fileName)
geturl(row, type, true)
} else {
row.fileType = getFileType(row.fileName)
filePreview.value = row
filePreview.value.url = geturl(row.id, type, false)
// localStorage.setItem('videorow', JSON.stringify(row));
// openRow(row)
geturl(row, type, false)
}
}
function geturl(row: any, type1: any, pan: any) {
obtainUrl({ id: row, type: type1 }).then((res: any) => {
return res.data.url
obtainUrl({ id: row.id, type: type1 }).then((res: any) => {
if (pan) {
ViewfileUrl.value = res.data.url
isViewfile.value = true
fileType.value = getFileExtension(row.fileName)
} else {
filePreview.value.url = res.data.url
localStorage.setItem('videorow', JSON.stringify(row));
openRow(row)
}
})
}
@ -1047,7 +1072,7 @@ const tabs = ref(1)
</div>
</div>
<div class="tree_button">
<el-button type="primary" :disabled="worktree && worktree1" @click="backups()">文件备份</el-button>
<el-button type="primary" :loading="tonloading" :disabled="worktree && worktree1" @click="backups()">{{buttonmsg}}</el-button>
<el-button type="primary" :disabled="worktree && worktree1" @click="diffFile2()">差异检测</el-button>
<el-button type="primary" :disabled="worktree && worktree1" @click="diffFile()">差异批量处理</el-button>
</div>