文档管理bug修改

This commit is contained in:
wangxk 2025-03-25 11:29:52 +08:00
parent 5dae66f63e
commit f6e4553a70
2 changed files with 47 additions and 25 deletions

View File

@ -101,11 +101,16 @@ function gettreedata() {
getTsNodesTree(treeForm.value).then((res: any) => {
treedata.value = res.data
treeloading.value = false
pathid.value = treedata.value[0].nodeId
nextTick(() => {
treeRef.value?.setCurrentKey(pathid.value);
});
getdata()
if (treedata.value[0]) {
pathid.value = treedata.value[0].nodeId
nextTick(() => {
treeRef.value?.setCurrentKey(pathid.value);
});
getdata()
} else {
tableData.value.length = 0
}
})
}
const pathid = ref()
@ -590,9 +595,7 @@ const title1 = ref('')
const isViewfile = ref(false)
const fileType = ref('')
function openPreview(row: 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') {
// debugger
title1.value = row.fileName
ViewfileUrl.value = row.url
isViewfile.value = true
@ -794,7 +797,7 @@ function paste() {
//
copyarr.value.forEach((items: any) => {
repeatObj.oldpaths ='/' + pathid.value + items.workPath
repeatObj.oldpaths = '/' + pathid.value + items.workPath
repeatObj.newFileName.push(items.fileName)
})
repeatObj.newFileName = repeatObj.newFileName.join(',')
@ -1188,7 +1191,6 @@ async function submitzip(formEl: any) {
// gettreedata()
getdata()
zipfiles.value = false
// debugger
zipObj.value.compressedPath = '/' + pathid.value + zipObj.value.compressedPath
compress(zipObj.value).then((res: any) => {
if (res.code == 0) {
@ -1234,7 +1236,7 @@ const jiepatharr: any = ref([])
function gettsfiles() {
filetsobj.value.nodeId = pathid.value
filetsobj.value.taskId = projectId.value
filetsobj.value.path ='/' + pathid.value+filetsobj.value.path
filetsobj.value.path = '/' + pathid.value + filetsobj.value.path
listTsFiles(filetsobj.value).then((res: any) => {
listFilesarr.value = res.data
if (res.data[0]) {
@ -1568,8 +1570,8 @@ function textClose() {
</div>
<div>
<!-- :disabled="pathid.value" -->
<el-button type="primary" @click="creatFile">创建文件/文件夹</el-button>
<el-button type="primary" :disabled="!pathid" @click="openFile">上传</el-button>
<el-button type="primary" :disabled="loading" @click="creatFile">创建文件/文件夹</el-button>
<el-button type="primary" :disabled="loading" @click="openFile">上传</el-button>
<el-button type="primary" @click="delprojectArr()" :disabled="tableIdarr.length == 0">删除</el-button>
<el-button type="primary" @click="xiafilemony()" :disabled="tableIdarr.length == 0">下载</el-button>
</div>

View File

@ -149,11 +149,17 @@ function gettreedata() {
getTsNodesTree(treeForm.value).then((res: any) => {
treedata.value = res.data
treeloading.value = false
pathid.value = treedata.value[0].nodeId
if(treedata.value[0].nodeId ){
pathid.value = treedata.value[0].nodeId
nextTick(() => {
treeRef.value?.setCurrentKey(pathid.value);
});
getWorkData()
}else{
workdata.value.length = 0
backupsdata.value.length = 0
}
})
}
function handleNodeClick(data: any, node: any) {
@ -273,7 +279,7 @@ const handleMenuClick = (action: string, type: any) => {
)
.then(() => {
const params = [{
path: currentNode.value.path,
path: '/' + pathid.value + currentNode.value.path,
name: currentNode.value.fileName,
size: currentNode.value.fileSize,
type: currentNode.value.isFile
@ -301,7 +307,7 @@ const handleMenuClick = (action: string, type: any) => {
)
.then(() => {
const params = [{
path: currentNode.value.path,
path: '/' + pathid.value + currentNode.value.path,
name: currentNode.value.fileName,
size: currentNode.value.fileSize,
type: currentNode.value.isFile
@ -352,7 +358,7 @@ function tableBeifen(row: any) {
)
.then(() => {
const params = [{
path: row.path,
path: '/' + pathid.value + row.path,
name: row.name,
size: row.size,
type: row.type
@ -382,7 +388,11 @@ function moretableBeifen() {
}
)
.then(() => {
uploadToBackup({ parameterLists: beifenArr.value }).then((res: any) => {
let beifenArr2 = JSON.parse(JSON.stringify(beifenArr.value))
beifenArr2.forEach((items: any) => {
items.path = '/' + pathid.value + items.path
})
uploadToBackup({ parameterLists: beifenArr2 }).then((res: any) => {
if (res.code == '0') {
ElMessage.success("上传成功")
beifenArr.value.forEach((items: any) => {
@ -408,7 +418,7 @@ function tablerestore(row: any) {
)
.then(() => {
const params = [{
path: row.path,
path: '/' + pathid.value + row.path,
name: row.name,
size: row.size,
type: row.type
@ -437,7 +447,11 @@ function moretablerestore() {
}
)
.then(() => {
downloadToLocal({ parameterLists: restoreArr.value }).then((res: any) => {
let restoreArr2 = JSON.parse(JSON.stringify(restoreArr.value))
restoreArr2.forEach((items: any) => {
items.path = '/' + pathid.value + items.path
})
downloadToLocal({ parameterLists: restoreArr2 }).then((res: any) => {
if (res.code == '0') {
ElMessage.success("恢复成功")
restoreArr.value.forEach((items: any) => {
@ -499,8 +513,11 @@ function bfclick(type: any) {
)
.then(() => {
if (type == 'bf') {
uploadToBackup({ parameterLists: changeclick.value }).then((res: any) => {
let beifenArr2 = JSON.parse(JSON.stringify(changeclick.value))
beifenArr2.forEach((items: any) => {
items.path = '/' + pathid.value + items.path
})
uploadToBackup({ parameterLists: beifenArr2 }).then((res: any) => {
if (res.code == '0') {
ElMessage.success("上传成功")
changeclick.value.forEach((items: any) => {
@ -509,8 +526,11 @@ function bfclick(type: any) {
}
})
} else {
downloadToLocal({ parameterLists: changeclick.value }).then((res: any) => {
let restoreArr2 = JSON.parse(JSON.stringify(changeclick.value))
restoreArr2.forEach((items: any) => {
items.path = '/' + pathid.value + items.path
})
downloadToLocal({ parameterLists: restoreArr2 }).then((res: any) => {
if (res.code == '0') {
ElMessage.success("恢复成功")
changeclick.value.forEach((items: any) => {
@ -681,8 +701,8 @@ function CloseView() {
</aside>
<section class="silderRight">
<div class="tree_button">
<el-button type="primary" @click="diffFile()">文件差异性对比</el-button>
<el-button type="primary" @click="differential = true">查看本次差异性对比</el-button>
<el-button type="primary" :disabled="worktree" @click="diffFile()">文件差异性对比</el-button>
<el-button type="primary" :disabled="worktree" @click="differential = true">查看本次差异性对比</el-button>
</div>
<div class="tree_box">
<div class="tree_left">