From 9c3c1f0d26a80a6206ea8d0d2db3c2409e14081a Mon Sep 17 00:00:00 2001 From: developer Date: Sun, 12 Jul 2026 13:49:11 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20TaskForm=20=E5=BA=94=E7=94=A8=E5=9C=BA?= =?UTF-8?q?=E6=99=AF=E9=93=BE=E6=8E=A5=E6=A0=87=E9=A2=98=E6=8A=93=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 导入 getUrlTitle 替代直连 lpt-ai - 新增 appUrlTitles 缓存映射 - loadApplications 中并行抓取应用场景 URL 标题 - 模板中应用场景链接显示标题而非裸 URL --- src/components/TaskForm.vue | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) 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 }}
编辑