|
@@ -93,7 +93,8 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<template v-for="(item, index) in useMenu">
|
|
|
- <div :class="{'isCheck':haveCheck}" style="display: flex;width: 82px;opacity:0.5;height: 32px;justify-content: flex-start;align-items: center;line-height: 18px;"
|
|
|
+ <div :class="{ 'isCheck': haveCheck }"
|
|
|
+ style="display: flex;width: 82px;opacity:0.5;height: 32px;justify-content: flex-start;align-items: center;line-height: 18px;"
|
|
|
@click="getMenu(item, index)">
|
|
|
<div style="margin-left: 5px;">
|
|
|
<img :src="item.img" style="width: 24px;height: 24px;" alt="">
|
|
@@ -178,7 +179,8 @@
|
|
|
<el-collapse v-model="files" accordion class="collapse" style="height: 200px;">
|
|
|
<el-collapse-item title="文件" name="2" class="">
|
|
|
<el-table :data="fileList" style="width: 100%" @row-contextmenu="handleRowClick"
|
|
|
- @selection-change="handleSelectionChange" @row-click="mouseClick" :default-sort="{ prop: 'createTime', order: 'descending' }">
|
|
|
+ @selection-change="handleSelectionChange" @row-click="mouseClick"
|
|
|
+ :default-sort="{ prop: 'createTime', order: 'descending' }">
|
|
|
<el-table-column type="selection" width="55" />
|
|
|
<el-table-column label="名称" width="200">
|
|
|
<template #default="scope">
|
|
@@ -549,7 +551,7 @@ export default {
|
|
|
pageNum: 1,
|
|
|
pageSize: 10
|
|
|
}
|
|
|
- documents.getALLdocument({ parentId: userMe[0].dirId - 0, spaceId: userMe[0].spaceId,pageNum:obj.pageNum,pageSize:obj.pageSize }).then(res => {
|
|
|
+ documents.getALLdocument({ parentId: userMe[0].dirId - 0, spaceId: userMe[0].spaceId, pageNum: obj.pageNum, pageSize: obj.pageSize }).then(res => {
|
|
|
fileMenu.value = res.data
|
|
|
folderList.value = res.data
|
|
|
})
|
|
@@ -559,10 +561,14 @@ export default {
|
|
|
fileTotal.value = res.total
|
|
|
if (fileTotal.value / 10 != 1) {
|
|
|
let x = Math.trunc(fileTotal.value / 10) + 1
|
|
|
- for (var i = 1; i < x; i++) {
|
|
|
+ for (var i = 1; i <= x; i++) {
|
|
|
obj.pageNum = i
|
|
|
myfile.getById(userMe[0].dirId - 0, obj).then(res => {
|
|
|
- fileList.value = fileList.value.concat(res.rows); // 合并数组并更新 fileList.value
|
|
|
+ fileList.value = fileList.value.concat(res.rows)
|
|
|
+ const uniqueFileList = Array.from(new Set(fileList.value.map(item => item.docId)))
|
|
|
+ .map(docId => fileList.value.find(item => item.docId === docId));
|
|
|
+ // 合并数组并更新 fileList.value
|
|
|
+ fileList.value = uniqueFileList
|
|
|
})
|
|
|
}
|
|
|
}
|
|
@@ -715,16 +721,16 @@ export default {
|
|
|
}
|
|
|
if (row.name === '预览') {
|
|
|
const filePreview = canPreviewFile(copyFileType.value)
|
|
|
- if(filePreview){
|
|
|
+ if (filePreview) {
|
|
|
onlyView.value = true
|
|
|
editOnline.value = false
|
|
|
cliCC.value = false
|
|
|
- }else{
|
|
|
- showPreview.value = true
|
|
|
- const res = await preview(copyFileId.value)
|
|
|
- previewData.value = URL.createObjectURL(res)
|
|
|
+ } else {
|
|
|
+ showPreview.value = true
|
|
|
+ const res = await preview(copyFileId.value)
|
|
|
+ previewData.value = URL.createObjectURL(res)
|
|
|
}
|
|
|
- console.log('filePreview',filePreview);
|
|
|
+ console.log('filePreview', filePreview);
|
|
|
|
|
|
// console.log('res',res);
|
|
|
showPreview.value = true
|
|
@@ -800,7 +806,7 @@ export default {
|
|
|
}
|
|
|
// 表格多选框
|
|
|
function handleSelectionChange(val) {
|
|
|
- console.log('checkout val',toRaw(val));
|
|
|
+ console.log('checkout val',val);
|
|
|
if (val.length > 1) {
|
|
|
// 如果选择了多项,只保留最后一项
|
|
|
val.shift();
|
|
@@ -808,13 +814,13 @@ export default {
|
|
|
if (val.length === 1) {
|
|
|
fileId.value = val[0].docId
|
|
|
}
|
|
|
- if(val.length){
|
|
|
- folderCheckout.value = true
|
|
|
- haveCheck.value = true
|
|
|
- }else{
|
|
|
+ if (val.length) {
|
|
|
+ folderCheckout.value = true
|
|
|
+ haveCheck.value = true
|
|
|
+ } else {
|
|
|
folderCheckout.value = false
|
|
|
- if(!fileCheckout.value){
|
|
|
- haveCheck.value = false
|
|
|
+ if (!fileCheckout.value) {
|
|
|
+ haveCheck.value = false
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -827,13 +833,13 @@ export default {
|
|
|
if (val.length === 1) {
|
|
|
folderId.value = val[0].dirId
|
|
|
}
|
|
|
- if(val.length){
|
|
|
- fileCheckout.value = true
|
|
|
- haveCheck.value = true
|
|
|
- }else{
|
|
|
+ if (val.length) {
|
|
|
+ fileCheckout.value = true
|
|
|
+ haveCheck.value = true
|
|
|
+ } else {
|
|
|
fileCheckout.value = false
|
|
|
- if(!folderCheckout.value){
|
|
|
- haveCheck.value = false
|
|
|
+ if (!folderCheckout.value) {
|
|
|
+ haveCheck.value = false
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -908,7 +914,7 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
} else {
|
|
|
- myfile.getById(res.data[0].dirId - 0).then(res => {
|
|
|
+ myfile.getById(row.dirId - 0).then(res => {
|
|
|
if (res.code === 200) {
|
|
|
fileList.value = res.rows
|
|
|
}
|
|
@@ -996,17 +1002,17 @@ export default {
|
|
|
}
|
|
|
|
|
|
//对mouseCli数组进行筛选,实现菜单的区分显示
|
|
|
- const filterMouseCli = ()=>{
|
|
|
- const array = ['.doc', '.docm', '.docx', '.dot', '.dotm', '.dotx', '.epub', '.fodt', '.htm', '.html', '.mht', '.odt', '.ott', '.pdf', '.rtf', '.txt', '.djvu', '.xps','csv', 'fods', 'ods', 'ots', 'xls', 'xlsm', 'xlsx', 'xlt', 'xltm', 'xltx','fodp', 'odp', 'otp', 'pot', 'potm', 'potx', 'pps', 'ppsm', 'ppsx', 'ppt', 'pptm', 'pptx']
|
|
|
- const typeArr = ['.png','.jpg','.jpeg','.JPG','.mp3','.mp4','.pdf']
|
|
|
- const imgTypeArr = ['.png','.jpg','.jpeg','.JPG']
|
|
|
+ const filterMouseCli = () => {
|
|
|
+ const array = ['.doc', '.docm', '.docx', '.dot', '.dotm', '.dotx', '.epub', '.fodt', '.htm', '.html', '.mht', '.odt', '.ott', '.pdf', '.rtf', '.txt', '.djvu', '.xps', 'csv', 'fods', 'ods', 'ots', 'xls', 'xlsm', 'xlsx', 'xlt', 'xltm', 'xltx', 'fodp', 'odp', 'otp', 'pot', 'potm', 'potx', 'pps', 'ppsm', 'ppsx', 'ppt', 'pptm', 'pptx']
|
|
|
+ const typeArr = ['.png', '.jpg', '.jpeg', '.JPG', '.mp3', '.mp4', '.pdf']
|
|
|
+ const imgTypeArr = ['.png', '.jpg', '.jpeg', '.JPG']
|
|
|
let arr = []
|
|
|
- if (!(typeArr.includes(copyFileType.value) || array.includes(copyFileType.value)) ) {
|
|
|
+ if (!(typeArr.includes(copyFileType.value) || array.includes(copyFileType.value))) {
|
|
|
arr = mouseCli.value.filter(item => item.name !== "预览")
|
|
|
} else {
|
|
|
arr = toRaw(mouseCli.value)
|
|
|
}
|
|
|
- if(!array.includes(copyFileType.value)){
|
|
|
+ if (!array.includes(copyFileType.value)) {
|
|
|
arr = arr.filter(item => item.name !== "在线编辑" && item.name !== "协作" && item.name !== "历史版本")
|
|
|
}
|
|
|
if (!imgTypeArr.includes(copyFileType.value)) {
|
|
@@ -1452,8 +1458,9 @@ p {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-.isCheck{
|
|
|
- opacity: 1!important;
|
|
|
+
|
|
|
+.isCheck {
|
|
|
+ opacity: 1 !important;
|
|
|
}
|
|
|
|
|
|
:deep(.el-tag__content) {
|
|
@@ -1471,5 +1478,4 @@ p {
|
|
|
|
|
|
:deep(.el-collapse-item__wrap) {
|
|
|
height: 300px;
|
|
|
-}
|
|
|
-</style>
|
|
|
+}</style>
|