|
@@ -7,7 +7,7 @@
|
|
|
|
|
|
<div class="spaceName">{{ spaceName }}</div>
|
|
|
<div>
|
|
|
- <el-icon @click="createNewMenu(1,true)" color="#505870" size="24">
|
|
|
+ <el-icon @click="createNewMenu(1, true)" color="#505870" size="24">
|
|
|
<Plus />
|
|
|
</el-icon>
|
|
|
<!-- @click="createNewFile" -->
|
|
@@ -16,49 +16,49 @@
|
|
|
<!-- 方块点击盒子 -->
|
|
|
<div style="height: 75vh;overflow-y: auto;">
|
|
|
<div class="searchBox">
|
|
|
- <el-input v-model="searchFire" @blur="fileBlur" class="searchFire" size="large"
|
|
|
+ <el-input v-model="searchFire" @keyup.enter="fileBlur" class="searchFire" size="large"
|
|
|
placeholder="搜索文件" />
|
|
|
- <el-icon class="SearchIcon">
|
|
|
+ <el-icon class="SearchIcon" @click="fileBlur">
|
|
|
<Search />
|
|
|
</el-icon>
|
|
|
</div>
|
|
|
<!-- v-for盒子 -->
|
|
|
- <div style="display: flex;justify-content: flex-start;align-items: flex-start;flex-wrap: wrap;align-content: flex-start;overflow-y: auto;">
|
|
|
- <template v-for="(item, index) in fileMenu" :key="index">
|
|
|
- <div class="setBox" @click="changeFile(item, index)">
|
|
|
- <el-dropdown trigger="click" class="selectChe">
|
|
|
- <span class="el-dropdown-link">
|
|
|
- ...
|
|
|
- </span>
|
|
|
-
|
|
|
- <template #dropdown>
|
|
|
- <el-dropdown-menu>
|
|
|
- <el-dropdown-item @click="restName(item, index)">重命名</el-dropdown-item>
|
|
|
- <el-dropdown-item v-if="!item.encryptLevel" @click="delName(item, index)">删除</el-dropdown-item>
|
|
|
- </el-dropdown-menu>
|
|
|
- </template>
|
|
|
- </el-dropdown>
|
|
|
- <div class="left_fileBox">
|
|
|
- <el-tooltip
|
|
|
- class="box-item tool-tip"
|
|
|
- effect="dark"
|
|
|
- placement="top-start"
|
|
|
- v-if="item.encryptLevel"
|
|
|
- >
|
|
|
- <template #content><span>安全级别: {{ item.encryptLevel == 'L1'?'敏感':(item.encryptLevel == 'L2'?'涉密':(item.encryptLevel == 'L3'?'机密':'绝密')) }}</span> </template>
|
|
|
- <img src="../../assets/images/fileStyle.png" style="width: 72px;height: 72px;"></el-tooltip>
|
|
|
- <img src="../../assets/images/fileStyle.png" style="width: 72px;height: 72px;" v-else>
|
|
|
- <el-tooltip
|
|
|
- class="box-item tool-tip"
|
|
|
- effect="dark"
|
|
|
- placement="top-start"
|
|
|
- > <template #content> <span>{{ item.dirName }}</span></template>
|
|
|
- <p class="ellipsis-text shouzhi">{{ item.dirName }}</p>
|
|
|
- </el-tooltip>
|
|
|
- <img class="levelImg shouzhi" v-if="item.isEncrypt === 'Y'" :src="getLevelImg(item.encryptLevel)" alt="">
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </template>
|
|
|
+ <div
|
|
|
+ style="display: flex;justify-content: flex-start;align-items: flex-start;flex-wrap: wrap;align-content: flex-start;overflow-y: auto;">
|
|
|
+ <template v-for="(item, index) in fileMenu" :key="index">
|
|
|
+ <div class="setBox" @click="changeFile(item, index)">
|
|
|
+ <el-dropdown trigger="click" class="selectChe">
|
|
|
+ <span class="el-dropdown-link">
|
|
|
+ ...
|
|
|
+ </span>
|
|
|
+
|
|
|
+ <template #dropdown>
|
|
|
+ <el-dropdown-menu>
|
|
|
+ <el-dropdown-item @click="restName(item, index)">重命名</el-dropdown-item>
|
|
|
+ <el-dropdown-item v-if="!item.encryptLevel"
|
|
|
+ @click="delName(item, index)">删除</el-dropdown-item>
|
|
|
+ </el-dropdown-menu>
|
|
|
+ </template>
|
|
|
+ </el-dropdown>
|
|
|
+ <div class="left_fileBox">
|
|
|
+ <el-tooltip class="box-item tool-tip" effect="dark" placement="top-start"
|
|
|
+ v-if="item.encryptLevel">
|
|
|
+ <template #content><span>安全级别: {{ item.encryptLevel == 'L1' ? '敏感' :
|
|
|
+ (item.encryptLevel
|
|
|
+ == 'L2' ? '涉密' : (item.encryptLevel == 'L3' ? '机密' : '绝密')) }}</span>
|
|
|
+ </template>
|
|
|
+ <img src="../../assets/images/fileStyle.png"
|
|
|
+ style="width: 72px;height: 72px;"></el-tooltip>
|
|
|
+ <img src="../../assets/images/fileStyle.png" style="width: 72px;height: 72px;" v-else>
|
|
|
+ <el-tooltip class="box-item tool-tip" effect="dark" placement="top-start"> <template
|
|
|
+ #content> <span>{{ item.dirName }}</span></template>
|
|
|
+ <p class="ellipsis-text shouzhi">{{ item.dirName }}</p>
|
|
|
+ </el-tooltip>
|
|
|
+ <img class="levelImg shouzhi" v-if="item.isEncrypt === 'Y'"
|
|
|
+ :src="getLevelImg(item.encryptLevel)" alt="">
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
@@ -147,7 +147,7 @@
|
|
|
<Plus />
|
|
|
</el-icon>
|
|
|
</div>
|
|
|
- <div style="margin-left: 5px;" @click="thisFolder.dirType?createNewMenu(2):null">
|
|
|
+ <div style="margin-left: 5px;" @click="thisFolder.dirType ? createNewMenu(2) : null">
|
|
|
<span style="font-size: 14px;" class="shouzhi">新建文档</span>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -222,22 +222,22 @@
|
|
|
<span class="shouzhi">{{ scope.row.dirName }}</span>
|
|
|
</el-tooltip> -->
|
|
|
<span class="shouzhi">{{ scope.row.dirName }}</span>
|
|
|
- </span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column prop="createTime" label="时间" width="180" />
|
|
|
- <el-table-column prop="dirType" label="类型">
|
|
|
- <template #default="scope">
|
|
|
- <span>文件夹</span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="大小">
|
|
|
- <template #default="scope">
|
|
|
- <span>
|
|
|
- 10KB
|
|
|
- </span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
+ </span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="createTime" label="时间" width="180" />
|
|
|
+ <el-table-column prop="dirType" label="类型">
|
|
|
+ <template #default="scope">
|
|
|
+ <span>文件夹</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="大小">
|
|
|
+ <template #default="scope">
|
|
|
+ <span>
|
|
|
+ 10KB
|
|
|
+ </span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
|
|
|
</el-table>
|
|
|
<PlaceGridFolder v-else :folderClick="folderClick" :restName="restName"
|
|
@@ -537,7 +537,7 @@ export default {
|
|
|
const delMoreFile = ref([]) //删除多个文件夹
|
|
|
const historyTotal = ref(0)
|
|
|
const historyPrew = ref(false)
|
|
|
- const leftNewFile =ref(false) //解决左侧点击后不能显示的问题
|
|
|
+ const leftNewFile = ref(false) //解决左侧点击后不能显示的问题
|
|
|
let xz = ref(0)
|
|
|
let yz = ref(0)
|
|
|
let newAdd = ref(false)
|
|
@@ -834,7 +834,11 @@ export default {
|
|
|
if (searchFire.value == '') {
|
|
|
getAllTop()
|
|
|
} else {
|
|
|
- fileMenu.value = fileMenu.value.filter(item => item.dirName == searchFire.value)
|
|
|
+ const searchTerm = searchFire.value.trim().toLowerCase(); // 转换为小写字母并去除首尾空格
|
|
|
+ fileMenu.value = fileMenu.value.filter(item => {
|
|
|
+ const dirName = item.dirName.trim();
|
|
|
+ return dirName.includes(searchTerm);
|
|
|
+ });
|
|
|
}
|
|
|
}
|
|
|
// 文件名表格每一行点击事件
|
|
@@ -1020,11 +1024,11 @@ export default {
|
|
|
thanks.value = true
|
|
|
anyP.value = false
|
|
|
}
|
|
|
- function createNewMenu(num,leftNewFiles) {
|
|
|
- if(leftNewFiles){
|
|
|
+ function createNewMenu(num, leftNewFiles) {
|
|
|
+ if (leftNewFiles) {
|
|
|
leftNewFile.value = true //解决左侧点击文件后不显示的问题
|
|
|
}
|
|
|
- if(num==2) {
|
|
|
+ if (num == 2) {
|
|
|
newAdd.value = true
|
|
|
} else {
|
|
|
oneOrTwo.value = num
|
|
@@ -1035,28 +1039,28 @@ export default {
|
|
|
newAdd.value = data
|
|
|
console.log('cli', clickFileData.value)
|
|
|
let obj = {
|
|
|
- pageNum: 1,
|
|
|
- pageSize: 10
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 10
|
|
|
}
|
|
|
myfile.getById(clickFileData.value.dirId, obj).then(res => {
|
|
|
- if (res.code === 200) {
|
|
|
- fileList.value = res.rows
|
|
|
- fileTotal.value = res.total
|
|
|
- if (fileTotal.value / 10 != 1) {
|
|
|
- let x = Math.trunc(fileTotal.value / 10) + 1
|
|
|
- for (var i = 1; i <= x; i++) {
|
|
|
- obj.pageNum = i
|
|
|
- myfile.getById(clickFileData.value.dirId, obj).then(res => {
|
|
|
- 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
|
|
|
- })
|
|
|
- }
|
|
|
+ if (res.code === 200) {
|
|
|
+ fileList.value = res.rows
|
|
|
+ fileTotal.value = res.total
|
|
|
+ if (fileTotal.value / 10 != 1) {
|
|
|
+ let x = Math.trunc(fileTotal.value / 10) + 1
|
|
|
+ for (var i = 1; i <= x; i++) {
|
|
|
+ obj.pageNum = i
|
|
|
+ myfile.getById(clickFileData.value.dirId, obj).then(res => {
|
|
|
+ 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
|
|
|
+ })
|
|
|
}
|
|
|
}
|
|
|
- })
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
function cancleHistoryPrew(val) {
|
|
|
historyPrew.value = false
|
|
@@ -1073,7 +1077,14 @@ export default {
|
|
|
}
|
|
|
// 确认上传
|
|
|
function sureUpload() {
|
|
|
- loadingUpload.value =true
|
|
|
+ loadingUpload.value =true
|
|
|
+ if(useSpace.value*1024+fileBig.value > allSpace.value*1024*1024){
|
|
|
+ ElMessage({
|
|
|
+ message:"超过最大容量,请联系管理员扩容",
|
|
|
+ type:"wanning",
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }else{
|
|
|
if (fileArr.value.length > 0) {
|
|
|
for (var i = 1; i <= fileArr.value.length; i++) {
|
|
|
uploadApi.uploadFile({
|
|
@@ -1101,12 +1112,12 @@ export default {
|
|
|
loadingUpload.value = false
|
|
|
return ElMessage({ message: "请选择文件", type: "error"})
|
|
|
}
|
|
|
+ }
|
|
|
|
|
|
}
|
|
|
function onSuccess(files, val) {
|
|
|
fileBig.value = files.file.size
|
|
|
fileArr.value.push(files.file)
|
|
|
- console.log('大小');
|
|
|
}
|
|
|
//关闭文件上传
|
|
|
const closeUpload =() =>{
|
|
@@ -1547,9 +1558,9 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
//点击收藏后刷新文件
|
|
|
- const refreshFile = ()=>{
|
|
|
- if(toRaw(thisFolder.value).dirId&&!leftNewFile.value){//如果点开了文件夹
|
|
|
- folderClick()
|
|
|
+ const refreshFile = () => {
|
|
|
+ if (toRaw(thisFolder.value).dirId && !leftNewFile.value) {//如果点开了文件夹
|
|
|
+ folderClick()
|
|
|
} else {
|
|
|
getAllTop()
|
|
|
}
|
|
@@ -2349,4 +2360,4 @@ p {
|
|
|
color: #2e6bc8;
|
|
|
right: 97%;
|
|
|
}
|
|
|
-</style>
|
|
|
+</style>
|