diff --git a/src/components/TaskForm.vue b/src/components/TaskForm.vue index a04b375..cb4872a 100644 --- a/src/components/TaskForm.vue +++ b/src/components/TaskForm.vue @@ -10,6 +10,7 @@ import { updateTaskApplication, type TaskApplication, } from "@/api/tasks"; +import { getUrlTitle } from "@/utils/fetchTitle"; const router = useRouter(); const route = useRoute(); @@ -38,6 +39,7 @@ const applicationStatusOptions: { label: string; value: TaskApplication["status" ]; const applications = ref([]); +const appUrlTitles = ref>({}); const applicationLoading = ref(false); const applicationSaving = ref(false); const editingApplicationId = ref(null); @@ -68,6 +70,15 @@ const loadApplications = async (targetTaskNum: string) => { try { const res = await getTaskApplications(targetTaskNum); applications.value = res?.data || []; + const map: Record = {}; + await Promise.all( + applications.value + .filter((a) => a.resourceUrl) + .map(async (a) => { + map[a.id] = await getUrlTitle(a.resourceUrl!); + }) + ); + appUrlTitles.value = map; } catch (error: any) { applications.value = []; ElMessage.error(error?.message || "应用场景加载失败"); @@ -290,7 +301,7 @@ const isMobile = computed(() => screenWidth.value <= 900);

{{ item.description }}

- {{ item.resourceUrl }} + {{ appUrlTitles[item.id] || item.resourceUrl }}
编辑