修改任务管理

This commit is contained in:
lq
2025-09-25 16:33:52 +08:00
parent 80e734136e
commit f4d20eb8e9
3 changed files with 44 additions and 5 deletions

View File

@ -492,8 +492,35 @@ const showDrawer = (accountInfo = null, selectedDate = null) => {
showDriwer.value = true;
if (accountInfo && accountInfo.id) {
nextTick(() => {
localQuery.value.accounts = [accountInfo.name];
localQuery.value.ids = [accountInfo.id];
// 查找账号列表中匹配的账号,包含平台信息和图标
const matchedAccount = accountList.value.find(account => account.value === accountInfo.id);
if (matchedAccount) {
localQuery.value.accounts = [matchedAccount.name];
localQuery.value.ids = [accountInfo.id];
} else {
// 如果没有找到匹配项,检查账号列表是否已加载
if (accountList.value.length > 0) {
// 账号列表已加载但未找到匹配项,回退到原来的方式
localQuery.value.accounts = [`${accountInfo.name}(${getPlatformName(accountInfo.platform)})`];
localQuery.value.ids = [accountInfo.id];
} else {
// 账号列表尚未加载,等待加载完成后再设置
const unwatch = watch(accountList, (newAccountList) => {
if (newAccountList.length > 0) {
const matched = newAccountList.find(account => account.value === accountInfo.id);
if (matched) {
localQuery.value.accounts = [matched.name];
localQuery.value.ids = [accountInfo.id];
} else {
localQuery.value.accounts = [`${accountInfo.name}(${getPlatformName(accountInfo.platform)})`];
localQuery.value.ids = [accountInfo.id];
}
// 取消监听
unwatch();
}
}, { immediate: true });
}
}
});
}
// 如果传入了日期,则设置为默认日期

View File

@ -472,7 +472,7 @@ const handleCellClick = (record: any, rowIndex: any, column: any) => {
return;
}
console.log('selectedDate', selectedDate);
console.log('selectedDate', selectedDate, accountInfo);
drawerPopupRef.value.showDrawer(accountInfo, selectedDate);
};