|
|
@@ -42,9 +42,7 @@
|
|
|
</div>
|
|
|
<div>
|
|
|
<p>
|
|
|
- <span style="margin-left: 5px;">{{ useSpace ? useSpace + 'G' : '0' }}/{{ allSpace ?
|
|
|
- allSpace
|
|
|
- * 1024 + 'G' : '0' }}</span>
|
|
|
+ <span style="margin-left: 5px;">{{ useSpace + 'G' }}/{{ allSpace + "G" }}</span>
|
|
|
<span style="margin-left: 5px;font-size: 12px;color: blue;cursor: pointer;"
|
|
|
@click="askApply">申请扩容</span>
|
|
|
</p>
|
|
|
@@ -92,8 +90,9 @@
|
|
|
<span style="font-size: 14px;">新建</span>
|
|
|
</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;"
|
|
|
+ <template v-for="(item, index) in useMenu" :key="index">
|
|
|
+ <div :class="{ 'isCheck': haveCheck }"
|
|
|
+ style="display: flex;width: 82px;opacity:0.5;height: 32px;justify-content: flex-start;align-items: center;line-height: 18px;cursor: pointer;"
|
|
|
@click="getMenu(item, index)">
|
|
|
<div style="margin-left: 5px;">
|
|
|
<img :src="item.img" style="width: 24px;height: 24px;" alt="">
|
|
|
@@ -115,24 +114,26 @@
|
|
|
<img style="display:block;width: 16px;height: 16px;" :src="grayRight" alt="">
|
|
|
</div>
|
|
|
<!-- 面包屑 -->
|
|
|
- <div>
|
|
|
- <BreadMenu></BreadMenu>
|
|
|
+ <div class="topPath">
|
|
|
+ {{ topPath }}
|
|
|
+ <!-- <BreadMenu></BreadMenu> -->
|
|
|
</div>
|
|
|
</div>
|
|
|
<!-- 右侧 -->
|
|
|
<div>
|
|
|
<img :src="sort" alt="">
|
|
|
- <img :src="squre" alt="">
|
|
|
+ <img :src="squre" alt="" >
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
<!-- 展示文件夹盒子 -->
|
|
|
<!-- 文件夹 -->
|
|
|
- <div class="detailBox" @click="mouseClick">
|
|
|
+ <div class="detailBox file-jia" @click="mouseClick">
|
|
|
<el-collapse v-model="folder" accordion class="collapseSell">
|
|
|
<el-collapse-item title="文件夹" name="1" class="custom-collapse-item">
|
|
|
<el-table :data="folderList" style="width: 100%" @selection-change="handleSelectionChange1"
|
|
|
- :single-select="true" @row-click="folderClick" @row-contextmenu="folderRClick">
|
|
|
+ :single-select="true" @row-click="folderClick" @row-contextmenu="folderRClick"
|
|
|
+ ref="taskTableRef">
|
|
|
<el-table-column type="selection" width="55" />
|
|
|
<el-table-column label="名称" width="180">
|
|
|
<template #default="scope">
|
|
|
@@ -177,8 +178,9 @@
|
|
|
<div class="fileTable">
|
|
|
<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' }">
|
|
|
+ <el-table v-if="fileGrid" :data="fileList" style="width: 100%;position: relative;"
|
|
|
+ @row-contextmenu="handleRowClick" @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">
|
|
|
@@ -197,16 +199,17 @@
|
|
|
<el-table-column label="大小">
|
|
|
<template #default="scope">
|
|
|
<span>
|
|
|
- {{ scope.row.fileSize }}KB
|
|
|
+ {{ formatFileSize(scope.row.fileSize) }}
|
|
|
</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
+ <PalaceGridFile v-else></PalaceGridFile>
|
|
|
</el-collapse-item>
|
|
|
</el-collapse>
|
|
|
- <div class="setCli" v-if="cliCC">
|
|
|
+ <div class="setCli" v-if="cliCC" :style="{ left: xz + 'px', top: yz - 260 + 'px' }">
|
|
|
<template v-for="(item, index) in filterMouseCli()">
|
|
|
- <p @click="chooseSet(item, index)" class="chooseSet">
|
|
|
+ <p @click="chooseSet(item, index,1)" class="chooseSet">
|
|
|
<img :src="item.img" alt="">
|
|
|
{{ item.name }}
|
|
|
<span v-if="item.name == '在线编辑' || item.name == '协作' ? true : false"
|
|
|
@@ -229,32 +232,14 @@
|
|
|
</div>
|
|
|
<div v-else>
|
|
|
<div>
|
|
|
- <el-button @click="editOnline = true;historyPrew=false">返回</el-button>
|
|
|
+ <el-button @click="editOnline = true; historyPrew = false">返回</el-button>
|
|
|
</div>
|
|
|
- <FileEdit :docId="clickRowId" :copyRow="copyRow" :historyPrew="historyPrew"
|
|
|
- :historycopyRow="historycopyRow" :onlyView="onlyView" @cancleHistoryPrew="cancleHistoryPrew"></FileEdit>
|
|
|
+ <FileEdit :docId="clickRowId" :copyRow="copyRow" :historyPrew="historyPrew" :historycopyRow="historycopyRow"
|
|
|
+ :onlyView="onlyView" @cancleHistoryPrew="cancleHistoryPrew"></FileEdit>
|
|
|
</div>
|
|
|
<!-- 扩容弹窗 -->
|
|
|
<div>
|
|
|
- <el-dialog v-model="askTo" title="扩容申请" width="30%">
|
|
|
- <el-form>
|
|
|
- <el-form-item label="新容量">
|
|
|
- <el-input-number v-model="askNum" :min="1" :max="10" />
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="申请理由">
|
|
|
- <el-input v-model="askTalk" maxlength="150" placeholder="请输入申请理由" show-word-limit
|
|
|
- type="textarea" />
|
|
|
- </el-form-item>
|
|
|
- </el-form>
|
|
|
- <template #footer>
|
|
|
- <span class="dialog-footer">
|
|
|
- <el-button @click="askTo = false">取消</el-button>
|
|
|
- <el-button type="primary" @click="sureAsk">
|
|
|
- 确定
|
|
|
- </el-button>
|
|
|
- </span>
|
|
|
- </template>
|
|
|
- </el-dialog>
|
|
|
+ <SpaceBig v-if="spaces" :spaces="spaces" :impSpaceId="impSpaceId" @getSpaceC="getSpaceC"></SpaceBig>
|
|
|
</div>
|
|
|
<!-- 新增文件夹弹窗 -->
|
|
|
<div>
|
|
|
@@ -302,19 +287,13 @@
|
|
|
<!-- 文件收藏 -->
|
|
|
<div>
|
|
|
<FileCollect v-if="collects" :collects="collects" @getCollects="getCollects" :copyFileName="copyFileName"
|
|
|
- :copyFileId="copyFileId"></FileCollect>
|
|
|
+ :copyFileId="copyFileId" :isFolder="isFolder" :clickRow="clickRow"></FileCollect>
|
|
|
</div>
|
|
|
<!-- 中栏重命名 -->
|
|
|
<div>
|
|
|
- <el-dialog v-model="folderName" title="重命名" width="30%">
|
|
|
- <el-input v-model="newName"></el-input>
|
|
|
- <template #footer>
|
|
|
- <span class="dialog-footer">
|
|
|
- <el-button @click="folderName = false">取消</el-button>
|
|
|
- <el-button type="primary" @click="sureFolderName">确认</el-button>
|
|
|
- </span>
|
|
|
- </template>
|
|
|
- </el-dialog>
|
|
|
+ <FolderReName v-if="rename" :rename="rename" :selectedBox="selectedBox" :getAllTop="getAllTop"
|
|
|
+ :copyFolderName="copyFolderName" @getRename="getRename">
|
|
|
+ </FolderReName>
|
|
|
</div>
|
|
|
<ImgPreview :previewData="previewData" :copyFileType="copyFileType" :showPreview="showPreview"
|
|
|
@closeImgPreview="closeImgPreview"></ImgPreview>
|
|
|
@@ -332,7 +311,8 @@
|
|
|
<!-- 图片预览 -->
|
|
|
<!-- 历史版本 -->
|
|
|
<historyList :openFile="openForwardFile" :docId="clickRowId" :name="nameForm.name" :copyRow="copyRow"
|
|
|
- @close="openForwardFile = false" :fileUserTreeData="fileUserTreeData.data" @changeMsgClose="changeMsgClose">
|
|
|
+ @close="openForwardFile = false" :fileUserTreeData="fileUserTreeData.data" @changeMsgClose="changeMsgClose"
|
|
|
+ :historyTotal="historyTotal">
|
|
|
</historyList>
|
|
|
<!-- 历史版本 -->
|
|
|
</template>
|
|
|
@@ -341,7 +321,6 @@
|
|
|
import { ref, toRaw, onMounted } from 'vue'
|
|
|
import myfile from '../../api/myfile/myfile'
|
|
|
import documents from '../../api/document/document'
|
|
|
-import fileSpace from '../../api/filespace/fileSpace'
|
|
|
import fileCount from '../../api/fileCount/fileCount'
|
|
|
import FileTree from './components/FileTree.vue'
|
|
|
import BreadMenu from './components/BreadMenu.vue'
|
|
|
@@ -349,6 +328,10 @@ import FileEdit from './components/FileEdit.vue'
|
|
|
import TransferModal from './modalComponebts/Transfer.vue'
|
|
|
import CreateFloder from './modalComponebts/CreateFloder.vue'
|
|
|
import FileCollect from './modalComponebts/FileCollect.vue'
|
|
|
+import FolderReName from './modalComponebts/FolderReName.vue'
|
|
|
+import SpaceBig from './modalComponebts/SpaceBig.vue'
|
|
|
+import PlaceGridFolder from './components/PlaceGridFolder.vue'
|
|
|
+import PalaceGridFile from './components/PalaceGridFile.vue'
|
|
|
import ImgFile from "./jsComponents/ImgFile"
|
|
|
import { Search } from '@element-plus/icons-vue'
|
|
|
import blueLeft from '../../assets/images/blueLeft.png'
|
|
|
@@ -363,28 +346,29 @@ import { listVersion } from "@/api/biz/version";
|
|
|
import useUserStore from "@/store/modules/user";
|
|
|
import { useRouter, useRoute } from "vue-router";
|
|
|
import { canPreviewFile } from "@/utils/index.js"
|
|
|
+
|
|
|
export default {
|
|
|
setup() {
|
|
|
+ const { proxy } = getCurrentInstance();
|
|
|
let fileTrees = ref(false)//filetree父传子
|
|
|
let thanks = ref(false)//transfer父传子
|
|
|
let collects = ref(false)//文件收藏父传子
|
|
|
+ let rename = ref(false)//文件夹重命名
|
|
|
+ let spaces = ref(false)//空间扩容父传子
|
|
|
let folderCase = ref(false)
|
|
|
+ let fileGrid = ref(true)
|
|
|
+ let folderGrid = ref(true)
|
|
|
let editOnline = ref(true)
|
|
|
let searchFire = ref('')
|
|
|
let selectedIndex = ref(0)
|
|
|
let folder = ref(['1'])
|
|
|
let files = ref(['2'])
|
|
|
let folderList = ref([])
|
|
|
- let askTo = ref(false)
|
|
|
- let folderName = ref(false)
|
|
|
- let askNum = ref(1)
|
|
|
- let askTalk = ref('')
|
|
|
let cliCC = ref(false)
|
|
|
let anyP = ref(false)
|
|
|
let uploadModal = ref(false)
|
|
|
let collectImg = ref(true)
|
|
|
let selectedBox = ref(-1)
|
|
|
- let newName = ref('')
|
|
|
let clickRowId = ref(0)
|
|
|
let trandata = ref()
|
|
|
let folderId = ref('')
|
|
|
@@ -400,6 +384,8 @@ export default {
|
|
|
let copyFileSize = ref(0)//需要操作的filesize
|
|
|
let copyFileType = ref('')//需要操作的文件类型
|
|
|
let copyFileName = ref("")//需要操作的文件名
|
|
|
+ let copyFolderName = ref("")
|
|
|
+ let copySpaceCup = ref(0)
|
|
|
let directoryId = ref('')
|
|
|
let impSpaceId = ref("")
|
|
|
let impDirId = ref("")
|
|
|
@@ -412,7 +398,11 @@ export default {
|
|
|
let folderTotal = ref(0)//文件夹total
|
|
|
let fileTotal = ref(0)//文件total
|
|
|
const openForwardFile = ref(false) //历史版本展示
|
|
|
+ const delMoreFile = ref([]) //删除多个文件夹
|
|
|
+ const historyTotal = ref(0)
|
|
|
const historyPrew = ref(false)
|
|
|
+ let xz = ref(0)
|
|
|
+ let yz = ref(0)
|
|
|
const fileUserTreeData = reactive({ data: {} });
|
|
|
let fileList = ref([
|
|
|
])
|
|
|
@@ -536,6 +526,9 @@ export default {
|
|
|
const fileCheckout = ref(false)//是否有勾选
|
|
|
const haveCheck = ref(false)//是否有勾选
|
|
|
const onlyView = ref(false) //预览
|
|
|
+ const topPath = ref()//顶部路径
|
|
|
+ const isFolder = ref('N') //是否为文件夹
|
|
|
+ const clickRow = ref()//当前右键的行数据
|
|
|
// 获取文件夹,中栏,文件
|
|
|
function getAllTop() {
|
|
|
documents.getTop(3).then(res => {
|
|
|
@@ -544,11 +537,12 @@ export default {
|
|
|
impSpaceId.value = userMe[0].spaceId//固定
|
|
|
newSpaceId.value = userMe[0].spaceId//变化
|
|
|
newDirId.value = userMe[0].dirId//变化
|
|
|
+ topPath.value = userMe[0].dirPath
|
|
|
let obj = {
|
|
|
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
|
|
|
})
|
|
|
@@ -558,10 +552,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
|
|
|
})
|
|
|
}
|
|
|
}
|
|
|
@@ -569,6 +567,12 @@ export default {
|
|
|
})
|
|
|
})
|
|
|
}
|
|
|
+ function getSpaceList() {
|
|
|
+ myfile.fileType(3).then(res => {
|
|
|
+ useSpace.value = res.data.usedCap
|
|
|
+ allSpace.value = res.data.spaceCap
|
|
|
+ })
|
|
|
+ }
|
|
|
function changeFile(row, num) {
|
|
|
copyParentId.value = row.parentId
|
|
|
newDirId.value = row.dirId
|
|
|
@@ -587,7 +591,7 @@ export default {
|
|
|
console.error("myfile.getAllFileMenu 调用失败:", error);
|
|
|
});
|
|
|
} else {
|
|
|
- myfile.getById(res.data[0].dirId - 0)
|
|
|
+ myfile.getById(row.dirId - 0)
|
|
|
.then(res => {
|
|
|
if (res.code === 200) {
|
|
|
fileList.value = res.rows;
|
|
|
@@ -610,8 +614,6 @@ export default {
|
|
|
if (!isItemExist) {
|
|
|
menuList.value.push(newItem);
|
|
|
}
|
|
|
- useSpace.value = row.usedCap
|
|
|
- allSpace.value = row.spaceCap
|
|
|
}
|
|
|
|
|
|
// tableMenu切换
|
|
|
@@ -624,9 +626,13 @@ export default {
|
|
|
}
|
|
|
// 文件名表格每一行点击事件
|
|
|
function handleRowClick(row, col, e) {
|
|
|
+ console.log('row',row);
|
|
|
+ isFolder.value = "N"
|
|
|
+ clickRow.value = row
|
|
|
e.preventDefault();
|
|
|
e.stopPropagation();
|
|
|
- console.log(e, 'xxyy');
|
|
|
+ xz.value = e.pageX
|
|
|
+ yz.value = e.pageY
|
|
|
copyRow.value = row
|
|
|
clickRowId.value = row.docId
|
|
|
copyDirId.value = row.dirId
|
|
|
@@ -644,10 +650,7 @@ export default {
|
|
|
}
|
|
|
// 申请扩容
|
|
|
function askApply() {
|
|
|
- this.askTo = true
|
|
|
- }
|
|
|
- function sureAsk() {
|
|
|
- this.askTo = false
|
|
|
+ spaces.value = true
|
|
|
}
|
|
|
//mouse弹框
|
|
|
async function chooseSet(row, index, num) {
|
|
|
@@ -714,16 +717,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
|
|
|
@@ -731,6 +734,7 @@ export default {
|
|
|
previewData.value = URL.createObjectURL(res)
|
|
|
} else if (row.name === "历史版本") {
|
|
|
const resHistory = await listVersion({ docId: clickRowId.value })
|
|
|
+ historyTotal.value = resHistory.total
|
|
|
fileUserTreeData.data = resHistory.rows;
|
|
|
openForwardFile.value = true
|
|
|
}
|
|
|
@@ -744,8 +748,8 @@ export default {
|
|
|
oneOrTwo.value = num
|
|
|
folderCase.value = true
|
|
|
}
|
|
|
- function cancleHistoryPrew(val){
|
|
|
- historyPrew.value=false
|
|
|
+ function cancleHistoryPrew(val) {
|
|
|
+ historyPrew.value = false
|
|
|
}
|
|
|
function createNewFile() {
|
|
|
addFile.value = true
|
|
|
@@ -798,40 +802,43 @@ export default {
|
|
|
}
|
|
|
// 表格多选框
|
|
|
function handleSelectionChange(val) {
|
|
|
- console.log('checkout val',toRaw(val));
|
|
|
- if (val.length > 1) {
|
|
|
- // 如果选择了多项,只保留最后一项
|
|
|
- val.shift();
|
|
|
- }
|
|
|
+ delMoreFile.value = val //删除多项的数据
|
|
|
+ // if (val.length > 1) {
|
|
|
+ // // 如果选择了多项,只保留最后一项
|
|
|
+ // val.shift();
|
|
|
+ // }
|
|
|
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
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
// 文件夹
|
|
|
+
|
|
|
function handleSelectionChange1(val) {
|
|
|
+ delMoreFile.value = val //删除多项的数据
|
|
|
if (val.length > 1) {
|
|
|
// 如果选择了多项,只保留最后一项
|
|
|
val.shift();
|
|
|
+ proxy.$refs.taskTableRef.toggleRowSelection(val.shift(), false);//单选操作
|
|
|
}
|
|
|
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
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -839,36 +846,50 @@ export default {
|
|
|
function restName(row, index) {
|
|
|
// 判断是点击打开还是右键菜单打开
|
|
|
row = row ? row : thisFolder.value
|
|
|
- newName.value = row.dirName
|
|
|
- folderName.value = true
|
|
|
+ copyFolderName.value = row.dirName
|
|
|
selectedBox.value = row.dirId
|
|
|
+ rename.value = true
|
|
|
+
|
|
|
}
|
|
|
function getMenu(row, num) {
|
|
|
if (row.name === '删除') {
|
|
|
- // 文件夹删除
|
|
|
- documents.delDocument(folderId.value).then(res => {
|
|
|
- if (res.code === 200) {
|
|
|
- ElMessage({
|
|
|
- message: "删除成功",
|
|
|
- type: "success"
|
|
|
- })
|
|
|
- getAllTop()
|
|
|
- } else {
|
|
|
- ElMessage({
|
|
|
- message: "删除失败,目录应不为空",
|
|
|
- type: "error"
|
|
|
- })
|
|
|
- }
|
|
|
- })
|
|
|
- myfile.delMenu(fileId.value).then(res => {
|
|
|
- if (res.code === 200) {
|
|
|
- ElMessage({
|
|
|
- message: "删除成功",
|
|
|
- type: "success"
|
|
|
- })
|
|
|
- getAllTop()
|
|
|
+ const datas = []
|
|
|
+ const isFile = ref(false)
|
|
|
+ delMoreFile.value.map(i => {//多选删除
|
|
|
+ if (i.parentId) {//文件
|
|
|
+ isFile.value = true
|
|
|
+ } else {//文件夹
|
|
|
+ datas.push(i.docId)
|
|
|
}
|
|
|
})
|
|
|
+ // 文件夹删除
|
|
|
+ if (isFile.value) {//文件
|
|
|
+ documents.delDocument(folderId.value).then(res => {
|
|
|
+ if (res.code === 200) {
|
|
|
+ ElMessage({
|
|
|
+ message: "删除成功",
|
|
|
+ type: "success"
|
|
|
+ })
|
|
|
+ getAllTop()
|
|
|
+ } else {
|
|
|
+ ElMessage({
|
|
|
+ message: "删除失败,目录应不为空",
|
|
|
+ type: "error"
|
|
|
+ })
|
|
|
+ }
|
|
|
+ isFile.value = false
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ myfile.delMenu(datas.toString()).then(res => {
|
|
|
+ if (res.code === 200) {
|
|
|
+ ElMessage({
|
|
|
+ message: "删除成功",
|
|
|
+ type: "success"
|
|
|
+ })
|
|
|
+ getAllTop()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
function delName(row, num) {
|
|
|
@@ -884,17 +905,21 @@ export default {
|
|
|
}
|
|
|
// 计算百分比
|
|
|
function percent() {
|
|
|
- let numP = 0
|
|
|
- if (useSpace.value) {
|
|
|
- numP = parseInt(useSpace.value / (allSpace.value * 1024) * 100)
|
|
|
+ let numP = 0;
|
|
|
+ if (useSpace.value && allSpace.value) {
|
|
|
+ numP = (useSpace.value / allSpace.value) * 100;
|
|
|
}
|
|
|
- return numP
|
|
|
+ return numP.toFixed(2) - 0; // 将结果保留两位小数
|
|
|
}
|
|
|
+
|
|
|
// 文件夹每行点击事件
|
|
|
function folderClick(row, list) {
|
|
|
// 上一级dirId就是下一级的parentId
|
|
|
// 判断是点击打开还是右键菜单打开
|
|
|
row = row ? row : thisFolder.value
|
|
|
+ // console.log('row', toRaw(row));
|
|
|
+ topPath.value = row.dirPath
|
|
|
+ // console.log('topPath',toRaw(topPath.value));
|
|
|
newDirId.value = row.dirId
|
|
|
newSpaceId.value = row.spaceId
|
|
|
documents.getALLdocument({ parentId: row.dirId - 0, spaceId: row.spaceId - 0 }).then(res => {
|
|
|
@@ -906,7 +931,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
|
|
|
}
|
|
|
@@ -947,22 +972,6 @@ export default {
|
|
|
getAllTop()
|
|
|
}
|
|
|
}
|
|
|
- // 中栏重命名
|
|
|
- function sureFolderName() {
|
|
|
- documents.editDocument({
|
|
|
- dirId: selectedBox.value - 0,
|
|
|
- name: newName.value,
|
|
|
- }).then(res => {
|
|
|
- if (res.code === 200) {
|
|
|
- getAllTop()
|
|
|
- folderName.value = false
|
|
|
- ElMessage({
|
|
|
- message: '重命名成功',
|
|
|
- type: "success"
|
|
|
- })
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
//关闭图片预览事件
|
|
|
const closeImgPreview = () => {
|
|
|
// console.log('close');
|
|
|
@@ -980,6 +989,12 @@ export default {
|
|
|
function getCollects(data) {
|
|
|
collects.value = data
|
|
|
}
|
|
|
+ function getRename(data) {
|
|
|
+ rename.value = data
|
|
|
+ }
|
|
|
+ function getSpaceC(data) {
|
|
|
+ spaces.value = data
|
|
|
+ }
|
|
|
//历史版本
|
|
|
const forwardTreeData = reactive({ data: {} });
|
|
|
const historycopyRow = ref({})
|
|
|
@@ -994,17 +1009,18 @@ 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 canPreviewArray = ['.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']
|
|
|
+ const imgTypeArr = ['.png', '.jpg', '.jpeg', '.JPG']
|
|
|
+ const canEditArr = ['.doc', '.docm', '.docx', '.dot', '.dotm', '.dotx', '.txt', '.djvu', '.xps', 'csv', 'fods', 'ods', 'ots', 'xls', 'xlsm', 'xlsx', 'xlt', 'xltm', 'xltx', 'fodp', 'odp', 'otp']
|
|
|
let arr = []
|
|
|
- if (!(typeArr.includes(copyFileType.value) || array.includes(copyFileType.value)) ) {
|
|
|
+ if (!(typeArr.includes(copyFileType.value) || canPreviewArray.includes(copyFileType.value))) {
|
|
|
arr = mouseCli.value.filter(item => item.name !== "预览")
|
|
|
} else {
|
|
|
arr = toRaw(mouseCli.value)
|
|
|
}
|
|
|
- if(!array.includes(copyFileType.value)){
|
|
|
+ if (!canEditArr.includes(copyFileType.value)) {
|
|
|
arr = arr.filter(item => item.name !== "在线编辑" && item.name !== "协作" && item.name !== "历史版本")
|
|
|
}
|
|
|
if (!imgTypeArr.includes(copyFileType.value)) {
|
|
|
@@ -1026,6 +1042,7 @@ export default {
|
|
|
e.stopPropagation();
|
|
|
let thisRow = toRaw(row)
|
|
|
thisFolder.value = thisRow;
|
|
|
+ copyFolderName.value = row.dirName
|
|
|
// 唤出右键菜单,思路:获取鼠标位置来定位菜单
|
|
|
folderVisible.value = true;
|
|
|
foldertop.value = e.pageY;
|
|
|
@@ -1049,12 +1066,37 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
+ function formatFileSize(fileSize) {
|
|
|
+ if (fileSize >= 1024 * 1024 * 1024) {
|
|
|
+ // 大于等于1GB,显示GB
|
|
|
+ return (fileSize / (1024 * 1024 * 1024)).toFixed(2) + 'GB';
|
|
|
+ } else if (fileSize >= 1024 * 1024) {
|
|
|
+ // 大于等于1MB,显示MB
|
|
|
+ return (fileSize / (1024 * 1024)).toFixed(2) + 'MB';
|
|
|
+ } else if (fileSize >= 1024) {
|
|
|
+ // 大于等于1KB,显示KB
|
|
|
+ return (fileSize / 1024).toFixed(2) + 'KB';
|
|
|
+ } else {
|
|
|
+ // 小于1KB,显示字节
|
|
|
+ return fileSize + 'B';
|
|
|
+ }
|
|
|
+ }
|
|
|
+ function gridChange() {
|
|
|
+ if (fileGrid.value) {
|
|
|
+ fileGrid.value = false
|
|
|
+ } else {
|
|
|
+ fileGrid.value = true
|
|
|
+ }
|
|
|
+ }
|
|
|
onMounted(() => {
|
|
|
getAllTop()
|
|
|
+ getSpaceList()
|
|
|
// 添加监听,点击其他地方关闭文件夹右键菜单
|
|
|
window.addEventListener("click", closeRMenu, true);
|
|
|
+ window.addEventListener("click", mouseClick);
|
|
|
})
|
|
|
return {
|
|
|
+ getSpaceList,
|
|
|
folderList,//文件夹的数据
|
|
|
fileList,//文件夹的数据
|
|
|
searchFire,//搜索文件的model
|
|
|
@@ -1073,10 +1115,6 @@ export default {
|
|
|
files,
|
|
|
handleRowClick,
|
|
|
askApply,//申请扩容
|
|
|
- askTo,
|
|
|
- sureAsk,
|
|
|
- askNum,
|
|
|
- askTalk,
|
|
|
cliCC,
|
|
|
mouseCli,//文件点击弹框
|
|
|
chooseSet,
|
|
|
@@ -1095,7 +1133,6 @@ export default {
|
|
|
handleSelectionChange1,
|
|
|
selectedBox,//重命名相关
|
|
|
restName,//重命名相关
|
|
|
- newName,//重命名相关
|
|
|
getMenu,
|
|
|
folderId,
|
|
|
fileId,
|
|
|
@@ -1127,8 +1164,6 @@ export default {
|
|
|
isId,
|
|
|
editOnline,//在线编辑
|
|
|
copyParentId,
|
|
|
- folderName,
|
|
|
- sureFolderName,
|
|
|
copyRow,
|
|
|
getAllTop,
|
|
|
newDirId,
|
|
|
@@ -1161,6 +1196,7 @@ export default {
|
|
|
folderRClick,
|
|
|
closeRMenu,
|
|
|
cancleHistoryPrew,
|
|
|
+ historyTotal,
|
|
|
//历史版本=========
|
|
|
fileUserTreeData,
|
|
|
thanks,
|
|
|
@@ -1179,6 +1215,22 @@ export default {
|
|
|
getCollects,//收藏子传父
|
|
|
folderTotal,
|
|
|
fileTotal,
|
|
|
+ delMoreFile,//删除多个文件夹
|
|
|
+ topPath,
|
|
|
+ xz,//文件右键菜单left
|
|
|
+ yz,//文件右键菜单top
|
|
|
+ formatFileSize,
|
|
|
+ isFolder,
|
|
|
+ clickRow,
|
|
|
+ rename,
|
|
|
+ getRename,//文件夹重命名子传父
|
|
|
+ copyFolderName,
|
|
|
+ spaces,//空间扩容父传子
|
|
|
+ getSpaceC,//空间扩容子传父
|
|
|
+ copySpaceCup,
|
|
|
+ fileGrid,
|
|
|
+ folderGrid,
|
|
|
+ gridChange,
|
|
|
}
|
|
|
},
|
|
|
watch: {
|
|
|
@@ -1192,6 +1244,10 @@ export default {
|
|
|
TransferModal,
|
|
|
CreateFloder,
|
|
|
FileCollect,
|
|
|
+ FolderReName,
|
|
|
+ SpaceBig,
|
|
|
+ PlaceGridFolder,
|
|
|
+ PalaceGridFile,
|
|
|
},
|
|
|
}
|
|
|
|
|
|
@@ -1329,7 +1385,12 @@ p {
|
|
|
display: flex;
|
|
|
justify-content: space-between;
|
|
|
align-items: center;
|
|
|
- background-color: #D9E0F0;
|
|
|
+ background-color: #F6F7F9;
|
|
|
+
|
|
|
+ .topPath {
|
|
|
+ color: #6F85B5;
|
|
|
+ font-size: 12px;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
:deep(.el-collapse-item__header) {
|
|
|
@@ -1348,14 +1409,13 @@ p {
|
|
|
}
|
|
|
|
|
|
.fileTable {
|
|
|
- position: relative;
|
|
|
height: 100%;
|
|
|
- /* overflow-y: auto; */
|
|
|
+ overflow-y: hidden;
|
|
|
}
|
|
|
|
|
|
.setCli {
|
|
|
width: 156px;
|
|
|
- max-height: 380px;
|
|
|
+ max-height: auto;
|
|
|
position: absolute;
|
|
|
top: -70px;
|
|
|
left: 300px;
|
|
|
@@ -1363,7 +1423,7 @@ p {
|
|
|
background-color: white;
|
|
|
border: 1px solid gray;
|
|
|
border-radius: 4px;
|
|
|
- z-index: 10;
|
|
|
+ z-index: 3;
|
|
|
overflow-y: auto;
|
|
|
// font-size: 16px;
|
|
|
}
|
|
|
@@ -1449,8 +1509,9 @@ p {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-.isCheck{
|
|
|
- opacity: 1!important;
|
|
|
+
|
|
|
+.isCheck {
|
|
|
+ opacity: 1 !important;
|
|
|
}
|
|
|
|
|
|
:deep(.el-tag__content) {
|
|
|
@@ -1469,4 +1530,11 @@ p {
|
|
|
:deep(.el-collapse-item__wrap) {
|
|
|
height: 300px;
|
|
|
}
|
|
|
+
|
|
|
+// 隐藏全选按钮
|
|
|
+.file-jia {
|
|
|
+ :deep(.el-table th.el-table__cell:nth-child(1) .cell) {
|
|
|
+ visibility: hidden;
|
|
|
+ }
|
|
|
+}
|
|
|
</style>
|