From c6723155a518b9cd8227727cb8442fcca380a178 Mon Sep 17 00:00:00 2001 From: baiqi Date: Fri, 8 Dec 2023 14:55:03 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E7=94=A8=E4=BE=8B=E8=AF=84=E5=AE=A1):=20?= =?UTF-8?q?=E7=94=A8=E4=BE=8B=E8=AF=84=E5=AE=A1=E9=83=A8=E5=88=86=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3&=E9=83=A8=E5=88=86=E7=BB=84=E4=BB=B6=E8=B0=83?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/api/modules/setting/config.ts | 13 ++ frontend/src/api/requrls/setting/config.ts | 4 + .../business/ms-case-associate/index.vue | 66 ++++---- .../business/ms-detail-drawer/index.vue | 7 +- .../components/baseInfo.vue | 64 +++++--- .../ms-personal-drawer/components/setPsw.vue | 11 +- .../components/business/ms-select/index.tsx | 4 + .../src/components/business/ms-tree/index.vue | 8 +- .../pure/ms-advance-filter/index.vue | 2 +- frontend/src/models/setting/config.ts | 5 + frontend/src/models/user.ts | 12 +- .../components/create/associateDrawer.vue | 53 +++++-- .../components/index/moduleTree.vue | 14 +- .../components/index/popConfirm.vue | 36 +---- .../components/index/reviewTable.vue | 19 ++- .../case-management/caseReview/create.vue | 104 ++++--------- .../case-management/caseReview/index.vue | 2 +- .../caseReview/locale/en-US.ts | 51 +++++++ .../caseReview/locale/zh-CN.ts | 1 + .../fileManagement/components/folderTree.vue | 2 +- .../fileManagement/components/popConfirm.vue | 1 + .../config/components/memoryCleanup.vue | 141 ++++++++++++++++++ .../src/views/setting/system/config/index.vue | 6 + .../setting/system/config/locale/en-US.ts | 12 ++ .../setting/system/config/locale/zh-CN.ts | 11 ++ .../system/log/components/logCards.vue | 4 + .../views/setting/system/log/locale/en-US.ts | 1 + .../views/setting/system/log/locale/zh-CN.ts | 1 + 28 files changed, 453 insertions(+), 202 deletions(-) create mode 100644 frontend/src/views/setting/system/config/components/memoryCleanup.vue diff --git a/frontend/src/api/modules/setting/config.ts b/frontend/src/api/modules/setting/config.ts index 675249ce37..6384301652 100644 --- a/frontend/src/api/modules/setting/config.ts +++ b/frontend/src/api/modules/setting/config.ts @@ -5,10 +5,12 @@ import { GetAuthDetailUrl, GetAuthListUrl, GetBaseInfoUrl, + GetCleanConfigUrl, GetEmailInfoUrl, GetPageConfigUrl, SaveBaseInfoUrl, SaveBaseUrlUrl, + SaveCleanConfigUrl, SaveEmailInfoUrl, SavePageConfigUrl, TestEmailUrl, @@ -23,6 +25,7 @@ import type { AuthItem, AuthParams, BaseConfig, + CleanupConfig, EmailConfig, LDAPConfig, LDAPConnectConfig, @@ -112,3 +115,13 @@ export function testLdapConnect(data: LDAPConnectConfig) { export function testLdapLogin(data: LDAPConfig) { return MSR.post({ url: TestLdapLoginUrl, data }); } + +// 保存内存清理配置 +export function saveCleanupConfig(data: SaveInfoParams) { + return MSR.post({ url: SaveCleanConfigUrl, data }); +} + +// 保存内存清理配置 +export function getCleanupConfig() { + return MSR.get({ url: GetCleanConfigUrl }); +} diff --git a/frontend/src/api/requrls/setting/config.ts b/frontend/src/api/requrls/setting/config.ts index ba95232d27..fdd1c64314 100644 --- a/frontend/src/api/requrls/setting/config.ts +++ b/frontend/src/api/requrls/setting/config.ts @@ -30,6 +30,10 @@ export const DeleteAuthUrl = '/system/authsource/delete'; export const TestLdapConnectUrl = '/system/authsource/ldap/test-connect'; // 测试ldap登录 export const TestLdapLoginUrl = '/system/authsource/ldap/test-login'; +// 内存清理配置保存 +export const SaveCleanConfigUrl = '/system/parameter/edit/clean-config'; +// 获取内存清理配置 +export const GetCleanConfigUrl = '/system/parameter/get/clean-config'; // 获取系统主页左上角图片 export const GetTitleImgUrl = `${import.meta.env.VITE_API_BASE_URL}/base-display/get/logo-platform`; diff --git a/frontend/src/components/business/ms-case-associate/index.vue b/frontend/src/components/business/ms-case-associate/index.vue index 0a1f1d3324..c24410dc50 100644 --- a/frontend/src/components/business/ms-case-associate/index.vue +++ b/frontend/src/components/business/ms-case-associate/index.vue @@ -19,7 +19,7 @@
{{ t('caseManagement.caseReview.allReviews') }}
-
({{ allFileCount }})
+
({{ allCaseCount }})
@@ -50,12 +50,23 @@
-
-
-
{{ activeFolderName }}
-
({{ activeFolderName }})
-
-
+ + + + + @@ -88,9 +87,9 @@
- {{ - t('common.cancel') - }} + + {{ t('common.cancel') }} + Promise; modulesCount?: Record; // 模块数量统计对象 okButtonDisabled?: boolean; // 确认按钮是否禁用 + selectedKeys?: string[]; // 已选中的用例id }>(); const emit = defineEmits<{ (e: 'update:visible', val: boolean): void; @@ -187,7 +189,9 @@ const activeFolder = ref('all'); const activeFolderName = ref(t('ms.case.associate.allCase')); - const allFileCount = ref(0); + const allCaseCount = ref(0); + const filterRowCount = ref(0); + const filterConfigList = ref([]); function getFolderClass(id: string) { return activeFolder.value === id ? 'folder-text folder-text--active' : 'folder-text'; @@ -213,7 +217,7 @@ async function initModules(isSetDefaultKey = false) { try { moduleLoading.value = true; - const res = await getModules(appStore.currentProjectId); + const res = await props.getModulesFunc(appStore.currentProjectId); folderTree.value = res; if (isSetDefaultKey) { selectedModuleKeys.value = [folderTree.value[0].id]; @@ -259,7 +263,7 @@ }); /** - * 初始化模块文件数量 + * 初始化模块资源数量 */ watch( () => props.modulesCount, @@ -327,7 +331,7 @@ isTag: true, }, ]; - const { propsRes, propsEvent, loadList, setLoadListParams } = useTable( + const { propsRes, propsEvent, loadList, setLoadListParams, resetSelector } = useTable( () => Promise.resolve({ list: [ @@ -443,6 +447,7 @@ Message.success(t('ms.case.associate.associateSuccess')); innerVisible.value = false; emit('success', Array.from(propsRes.value.selectedKeys)); + resetSelector(); } catch (error) { // eslint-disable-next-line no-console console.log(error); @@ -453,6 +458,7 @@ function cancel() { innerVisible.value = false; + resetSelector(); emit('close'); } diff --git a/frontend/src/components/business/ms-detail-drawer/index.vue b/frontend/src/components/business/ms-detail-drawer/index.vue index f6ab774157..a0e0c12f55 100644 --- a/frontend/src/components/business/ms-detail-drawer/index.vue +++ b/frontend/src/components/business/ms-detail-drawer/index.vue @@ -27,7 +27,7 @@ :detail-id="props.detailId" :detail-index="props.detailIndex" :table-data="props.tableData" - @loaded="(e) => emit('loaded', e)" + @loaded="handleDetailLoaded" />
@@ -90,6 +90,11 @@ prevNextButtonRef.value?.openNextDetail(); } + function handleDetailLoaded(val: any) { + detail.value = val; + emit('loaded', val); + } + watch( () => innerVisible.value, (val) => { diff --git a/frontend/src/components/business/ms-personal-drawer/components/baseInfo.vue b/frontend/src/components/business/ms-personal-drawer/components/baseInfo.vue index 8bb40590df..1d07d1439e 100644 --- a/frontend/src/components/business/ms-personal-drawer/components/baseInfo.vue +++ b/frontend/src/components/business/ms-personal-drawer/components/baseInfo.vue @@ -60,9 +60,17 @@ ([ - { - label: t('ms.personal.name'), - value: userStore.name || '', - }, - { - label: t('ms.personal.email'), - value: userStore.email || '', - }, - { - label: t('ms.personal.phone'), - value: userStore.phone || '', - }, - { - label: t('ms.personal.org'), - value: [], - isTag: true, - }, - ]); + const descriptions = ref([]); const baseInfoForm = ref({ name: userStore.name, email: userStore.email, phone: userStore.phone, }); const baseInfoFormRef = ref(); - const orgList = ref([]); + const orgList = ref([]); + + function initBaseInfo() { + descriptions.value = [ + { + label: t('ms.personal.name'), + value: userStore.name || '', + }, + { + label: t('ms.personal.email'), + value: userStore.email || '', + }, + { + label: t('ms.personal.phone'), + value: userStore.phone || '', + }, + { + label: t('ms.personal.org'), + value: [], + isTag: true, + }, + ]; + } onBeforeMount(async () => { + initBaseInfo(); try { loading.value = true; const res = await getBaseInfo(userStore.id || ''); - console.log(res); + orgList.value = res.orgProjectList; } catch (error) { // eslint-disable-next-line no-console console.log(error); @@ -223,6 +238,7 @@ }); Message.success(t('common.updateSuccess')); await userStore.isLogin(); + initBaseInfo(); isEdit.value = false; } catch (error) { // eslint-disable-next-line no-console diff --git a/frontend/src/components/business/ms-personal-drawer/components/setPsw.vue b/frontend/src/components/business/ms-personal-drawer/components/setPsw.vue index 7e1a4530d8..5994760dda 100644 --- a/frontend/src/components/business/ms-personal-drawer/components/setPsw.vue +++ b/frontend/src/components/business/ms-personal-drawer/components/setPsw.vue @@ -100,10 +100,17 @@ }); Message.success({ content: t('ms.personal.updatePswSuccess', { count: counting.value }), - duration: 4000, + duration: 1000, }); - setInterval(() => counting.value--, 1000); + const timer = setInterval(() => { + counting.value--; + Message.success({ + content: t('ms.personal.updatePswSuccess', { count: counting.value }), + duration: 1000, + }); + }, 1000); setTimeout(() => { + clearInterval(timer); logout(); }, 3000); } catch (error) { diff --git a/frontend/src/components/business/ms-select/index.tsx b/frontend/src/components/business/ms-select/index.tsx index 6fa0a59fe0..b6a6efbfad 100644 --- a/frontend/src/components/business/ms-select/index.tsx +++ b/frontend/src/components/business/ms-select/index.tsx @@ -45,6 +45,7 @@ export interface MsSearchSelectSlots { header?: (() => JSX.Element) | Slot; default?: () => JSX.Element[]; footer?: Slot; + empty?: Slot; } export default defineComponent( @@ -283,6 +284,9 @@ export default defineComponent( if (slots.footer) { _slots.footer = slots.footer; } + if (slots.empty) { + _slots.empty = slots.empty; + } return _slots; }; diff --git a/frontend/src/components/business/ms-tree/index.vue b/frontend/src/components/business/ms-tree/index.vue index e59b8e37bf..f07e7b6156 100644 --- a/frontend/src/components/business/ms-tree/index.vue +++ b/frontend/src/components/business/ms-tree/index.vue @@ -5,7 +5,7 @@ v-bind="props" ref="treeRef" v-model:expanded-keys="expandedKeys" - :selected-keys="selectedKeys" + v-model:selected-keys="innerSelectedKeys" :data="treeData" class="ms-tree" @drop="onDrop" @@ -355,17 +355,17 @@ } ); - const selectedKeys = ref(props.selectedKeys || []); + const innerSelectedKeys = ref(props.selectedKeys || []); watch( () => props.selectedKeys, (val) => { - selectedKeys.value = val || []; + innerSelectedKeys.value = val || []; } ); watch( - () => selectedKeys.value, + () => innerSelectedKeys.value, (val) => { emit('update:selectedKeys', val); } diff --git a/frontend/src/components/pure/ms-advance-filter/index.vue b/frontend/src/components/pure/ms-advance-filter/index.vue index f725f8af29..18b90581f0 100644 --- a/frontend/src/components/pure/ms-advance-filter/index.vue +++ b/frontend/src/components/pure/ms-advance-filter/index.vue @@ -2,6 +2,7 @@
+ - diff --git a/frontend/src/models/setting/config.ts b/frontend/src/models/setting/config.ts index 86144040a8..6cf50f3c87 100644 --- a/frontend/src/models/setting/config.ts +++ b/frontend/src/models/setting/config.ts @@ -145,3 +145,8 @@ export interface LDAPConfig extends LDAPConnectConfig { ldapUserOu: string; ldapUserMapping: string; } +// 内存清理配置 +export interface CleanupConfig { + operationLog: string; + operationHistory: string; +} diff --git a/frontend/src/models/user.ts b/frontend/src/models/user.ts index b8a4431d83..8c3ba4902c 100644 --- a/frontend/src/models/user.ts +++ b/frontend/src/models/user.ts @@ -128,8 +128,14 @@ export interface PersonalOrganization { enable: boolean; moduleSetting: string; } -export interface OrganizationProjectMap { - [key: string]: PersonalOrganization[]; +export interface PersonalProject { + projectId: string; + projectName: string; +} +export interface OrganizationProjectListItem { + orgId: string; + orgName: string; + projectList: PersonalProject[]; } export interface PersonalInfo { id: string; @@ -148,7 +154,7 @@ export interface PersonalInfo { updateUser: string; deleted: boolean; avatar: string; - organizationProjectMap: OrganizationProjectMap; + orgProjectList: OrganizationProjectListItem[]; } export interface UpdateBaseInfo { id: string; diff --git a/frontend/src/views/case-management/caseReview/components/create/associateDrawer.vue b/frontend/src/views/case-management/caseReview/components/create/associateDrawer.vue index c2ef3d276e..130f42f2df 100644 --- a/frontend/src/views/case-management/caseReview/components/create/associateDrawer.vue +++ b/frontend/src/views/case-management/caseReview/components/create/associateDrawer.vue @@ -3,8 +3,8 @@ v-model:visible="innerVisible" v-model:project="innerProject" :ok-button-disabled="associateForm.reviewers.length === 0" + :get-modules-func="getCaseModuleTree" @success="writeAssociateCases" - @close="emit('close')" >