From b138b3f24178f782a2e0dc9bb90a97f71a73f52e Mon Sep 17 00:00:00 2001 From: cp3hnu Date: Wed, 22 May 2024 14:00:49 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E6=B5=81=E6=B0=B4?= =?UTF-8?q?=E7=BA=BF=E6=A8=A1=E7=89=88=E6=8F=8F=E8=BF=B0=E5=BE=88=E9=95=BF?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- react-ui/src/components/CommonTableCell/index.tsx | 6 +++++- react-ui/src/components/ParameterInput/index.tsx | 7 ++++--- react-ui/src/pages/Experiment/index.jsx | 3 +++ .../Pipeline/components/ResourceSelectorModal/index.tsx | 2 +- react-ui/src/pages/Pipeline/index.jsx | 6 ++++-- 5 files changed, 17 insertions(+), 7 deletions(-) diff --git a/react-ui/src/components/CommonTableCell/index.tsx b/react-ui/src/components/CommonTableCell/index.tsx index 6c2f35b0..afa5d8d3 100644 --- a/react-ui/src/components/CommonTableCell/index.tsx +++ b/react-ui/src/components/CommonTableCell/index.tsx @@ -12,7 +12,11 @@ function renderCell(text?: string | null) { function CommonTableCell(ellipsis: boolean = false) { if (ellipsis) { - return (text?: string | null) => {renderCell(text)}; + return (text?: string | null) => ( + + {renderCell(text)} + + ); } else { return renderCell; } diff --git a/react-ui/src/components/ParameterInput/index.tsx b/react-ui/src/components/ParameterInput/index.tsx index 9d023047..27ba2856 100644 --- a/react-ui/src/components/ParameterInput/index.tsx +++ b/react-ui/src/components/ParameterInput/index.tsx @@ -64,14 +64,15 @@ function ParameterInput({ {valueObj?.showValue} + onClick={(e) => { + e.stopPropagation(); onChange?.({ ...valueObj, fromSelect: false, value: undefined, showValue: undefined, - }) - } + }); + }} /> ) : ( diff --git a/react-ui/src/pages/Experiment/index.jsx b/react-ui/src/pages/Experiment/index.jsx index cff525c0..014a7c5b 100644 --- a/react-ui/src/pages/Experiment/index.jsx +++ b/react-ui/src/pages/Experiment/index.jsx @@ -1,3 +1,4 @@ +import CommonTableCell from '@/components/CommonTableCell'; import KFIcon from '@/components/KFIcon'; import { deleteExperimentById, @@ -290,6 +291,8 @@ function Experiment() { title: '实验描述', dataIndex: 'description', key: 'description', + render: CommonTableCell(true), + ellipsis: { showTitle: false }, }, { title: '最近五次运行状态', diff --git a/react-ui/src/pages/Pipeline/components/ResourceSelectorModal/index.tsx b/react-ui/src/pages/Pipeline/components/ResourceSelectorModal/index.tsx index bddf2718..45cf6a1e 100644 --- a/react-ui/src/pages/Pipeline/components/ResourceSelectorModal/index.tsx +++ b/react-ui/src/pages/Pipeline/components/ResourceSelectorModal/index.tsx @@ -13,7 +13,7 @@ import { Input, Tabs, Tree } from 'antd'; import React, { useEffect, useMemo, useRef, useState } from 'react'; import { MirrorVersion, ResourceSelectorType, selectorTypeConfig } from './config'; import styles from './index.less'; -export { ResourceSelectorType, selectorTypeConfig } from './config'; +export { ResourceSelectorType, selectorTypeConfig }; // 选择数据集和模型的返回类型 export type ResourceSelectorResponse = { diff --git a/react-ui/src/pages/Pipeline/index.jsx b/react-ui/src/pages/Pipeline/index.jsx index 7467052f..98ba9b72 100644 --- a/react-ui/src/pages/Pipeline/index.jsx +++ b/react-ui/src/pages/Pipeline/index.jsx @@ -1,3 +1,4 @@ +import CommonTableCell from '@/components/CommonTableCell'; import DateTableCell from '@/components/DateTableCell'; import KFIcon from '@/components/KFIcon'; import KFModal from '@/components/KFModal'; @@ -119,9 +120,8 @@ const Pipeline = () => { width: 120, align: 'center', render(text, record, index) { - return {(pageOption.current.page - 1) * 10 + index + 1}; + return {(pageOption.current.page - 1) * pageOption.current.size + index + 1}; }, - // render: (text, record, index) => `${((curPage-1)*10)+(index+1)}`, }, { title: '流水线名称', @@ -133,6 +133,8 @@ const Pipeline = () => { title: '流水线描述', dataIndex: 'description', key: 'description', + render: CommonTableCell(true), + ellipsis: { showTitle: false }, }, { title: '创建时间',