|
@@ -266,10 +266,10 @@
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-form>
|
|
</el-form>
|
|
<template #footer>
|
|
<template #footer>
|
|
- <span class="dialog-footer">
|
|
|
|
- <el-button @click="folderDialogVisible = false">取消</el-button>
|
|
|
|
- <el-button type="primary" @click="submitFolderForm">确定</el-button>
|
|
|
|
- </span>
|
|
|
|
|
|
+ <span class="dialog-footer">
|
|
|
|
+ <el-button @click="folderDialogVisible = false">取消</el-button>
|
|
|
|
+ <el-button type="primary" @click="submitFolderForm">确定</el-button>
|
|
|
|
+ </span>
|
|
</template>
|
|
</template>
|
|
</el-dialog>
|
|
</el-dialog>
|
|
|
|
|
|
@@ -319,6 +319,8 @@ import dict from "@/utils/dict";
|
|
import {parseTime} from "@/utils/xzl";
|
|
import {parseTime} from "@/utils/xzl";
|
|
import {updateFileStatus} from "@/api/system/file";
|
|
import {updateFileStatus} from "@/api/system/file";
|
|
import {listDept} from "@/api/system/dept";
|
|
import {listDept} from "@/api/system/dept";
|
|
|
|
+import {getUser, getUserProfile} from "@/api/system/user";
|
|
|
|
+import dept from "@/views/system/dept/index.vue";
|
|
|
|
|
|
|
|
|
|
export default {
|
|
export default {
|
|
@@ -384,6 +386,8 @@ export default {
|
|
},
|
|
},
|
|
// 是否为新增文件夹操作
|
|
// 是否为新增文件夹操作
|
|
isAddFolder: true,
|
|
isAddFolder: true,
|
|
|
|
+ // 当前用户部门ID
|
|
|
|
+ userDeptId: null,
|
|
// 表单参数
|
|
// 表单参数
|
|
form: {
|
|
form: {
|
|
fileId: null,
|
|
fileId: null,
|
|
@@ -475,6 +479,7 @@ export default {
|
|
this.getList();
|
|
this.getList();
|
|
this.getFileTree();
|
|
this.getFileTree();
|
|
this.getDeptList();
|
|
this.getDeptList();
|
|
|
|
+ this.getUserInfo();
|
|
this.getConfigKey("sys.user.initPassword").then(response => {
|
|
this.getConfigKey("sys.user.initPassword").then(response => {
|
|
this.initPassword = response.msg;
|
|
this.initPassword = response.msg;
|
|
});
|
|
});
|
|
@@ -495,6 +500,7 @@ export default {
|
|
getFileTree() {
|
|
getFileTree() {
|
|
folderTreeSelectByDeptId().then(response => {
|
|
folderTreeSelectByDeptId().then(response => {
|
|
this.fileOptions = response.data;
|
|
this.fileOptions = response.data;
|
|
|
|
+ console.log("获取到的文件夹树:", this.fileOptions);
|
|
})
|
|
})
|
|
},
|
|
},
|
|
// 筛选节点
|
|
// 筛选节点
|
|
@@ -508,6 +514,11 @@ export default {
|
|
this.selectedFolderId = data.id;
|
|
this.selectedFolderId = data.id;
|
|
this.handleQuery();
|
|
this.handleQuery();
|
|
},
|
|
},
|
|
|
|
+ getUserInfo() {
|
|
|
|
+ getUserProfile().then(response => {
|
|
|
|
+ this.userDeptId = response.data.deptId;
|
|
|
|
+ });
|
|
|
|
+ },
|
|
// 文件状态修改
|
|
// 文件状态修改
|
|
handleStatusChange(row) {
|
|
handleStatusChange(row) {
|
|
const text = row.status === "0" ? "启用" : "停用";
|
|
const text = row.status === "0" ? "启用" : "停用";
|
|
@@ -612,6 +623,7 @@ export default {
|
|
const formData = new FormData();
|
|
const formData = new FormData();
|
|
formData.append('file', file.raw);
|
|
formData.append('file', file.raw);
|
|
formData.append('folderId', this.selectedFolderId);
|
|
formData.append('folderId', this.selectedFolderId);
|
|
|
|
+ formData.append('deptId', this.userDeptId);
|
|
this.upload.isUploading = true;
|
|
this.upload.isUploading = true;
|
|
try {
|
|
try {
|
|
const response = await addFile(formData);
|
|
const response = await addFile(formData);
|
|
@@ -626,15 +638,6 @@ export default {
|
|
handleTemplateDownload() {
|
|
handleTemplateDownload() {
|
|
downloadTemplate().then(blob => {
|
|
downloadTemplate().then(blob => {
|
|
this.parseBlob(blob,'模板.doc');
|
|
this.parseBlob(blob,'模板.doc');
|
|
- console.log(blob)
|
|
|
|
- // const url = window.URL.createObjectURL(new Blob([blob]));
|
|
|
|
- // const link = document.createElement('a');
|
|
|
|
- // link.href = url;
|
|
|
|
- // link.setAttribute('download', '模板.doc'); // 下载的文件名
|
|
|
|
- // document.body.appendChild(link);
|
|
|
|
- // link.click();
|
|
|
|
- // link.remove();
|
|
|
|
- // window.URL.revokeObjectURL(url);
|
|
|
|
});
|
|
});
|
|
},
|
|
},
|
|
// 文件上传中处理
|
|
// 文件上传中处理
|
|
@@ -666,9 +669,7 @@ export default {
|
|
async getDeptList() {
|
|
async getDeptList() {
|
|
try {
|
|
try {
|
|
const response = await listDept();
|
|
const response = await listDept();
|
|
- console.log(response);
|
|
|
|
this.deptOptions = response.data;
|
|
this.deptOptions = response.data;
|
|
- console.log(this.deptOptions);
|
|
|
|
} catch (error) {
|
|
} catch (error) {
|
|
this.$message.error('获取部门列表失败');
|
|
this.$message.error('获取部门列表失败');
|
|
}
|
|
}
|
|
@@ -680,7 +681,7 @@ export default {
|
|
this.folderForm = {
|
|
this.folderForm = {
|
|
parentId: data.id,
|
|
parentId: data.id,
|
|
folderName: '',
|
|
folderName: '',
|
|
- deptId: null
|
|
|
|
|
|
+ deptId: this.userDeptId
|
|
};
|
|
};
|
|
this.folderDialogVisible = true;
|
|
this.folderDialogVisible = true;
|
|
},
|
|
},
|
|
@@ -727,13 +728,15 @@ export default {
|
|
inputPattern: /.+/,
|
|
inputPattern: /.+/,
|
|
inputErrorMessage: '文件夹名称不能为空'
|
|
inputErrorMessage: '文件夹名称不能为空'
|
|
}).then(({value}) => {
|
|
}).then(({value}) => {
|
|
- updateFolder({folderId: data.id, folderName: value}).then(() => {
|
|
|
|
|
|
+ getFolder(data.id).then(res => {
|
|
|
|
+ const deptId = res.data.deptId;
|
|
|
|
+ updateFolder({folderId: data.id, folderName: value, deptId: deptId}).then(() => {
|
|
this.$modal.msgSuccess("修改成功");
|
|
this.$modal.msgSuccess("修改成功");
|
|
this.getFileTree(); // 刷新树
|
|
this.getFileTree(); // 刷新树
|
|
});
|
|
});
|
|
});
|
|
});
|
|
|
|
+ });
|
|
},
|
|
},
|
|
-
|
|
|
|
// 删除文件夹
|
|
// 删除文件夹
|
|
handleDeleteFolder(data) {
|
|
handleDeleteFolder(data) {
|
|
this.$confirm(`是否确认删除文件夹 “${data.label}”?`, '提示', {
|
|
this.$confirm(`是否确认删除文件夹 “${data.label}”?`, '提示', {
|
|
@@ -761,11 +764,7 @@ export default {
|
|
this.getList(); // 刷新文件列表
|
|
this.getList(); // 刷新文件列表
|
|
});
|
|
});
|
|
}
|
|
}
|
|
- }).catch(() => {
|
|
|
|
- this.$message.info("已取消删除");
|
|
|
|
});
|
|
});
|
|
- }).catch(() => {
|
|
|
|
- this.$message.info("操作已取消");
|
|
|
|
});
|
|
});
|
|
},
|
|
},
|
|
handleDelete() {
|
|
handleDelete() {
|