['columns'] = useMemo(() => {
- const first: TableData | undefined = tableData.find(
+ const firstMetrics: TableData | undefined = tableData.find(
(item) => item.metrics_names && item.metrics_names.length > 0,
);
- const metricsNames = first?.metrics_names ?? [];
- const paramsNames = first?.params_names ?? [];
+ const firstParams: TableData | undefined = tableData.find(
+ (item) => item.params_names && item.params_names.length > 0,
+ );
+ const metricsNames = firstMetrics?.metrics_names ?? [];
+ const paramsNames = firstParams?.params_names ?? [];
return [
{
title: '基本信息',
diff --git a/react-ui/src/pages/Model/components/NodeTooltips/index.less b/react-ui/src/pages/Model/components/NodeTooltips/index.less
index eabb979a..245cbe5f 100644
--- a/react-ui/src/pages/Model/components/NodeTooltips/index.less
+++ b/react-ui/src/pages/Model/components/NodeTooltips/index.less
@@ -1,7 +1,5 @@
.node-tooltips {
position: absolute;
- bottom: -100px;
- left: -300px;
z-index: 10;
width: 300px;
padding: 10px;
@@ -10,6 +8,30 @@
border-radius: 4px;
box-shadow: 0px 3px 6px rgba(146, 146, 146, 0.09);
+ &::after {
+ position: absolute;
+ bottom: -8px; /* 让三角形紧贴 div 底部 */
+ left: 12px; /* 控制三角形相对 div 的位置 */
+ width: 0;
+ height: 0;
+ border-top: 8px solid white; /* 主要颜色 */
+ border-right: 8px solid transparent;
+ border-left: 8px solid transparent;
+ content: '';
+ }
+
+ &::before {
+ position: absolute;
+ bottom: -10px; /* 边框略大,形成描边效果 */
+ left: 10px; /* 调整边框的偏移量,使其覆盖白色三角形 */
+ width: 0;
+ height: 0;
+ border-top: 10px solid #eaeaea; /* 这是边框颜色 */
+ border-right: 10px solid transparent;
+ border-left: 10px solid transparent;
+ content: '';
+ }
+
&__title {
margin: 10px 0;
color: @text-color;
@@ -59,3 +81,31 @@
}
}
}
+
+.node-tooltips.node-tooltips--right {
+ &::after {
+ position: absolute;
+ right: 12px; /* 控制三角形相对 div 的位置 */
+ bottom: -8px; /* 让三角形紧贴 div 底部 */
+ left: auto;
+ width: 0;
+ height: 0;
+ border-top: 8px solid white; /* 主要颜色 */
+ border-right: 8px solid transparent;
+ border-left: 8px solid transparent;
+ content: '';
+ }
+
+ &::before {
+ position: absolute;
+ right: 10px; /* 调整边框的偏移量,使其覆盖白色三角形 */
+ bottom: -10px; /* 边框略大,形成描边效果 */
+ left: auto;
+ width: 0;
+ height: 0;
+ border-top: 10px solid #eaeaea; /* 这是边框颜色 */
+ border-right: 10px solid transparent;
+ border-left: 10px solid transparent;
+ content: '';
+ }
+}
diff --git a/react-ui/src/pages/Model/components/NodeTooltips/index.tsx b/react-ui/src/pages/Model/components/NodeTooltips/index.tsx
index 8a0f055e..574a5065 100644
--- a/react-ui/src/pages/Model/components/NodeTooltips/index.tsx
+++ b/react-ui/src/pages/Model/components/NodeTooltips/index.tsx
@@ -2,6 +2,7 @@ import { ResourceInfoTabKeys } from '@/pages/Dataset/components/ResourceInfo';
import { getGitUrl } from '@/utils';
import { formatDate } from '@/utils/date';
import { useNavigate } from '@umijs/max';
+import classNames from 'classnames';
import { ModelDepsData, NodeType, ProjectDependency, TrainDataset } from '../ModelEvolution/utils';
import styles from './index.less';
@@ -180,6 +181,7 @@ type NodeTooltipsProps = {
data: ModelDepsData | ProjectDependency | TrainDataset;
x: number;
y: number;
+ isLeft: boolean;
onMouseEnter?: () => void;
onMouseLeave?: () => void;
onVersionChange: (version: string) => void;
@@ -190,6 +192,7 @@ function NodeTooltips({
data,
x,
y,
+ isLeft,
onMouseEnter,
onMouseLeave,
onVersionChange,
@@ -208,10 +211,13 @@ function NodeTooltips({
) {
Component = ;
}
+ const style = isLeft
+ ? { left: `${x}px`, bottom: `${y}px` }
+ : { right: `${x}px`, bottom: `${y}px` };
return (
diff --git a/react-ui/src/pages/ModelDeployment/CreateVersion/index.tsx b/react-ui/src/pages/ModelDeployment/CreateVersion/index.tsx
index 86f21f4e..7adb7dc8 100644
--- a/react-ui/src/pages/ModelDeployment/CreateVersion/index.tsx
+++ b/react-ui/src/pages/ModelDeployment/CreateVersion/index.tsx
@@ -20,7 +20,7 @@ import {
import { changePropertyName } from '@/utils';
import { to } from '@/utils/promise';
import SessionStorage from '@/utils/sessionStorage';
-import { modalConfirm } from '@/utils/ui';
+import { removeFormListItem } from '@/utils/ui';
import { MinusCircleOutlined, PlusCircleOutlined, PlusOutlined } from '@ant-design/icons';
import { useNavigate, useParams } from '@umijs/max';
import { App, Button, Col, Flex, Form, Input, InputNumber, Row, Select } from 'antd';
@@ -434,7 +434,6 @@ function CreateServiceVersion() {
{fields.map(({ key, name, ...restField }, index) => (
-
+
- =
+ =
-
+
}
disabled={disabled}
onClick={() => {
- modalConfirm({
- title: '确定要删除该环境变量吗?',
- onOk: () => {
- remove(name);
- },
- });
+ removeFormListItem(
+ form,
+ 'env_variables',
+ name,
+ remove,
+ ['key', 'value'],
+ '删除后,该环境变量将不可恢复',
+ );
}}
>
{index === fields.length - 1 && (
diff --git a/react-ui/src/pages/Pipeline/components/GlobalParamsDrawer/index.tsx b/react-ui/src/pages/Pipeline/components/GlobalParamsDrawer/index.tsx
index e54894ea..f1aa57c9 100644
--- a/react-ui/src/pages/Pipeline/components/GlobalParamsDrawer/index.tsx
+++ b/react-ui/src/pages/Pipeline/components/GlobalParamsDrawer/index.tsx
@@ -40,7 +40,8 @@ const GlobalParamsDrawer = forwardRef(
const removeParameter = (name: number, remove: (param: number) => void) => {
modalConfirm({
- title: '确认删除该参数吗?',
+ title: '删除后,该全局参数将不可恢复',
+ content: '是否确认删除?',
onOk: () => {
remove(name);
},
diff --git a/react-ui/src/utils/ui.tsx b/react-ui/src/utils/ui.tsx
index a3a214ec..d9953a3e 100644
--- a/react-ui/src/utils/ui.tsx
+++ b/react-ui/src/utils/ui.tsx
@@ -8,7 +8,16 @@ import { removeAllPageCacheState } from '@/hooks/pageCacheState';
import themes from '@/styles/theme.less';
import { type ClientInfo } from '@/types';
import { history } from '@umijs/max';
-import { Modal, Upload, message, type ModalFuncProps, type UploadFile } from 'antd';
+import {
+ Modal,
+ Upload,
+ message,
+ type FormInstance,
+ type ModalFuncProps,
+ type UploadFile,
+} from 'antd';
+import { NamePath } from 'antd/es/form/interface';
+import { isEmpty } from './index';
import { closeAllModals } from './modal';
import SessionStorage from './sessionStorage';
@@ -143,16 +152,38 @@ export const limitUploadFileType = (type: string) => {
};
/**
- * 滚动到底部
- *
- * @param {boolean} smooth - Determines if the scroll should be smooth
+ * 删除 FormList 表单项,如果表单项没有值,则直接删除,否则弹出确认框
+ * @param form From实例
+ * @param listName FormList 的 name
+ * @param name FormList 的其中一项
+ * @param remove FormList 的删除方法
+ * @param fieldNames FormList 的子项名称数组
+ * @param confirmTitle 弹出确认框的标题
*/
-export const scrollToBottom = (element: HTMLElement | null, smooth: boolean = true) => {
- if (element) {
- const optons: ScrollToOptions = {
- top: element.scrollHeight,
- behavior: smooth ? 'smooth' : 'instant',
- };
- element.scrollTo(optons);
+export const removeFormListItem = (
+ form: FormInstance,
+ listName: NamePath,
+ name: number,
+ remove: (name: number) => void,
+ fieldNames: NamePath[],
+ confirmTitle: string,
+) => {
+ const fields = fieldNames.map((item) => [listName, name, item].flat());
+ const isEmptyField = fields.every((item) => {
+ const value = form.getFieldValue(item);
+ return isEmpty(value);
+ });
+
+ if (isEmptyField) {
+ remove(name);
+ return;
}
+
+ modalConfirm({
+ title: confirmTitle,
+ content: '是否确认删除?',
+ onOk: () => {
+ remove(name);
+ },
+ });
};
diff --git a/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/ServiceServiceImpl.java b/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/ServiceServiceImpl.java
index 2a30da66..0244bba6 100644
--- a/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/ServiceServiceImpl.java
+++ b/ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/ServiceServiceImpl.java
@@ -44,6 +44,7 @@ public class ServiceServiceImpl implements ServiceService {
private ServiceDao serviceDao;
@Resource
private AssetWorkflowDao assetWorkflowDao;
+
@Override
public Page queryByPageService(com.ruoyi.platform.domain.Service service, PageRequest pageRequest) {
long total = serviceDao.countService(service);
@@ -225,9 +226,9 @@ public class ServiceServiceImpl implements ServiceService {
String req = HttpUtils.sendPost(argoUrl + modelService + "/delete", JSON.toJSONString(paramMap));
if (StringUtils.isNotEmpty(req)) {
Map reqMap = JacksonUtil.parseJSONStr2Map(req);
- if ((Integer) reqMap.get("code") == 200) {
- return serviceDao.updateServiceVersion(serviceVersion) > 0 ? "删除成功" : "删除失败";
- }
+// if ((Integer) reqMap.get("code") == 200) {
+ return serviceDao.updateServiceVersion(serviceVersion) > 0 ? "删除成功" : "删除失败";
+// }
}
return "删除失败";
}