修复配置项没有数据时的问题

dev_xd
lj7788 2026-03-31 17:55:35 +08:00
parent 26442645eb
commit 8d2b984abb
4 changed files with 20 additions and 4 deletions

View File

@ -381,7 +381,11 @@ queryParams.value.inTime = proxy.$dt(new Date()).format("YYYY-MM-DD");
function getCfgList() { function getCfgList() {
listAttendance_cfg({ projectId: userStore.currentPrjId, pageNum: 1, pageSize: 100 }).then(response => { listAttendance_cfg({ projectId: userStore.currentPrjId, pageNum: 1, pageSize: 100 }).then(response => {
data.cfgOptions = response.rows || [] data.cfgOptions = response.rows || []
queryParams.value.cfgId = data.cfgOptions[0]?.id || null if (data.cfgOptions.length > 0) {
queryParams.value.cfgId = data.cfgOptions[0].id
} else {
queryParams.value.cfgId = null
}
getList() getList()
}); });
} }

View File

@ -211,7 +211,11 @@ queryParams.value.inTime = proxy.$dt(new Date()).format("YYYY-MM-DD");
function getCfgList() { function getCfgList() {
listAttendance_cfg({ projectId: userStore.currentPrjId, pageNum: 1, pageSize: 100 }).then(response => { listAttendance_cfg({ projectId: userStore.currentPrjId, pageNum: 1, pageSize: 100 }).then(response => {
data.cfgOptions = response.rows || [] data.cfgOptions = response.rows || []
queryParams.value.cfgId = data.cfgOptions[0]?.id || null if (data.cfgOptions.length > 0) {
queryParams.value.cfgId = data.cfgOptions[0].id
} else {
queryParams.value.cfgId = null
}
handleQuery(); handleQuery();
}); });
} }

View File

@ -417,7 +417,11 @@ function getWorkAreaTree() {
function getCfgList() { function getCfgList() {
listAttendance_cfg({ projectId: userStore.currentPrjId, pageNum: 1, pageSize: 100 }).then(response => { listAttendance_cfg({ projectId: userStore.currentPrjId, pageNum: 1, pageSize: 100 }).then(response => {
data.cfgOptions = response.rows || [] data.cfgOptions = response.rows || []
queryParams.value.cfgId = data.cfgOptions[0]?.id || null if (data.cfgOptions.length > 0) {
queryParams.value.cfgId = data.cfgOptions[0].id
} else {
queryParams.value.cfgId = null
}
getList() getList()
}); });
} }

View File

@ -293,7 +293,11 @@ function handleExport() {
function getCfgList() { function getCfgList() {
listAttendance_cfg({ projectId: userStore.currentPrjId, pageNum: 1, pageSize: 100 }).then(response => { listAttendance_cfg({ projectId: userStore.currentPrjId, pageNum: 1, pageSize: 100 }).then(response => {
data.cfgOptions = response.rows || [] data.cfgOptions = response.rows || []
queryParams.value.cfgId = data.cfgOptions[0]?.id || null if (data.cfgOptions.length > 0) {
queryParams.value.cfgId = data.cfgOptions[0].id
} else {
queryParams.value.cfgId = null
}
getList() getList()
}); });
} }