|
@@ -34,16 +34,15 @@
|
|
|
</template>
|
|
|
</el-dropdown>
|
|
|
<img src="../../assets/images/fileStyle.png" style="width: 72px;height: 72px;">
|
|
|
- <p class="ellipsis-text" v-if="selectedBox !== index">{{ item.dirName }}</p>
|
|
|
- <el-input v-else v-model="newName" @blur="nameChange(item, index)"></el-input>
|
|
|
+ <p class="ellipsis-text">{{ item.dirName }}</p>
|
|
|
</div>
|
|
|
</template>
|
|
|
</div>
|
|
|
<div>
|
|
|
<p>
|
|
|
- <span style="margin-left: 5px;">{{ useSpace ? useSpace + 'G' : '未能找到已使用空间' }}/{{ allSpace ?
|
|
|
+ <span style="margin-left: 5px;">{{ useSpace ? useSpace + 'G' : '0' }}/{{ allSpace ?
|
|
|
allSpace
|
|
|
- * 1024 + 'G' : '未能找到总空间' }}</span>
|
|
|
+ * 1024 + 'G' : '0' }}</span>
|
|
|
<span style="margin-left: 5px;font-size: 12px;color: blue;cursor: pointer;"
|
|
|
@click="askApply">申请扩容</span>
|
|
|
</p>
|
|
@@ -249,7 +248,7 @@
|
|
|
</el-dialog>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <FileEdit v-else></FileEdit>
|
|
|
+ <FileEdit v-else :docId="clickRowId" :copyRow="copyRow"></FileEdit>
|
|
|
</div>
|
|
|
<!-- 扩容弹窗 -->
|
|
|
<div>
|
|
@@ -409,6 +408,18 @@
|
|
|
</template>
|
|
|
</el-dialog>
|
|
|
</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>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
<!-- 图片预览 -->
|
|
@@ -426,7 +437,7 @@ import fileShare from '../../api/fileShare/fileShare'
|
|
|
import collect from '../../api/collect/collect'
|
|
|
import fileCount from '../../api/fileCount/fileCount'
|
|
|
import BreadMenu from './components/BreadMenu.vue'
|
|
|
-import FileEdit from './components/FileEdit.vue'
|
|
|
+import FileEdit from './components/fileedit.vue'
|
|
|
import ImgFile from "./jsComponents/ImgFile"
|
|
|
import { Search } from '@element-plus/icons-vue'
|
|
|
import blueLeft from '../../assets/images/blueLeft.png'
|
|
@@ -443,6 +454,7 @@ export default {
|
|
|
let files = ref(['2'])
|
|
|
let folderList = ref([])
|
|
|
let askTo = ref(false)
|
|
|
+ let folderName = ref(false)
|
|
|
let askNum = ref(1)
|
|
|
let askTalk = ref('')
|
|
|
let newTag = ref('')
|
|
@@ -611,13 +623,10 @@ export default {
|
|
|
let fileNameChange = ref(false)
|
|
|
let fileMenu = ref([])
|
|
|
let collectList = ref([])
|
|
|
+ let copyRow = ref({})
|
|
|
// 获取所有文件
|
|
|
function getAll() {
|
|
|
- myfile.getAllFileMenu({ dirId: folderId.value }).then(res => {
|
|
|
- if (res.code === 200) {
|
|
|
- fileList.value = res.rows
|
|
|
- }
|
|
|
- })
|
|
|
+
|
|
|
}
|
|
|
// 获取用户树
|
|
|
function getAllUser() {
|
|
@@ -652,25 +661,23 @@ export default {
|
|
|
})
|
|
|
})
|
|
|
}
|
|
|
- // 中栏
|
|
|
- function getAllText() {
|
|
|
- documents.getALLdocument({ spaceId: directoryId.value }).then(res => {
|
|
|
- folderList.value = res.data
|
|
|
- fileMenu.value = res.data
|
|
|
+ // 获取文件夹,中栏,文件
|
|
|
+ function getAllTop() {
|
|
|
+ documents.getTop(3).then(res => {
|
|
|
+ fileMenu.value = [res]
|
|
|
+ documents.getALLdocument({ parentId: fileMenu.value[0].parentId - 0, spaceId: fileMenu.value[0].spaceId - 0 }).then(res => {
|
|
|
+ folderList.value = res.data
|
|
|
+ })
|
|
|
+ myfile.getAllFileMenu({ dirId: fileMenu.value[0].dirId - 0 }).then(res => {
|
|
|
+ if (res.code === 200) {
|
|
|
+ fileList.value = res.rows
|
|
|
+ }
|
|
|
+ })
|
|
|
})
|
|
|
}
|
|
|
// 获取所有文件夹
|
|
|
function getAllFolder() {
|
|
|
- if (copyParentId.value === '') {
|
|
|
- copyParentId.value = 0
|
|
|
- documents.getALLdocument({ parentId: copyParentId.value - 0 }).then(res => {
|
|
|
- folderList.value = res.data
|
|
|
- })
|
|
|
- } else {
|
|
|
- documents.getALLdocument({ parentId: copyParentId.value - 0 }).then(res => {
|
|
|
- folderList.value = res.data
|
|
|
- })
|
|
|
- }
|
|
|
+
|
|
|
}
|
|
|
function changeFile(row, num) {
|
|
|
copyParentId.value = row.parentId
|
|
@@ -700,6 +707,7 @@ export default {
|
|
|
}
|
|
|
// 文件名表格每一行点击事件
|
|
|
function handleRowClick(row) {
|
|
|
+ copyRow.value = row
|
|
|
clickRowId.value = row.docId
|
|
|
copyDirId.value = row.dirId
|
|
|
copySpaceId.value = row.spaceId
|
|
@@ -804,9 +812,9 @@ export default {
|
|
|
"dirName": boserForm.value.dirName,
|
|
|
// "dirRole": boserForm.value.dirPower,
|
|
|
// "dirType": boserForm.value.dirType,
|
|
|
- "parentId": copyParentId.value-0,
|
|
|
+ "parentId": copyParentId.value - 0,
|
|
|
// "remark": boserForm.value.remark,
|
|
|
- "spaceId": directoryId.value,
|
|
|
+ "spaceId": fileMenu.value[0].spaceId-0,
|
|
|
}).then(res => {
|
|
|
if (res.code === 200) {
|
|
|
ElMessage({
|
|
@@ -815,7 +823,7 @@ export default {
|
|
|
})
|
|
|
}
|
|
|
addBoser.value = false
|
|
|
- getAllText()
|
|
|
+ getAllTop()
|
|
|
})
|
|
|
}
|
|
|
|
|
@@ -861,8 +869,8 @@ export default {
|
|
|
if (fileArr.value.length > 0) {
|
|
|
for (var i = 0; i <= fileArr.value.length; i++) {
|
|
|
myfile.uploadFile({
|
|
|
- spaceId: 1,
|
|
|
- dirId: 1,
|
|
|
+ spaceId: fileMenu.value[0].spaceId-0,
|
|
|
+ dirId: fileMenu.value[0].dirId-0,
|
|
|
file: fileArr.value[i]
|
|
|
}).then(res => {
|
|
|
if (res.code === 200) {
|
|
@@ -870,7 +878,7 @@ export default {
|
|
|
message: "上传文件成功",
|
|
|
type: "success"
|
|
|
})
|
|
|
- getAll()
|
|
|
+ getAllTop()
|
|
|
uploadModal.value = false
|
|
|
fileArr.value = []
|
|
|
}
|
|
@@ -918,23 +926,12 @@ export default {
|
|
|
// 重命名
|
|
|
function restName(row, index) {
|
|
|
newName.value = row.dirName
|
|
|
- selectedBox.value = index
|
|
|
+ folderName.value = true
|
|
|
+ selectedBox.value = row.dirId
|
|
|
}
|
|
|
// 重命名失焦事件
|
|
|
function nameChange(row, index) {
|
|
|
- document.editDocument({
|
|
|
- "spaceId": row.spaceId,
|
|
|
- "spaceName": newName.value,
|
|
|
- }).then(res => {
|
|
|
- if (res.code === 200) {
|
|
|
- getAllFolder()
|
|
|
- selectedBox.value = -1
|
|
|
- ElMessage({
|
|
|
- message: '重命名成功',
|
|
|
- type: "success"
|
|
|
- })
|
|
|
- }
|
|
|
- })
|
|
|
+
|
|
|
}
|
|
|
function getMenu(row, num) {
|
|
|
if (row.name === '删除') {
|
|
@@ -945,7 +942,7 @@ export default {
|
|
|
message: "删除成功",
|
|
|
type: "success"
|
|
|
})
|
|
|
- getAllText()
|
|
|
+ getAllTop()
|
|
|
} else {
|
|
|
ElMessage({
|
|
|
message: "删除失败,目录应不为空",
|
|
@@ -1082,13 +1079,29 @@ export default {
|
|
|
function isId() {
|
|
|
if (this.directoryId === '') {
|
|
|
this.directoryId = 0
|
|
|
- this.getAllText()
|
|
|
+ this.getAllTop()
|
|
|
}
|
|
|
if (this.folderId === '') {
|
|
|
this.folderId = 0
|
|
|
this.getAll()
|
|
|
}
|
|
|
}
|
|
|
+ // 中栏重命名
|
|
|
+ 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"
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
return {
|
|
|
allBag,
|
|
|
folderList,//文件夹的数据
|
|
@@ -1129,7 +1142,6 @@ export default {
|
|
|
createNewMenu,
|
|
|
sureAddBoser,
|
|
|
// delBoser,
|
|
|
- getAllText,
|
|
|
clickRowId,
|
|
|
addFile,
|
|
|
createNewFile,
|
|
@@ -1193,17 +1205,22 @@ export default {
|
|
|
editOnline,//在线编辑
|
|
|
copyParentId,
|
|
|
getAllFolder,
|
|
|
+ folderName,
|
|
|
+ sureFolderName,
|
|
|
+ copyRow,
|
|
|
+ getAllTop,
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
|
+ this.getAllTop()
|
|
|
this.getAll();
|
|
|
this.getSpace()
|
|
|
- this.getAllText()
|
|
|
// this.getAllMiddle()
|
|
|
this.getAllUser()
|
|
|
this.getAllCollect()
|
|
|
this.isId()
|
|
|
this.getAllFolder()
|
|
|
+
|
|
|
},
|
|
|
watch: {
|
|
|
},
|