merge code pull

This commit is contained in:
2026-01-26 11:07:16 +08:00
parent b99d181d85
commit dde24adf2c
79 changed files with 11876 additions and 5017 deletions

View File

@@ -52,7 +52,18 @@ const openDialog = async (id: string) => {
try {
const res = await getDetail(id)
if (res.data) {
detailData.value = res.data
// 根据接口文档,返回的数据可能是 { records: [...], total: ... } 格式
// 如果是列表格式,取第一条;如果是对象,直接使用
if (res.data.records && Array.isArray(res.data.records) && res.data.records.length > 0) {
detailData.value = res.data.records[0]
} else if (res.data.records && Array.isArray(res.data.records)) {
// 列表为空
useMessage().warning('未找到详情数据')
visible.value = false
} else {
// 直接是对象
detailData.value = res.data
}
}
} catch (err: any) {
useMessage().error(err.msg || '获取详情失败')