|
@@ -41,8 +41,10 @@
|
|
|
</div>
|
|
|
<div>
|
|
|
<p>
|
|
|
- <span style="margin-left: 10px;">{{ useSpace }}G/{{ allSpace * 1024 }}G</span>
|
|
|
- <span style="margin-left: 10rem;font-size: 12px;color: blue;cursor: pointer;"
|
|
|
+ <span style="margin-left: 10px;">{{ useSpace ? useSpace + 'G' : '未能找到已使用空间' }}/{{ allSpace ?
|
|
|
+ allSpace
|
|
|
+ * 1024 + 'G' : '未能找到总空间' }}</span>
|
|
|
+ <span style="margin-left: 10px;font-size: 12px;color: blue;cursor: pointer;"
|
|
|
@click="askApply">申请扩容</span>
|
|
|
</p>
|
|
|
<el-progress style="margin-left: 8px;" :percentage="percent()" />
|
|
@@ -152,7 +154,7 @@
|
|
|
<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">
|
|
|
+ :single-select="true" @row-click="folderClick">
|
|
|
<el-table-column type="selection" width="55" />
|
|
|
<el-table-column label="名称" width="180">
|
|
|
<template #default="scope">
|
|
@@ -358,6 +360,24 @@
|
|
|
</template>
|
|
|
</el-dialog>
|
|
|
</div>
|
|
|
+ <!-- 文件重命名 -->
|
|
|
+ <div>
|
|
|
+ <el-dialog v-model="fileNameChange" title="重命名" width="30%">
|
|
|
+ <el-form :model="nameForm" label-width="120px">
|
|
|
+ <el-form-item label="新名字">
|
|
|
+ <el-input v-model="nameForm.name"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <template #footer>
|
|
|
+ <span class="dialog-footer">
|
|
|
+ <el-button @click="fileNameChange = false">取消</el-button>
|
|
|
+ <el-button type="primary" @click="sureChangeName">
|
|
|
+ 确认
|
|
|
+ </el-button>
|
|
|
+ </span>
|
|
|
+ </template>
|
|
|
+ </el-dialog>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -424,6 +444,14 @@ export default {
|
|
|
let useSpace = ref(0)
|
|
|
let allSpace = ref(0)
|
|
|
let fileArr = ref([])
|
|
|
+ let copyDirId = ref(0)//需要操作的dirid
|
|
|
+ let copySpaceId = ref(0)//需要操作的spaceid
|
|
|
+ let copyDocId = ref(0)//需要操作的docid
|
|
|
+ let copyFileId = ref(0)//需要操作的fileid
|
|
|
+ let copyFileSize = ref(0)//需要操作的filesize
|
|
|
+ let copyFileType = ref('')//需要操作的文件类型
|
|
|
+ let copyFileName = ref("")//需要操作的文件名
|
|
|
+ let directoryId = ref('')
|
|
|
let boserForm = ref({
|
|
|
spaceId: "",//空间id
|
|
|
dirName: "",
|
|
@@ -441,26 +469,6 @@ export default {
|
|
|
remark: "",
|
|
|
})
|
|
|
let fileList = ref([
|
|
|
- {
|
|
|
- date: '2016-05-03',
|
|
|
- name: 'Tom',
|
|
|
- address: 'No. 189, Grove St, Los Angeles',
|
|
|
- },
|
|
|
- {
|
|
|
- date: '2016-05-02',
|
|
|
- name: 'Tom',
|
|
|
- address: 'No. 189, Grove St, Los Angeles',
|
|
|
- },
|
|
|
- {
|
|
|
- date: '2016-05-04',
|
|
|
- name: 'Tom',
|
|
|
- address: 'No. 189, Grove St, Los Angeles',
|
|
|
- },
|
|
|
- {
|
|
|
- date: '2016-05-01',
|
|
|
- name: 'Tom',
|
|
|
- address: 'No. 189, Grove St, Los Angeles',
|
|
|
- },
|
|
|
])
|
|
|
let menuList = ref([
|
|
|
])
|
|
@@ -550,10 +558,14 @@ export default {
|
|
|
name: "删除"
|
|
|
}
|
|
|
])
|
|
|
+ let nameForm = ref({
|
|
|
+ name: ""
|
|
|
+ })
|
|
|
+ let fileNameChange = ref(false)
|
|
|
let fileMenu = ref([])
|
|
|
// 获取所有文件夹
|
|
|
function getAll() {
|
|
|
- myfile.getAllFileMenu({}).then(res => {
|
|
|
+ myfile.getAllFileMenu({ dirId: folderId.value }).then(res => {
|
|
|
if (res.code === 200) {
|
|
|
fileList.value = res.rows
|
|
|
}
|
|
@@ -566,6 +578,8 @@ export default {
|
|
|
})
|
|
|
}
|
|
|
function changeFile(row, num) {
|
|
|
+ directoryId.value = row.spaceId
|
|
|
+ getAllText()
|
|
|
this.selectedIndex = num
|
|
|
const newItem = {
|
|
|
name: row.spaceName,
|
|
@@ -577,7 +591,6 @@ export default {
|
|
|
if (!isItemExist) {
|
|
|
menuList.value.push(newItem);
|
|
|
}
|
|
|
- console.log(row, 'asdasd');
|
|
|
useSpace.value = row.usedCap
|
|
|
allSpace.value = row.spaceCap
|
|
|
}
|
|
@@ -592,7 +605,14 @@ export default {
|
|
|
}
|
|
|
// 文件名表格每一行点击事件
|
|
|
function handleRowClick(row) {
|
|
|
+ console.log(row,'55');
|
|
|
clickRowId.value = row.docId
|
|
|
+ copyDirId.value = row.dirId
|
|
|
+ copySpaceId.value = row.spaceId
|
|
|
+ copyFileId.value = row.fileId
|
|
|
+ copyFileSize.value = row.fileSize
|
|
|
+ copyFileType.value = row.fileType
|
|
|
+ nameForm.value.name = row.fileName
|
|
|
if (cliCC.value === true) {
|
|
|
cliCC.value = false
|
|
|
} else {
|
|
@@ -634,11 +654,35 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
+ if (row.name === '复制') {
|
|
|
+ myfile.fileCopy({ dirId: copyDirId.value, docId: clickRowId.value, spaceId: copySpaceId.value }).then(res => {
|
|
|
+ if (res.code === 200) {
|
|
|
+ ElMessage({
|
|
|
+ message: "复制成功",
|
|
|
+ type: "success"
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ if (row.name === '移动') {
|
|
|
+ myfile.fileMove({ dirId: copyDirId.value, docId: clickRowId.value, spaceId: copySpaceId.value }).then(res => {
|
|
|
+ if (res.code === 200) {
|
|
|
+ ElMessage({
|
|
|
+ message: "移动成功",
|
|
|
+ type: "success"
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ if (row.name === '重命名') {
|
|
|
+ fileNameChange.value = true
|
|
|
+ }
|
|
|
}
|
|
|
function chooseSet1() {
|
|
|
transferModal.value = true
|
|
|
anyP.value = false
|
|
|
}
|
|
|
+ // 穿梭框
|
|
|
function generateData() {
|
|
|
const data = []
|
|
|
const states = [
|
|
@@ -660,6 +704,7 @@ export default {
|
|
|
})
|
|
|
return data
|
|
|
}
|
|
|
+ // 穿梭狂数据
|
|
|
function filterMethod(query, item) {
|
|
|
return item.initial.toLowerCase().includes(query.toLowerCase())
|
|
|
}
|
|
@@ -690,14 +735,16 @@ export default {
|
|
|
getAllText()
|
|
|
})
|
|
|
}
|
|
|
+ // 所有文件夹
|
|
|
function getAllText() {
|
|
|
- documents.getALLdocument({}).then(res => {
|
|
|
+ documents.getALLdocument({ spaceId: directoryId.value }).then(res => {
|
|
|
folderList.value = res.data
|
|
|
})
|
|
|
}
|
|
|
function createNewFile() {
|
|
|
addFile.value = true
|
|
|
}
|
|
|
+ // 确定新增中栏
|
|
|
function sureAddFile() {
|
|
|
fileSpace.addFileSpace(
|
|
|
{
|
|
@@ -724,34 +771,6 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
- // function fileUpload() {
|
|
|
- // const fileInput = document.getElementById('fileInput');
|
|
|
- // const uploadButton = document.getElementById('uploadButton');
|
|
|
- // // 监听按钮点击事件
|
|
|
- // uploadButton.addEventListener('click', function () {
|
|
|
- // // 模拟点击文件上传输入框
|
|
|
- // fileInput.click();
|
|
|
- // });
|
|
|
- // // 监听文件选择事件
|
|
|
- // fileInput.addEventListener('change', function () {
|
|
|
- // const files = fileInput.files[0]; // 获取选择的文件
|
|
|
- // console.log(files, 'file');
|
|
|
- // myfile.uploadFile({
|
|
|
- // spaceId: 1,
|
|
|
- // dirId: 1,
|
|
|
- // file: files
|
|
|
- // }).then(res => {
|
|
|
- // console.log(res, '222');
|
|
|
- // if (res.code === 200) {
|
|
|
- // ElMessage({
|
|
|
- // message: "上传文件成功",
|
|
|
- // type: "success"
|
|
|
- // })
|
|
|
- // getAll()
|
|
|
- // }
|
|
|
- // })
|
|
|
- // })
|
|
|
- // }
|
|
|
function arrowClick(row, num) {
|
|
|
if (row.name === '文件') {
|
|
|
uploadModal.value = true
|
|
@@ -810,7 +829,8 @@ export default {
|
|
|
val.shift();
|
|
|
}
|
|
|
if (val.length === 1) {
|
|
|
- folderId.value = val[0].docIds
|
|
|
+ folderId.value = val[0].dirId
|
|
|
+ console.log(folderId.value, '666');
|
|
|
}
|
|
|
}
|
|
|
// 重命名
|
|
@@ -844,6 +864,11 @@ export default {
|
|
|
type: "success"
|
|
|
})
|
|
|
getAllText()
|
|
|
+ } else {
|
|
|
+ ElMessage({
|
|
|
+ message: "删除失败,目录应不为空",
|
|
|
+ type: "error"
|
|
|
+ })
|
|
|
}
|
|
|
})
|
|
|
myfile.delMenu(fileId.value).then(res => {
|
|
@@ -876,6 +901,34 @@ export default {
|
|
|
return numP
|
|
|
}
|
|
|
}
|
|
|
+ // 文件夹每行点击事件
|
|
|
+ function folderClick(row, list) {
|
|
|
+ folderId.value = row.dirId
|
|
|
+ getAll()
|
|
|
+ }
|
|
|
+ // 确认文件重命名
|
|
|
+ function sureChangeName() {
|
|
|
+ myfile.editNewMenu({
|
|
|
+ dirId: copyDirId.value - 0,
|
|
|
+ docId: clickRowId.value - 0,
|
|
|
+ fileId: copyFileId.value,
|
|
|
+ fileName: nameForm.value.name,
|
|
|
+ fileSize: copyFileSize.value - 0,
|
|
|
+ fileType: copyFileType.value,
|
|
|
+ remark: '',
|
|
|
+ spaceId: copySpaceId.value - 0,
|
|
|
+ }).then(res => {
|
|
|
+ console.log(res,'852');
|
|
|
+ if (res.code === 200) {
|
|
|
+ ElMessage({
|
|
|
+ message: "重命名成功",
|
|
|
+ type: "success"
|
|
|
+ })
|
|
|
+ fileNameChange.value = false
|
|
|
+ getAll()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
return {
|
|
|
folderList,//文件夹的数据
|
|
|
fileList,//文件夹的数据
|
|
@@ -959,6 +1012,18 @@ export default {
|
|
|
sureUpload,
|
|
|
onSuccess,
|
|
|
fileArr,
|
|
|
+ directoryId,
|
|
|
+ folderClick,
|
|
|
+ copyDirId,//复制移动需要的↓
|
|
|
+ copyDocId,
|
|
|
+ copySpaceId,
|
|
|
+ copyFileId,
|
|
|
+ copyFileName,
|
|
|
+ copyFileSize,
|
|
|
+ copyFileType,
|
|
|
+ sureChangeName,//文件重命名
|
|
|
+ fileNameChange,//文件重命名模态框
|
|
|
+ nameForm,
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
@@ -966,6 +1031,14 @@ export default {
|
|
|
this.getSpace()
|
|
|
this.getAllText()
|
|
|
this.getAllMiddle()
|
|
|
+ if (this.directoryId === '') {
|
|
|
+ this.directoryId = 0
|
|
|
+ this.getAllText()
|
|
|
+ }
|
|
|
+ if (this.folderId === '') {
|
|
|
+ this.folderId = 0
|
|
|
+ this.getAll()
|
|
|
+ }
|
|
|
},
|
|
|
watch: {
|
|
|
},
|