diff --git a/src/pages/WorkSpace/TestResult/Details/TestRsultTable/InfoResultTable.tsx b/src/pages/WorkSpace/TestResult/Details/TestRsultTable/InfoResultTable.tsx index 016e3dc1dd24ceb1a822b89cc56f77325894a80c..f2de72d8193b24fb7ebf0460aa3d87bbc657515d 100644 --- a/src/pages/WorkSpace/TestResult/Details/TestRsultTable/InfoResultTable.tsx +++ b/src/pages/WorkSpace/TestResult/Details/TestRsultTable/InfoResultTable.tsx @@ -1,5 +1,5 @@ /* eslint-disable react-hooks/exhaustive-deps */ -import { Space, Tooltip, Input, Button, Typography } from 'antd' +import { Space, Tooltip, Input, Button, Typography, Divider } from 'antd' import { FilterFilled } from '@ant-design/icons' import React, { useRef, useEffect } from 'react' @@ -8,6 +8,7 @@ import { queryCaseResult } from '../service' import EditRemarks from '../components/EditRemarks' import JoinBaseline from '../components/JoinBaseline' import { QusetionIconTootip } from '@/components/Product'; +import EllipsisPulic from '@/components/Public/EllipsisPulic' import qs from 'querystring' import Highlighter from 'react-highlight-words' @@ -32,7 +33,7 @@ export default (props: any) => { const { test_case_id, suite_id, testType, creator, server_provider, state = '', suite_name, conf_name, - refreshId, setRefreshId, lookPathCallback = ()=> {} + refreshId, setRefreshId, lookPathCallback = () => { } } = props const editRemark: any = useRef(null) const joinBaseline: any = useRef(null) @@ -92,13 +93,13 @@ export default (props: any) => { > - { setSelectedKeys(undefined) handleSearch(undefined, confirm) }} type="text" - size="small" + size="small" style={{ width: 75, border: 'none' }} > @@ -256,10 +257,70 @@ export default (props: any) => { ), ...tooltipTd() }, + { + title: , + dataIndex: 'log', + width: 240, + // fixed: "right", + ellipsis: true, + render: (_: any, row: any) => { + const scene_all = row.log_path && row.extend_info && row.debug_info + if (scene_all) { + return ( + + lookPathCallback(row.log_path, 'look')}>{formatMessage({ id: 'operation.log' })} + {!!row.extend_info.length && } + + {!!row.debug_info.length && } + <> + {row.debug_info?.map((item: any, index: number) => { + const key = Object.keys(item)[0]; + const prefix = "console"; + if (key.startsWith(prefix)) { + const realKey = key.substring(prefix.length); + const value = item[key]; + const label = ( + + lookPathCallback(value, 'look')}> + {`console${realKey}_>`} + + + ) + if (index === row.debug_info.length - 1) { + // 最后一个元素,不加分隔符 + return ( + + {label} + + ) + } else { + // 其他元素,在后面加上分隔符 + return ( + + { label } + + + ) + } + } + return null; + })} + > + + ) + } else if (row.log_path) { + return ( + lookPathCallback(row.log_path, 'look')}>{formatMessage({ id: 'operation.log' })} + ) + } else { + return NA + } + } + }, !share_id && { title: , - width: 200, + width: 160, fixed: "right", render: (_: any, row: any) => { // 失败的 && 没有关联关系的才能“修改基线” @@ -272,7 +333,7 @@ export default (props: any) => { fallback={ AccessTootip()}> - {failFlag && AccessTootip()}>{buttonText} } + {failFlag && AccessTootip()}>{buttonText}} } > @@ -285,25 +346,12 @@ export default (props: any) => { ) } }, - { - title: , - dataIndex: 'log', - width: 80, - fixed: "right", - ellipsis: true, - render: (_: any, row: any)=> { - const filePath = row.conf_log_path - return filePath ? - lookPathCallback(filePath, 'look') }>{formatMessage({ id: 'operation.log' })} - : null - } - }, ].filter(Boolean) return ( <> { pageSizeOptions: [100, 200, 500], }} columns={columns} + scroll={{ x: '100%' }} rowClassName={styles.result_info_table_row} dataSource={data.data || []} /> diff --git a/src/pages/WorkSpace/TestResult/Details/TestRsultTable/MetricResultTable.tsx b/src/pages/WorkSpace/TestResult/Details/TestRsultTable/MetricResultTable.tsx index 1e1b18894987a9fc0359c7f62c7ba46fc67c79cf..1213df7b4288ee78b3c0eeb55f08c526d720ee10 100644 --- a/src/pages/WorkSpace/TestResult/Details/TestRsultTable/MetricResultTable.tsx +++ b/src/pages/WorkSpace/TestResult/Details/TestRsultTable/MetricResultTable.tsx @@ -1,6 +1,6 @@ /* eslint-disable react-hooks/exhaustive-deps */ import React, { useEffect, useState } from 'react' -import { Tooltip, Typography } from 'antd' +import { Tooltip, Typography, Divider } from 'antd' import { FilterFilled } from '@ant-design/icons' import { QusetionIconTootip, ResultTdPopver, compareResultFontColor, compareResultSpan } from '../components' import { queryCaseResultPerformance } from '../service' @@ -15,7 +15,7 @@ import { MetricSelectProvider } from '.' export default (props: any) => { const { formatMessage } = useIntl() - const { test_case_id, suite_id, state: compare_result, refreshId, setRefreshId, testType, lookPathCallback = ()=> {}, } = props + const { test_case_id, suite_id, state: compare_result, refreshId, setRefreshId, testType, lookPathCallback = () => { }, } = props const { id: job_id, ws_id, share_id } = useParams() as any const { setOSuite, oSuite } = React.useContext(MetricSelectProvider) const defaultKeys = { @@ -194,19 +194,6 @@ export default (props: any) => { ellipsis: true, render: (_: any, row: any) => compareResultSpan(row.track_result, row.result, formatMessage) }, - { - title: , - dataIndex: 'log', - width: 80, - fixed: "right", - ellipsis: true, - render: (_: any, row: any)=> { - const filePath = row.conf_log_path - return filePath ? - lookPathCallback(filePath, 'look') }>{formatMessage({ id: 'operation.log' })} - : null - } - }, ] const rowSelection: any = !share_id && testType === 'performance' ? { @@ -272,6 +259,7 @@ export default (props: any) => { rowClassName={styles.result_info_table_row} dataSource={data.data} columns={columns} + scroll={{ x: '100%' }} refreshDeps={[interfaceSearchKeys, ws_id, strLocals, access]} /> ) diff --git a/src/pages/WorkSpace/TestResult/Details/TestRsultTable/index.less b/src/pages/WorkSpace/TestResult/Details/TestRsultTable/index.less index ec9431ac399a0780b585d69834b4a7098fd4b16b..8b3f85346e790ac42fd4e20e5b842bfd93f0b207 100644 --- a/src/pages/WorkSpace/TestResult/Details/TestRsultTable/index.less +++ b/src/pages/WorkSpace/TestResult/Details/TestRsultTable/index.less @@ -45,6 +45,11 @@ margin: 0!important; } } + :global { + .ant-divider-vertical { + border-left: 1px solid rgba(0, 0, 0, 0.6) !important; + } + } } .result_info_table_row { @@ -119,5 +124,4 @@ /* 去掉二级表格最底部下划线 */ .resultCaseTableCls > div > div > div > div > div > table > tbody > tr:nth-last-child(2) > td { border-bottom: none; -} - \ No newline at end of file +} \ No newline at end of file diff --git a/src/pages/WorkSpace/TestResult/Details/locales/en-US.ts b/src/pages/WorkSpace/TestResult/Details/locales/en-US.ts index 13fab7508c7de868b08445491f013837f036b797..ad0f01478e51dcc7a3827138036437ce639c9e0f 100644 --- a/src/pages/WorkSpace/TestResult/Details/locales/en-US.ts +++ b/src/pages/WorkSpace/TestResult/Details/locales/en-US.ts @@ -89,6 +89,7 @@ const text = { 'note': 'Note', 'join.baseline': 'Add Baseline', 'edit.baseline': 'Edit Baseline', + 'additional.information': 'Additional Information', // Drawer 'bug': 'Bug Record', 'bug.placeholder': 'Enter bug record', diff --git a/src/pages/WorkSpace/TestResult/Details/locales/zh-CN.ts b/src/pages/WorkSpace/TestResult/Details/locales/zh-CN.ts index c94fc3e33bad9b5840a3e4e4c337b7194c83b6a2..719225ef831f215600a026a1e52f29e12cbfb161 100644 --- a/src/pages/WorkSpace/TestResult/Details/locales/zh-CN.ts +++ b/src/pages/WorkSpace/TestResult/Details/locales/zh-CN.ts @@ -83,6 +83,7 @@ const text = { 'note': '备注', 'join.baseline': '加入基线', 'edit.baseline': '修改基线', + 'additional.information': '附加信息', // Drawer 'bug': '缺陷记录', 'bug.placeholder': '请输入缺陷记录',