From bbef4682f463df7b5648e2edc78fb4ed77a85905 Mon Sep 17 00:00:00 2001
From: dayou <853094838@qq.com>
Date: Mon, 9 Dec 2024 17:50:36 +0800
Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E9=97=AE=E5=8D=B7?=
=?UTF-8?q?=E5=88=86=E7=BB=84bug=20(#459)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
* fix: 修复未分组总数
* fix: 列表接口显示传all
* fix: 修复问卷分组bug
---
.../modules/survey/controllers/surveyGroup.controller.ts | 2 ++
server/src/modules/survey/services/surveyMeta.service.ts | 5 +++--
web/src/management/pages/list/components/ModifyDialog.vue | 2 +-
web/src/management/pages/list/components/SliderBar.vue | 6 +++---
web/src/management/pages/list/index.vue | 2 --
web/src/management/stores/surveyList.ts | 2 +-
web/src/management/styles/common.scss | 3 +++
web/src/management/utils/workSpace.ts | 2 +-
8 files changed, 14 insertions(+), 10 deletions(-)
diff --git a/server/src/modules/survey/controllers/surveyGroup.controller.ts b/server/src/modules/survey/controllers/surveyGroup.controller.ts
index 4852f82e..bb150c6d 100644
--- a/server/src/modules/survey/controllers/surveyGroup.controller.ts
+++ b/server/src/modules/survey/controllers/surveyGroup.controller.ts
@@ -85,6 +85,7 @@ export class SurveyGroupController {
const surveyTotalList = await Promise.all(
groupIdList.map((item) => {
return this.surveyMetaService.countSurveyMetaByGroupId({
+ userId,
groupId: item,
});
}),
@@ -95,6 +96,7 @@ export class SurveyGroupController {
return pre;
}, {});
const notTotal = await this.surveyMetaService.countSurveyMetaByGroupId({
+ userId,
groupId: null,
});
return {
diff --git a/server/src/modules/survey/services/surveyMeta.service.ts b/server/src/modules/survey/services/surveyMeta.service.ts
index dbbb4d4b..c18f4cdb 100644
--- a/server/src/modules/survey/services/surveyMeta.service.ts
+++ b/server/src/modules/survey/services/surveyMeta.service.ts
@@ -173,7 +173,7 @@ export class SurveyMetaService {
}
if (groupId && groupId !== 'all') {
query.groupId =
- groupId === 'nogrouped'
+ groupId === 'unclassified'
? {
$exists: true,
$eq: null,
@@ -248,8 +248,9 @@ export class SurveyMetaService {
});
return total;
}
- async countSurveyMetaByGroupId({ groupId }) {
+ async countSurveyMetaByGroupId({ groupId, userId = undefined }) {
const total = await this.surveyRepository.count({
+ ownerId: userId,
groupId,
$or: [
{ workspaceId: { $exists: false } },
diff --git a/web/src/management/pages/list/components/ModifyDialog.vue b/web/src/management/pages/list/components/ModifyDialog.vue
index 6940cd80..d5305001 100644
--- a/web/src/management/pages/list/components/ModifyDialog.vue
+++ b/web/src/management/pages/list/components/ModifyDialog.vue
@@ -21,7 +21,7 @@
-
+
{
- return props.activeValue
-},
-set: () => {}
+ return props.activeValue
+ },
+ set: () => {}
})
const emit = defineEmits(['select'])
diff --git a/web/src/management/pages/list/index.vue b/web/src/management/pages/list/index.vue
index 6ed71124..7185e9a9 100644
--- a/web/src/management/pages/list/index.vue
+++ b/web/src/management/pages/list/index.vue
@@ -199,9 +199,7 @@ const fetchSurveyList = async (params?: any) => {
}
onMounted(() => {
- fetchGroupList()
fetchSpaceList()
- fetchSurveyList()
})
const modifyType = ref('add')
diff --git a/web/src/management/stores/surveyList.ts b/web/src/management/stores/surveyList.ts
index fcd885ef..f6128953 100644
--- a/web/src/management/stores/surveyList.ts
+++ b/web/src/management/stores/surveyList.ts
@@ -151,7 +151,7 @@ export const useSurveyListStore = defineStore('surveyList', () => {
filter: filterString,
order: orderString,
workspaceId: workSpaceStore.workSpaceId,
- groupId: workSpaceStore.groupId === GroupState.All ? '' : workSpaceStore.groupId
+ groupId: workSpaceStore.groupId
}
const res: any = await getSurveyListReq(params)
diff --git a/web/src/management/styles/common.scss b/web/src/management/styles/common.scss
index ca8e0e70..db021fe4 100644
--- a/web/src/management/styles/common.scss
+++ b/web/src/management/styles/common.scss
@@ -6,3 +6,6 @@
}
}
}
+.el-message-box__status{
+ font-size: 24px;
+}
\ No newline at end of file
diff --git a/web/src/management/utils/workSpace.ts b/web/src/management/utils/workSpace.ts
index ac0cc95f..58fe66bb 100644
--- a/web/src/management/utils/workSpace.ts
+++ b/web/src/management/utils/workSpace.ts
@@ -77,7 +77,7 @@ export enum UserRole {
export enum GroupState {
All = 'all',
- Not = 'nogrouped'
+ Not = 'unclassified'
}
// 定义角色标签映射对象