feat(testDemo): 新增测试计划管理中订单详情功能
Co-Authored-By: '黄星炤' <huangxz@xiaopeng.com>
| | |
| | | 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', |
| | |
| | | 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 |
| | |
| | | return |
| | | } |
| | | if (action === '详情') { |
| | | message.info('订单详情待接入') |
| | | router.push({ |
| | | name: 'testPlanDemoOrderDetail', |
| | | query: { |
| | | orderId: String(row.orderId), |
| | | testPlanId: currentPlanId.value, |
| | | type: 'testPlanDemo', |
| | | }, |
| | | }) |
| | | return |
| | | } |
| | | if (action === '取消订单') { |
| | |
| | | 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( |
| | |
| | | |
| | | 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, |
| | |
| | | ? 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 || {} |