From 742abea1f93249c11aaf7dbb04c24d7dcd8f44eb Mon Sep 17 00:00:00 2001
From: Quella <2892744389@qq.com>
Date: Mon, 15 Sep 2025 09:56:34 +0800
Subject: [PATCH] init
---
ruoyi-ui/src/views/project/doc/index.vue | 56 ++++++++++++++++---
ruoyi-ui/src/views/project/module/index.vue | 35 ++++++++----
.../src/views/project/module/myModules.vue | 31 +++++++++-
ruoyi-ui/src/views/project/project/index.vue | 13 +++--
4 files changed, 107 insertions(+), 28 deletions(-)
diff --git a/ruoyi-ui/src/views/project/doc/index.vue b/ruoyi-ui/src/views/project/doc/index.vue
index 2852965..ac7f41d 100644
--- a/ruoyi-ui/src/views/project/doc/index.vue
+++ b/ruoyi-ui/src/views/project/doc/index.vue
@@ -51,6 +51,11 @@
+
+
+ {{ scope.row.moduleName || (scope.row.kindType === '0' || scope.row.kindType === 0 ? '项目文档' : '-') }}
+
+
{{ (scope.row.docType) || (scope.row.docPath ? scope.row.docPath.split('.').pop() : '-') }}
@@ -338,14 +343,23 @@ export default {
this.upload.meta.moduleId = null;
if (!projectId) { this.moduleOptions = []; return; }
try {
+ const currentUid = String(this.currentUserId)
+ // 无论角色,上传模块文档都只允许当前用户为接取人(assignee)
+ // 因此下拉仅展示“我为接取人”的模块,避免误选
+ let rows = []
if (!this.isProjectAdmin && this.isNormalUser) {
- // 从“我的模块”中过滤出所选项目的可见模块
- const { rows } = await getMyModules({ pageNum: 1, pageSize: 9999 })
- this.moduleOptions = (rows || []).filter(m => String(m.projectId) === String(projectId))
+ const res = await getMyModules({ pageNum: 1, pageSize: 9999 })
+ rows = res && Array.isArray(res.rows) ? res.rows : []
} else {
- const { rows } = await listModulesByProject(projectId)
- this.moduleOptions = rows || []
+ const res = await listModulesByProject(projectId)
+ rows = res && Array.isArray(res.rows) ? res.rows : []
}
+ this.moduleOptions = rows
+ .filter(m => String(m.projectId) === String(projectId))
+ .filter(m => (m.assigneeId != null && String(m.assigneeId) === currentUid)
+ || (m.assignee && (String(m.assignee) === currentUid
+ || m.assignee === (this.$store.getters && this.$store.getters.name)
+ || m.assignee === (this.$store.getters && this.$store.getters.nickName))))
} catch (e) {
this.moduleOptions = []
}
@@ -463,11 +477,33 @@ export default {
},
// 文件上传成功处理
handleFileSuccess(response, file, fileList) {
- this.upload.open = false;
this.upload.isUploading = false;
- this.$refs.upload.clearFiles();
- this.$alert("" + response.msg + "
", "导入结果", { dangerouslyUseHTMLString: true });
- this.getList();
+ // 按后端 code 判断
+ if (response && typeof response.code !== 'undefined' && Number(response.code) !== 200) {
+ this.$message.error(response.msg || '上传失败')
+ return
+ }
+ // 统一成功提示
+ const msg = (response && (response.msg || response.message)) || '上传成功'
+ this.$message.success(msg)
+ // 关闭弹窗、清空文件列表
+ this.uploadOpen = false
+ this.$nextTick(() => {
+ try { this.$refs.upload && this.$refs.upload.clearFiles() } catch(e) {}
+ })
+ // 同步筛选条件为当前上传目标并即时刷新列表
+ const { kindType, projectId, moduleId } = this.upload.meta
+ this.queryParams.kind_type = kindType
+ if (kindType === 1) {
+ this.queryParams.moduleId = moduleId
+ this.queryParams.projectId = null
+ } else {
+ this.queryParams.projectId = projectId
+ this.queryParams.moduleId = null
+ }
+ this.queryParams.pageNum = 1
+ // 即时刷新列表
+ this.getList()
},
// 文件上传失败处理(网络/后端错误)
handleFileError(err, file, fileList) {
@@ -534,6 +570,8 @@ export default {
this.$modal.msgError('请选择所属模块');
return;
}
+ // 增加上传中状态,避免重复点击
+ this.upload.isUploading = true
this.$refs.upload.submit();
}
}
diff --git a/ruoyi-ui/src/views/project/module/index.vue b/ruoyi-ui/src/views/project/module/index.vue
index 010c322..db518c5 100644
--- a/ruoyi-ui/src/views/project/module/index.vue
+++ b/ruoyi-ui/src/views/project/module/index.vue
@@ -108,7 +108,7 @@
v-hasPermi="['project:module:claim']"
>接取
-
-
-
+