This commit is contained in:
2025-11-07 01:35:43 +08:00
parent 92d29fe73f
commit 0dde8db6fd

View File

@@ -201,8 +201,11 @@ export default {
watch: {
value(val) {
if (val) {
this.loading = false // 重置loading状态
this.initData()
this.getList()
} else {
this.loading = false // 关闭时也重置loading
}
}
},
@@ -213,23 +216,28 @@ export default {
},
/** 查询日志列表 */
async getList() {
getList() {
this.loading = true
try {
const res = await getOperationLogs(this.queryParams)
getOperationLogs(this.queryParams).then(res => {
if (res.code === 200) {
this.logList = res.data || []
this.total = this.logList.length
this.calculateStatistics()
} else {
this.$message.error(res.msg || '查询失败')
this.logList = []
this.total = 0
this.calculateStatistics()
}
} catch (e) {
}).catch(e => {
this.$message.error('查询失败: ' + (e.message || '未知错误'))
console.error('查询操作日志失败', e)
} finally {
this.logList = []
this.total = 0
this.calculateStatistics()
}).finally(() => {
this.loading = false
}
})
},
/** 计算统计数据 */
@@ -285,6 +293,7 @@ export default {
/** 关闭对话框 */
handleClose() {
this.loading = false // 确保关闭loading状态
this.visible = false
}
}