| | |
| | | const operationLogRecords = ref<OperationLogRecord[]>([]) |
| | | const loading = ref(false) |
| | | const loadError = ref('') |
| | | onMounted(async () => { |
| | | async function loadLogs() { |
| | | loadError.value = '' |
| | | loading.value = true |
| | | try { operationLogRecords.value = await listOperationLogs() } catch (error) { |
| | | operationLogRecords.value = [] |
| | | loadError.value = error instanceof Error ? error.message : '操作日志加载失败' |
| | | } finally { loading.value = false } |
| | | }) |
| | | } |
| | | onMounted(loadLogs) |
| | | const operatorOptions = computed(() => [...new Set(operationLogRecords.value.map(item => item.operator))].sort((a, b) => a.localeCompare(b, 'zh-CN'))) |
| | | |
| | | const filteredRecords = computed(() => { |
| | |
| | | |
| | | <template> |
| | | <div class="operation-log-page"> |
| | | <el-alert v-if="loadError" :title="loadError" type="error" :closable="false" show-icon /> |
| | | <el-alert v-if="loadError" :title="loadError" type="error" :closable="false" show-icon /><el-button v-if="loadError" @click="loadLogs">重试</el-button> |
| | | <section class="filter-panel" aria-label="操作日志查询条件"> |
| | | <header class="section-heading"><div><i></i><strong>查询条件</strong><span>OPERATION LOG QUERY</span></div><small>共 {{ operationLogRecords.length }} 条日志</small></header> |
| | | <div class="filter-grid"> |