From eeb0d0c14924a5c8c16e858354d7a527b152e6d8 Mon Sep 17 00:00:00 2001 From: cp3hnu Date: Wed, 18 Sep 2024 11:09:46 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=A6=81=E6=AD=A2=E5=9B=BE=E7=89=87?= =?UTF-8?q?=E6=8B=96=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- react-ui/src/components/KFEmpty/index.tsx | 2 +- react-ui/src/components/ModalTitle/index.tsx | 2 +- .../src/components/SubAreaTitle/index.tsx | 2 +- .../components/CodeConfigItem/index.tsx | 9 +++++++-- .../Dataset/components/CategoryItem/index.tsx | 2 ++ .../Dataset/components/ResourceItem/index.tsx | 9 +++++++-- .../Dataset/components/ResourcePage/index.tsx | 8 ++++---- .../components/ExperimentInstance/index.tsx | 2 ++ .../components/ExperimentStatusCell/index.tsx | 7 ++++++- .../components/TensorBoardStatus/index.tsx | 2 ++ react-ui/src/pages/Experiment/index.jsx | 2 ++ .../Pipeline/components/ModelMenu/index.tsx | 1 + .../Center/components/AvatarCropper/index.tsx | 7 ++++++- react-ui/src/pages/User/Center/index.tsx | 2 +- react-ui/src/pages/User/Login/index.tsx | 5 ++++- .../components/ExperimentTable/index.tsx | 2 ++ .../components/QuickStart/WorkArrow.tsx | 1 + .../components/TotalStatistics/index.tsx | 2 +- .../Workspace/components/UserSpace/index.tsx | 20 ++++++++++++++++--- .../components/WorkspaceIntro/index.tsx | 18 +++++++++++++++-- react-ui/src/pages/Workspace/index.less | 1 + react-ui/src/pages/Workspace/index.tsx | 3 ++- react-ui/src/utils/ui.tsx | 1 + 23 files changed, 88 insertions(+), 22 deletions(-) diff --git a/react-ui/src/components/KFEmpty/index.tsx b/react-ui/src/components/KFEmpty/index.tsx index e36a4b2..e59b6f6 100644 --- a/react-ui/src/components/KFEmpty/index.tsx +++ b/react-ui/src/components/KFEmpty/index.tsx @@ -46,7 +46,7 @@ function KFEmpty({ return (
- +
{title}
{content}
{hasFooter && ( diff --git a/react-ui/src/components/ModalTitle/index.tsx b/react-ui/src/components/ModalTitle/index.tsx index adc8322..4c0179e 100644 --- a/react-ui/src/components/ModalTitle/index.tsx +++ b/react-ui/src/components/ModalTitle/index.tsx @@ -18,7 +18,7 @@ type ModalTitleProps = { function ModalTitle({ title, image, style, className }: ModalTitleProps) { return (
- {image && } + {image && } {title}
); diff --git a/react-ui/src/components/SubAreaTitle/index.tsx b/react-ui/src/components/SubAreaTitle/index.tsx index a1d5e33..0458f71 100644 --- a/react-ui/src/components/SubAreaTitle/index.tsx +++ b/react-ui/src/components/SubAreaTitle/index.tsx @@ -17,7 +17,7 @@ type SubAreaTitleProps = { function SubAreaTitle({ title, image, style, className }: SubAreaTitleProps) { return (
- + {title}
); diff --git a/react-ui/src/pages/CodeConfig/components/CodeConfigItem/index.tsx b/react-ui/src/pages/CodeConfig/components/CodeConfigItem/index.tsx index e20f76a..70fcea5 100644 --- a/react-ui/src/pages/CodeConfig/components/CodeConfigItem/index.tsx +++ b/react-ui/src/pages/CodeConfig/components/CodeConfigItem/index.tsx @@ -63,11 +63,16 @@ function CodeConfigItem({ item, onClick, onEdit, onRemove }: CodeConfigItemProps
- + {item.create_by}
- + 最近更新: {formatDate(item.update_time, 'YYYY-MM-DD')}
diff --git a/react-ui/src/pages/Dataset/components/CategoryItem/index.tsx b/react-ui/src/pages/Dataset/components/CategoryItem/index.tsx index ee50e64..417248f 100644 --- a/react-ui/src/pages/Dataset/components/CategoryItem/index.tsx +++ b/react-ui/src/pages/Dataset/components/CategoryItem/index.tsx @@ -23,12 +23,14 @@ function CategoryItem({ resourceType, item, isSelected, onClick }: CategoryItemP style={{ width: '22px' }} src={`/assets/images/${config.prefix}/${item.path}.png`} alt="" + draggable={false} /> {item.name} diff --git a/react-ui/src/pages/Dataset/components/ResourceItem/index.tsx b/react-ui/src/pages/Dataset/components/ResourceItem/index.tsx index e00dcdf..a8cabfe 100644 --- a/react-ui/src/pages/Dataset/components/ResourceItem/index.tsx +++ b/react-ui/src/pages/Dataset/components/ResourceItem/index.tsx @@ -39,11 +39,16 @@ function ResourceItem({ item, isPublic, onClick, onRemove }: ResourceItemProps)
{item.description}
- + {item.create_by ?? ''}
- + {'最近更新: '} {item.update_time ? formatDate(item.update_time, 'YYYY-MM-DD') : item.time_ago ?? ''} diff --git a/react-ui/src/pages/Dataset/components/ResourcePage/index.tsx b/react-ui/src/pages/Dataset/components/ResourcePage/index.tsx index e5180a0..1dd7247 100644 --- a/react-ui/src/pages/Dataset/components/ResourcePage/index.tsx +++ b/react-ui/src/pages/Dataset/components/ResourcePage/index.tsx @@ -18,8 +18,8 @@ function ResourcePage({ resourceType }: ResourcePageProps) { const [activeTab, setActiveTab] = useState(cacheState?.activeTab ?? CommonTabKeys.Public); const [typeList, setTypeList] = useState([]); const [tagList, setTagList] = useState([]); - const [activeType, setActiveType] = useState(cacheState?.activeType); - const [activeTag, setActiveTag] = useState(cacheState?.activeTag); + const [activeType, setActiveType] = useState(cacheState?.activeType); + const [activeTag, setActiveTag] = useState(cacheState?.activeTag); const dataListRef = useRef(null); const config = resourceConfig[resourceType]; @@ -34,12 +34,12 @@ function ResourcePage({ resourceType }: ResourcePageProps) { // 选择类型 const chooseType = (record: CategoryData) => { - setActiveType((prev) => (prev === record.id ? undefined : record.id)); + setActiveType((prev) => (prev === record.name ? undefined : record.name)); }; // 选择 Tag const chooseTag = (record: CategoryData) => { - setActiveTag((prev) => (prev === record.id ? undefined : record.id)); + setActiveTag((prev) => (prev === record.name ? undefined : record.name)); }; // 获取分类 diff --git a/react-ui/src/pages/Experiment/components/ExperimentInstance/index.tsx b/react-ui/src/pages/Experiment/components/ExperimentInstance/index.tsx index 1fb3441..e2bdb42 100644 --- a/react-ui/src/pages/Experiment/components/ExperimentInstance/index.tsx +++ b/react-ui/src/pages/Experiment/components/ExperimentInstance/index.tsx @@ -116,6 +116,8 @@ function ExperimentInstanceComponent({ - + )} diff --git a/react-ui/src/pages/Experiment/index.jsx b/react-ui/src/pages/Experiment/index.jsx index 9faf4ee..b09ba98 100644 --- a/react-ui/src/pages/Experiment/index.jsx +++ b/react-ui/src/pages/Experiment/index.jsx @@ -385,6 +385,8 @@ function Experiment() { style={{ width: '17px', marginRight: '6px' }} key={index} src={experimentStatusInfo[item].icon} + draggable={false} + alt="" /> ); }) diff --git a/react-ui/src/pages/Pipeline/components/ModelMenu/index.tsx b/react-ui/src/pages/Pipeline/components/ModelMenu/index.tsx index 38f6806..1418b4f 100644 --- a/react-ui/src/pages/Pipeline/components/ModelMenu/index.tsx +++ b/react-ui/src/pages/Pipeline/components/ModelMenu/index.tsx @@ -48,6 +48,7 @@ const ModelMenu = ({ onComponentDragEnd }: ModelMenuProps) => { )} diff --git a/react-ui/src/pages/User/Center/components/AvatarCropper/index.tsx b/react-ui/src/pages/User/Center/components/AvatarCropper/index.tsx index a2e19b0..5843a93 100644 --- a/react-ui/src/pages/User/Center/components/AvatarCropper/index.tsx +++ b/react-ui/src/pages/User/Center/components/AvatarCropper/index.tsx @@ -116,7 +116,12 @@ const AvatarCropperForm: React.FC = (props) => {
- +
diff --git a/react-ui/src/pages/User/Center/index.tsx b/react-ui/src/pages/User/Center/index.tsx index 824bb8e..2e38a98 100644 --- a/react-ui/src/pages/User/Center/index.tsx +++ b/react-ui/src/pages/User/Center/index.tsx @@ -141,7 +141,7 @@ const Center: React.FC = () => { setCropperModalOpen(true); }} > - +
{renderUserInfo(currentUser)} diff --git a/react-ui/src/pages/User/Login/index.tsx b/react-ui/src/pages/User/Login/index.tsx index 277c648..6ad360d 100644 --- a/react-ui/src/pages/User/Login/index.tsx +++ b/react-ui/src/pages/User/Login/index.tsx @@ -11,7 +11,7 @@ import styles from './login.less'; const LoginInputPrefix = ({ icon }: { icon: string }) => { return (
- +
); @@ -98,6 +98,7 @@ const Login = () => { 智能材料科研平台 @@ -107,6 +108,7 @@ const Login = () => { @@ -116,6 +118,7 @@ const Login = () => { diff --git a/react-ui/src/pages/Workspace/components/ExperimentTable/index.tsx b/react-ui/src/pages/Workspace/components/ExperimentTable/index.tsx index af940b7..66b1016 100644 --- a/react-ui/src/pages/Workspace/components/ExperimentTable/index.tsx +++ b/react-ui/src/pages/Workspace/components/ExperimentTable/index.tsx @@ -31,6 +31,8 @@ function ExperimentTable({ tableData = [], style }: ExperimentTableProps) { src={experimentStatusInfo[item.status as ExperimentStatus]?.icon} width={17} height={17} + draggable={false} + alt="" />
diff --git a/react-ui/src/pages/Workspace/components/QuickStart/WorkArrow.tsx b/react-ui/src/pages/Workspace/components/QuickStart/WorkArrow.tsx index 76ca1ca..523d857 100644 --- a/react-ui/src/pages/Workspace/components/QuickStart/WorkArrow.tsx +++ b/react-ui/src/pages/Workspace/components/QuickStart/WorkArrow.tsx @@ -44,6 +44,7 @@ function WorkArrow({ - +
{title} diff --git a/react-ui/src/pages/Workspace/components/UserSpace/index.tsx b/react-ui/src/pages/Workspace/components/UserSpace/index.tsx index bd4bf32..dcfa769 100644 --- a/react-ui/src/pages/Workspace/components/UserSpace/index.tsx +++ b/react-ui/src/pages/Workspace/components/UserSpace/index.tsx @@ -20,7 +20,15 @@ function UserSpace({ users = [] }: UserSpaceProps) { className={styles['user-space__avatar']} src={currentUser?.avatar} alt="" - icon={} + icon={ + + } >
{currentUser?.nickName}
{currentUser?.roleNames?.[0]?.roleName}
@@ -34,7 +42,7 @@ function UserSpace({ users = [] }: UserSpaceProps) {
8
- {users?.map((item, index) => { + {users?.map((_item, index) => { return ( + } > ); diff --git a/react-ui/src/pages/Workspace/components/WorkspaceIntro/index.tsx b/react-ui/src/pages/Workspace/components/WorkspaceIntro/index.tsx index 49c0371..81ab8f5 100644 --- a/react-ui/src/pages/Workspace/components/WorkspaceIntro/index.tsx +++ b/react-ui/src/pages/Workspace/components/WorkspaceIntro/index.tsx @@ -15,7 +15,13 @@ function WorkspaceIntro() { type="primary" style={{ marginRight: '20px' }} icon={ - + } > 功能材料自主实验系统 @@ -23,7 +29,13 @@ function WorkspaceIntro() {
diff --git a/react-ui/src/pages/Workspace/index.less b/react-ui/src/pages/Workspace/index.less index 09be284..300887e 100644 --- a/react-ui/src/pages/Workspace/index.less +++ b/react-ui/src/pages/Workspace/index.less @@ -53,6 +53,7 @@ width: 64px; height: 64px; background-color: white; + border-radius: 10px; cursor: pointer; } } diff --git a/react-ui/src/pages/Workspace/index.tsx b/react-ui/src/pages/Workspace/index.tsx index 7fa3dd2..bdef4f8 100644 --- a/react-ui/src/pages/Workspace/index.tsx +++ b/react-ui/src/pages/Workspace/index.tsx @@ -76,7 +76,8 @@ function Workspace() { className={styles['workspace__robot-img']} src={require('@/assets/img/robot.png')} onClick={handleClick} - onDragStart={(e) => e.preventDefault()} + draggable={false} + alt="" > diff --git a/react-ui/src/utils/ui.tsx b/react-ui/src/utils/ui.tsx index af27f1c..7625a77 100644 --- a/react-ui/src/utils/ui.tsx +++ b/react-ui/src/utils/ui.tsx @@ -21,6 +21,7 @@ export function modalConfirm({ title, content, onOk, ...rest }: ModalFuncProps)
{title}