diff --git a/ui/src/api/system/operate-log.ts b/ui/src/api/system/operate-log.ts index 21a494959..0f622b23e 100644 --- a/ui/src/api/system/operate-log.ts +++ b/ui/src/api/system/operate-log.ts @@ -1,18 +1,18 @@ -import { Result } from '@/request/Result' -import { get, exportExcelPost } from '@/request/index' -import type { pageRequest } from '@/api/type/common' -import { type Ref } from 'vue' +import {Result} from '@/request/Result' +import {get, exportExcelPost, post} from '@/request/index' +import type {pageRequest} from '@/api/type/common' +import {type Ref} from 'vue' const prefix = '/operate_log' /** * 日志分页列表 * @param 参数 * page { - "current_page": "string", - "page_size": "string", - } + "current_page": "string", + "page_size": "string", + } * @query 参数 - param: any + param: any */ const getOperateLog: ( page: pageRequest, @@ -39,8 +39,20 @@ const exportOperateLog: ( ) } +const saveCleanTime: ( + data: any, + loading?: Ref +) => Promise> = (data, loading) => { + return post(`${prefix}/save`, data, undefined, loading) +} +const getCleanTime: () => Promise> = () => { + return get(`${prefix}/get_clean_time`, undefined, undefined) +} + export default { getOperateLog, getMenuList, - exportOperateLog + exportOperateLog, + saveCleanTime, + getCleanTime } diff --git a/ui/src/utils/permission/data.ts b/ui/src/utils/permission/data.ts index 60ded719d..f9b8c82a7 100644 --- a/ui/src/utils/permission/data.ts +++ b/ui/src/utils/permission/data.ts @@ -272,12 +272,12 @@ const PermissionConst = { RESOURCE_MODEL_READ: new Permission('SYSTEM_RESOURCE_MODEL:READ'), RESOURCE_MODEL_EDIT: new Permission('SYSTEM_RESOURCE_MODEL:READ+EDIT'), RESOURCE_MODEL_DELETE: new Permission('SYSTEM_RESOURCE_MODEL:READ+DELETE'), - + RESOURCE_MODEL_AUTH: new Permission('SYSTEM_RESOURCE_MODEL:READ+AUTH'), RESOURCE_APPLICATION_AUTH: new Permission('SYSTEM_RESOURCE_APPLICATION:READ+AUTH'), RESOURCE_KNOWLEDGE_AUTH: new Permission('SYSTEM_RESOURCE_KNOWLEDGE:READ+AUTH'), RESOURCE_TOOL_AUTH: new Permission('SYSTEM_RESOURCE_TOOL:READ+AUTH'), - + APPEARANCE_SETTINGS_READ: new Permission('APPEARANCE_SETTINGS:READ'), APPEARANCE_SETTINGS_EDIT: new Permission('APPEARANCE_SETTINGS:READ+EDIT'), @@ -289,6 +289,7 @@ const PermissionConst = { OPERATION_LOG_READ: new Permission('OPERATION_LOG:READ'), OPERATION_LOG_EXPORT: new Permission('OPERATION_LOG:READ+EXPORT'), + OPERATION_LOG_CLEAR_POLICY: new Permission('OPERATION_LOG:READ+CLEAR_POLICY'), ABOUT_READ: new Permission('OTHER:READ'), SWITCH_LANGUAGE: new Permission('OTHER:READ+EDIT'), diff --git a/ui/src/views/system/operate-log/index.vue b/ui/src/views/system/operate-log/index.vue index fa0d620a9..09cde50ca 100644 --- a/ui/src/views/system/operate-log/index.vue +++ b/ui/src/views/system/operate-log/index.vue @@ -70,7 +70,18 @@ /> {{ $t('common.export') }} + v-hasPermission=" + new ComplexPermission([RoleConst.ADMIN], + [PermissionConst.OPERATION_LOG_EXPORT], + [EditionConst.IS_EE, EditionConst.IS_PE], 'OR')" + >{{ $t('common.export') }} + + + {{ $t('views.chatLog.buttons.clearStrategy') }} @@ -96,7 +107,7 @@ @click="popoverVisible = !popoverVisible" > - + @@ -121,10 +132,10 @@
{{ $t('common.clear') }} + >{{ $t('common.clear') }} {{ $t('common.confirm') }} + >{{ $t('common.confirm') }}
@@ -173,7 +184,7 @@ @click="workspaceVisible = !workspaceVisible" > - + @@ -198,10 +209,10 @@
{{ $t('common.clear') }} + >{{ $t('common.clear') }} {{ $t('common.confirm') }} + >{{ $t('common.confirm') }}
@@ -215,8 +226,8 @@ > @@ -233,7 +244,8 @@ +