fix: Fix operate log page error

v3.2
wangdan-fit2cloud 2025-10-17 14:30:22 +08:00
parent f5f88b3db2
commit a4330e30a8
3 changed files with 82 additions and 67 deletions

View File

@ -316,7 +316,7 @@
</div>
</div>
<div class="text-center" v-if="applicationDetails.disclaimer" style="margin-top: 8px">
<div class="text-center mt-8" v-if="applicationDetails.disclaimer">
<el-text type="info" v-if="applicationDetails.disclaimer" style="font-size: 12px">
<auto-tooltip :content="applicationDetails.disclaimer_value">
{{ applicationDetails.disclaimer_value }}

View File

@ -5,7 +5,6 @@
:class="type"
:style="{
height: firsUserInput ? '100%' : undefined,
paddingBottom: applicationDetails.disclaimer ? '20px' : 0,
}"
>
<div

View File

@ -69,18 +69,30 @@
clearable
/>
</div>
<el-button @click="exportLog" style="margin-left: 10px"
v-hasPermission="
new ComplexPermission([RoleConst.ADMIN],
[PermissionConst.OPERATION_LOG_EXPORT],
[EditionConst.IS_EE, EditionConst.IS_PE], 'OR')"
>{{ $t('common.export') }}
<el-button
@click="exportLog"
style="margin-left: 10px"
v-hasPermission="
new ComplexPermission(
[RoleConst.ADMIN],
[PermissionConst.OPERATION_LOG_EXPORT],
[EditionConst.IS_EE, EditionConst.IS_PE],
'OR',
)
"
>{{ $t('common.export') }}
</el-button>
<el-button @click="dialogVisible = true"
v-hasPermission="
new ComplexPermission([RoleConst.ADMIN],
[PermissionConst.OPERATION_LOG_CLEAR_POLICY],
[EditionConst.IS_EE, EditionConst.IS_PE], 'OR')">
<el-button
@click="dialogVisible = true"
v-hasPermission="
new ComplexPermission(
[RoleConst.ADMIN],
[PermissionConst.OPERATION_LOG_CLEAR_POLICY],
[EditionConst.IS_EE, EditionConst.IS_PE],
'OR',
)
"
>
{{ $t('views.chatLog.buttons.clearStrategy') }}
</el-button>
</div>
@ -107,7 +119,7 @@
@click="popoverVisible = !popoverVisible"
>
<el-icon>
<Filter/>
<Filter />
</el-icon>
</el-button>
</template>
@ -132,10 +144,10 @@
</div>
<div class="text-right">
<el-button size="small" @click="filterChange('clear')"
>{{ $t('common.clear') }}
>{{ $t('common.clear') }}
</el-button>
<el-button type="primary" @click="filterChange" size="small"
>{{ $t('common.confirm') }}
>{{ $t('common.confirm') }}
</el-button>
</div>
</el-popover>
@ -184,7 +196,7 @@
@click="workspaceVisible = !workspaceVisible"
>
<el-icon>
<Filter/>
<Filter />
</el-icon>
</el-button>
</template>
@ -209,10 +221,10 @@
</div>
<div class="text-right">
<el-button size="small" @click="filterWorkspaceChange('clear')"
>{{ $t('common.clear') }}
>{{ $t('common.clear') }}
</el-button>
<el-button type="primary" @click="filterWorkspaceChange" size="small"
>{{ $t('common.confirm') }}
>{{ $t('common.confirm') }}
</el-button>
</div>
</el-popover>
@ -226,8 +238,8 @@
>
<template #default="{ row }">
<span v-if="row.status === 200">{{
$t('views.operateLog.table.status.success')
}}</span>
$t('views.operateLog.table.status.success')
}}</span>
<span v-else style="color: red">{{ $t('views.operateLog.table.status.fail') }}</span>
</template>
</el-table-column>
@ -244,8 +256,11 @@
<el-table-column :label="$t('common.operation')" width="60" align="left" fixed="right">
<template #default="{ row }">
<span class="mr-4">
<el-tooltip effect="dark" :content="$t('views.operateLog.table.opt.label')"
placement="top">
<el-tooltip
effect="dark"
:content="$t('views.operateLog.table.opt.label')"
placement="top"
>
<el-button type="primary" text @click.stop="showDetails(row)" class="text-button">
<AppIcon iconName="app-operate-log"></AppIcon>
</el-button>
@ -255,53 +270,53 @@
</el-table-column>
</app-table>
</div>
<DetailDialog ref="DetailDialogRef"/>
<DetailDialog ref="DetailDialogRef" />
</el-card>
<el-dialog
:title="$t('views.chatLog.buttons.clearStrategy')"
v-model="dialogVisible"
width="25%"
:close-on-click-modal="false"
:close-on-press-escape="false"
>
<span>{{ $t('common.delete') }}</span>
<el-input-number
v-model="days"
controls-position="right"
:min="1"
:max="100000"
:value-on-clear="0"
step-strictly
style="width: 110px; margin-left: 8px; margin-right: 8px"
></el-input-number>
<span>{{ $t('views.chatLog.daysText') }}</span>
<template #footer>
<div class="dialog-footer" style="margin-top: 16px">
<el-button @click="dialogVisible = false">{{ $t('common.cancel') }}</el-button>
<el-button type="primary" @click="saveCleanTime">
{{ $t('common.save') }}
</el-button>
</div>
</template>
</el-dialog>
</div>
<el-dialog
:title="$t('views.chatLog.buttons.clearStrategy')"
v-model="dialogVisible"
width="25%"
:close-on-click-modal="false"
:close-on-press-escape="false"
>
<span>{{ $t('common.delete') }}</span>
<el-input-number
v-model="days"
controls-position="right"
:min="1"
:max="100000"
:value-on-clear="0"
step-strictly
style="width: 110px; margin-left: 8px; margin-right: 8px"
></el-input-number>
<span>{{ $t('views.chatLog.daysText') }}</span>
<template #footer>
<div class="dialog-footer" style="margin-top: 16px">
<el-button @click="dialogVisible = false">{{ $t('common.cancel') }}</el-button>
<el-button type="primary" @click="saveCleanTime">
{{ $t('common.save') }}
</el-button>
</div>
</template>
</el-dialog>
</template>
<script setup lang="ts">
import {ref, onMounted, reactive} from 'vue'
import { ref, onMounted, reactive } from 'vue'
import operateLog from '@/api/system/operate-log'
import DetailDialog from './component/DetailDialog.vue'
import {t} from '@/locales'
import {beforeDay, datetimeFormat, nowDate} from '@/utils/time'
import { t } from '@/locales'
import { beforeDay, datetimeFormat, nowDate } from '@/utils/time'
import useStore from '@/stores'
import WorkspaceApi from '@/api/system/workspace.ts'
import {hasPermission} from "@/utils/permission";
import {EditionConst, PermissionConst, RoleConst} from "@/utils/permission/data.ts";
import {ComplexPermission} from "@/utils/permission/type.ts";
import {loadSharedApi} from "@/utils/dynamics-api/shared-api.ts";
import {MsgSuccess} from "@/utils/message.ts";
import { hasPermission } from '@/utils/permission'
import { EditionConst, PermissionConst, RoleConst } from '@/utils/permission/data.ts'
import { ComplexPermission } from '@/utils/permission/type.ts'
import { loadSharedApi } from '@/utils/dynamics-api/shared-api.ts'
import { MsgSuccess } from '@/utils/message.ts'
const {user} = useStore()
const { user } = useStore()
const popoverVisible = ref(false)
const operateTypeArr = ref<any[]>([])
const workspaceVisible = ref(false)
@ -458,7 +473,7 @@ function getMenuList() {
arr
.filter((item, index, self) => index === self.findIndex((i) => i['menu'] === item['menu']))
.forEach((ele) => {
operateOptions.value.push({label: ele.menu_label, value: ele.menu})
operateOptions.value.push({ label: ele.menu_label, value: ele.menu })
})
})
}
@ -481,17 +496,18 @@ function saveCleanTime() {
const obj = {
clean_time: days.value,
}
operateLog.saveCleanTime(obj, loading).then(() => {
MsgSuccess(t('common.saveSuccess'))
dialogVisible.value = false
getCleanTime()
})
operateLog
.saveCleanTime(obj, loading)
.then(() => {
MsgSuccess(t('common.saveSuccess'))
dialogVisible.value = false
getCleanTime()
})
.catch(() => {
dialogVisible.value = false
})
}
function getCleanTime() {
operateLog.getCleanTime().then((res) => {
days.value = res.data