Commit 7eb91810 by liimin

refactor(ai-previews, ai-direct): 清理废弃预览页面路由,优化AI直连工具链

- 移除diaobo-preview和testpage-preview中的冗余自定义路由,删除对应废弃页面文件
- 删除testpage-preview中dd页面的全套组件及配置文件
- 更新testpage-preview的全局组件类型声明以支持新页面
- 优化AI直连后台服务的预览代理、步骤统计和日志匹配逻辑
- 更新AI生成代码的提示规则与项目构建脚本
- 同步更新AI贡献记录文件
1 parent 53d53bc4
...@@ -51,16 +51,7 @@ const routes = [ ...@@ -51,16 +51,7 @@ const routes = [
meta: { meta: {
title: "User", title: "User",
}, },
}, }
{
path: "/aa",
name: "Aa",
component: () => import("@/views/Aa.vue"),
meta: {
title: "Aa",
},
},
]; ];
export function createRouter(base = "/"): Router { export function createRouter(base = "/"): Router {
......
// @ai-co-author venus-ai-direct | openai-compatible/qwen3.7-max | 2026-06-05T08:31:36.839Z
<template>
<div class="transfer-confirm-page">
<div class="page-header">
<span class="page-title">调拨确认单</span>
</div>
<div class="table-wrapper">
<v-table :columns="columns"
:data="tableData"
row-key="index">
<template #actions="{ row }">
<span class="action-link"
@click="handleCancel(row)">
取消
</span>
</template>
</v-table>
</div>
<div class="pagination-wrapper">
<ElPagination v-model:current-page="currentPage"
v-model:page-size="pageSize"
layout="total, sizes, prev, pager, next, jumper"
:page-sizes="[10, 20, 50, 100]"
:total="total"
@current-change="handlePageChange"
@size-change="handleSizeChange" />
</div>
</div>
</template>
<script setup lang="ts">
import { ref } from "vue";
import { ElPagination } from "element-plus";
interface TableRow {
category: string;
index: number;
productCode: string;
productName: string;
rollNumber: string;
series: string;
spec: string;
stock: string;
}
const columns = [
{ key: "index", label: "序号", width: 60, align: "center" as const },
{ key: "productName", label: "商品名称", width: 140 },
{ key: "spec", label: "规格" },
{ key: "productCode", label: "商品编码" },
{ key: "series", label: "系列" },
{ key: "category", label: "所属分类" },
{ key: "stock", label: "调拨库存", width: 100, align: "center" as const },
{ key: "rollNumber", label: "膜卷号" },
{ key: "actions", label: "操作", width: 80, align: "center" as const },
];
const tableData = ref<TableRow[]>([
{
index: 1,
productName: "商品名称商品名称\n商品名称",
spec: "A/B",
productCode: "12345678...",
series: "太阳膜多规格\n商品",
category: "太阳膜",
stock: "2米",
rollNumber: "1234,5678...",
},
{
index: 2,
productName: "商品名称商品名称\n商品名称",
spec: "A/B",
productCode: "-",
series: "太阳膜多规格\n商品",
category: "太阳膜",
stock: "2米",
rollNumber: "-",
},
{
index: 3,
productName: "商品名称商品名称\n商品名称",
spec: "五座下层纳\n帕皮上层弯头纱",
productCode: "JC-JP-0077",
series: "太阳膜多规格\n商品",
category: "太阳膜",
stock: "2米",
rollNumber: "JC-JP-0077",
},
{
index: 4,
productName: "商品名称商品名称\n商品名称",
spec: "灰色/中/muji",
productCode: "M000077",
series: "太阳膜多规格\n商品",
category: "自建商品\n-精品",
stock: "2米",
rollNumber: "M000077",
},
{
index: 5,
productName: "商品名称商品名称\n商品名称",
spec: "灰色/中/muji",
productCode: "XXXXXXXX",
series: "太阳膜多规格\n商品",
category: "精品",
stock: "3件",
rollNumber: "XXXXXXXX",
},
{
index: 6,
productName: "商品名称商品名称\n商品名称",
spec: "灰色/中/muji",
productCode: "XXXXXXXX",
series: "XXXXXXXX",
category: "权益服务",
stock: "1件",
rollNumber: "XXXXXXXX",
},
{
index: 7,
productName: "商品名称商品名称\n商品名称",
spec: "灰色/中/muji",
productCode: "XXXXXXXX",
series: "XXXXXXXX",
category: "太阳膜",
stock: "2米",
rollNumber: "XXXXXXXX",
},
{
index: 8,
productName: "商品名称商品名称\n商品名称",
spec: "灰色/中/muji",
productCode: "XXXXXXXX",
series: "XXXXXXXX",
category: "自建商品\n-精品",
stock: "3件",
rollNumber: "XXXXXXXX",
},
{
index: 9,
productName: "商品名称商品名称\n商品名称",
spec: "灰色/中/muji",
productCode: "XXXXXXXX",
series: "XXXXXXXX",
category: "精品",
stock: "1件",
rollNumber: "XXXXXXXX",
},
{
index: 10,
productName: "商品名称商品名称\n商品名称",
spec: "灰色/中/muji",
productCode: "XXXXXXXX",
series: "XXXXXXXX",
category: "权益服务",
stock: "1件",
rollNumber: "XXXXXXXX",
},
]);
const currentPage = ref(1);
const pageSize = ref(10);
const total = ref(800);
function handlePageChange(page: number): void {
currentPage.value = page;
}
function handleSizeChange(size: number): void {
pageSize.value = size;
}
function handleCancel(row: TableRow): void {
console.log("取消调拨", row.index);
}
</script>
<style scoped>
.transfer-confirm-page {
display: flex;
flex-direction: column;
gap: 16px;
padding: 20px;
background: rgb(255 255 255 / 100%);
box-shadow: 0 4px 4px 0 rgb(0 0 0 / 25%);
}
.page-header {
display: flex;
align-items: center;
padding: 12px 16px;
background: rgb(244 246 252 / 100%);
border-radius: 4px;
}
.page-title {
font-size: 16px;
font-weight: 500;
line-height: 24px;
color: rgb(51 51 51 / 100%);
}
.table-wrapper {
width: 100%;
overflow-x: auto;
}
.table-wrapper :deep(th) {
font-size: 14px;
font-weight: 500;
line-height: 16px;
color: rgb(51 51 51 / 100%);
background: rgb(244 246 252 / 100%) !important;
border: 1px solid rgb(229 229 229 / 100%) !important;
}
.table-wrapper :deep(td) {
font-size: 14px;
font-weight: 400;
line-height: 16px;
color: rgb(102 102 102 / 100%);
white-space: pre-line;
background: rgb(255 255 255 / 100%);
border: 1px solid rgb(229 229 229 / 100%) !important;
}
.action-link {
font-size: 14px;
font-weight: 400;
line-height: 16px;
color: rgb(88 80 255 / 100%);
cursor: pointer;
}
.action-link:hover {
opacity: 0.8;
}
.pagination-wrapper {
display: flex;
justify-content: flex-end;
padding: 8px 0;
}
</style>
{ {
"generator": "scripts/ai-direct-apply-output.mjs", "generator": "scripts/ai-direct-apply-output.mjs",
"generatedAt": "2026-06-05T09:27:56.447Z", "generatedAt": "2026-06-05T10:34:33.913Z",
"model": "unknown", "model": "qwen3.7-max",
"provider": "unknown", "provider": "openai-compatible",
"files": [ "files": [
{ {
"path": "apps/web/ai-previews/testpage-preview/src/views/aa/components/Node5971297.vue", "path": "apps/web/ai-previews/testpage-preview/src/views/aa/components/Node5971297.vue",
...@@ -101,6 +101,27 @@ ...@@ -101,6 +101,27 @@
"purpose": "广联二手车完整车辆信息页面", "purpose": "广联二手车完整车辆信息页面",
"coAuthor": "@ai-co-author venus-ai-direct | unknown-provider/unknown-model | 2026-06-05T09:27:48.328Z", "coAuthor": "@ai-co-author venus-ai-direct | unknown-provider/unknown-model | 2026-06-05T09:27:48.328Z",
"action": "updated" "action": "updated"
},
{
"path": "apps/web/ai-previews/testpage-preview/src/views/tt/index.vue",
"language": "vue",
"purpose": "广联二手车首页 - 包含导航栏、搜索、拍卖入口、品牌、筛选标签、车辆列表和底部TabBar",
"coAuthor": "@ai-co-author venus-ai-direct | openai-compatible/qwen3.7-max | 2026-06-05T09:45:21.619Z",
"action": "created"
},
{
"path": "apps/web/ai-previews/testpage-preview/src/views/vv/index.vue",
"language": "vue",
"purpose": "广联二手车首页,包含导航栏、搜索、Banner、功能入口、品牌、筛选标签、车辆列表和底部导航",
"coAuthor": "@ai-co-author venus-ai-direct | openai-compatible/qwen3.7-max | 2026-06-05T10:16:12.211Z",
"action": "created"
},
{
"path": "apps/web/ai-previews/testpage-preview/src/views/vvv/index.vue",
"language": "vue",
"purpose": "广联二手车首页,包含导航栏、搜索、分类入口、筛选标签、热搜品牌和车辆卡片列表",
"coAuthor": "@ai-co-author venus-ai-direct | openai-compatible/qwen3.7-max | 2026-06-05T10:34:23.232Z",
"action": "created"
} }
] ]
} }
...@@ -9,11 +9,14 @@ declare module 'vue' { ...@@ -9,11 +9,14 @@ declare module 'vue' {
export interface GlobalComponents { export interface GlobalComponents {
RouterLink: typeof import('vue-router')['RouterLink'] RouterLink: typeof import('vue-router')['RouterLink']
RouterView: typeof import('vue-router')['RouterView'] RouterView: typeof import('vue-router')['RouterView']
VanIcon: typeof import('vant/es')['Icon']
VanSwipe: typeof import('vant/es')['Swipe'] VanSwipe: typeof import('vant/es')['Swipe']
VanSwipeItem: typeof import('vant/es')['SwipeItem'] VanSwipeItem: typeof import('vant/es')['SwipeItem']
VanTabbarItem: typeof import('vant/es')['TabbarItem']
VButton: typeof import('@vui/mobile')['VButton'] VButton: typeof import('@vui/mobile')['VButton']
VCell: typeof import('@vui/mobile')['VCell'] VCell: typeof import('@vui/mobile')['VCell']
VNavBar: typeof import('@vui/mobile')['VNavBar'] VNavBar: typeof import('@vui/mobile')['VNavBar']
VSearch: typeof import('@vui/mobile')['VSearch'] VSearch: typeof import('@vui/mobile')['VSearch']
VTabbar: typeof import('@vui/mobile')['VTabbar']
} }
} }
...@@ -16,34 +16,7 @@ const routes = [ ...@@ -16,34 +16,7 @@ const routes = [
meta: { meta: {
title: "Home", title: "Home",
}, },
}, }
{
path: "/dd",
name: "dd",
component: () => import("@/views/dd/index.vue"),
meta: {
title: "dd",
},
},
{
path: "/aa",
name: "aa",
component: () => import("@/views/aa.vue"),
meta: {
title: "aa",
},
},
{
path: "/mm",
name: "mm",
component: () => import("@/views/mm/index.vue"),
meta: {
title: "mm",
},
},
]; ];
export function createRouter(): Router { export function createRouter(): Router {
......
{
"pageName": "dd",
"componentNames": {},
"batches": [
{
"url": "https://www.figma.com/design/ZbhoA04cGHI9DMjknZ8FNB/%E5%B9%BF%E8%81%94%E4%BA%8C%E6%89%8B%E8%BD%A6%EF%BC%88%E8%AE%BE%EF%BC%89?node-id=640-708&t=UoZ7GaEcYn9o0fel-4",
"urlIndex": 0,
"batchIndex": 0
},
{
"url": "https://www.figma.com/design/ZbhoA04cGHI9DMjknZ8FNB/%E5%B9%BF%E8%81%94%E4%BA%8C%E6%89%8B%E8%BD%A6%EF%BC%88%E8%AE%BE%EF%BC%89?node-id=597-1297&t=UoZ7GaEcYn9o0fel-4",
"urlIndex": 1,
"batchIndex": 1
},
{
"url": "https://www.figma.com/design/ZbhoA04cGHI9DMjknZ8FNB/%E5%B9%BF%E8%81%94%E4%BA%8C%E6%89%8B%E8%BD%A6%EF%BC%88%E8%AE%BE%EF%BC%89?node-id=597-1239&t=UoZ7GaEcYn9o0fel-4",
"urlIndex": 2,
"batchIndex": 2
},
{
"url": "https://www.figma.com/design/ZbhoA04cGHI9DMjknZ8FNB/%E5%B9%BF%E8%81%94%E4%BA%8C%E6%89%8B%E8%BD%A6%EF%BC%88%E8%AE%BE%EF%BC%89?node-id=437-1036&t=UoZ7GaEcYn9o0fel-4",
"urlIndex": 3,
"batchIndex": 3
}
]
}
\ No newline at end of file \ No newline at end of file
// @ai-co-author venus-ai-direct | openai-compatible/qwen3.7-max | 2026-06-05T04:12:45.067Z
<template>
<div class="car-detail-card">
<div class="car-image-wrapper">
<div class="car-image-placeholder">
<svg class="car-icon"
fill="none"
viewBox="0 0 64 64"
xmlns="http://www.w3.org/2000/svg">
<rect fill="#E0E0E0"
height="24"
rx="4"
width="48"
x="8"
y="20" />
<circle cx="20"
cy="44"
fill="#BDBDBD"
r="5" />
<circle cx="44"
cy="44"
fill="#BDBDBD"
r="5" />
</svg>
</div>
</div>
<div class="car-info">
<h3 class="car-title">
宝马5系 2023款 改款 530Li 领先型 M运动套装
</h3>
<div class="tag-list">
<span class="tag tag--primary">原厂质保</span>
<span class="tag tag--secondary">同款低价</span>
<span class="tag tag--secondary">准新车</span>
</div>
<div class="source-row">
<span class="source-text">车源号:321867</span>
<button class="copy-btn"
type="button"
@click="handleCopy">
<svg fill="none"
height="14"
viewBox="0 0 14 14"
width="14"
xmlns="http://www.w3.org/2000/svg">
<rect height="8"
rx="1"
stroke="#676D7D"
stroke-width="1.2"
width="8"
x="4"
y="4" />
<path d="M10 4V3C10 2.44772 9.55228 2 9 2H3C2.44772 2 2 2.44772 2 3V9C2 9.55228 2.44772 10 3 10H4"
stroke="#676D7D"
stroke-width="1.2" />
</svg>
</button>
</div>
<div class="price-row">
<div class="price-group">
<span class="price-value">7.80</span>
<span class="price-unit">万</span>
</div>
<div class="fire-icon">
<svg fill="none"
height="16"
viewBox="0 0 16 16"
width="16"
xmlns="http://www.w3.org/2000/svg">
<path d="M8 1C8 1 4 5 4 9C4 11.2091 5.79086 13 8 13C10.2091 13 12 11.2091 12 9C12 5 8 1 8 1Z"
fill="url(#fireGrad)" />
<defs>
<linearGradient id="fireGrad"
gradientUnits="userSpaceOnUse"
x1="8"
x2="8"
y1="1"
y2="13">
<stop stop-color="#FF5A00" />
<stop offset="1"
stop-color="#EC0000" />
</linearGradient>
</defs>
</svg>
</div>
<span class="price-label">起拍</span>
</div>
<div class="countdown-badge">
<span class="countdown-text">距离开始</span>
<span class="countdown-time">11:13:28</span>
</div>
</div>
</div>
</template>
<script setup lang="ts">
import { ref } from "vue";
defineOptions({
name: "CarDetailCard",
});
const copied = ref(false);
function handleCopy(): void {
const text = "321867";
if (navigator.clipboard) {
navigator.clipboard.writeText(text).then(() => {
copied.value = true;
setTimeout(() => {
copied.value = false;
}, 2000);
});
}
}
</script>
<style scoped>
.car-detail-card {
display: flex;
width: 100%;
padding: 12px;
background: #fff;
border-radius: 10px;
box-shadow: 0 1px 4px rgb(0 0 0 / 6%);
}
.car-image-wrapper {
flex-shrink: 0;
width: 110px;
height: 82px;
margin-right: 12px;
overflow: hidden;
border-radius: 10px;
}
.car-image-placeholder {
display: flex;
align-items: center;
justify-content: center;
width: 100%;
height: 100%;
background: #f5f6fa;
}
.car-icon {
width: 48px;
height: 48px;
opacity: 0.5;
}
.car-info {
display: flex;
flex: 1;
flex-direction: column;
min-width: 0;
}
.car-title {
margin: 0;
overflow: hidden;
text-overflow: ellipsis;
font-family: "PingFang SC", sans-serif;
font-size: 18px;
font-weight: 500;
line-height: 27px;
color: #141e34;
white-space: nowrap;
}
.tag-list {
display: flex;
gap: 6px;
margin-top: 6px;
}
.tag {
display: inline-flex;
align-items: center;
padding: 2px 6px;
font-family: "PingFang SC", sans-serif;
font-size: 12px;
font-weight: 400;
line-height: 16.8px;
border-radius: 2px;
}
.tag--primary {
color: #ff4800;
background: #ffefeb;
}
.tag--secondary {
color: #828ca0;
background: #f5f6fa;
}
.source-row {
display: flex;
align-items: center;
justify-content: flex-end;
margin-top: 4px;
}
.source-text {
font-family: "PingFang SC", sans-serif;
font-size: 13px;
font-weight: 400;
line-height: 18.2px;
color: #676d7d;
}
.copy-btn {
display: flex;
align-items: center;
justify-content: center;
width: 20px;
height: 20px;
padding: 0;
margin-left: 4px;
cursor: pointer;
background: transparent;
border: none;
}
.price-row {
display: flex;
align-items: baseline;
margin-top: 6px;
}
.price-group {
display: flex;
align-items: baseline;
}
.price-value {
font-family: "PingFang SC", sans-serif;
font-size: 15px;
font-weight: 600;
line-height: 26px;
color: #ff4800;
}
.price-unit {
font-family: "PingFang SC", sans-serif;
font-size: 12px;
font-weight: 400;
line-height: 16.8px;
color: #ff4800;
}
.fire-icon {
display: flex;
align-items: center;
margin-left: 4px;
}
.price-label {
margin-left: 4px;
font-family: "PingFang SC", sans-serif;
font-size: 14px;
font-weight: 400;
line-height: 19.6px;
color: #141e34;
}
.countdown-badge {
display: inline-flex;
gap: 4px;
align-items: center;
align-self: flex-start;
padding: 3px 8px;
margin-top: 8px;
background: rgb(24 94 254 / 10%);
border-radius: 4px;
}
.countdown-text {
font-family: "PingFang SC", sans-serif;
font-size: 12px;
font-weight: 400;
line-height: 16.8px;
color: #185efe;
}
.countdown-time {
font-family: "PingFang SC", sans-serif;
font-size: 12px;
font-weight: 400;
line-height: 16.8px;
color: #185efe;
}
</style>
// @ai-co-author venus-ai-direct | openai-compatible/qwen3.7-max | 2026-06-05T04:11:31.541Z
<template>
<div class="car-gallery">
<!-- 图片展示区域 -->
<div class="gallery-image-area">
<div class="image-placeholder">
<img alt="车辆图片"
class="car-image"
src="https://via.placeholder.com/375x280/d8d8d8/999999?text=车辆图片" />
</div>
<!-- 拍卖规则标签 -->
<div class="auction-rule-tag">
<span class="tag-text">拍卖规则</span>
</div>
</div>
<!-- 底部控制栏 -->
<div class="gallery-bottom-bar">
<!-- 标签切换器 -->
<div class="tab-switcher">
<div class="tab-item"
:class="{ active: activeTab === 'exterior' }"
@click="activeTab = 'exterior'">
<span class="tab-text">外观</span>
</div>
<div class="tab-item"
:class="{ active: activeTab === 'interior' }"
@click="activeTab = 'interior'">
<span class="tab-text">内饰</span>
</div>
</div>
<!-- 照片计数器 -->
<div class="photo-counter">
<span class="counter-text">{{ currentIndex }}/{{ totalCount }}</span>
</div>
</div>
</div>
</template>
<script setup lang="ts">
import { ref } from "vue";
defineOptions({
name: "CarGallery",
});
const activeTab = ref<"exterior" | "interior">("exterior");
const currentIndex = ref<number>(5);
const totalCount = ref<number>(10);
</script>
<style scoped>
.car-gallery {
position: relative;
display: flex;
flex-direction: column;
width: 100%;
overflow: hidden;
background: #fff;
}
.gallery-image-area {
position: relative;
display: flex;
align-items: center;
justify-content: center;
width: 100%;
height: 280px;
overflow: hidden;
background: #d8d8d8;
}
.image-placeholder {
display: flex;
align-items: center;
justify-content: center;
width: 100%;
height: 100%;
}
.car-image {
width: 100%;
height: 100%;
object-fit: cover;
}
.auction-rule-tag {
position: absolute;
top: 50%;
left: 0;
z-index: 2;
display: flex;
align-items: center;
padding: 6px 12px;
background: rgb(255 255 255 / 90%);
border-radius: 16px 0 0 16px;
box-shadow: 0 2px 4px 0 rgb(51 51 51 / 10%);
transform: translateY(-50%);
}
.tag-text {
font-size: 12px;
font-weight: 400;
line-height: 16.8px;
color: #333;
white-space: nowrap;
}
.gallery-bottom-bar {
position: absolute;
right: 12px;
bottom: 12px;
left: 12px;
z-index: 3;
display: flex;
align-items: center;
justify-content: space-between;
}
.tab-switcher {
display: flex;
align-items: center;
overflow: hidden;
background: rgb(51 51 51 / 80%);
border-radius: 17px;
}
.tab-item {
display: flex;
align-items: center;
justify-content: center;
padding: 6px 16px;
cursor: pointer;
border-radius: 17px;
transition: background-color 0.2s ease;
}
.tab-item.active {
background: #fff;
border-radius: 11px;
}
.tab-text {
font-size: 11px;
font-weight: 400;
line-height: 15.4px;
color: #fff;
white-space: nowrap;
}
.tab-item.active .tab-text {
color: #000;
}
.photo-counter {
display: flex;
align-items: center;
justify-content: center;
padding: 4px 10px;
background: rgb(51 51 51 / 80%);
border-radius: 11px;
}
.counter-text {
font-size: 11px;
font-weight: 400;
line-height: 15.4px;
color: #fff;
white-space: nowrap;
}
</style>
// @ai-co-author venus-ai-direct | openai-compatible/qwen3.7-max | 2026-06-05T04:10:37.869Z
<template>
<div class="detail-nav-bar">
<VNavBar left-arrow
title="参拍详情"
@click-left="handleClickLeft" />
</div>
</template>
<script setup lang="ts">
import { useRouter } from "vue-router";
const router = useRouter();
const handleClickLeft = (): void => {
router.back();
};
</script>
<style scoped>
.detail-nav-bar {
position: sticky;
top: 0;
z-index: 100;
background: rgb(255 255 255 / 100%);
}
</style>
// @ai-co-author venus-ai-direct | openai-compatible/qwen3.7-max | 2026-06-05T04:13:45.817Z
<template>
<div class="vehicle-info-card">
<!-- 顶部四列概览区 -->
<div class="overview-section">
<div class="overview-bg">
<div class="overview-grid">
<div class="overview-item">
<span class="overview-label">首次上牌</span>
<span class="overview-value">2022.02</span>
</div>
<div class="overview-item">
<span class="overview-label">表显里程</span>
<span class="overview-value">23.75万公里</span>
</div>
<div class="overview-item">
<span class="overview-label">过户次数</span>
<span class="overview-value">0次</span>
</div>
<div class="overview-item">
<span class="overview-label">使用性质</span>
<span class="overview-value">非营运</span>
</div>
</div>
</div>
</div>
<!-- 分隔线 -->
<div class="divider" />
<!-- 详情键值对区 -->
<div class="detail-section">
<div class="detail-row">
<div class="detail-col">
<span class="detail-label">是否有抵押</span>
<span class="detail-value">无</span>
</div>
<div class="detail-col">
<span class="detail-label">所有人性质</span>
<span class="detail-value">无</span>
</div>
</div>
<div class="detail-row">
<div class="detail-col">
<span class="detail-label">出厂时间</span>
<span class="detail-value">2021.08</span>
</div>
<div class="detail-col">
<span class="detail-label">历史所有人性质</span>
<span class="detail-value">2021.08</span>
</div>
</div>
<div class="detail-row">
<div class="detail-col">
<span class="detail-label">年检到期</span>
<span class="detail-value">2027.08</span>
</div>
<div class="detail-col">
<span class="detail-label">交强险到期</span>
<span class="detail-value">-</span>
</div>
</div>
<div class="detail-row">
<div class="detail-col">
<span class="detail-label">最近过户</span>
<span class="detail-value">-</span>
</div>
<div class="detail-col">
<span class="detail-label">燃料系统</span>
<span class="detail-value">汽油+48V轻混系统</span>
</div>
</div>
<div class="detail-row">
<div class="detail-col">
<span class="detail-label">排放标准</span>
<span class="detail-value">国6</span>
</div>
<div class="detail-col">
<span class="detail-label">车身颜色</span>
<span class="detail-value">其他</span>
</div>
</div>
<div class="detail-row">
<div class="detail-col">
<span class="detail-label">登记证</span>
<span class="detail-value">检测时已带</span>
</div>
<div class="detail-col">
<span class="detail-label">登记证颜色</span>
<span class="detail-value">黄色</span>
</div>
</div>
<div class="detail-row">
<div class="detail-col">
<span class="detail-label">座位数</span>
<span class="detail-value">-</span>
</div>
<div class="detail-col" />
</div>
</div>
</div>
</template>
<script setup lang="ts">
defineOptions({
name: "VehicleInfoCard",
});
</script>
<style scoped>
.vehicle-info-card {
box-sizing: border-box;
width: 100%;
padding: 12px;
background: rgb(255 255 255 / 100%);
border: 1px solid rgb(151 151 151 / 100%);
border-radius: 8px;
}
.overview-section {
margin-bottom: 12px;
}
.overview-bg {
padding: 12px 8px;
background: rgb(245 249 255 / 100%);
border: 1px solid rgb(255 255 255 / 100%);
border-radius: 4px;
}
.overview-grid {
display: flex;
justify-content: space-between;
}
.overview-item {
display: flex;
flex: 1;
flex-direction: column;
gap: 4px;
align-items: center;
}
.overview-label {
font-family: "PingFang SC", sans-serif;
font-size: 11px;
font-weight: 400;
line-height: 15.4px;
color: rgb(153 153 153 / 100%);
text-align: center;
}
.overview-value {
font-family: "PingFang SC", sans-serif;
font-size: 14px;
font-weight: 500;
line-height: 19.6px;
color: rgb(51 51 51 / 100%);
text-align: center;
}
.divider {
height: 1px;
margin: 12px 0;
background: rgb(216 216 216 / 100%);
}
.detail-section {
display: flex;
flex-direction: column;
gap: 14px;
}
.detail-row {
display: flex;
justify-content: space-between;
}
.detail-col {
display: flex;
flex: 1;
gap: 8px;
align-items: center;
}
.detail-label {
flex-shrink: 0;
font-family: "PingFang SC", sans-serif;
font-size: 14px;
font-weight: 400;
line-height: 14px;
color: rgb(153 153 153 / 100%);
text-align: left;
letter-spacing: 0.4px;
}
.detail-value {
font-family: "PingFang SC", sans-serif;
font-size: 14px;
font-weight: 400;
line-height: 14px;
color: rgb(51 51 51 / 100%);
text-align: left;
letter-spacing: 0.4px;
}
</style>
<script setup lang="ts">
import Detailnavbar from "./components/Detailnavbar.vue";
import Cargallery from "./components/Cargallery.vue";
import Cardetailcard from "./components/Cardetailcard.vue";
import Vehicleinfocard from "./components/Vehicleinfocard.vue";
</script>
<template>
<div class="dd-page">
<Detailnavbar />
<Cargallery />
<Cardetailcard />
<Vehicleinfocard />
</div>
</template>
<style scoped>
.dd-page {
display: flex;
flex-direction: column;
}
</style>
// @ai-co-author venus-ai-direct | unknown-provider/unknown-model | 2026-06-05T09:27:48.328Z
<template>
<div class="mm-page">
<VNavBar left-arrow
title="完整车辆信息"
@click-left="handleBack" />
<!-- Tab 切换栏 -->
<div class="tab-bar">
<div class="tab-item"
:class="{ active: activeTab === 'archive' }"
@click="activeTab = 'archive'">
车辆档案
</div>
<div class="tab-item"
:class="{ active: activeTab === 'config' }"
@click="activeTab = 'config'">
参数配置
</div>
</div>
<!-- 车辆头部信息 -->
<div class="car-header">
<div class="car-image-wrapper">
<div class="car-image">
<div class="image-placeholder" />
</div>
</div>
<div class="car-basic-info">
<div class="car-name">
宝马3系 2022款 325Li M运动曜夜…
</div>
<div class="car-meta">
4.6万公里 / 2022年 / 广州
</div>
<div class="car-price">
22.98万
</div>
</div>
</div>
<!-- 车辆信息卡片 -->
<div class="info-card">
<div class="card-title">
车辆信息
</div>
<div class="info-grid">
<div class="info-row">
<span class="info-label">表显里程</span>
<span class="info-value">4.6万公里</span>
</div>
<div class="info-row">
<span class="info-label">过户次数</span>
<span class="info-value">0次</span>
</div>
<div class="info-row">
<span class="info-label">使用性质</span>
<span class="info-value">2020.06</span>
</div>
<div class="info-row">
<span class="info-label">排放标准</span>
<span class="info-value">国VI</span>
</div>
<div class="info-row">
<span class="info-label">所在地</span>
<span class="info-value">广州</span>
</div>
<div class="info-row">
<span class="info-label">上牌时间</span>
<span class="info-value">2022-02</span>
</div>
<div class="info-row">
<span class="info-label">交强险到期</span>
<span class="info-value">4.6万公里</span>
</div>
<div class="info-row">
<span class="info-label">年检到期</span>
<span class="info-value">2026-02</span>
</div>
<div class="info-row">
<span class="info-label">车身颜色</span>
<span class="info-value">黑色</span>
</div>
<div class="info-row">
<span class="info-label">车辆网点</span>
<span class="info-value">广州</span>
</div>
</div>
</div>
<!-- 车辆配置信息卡片 -->
<div class="info-card">
<div class="card-title">
车辆配置信息
</div>
<div class="info-grid">
<div class="info-row">
<span class="info-label">发动机排量</span>
<span class="info-value">2L</span>
</div>
<div class="info-row">
<span class="info-label">进气形式</span>
<span class="info-value">涡轮增压</span>
</div>
<div class="info-row">
<span class="info-label">驱动方式</span>
<span class="info-value">前置后驱</span>
</div>
<div class="info-row">
<span class="info-label">变速箱</span>
<span class="info-value">自动</span>
</div>
<div class="info-row">
<span class="info-label">燃料形式</span>
<span class="info-value">汽油</span>
</div>
<div class="info-row">
<span class="info-label">座位数</span>
<span class="info-value">5</span>
</div>
<div class="info-row">
<span class="info-label">级别</span>
<span class="info-value">中型车</span>
</div>
</div>
</div>
</div>
</template>
<script setup lang="ts">
import type { ComponentPublicInstance } from "vue";
import { ref } from "vue";
// 显式声明使用 @vui/mobile 组件(全局注册,无需 import 组件本身)
type VNavBarInstance = ComponentPublicInstance;
const activeTab = ref<"archive" | "config">("archive");
const handleBack = (): void => {
window.history.back();
};
</script>
<style scoped>
.mm-page {
display: flex;
flex-direction: column;
min-height: 100vh;
background: rgb(255 255 255 / 100%);
}
/* Tab 切换栏 */
.tab-bar {
display: flex;
gap: 32px;
align-items: center;
justify-content: center;
padding: 12px 16px;
background: rgb(255 255 255 / 100%);
}
.tab-item {
position: relative;
padding-bottom: 8px;
font-family: "PingFang SC", sans-serif;
font-size: 14px;
font-weight: 400;
line-height: 19.6px;
color: rgb(20 30 52 / 100%);
text-align: center;
cursor: pointer;
}
.tab-item.active {
font-size: 18px;
font-weight: 500;
line-height: 25.2px;
}
.tab-item.active::after {
position: absolute;
bottom: 0;
left: 50%;
width: 24px;
height: 3px;
content: "";
background: rgb(24 94 254 / 100%);
border-radius: 1.5px;
transform: translateX(-50%);
}
/* 车辆头部信息 */
.car-header {
display: flex;
gap: 12px;
padding: 16px;
background: rgb(248 249 252 / 100%);
}
.car-image-wrapper {
flex-shrink: 0;
}
.car-image {
width: 100px;
height: 75px;
overflow: hidden;
background: rgb(255 255 255 / 100%);
border-radius: 6px;
}
.image-placeholder {
width: 100%;
height: 100%;
background: rgb(216 216 216 / 100%);
}
.car-basic-info {
display: flex;
flex: 1;
flex-direction: column;
gap: 4px;
justify-content: center;
}
.car-name {
overflow: hidden;
text-overflow: ellipsis;
font-family: "PingFang SC", sans-serif;
font-size: 14px;
font-weight: 400;
line-height: 19.6px;
color: rgb(20 30 52 / 100%);
text-align: left;
white-space: nowrap;
}
.car-meta {
font-family: "PingFang SC", sans-serif;
font-size: 12px;
font-weight: 400;
line-height: 16.8px;
color: rgb(20 30 52 / 100%);
text-align: left;
}
.car-price {
font-family: "PingFang SC", sans-serif;
font-size: 14px;
font-weight: 600;
line-height: 24px;
color: rgb(255 72 0 / 100%);
text-align: left;
}
/* 信息卡片 */
.info-card {
padding: 16px;
margin: 12px 16px;
background: rgb(248 249 252 / 100%);
border-radius: 8px;
}
.card-title {
margin-bottom: 16px;
font-family: "PingFang SC", sans-serif;
font-size: 18px;
font-weight: 500;
line-height: 24px;
color: rgb(51 51 51 / 100%);
text-align: left;
}
.info-grid {
display: flex;
flex-direction: column;
gap: 12px;
}
.info-row {
display: flex;
align-items: center;
justify-content: space-between;
}
.info-label {
font-family: "PingFang SC", sans-serif;
font-size: 14px;
font-weight: 400;
line-height: 19.6px;
color: rgb(153 153 153 / 100%);
text-align: left;
}
.info-value {
font-family: "PingFang SC", sans-serif;
font-size: 14px;
font-weight: 400;
line-height: 19.6px;
color: rgb(51 51 51 / 100%);
text-align: right;
}
</style>
...@@ -484,6 +484,7 @@ function buildUserPrompt({ bundle, promptText, designContext, variableDefsText, ...@@ -484,6 +484,7 @@ function buildUserPrompt({ bundle, promptText, designContext, variableDefsText,
"- 导航栏中的系统图标:返回箭头(用组件的 leftArrow prop 代替)、更多按钮(...)图标", "- 导航栏中的系统图标:返回箭头(用组件的 leftArrow prop 代替)、更多按钮(...)图标",
"- 小程序导航栏右侧胶囊按钮(Capsule Button)", "- 小程序导航栏右侧胶囊按钮(Capsule Button)",
"- 底部安全区(Safe Area):iPhone 底部横条", "- 底部安全区(Safe Area):iPhone 底部横条",
"- **底部标签栏(TabBar)**:name 为\"底部标签栏\"或包含\"首页/买车/推广/喜欢/我的\"等全局导航项的 FRAME/GROUP。底部标签栏是应用级全局导航,由应用骨架提供,**不要在页面中生成**",
"- 系统键盘、系统弹窗、系统提示框等操作系统 UI", "- 系统键盘、系统弹窗、系统提示框等操作系统 UI",
"", "",
"这些元素不需要生成代码,但它们**不构成拒绝生成的理由**——你仍然必须生成包含业务组件(如 VNavBar)的完整代码。", "这些元素不需要生成代码,但它们**不构成拒绝生成的理由**——你仍然必须生成包含业务组件(如 VNavBar)的完整代码。",
...@@ -496,7 +497,46 @@ function buildUserPrompt({ bundle, promptText, designContext, variableDefsText, ...@@ -496,7 +497,46 @@ function buildUserPrompt({ bundle, promptText, designContext, variableDefsText,
"", "",
"你必须始终返回包含 files 数组的 JSON,其中至少包含一个 .vue 组件文件。", "你必须始终返回包含 files 数组的 JSON,其中至少包含一个 .vue 组件文件。",
"", "",
"",
"# 布局推断规则(重要)",
"", "",
"Design Context 不包含 flex/grid 布局方向信息,你需要根据 UI 元素的语义和上下文正确推断布局。",
"以下是常见场景的布局推断规则:",
"",
"## 1. 横向并排标签/页签",
"- 同级 TEXT 节点如果是简短的标签文本(如\"本地精选\"、\"猜你喜欢\"),且字号/颜色不同表示选中/未选中状态 → 它们是**横向并排的 Tab 页签**",
"- 用 `display: flex; flex-direction: row; gap: Xpx;` 实现",
"- **不要**把它们拆成两个独立的纵向 section",
"",
"## 2. 卡片列表方向(纵向 vs 横向)",
"- 移动端页面中的内容卡片(商品卡片、车辆卡片、文章卡片等),如果卡片内包含图片+文本信息 → **默认使用纵向布局**:图片在上方,文字信息在下方",
"- 卡片内图片(RECTANGLE + IMAGE background)应使用 `width: 100%; height: 固定高度;` 铺满卡片宽度",
"- **不要**默认把卡片做成左图右文的横向布局(除非 design context 明确指示)",
"",
"## 3. 列表列数(重要:移动端默认 2 列)",
"- **移动端页面中,所有列表数据默认使用 2 列网格布局**:`display: grid; grid-template-columns: 1fr 1fr; gap: Xpx;`",
"- 无论是卡片列表(图片+文字)、文字列表(key:value)、还是纯文本列表,都默认 2 列",
"- **不要**使用 `flex-direction: column` 做 1 列纵向列表",
"- 只有在 design context 中有明确的「全宽卡片」结构(单个卡片占满整行宽度)时,才可以例外使用 1 列",
"",
"## 4. 标签/筛选条件换行",
"- 同级 TEXT 节点如果是多个短标签(如筛选条件:SUV、轿车、新能源...)→ 使用 `flex-wrap: wrap;` 允许换行",
"- **不要**使用 `overflow-x: auto` 做横向滚动,除非标签数量很少且 design context 暗示是横向滚动",
"- 标签容器的 gap 通常较小(4-8px),每个标签使用固定 padding",
"",
"## 5. 禁止臆造设计稿中不存在的内容",
"",
"**你只能生成 design context 中明确存在的 UI 元素。** 每个生成的区块都必须能在 design context 中找到对应的节点。",
"",
"**禁止:**",
"- 生成 design context 中不存在的 section(如凭空添加\"热搜品牌\"、\"推荐列表\"等)",
"- 为 design context 中的元素添加不存在的子组件(如给卡片添加不存在的\"收藏\"按钮)",
"- 合并或拆分 design context 中的结构(如把两个独立 section 合并成一个)",
"",
"**自检方法**:生成代码后,逐一检查每个 section/模块,确认它是否能在 design context 中找到对应的 FRAME/GROUP/TEXT 节点。如果找不到,删除该部分代码。",
"",
"",
); );
// 短 design context 检测:内容极少时注入强化指令,防止 AI 只返回 summary // 短 design context 检测:内容极少时注入强化指令,防止 AI 只返回 summary
......
...@@ -442,7 +442,7 @@ async function runBatchGeneration(batch, bIndex, isLastBatch, config, repoRoot, ...@@ -442,7 +442,7 @@ async function runBatchGeneration(batch, bIndex, isLastBatch, config, repoRoot,
if (progressMatch) { if (progressMatch) {
const stepNum = Number(progressMatch[1]); const stepNum = Number(progressMatch[1]);
const stepName = progressMatch[3]; const stepName = progressMatch[3];
if (stepNum >= 1 && stepNum <= 8) { if (stepNum >= 0 && stepNum <= 8) {
emitStep(`step-${stepNum}`, stepName); emitStep(`step-${stepNum}`, stepName);
} }
} }
...@@ -589,7 +589,7 @@ function launchPipelineChild(args, env, config, repoRoot, log) { ...@@ -589,7 +589,7 @@ function launchPipelineChild(args, env, config, repoRoot, log) {
if (progressMatch) { if (progressMatch) {
const stepNum = Number(progressMatch[1]); const stepNum = Number(progressMatch[1]);
const stepName = progressMatch[3]; const stepName = progressMatch[3];
if (stepNum >= 1 && stepNum <= 8) { if (stepNum >= 0 && stepNum <= 8) {
emitStep(`step-${stepNum}`, stepName); emitStep(`step-${stepNum}`, stepName);
lastStep = `step-${stepNum}`; lastStep = `step-${stepNum}`;
} }
...@@ -658,18 +658,38 @@ async function registerRoutesAndStartPreview(projectRoot, env, repoRoot, log) { ...@@ -658,18 +658,38 @@ async function registerRoutesAndStartPreview(projectRoot, env, repoRoot, log) {
detached: true, detached: true,
}); });
let previewUrlDetected = false;
const detectPreviewUrl = (text) => {
if (previewUrlDetected) return;
// 匹配多种格式的 Vite 输出
const patterns = [
/Local:\s+(https?:\/\/(?:localhost|127\.0\.0\.1):\d+\/?)/i,
/(https?:\/\/localhost:\d+\/?)/i,
/> Local:\s+(https?:\/\/\S+)/i,
];
for (const pattern of patterns) {
const match = text.match(pattern);
if (match) {
previewUrlDetected = true;
const url = match[1];
setPreviewUrl(url, log);
emitConsole(`\n✓ 预览地址: ${url}\n`, "system");
log(`检测到预览地址: ${url}`);
return;
}
}
};
child.stdout.on("data", (data) => { child.stdout.on("data", (data) => {
const text = data.toString(); const text = data.toString();
broadcast("output", { stream: "stdout", text, timestamp: Date.now() }); broadcast("output", { stream: "stdout", text, timestamp: Date.now() });
const viteMatch = text.match(/Local:\s+(https?:\/\/(?:localhost|127\.0\.0\.1):\d+\/?)/); detectPreviewUrl(text);
if (viteMatch) {
setPreviewUrl(viteMatch[1], log);
emitConsole(`\n✓ 预览地址: ${viteMatch[1]}\n`, "system");
}
}); });
child.stderr.on("data", (data) => { child.stderr.on("data", (data) => {
broadcast("output", { stream: "stderr", text: data.toString(), timestamp: Date.now() }); const text = data.toString();
broadcast("output", { stream: "stderr", text, timestamp: Date.now() });
detectPreviewUrl(text);
}); });
child.unref(); child.unref();
......
...@@ -133,6 +133,57 @@ function handleSSE(req, res) { ...@@ -133,6 +133,57 @@ function handleSSE(req, res) {
} }
/** /**
* 处理预览代理请求
* 将 /preview-proxy/* 请求转发到预览项目的 dev server
*/
async function handlePreviewProxy(req, res) {
const url = req.url;
const previewUrl = getPreviewUrl();
if (!previewUrl) {
res.writeHead(503, { "Content-Type": "text/html; charset=utf-8" });
res.end("<html><body><p style='color:#8b949e;text-align:center;margin-top:40vh'>预览服务尚未就绪</p></body></html>");
return;
}
// Extract the path after /preview-proxy (e.g., /preview-proxy/foo -> /foo)
const subPath = url.slice("/preview-proxy".length) || "/";
try {
const targetUrl = new URL(subPath, previewUrl);
const proxyReq = http.request(
targetUrl,
{
method: req.method,
headers: {
...req.headers,
host: targetUrl.host,
},
},
(proxyRes) => {
// Copy status and headers
const headers = { ...proxyRes.headers };
// Remove restrictive headers that might break iframe embedding
delete headers["x-frame-options"];
delete headers["content-security-policy"];
res.writeHead(proxyRes.statusCode, headers);
proxyRes.pipe(res);
},
);
proxyReq.on("error", (err) => {
res.writeHead(502, { "Content-Type": "text/html; charset=utf-8" });
res.end(`<html><body><p style='color:#f85149;text-align:center;margin-top:40vh'>无法连接到预览服务: ${err.message}</p></body></html>`);
});
req.pipe(proxyReq);
} catch (error) {
res.writeHead(502, { "Content-Type": "text/html; charset=utf-8" });
res.end(`<html><body><p style='color:#f85149;text-align:center;margin-top:40vh'>预览代理错误: ${error.message}</p></body></html>`);
}
}
/**
* 处理 API 请求 * 处理 API 请求
*/ */
async function handleApi(req, res, repoRoot) { async function handleApi(req, res, repoRoot) {
...@@ -222,14 +273,28 @@ async function handleApi(req, res, repoRoot) { ...@@ -222,14 +273,28 @@ async function handleApi(req, res, repoRoot) {
// 安全检查:防止路径遍历 // 安全检查:防止路径遍历
const normalized = path.normalize(filePath); const normalized = path.normalize(filePath);
if (normalized.includes("..") || path.isAbsolute(filePath)) { if (normalized.includes("..")) {
res.writeHead(403, { "Content-Type": "text/plain" }); res.writeHead(403, { "Content-Type": "text/plain" });
res.end("Forbidden"); res.end("Forbidden");
return; return;
} }
// 只允许读取 ai-previews 目录下的文件 // 支持绝对路径和相对路径
const fullPath = path.join(repoRoot, "apps/web/ai-previews", filePath); let fullPath;
if (path.isAbsolute(filePath)) {
fullPath = filePath;
// 安全检查:绝对路径必须在 ai-previews 目录下
const aiPreviewsDir = path.join(repoRoot, "apps/web/ai-previews");
if (!fullPath.startsWith(aiPreviewsDir)) {
res.writeHead(403, { "Content-Type": "text/plain" });
res.end("Forbidden: path must be within ai-previews directory");
return;
}
} else {
// 相对路径:拼接 ai-previews 目录
fullPath = path.join(repoRoot, "apps/web/ai-previews", filePath);
}
if (!fs.existsSync(fullPath)) { if (!fs.existsSync(fullPath)) {
res.writeHead(404, { "Content-Type": "text/plain" }); res.writeHead(404, { "Content-Type": "text/plain" });
res.end("Not Found"); res.end("Not Found");
...@@ -286,6 +351,12 @@ export function createServer(repoRoot) { ...@@ -286,6 +351,12 @@ export function createServer(repoRoot) {
return; return;
} }
// Preview proxy - forwards requests to preview project dev server
if (url.startsWith("/preview-proxy")) {
await handlePreviewProxy(req, res);
return;
}
// API endpoints // API endpoints
if (url.startsWith("/api/")) { if (url.startsWith("/api/")) {
await handleApi(req, res, repoRoot); await handleApi(req, res, repoRoot);
...@@ -316,6 +387,47 @@ export function createServer(repoRoot) { ...@@ -316,6 +387,47 @@ export function createServer(repoRoot) {
res.end("Not Found"); res.end("Not Found");
}); });
// WebSocket upgrade for Vite HMR in preview proxy
server.on("upgrade", (req, socket, head) => {
const url = req.url || "";
if (url.startsWith("/preview-proxy")) {
const previewUrl = getPreviewUrl();
if (!previewUrl) {
socket.destroy();
return;
}
const subPath = url.slice("/preview-proxy".length) || "/";
const targetUrl = new URL(subPath, previewUrl);
targetUrl.protocol = targetUrl.protocol === "https:" ? "wss:" : "ws:";
const proxyReq = http.request(targetUrl, {
method: "GET",
headers: {
...req.headers,
host: targetUrl.host,
},
});
proxyReq.on("upgrade", (proxyRes, proxySocket, proxyHead) => {
socket.write(`HTTP/1.1 101 Switching Protocols\r\n`);
Object.entries(proxyRes.headers).forEach(([key, value]) => {
if (value) {
const values = Array.isArray(value) ? value : [value];
values.forEach((v) => socket.write(`${key}: ${v}\r\n`));
}
});
socket.write("\r\n");
if (proxyHead.length > 0) socket.write(proxyHead);
proxySocket.pipe(socket);
socket.pipe(proxySocket);
});
proxyReq.on("error", () => socket.destroy());
proxyReq.end();
}
});
return server; return server;
} }
......
...@@ -8,11 +8,10 @@ const STEPS = [ ...@@ -8,11 +8,10 @@ const STEPS = [
{ key: "messages", label: "[2] Messages" }, { key: "messages", label: "[2] Messages" },
{ key: "project-decision", label: "[3] 项目决策" }, { key: "project-decision", label: "[3] 项目决策" },
{ key: "ai-generate", label: "[4] AI 生成" }, { key: "ai-generate", label: "[4] AI 生成" },
{ key: "quality-check", label: "[5] 质量校验" }, { key: "file-write", label: "[5] 文件写入" },
{ key: "health-fix", label: "[6] 健康修复" }, { key: "quality-check", label: "[6] 质量校验" },
{ key: "install-launch", label: "[7] 安装启动" }, { key: "health-fix", label: "[7] 健康修复" },
{ key: "manual-confirm", label: "[8] 人工确认" }, { key: "install-launch", label: "[8] 安装启动" },
{ key: "complete", label: "完成" },
]; ];
let evtSource = null; let evtSource = null;
...@@ -57,23 +56,23 @@ const STEP_KEY_MAP = { ...@@ -57,23 +56,23 @@ const STEP_KEY_MAP = {
"step-2": "messages", "step-2": "messages",
"project-decision": "project-decision", "project-decision-done": "project-decision", "project-created": "project-decision", "project-decision": "project-decision", "project-decision-done": "project-decision", "project-created": "project-decision",
"step-3": "project-decision", "step-3": "project-decision",
"preview-legacy": "project-decision", "preview-legacy-done": "project-decision",
"ai-generate": "ai-generate", "ai-generate-done": "ai-generate", "ai-generate": "ai-generate", "ai-generate-done": "ai-generate",
"apply-legacy": "ai-generate", "apply-legacy-done": "ai-generate",
"step-4": "ai-generate", "step-4": "ai-generate",
"file-write": "file-write", "file-write-done": "file-write",
"apply-legacy": "file-write", "apply-legacy-done": "file-write",
"step-5": "file-write",
"quality-check": "quality-check", "quality-check-done": "quality-check", "quality-check": "quality-check", "quality-check-done": "quality-check",
"fitness-item": "quality-check", "fitness-item": "quality-check",
"validate-legacy": "quality-check", "validate-legacy": "quality-check",
"repair-legacy": "quality-check", "repair-legacy": "quality-check",
"step-5": "quality-check", "step-6": "quality-check",
"health-fix": "health-fix", "health-fix-done": "health-fix", "health-fix": "health-fix", "health-fix-done": "health-fix",
"step-6": "health-fix", "step-7": "health-fix",
"install-launch": "install-launch", "install": "install-launch", "launch": "install-launch", "install-launch": "install-launch", "install": "install-launch", "launch": "install-launch",
"dev-ready": "install-launch", "dev-ready": "install-launch",
"step-7": "install-launch", "step-8": "install-launch",
"manual-confirm": "manual-confirm", "complete": "install-launch",
"step-8": "manual-confirm",
"complete": "complete",
"preview-legacy": "project-decision", "preview-legacy-done": "project-decision",
}; };
// ============================================================================ // ============================================================================
...@@ -258,10 +257,11 @@ function appendConsole(text, stream) { ...@@ -258,10 +257,11 @@ function appendConsole(text, stream) {
break; break;
} }
default: { default: {
if (/[✓✔]/.test(line) || /通过|完成|success|ready/i.test(line)) { // 先检测失败/错误(包括"未通过"等否定形式),再检测成功
cls += " success"; if (/[✗✘]/.test(line) || /未通过|失败|错误|error|failed/i.test(line)) {
} else if (/[✗✘]/.test(line) || /失败|错误|error|failed/i.test(line)) {
cls += " error"; cls += " error";
} else if (/[✓✔]/.test(line) || /通过|完成|success|ready/i.test(line)) {
cls += " success";
} else if (/⚠/.test(line) || /警告|warning/i.test(line)) { } else if (/⚠/.test(line) || /警告|warning/i.test(line)) {
cls += " warning"; cls += " warning";
} else if (/⏳/.test(line) || /正在|等待|info/i.test(line)) { } else if (/⏳/.test(line) || /正在|等待|info/i.test(line)) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!