ai-coding
2026-06-20 3580603b1cd49e4ff8e742714ba2270238137f3e
feat(testDemo): 新增测试计划管理中订单详情功能

Co-Authored-By: '黄星炤' <huangxz@xiaopeng.com>
4个文件已修改
38 ■■■■■ 已修改文件
src/router/routes.static.ts 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/service/api/testPlanManagement.ts 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/testDemo/testPlanManagement/detail.vue 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/transaction/order/orderManagement/detail.vue 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/router/routes.static.ts
@@ -1782,6 +1782,20 @@
    activeMenu: '/testDemo/testPlanManagement',
  },
  {
    name: 'testPlanDemoOrderDetail',
    path: '/testDemo/testPlanManagement/orderDetail',
    title: '订单详情',
    requiresAuth: false,
    icon: 'icon-park-outline:alarm',
    menuType: 'page',
    componentPath: '/transaction/order/orderManagement/detail.vue',
    id: 2026061524,
    pid: 20260615,
    hide: true,
    fullScreen: true,
    activeMenu: '/testDemo/testPlanManagement',
  },
  {
    name: 'testDemo2.0',
    path: '/testDemo',
    title: '测试跑单demo2.0',
src/service/api/testPlanManagement.ts
@@ -54,6 +54,14 @@
  return request.Get<Service.ResponseResult<any>>(`/operation/api/v1/test-plan-demo/detail/${id}`)
}
// 测试计划 demo 订单详情:orderId 走 path variable,testPlanId 作为可选 query(用于越权校验)。
// orderId 与列表 detail/pageOrders 返回的 orderId 同源,可直接查询。
export function fetchTestPlanDemoOrderDetail(orderId: number | string, testPlanId?: number | string) {
  return request.Get<Service.ResponseResult<any>>(`/operation/api/v1/test-plan-demo/detail/order/${orderId}`, {
    params: testPlanId ? { testPlanId } : undefined,
  })
}
export function fetchTestPlanOrderPageList(data: {
  dispatchEndTime?: string
  dispatchStartTime?: string
src/views/testDemo/testPlanManagement/detail.vue
@@ -642,7 +642,14 @@
    return
  }
  if (action === '详情') {
    message.info('订单详情待接入')
    router.push({
      name: 'testPlanDemoOrderDetail',
      query: {
        orderId: String(row.orderId),
        testPlanId: currentPlanId.value,
        type: 'testPlanDemo',
      },
    })
    return
  }
  if (action === '取消订单') {
src/views/transaction/order/orderManagement/detail.vue
@@ -6,6 +6,7 @@
import { getOrderDetail } from '@/service/api/transaction'
import { fetchCruiseOrderDetail } from '@/service/api/cruise'
import { fetchTestOrderDetail } from '@/service/api/copyText'
import { fetchTestPlanDemoOrderDetail } from '@/service/api/testPlanManagement'
import dayjs from 'dayjs'
const { load } = useScriptTag(
@@ -18,6 +19,8 @@
const orderId = computed(() => (route.query.orderId || route.params.id) as string)
const type = computed(() => route.query.type as string)
// testPlanDemo 模式下用于越权校验的计划 ID。
const testPlanId = computed(() => route.query.testPlanId as string)
const initialModel: any = {
  condition_1: null,
@@ -107,7 +110,9 @@
      ? fetchCruiseOrderDetail
      : type.value === 'test'
        ? fetchTestOrderDetail
        : getOrderDetail
        : type.value === 'testPlanDemo'
          ? (id: string) => fetchTestPlanDemoOrderDetail(id, testPlanId.value || undefined)
          : getOrderDetail
    detailApi(orderId.value).then((res) => {
      if (res.code === 200) {
        model.value = res.data || {}