|
-
- {React.createElement(allIcons[iconName])}
-
+
+ {React.createElement(allIcons[iconName])}
+
|
@@ -220,7 +221,9 @@ const PicSearcher: React.FC = () => {
)}
diff --git a/react-ui/src/components/IconSelector/fields.ts b/react-ui/src/components/IconSelector/fields.ts
index de37e675..5de572cb 100644
--- a/react-ui/src/components/IconSelector/fields.ts
+++ b/react-ui/src/components/IconSelector/fields.ts
@@ -1,7 +1,7 @@
import * as AntdIcons from '@ant-design/icons/lib/icons';
const all = Object.keys(AntdIcons)
- .map(n => n.replace(/(Outlined|Filled|TwoTone)$/, ''))
+ .map((n) => n.replace(/(Outlined|Filled|TwoTone)$/, ''))
.filter((n, i, arr) => arr.indexOf(n) === i);
const direction = [
@@ -206,7 +206,7 @@ const logo = [
const datum = [...direction, ...suggestion, ...editor, ...data, ...logo];
-const other = all.filter(n => !datum.includes(n));
+const other = all.filter((n) => !datum.includes(n));
export const categories = {
direction,
diff --git a/react-ui/src/components/IconSelector/index.tsx b/react-ui/src/components/IconSelector/index.tsx
index 78dc931b..0d50db68 100644
--- a/react-ui/src/components/IconSelector/index.tsx
+++ b/react-ui/src/components/IconSelector/index.tsx
@@ -1,13 +1,13 @@
-import * as React from 'react';
import Icon, * as AntdIcons from '@ant-design/icons';
-import { Radio, Input, Empty } from 'antd';
+import { Empty, Input, Radio } from 'antd';
import type { RadioChangeEvent } from 'antd/es/radio/interface';
import debounce from 'lodash/debounce';
+import * as React from 'react';
import Category from './Category';
import IconPicSearcher from './IconPicSearcher';
-import { FilledIcon, OutlinedIcon, TwoToneIcon } from './themeIcons';
import type { CategoriesKeys } from './fields';
import { categories } from './fields';
+import { FilledIcon, OutlinedIcon, TwoToneIcon } from './themeIcons';
// import { useIntl } from '@umijs/max';
export enum ThemeType {
@@ -41,13 +41,13 @@ const IconSelector: React.FC = (props) => {
const handleSearchIcon = React.useCallback(
debounce((searchKey: string) => {
- setDisplayState(prevState => ({ ...prevState, searchKey }));
+ setDisplayState((prevState) => ({ ...prevState, searchKey }));
}),
[],
);
const handleChangeTheme = React.useCallback((e: RadioChangeEvent) => {
- setDisplayState(prevState => ({ ...prevState, theme: e.target.value as ThemeType }));
+ setDisplayState((prevState) => ({ ...prevState, theme: e.target.value as ThemeType }));
}, []);
const renderCategories = React.useMemo(() => {
@@ -62,15 +62,19 @@ const IconSelector: React.FC = (props) => {
.replace(new RegExp(`^<([a-zA-Z]*)\\s/>$`, 'gi'), (_, name) => name)
.replace(/(Filled|Outlined|TwoTone)$/, '')
.toLowerCase();
- iconList = iconList.filter((iconName:string) => iconName.toLowerCase().includes(matchKey));
+ iconList = iconList.filter((iconName: string) =>
+ iconName.toLowerCase().includes(matchKey),
+ );
}
// CopyrightCircle is same as Copyright, don't show it
- iconList = iconList.filter((icon:string) => icon !== 'CopyrightCircle');
+ iconList = iconList.filter((icon: string) => icon !== 'CopyrightCircle');
return {
category: key,
- icons: iconList.map((iconName:string) => iconName + theme).filter((iconName:string) => allIcons[iconName]),
+ icons: iconList
+ .map((iconName: string) => iconName + theme)
+ .filter((iconName: string) => allIcons[iconName]),
};
})
.filter(({ icons }) => !!icons.length)
@@ -101,16 +105,16 @@ const IconSelector: React.FC = (props) => {
buttonStyle="solid"
options={[
{
- label: ,
- value: ThemeType.Outlined
+ label: ,
+ value: ThemeType.Outlined,
},
{
label: ,
- value: ThemeType.Filled
+ value: ThemeType.Filled,
},
{
label: ,
- value: ThemeType.TwoTone
+ value: ThemeType.TwoTone,
},
]}
>
@@ -128,7 +132,7 @@ const IconSelector: React.FC = (props) => {
// placeholder={messages['app.docs.components.icon.search.placeholder']}
style={{ margin: '0 10px', flex: 1 }}
allowClear
- onChange={e => handleSearchIcon(e.currentTarget.value)}
+ onChange={(e) => handleSearchIcon(e.currentTarget.value)}
size="large"
autoFocus
suffix={}
@@ -139,4 +143,4 @@ const IconSelector: React.FC = (props) => {
);
};
-export default IconSelector
+export default IconSelector;
diff --git a/react-ui/src/components/IconSelector/themeIcons.tsx b/react-ui/src/components/IconSelector/themeIcons.tsx
index abefe04d..1d9762cd 100644
--- a/react-ui/src/components/IconSelector/themeIcons.tsx
+++ b/react-ui/src/components/IconSelector/themeIcons.tsx
@@ -1,7 +1,6 @@
import * as React from 'react';
-
-export const FilledIcon: React.FC = props => {
+export const FilledIcon: React.FC = (props) => {
const path =
'M864 64H160C107 64 64 107 64 160v' +
'704c0 53 43 96 96 96h704c53 0 96-43 96-96V16' +
@@ -13,7 +12,7 @@ export const FilledIcon: React.FC = props => {
);
};
-export const OutlinedIcon: React.FC = props => {
+export const OutlinedIcon: React.FC = (props) => {
const path =
'M864 64H160C107 64 64 107 64 160v7' +
'04c0 53 43 96 96 96h704c53 0 96-43 96-96V160c' +
@@ -27,7 +26,7 @@ export const OutlinedIcon: React.FC = props => {
);
};
-export const TwoToneIcon: React.FC = props => {
+export const TwoToneIcon: React.FC = (props) => {
const path =
'M16 512c0 273.932 222.066 496 496 49' +
'6s496-222.068 496-496S785.932 16 512 16 16 238.' +
diff --git a/react-ui/src/components/RightContent/AvatarDropdown.tsx b/react-ui/src/components/RightContent/AvatarDropdown.tsx
index 9447493e..c6c52a92 100644
--- a/react-ui/src/components/RightContent/AvatarDropdown.tsx
+++ b/react-ui/src/components/RightContent/AvatarDropdown.tsx
@@ -1,17 +1,17 @@
+import { clearSessionToken } from '@/access';
+import { PageEnum } from '@/enums/pagesEnums';
+import { setRemoteMenu } from '@/services/session';
+import { logout } from '@/services/system/auth';
import { LogoutOutlined, SettingOutlined, UserOutlined } from '@ant-design/icons';
+import { setAlpha } from '@ant-design/pro-components';
import { useEmotionCss } from '@ant-design/use-emotion-css';
import { history, useModel } from '@umijs/max';
import { Avatar, Spin } from 'antd';
-import { setAlpha } from '@ant-design/pro-components';
import { stringify } from 'querystring';
import type { MenuInfo } from 'rc-menu/lib/interface';
import React, { useCallback } from 'react';
import { flushSync } from 'react-dom';
import HeaderDropdown from '../HeaderDropdown';
-import { setRemoteMenu } from '@/services/session';
-import { PageEnum } from '@/enums/pagesEnums';
-import { clearSessionToken } from '@/access';
-import { logout } from '@/services/system/auth';
export type GlobalHeaderRightProps = {
menu?: boolean;
diff --git a/react-ui/src/enums/pagesEnums.ts b/react-ui/src/enums/pagesEnums.ts
index 4bdb5fd3..756d3325 100644
--- a/react-ui/src/enums/pagesEnums.ts
+++ b/react-ui/src/enums/pagesEnums.ts
@@ -1,4 +1,3 @@
-
export enum PageEnum {
- LOGIN = '/user/login'
-}
\ No newline at end of file
+ LOGIN = '/user/login',
+}
diff --git a/react-ui/src/enums/status.d.ts b/react-ui/src/enums/status.d.ts
index 8b137891..e69de29b 100644
--- a/react-ui/src/enums/status.d.ts
+++ b/react-ui/src/enums/status.d.ts
@@ -1 +0,0 @@
-
diff --git a/react-ui/src/global.less b/react-ui/src/global.less
index c6d331ea..df9fc389 100644
--- a/react-ui/src/global.less
+++ b/react-ui/src/global.less
@@ -19,8 +19,8 @@ body,
.ant-pro-sider.ant-layout-sider.ant-pro-sider-fixed {
left: unset;
}
-.ant-layout-sider-children{
- margin-top: 60px!important;
+.ant-layout-sider-children {
+ margin-top: 60px !important;
}
canvas {
display: block;
@@ -31,67 +31,65 @@ body {
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
-.ant-pro-layout .ant-pro-layout-content{
+.ant-pro-layout .ant-pro-layout-content {
padding: 10px;
}
-.ant-pro-layout .ant-pro-layout-bg-list{
- background:#f9fafb;
+.ant-pro-layout .ant-pro-layout-bg-list {
+ background: #f9fafb;
}
-.ant-table-wrapper .ant-table-thead >tr>th{
+.ant-table-wrapper .ant-table-thead > tr > th {
background-color: #fff;
}
-.ant-table-wrapper .ant-table-thead >tr>td{
+.ant-table-wrapper .ant-table-thead > tr > td {
background-color: #fff;
}
-.ant-menu-light .ant-menu-item-selected{
- background:rgba(197, 232, 255, 0.8)!important;
+.ant-menu-light .ant-menu-item-selected {
+ background: rgba(197, 232, 255, 0.8) !important;
}
-.ant-pro-base-menu-inline{
+.ant-pro-base-menu-inline {
// height: 87vh;
- background:#f2f5f7;
-border-radius:0px 20px 20px 0px;
+ background: #f2f5f7;
+ border-radius: 0px 20px 20px 0px;
}
-.ant-pro-layout .ant-pro-layout-content{
+.ant-pro-layout .ant-pro-layout-content {
background-color: transparent;
}
-.ant-pro-global-header-logo img{
+.ant-pro-global-header-logo img {
height: 21px;
}
-.ant-pro-layout .ant-layout-sider.ant-pro-sider{
+.ant-pro-layout .ant-layout-sider.ant-pro-sider {
height: 87vh;
}
-.ant-pro-layout .ant-pro-layout-container{
+.ant-pro-layout .ant-pro-layout-container {
height: 98vh;
}
-.ant-pagination .ant-pagination-item-active a{
- background:#1664ff;
+.ant-pagination .ant-pagination-item-active a {
color: #fff;
+ background: #1664ff;
border-color: #1664ff;
}
-.ant-pagination .ant-pagination-item-active a:hover{
- background:rgba(22, 100, 255, 0.8);
+.ant-pagination .ant-pagination-item-active a:hover {
color: #fff;
+ background: rgba(22, 100, 255, 0.8);
border-color: rgba(22, 100, 255, 0.8);
}
// ::-webkit-scrollbar-button {
// background: #97a1bd;
// }
-::-webkit-scrollbar{
- width:9px;
+::-webkit-scrollbar {
+ width: 9px;
border-radius: 2px;
}
-::-webkit-scrollbar-thumb{
+::-webkit-scrollbar-thumb {
// background-color: #9aa3bc!important;
width: 7px;
- background:rgba(77, 87, 123,0.5)!important;
-
+ background: rgba(77, 87, 123, 0.5) !important;
}
-::-webkit-scrollbar-track{
+::-webkit-scrollbar-track {
// background-color: #eaf1ff!important;
width: 9px;
- background:rgba(22, 100, 255,0.06)!important;
-
+ background: rgba(22, 100, 255, 0.06) !important;
}
ul,
ol {
@@ -114,5 +112,3 @@ ol {
}
}
}
-
-
diff --git a/react-ui/src/locales/en-US/app.ts b/react-ui/src/locales/en-US/app.ts
index 074dcb85..6a196446 100644
--- a/react-ui/src/locales/en-US/app.ts
+++ b/react-ui/src/locales/en-US/app.ts
@@ -1,26 +1,26 @@
export default {
- 'app.docs.components.icon.search.placeholder': 'Search icons here, click icon to copy code',
- 'app.docs.components.icon.outlined': 'Outlined',
- 'app.docs.components.icon.filled': 'Filled',
- 'app.docs.components.icon.two-tone': 'Two Tone',
- 'app.docs.components.icon.category.direction': 'Directional Icons',
- 'app.docs.components.icon.category.suggestion': 'Suggested Icons',
- 'app.docs.components.icon.category.editor': 'Editor Icons',
- 'app.docs.components.icon.category.data': 'Data Icons',
- 'app.docs.components.icon.category.other': 'Application Icons',
- 'app.docs.components.icon.category.logo': 'Brand and Logos',
- 'app.docs.components.icon.pic-searcher.intro':
- 'AI Search by image is online, you are welcome to use it! 🎉',
- 'app.docs.components.icon.pic-searcher.title': 'Search by image',
- 'app.docs.components.icon.pic-searcher.upload-text':
- 'Click, drag, or paste file to this area to upload',
- 'app.docs.components.icon.pic-searcher.upload-hint':
- 'We will find the best matching icon based on the image provided',
- 'app.docs.components.icon.pic-searcher.server-error':
- 'Predict service is temporarily unavailable',
- 'app.docs.components.icon.pic-searcher.matching': 'Matching...',
- 'app.docs.components.icon.pic-searcher.modelloading': 'Model is loading...',
- 'app.docs.components.icon.pic-searcher.result-tip': 'Matched the following icons for you:',
- 'app.docs.components.icon.pic-searcher.th-icon': 'Icon',
- 'app.docs.components.icon.pic-searcher.th-score': 'Probability',
+ 'app.docs.components.icon.search.placeholder': 'Search icons here, click icon to copy code',
+ 'app.docs.components.icon.outlined': 'Outlined',
+ 'app.docs.components.icon.filled': 'Filled',
+ 'app.docs.components.icon.two-tone': 'Two Tone',
+ 'app.docs.components.icon.category.direction': 'Directional Icons',
+ 'app.docs.components.icon.category.suggestion': 'Suggested Icons',
+ 'app.docs.components.icon.category.editor': 'Editor Icons',
+ 'app.docs.components.icon.category.data': 'Data Icons',
+ 'app.docs.components.icon.category.other': 'Application Icons',
+ 'app.docs.components.icon.category.logo': 'Brand and Logos',
+ 'app.docs.components.icon.pic-searcher.intro':
+ 'AI Search by image is online, you are welcome to use it! 🎉',
+ 'app.docs.components.icon.pic-searcher.title': 'Search by image',
+ 'app.docs.components.icon.pic-searcher.upload-text':
+ 'Click, drag, or paste file to this area to upload',
+ 'app.docs.components.icon.pic-searcher.upload-hint':
+ 'We will find the best matching icon based on the image provided',
+ 'app.docs.components.icon.pic-searcher.server-error':
+ 'Predict service is temporarily unavailable',
+ 'app.docs.components.icon.pic-searcher.matching': 'Matching...',
+ 'app.docs.components.icon.pic-searcher.modelloading': 'Model is loading...',
+ 'app.docs.components.icon.pic-searcher.result-tip': 'Matched the following icons for you:',
+ 'app.docs.components.icon.pic-searcher.th-icon': 'Icon',
+ 'app.docs.components.icon.pic-searcher.th-score': 'Probability',
};
diff --git a/react-ui/src/locales/zh-CN.ts b/react-ui/src/locales/zh-CN.ts
index 06e2eac5..ae9b1a77 100644
--- a/react-ui/src/locales/zh-CN.ts
+++ b/react-ui/src/locales/zh-CN.ts
@@ -2,25 +2,25 @@ import app from './zh-CN/app';
import component from './zh-CN/component';
import globalHeader from './zh-CN/globalHeader';
import sysmenu from './zh-CN/menu';
+import job from './zh-CN/monitor/job';
+import joblog from './zh-CN/monitor/job-log';
+import logininfor from './zh-CN/monitor/logininfor';
+import onlineUser from './zh-CN/monitor/onlineUser';
+import operlog from './zh-CN/monitor/operlog';
+import server from './zh-CN/monitor/server';
import pages from './zh-CN/pages';
import pwa from './zh-CN/pwa';
import settingDrawer from './zh-CN/settingDrawer';
import settings from './zh-CN/settings';
-import user from './zh-CN/system/user';
-import menu from './zh-CN/system/menu';
+import config from './zh-CN/system/config';
+import dept from './zh-CN/system/dept';
import dict from './zh-CN/system/dict';
import dictData from './zh-CN/system/dict-data';
-import role from './zh-CN/system/role';
-import dept from './zh-CN/system/dept';
-import post from './zh-CN/system/post';
-import config from './zh-CN/system/config';
+import menu from './zh-CN/system/menu';
import notice from './zh-CN/system/notice';
-import operlog from './zh-CN/monitor/operlog';
-import logininfor from './zh-CN/monitor/logininfor';
-import onlineUser from './zh-CN/monitor/onlineUser';
-import job from './zh-CN/monitor/job';
-import joblog from './zh-CN/monitor/job-log';
-import server from './zh-CN/monitor/server';
+import post from './zh-CN/system/post';
+import role from './zh-CN/system/role';
+import user from './zh-CN/system/user';
export default {
'navBar.lang': '语言',
diff --git a/react-ui/src/locales/zh-CN/monitor/job-log.ts b/react-ui/src/locales/zh-CN/monitor/job-log.ts
index 75cf8d06..5c038599 100644
--- a/react-ui/src/locales/zh-CN/monitor/job-log.ts
+++ b/react-ui/src/locales/zh-CN/monitor/job-log.ts
@@ -1,18 +1,18 @@
/**
* 定时任务调度日志
- *
+ *
* @author whiteshader
* @date 2023-02-07
*/
export default {
- 'monitor.job.log.title': '定时任务调度日志',
- 'monitor.job.log.job_log_id': '任务日志编号',
- 'monitor.job.log.job_name': '任务名称',
- 'monitor.job.log.job_group': '任务组名',
- 'monitor.job.log.invoke_target': '调用方法',
- 'monitor.job.log.job_message': '日志信息',
- 'monitor.job.log.status': '执行状态',
- 'monitor.job.log.exception_info': '异常信息',
- 'monitor.job.log.create_time': '创建时间',
+ 'monitor.job.log.title': '定时任务调度日志',
+ 'monitor.job.log.job_log_id': '任务日志编号',
+ 'monitor.job.log.job_name': '任务名称',
+ 'monitor.job.log.job_group': '任务组名',
+ 'monitor.job.log.invoke_target': '调用方法',
+ 'monitor.job.log.job_message': '日志信息',
+ 'monitor.job.log.status': '执行状态',
+ 'monitor.job.log.exception_info': '异常信息',
+ 'monitor.job.log.create_time': '创建时间',
};
diff --git a/react-ui/src/locales/zh-CN/monitor/job.ts b/react-ui/src/locales/zh-CN/monitor/job.ts
index 7e0d5b9a..866ad8f0 100644
--- a/react-ui/src/locales/zh-CN/monitor/job.ts
+++ b/react-ui/src/locales/zh-CN/monitor/job.ts
@@ -1,25 +1,25 @@
/**
* 定时任务调度
- *
+ *
* @author whiteshader@163.com
* @date 2023-02-07
*/
export default {
- 'monitor.job.title': '定时任务调度',
- 'monitor.job.job_id': '任务编号',
- 'monitor.job.job_name': '任务名称',
- 'monitor.job.job_group': '任务组名',
- 'monitor.job.invoke_target': '调用方法',
- 'monitor.job.cron_expression': 'cron执行表达式',
- 'monitor.job.misfire_policy': '执行策略',
- 'monitor.job.concurrent': '是否并发执行',
- 'monitor.job.next_valid_time': '下次执行时间',
- 'monitor.job.status': '状态',
- 'monitor.job.create_by': '创建者',
- 'monitor.job.create_time': '创建时间',
- 'monitor.job.update_by': '更新者',
- 'monitor.job.update_time': '更新时间',
- 'monitor.job.remark': '备注信息',
- 'monitor.job.detail': '任务详情',
+ 'monitor.job.title': '定时任务调度',
+ 'monitor.job.job_id': '任务编号',
+ 'monitor.job.job_name': '任务名称',
+ 'monitor.job.job_group': '任务组名',
+ 'monitor.job.invoke_target': '调用方法',
+ 'monitor.job.cron_expression': 'cron执行表达式',
+ 'monitor.job.misfire_policy': '执行策略',
+ 'monitor.job.concurrent': '是否并发执行',
+ 'monitor.job.next_valid_time': '下次执行时间',
+ 'monitor.job.status': '状态',
+ 'monitor.job.create_by': '创建者',
+ 'monitor.job.create_time': '创建时间',
+ 'monitor.job.update_by': '更新者',
+ 'monitor.job.update_time': '更新时间',
+ 'monitor.job.remark': '备注信息',
+ 'monitor.job.detail': '任务详情',
};
diff --git a/react-ui/src/locales/zh-CN/monitor/logininfor.ts b/react-ui/src/locales/zh-CN/monitor/logininfor.ts
index 959a6d2c..10369ac8 100644
--- a/react-ui/src/locales/zh-CN/monitor/logininfor.ts
+++ b/react-ui/src/locales/zh-CN/monitor/logininfor.ts
@@ -1,13 +1,13 @@
export default {
- 'monitor.logininfor.title': '系统访问记录',
- 'monitor.logininfor.info_id': '访问编号',
- 'monitor.logininfor.user_name': '用户账号',
- 'monitor.logininfor.ipaddr': '登录IP地址',
- 'monitor.logininfor.login_location': '登录地点',
- 'monitor.logininfor.browser': '浏览器类型',
- 'monitor.logininfor.os': '操作系统',
- 'monitor.logininfor.status': '登录状态',
- 'monitor.logininfor.msg': '提示消息',
- 'monitor.logininfor.login_time': '访问时间',
- 'monitor.logininfor.unlock': '解锁',
+ 'monitor.logininfor.title': '系统访问记录',
+ 'monitor.logininfor.info_id': '访问编号',
+ 'monitor.logininfor.user_name': '用户账号',
+ 'monitor.logininfor.ipaddr': '登录IP地址',
+ 'monitor.logininfor.login_location': '登录地点',
+ 'monitor.logininfor.browser': '浏览器类型',
+ 'monitor.logininfor.os': '操作系统',
+ 'monitor.logininfor.status': '登录状态',
+ 'monitor.logininfor.msg': '提示消息',
+ 'monitor.logininfor.login_time': '访问时间',
+ 'monitor.logininfor.unlock': '解锁',
};
diff --git a/react-ui/src/locales/zh-CN/monitor/onlineUser.ts b/react-ui/src/locales/zh-CN/monitor/onlineUser.ts
index c693cde7..fd2377a3 100644
--- a/react-ui/src/locales/zh-CN/monitor/onlineUser.ts
+++ b/react-ui/src/locales/zh-CN/monitor/onlineUser.ts
@@ -1,9 +1,8 @@
-
/* *
*
* @author whiteshader@163.com
* @datetime 2021/09/16
- *
+ *
* */
export default {
diff --git a/react-ui/src/locales/zh-CN/monitor/operlog.ts b/react-ui/src/locales/zh-CN/monitor/operlog.ts
index c45824c6..6faf1c85 100644
--- a/react-ui/src/locales/zh-CN/monitor/operlog.ts
+++ b/react-ui/src/locales/zh-CN/monitor/operlog.ts
@@ -1,19 +1,19 @@
export default {
- 'monitor.operlog.title': '操作日志记录',
- 'monitor.operlog.oper_id': '日志主键',
- 'monitor.operlog.business_type': '业务类型',
- 'monitor.operlog.method': '方法名称',
- 'monitor.operlog.request_method': '请求方式',
- 'monitor.operlog.operator_type': '操作类别',
- 'monitor.operlog.oper_name': '操作人员',
- 'monitor.operlog.dept_name': '部门名称',
- 'monitor.operlog.oper_url': '请求URL',
- 'monitor.operlog.oper_ip': '主机地址',
- 'monitor.operlog.oper_location': '操作地点',
- 'monitor.operlog.oper_param': '请求参数',
- 'monitor.operlog.json_result': '返回参数',
- 'monitor.operlog.status': '操作状态',
- 'monitor.operlog.error_msg': '错误消息',
- 'monitor.operlog.oper_time': '操作时间',
- 'monitor.operlog.module': '操作模块',
+ 'monitor.operlog.title': '操作日志记录',
+ 'monitor.operlog.oper_id': '日志主键',
+ 'monitor.operlog.business_type': '业务类型',
+ 'monitor.operlog.method': '方法名称',
+ 'monitor.operlog.request_method': '请求方式',
+ 'monitor.operlog.operator_type': '操作类别',
+ 'monitor.operlog.oper_name': '操作人员',
+ 'monitor.operlog.dept_name': '部门名称',
+ 'monitor.operlog.oper_url': '请求URL',
+ 'monitor.operlog.oper_ip': '主机地址',
+ 'monitor.operlog.oper_location': '操作地点',
+ 'monitor.operlog.oper_param': '请求参数',
+ 'monitor.operlog.json_result': '返回参数',
+ 'monitor.operlog.status': '操作状态',
+ 'monitor.operlog.error_msg': '错误消息',
+ 'monitor.operlog.oper_time': '操作时间',
+ 'monitor.operlog.module': '操作模块',
};
diff --git a/react-ui/src/locales/zh-CN/monitor/server.ts b/react-ui/src/locales/zh-CN/monitor/server.ts
index f887a221..33210f65 100644
--- a/react-ui/src/locales/zh-CN/monitor/server.ts
+++ b/react-ui/src/locales/zh-CN/monitor/server.ts
@@ -1,9 +1,8 @@
-
/* *
*
* @author whiteshader@163.com
* @datetime 2021/09/16
- *
+ *
* */
export default {
diff --git a/react-ui/src/locales/zh-CN/system/config.ts b/react-ui/src/locales/zh-CN/system/config.ts
index 5e1e7646..8c230928 100644
--- a/react-ui/src/locales/zh-CN/system/config.ts
+++ b/react-ui/src/locales/zh-CN/system/config.ts
@@ -1,14 +1,14 @@
export default {
- 'system.config.title': '参数配置',
- 'system.config.config_id': '参数主键',
- 'system.config.config_name': '参数名称',
- 'system.config.config_key': '参数键名',
- 'system.config.config_value': '参数键值',
- 'system.config.config_type': '系统内置',
- 'system.config.create_by': '创建者',
- 'system.config.create_time': '创建时间',
- 'system.config.update_by': '更新者',
- 'system.config.update_time': '更新时间',
- 'system.config.remark': '备注',
- 'system.config.refreshCache': '刷新缓存',
+ 'system.config.title': '参数配置',
+ 'system.config.config_id': '参数主键',
+ 'system.config.config_name': '参数名称',
+ 'system.config.config_key': '参数键名',
+ 'system.config.config_value': '参数键值',
+ 'system.config.config_type': '系统内置',
+ 'system.config.create_by': '创建者',
+ 'system.config.create_time': '创建时间',
+ 'system.config.update_by': '更新者',
+ 'system.config.update_time': '更新时间',
+ 'system.config.remark': '备注',
+ 'system.config.refreshCache': '刷新缓存',
};
diff --git a/react-ui/src/locales/zh-CN/system/dept.ts b/react-ui/src/locales/zh-CN/system/dept.ts
index 7774f2c2..534f3119 100644
--- a/react-ui/src/locales/zh-CN/system/dept.ts
+++ b/react-ui/src/locales/zh-CN/system/dept.ts
@@ -1,18 +1,18 @@
export default {
- 'system.dept.title': '部门',
- 'system.dept.dept_id': '部门id',
- 'system.dept.parent_id': '父部门id',
- 'system.dept.parent_dept': '上级部门',
- 'system.dept.ancestors': '祖级列表',
- 'system.dept.dept_name': '部门名称',
- 'system.dept.order_num': '显示顺序',
- 'system.dept.leader': '负责人',
- 'system.dept.phone': '联系电话',
- 'system.dept.email': '邮箱',
- 'system.dept.status': '部门状态',
- 'system.dept.del_flag': '删除标志',
- 'system.dept.create_by': '创建者',
- 'system.dept.create_time': '创建时间',
- 'system.dept.update_by': '更新者',
- 'system.dept.update_time': '更新时间',
+ 'system.dept.title': '部门',
+ 'system.dept.dept_id': '部门id',
+ 'system.dept.parent_id': '父部门id',
+ 'system.dept.parent_dept': '上级部门',
+ 'system.dept.ancestors': '祖级列表',
+ 'system.dept.dept_name': '部门名称',
+ 'system.dept.order_num': '显示顺序',
+ 'system.dept.leader': '负责人',
+ 'system.dept.phone': '联系电话',
+ 'system.dept.email': '邮箱',
+ 'system.dept.status': '部门状态',
+ 'system.dept.del_flag': '删除标志',
+ 'system.dept.create_by': '创建者',
+ 'system.dept.create_time': '创建时间',
+ 'system.dept.update_by': '更新者',
+ 'system.dept.update_time': '更新时间',
};
diff --git a/react-ui/src/locales/zh-CN/system/menu.ts b/react-ui/src/locales/zh-CN/system/menu.ts
index 8a01e582..163c2cec 100644
--- a/react-ui/src/locales/zh-CN/system/menu.ts
+++ b/react-ui/src/locales/zh-CN/system/menu.ts
@@ -1,22 +1,22 @@
export default {
- 'system.menu.title': '菜单权限',
- 'system.menu.menu_id': '菜单编号',
- 'system.menu.menu_name': '菜单名称',
- 'system.menu.parent_id': '上级菜单',
- 'system.menu.order_num': '显示顺序',
- 'system.menu.path': '路由地址',
- 'system.menu.component': '组件路径',
- 'system.menu.query': '路由参数',
- 'system.menu.is_frame': '是否为外链',
- 'system.menu.is_cache': '是否缓存',
- 'system.menu.menu_type': '菜单类型',
- 'system.menu.visible': '显示状态',
- 'system.menu.status': '菜单状态',
- 'system.menu.perms': '权限标识',
- 'system.menu.icon': '菜单图标',
- 'system.menu.create_by': '创建者',
- 'system.menu.create_time': '创建时间',
- 'system.menu.update_by': '更新者',
- 'system.menu.update_time': '更新时间',
- 'system.menu.remark': '备注',
+ 'system.menu.title': '菜单权限',
+ 'system.menu.menu_id': '菜单编号',
+ 'system.menu.menu_name': '菜单名称',
+ 'system.menu.parent_id': '上级菜单',
+ 'system.menu.order_num': '显示顺序',
+ 'system.menu.path': '路由地址',
+ 'system.menu.component': '组件路径',
+ 'system.menu.query': '路由参数',
+ 'system.menu.is_frame': '是否为外链',
+ 'system.menu.is_cache': '是否缓存',
+ 'system.menu.menu_type': '菜单类型',
+ 'system.menu.visible': '显示状态',
+ 'system.menu.status': '菜单状态',
+ 'system.menu.perms': '权限标识',
+ 'system.menu.icon': '菜单图标',
+ 'system.menu.create_by': '创建者',
+ 'system.menu.create_time': '创建时间',
+ 'system.menu.update_by': '更新者',
+ 'system.menu.update_time': '更新时间',
+ 'system.menu.remark': '备注',
};
diff --git a/react-ui/src/locales/zh-CN/system/notice.ts b/react-ui/src/locales/zh-CN/system/notice.ts
index ad55d516..b5c94982 100644
--- a/react-ui/src/locales/zh-CN/system/notice.ts
+++ b/react-ui/src/locales/zh-CN/system/notice.ts
@@ -1,13 +1,13 @@
export default {
- 'system.notice.title': '通知公告',
- 'system.notice.notice_id': '公告编号',
- 'system.notice.notice_title': '公告标题',
- 'system.notice.notice_type': '公告类型',
- 'system.notice.notice_content': '公告内容',
- 'system.notice.status': '公告状态',
- 'system.notice.create_by': '创建者',
- 'system.notice.create_time': '创建时间',
- 'system.notice.update_by': '更新者',
- 'system.notice.update_time': '更新时间',
- 'system.notice.remark': '备注',
+ 'system.notice.title': '通知公告',
+ 'system.notice.notice_id': '公告编号',
+ 'system.notice.notice_title': '公告标题',
+ 'system.notice.notice_type': '公告类型',
+ 'system.notice.notice_content': '公告内容',
+ 'system.notice.status': '公告状态',
+ 'system.notice.create_by': '创建者',
+ 'system.notice.create_time': '创建时间',
+ 'system.notice.update_by': '更新者',
+ 'system.notice.update_time': '更新时间',
+ 'system.notice.remark': '备注',
};
diff --git a/react-ui/src/locales/zh-CN/system/post.ts b/react-ui/src/locales/zh-CN/system/post.ts
index 40e589bc..c230a6c0 100644
--- a/react-ui/src/locales/zh-CN/system/post.ts
+++ b/react-ui/src/locales/zh-CN/system/post.ts
@@ -1,13 +1,13 @@
export default {
- 'system.post.title': '岗位信息',
- 'system.post.post_id': '岗位编号',
- 'system.post.post_code': '岗位编码',
- 'system.post.post_name': '岗位名称',
- 'system.post.post_sort': '显示顺序',
- 'system.post.status': '状态',
- 'system.post.create_by': '创建者',
- 'system.post.create_time': '创建时间',
- 'system.post.update_by': '更新者',
- 'system.post.update_time': '更新时间',
- 'system.post.remark': '备注',
+ 'system.post.title': '岗位信息',
+ 'system.post.post_id': '岗位编号',
+ 'system.post.post_code': '岗位编码',
+ 'system.post.post_name': '岗位名称',
+ 'system.post.post_sort': '显示顺序',
+ 'system.post.status': '状态',
+ 'system.post.create_by': '创建者',
+ 'system.post.create_time': '创建时间',
+ 'system.post.update_by': '更新者',
+ 'system.post.update_time': '更新时间',
+ 'system.post.remark': '备注',
};
diff --git a/react-ui/src/locales/zh-CN/system/role.ts b/react-ui/src/locales/zh-CN/system/role.ts
index e88f9794..3c3d10e1 100644
--- a/react-ui/src/locales/zh-CN/system/role.ts
+++ b/react-ui/src/locales/zh-CN/system/role.ts
@@ -1,21 +1,21 @@
export default {
- 'system.role.title': '角色信息',
- 'system.role.role_id': '角色编号',
- 'system.role.role_name': '角色名称',
- 'system.role.role_key': '权限字符',
- 'system.role.role_sort': '显示顺序',
- 'system.role.data_scope': '数据范围',
- 'system.role.menu_check_strictly': '菜单树选择项是否关联显示',
- 'system.role.dept_check_strictly': '部门树选择项是否关联显示',
- 'system.role.status': '角色状态',
- 'system.role.del_flag': '删除标志',
- 'system.role.create_by': '创建者',
- 'system.role.create_time': '创建时间',
- 'system.role.update_by': '更新者',
- 'system.role.update_time': '更新时间',
- 'system.role.remark': '备注',
- 'system.role.auth': '菜单权限',
- 'system.role.auth.user': '选择用户',
- 'system.role.auth.addUser': '添加用户',
- 'system.role.auth.cancelAll': '批量取消授权',
+ 'system.role.title': '角色信息',
+ 'system.role.role_id': '角色编号',
+ 'system.role.role_name': '角色名称',
+ 'system.role.role_key': '权限字符',
+ 'system.role.role_sort': '显示顺序',
+ 'system.role.data_scope': '数据范围',
+ 'system.role.menu_check_strictly': '菜单树选择项是否关联显示',
+ 'system.role.dept_check_strictly': '部门树选择项是否关联显示',
+ 'system.role.status': '角色状态',
+ 'system.role.del_flag': '删除标志',
+ 'system.role.create_by': '创建者',
+ 'system.role.create_time': '创建时间',
+ 'system.role.update_by': '更新者',
+ 'system.role.update_time': '更新时间',
+ 'system.role.remark': '备注',
+ 'system.role.auth': '菜单权限',
+ 'system.role.auth.user': '选择用户',
+ 'system.role.auth.addUser': '添加用户',
+ 'system.role.auth.cancelAll': '批量取消授权',
};
diff --git a/react-ui/src/locales/zh-CN/system/user.ts b/react-ui/src/locales/zh-CN/system/user.ts
index 7d676d03..66a9f8b1 100644
--- a/react-ui/src/locales/zh-CN/system/user.ts
+++ b/react-ui/src/locales/zh-CN/system/user.ts
@@ -1,31 +1,31 @@
export default {
- 'system.user.title': '用户信息',
- 'system.user.user_id': '用户编号',
- 'system.user.dept_name': '部门',
- 'system.user.user_name': '用户账号',
- 'system.user.nick_name': '用户昵称',
- 'system.user.user_type': '用户类型',
- 'system.user.email': '用户邮箱',
- 'system.user.phonenumber': '手机号码',
- 'system.user.sex': '用户性别',
- 'system.user.avatar': '头像地址',
- 'system.user.password': '密码',
- 'system.user.status': '帐号状态',
- 'system.user.del_flag': '删除标志',
- 'system.user.login_ip': '最后登录IP',
- 'system.user.login_date': '最后登录时间',
- 'system.user.create_by': '创建者',
- 'system.user.create_time': '创建时间',
- 'system.user.update_by': '更新者',
- 'system.user.update_time': '更新时间',
- 'system.user.remark': '备注',
- 'system.user.post': '岗位',
- 'system.user.role': '角色',
- 'system.user.auth.role': '分配角色',
- 'system.user.reset.password': '密码重置',
- 'system.user.modify_info': '编辑用户信息',
- 'system.user.old_password': '旧密码',
- 'system.user.new_password': '新密码',
- 'system.user.confirm_password': '确认密码',
- 'system.user.modify_avatar': '修改头像',
+ 'system.user.title': '用户信息',
+ 'system.user.user_id': '用户编号',
+ 'system.user.dept_name': '部门',
+ 'system.user.user_name': '用户账号',
+ 'system.user.nick_name': '用户昵称',
+ 'system.user.user_type': '用户类型',
+ 'system.user.email': '用户邮箱',
+ 'system.user.phonenumber': '手机号码',
+ 'system.user.sex': '用户性别',
+ 'system.user.avatar': '头像地址',
+ 'system.user.password': '密码',
+ 'system.user.status': '帐号状态',
+ 'system.user.del_flag': '删除标志',
+ 'system.user.login_ip': '最后登录IP',
+ 'system.user.login_date': '最后登录时间',
+ 'system.user.create_by': '创建者',
+ 'system.user.create_time': '创建时间',
+ 'system.user.update_by': '更新者',
+ 'system.user.update_time': '更新时间',
+ 'system.user.remark': '备注',
+ 'system.user.post': '岗位',
+ 'system.user.role': '角色',
+ 'system.user.auth.role': '分配角色',
+ 'system.user.reset.password': '密码重置',
+ 'system.user.modify_info': '编辑用户信息',
+ 'system.user.old_password': '旧密码',
+ 'system.user.new_password': '新密码',
+ 'system.user.confirm_password': '确认密码',
+ 'system.user.modify_avatar': '修改头像',
};
diff --git a/react-ui/src/pages/Dataset/datasetIntro.jsx b/react-ui/src/pages/Dataset/datasetIntro.jsx
index 05b01e31..e3cf7baf 100644
--- a/react-ui/src/pages/Dataset/datasetIntro.jsx
+++ b/react-ui/src/pages/Dataset/datasetIntro.jsx
@@ -1,88 +1,95 @@
-
-import React ,{useEffect,useState,useRef}from 'react';
-import Styles from './index.less'
-import { Input, Space ,Button,Tabs,Pagination,Modal, Form,message, Radio,Select,Table,Upload} from 'antd';
-import { PlusOutlined,PlusCircleOutlined, DeleteOutlined,UploadOutlined, ExclamationCircleOutlined, DownOutlined, EditOutlined ,CopyOutlined} from '@ant-design/icons';
-import {getDatasetList,getDatasetById,getDatasetVersionsById,getDatasetVersionIdList,deleteDatasetVersion,addDatasetVersionDetail,exportDataset} from '@/services/dataset/index.js'
-import { useParams } from 'react-router-dom'
-import {downLoadZip} from '@/utils/downloadfile'
-const { Search } = Input;
+import { getAccessToken } from '@/access';
+import {
+ addDatasetVersionDetail,
+ deleteDatasetVersion,
+ getDatasetById,
+ getDatasetVersionIdList,
+ getDatasetVersionsById,
+} from '@/services/dataset/index.js';
+import { downLoadZip } from '@/utils/downloadfile';
+import {
+ DeleteOutlined,
+ DownloadOutlined,
+ PlusCircleOutlined,
+ UploadOutlined,
+} from '@ant-design/icons';
+import { Button, Form, Input, Modal, Select, Table, Tabs, Upload, message } from 'antd';
import moment from 'moment';
-import { getAccessToken } from '@/access';
+import { useEffect, useRef, useState } from 'react';
+import { useParams } from 'react-router-dom';
+import Styles from './index.less';
+const { Search } = Input;
const { TabPane } = Tabs;
-const Dataset= React.FC = () => {
+const Dataset = () => {
const props = {
action: '/api/mmp/dataset/upload',
// headers: {
// 'X-Requested-With': null
// },
headers: {
- Authorization:getAccessToken(),
- 'X-Requested-With': null
-
+ Authorization: getAccessToken(),
+ 'X-Requested-With': null,
},
onChange({ file, fileList }) {
if (file.status !== 'uploading') {
console.log(file, fileList);
- setFormList(fileList.map(item=>{
- return {
- ...form.getFieldsValue(),
- dataset_id:locationParams.id,
- file_name:item.response.data[0].fileName,
- file_size:item.response.data[0].fileSize,
- url:item.response.data[0].url,
- }
- }))
+ setFormList(
+ fileList.map((item) => {
+ return {
+ ...form.getFieldsValue(),
+ dataset_id: locationParams.id,
+ file_name: item.response.data[0].fileName,
+ file_size: item.response.data[0].fileSize,
+ url: item.response.data[0].url,
+ };
+ }),
+ );
}
},
- defaultFileList: [
- ],
+ defaultFileList: [],
};
const [form] = Form.useForm();
- const [formList,setFormList]=useState([])
+ const [formList, setFormList] = useState([]);
const [dialogTitle, setDialogTitle] = useState('新建版本');
- const [isModalOpen,setIsModalOpen]=useState(false)
- const [datasetDetailObj,setDatasetDetailObj]=useState({
- });
- const [version,setVersion]=useState('')
+ const [isModalOpen, setIsModalOpen] = useState(false);
+ const [datasetDetailObj, setDatasetDetailObj] = useState({});
+ const [version, setVersion] = useState('');
const [versionList, setVersionList] = useState([]);
- const locationParams =useParams () //新版本获取路由参数接口
- console.log(locationParams);
+ const locationParams = useParams(); //新版本获取路由参数接口
const [wordList, setWordList] = useState([]);
- const getDatasetByDetail=()=>{
- getDatasetById(locationParams.id).then(ret=>{
+ const [activeTabKey, setActiveTabKey] = useState('1');
+ const getDatasetByDetail = () => {
+ getDatasetById(locationParams.id).then((ret) => {
console.log(ret);
- if(ret.code==200){
- setDatasetDetailObj(ret.data)
- }
- })
- }
- const getDatasetVersionList=()=>{
- getDatasetVersionsById(locationParams.id).then(ret=>{
+ setDatasetDetailObj(ret.data);
+ });
+ };
+ const getDatasetVersionList = () => {
+ getDatasetVersionsById(locationParams.id).then((ret) => {
console.log(ret);
- if(ret.code==200&&ret.data&&ret.data.length>0){
- setVersionList(ret.data.map(item=>{
- return {
- 'label':item,
- 'value':item
- }
- }))
+ if (ret.data && ret.data.length > 0) {
+ setVersionList(
+ ret.data.map((item) => {
+ return {
+ label: item,
+ value: item,
+ };
+ }),
+ );
}
- })
- }
- useEffect(()=>{
- getDatasetByDetail()
- getDatasetVersionList()
- return ()=>{
-
- }
- },[])
+ });
+ };
+ useEffect(() => {
+ getDatasetByDetail();
+ getDatasetVersionList();
+ return () => {};
+ }, []);
const showModal = () => {
- form.resetFields()
- form.setFieldsValue({name:datasetDetailObj.name})
-
- setDialogTitle('创建新版本')
+ form.resetFields();
+ form.setFieldsValue({ name: datasetDetailObj.name });
+
+ setDialogTitle('创建新版本');
setIsModalOpen(true);
};
const handleCancel = () => {
@@ -91,80 +98,74 @@ const Dataset= React.FC = () => {
const handleExport = async () => {
const hide = message.loading('正在下载');
hide();
- downLoadZip(`/api/mmp/dataset/downloadAllFiles`,{dataset_id:locationParams.id,version})
+ downLoadZip(`/api/mmp/dataset/downloadAllFiles`, { dataset_id: locationParams.id, version });
};
- const deleteDataset=()=>{
+ const deleteDataset = () => {
Modal.confirm({
title: '删除',
content: '确定删除数据集版本?',
okText: '确认',
cancelText: '取消',
- onOk: () => {
- deleteDatasetVersion({dataset_id:locationParams.id,version}).then(ret=>{
- if(ret.code==200){
- message.success('删除成功')
- getDatasetVersions({version,dataset_id:locationParams.id})
- }
- else{
- message.error(ret.msg)
- }
+ onOk: () => {
+ deleteDatasetVersion({ dataset_id: locationParams.id, version }).then((ret) => {
+ message.success('删除成功');
+ getDatasetVersions({ version, dataset_id: locationParams.id });
});
},
});
- }
- const onFinish = (values) => {
- addDatasetVersionDetail(formList).then(ret=>{
- console.log(ret);
- getDatasetVersionList()
- setIsModalOpen(false);
- })
- };
- const getDatasetVersions=(params)=>{
- getDatasetVersionIdList(params).then(ret=>{
+ };
+ const onFinish = (values) => {
+ addDatasetVersionDetail(formList).then((ret) => {
console.log(ret);
- if(ret.code==200){
- setWordList(ret.data)
- }
- })
- }
- const handleChange=(value)=>{
+ getDatasetVersionList();
+ setIsModalOpen(false);
+ });
+ };
+ const getDatasetVersions = (params) => {
+ getDatasetVersionIdList(params).then((res) => {
+ setWordList(
+ res.data.map((v) => ({
+ ...v,
+ key: v.id,
+ })),
+ );
+ });
+ };
+ const handleChange = (value) => {
console.log(value);
- if(value){
- getDatasetVersions({version:value,dataset_id:locationParams.id})
- setVersion(value)
- }
- else{
- setVersion(null)
+ if (value) {
+ getDatasetVersions({ version: value, dataset_id: locationParams.id });
+ setVersion(value);
+ } else {
+ setVersion(null);
}
- }
+ };
const onFinishFailed = (errorInfo) => {
console.log('Failed:', errorInfo);
};
- const downloadAlone=(e,record)=>{
+ const downloadAlone = (e, record) => {
console.log(record);
const hide = message.loading('正在下载');
hide();
- downLoadZip(`/api/mmp//dataset/download/${record.id}`)
- }
+ downLoadZip(`/api/mmp/dataset/download/${record.id}`);
+ };
const columns = [
- // {
- // title: '序号',
- // dataIndex: 'index',
- // key: 'index',
- // width: 80,
- // render(text, record, index) {
- // return (
- // {(pageOption.current.page - 1) * 10 + index + 1}
- // )
- // }
- // // render: (text, record, index) => `${((curPage-1)*10)+(index+1)}`,
- // },
+ {
+ title: '序号',
+ dataIndex: 'index',
+ key: 'index',
+ width: 80,
+ render(text, record, index) {
+ return {(pageOption.current.page - 1) * 10 + index + 1};
+ },
+ // render: (text, record, index) => `${((curPage-1)*10)+(index+1)}`,
+ },
{
title: '文件名称',
dataIndex: 'file_name',
key: 'file_name',
- render: (text,record) => downloadAlone(e,record)}>{text},
+ render: (text, record) => downloadAlone(e, record)}>{text},
},
{
title: '版本号',
@@ -182,80 +183,128 @@ const Dataset= React.FC = () => {
key: 'update_time',
render: (text) => {moment(text).format('YYYY-MM-DD HH:mm:ss')},
},
+ {
+ title: '操作',
+ dataIndex: 'option',
+ width: '100px',
+ key: 'option',
+ render: (_, record) => [
+ }
+ onClick={(e) => downloadAlone(e, record)}
+ >
+ 下载
+ ,
+ ],
+ },
];
- const pageOption = useRef({page: 1,size: 10})
+ const pageOption = useRef({ page: 1, size: 10 });
// 当前页面切换
const paginationChange = async (current, size) => {
- console.log('page', current, size)
- pageOption.current={
- page:current,
- size:size
- }
+ console.log('page', current, size);
+ pageOption.current = {
+ page: current,
+ size: size,
+ };
// getList()
- }
- return (
-
- {datasetDetailObj.name}
-
- {datasetDetailObj.data_tag||'...'}
+ };
+ return (
+
+
+ {datasetDetailObj.name}
+
+ {datasetDetailObj.data_tag || '...'}
{datasetDetailObj.data_type}
{/* English */}
-
-
-
-
-
- 简介
- {datasetDetailObj.description}
-
-
-
- 数据集文件列表
-
-
- 版本号:
-
- }>
- 创建新版本
-
-
-
- }>
- 删除
-
- }>
- 下载
-
-
-
-
-
-
-
-
-
- {dialogTitle}
- } open={isModalOpen} className={Styles.modal} okButtonProps={{
- htmlType: 'submit',
- form: 'form',
- }} onCancel={handleCancel}>
+
+
+ setActiveTabKey(key)}>
+
+ 简介
+ {datasetDetailObj.description}
+
+
+
+ 数据集文件列表
+
+
+ 版本号:
+
+ }
+ >
+ 创建新版本
+
+
+
+ }
+ >
+ 删除
+
+ }
+ >
+ 下载
+
+
+
+
+ {wordList.length > 0 ? wordList[0].description : null}
+
+
+
+
+
+
+
+
+ {dialogTitle}
+
+ }
+ open={isModalOpen}
+ className={Styles.modal}
+ okButtonProps={{
+ htmlType: 'submit',
+ form: 'form',
+ }}
+ onCancel={handleCancel}
+ >
-
+
+
+
+
+
+
+
+ }
+ >
+ 上传文件
+
+
-
-
- }>上传文件
-
-
-
- )
+
+ );
};
-export default Dataset;
\ No newline at end of file
+export default Dataset;
diff --git a/react-ui/src/pages/Dataset/index.jsx b/react-ui/src/pages/Dataset/index.jsx
index 7a8bf2eb..b2aeda48 100644
--- a/react-ui/src/pages/Dataset/index.jsx
+++ b/react-ui/src/pages/Dataset/index.jsx
@@ -1,84 +1,74 @@
-
-import React ,{useEffect,useState}from 'react';
-import Styles from './index.less'
-import { Input, Space ,Button,Tabs,Pagination,Modal, Form,message, Radio,} from 'antd';
-import { PlusOutlined,PlusCircleOutlined, DeleteOutlined, ExclamationCircleOutlined, DownOutlined, EditOutlined ,CopyOutlined} from '@ant-design/icons';
-import {getDatasetList} from '@/services/dataset/index.js'
+import { getDatasetList } from '@/services/dataset/index.js';
+import { Form, Input, Tabs } from 'antd';
+import React, { useEffect, useState } from 'react';
+import { useNavigate } from 'react-router-dom';
+import Styles from './index.less';
+import PersonalData from './personalData';
+import PublicData from './publicData';
const { Search } = Input;
-import { useNavigate} from 'react-router-dom';
-import moment from 'moment';
const { TabPane } = Tabs;
-import PublicData from './publicData';
-import PersonalData from './personalData'
-const leftdataList=[1,2,3]
+const leftdataList = [1, 2, 3];
-const Dataset= React.FC = () => {
- const [queryFlow,setQueryFlow]=useState({
- page:0,
- size:10,
- name:null
+const Dataset = (React.FC = () => {
+ const [queryFlow, setQueryFlow] = useState({
+ page: 0,
+ size: 10,
+ name: null,
});
- const navgite=useNavigate();
- const [isModalOpen,setIsModalOpen]=useState(false)
- const [datasetList,setDatasetList]=useState([]);
- const [total,setTotal]=useState(0);
+ const navgite = useNavigate();
+ const [isModalOpen, setIsModalOpen] = useState(false);
+ const [datasetList, setDatasetList] = useState([]);
+ const [total, setTotal] = useState(0);
const [form] = Form.useForm();
const [dialogTitle, setDialogTitle] = useState('新建数据');
- const getDatasetlist=()=>{
- getDatasetList(queryFlow).then(ret=>{
+ const getDatasetlist = () => {
+ getDatasetList(queryFlow).then((ret) => {
console.log(ret);
- if(ret.code==200){
- setDatasetList(ret.data.content)
- setTotal(ret.data.totalElements)
+ if (ret.code == 200) {
+ setDatasetList(ret.data.content);
+ setTotal(ret.data.totalElements);
}
- })
- }
+ });
+ };
const showModal = () => {
- form.resetFields()
- setDialogTitle('新建数据集')
+ form.resetFields();
+ setDialogTitle('新建数据集');
setIsModalOpen(true);
};
const handleOk = () => {
- console.log(1111);
+ console.log(1111);
setIsModalOpen(false);
};
const handleCancel = () => {
setIsModalOpen(false);
};
- const onFinish = (values) => {
-
- };
- const routeToIntro=(e,record)=>{
- e.stopPropagation()
- navgite({pathname:'/dataset/datasetIntro' });
-}
+ const onFinish = (values) => {};
+ const routeToIntro = (e, record) => {
+ e.stopPropagation();
+ navgite({ pathname: '/dataset/datasetIntro' });
+ };
const onFinishFailed = (errorInfo) => {
console.log('Failed:', errorInfo);
};
- useEffect(()=>{
-
- getDatasetlist()
- return ()=>{
-
- }
- },[])
- return ()
-};
-export default Dataset;
\ No newline at end of file
+ useEffect(() => {
+ getDatasetlist();
+ return () => {};
+ }, []);
+ return (
+
+ );
+});
+export default Dataset;
diff --git a/react-ui/src/pages/Dataset/index.less b/react-ui/src/pages/Dataset/index.less
index a3994d1d..320ca827 100644
--- a/react-ui/src/pages/Dataset/index.less
+++ b/react-ui/src/pages/Dataset/index.less
@@ -1,303 +1,297 @@
-.datasetTopBox{
+.datasetTopBox {
+ display: flex;
+ align-items: center;
+ width: 100%;
+ height: 49px;
+ padding: 0 30px;
+ padding-right: 30px;
+ background-image: url(/assets/images/pipeline-back.png);
+ background-size: 100% 100%;
+}
+.datasetIntroTopBox {
+ display: flex;
+ flex-direction: column;
+ justify-content: space-between;
+ width: 100%;
+ height: 110px;
+ margin-bottom: 10px;
+ padding: 25px 30px;
+ background-image: url(/assets/images/dataset-back.png);
+ background-size: 100% 100%;
+ .smallTagBox {
display: flex;
align-items: center;
- padding-right: 30px;
- width: 100%;
- height: 49px;
- background-size: 100% 100%;
- background-image: url(/assets/images/pipeline-back.png);
- padding: 0 30px;
+ color: #1664ff;
+ font-size: 14px;
+ .tagItem {
+ margin-right: 20px;
+ padding: 4px 10px;
+ background: rgba(22, 100, 255, 0.1);
+ border-radius: 4px;
+ }
+ }
}
-.datasetIntroTopBox{
+.dataListBox {
+ padding: 20px 30px;
+ color: #1d1d20;
+ font-size: 16px;
+ background: #ffffff;
+ border-radius: 10px;
+ box-shadow: 0px 2px 12px rgba(180, 182, 191, 0.09);
+ .dataButtonList {
display: flex;
- flex-direction: column;
+ align-items: center;
justify-content: space-between;
- width: 100%;
- height: 110px;
- background-size: 100% 100%;
- background-image: url(/assets/images/dataset-back.png);
- margin-bottom: 10px;
- padding: 25px 30px;
- .smallTagBox{
- display: flex;
- align-items: center;
- color:#1664ff;
- font-size:14px;
- .tagItem{
- padding: 4px 10px;
- background: rgba(22, 100, 255, 0.1);
- border-radius:4px;
- margin-right: 20px;
- }
- }
-}
-.dataListBox{
- padding: 20px 30px;
- background:#ffffff;
- border-radius:10px;
- box-shadow:0px 2px 12px rgba(180, 182, 191, 0.09);
- color:#1d1d20;
- font-size:16px;
- .dataButtonList{
- display: flex;
- justify-content: space-between;
- align-items: center;
- height: 32px;
- margin: 24px 0 30px 0;
- color:#575757;
- font-size:16px;
- }
+ height: 32px;
+ margin: 24px 0 30px 0;
+ color: #575757;
+ font-size: 16px;
+ }
}
-.datasetIntroCneterBox{
- height: 77vh;
- padding: 20px 30px;
- background:#ffffff;
- border-radius:10px;
- box-shadow:0px 2px 12px rgba(180, 182, 191, 0.09);
+.datasetIntroCneterBox {
+ height: 77vh;
+ padding: 20px 30px;
+ background: #ffffff;
+ border-radius: 10px;
+ box-shadow: 0px 2px 12px rgba(180, 182, 191, 0.09);
}
-.datasetIntroTitle{
- color:#1d1d20;
- font-size:15px;
- margin: 37px 0 10px 0;
+.datasetIntroTitle {
+ margin: 37px 0 10px 0;
+ color: #1d1d20;
+ font-size: 15px;
}
-.datasetIntroText{
- color:#575757;
- font-size:14px;
- margin-bottom: 30px;
+.datasetIntroText {
+ margin-bottom: 30px;
+ color: #575757;
+ font-size: 14px;
}
-.datasetBox{
- background:#f9fafb;
- font-family: 'Alibaba';
- :global{
- .ant-tabs-top >.ant-tabs-nav{
- margin: 0;
- }
- .ant-pagination{
- text-align: right;
- }
-
+.datasetBox {
+ font-family: 'Alibaba';
+ background: #f9fafb;
+ :global {
+ .ant-tabs-top > .ant-tabs-nav {
+ margin: 0;
}
+ .ant-pagination {
+ text-align: right;
+ }
+ }
}
-.datasetAllBox{
- :global{
- .ant-tabs-nav .ant-tabs-nav-wrap{
- margin: -48px 0 0 30px;
- }
-
+.datasetAllBox {
+ :global {
+ .ant-tabs-nav .ant-tabs-nav-wrap {
+ margin: -48px 0 0 30px;
}
+ }
}
-.plusButton{
- margin: 0 18px 0 20px;
- background:rgba(22, 100, 255, 0.06);
- border:1px solid;
- border-color:rgba(22, 100, 255, 0.11);
- border-radius:4px;
- color:#1d1d20;
- font-size:14px;
- font-family: 'Alibaba';
+.plusButton {
+ margin: 0 18px 0 20px;
+ color: #1d1d20;
+ font-size: 14px;
+ font-family: 'Alibaba';
+ background: rgba(22, 100, 255, 0.06);
+ border: 1px solid;
+ border-color: rgba(22, 100, 255, 0.11);
+ border-radius: 4px;
}
-.plusButton:hover{
- background:rgba(22, 100, 255, 0.06)!important;
- border:1px solid!important;
- border-color:rgba(22, 100, 255, 0.11)!important;
- color:#1d1d20!important;
+.plusButton:hover {
+ color: #1d1d20 !important;
+ background: rgba(22, 100, 255, 0.06) !important;
+ border: 1px solid !important;
+ border-color: rgba(22, 100, 255, 0.11) !important;
}
-.datasetCneterBox{
- display: flex;
- justify-content: space-between;
- height: 85vh;
- width: 100%;
- :global{
- .ant-btn{
- color:#1d1d20;
- font-size:14px;
- }
+.datasetCneterBox {
+ display: flex;
+ justify-content: space-between;
+ width: 100%;
+ height: 85vh;
+ :global {
+ .ant-btn {
+ color: #1d1d20;
+ font-size: 14px;
}
- .datasetCneterLeftBox{
- width:340px;
- height:100%;
- background:#ffffff;
- box-shadow:0px 3px 6px rgba(146, 146, 146, 0.09);
- margin-right: 10px;
- padding-top: 15px;
- .custTab{
- display: flex;
- border-bottom: 1px solid #e0eaff;
- height: 32px;
- .tabItem{
- width: 52px;
- height: 100%;
- text-align: center;
- color:#808080;
- font-size:15px;
- cursor: pointer;
- }
+ }
+ .datasetCneterLeftBox {
+ width: 340px;
+ height: 100%;
+ margin-right: 10px;
+ padding-top: 15px;
+ background: #ffffff;
+ box-shadow: 0px 3px 6px rgba(146, 146, 146, 0.09);
+ .custTab {
+ display: flex;
+ height: 32px;
+ border-bottom: 1px solid #e0eaff;
+ .tabItem {
+ width: 52px;
+ height: 100%;
+ color: #808080;
+ font-size: 15px;
+ text-align: center;
+ cursor: pointer;
+ }
+ }
+ .leftContentBox {
+ max-height: 80vh;
+ padding: 15px 20px;
+ overflow-x: hidden;
+ overflow-y: auto;
+ .itemTitle {
+ margin-bottom: 15px;
+ color: #1d1d20;
+ font-size: 14px;
+ }
+ .itemBox {
+ display: flex;
+ flex-wrap: wrap;
+ align-content: start;
+ width: 110%;
+ .messageBox {
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ justify-content: space-between;
+ width: 92px;
+ height: 62px;
+ margin: 0 12px 20px 0;
+ padding: 11px 0px 7px 0px;
+ color: #1d1d20;
+ font-size: 12px;
+ border: 1px solid;
+ border-color: rgba(22, 100, 255, 0.05);
+ border-radius: 4px;
+ cursor: pointer;
+ .ptIcon {
+ display: block;
+ }
+ .hoverIcon {
+ display: none;
+ }
+ .messageText {
+ width: 65px;
+ overflow: hidden;
+ white-space: nowrap;
+ text-align: center;
+ text-overflow: ellipsis;
+ }
}
- .leftContentBox{
- max-height: 80vh;
- overflow-y: auto;
- overflow-x: hidden;
- padding: 15px 20px;
- .itemTitle{
- color:#1d1d20;
- font-size:14px;
- margin-bottom: 15px;
- }
- .itemBox{
- width: 110%;
- display: flex;
- flex-wrap: wrap;
- align-content: start;
- .messageBox{
- display: flex;
- flex-direction: column;
- justify-content: space-between;
- align-items: center;
- cursor: pointer;
- width:92px;
- height:62px;
- border:1px solid;
- border-color:rgba(22, 100, 255, 0.05);
- border-radius:4px;
- margin: 0 12px 20px 0;
- padding: 11px 0px 7px 0px;
- color:#1d1d20;
- font-size:12px;
- .ptIcon{
- display: block;
- }
- .hoverIcon{
- display: none;
- }
- .messageText{
- width: 65px;
- text-align: center;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- }
- }
- .messageBox:hover{
- background:rgba(22, 100, 255, 0.03);
- border:1px solid;
- border-color:#1664ff;
- .ptIcon{
- display: none;
- }
- .hoverIcon{
- display: block;
- }
- }
- .active{
- background:rgba(22, 100, 255, 0.03)!important;
- border:1px solid!important;
- border-color:#1664ff!important;
- .ptIcon{
- display: none!important;
- }
- .hoverIcon{
- display: block!important;
- }
- }
- }
+ .messageBox:hover {
+ background: rgba(22, 100, 255, 0.03);
+ border: 1px solid;
+ border-color: #1664ff;
+ .ptIcon {
+ display: none;
+ }
+ .hoverIcon {
+ display: block;
+ }
}
+ .active {
+ background: rgba(22, 100, 255, 0.03) !important;
+ border: 1px solid !important;
+ border-color: #1664ff !important;
+ .ptIcon {
+ display: none !important;
+ }
+ .hoverIcon {
+ display: block !important;
+ }
+ }
+ }
}
+ }
- .datasetCneterRightBox{
- display: flex;
- flex-direction: column;
- padding: 22px 30px 26px 30px;
- flex: 1;
- height:100%;
- background:#ffffff;
- box-shadow:0px 3px 6px rgba(146, 146, 146, 0.09);
- .dataSource{
- display: flex;
- justify-content: space-between;
- align-items: center;
- height: 32px;
- margin-bottom: 30px;
- color:rgba(29, 29, 32, 0.8);
- font-size:15px;
+ .datasetCneterRightBox {
+ display: flex;
+ flex: 1;
+ flex-direction: column;
+ height: 100%;
+ padding: 22px 30px 26px 30px;
+ background: #ffffff;
+ box-shadow: 0px 3px 6px rgba(146, 146, 146, 0.09);
+ .dataSource {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ height: 32px;
+ margin-bottom: 30px;
+ color: rgba(29, 29, 32, 0.8);
+ font-size: 15px;
+ }
+ .dataContent {
+ display: flex;
+ flex: 1;
+ flex-wrap: wrap;
+ align-content: flex-start;
+ width: 100%;
+ .dataItem {
+ position: relative;
+ width: 32%;
+ height: 66px;
+ margin: 0 15px 18px 0;
+ background: rgba(128, 128, 128, 0.05);
+ border-radius: 8px;
+ box-shadow: 0px 0px 12px rgba(75, 84, 137, 0.05);
+ cursor: pointer;
+ .itemText {
+ position: absolute;
+ top: 10px;
+ left: 20px;
+ color: #1d1d20;
+ font-size: 15px;
+ }
+ .itemTime {
+ position: absolute;
+ bottom: 10px;
+ left: 20px;
+ color: #808080;
+ font-size: 14px;
}
- .dataContent{
- width: 100%;
- flex: 1;
- display: flex;
- flex-wrap: wrap;
- align-content: flex-start;
- .dataItem{
- width: 32%;
- margin: 0 15px 18px 0;
- height:66px;
- position: relative;
- background:rgba(128, 128, 128, 0.05);
- border-radius:8px;
- box-shadow:0px 0px 12px rgba(75, 84, 137, 0.05);
- cursor: pointer;
- .itemText{
- position: absolute;
- left: 20px;
- top: 10px;
- color:#1d1d20;
- font-size:15px;
-
- }
- .itemTime{
- position: absolute;
- left: 20px;
- bottom: 10px;
- color:#808080;
- font-size:14px;
- }
- .itemIcon{
- position: absolute;
- right: 20px;
- bottom: 10px;
- color:#808080;
- font-size:14px;
- }
- }
+ .itemIcon {
+ position: absolute;
+ right: 20px;
+ bottom: 10px;
+ color: #808080;
+ font-size: 14px;
}
+ }
}
+ }
}
.modal {
- :global {
- .ant-modal-content {
- background:linear-gradient(180deg,#cfdfff 0%,#d4e2ff 9.77%,#ffffff 40%,#ffffff 100%);
- border-radius:21px;
- padding: 20px 67px;
- width: 825px;
-
- }
- .ant-modal-header{
- background-color: transparent;
- margin: 20px 0;
- }
- .ant-input{
- border-color:#e6e6e6;
- height: 40px;
-
- }
- .ant-form-item .ant-form-item-label >label{
- color:rgba(29, 29, 32, 0.8);
- }
- .ant-modal-footer{
- margin: 40px 0 30px 0;
- display: flex;
- justify-content: center;
- }
- .ant-btn{
- width:110px;
- height:40px;
- font-size:18px;
- background:rgba(22, 100, 255, 0.06);
- border-radius:10px;
- border-color: transparent;
-
- }
- .ant-btn-primary{
- background:#1664ff;
- }
+ :global {
+ .ant-modal-content {
+ width: 825px;
+ padding: 20px 67px;
+ background: linear-gradient(180deg, #cfdfff 0%, #d4e2ff 9.77%, #ffffff 40%, #ffffff 100%);
+ border-radius: 21px;
+ }
+ .ant-modal-header {
+ margin: 20px 0;
+ background-color: transparent;
+ }
+ .ant-input {
+ height: 40px;
+ border-color: #e6e6e6;
}
-}
\ No newline at end of file
+ .ant-form-item .ant-form-item-label > label {
+ color: rgba(29, 29, 32, 0.8);
+ }
+ .ant-modal-footer {
+ display: flex;
+ justify-content: center;
+ margin: 40px 0 30px 0;
+ }
+ .ant-btn {
+ width: 110px;
+ height: 40px;
+ font-size: 18px;
+ background: rgba(22, 100, 255, 0.06);
+ border-color: transparent;
+ border-radius: 10px;
+ }
+ .ant-btn-primary {
+ background: #1664ff;
+ }
+ }
+}
diff --git a/react-ui/src/pages/Dataset/personalData.jsx b/react-ui/src/pages/Dataset/personalData.jsx
index 5ee5d3c6..ac04fd40 100644
--- a/react-ui/src/pages/Dataset/personalData.jsx
+++ b/react-ui/src/pages/Dataset/personalData.jsx
@@ -1,240 +1,302 @@
-
-import React ,{useEffect,useState}from 'react';
-import Styles from './index.less'
-import './index.less'
-import { Input, Space ,Button,Tabs,Pagination,Modal, Form,message, Radio,Select,Upload } from 'antd';
-import { PlusOutlined,PlusCircleOutlined,UploadOutlined , DeleteOutlined, ExclamationCircleOutlined, DownOutlined, EditOutlined ,CopyOutlined} from '@ant-design/icons';
-import {getDatasetList,addDatesetAndVesion,getAssetIcon} from '@/services/dataset/index.js'
-import { getDictSelectOption } from "@/services/system/dict";
-const { Search } = Input;
-import { useNavigate} from 'react-router-dom';
+import { getAccessToken } from '@/access';
+import { addDatesetAndVesion, getAssetIcon, getDatasetList } from '@/services/dataset/index.js';
+import { getDictSelectOption } from '@/services/system/dict';
+import { PlusCircleOutlined, UploadOutlined } from '@ant-design/icons';
+import { Button, Form, Input, Modal, Pagination, Radio, Select, Upload } from 'antd';
import moment from 'moment';
-import axios from 'axios'
-import { getAccessToken } from '@/access';
-const leftdataList=[1,2,3]
-
-const PublicData= React.FC = () => {
+import React, { useEffect, useState } from 'react';
+import { useNavigate } from 'react-router-dom';
+import './index.less';
+import Styles from './index.less';
+const { Search } = Input;
+const leftdataList = [1, 2, 3];
+const PublicData = (React.FC = () => {
const props = {
action: '/api/mmp/dataset/upload',
// headers: {
// 'X-Requested-With': null
// },
headers: {
- Authorization:getAccessToken(),
- 'X-Requested-With': null
-
+ Authorization: getAccessToken(),
+ 'X-Requested-With': null,
},
onChange({ file, fileList }) {
if (file.status !== 'uploading') {
console.log(file, fileList);
- form.setFieldsValue({dataset_version_vos:fileList.map(item=>item.response.data[0])})
+ form.setFieldsValue({ dataset_version_vos: fileList.map((item) => item.response.data[0]) });
}
},
- defaultFileList: [
- ],
+ defaultFileList: [],
};
- const [queryFlow,setQueryFlow]=useState({
- page:0,
- size:10,
- name:null,
- available_range:0,
+ const [queryFlow, setQueryFlow] = useState({
+ page: 0,
+ size: 10,
+ name: null,
+ available_range: 0,
+ });
+ const [iconParams, setIconParams] = useState({
+ name: null,
+ page: 0,
+ size: 10000,
});
- const [iconParams,setIconParams]=useState({
- name:null,
- page:0,
- size:10000
- })
- const [activeType,setActiveType]=useState(null)
- const [activeTag,setActiveTag]=useState(null)
- const [datasetTypeList,setDatasetTypeList]=useState([])
- const [datasetDirectionList,setDatasetDirectionList]=useState([])
- const navgite=useNavigate();
- const [clusterOptions,setClusterOptions]=useState([])
- const [isModalOpen,setIsModalOpen]=useState(false)
- const [datasetList,setDatasetList]=useState([]);
- const [total,setTotal]=useState(0);
+ const [activeType, setActiveType] = useState(null);
+ const [activeTag, setActiveTag] = useState(null);
+ const [datasetTypeList, setDatasetTypeList] = useState([]);
+ const [datasetDirectionList, setDatasetDirectionList] = useState([]);
+ const navgite = useNavigate();
+ const [clusterOptions, setClusterOptions] = useState([]);
+ const [isModalOpen, setIsModalOpen] = useState(false);
+ const [datasetList, setDatasetList] = useState([]);
+ const [total, setTotal] = useState(0);
const [form] = Form.useForm();
const [dialogTitle, setDialogTitle] = useState('新建数据');
- const getDatasetlist=(queryFlow)=>{
- getDatasetList(queryFlow).then(ret=>{
+ const getDatasetlist = (queryFlow) => {
+ getDatasetList(queryFlow).then((ret) => {
console.log(ret);
- if(ret.code==200){
- setDatasetList(ret.data.content)
- setTotal(ret.data.totalElements)
+ if (ret.code == 200) {
+ setDatasetList(ret.data.content);
+ setTotal(ret.data.totalElements);
}
- })
- }
+ });
+ };
const showModal = () => {
- form.resetFields()
- setDialogTitle('新建数据集')
+ form.resetFields();
+ setDialogTitle('新建数据集');
setIsModalOpen(true);
};
- const getAssetIconList=(params)=>{
- getAssetIcon(params).then(ret=>{
+ const getAssetIconList = (params) => {
+ getAssetIcon(params).then((ret) => {
console.log(ret);
- if(ret.code==200&&ret.data.content&&ret.data.content.length>0){
- setDatasetTypeList(ret.data.content.filter(item=>item.category_id==1))
- setDatasetDirectionList(ret.data.content.filter(item=>item.category_id==2))
+ if (ret.code == 200 && ret.data.content && ret.data.content.length > 0) {
+ setDatasetTypeList(ret.data.content.filter((item) => item.category_id == 1));
+ setDatasetDirectionList(ret.data.content.filter((item) => item.category_id == 2));
+ } else {
+ setDatasetTypeList([]);
+ setDatasetDirectionList([]);
}
- else{
- setDatasetTypeList([])
- setDatasetDirectionList([])
- }
- })
- }
- const onSearch=(values)=>{
+ });
+ };
+ const onSearch = (values) => {
console.log(values);
- getAssetIconList({...iconParams,name:values})
- }
- const nameSearch=(values)=>{
+ getAssetIconList({ ...iconParams, name: values });
+ };
+ const nameSearch = (values) => {
console.log(values);
- getDatasetlist({...queryFlow,name:values})
- }
+ getDatasetlist({ ...queryFlow, name: values });
+ };
const handleOk = () => {
- console.log(1111);
+ console.log(1111);
setIsModalOpen(false);
};
const handleCancel = () => {
setIsModalOpen(false);
};
- const chooseDatasetType=(val,item)=>{
- console.log(val,item);
- if(item.path==queryFlow.data_type){
- setActiveType('')
- setQueryFlow({...queryFlow,data_type:null})
- getDatasetlist({...queryFlow,data_type:null})
- }
- else{
- setActiveType(item.path)
- setQueryFlow({...queryFlow,data_type:item.path})
- getDatasetlist({...queryFlow,data_type:item.path})
+ const chooseDatasetType = (val, item) => {
+ console.log(val, item);
+ if (item.path == queryFlow.data_type) {
+ setActiveType('');
+ setQueryFlow({ ...queryFlow, data_type: null });
+ getDatasetlist({ ...queryFlow, data_type: null });
+ } else {
+ setActiveType(item.path);
+ setQueryFlow({ ...queryFlow, data_type: item.path });
+ getDatasetlist({ ...queryFlow, data_type: item.path });
}
// setQueryFlow({...queryFlow,data_type:item.path},()=>{
// getDatasetlist()
// })
};
- const chooseDatasetTag=(val,item)=>{
- console.log(val,item);
- if(item.path==queryFlow.data_tag){
- setActiveTag('')
- setQueryFlow({...queryFlow,data_tag:null})
- getDatasetlist({...queryFlow,data_tag:null})
- }
- else{
- setActiveTag(item.path)
- setQueryFlow({...queryFlow,data_tag:item.path})
- getDatasetlist({...queryFlow,data_tag:item.path})
+ const chooseDatasetTag = (val, item) => {
+ console.log(val, item);
+ if (item.path == queryFlow.data_tag) {
+ setActiveTag('');
+ setQueryFlow({ ...queryFlow, data_tag: null });
+ getDatasetlist({ ...queryFlow, data_tag: null });
+ } else {
+ setActiveTag(item.path);
+ setQueryFlow({ ...queryFlow, data_tag: item.path });
+ getDatasetlist({ ...queryFlow, data_tag: item.path });
}
// setQueryFlow({...queryFlow,data_type:item.path},()=>{
// getDatasetlist()
// })
};
const onFinish = (values) => {
- addDatesetAndVesion(values).then(ret=>{
- console.log(ret);
- setIsModalOpen(false);
- getDatasetlist(queryFlow)
- })
- };
- const routeToIntro=(e,record)=>{
- e.stopPropagation()
+ addDatesetAndVesion(values).then((ret) => {
+ console.log(ret);
+ setIsModalOpen(false);
+ getDatasetlist(queryFlow);
+ });
+ };
+ const routeToIntro = (e, record) => {
+ e.stopPropagation();
console.log(record);
- navgite({pathname:`/dataset/datasetIntro/${record.id}` });
-}
+ navgite({ pathname: `/dataset/datasetIntro/${record.id}` });
+ };
const onFinishFailed = (errorInfo) => {
console.log('Failed:', errorInfo);
};
- useEffect(()=>{
+ useEffect(() => {
getDictSelectOption('available_cluster').then((data) => {
-
setClusterOptions(data);
});
- getAssetIconList(iconParams)
- getDatasetlist(queryFlow)
- return ()=>{
-
- }
- },[])
- return (<>
-
-
-
-
-
- 分类
-
-
- {datasetTypeList&&datasetTypeList.length>0?datasetTypeList.map(item=>{return
- {chooseDatasetType(e, item)}} >
- 
- 
- {item.name}
+ getAssetIconList(iconParams);
+ getDatasetlist(queryFlow);
+ return () => {};
+ }, []);
+ return (
+ <>
+
+
+
+
+ 分类
+
+ {datasetTypeList && datasetTypeList.length > 0
+ ? datasetTypeList.map((item) => {
+ return (
+
+ {
+ chooseDatasetType(e, item);
+ }}
+ >
+ 
+ 
+ {item.name}
+
+
+ );
+ })
+ : ''}
+
+ 研究方向/应用领域
+
+ {datasetDirectionList && datasetDirectionList.length > 0
+ ? datasetDirectionList.map((item) => {
+ return (
+
+ {
+ chooseDatasetTag(e, item);
+ }}
+ >
+ 
+ 
+ {item.name}
+
+
+ );
+ })
+ : ''}
+
- }):''}
-
- 研究方向/应用领域
-
-
- {datasetDirectionList&&datasetDirectionList.length>0?datasetDirectionList.map(item=>{return
- {chooseDatasetTag(e, item)}}>
- 
- 
- {item.name}
+
+
+
+ 数据总数:{total}个
+
+
+ }
+ >
+ 新建数据集
+
+
- }):''}
-
-
-
-
-
- 数据总数:{total}个
-
-
- }>
- 新建数据集
-
+
+ {datasetList && datasetList.length > 0
+ ? datasetList.map((item) => {
+ return (
+ routeToIntro(e, item)}>
+ {item.name}
+
+ 最近更新: {moment(item.update_time).format('YYYY-MM-DD')}
+
+
+ 
+ 1582
+
+
+ );
+ })
+ : ''}
+ {/* Demo */}
+
+
-
- {datasetList&&datasetList.length>0?datasetList.map(item=>{return routeToIntro(e,item)}>
- {item.name}
- 最近更新: {moment(item.update_time).format('YYYY-MM-DD')}
- 1582
- }):''}
- {/* Demo */}
-
-
-
-
-
- {dialogTitle}
- } open={isModalOpen} className={Styles.modal} okButtonProps={{
- htmlType: 'submit',
- form: 'form',
- }} onCancel={handleCancel}>
+
+
+ {dialogTitle}
+
+ }
+ open={isModalOpen}
+ className={Styles.modal}
+ okButtonProps={{
+ htmlType: 'submit',
+ form: 'form',
+ }}
+ onCancel={handleCancel}
+ >
-
+
-
+
- {
+ return { value: item.id, label: item.name };
+ })}
+ />
+
+
-
-
+
+
-
+
-
- 仅自己可见
- 工作空间可见
-
-
-
-
- }>上传文件
-
-
+
+ 仅自己可见
+ 工作空间可见
+
+
+
+
+ }
+ >
+ 上传文件
+
+
+
- >)
-};
-export default PublicData;
\ No newline at end of file
+ >
+ );
+});
+export default PublicData;
diff --git a/react-ui/src/pages/Dataset/publicData.jsx b/react-ui/src/pages/Dataset/publicData.jsx
index ea783ff9..95e20846 100644
--- a/react-ui/src/pages/Dataset/publicData.jsx
+++ b/react-ui/src/pages/Dataset/publicData.jsx
@@ -1,195 +1,244 @@
-
-import React ,{useEffect,useState}from 'react';
-import Styles from './index.less'
-import { Input, Space ,Button,Tabs,Pagination,Modal, Form,message, Radio,} from 'antd';
-import { PlusOutlined,PlusCircleOutlined, DeleteOutlined, ExclamationCircleOutlined, DownOutlined, EditOutlined ,CopyOutlined} from '@ant-design/icons';
-import {getDatasetList,getAssetIcon} from '@/services/dataset/index.js'
-const { Search } = Input;
-import { useNavigate} from 'react-router-dom';
+import { getAssetIcon, getDatasetList } from '@/services/dataset/index.js';
+import { Form, Input, Pagination } from 'antd';
import moment from 'moment';
-const leftdataList=[1,2,3]
+import React, { useEffect, useState } from 'react';
+import { useNavigate } from 'react-router-dom';
+import Styles from './index.less';
+const { Search } = Input;
+const leftdataList = [1, 2, 3];
-const PublicData= React.FC = () => {
- const [queryFlow,setQueryFlow]=useState({
- page:0,
- size:10,
- name:null,
- available_range:1
+const PublicData = (React.FC = () => {
+ const [queryFlow, setQueryFlow] = useState({
+ page: 0,
+ size: 10,
+ name: null,
+ available_range: 1,
});
- const [iconParams,setIconParams]=useState({
- name:null,
- page:0,
- size:10000
- })
- const navgite=useNavigate();
- const [datasetTypeList,setDatasetTypeList]=useState([])
- const [datasetDirectionList,setDatasetDirectionList]=useState([])
- const [activeType,setActiveType]=useState(null)
- const [activeTag,setActiveTag]=useState(null)
- const [isModalOpen,setIsModalOpen]=useState(false)
- const [datasetList,setDatasetList]=useState([]);
- const [total,setTotal]=useState(0);
+ const [iconParams, setIconParams] = useState({
+ name: null,
+ page: 0,
+ size: 10000,
+ });
+ const navgite = useNavigate();
+ const [datasetTypeList, setDatasetTypeList] = useState([]);
+ const [datasetDirectionList, setDatasetDirectionList] = useState([]);
+ const [activeType, setActiveType] = useState(null);
+ const [activeTag, setActiveTag] = useState(null);
+ const [isModalOpen, setIsModalOpen] = useState(false);
+ const [datasetList, setDatasetList] = useState([]);
+ const [total, setTotal] = useState(0);
const [form] = Form.useForm();
const [dialogTitle, setDialogTitle] = useState('新建数据');
- const getDatasetlist=(queryFlow)=>{
- getDatasetList(queryFlow).then(ret=>{
+ const getDatasetlist = (queryFlow) => {
+ getDatasetList(queryFlow).then((ret) => {
console.log(ret);
- if(ret.code==200){
- setDatasetList(ret.data.content)
- setTotal(ret.data.totalElements)
+ if (ret.code == 200) {
+ setDatasetList(ret.data.content);
+ setTotal(ret.data.totalElements);
}
- })
- }
- const onSearch=(values)=>{
+ });
+ };
+ const onSearch = (values) => {
console.log(values);
- getAssetIconList({...iconParams,name:values})
- }
- const getAssetIconList=(params)=>{
- getAssetIcon(params).then(ret=>{
+ getAssetIconList({ ...iconParams, name: values });
+ };
+ const getAssetIconList = (params) => {
+ getAssetIcon(params).then((ret) => {
console.log(ret);
- if(ret.code==200&&ret.data.content&&ret.data.content.length>0){
- setDatasetTypeList(ret.data.content.filter(item=>item.category_id==1))
- setDatasetDirectionList(ret.data.content.filter(item=>item.category_id==2))
- }
- else{
- setDatasetTypeList([])
- setDatasetDirectionList([])
+ if (ret.code == 200 && ret.data.content && ret.data.content.length > 0) {
+ setDatasetTypeList(ret.data.content.filter((item) => item.category_id == 1));
+ setDatasetDirectionList(ret.data.content.filter((item) => item.category_id == 2));
+ } else {
+ setDatasetTypeList([]);
+ setDatasetDirectionList([]);
}
- })
- }
- const nameSearch=(values)=>{
+ });
+ };
+ const nameSearch = (values) => {
console.log(values);
- getDatasetlist({...queryFlow,name:values})
- }
+ getDatasetlist({ ...queryFlow, name: values });
+ };
const showModal = () => {
- form.resetFields()
- setDialogTitle('新建数据集')
+ form.resetFields();
+ setDialogTitle('新建数据集');
setIsModalOpen(true);
};
const handleOk = () => {
- console.log(1111);
+ console.log(1111);
setIsModalOpen(false);
};
const handleCancel = () => {
setIsModalOpen(false);
};
- const chooseDatasetType=(val,item)=>{
- console.log(val,item);
- if(item.path==queryFlow.data_type){
- setActiveType('')
- setQueryFlow({...queryFlow,data_type:null})
- getDatasetlist({...queryFlow,data_type:null})
- }
- else{
- setActiveType(item.path)
- setQueryFlow({...queryFlow,data_type:item.path})
- getDatasetlist({...queryFlow,data_type:item.path})
+ const chooseDatasetType = (val, item) => {
+ console.log(val, item);
+ if (item.path == queryFlow.data_type) {
+ setActiveType('');
+ setQueryFlow({ ...queryFlow, data_type: null });
+ getDatasetlist({ ...queryFlow, data_type: null });
+ } else {
+ setActiveType(item.path);
+ setQueryFlow({ ...queryFlow, data_type: item.path });
+ getDatasetlist({ ...queryFlow, data_type: item.path });
}
// setQueryFlow({...queryFlow,data_type:item.path},()=>{
// getDatasetlist()
// })
};
- const chooseDatasetTag=(val,item)=>{
- console.log(val,item);
- if(item.path==queryFlow.data_tag){
- setActiveTag('')
- setQueryFlow({...queryFlow,data_tag:null})
- getDatasetlist({...queryFlow,data_tag:null})
- }
- else{
- setActiveTag(item.path)
- setQueryFlow({...queryFlow,data_tag:item.path})
- getDatasetlist({...queryFlow,data_tag:item.path})
+ const chooseDatasetTag = (val, item) => {
+ console.log(val, item);
+ if (item.path == queryFlow.data_tag) {
+ setActiveTag('');
+ setQueryFlow({ ...queryFlow, data_tag: null });
+ getDatasetlist({ ...queryFlow, data_tag: null });
+ } else {
+ setActiveTag(item.path);
+ setQueryFlow({ ...queryFlow, data_tag: item.path });
+ getDatasetlist({ ...queryFlow, data_tag: item.path });
}
// setQueryFlow({...queryFlow,data_type:item.path},()=>{
// getDatasetlist()
// })
};
- const routeToIntro=(e,record)=>{
- e.stopPropagation()
- console.log(record);
- navgite({pathname:`/dataset/datasetIntro/${record.id}` });
- }
+ const routeToIntro = (e, record) => {
+ e.stopPropagation();
+ console.log(record);
+ navgite({ pathname: `/dataset/datasetIntro/${record.id}` });
+ };
const onFinishFailed = (errorInfo) => {
console.log('Failed:', errorInfo);
};
- useEffect(()=>{
- getAssetIconList(iconParams)
- getDatasetlist(queryFlow)
- return ()=>{
-
- }
- },[])
- return (<>
-
-
-
-
-
- 分类
-
-
- {datasetTypeList&&datasetTypeList.length>0?datasetTypeList.map(item=>{return
- {chooseDatasetType(e, item)}}>
- 
- 
- {item.name}
+ useEffect(() => {
+ getAssetIconList(iconParams);
+ getDatasetlist(queryFlow);
+ return () => {};
+ }, []);
+ return (
+ <>
+
+
+
+
+ 分类
+
+ {datasetTypeList && datasetTypeList.length > 0
+ ? datasetTypeList.map((item) => {
+ return (
+
+ {
+ chooseDatasetType(e, item);
+ }}
+ >
+ 
+ 
+ {item.name}
+
+
+ );
+ })
+ : ''}
+
+ 研究方向/应用领域
+
+ {datasetDirectionList && datasetDirectionList.length > 0
+ ? datasetDirectionList.map((item) => {
+ return (
+
+ {
+ chooseDatasetTag(e, item);
+ }}
+ >
+ 
+ 
+ {item.name}
+
+
+ );
+ })
+ : ''}
+
- }):''}
-
- 研究方向/应用领域
-
-
- {datasetDirectionList&&datasetDirectionList.length>0?datasetDirectionList.map(item=>{return
- {chooseDatasetTag(e, item)}}>
- 
- 
- {item.name}
+
+ }):''}
-
-
-
-
-
- 数据总数:{total}个
-
-
+
+ {datasetList && datasetList.length > 0
+ ? datasetList.map((item) => {
+ return (
+ routeToIntro(e, item)}>
+ {item.name}
+
+ 最近更新: {moment(item.update_time).format('YYYY-MM-DD')}
+
+
+ 
+ 1582
+
+
+ );
+ })
+ : ''}
+ {/* Demo */}
+
+
-
- {datasetList&&datasetList.length>0?datasetList.map(item=>{return routeToIntro(e,item)}>
- {item.name}
- 最近更新: {moment(item.update_time).format('YYYY-MM-DD')}
- 1582
- }):''}
- {/* Demo */}
-
-
-
-
- >)
-};
-export default PublicData;
\ No newline at end of file
+ >
+ );
+});
+export default PublicData;
diff --git a/react-ui/src/pages/Experiment/experimentText/LogList.tsx b/react-ui/src/pages/Experiment/experimentText/LogList.tsx
index 57e7a7e1..053819f4 100644
--- a/react-ui/src/pages/Experiment/experimentText/LogList.tsx
+++ b/react-ui/src/pages/Experiment/experimentText/LogList.tsx
@@ -1,8 +1,9 @@
-import LogGroup from './logGroup';
+import { ExperimentStatus } from '../types';
+import LogGroup, { type LogGroupProps } from './logGroup';
type LogListProps = {
- list: any[];
- status: string;
+ list: Omit [];
+ status: ExperimentStatus;
};
function LogList({ list = [], status }: LogListProps) {
diff --git a/react-ui/src/pages/Experiment/experimentText/editPipeline.less b/react-ui/src/pages/Experiment/experimentText/editPipeline.less
index 684b377c..f9e0e21b 100644
--- a/react-ui/src/pages/Experiment/experimentText/editPipeline.less
+++ b/react-ui/src/pages/Experiment/experimentText/editPipeline.less
@@ -1,61 +1,61 @@
#graph {
- height: 100%;
- width: 100%;
- position: relative;
- }
-.editPipelinePropsContent{
+ position: relative;
+ width: 100%;
+ height: 100%;
+}
+.editPipelinePropsContent {
display: flex;
align-items: center;
width: 100%;
- height:43px;
- background:#f8fbff;
- color:#1d1d20;
- font-size:15px;
- font-family: 'Alibaba';
- padding: 0 20px;
+ height: 43px;
margin-bottom: 10px;
+ padding: 0 20px;
+ color: #1d1d20;
+ font-size: 15px;
+ font-family: 'Alibaba';
+ background: #f8fbff;
}
-.centerContainer{
- flex: 1;
+.centerContainer {
display: flex;
+ flex: 1;
flex-direction: column;
}
-.buttonList{
+.buttonList {
display: flex;
align-items: center;
- padding: 0 30px;
width: 100%;
- height:45px;
- background:#ffffff;
- box-shadow:0px 3px 6px rgba(146, 146, 146, 0.09);
-}
-.detailBox{
- color:#1d1d20;
-font-size:15px;
-margin-bottom: 15px;
-display: flex;
-align-items: center;
-}
-.allMessageItem{
+ height: 45px;
+ padding: 0 30px;
+ background: #ffffff;
+ box-shadow: 0px 3px 6px rgba(146, 146, 146, 0.09);
+}
+.detailBox {
display: flex;
align-items: center;
- color:rgba(29, 29, 32, 0.8);
-font-size:15px;
-margin-right: 30px;
+ margin-bottom: 15px;
+ color: #1d1d20;
+ font-size: 15px;
}
-.resultTop{
- border-bottom: 1px solid #eee;
+.allMessageItem {
display: flex;
- justify-content: space-between;
align-items: center;
- padding: 10px 0;
+ margin-right: 30px;
+ color: rgba(29, 29, 32, 0.8);
+ font-size: 15px;
}
-.resultContent{
- width: 100%;
+.resultTop {
display: flex;
+ align-items: center;
justify-content: space-between;
-
+ padding: 10px 0;
+ border-bottom: 1px solid #eee;
+}
+.resultContent {
+ display: flex;
+
align-items: center;
- padding: 0 20px 0 0;
+ justify-content: space-between;
+ width: 100%;
margin-bottom: 10px;
-}
\ No newline at end of file
+ padding: 0 20px 0 0;
+}
diff --git a/react-ui/src/pages/Experiment/experimentText/logGroup.tsx b/react-ui/src/pages/Experiment/experimentText/logGroup.tsx
index f50114b3..523645fa 100644
--- a/react-ui/src/pages/Experiment/experimentText/logGroup.tsx
+++ b/react-ui/src/pages/Experiment/experimentText/logGroup.tsx
@@ -3,34 +3,35 @@ import { getExperimentPodsLog } from '@/services/experiment/index.js';
import { DoubleRightOutlined, DownOutlined, UpOutlined } from '@ant-design/icons';
import { Button } from 'antd';
import { useEffect, useState } from 'react';
+import { ExperimentStatus } from '../types';
import styles from './logGroup.less';
-type LogGroupProps = {
- log_type?: string;
- pod_name?: string;
- log_content?: string;
- start_time?: string;
- status: string;
+export type LogGroupProps = {
+ log_type: 'normal' | 'resource'; // 日志类型
+ pod_name?: string; // 分布式名称
+ log_content?: string; // 日志内容
+ start_time?: string; // 日志开始时间
+ status: ExperimentStatus; // 实验状态
};
type Log = {
- start_time: string;
- log_content: string;
+ start_time: string; // 日志开始时间
+ log_content: string; // 日志内容
};
function LogGroup({
- log_type = '',
+ log_type = 'normal',
pod_name = '',
log_content = '',
start_time = '',
- status = '',
+ status = ExperimentStatus.Pending,
}: LogGroupProps) {
const [collapse, setCollapse] = useState(true);
const [logList, setLogList, logListRef] = useStateRef([]);
const [completed, setCompleted] = useState(false);
useEffect(() => {
- if (status === 'Running') {
+ if (status === ExperimentStatus.Running) {
const timerId = setInterval(() => {
requestExperimentPodsLog();
}, 5000);
diff --git a/react-ui/src/pages/Experiment/experimentText/props.jsx b/react-ui/src/pages/Experiment/experimentText/props.jsx
index 1ab54930..1a6c738b 100644
--- a/react-ui/src/pages/Experiment/experimentText/props.jsx
+++ b/react-ui/src/pages/Experiment/experimentText/props.jsx
@@ -160,7 +160,12 @@ const Props = forwardRef(({ onParentChange }, ref) => {
Object.keys(stagingItem.control_strategy) &&
Object.keys(stagingItem.control_strategy).length > 0
? Object.keys(stagingItem.control_strategy).map((item) => (
-
+
))
@@ -178,6 +183,7 @@ const Props = forwardRef(({ onParentChange }, ref) => {
Object.keys(stagingItem.in_parameters).length > 0
? Object.keys(stagingItem.in_parameters).map((item) => (
{
Object.keys(stagingItem.out_parameters).length > 0
? Object.keys(stagingItem.out_parameters).map((item) => (
{
>
{resultObj && resultObj.length > 0
? resultObj.map((item) => (
-
+
{item.name}
@@ -249,7 +256,7 @@ const Props = forwardRef(({ onParentChange }, ref) => {
{item.value && item.value.length > 0
? item.value.map((ele) => (
-
+
{ele.name}
{ele.size}
diff --git a/react-ui/src/pages/Experiment/status.ts b/react-ui/src/pages/Experiment/status.ts
index 0a7b6652..fc4eb586 100644
--- a/react-ui/src/pages/Experiment/status.ts
+++ b/react-ui/src/pages/Experiment/status.ts
@@ -4,17 +4,6 @@ export interface StatusInfo {
icon: string;
}
-export enum ExperimentStatus {
- Running = 'Running',
- Succeeded = 'Succeeded',
- Pending = 'Pending',
- Failed = 'Failed',
- Error = 'Error',
- Terminated = 'Terminated',
- Skipped = 'Skipped',
- Omitted = 'Omitted',
-}
-
export const experimentStatusInfo: Record = {
Running: {
label: '运行中',
diff --git a/react-ui/src/pages/Experiment/types.ts b/react-ui/src/pages/Experiment/types.ts
index e69de29b..c90f310c 100644
--- a/react-ui/src/pages/Experiment/types.ts
+++ b/react-ui/src/pages/Experiment/types.ts
@@ -0,0 +1,10 @@
+export enum ExperimentStatus {
+ Running = 'Running',
+ Succeeded = 'Succeeded',
+ Pending = 'Pending',
+ Failed = 'Failed',
+ Error = 'Error',
+ Terminated = 'Terminated',
+ Skipped = 'Skipped',
+ Omitted = 'Omitted',
+}
diff --git a/react-ui/src/pages/Model/index.jsx b/react-ui/src/pages/Model/index.jsx
index 5b93bcec..2e926b87 100644
--- a/react-ui/src/pages/Model/index.jsx
+++ b/react-ui/src/pages/Model/index.jsx
@@ -1,27 +1,24 @@
-
-import React ,{useEffect,useState}from 'react';
-import Styles from './index.less'
-import { Input, Space ,Button,Tabs,Pagination,Modal, Form,message, Radio,} from 'antd';
-import { PlusOutlined,PlusCircleOutlined, DeleteOutlined, ExclamationCircleOutlined, DownOutlined, EditOutlined ,CopyOutlined} from '@ant-design/icons';
+import { Form, Input, Tabs } from 'antd';
+import { useEffect, useState } from 'react';
+import { useNavigate } from 'react-router-dom';
+import Styles from './index.less';
+import PersonalData from './personalData';
+import PublicData from './publicData';
// import {getModelList} from '@/services/dataset/index.js'
const { Search } = Input;
-import { useNavigate} from 'react-router-dom';
-import moment from 'moment';
const { TabPane } = Tabs;
-import PublicData from './publicData';
-import PersonalData from './personalData'
-const leftdataList=[1,2,3]
+const leftdataList = [1, 2, 3];
-const Dataset= React.FC = () => {
- const [queryFlow,setQueryFlow]=useState({
- page:0,
- size:10,
- name:null
+const Dataset = () => {
+ const [queryFlow, setQueryFlow] = useState({
+ page: 0,
+ size: 10,
+ name: null,
});
- const navgite=useNavigate();
- const [isModalOpen,setIsModalOpen]=useState(false)
- const [datasetList,setDatasetList]=useState([]);
- const [total,setTotal]=useState(0);
+ const navgite = useNavigate();
+ const [isModalOpen, setIsModalOpen] = useState(false);
+ const [datasetList, setDatasetList] = useState([]);
+ const [total, setTotal] = useState(0);
const [form] = Form.useForm();
const [dialogTitle, setDialogTitle] = useState('新建数据');
// const getModelLists=()=>{
@@ -35,49 +32,42 @@ const Dataset= React.FC = () => {
// }
const showModal = () => {
- form.resetFields()
- setDialogTitle('新建数据集')
+ form.resetFields();
+ setDialogTitle('新建数据集');
setIsModalOpen(true);
};
const handleOk = () => {
- console.log(1111);
+ console.log(1111);
setIsModalOpen(false);
};
const handleCancel = () => {
setIsModalOpen(false);
};
- const onFinish = (values) => {
-
- };
- const routeToIntro=(e,record)=>{
- e.stopPropagation()
- navgite({pathname:'/dataset/datasetIntro' });
-}
+ const onFinish = (values) => {};
+ const routeToIntro = (e, record) => {
+ e.stopPropagation();
+ navgite({ pathname: '/dataset/datasetIntro' });
+ };
const onFinishFailed = (errorInfo) => {
console.log('Failed:', errorInfo);
};
- useEffect(()=>{
-
- return ()=>{
-
- }
- },[])
- return ()
+ useEffect(() => {
+ return () => {};
+ }, []);
+ return (
+
+ );
};
-export default Dataset;
\ No newline at end of file
+export default Dataset;
diff --git a/react-ui/src/pages/Model/index.less b/react-ui/src/pages/Model/index.less
index ff21467e..857d0a7c 100644
--- a/react-ui/src/pages/Model/index.less
+++ b/react-ui/src/pages/Model/index.less
@@ -1,296 +1,293 @@
-.datasetTopBox{
+.datasetTopBox {
+ display: flex;
+ align-items: center;
+ width: 100%;
+ height: 49px;
+ padding: 0 30px;
+ padding-right: 30px;
+ background-image: url(/assets/images/pipeline-back.png);
+ background-size: 100% 100%;
+}
+.datasetIntroTopBox {
+ display: flex;
+ flex-direction: column;
+ justify-content: space-between;
+ width: 100%;
+ height: 110px;
+ margin-bottom: 10px;
+ padding: 25px 30px;
+ background-image: url(/assets/images/dataset-back.png);
+
+ background-size: 100% 100%;
+ .smallTagBox {
display: flex;
align-items: center;
- padding-right: 30px;
- width: 100%;
- height: 49px;
- background-size: 100% 100%;
- background-image: url(/assets/images/pipeline-back.png);
- padding: 0 30px;
+ color: #1664ff;
+ font-size: 14px;
+ .tagItem {
+ margin-right: 20px;
+ padding: 4px 10px;
+ background: rgba(22, 100, 255, 0.1);
+ border-radius: 4px;
+ }
+ }
}
-.datasetIntroTopBox{
+.dataListBox {
+ padding: 20px 30px;
+ color: #1d1d20;
+ font-size: 16px;
+ background: #ffffff;
+ border-radius: 10px;
+ box-shadow: 0px 2px 12px rgba(180, 182, 191, 0.09);
+ .dataButtonList {
display: flex;
- flex-direction: column;
+ align-items: center;
justify-content: space-between;
- width: 100%;
- height: 110px;
- background-size: 100% 100%;
- background-image: url(/assets/images/dataset-back.png);
- margin-bottom: 10px;
- padding: 25px 30px;
- .smallTagBox{
- display: flex;
- align-items: center;
- color:#1664ff;
- font-size:14px;
- .tagItem{
- padding: 4px 10px;
- background: rgba(22, 100, 255, 0.1);
- border-radius:4px;
- margin-right: 20px;
- }
- }
-}
-.dataListBox{
- padding: 20px 30px;
- background:#ffffff;
- border-radius:10px;
- box-shadow:0px 2px 12px rgba(180, 182, 191, 0.09);
- color:#1d1d20;
- font-size:16px;
- .dataButtonList{
- display: flex;
- justify-content: space-between;
- align-items: center;
- height: 32px;
- margin: 24px 0 30px 0;
- color:#575757;
- font-size:16px;
- }
+ height: 32px;
+ margin: 24px 0 30px 0;
+ color: #575757;
+ font-size: 16px;
+ }
}
-.datasetIntroCneterBox{
- height: 77vh;
- padding: 20px 30px;
- background:#ffffff;
- border-radius:10px;
- box-shadow:0px 2px 12px rgba(180, 182, 191, 0.09);
+.datasetIntroCneterBox {
+ height: 77vh;
+ padding: 20px 30px;
+ background: #ffffff;
+ border-radius: 10px;
+ box-shadow: 0px 2px 12px rgba(180, 182, 191, 0.09);
}
-.datasetIntroTitle{
- color:#1d1d20;
- font-size:15px;
- margin: 37px 0 10px 0;
+.datasetIntroTitle {
+ margin: 37px 0 10px 0;
+ color: #1d1d20;
+ font-size: 15px;
}
-.datasetIntroText{
- color:#575757;
- font-size:14px;
- margin-bottom: 30px;
+.datasetIntroText {
+ margin-bottom: 30px;
+ color: #575757;
+ font-size: 14px;
}
-.datasetBox{
- background:#f9fafb;
- font-family: 'Alibaba';
- :global{
- .ant-tabs-top >.ant-tabs-nav{
- margin: 0;
- }
- .ant-pagination{
- text-align: right;
- }
+.datasetBox {
+ font-family: 'Alibaba';
+ background: #f9fafb;
+ :global {
+ .ant-tabs-top > .ant-tabs-nav {
+ margin: 0;
+ }
+ .ant-pagination {
+ text-align: right;
}
+ }
}
-.datasetAllBox{
- :global{
- .ant-tabs-nav .ant-tabs-nav-wrap{
- margin: -48px 0 0 30px;
- }
-
+.datasetAllBox {
+ :global {
+ .ant-tabs-nav .ant-tabs-nav-wrap {
+ margin: -48px 0 0 30px;
}
+ }
}
-.plusButton{
- margin: 0 18px 0 20px;
- background:rgba(22, 100, 255, 0.06);
- border:1px solid;
- border-color:rgba(22, 100, 255, 0.11);
- border-radius:4px;
- color:#1d1d20;
- font-size:14px;
- font-family: 'Alibaba';
+.plusButton {
+ margin: 0 18px 0 20px;
+ color: #1d1d20;
+ font-size: 14px;
+ font-family: 'Alibaba';
+ background: rgba(22, 100, 255, 0.06);
+ border: 1px solid;
+ border-color: rgba(22, 100, 255, 0.11);
+ border-radius: 4px;
}
-.plusButton:hover{
- background:rgba(22, 100, 255, 0.06)!important;
- border:1px solid!important;
- border-color:rgba(22, 100, 255, 0.11)!important;
- color:#1d1d20!important;
+.plusButton:hover {
+ color: #1d1d20 !important;
+ background: rgba(22, 100, 255, 0.06) !important;
+ border: 1px solid !important;
+ border-color: rgba(22, 100, 255, 0.11) !important;
}
-.datasetCneterBox{
- display: flex;
- justify-content: space-between;
- height: 85vh;
- width: 100%;
-
- .datasetCneterLeftBox{
- width:340px;
- height:100%;
- background:#ffffff;
- box-shadow:0px 3px 6px rgba(146, 146, 146, 0.09);
- margin-right: 10px;
- padding-top: 15px;
- .custTab{
- display: flex;
- border-bottom: 1px solid #e0eaff;
- height: 32px;
- .tabItem{
- width: 52px;
- height: 100%;
- text-align: center;
- color:#808080;
- font-size:15px;
- cursor: pointer;
- }
+.datasetCneterBox {
+ display: flex;
+ justify-content: space-between;
+ width: 100%;
+ height: 85vh;
+
+ .datasetCneterLeftBox {
+ width: 340px;
+ height: 100%;
+ margin-right: 10px;
+ padding-top: 15px;
+ background: #ffffff;
+ box-shadow: 0px 3px 6px rgba(146, 146, 146, 0.09);
+ .custTab {
+ display: flex;
+ height: 32px;
+ border-bottom: 1px solid #e0eaff;
+ .tabItem {
+ width: 52px;
+ height: 100%;
+ color: #808080;
+ font-size: 15px;
+ text-align: center;
+ cursor: pointer;
+ }
+ }
+ .leftContentBox {
+ max-height: 80vh;
+ padding: 15px 20px;
+ overflow-x: hidden;
+ overflow-y: auto;
+ .itemTitle {
+ margin-bottom: 15px;
+ color: #1d1d20;
+ font-size: 14px;
+ }
+ .itemBox {
+ display: flex;
+ flex-wrap: wrap;
+ align-content: start;
+ width: 110%;
+ .messageBox {
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ justify-content: space-between;
+ width: 92px;
+ height: 62px;
+ margin: 0 12px 20px 0;
+ padding: 11px 0px 7px 0px;
+ color: #1d1d20;
+ font-size: 12px;
+ border: 1px solid;
+ border-color: rgba(22, 100, 255, 0.05);
+ border-radius: 4px;
+ cursor: pointer;
+ .ptIcon {
+ display: block;
+ }
+ .hoverIcon {
+ display: none;
+ }
+ .messageText {
+ width: 65px;
+ overflow: hidden;
+ white-space: nowrap;
+ text-align: center;
+ text-overflow: ellipsis;
+ transition: all 0.2s;
+ }
+ }
+ .messageBox:hover {
+ background: rgba(22, 100, 255, 0.03);
+ border: 1px solid;
+ border-color: #1664ff;
+ .ptIcon {
+ display: none;
+ }
+ .hoverIcon {
+ display: block;
+ }
}
- .leftContentBox{
- max-height: 80vh;
- overflow-y: auto;
- overflow-x: hidden;
- padding: 15px 20px;
- .itemTitle{
- color:#1d1d20;
- font-size:14px;
- margin-bottom: 15px;
- }
- .itemBox{
- width: 110%;
- display: flex;
- flex-wrap: wrap;
- align-content: start;
- .messageBox{
- display: flex;
- flex-direction: column;
- justify-content: space-between;
- align-items: center;
- cursor: pointer;
- width:92px;
- height:62px;
- border:1px solid;
- border-color:rgba(22, 100, 255, 0.05);
- border-radius:4px;
- margin: 0 12px 20px 0;
- padding: 11px 0px 7px 0px;
- color:#1d1d20;
- font-size:12px;
- .ptIcon{
- display: block;
- }
- .hoverIcon{
- display: none;
- }
- .messageText{
- width: 65px;
- text-align: center;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- transition: all 0.2s;
- }
- }
- .messageBox:hover{
- background:rgba(22, 100, 255, 0.03);
- border:1px solid;
- border-color:#1664ff;
- .ptIcon{
- display: none;
- }
- .hoverIcon{
- display: block;
- }
- }
- .active{
- background:rgba(22, 100, 255, 0.03)!important;
- border:1px solid!important;
- border-color:#1664ff!important;
- .ptIcon{
- display: none!important;
- }
- .hoverIcon{
- display: block!important;
- }
- }
- }
+ .active {
+ background: rgba(22, 100, 255, 0.03) !important;
+ border: 1px solid !important;
+ border-color: #1664ff !important;
+ .ptIcon {
+ display: none !important;
+ }
+ .hoverIcon {
+ display: block !important;
+ }
}
+ }
}
- .datasetCneterRightBox{
- display: flex;
- flex-direction: column;
- padding: 22px 30px 26px 30px;
- flex: 1;
- height:100%;
- background:#ffffff;
- box-shadow:0px 3px 6px rgba(146, 146, 146, 0.09);
- .dataSource{
- display: flex;
- justify-content: space-between;
- align-items: center;
- height: 32px;
- margin-bottom: 30px;
- color:rgba(29, 29, 32, 0.8);
- font-size:15px;
+ }
+ .datasetCneterRightBox {
+ display: flex;
+ flex: 1;
+ flex-direction: column;
+ height: 100%;
+ padding: 22px 30px 26px 30px;
+ background: #ffffff;
+ box-shadow: 0px 3px 6px rgba(146, 146, 146, 0.09);
+ .dataSource {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ height: 32px;
+ margin-bottom: 30px;
+ color: rgba(29, 29, 32, 0.8);
+ font-size: 15px;
+ }
+ .dataContent {
+ display: flex;
+ flex: 1;
+ flex-wrap: wrap;
+ align-content: flex-start;
+ width: 100%;
+ .dataItem {
+ position: relative;
+ width: 32%;
+ height: 66px;
+ margin: 0 15px 18px 0;
+ background: rgba(128, 128, 128, 0.05);
+ border-radius: 8px;
+ box-shadow: 0px 0px 12px rgba(75, 84, 137, 0.05);
+ cursor: pointer;
+ .itemText {
+ position: absolute;
+ top: 10px;
+ left: 20px;
+ color: #1d1d20;
+ font-size: 15px;
+ }
+ .itemTime {
+ position: absolute;
+ bottom: 10px;
+ left: 20px;
+ color: #808080;
+ font-size: 14px;
}
- .dataContent{
- width: 100%;
- flex: 1;
- display: flex;
- flex-wrap: wrap;
- align-content: flex-start;
- .dataItem{
- width: 32%;
- margin: 0 15px 18px 0;
- height:66px;
- position: relative;
- background:rgba(128, 128, 128, 0.05);
- border-radius:8px;
- box-shadow:0px 0px 12px rgba(75, 84, 137, 0.05);
- cursor: pointer;
- .itemText{
- position: absolute;
- left: 20px;
- top: 10px;
- color:#1d1d20;
- font-size:15px;
-
- }
- .itemTime{
- position: absolute;
- left: 20px;
- bottom: 10px;
- color:#808080;
- font-size:14px;
- }
- .itemIcon{
- position: absolute;
- right: 20px;
- bottom: 10px;
- color:#808080;
- font-size:14px;
- }
- }
+ .itemIcon {
+ position: absolute;
+ right: 20px;
+ bottom: 10px;
+ color: #808080;
+ font-size: 14px;
}
+ }
}
+ }
}
.modal {
- :global {
- .ant-modal-content {
- background:linear-gradient(180deg,#cfdfff 0%,#d4e2ff 9.77%,#ffffff 40%,#ffffff 100%);
- border-radius:21px;
- padding: 20px 67px;
- width: 825px;
-
- }
- .ant-modal-header{
- background-color: transparent;
- margin: 20px 0;
- }
- .ant-input{
- border-color:#e6e6e6;
- height: 40px;
-
- }
- .ant-form-item .ant-form-item-label >label{
- color:rgba(29, 29, 32, 0.8);
- }
- .ant-modal-footer{
- margin: 40px 0 30px 0;
- display: flex;
- justify-content: center;
- }
- .ant-btn{
- width:110px;
- height:40px;
- font-size:18px;
- background:rgba(22, 100, 255, 0.06);
- border-radius:10px;
- border-color: transparent;
- }
- .ant-btn-primary{
- background:#1664ff;
- }
+ :global {
+ .ant-modal-content {
+ width: 825px;
+ padding: 20px 67px;
+ background: linear-gradient(180deg, #cfdfff 0%, #d4e2ff 9.77%, #ffffff 40%, #ffffff 100%);
+ border-radius: 21px;
+ }
+ .ant-modal-header {
+ margin: 20px 0;
+ background-color: transparent;
+ }
+ .ant-input {
+ height: 40px;
+ border-color: #e6e6e6;
}
-}
\ No newline at end of file
+ .ant-form-item .ant-form-item-label > label {
+ color: rgba(29, 29, 32, 0.8);
+ }
+ .ant-modal-footer {
+ display: flex;
+ justify-content: center;
+ margin: 40px 0 30px 0;
+ }
+ .ant-btn {
+ width: 110px;
+ height: 40px;
+ font-size: 18px;
+ background: rgba(22, 100, 255, 0.06);
+ border-color: transparent;
+ border-radius: 10px;
+ }
+ .ant-btn-primary {
+ background: #1664ff;
+ }
+ }
+}
diff --git a/react-ui/src/pages/Model/modelIntro.jsx b/react-ui/src/pages/Model/modelIntro.jsx
index 91f0884e..2ce4a7e6 100644
--- a/react-ui/src/pages/Model/modelIntro.jsx
+++ b/react-ui/src/pages/Model/modelIntro.jsx
@@ -7,7 +7,12 @@ import {
getModelVersionsById,
} from '@/services/dataset/index.js';
import { downLoadZip } from '@/utils/downloadfile';
-import { DeleteOutlined, PlusCircleOutlined, UploadOutlined } from '@ant-design/icons';
+import {
+ DeleteOutlined,
+ DownloadOutlined,
+ PlusCircleOutlined,
+ UploadOutlined,
+} from '@ant-design/icons';
import { Button, Form, Input, Modal, Select, Table, Tabs, Upload, message } from 'antd';
import moment from 'moment';
import { useEffect, useRef, useState } from 'react';
@@ -57,15 +62,13 @@ const Dataset = () => {
const getModelByDetail = () => {
getModelById(locationParams.id).then((ret) => {
console.log(ret);
- if (ret.code == 200) {
- setDatasetDetailObj(ret.data);
- }
+ setDatasetDetailObj(ret.data);
});
};
const getModelVersionsList = () => {
getModelVersionsById(locationParams.id).then((ret) => {
console.log(ret);
- if (ret.code == 200 && ret.data && ret.data.length > 0) {
+ if (ret.data && ret.data.length > 0) {
setVersionList(
ret.data.map((item) => {
return {
@@ -101,12 +104,8 @@ const Dataset = () => {
onOk: () => {
deleteModelVersion({ models_id: locationParams.id, version }).then((ret) => {
- if (ret.code == 200) {
- message.success('删除成功');
- getModelVersions({ version, models_id: locationParams.id });
- } else {
- message.error(ret.msg);
- }
+ message.success('删除成功');
+ getModelVersions({ version, models_id: locationParams.id });
});
},
});
@@ -121,9 +120,7 @@ const Dataset = () => {
const getModelVersions = (params) => {
getModelVersionIdList(params).then((ret) => {
console.log(ret);
- if (ret.code == 200) {
- setWordList(ret.data);
- }
+ setWordList(ret.data);
});
};
const handleExport = async () => {
@@ -150,18 +147,16 @@ const Dataset = () => {
console.log('Failed:', errorInfo);
};
const columns = [
- // {
- // title: '序号',
- // dataIndex: 'index',
- // key: 'index',
- // width: 80,
- // render(text, record, index) {
- // return (
- // {(pageOption.current.page - 1) * 10 + index + 1}
- // )
- // }
- // // render: (text, record, index) => `${((curPage-1)*10)+(index+1)}`,
- // },
+ {
+ title: '序号',
+ dataIndex: 'index',
+ key: 'index',
+ width: 80,
+ render(text, record, index) {
+ return {(pageOption.current.page - 1) * 10 + index + 1};
+ },
+ // render: (text, record, index) => `${((curPage-1)*10)+(index+1)}`,
+ },
{
title: '文件名称',
dataIndex: 'file_name',
@@ -184,6 +179,23 @@ const Dataset = () => {
key: 'update_time',
render: (text) => {moment(text).format('YYYY-MM-DD HH:mm:ss')},
},
+ {
+ title: '操作',
+ dataIndex: 'option',
+ width: '100px',
+ key: 'option',
+ render: (_, record) => [
+ }
+ onClick={(e) => downloadAlone(e, record)}
+ >
+ 下载
+ ,
+ ],
+ },
];
const pageOption = useRef({ page: 1, size: 10 });
@@ -256,12 +268,15 @@ const Dataset = () => {
disabled={!version}
style={{ margin: '0 20px 0 0' }}
onClick={handleExport}
- icon={}
+ icon={}
>
下载
+
+ {wordList.length > 0 ? wordList[0].description : null}
+
@@ -300,21 +315,55 @@ const Dataset = () => {
-
+
-
-
+
+
-
+
+
+
+
} key={item.key}>
+ {item.value && item.value.length > 0
+ ? item.value.map((ele) => (
+ {
+ dragEnd(e, ele);
+ }}
+ className={Styles.collapseItem}
+ >
+ 
+ {ele.component_label}
+
+ ))
+ : ''}
+
+ ))
+ : ''}
+
+
+ );
+};
+export default modelMenus;
diff --git a/react-ui/src/pages/Pipeline/editPipeline/modelMenus.less b/react-ui/src/pages/Pipeline/editPipeline/modelMenus.less
index c8adc787..e58e17ac 100644
--- a/react-ui/src/pages/Pipeline/editPipeline/modelMenus.less
+++ b/react-ui/src/pages/Pipeline/editPipeline/modelMenus.less
@@ -1,44 +1,40 @@
-.collapseList{
-
+.collapseList {
}
-.collapseItem{
-
- display: flex;
- align-items: center;
- color:#575757;
- font-size:14px;
- height:40px;
- cursor: pointer;
- border-radius:4px;
- padding: 0 16px;
+.collapseItem {
+ display: flex;
+ align-items: center;
+ height: 40px;
+ padding: 0 16px;
+ color: #575757;
+ font-size: 14px;
+ border-radius: 4px;
+ cursor: pointer;
}
-.collapseItem:hover{
- background:rgba(22, 100, 255, 0.08);
+.collapseItem:hover {
+ background: rgba(22, 100, 255, 0.08);
+}
+.collapse {
+ :global {
+ .ant-collapse {
+ background-color: #fff;
+ border-color: transparent !important;
+ }
+ .ant-collapse > .ant-collapse-item > .ant-collapse-header {
+ margin-bottom: 5px;
+ background-color: #fff;
+ border-color: transparent;
+ }
+ .ant-collapse > .ant-collapse-item {
+ margin: 0 10px;
+ border-color: rgba(20, 49, 179, 0.12);
+ border-radius: 0px;
+ }
+ .ant-collapse .ant-collapse-content {
+ padding-bottom: 15px;
+ border-top: 1px solid transparent;
+ }
+ .ant-collapse .ant-collapse-content > .ant-collapse-content-box {
+ padding: 0;
+ }
+ }
}
-.collapse{
- :global {
- .ant-collapse{
- border-color: transparent!important;
- background-color: #fff;
-
- }
- .ant-collapse>.ant-collapse-item >.ant-collapse-header{
- background-color: #fff;
- border-color: transparent;
- margin-bottom: 5px;
- }
- .ant-collapse>.ant-collapse-item{
- border-radius: 0px;
- border-color:rgba(20, 49, 179, 0.12);
- margin: 0 10px;
- }
- .ant-collapse .ant-collapse-content{
- padding-bottom: 15px;
- border-top: 1px solid transparent;
-
- }
- .ant-collapse .ant-collapse-content>.ant-collapse-content-box{
- padding: 0;
- }
- }
-}
\ No newline at end of file
diff --git a/react-ui/src/pages/Pipeline/editPipeline/props.jsx b/react-ui/src/pages/Pipeline/editPipeline/props.jsx
index 38eea3a0..5b22cdb8 100644
--- a/react-ui/src/pages/Pipeline/editPipeline/props.jsx
+++ b/react-ui/src/pages/Pipeline/editPipeline/props.jsx
@@ -1,75 +1,93 @@
-import React, { useState,useImperativeHandle ,forwardRef } from 'react';
-import { Button, Drawer,Form, Input , } from 'antd';
-import Styles from './editPipeline.less'
+import { Drawer, Form, Input } from 'antd';
+import { forwardRef, useImperativeHandle, useState } from 'react';
+import Styles from './editPipeline.less';
const { TextArea } = Input;
-const Props = forwardRef(({onParentChange}, ref) =>{
- const [form] = Form.useForm();
- const [stagingItem,setStagingItem]=useState({})
- const [open, setOpen] = useState(false);
- const afterOpenChange=()=>{
-
- if(!open){
- console.log(111,open);
-
- console.log(stagingItem,form.getFieldsValue());
- for(let i in form.getFieldsValue()){
- for(let j in stagingItem.in_parameters){
-
- if(i==j){
- console.log(j,i);
- stagingItem.in_parameters[j].value=form.getFieldsValue()[i]
- }
+const Props = forwardRef(({ onParentChange }, ref) => {
+ const [form] = Form.useForm();
+ const [stagingItem, setStagingItem] = useState({});
+ const [open, setOpen] = useState(false);
+ const afterOpenChange = () => {
+ if (!open) {
+ console.log(111, open);
+
+ console.log(stagingItem, form.getFieldsValue());
+ for (let i in form.getFieldsValue()) {
+ for (let j in stagingItem.in_parameters) {
+ if (i == j) {
+ console.log(j, i);
+ stagingItem.in_parameters[j].value = form.getFieldsValue()[i];
}
- for(let p in stagingItem.out_parameters){
- if(i==p){
- stagingItem.out_parameters[p].value=form.getFieldsValue()[i]
- }
+ }
+ for (let p in stagingItem.out_parameters) {
+ if (i == p) {
+ stagingItem.out_parameters[p].value = form.getFieldsValue()[i];
}
- for(let k in stagingItem.control_strategy){
- if(i==k){
- stagingItem.control_strategy[k].value=form.getFieldsValue()[i]
- }
+ }
+ for (let k in stagingItem.control_strategy) {
+ if (i == k) {
+ stagingItem.control_strategy[k].value = form.getFieldsValue()[i];
}
}
- // setStagingItem({...stagingItem,})
- console.log((stagingItem.control_strategy));
- onParentChange({...stagingItem,control_strategy:JSON.stringify(stagingItem.control_strategy),in_parameters:JSON.stringify(stagingItem.in_parameters),out_parameters:JSON.stringify(stagingItem.out_parameters),...form.getFieldsValue()})
- // onParentChange({...stagingItem,...form.getFieldsValue()})
}
+ // setStagingItem({...stagingItem,})
+ console.log(stagingItem.control_strategy);
+ onParentChange({
+ ...stagingItem,
+ control_strategy: JSON.stringify(stagingItem.control_strategy),
+ in_parameters: JSON.stringify(stagingItem.in_parameters),
+ out_parameters: JSON.stringify(stagingItem.out_parameters),
+ ...form.getFieldsValue(),
+ });
+ // onParentChange({...stagingItem,...form.getFieldsValue()})
}
- const onClose=()=> {
- setOpen(false);
- };
- const onFinish = (values) => {
-
- console.log('Success:', values);
- };
- const onFinishFailed = (errorInfo) => {
- console.log('Failed:', errorInfo);
- };
- useImperativeHandle(ref, () => ({
- showDrawer (e) {
- if(e.item&&e.item.getModel()){
- // console.log(e.item.getModel().in_parameters);
- form.resetFields();
- form.setFieldsValue({...e.item.getModel(),in_parameters:JSON.parse(e.item.getModel().in_parameters),out_parameters:JSON.parse(e.item.getModel().out_parameters),control_strategy:JSON.parse(e.item.getModel().control_strategy)})
- setStagingItem({...e.item.getModel(),in_parameters:JSON.parse(e.item.getModel().in_parameters),out_parameters:JSON.parse(e.item.getModel().out_parameters),control_strategy:JSON.parse(e.item.getModel().control_strategy)})
- // form.setFieldsValue({...e.item.getModel(),in_parameters:JSON.parse(e.item.getModel().in_parameters),out_parameters:JSON.parse(e.item.getModel().out_parameters)})
- // setStagingItem({...e.item.getModel(),in_parameters:JSON.parse(e.item.getModel().in_parameters),out_parameters:JSON.parse(e.item.getModel().out_parameters)})
- // setTimeout(() => {
- // console.log(stagingItem);
- // }, (500));
- setOpen(true);
- }
-
- },
-
- }));
+ };
+ const onClose = () => {
+ setOpen(false);
+ };
+ const onFinish = (values) => {
+ console.log('Success:', values);
+ };
+ const onFinishFailed = (errorInfo) => {
+ console.log('Failed:', errorInfo);
+ };
+ useImperativeHandle(ref, () => ({
+ showDrawer(e) {
+ if (e.item && e.item.getModel()) {
+ // console.log(e.item.getModel().in_parameters);
+ form.resetFields();
+ form.setFieldsValue({
+ ...e.item.getModel(),
+ in_parameters: JSON.parse(e.item.getModel().in_parameters),
+ out_parameters: JSON.parse(e.item.getModel().out_parameters),
+ control_strategy: JSON.parse(e.item.getModel().control_strategy),
+ });
+ setStagingItem({
+ ...e.item.getModel(),
+ in_parameters: JSON.parse(e.item.getModel().in_parameters),
+ out_parameters: JSON.parse(e.item.getModel().out_parameters),
+ control_strategy: JSON.parse(e.item.getModel().control_strategy),
+ });
+ // form.setFieldsValue({...e.item.getModel(),in_parameters:JSON.parse(e.item.getModel().in_parameters),out_parameters:JSON.parse(e.item.getModel().out_parameters)})
+ // setStagingItem({...e.item.getModel(),in_parameters:JSON.parse(e.item.getModel().in_parameters),out_parameters:JSON.parse(e.item.getModel().out_parameters)})
+ // setTimeout(() => {
+ // console.log(stagingItem);
+ // }, (500));
+ setOpen(true);
+ }
+ },
+ }));
return (
<>
-
-
- {
{
},
]}
>
-
+
- 
- 任务信息
+ 
+ 任务信息
{
>
-
+
-
-
+
+
{
>
-
+
-
-
-
- {stagingItem.control_strategy&&Object.keys(stagingItem.control_strategy)&&Object.keys(stagingItem.control_strategy).length>0?Object.keys(stagingItem.control_strategy).map(item=>
-
-
-
+
+
- ):''}
+ {stagingItem.control_strategy &&
+ Object.keys(stagingItem.control_strategy) &&
+ Object.keys(stagingItem.control_strategy).length > 0
+ ? Object.keys(stagingItem.control_strategy).map((item) => (
+
+
+
+ ))
+ : ''}
- 
- 输入参数
+ 
+ 输入参数
- {stagingItem.in_parameters&&Object.keys(stagingItem.in_parameters)&&Object.keys(stagingItem.in_parameters).length>0?Object.keys(stagingItem.in_parameters).map(item=>
-
-
-
- ):''}
+ {stagingItem.in_parameters &&
+ Object.keys(stagingItem.in_parameters) &&
+ Object.keys(stagingItem.in_parameters).length > 0
+ ? Object.keys(stagingItem.in_parameters).map((item) => (
+
+
+
+ ))
+ : ''}
- 
- 输出参数
+ 
+ 输出参数
- {stagingItem.out_parameters&&Object.keys(stagingItem.out_parameters)&&Object.keys(stagingItem.out_parameters).length>0?Object.keys(stagingItem.out_parameters).map(item=>
-
-
-
- ):''}
+ {stagingItem.out_parameters &&
+ Object.keys(stagingItem.out_parameters) &&
+ Object.keys(stagingItem.out_parameters).length > 0
+ ? Object.keys(stagingItem.out_parameters).map((item) => (
+
+
+
+ ))
+ : ''}
>
diff --git a/react-ui/src/pages/Pipeline/index.jsx b/react-ui/src/pages/Pipeline/index.jsx
index e11380de..606f9e5b 100644
--- a/react-ui/src/pages/Pipeline/index.jsx
+++ b/react-ui/src/pages/Pipeline/index.jsx
@@ -1,250 +1,266 @@
-import React ,{ useState,useEffect,useRef }from 'react';
-import { Space, Table, Tag,Button,Modal, Form, Input ,message} from 'antd';
-import { PlusOutlined,PlusCircleOutlined, DeleteOutlined, ExclamationCircleOutlined, DownOutlined, EditOutlined ,CopyOutlined} from '@ant-design/icons';
-import {getWorkflow,addWorkflow,removeWorkflow,cloneWorkflow,getWorkflowById,editWorkflow} from '@/services/pipeline/index.js'
-import Styles from './index.less'
-import momnet from 'moment'
-import { useNavigate} from 'react-router-dom';
+import {
+ addWorkflow,
+ cloneWorkflow,
+ editWorkflow,
+ getWorkflow,
+ getWorkflowById,
+ removeWorkflow,
+} from '@/services/pipeline/index.js';
+import { CopyOutlined, DeleteOutlined, EditOutlined, PlusCircleOutlined } from '@ant-design/icons';
+import { Button, Form, Input, Modal, Space, Table, message } from 'antd';
+import momnet from 'moment';
+import { useEffect, useRef, useState } from 'react';
+import { useNavigate } from 'react-router-dom';
+import Styles from './index.less';
const { TextArea } = Input;
-const Pipeline = React.FC = () => {
- const [form] = Form.useForm();
- const navgite=useNavigate();
-
- const [formId,setFormId]=useState(null)
- const [dialogTitle,setDialogTitle]=useState('新建流水线')
- const [pipeList, setPipeList] = useState([]);
- const [total, setTotal] = useState(0);
- const [isModalOpen, setIsModalOpen] = useState(false);
- const editTable=(e,record)=>{
- e.stopPropagation()
- getWorkflowById(record.id).then(ret=>{
- if(ret.code==200){
- form.resetFields()
- form.setFieldsValue({...ret.data})
- setFormId(ret.data.id)
- setDialogTitle('编辑流水线')
- setIsModalOpen(true)
+const Pipeline = () => {
+ const [form] = Form.useForm();
+ const navgite = useNavigate();
+
+ const [formId, setFormId] = useState(null);
+ const [dialogTitle, setDialogTitle] = useState('新建流水线');
+ const [pipeList, setPipeList] = useState([]);
+ const [total, setTotal] = useState(0);
+ const [isModalOpen, setIsModalOpen] = useState(false);
+ const editTable = (e, record) => {
+ e.stopPropagation();
+ getWorkflowById(record.id).then((ret) => {
+ if (ret.code == 200) {
+ form.resetFields();
+ form.setFieldsValue({ ...ret.data });
+ setFormId(ret.data.id);
+ setDialogTitle('编辑流水线');
+ setIsModalOpen(true);
+ }
+ });
+ };
+ const routeToEdit = (e, record) => {
+ e.stopPropagation();
+ navgite({ pathname: `/pipeline/pytorchtext/${record.id}/${record.name}` });
+ };
+ const showModal = () => {
+ form.resetFields();
+ setDialogTitle('新建流水线');
+ setIsModalOpen(true);
+ };
+ const handleOk = () => {
+ console.log(1111);
+ setIsModalOpen(false);
+ };
+ const handleCancel = () => {
+ setIsModalOpen(false);
+ };
+ const onFinish = (values) => {
+ if (formId) {
+ editWorkflow({ ...values, id: formId }).then((ret) => {
+ message.success('编辑成功');
+ getList();
+ setIsModalOpen(false);
+ });
+ } else {
+ addWorkflow(values).then((ret) => {
+ console.log(ret);
+ if (ret.code == 200) {
+ navgite({ pathname: `/pipeline/pytorchtext/${ret.data.id}/${ret.data.name}` });
}
-
- })
-
+ });
}
- const routeToEdit=(e,record)=>{
- e.stopPropagation()
- navgite({pathname:`/pipeline/pytorchtext/${record.id}/${record.name}` });
- }
- const showModal = () => {
- form.resetFields()
- setDialogTitle('新建流水线')
- setIsModalOpen(true);
- };
- const handleOk = () => {
- console.log(1111);
- setIsModalOpen(false);
- };
- const handleCancel = () => {
- setIsModalOpen(false);
- };
- const onFinish = (values) => {
- if(formId){
- editWorkflow({...values,id:formId}).then(ret=>{
- message.success('编辑成功')
- getList()
- setIsModalOpen(false)
- })
- }
- else{
- addWorkflow(values).then(ret=>{
- console.log(ret);
- if(ret.code==200){
- navgite({pathname:`/pipeline/pytorchtext/${ret.data.id}/${ret.data.name}`,});
- }
- }
- )
- }
-
- };
- const onFinishFailed = (errorInfo) => {
- console.log('Failed:', errorInfo);
+ };
+ const onFinishFailed = (errorInfo) => {
+ console.log('Failed:', errorInfo);
+ };
+ const pageOption = useRef({ page: 1, size: 10 });
+ const paginationProps = {
+ showQuickJumper: true,
+ showTotal: () => `共${total}条`,
+ total: total,
+ page: pageOption.current.page,
+ size: pageOption.current.size,
+ onChange: (current, size) => paginationChange(current, size),
+ };
+ // 当前页面切换
+ const paginationChange = async (current, size) => {
+ console.log('page', current, size);
+ pageOption.current = {
+ page: current,
+ size: size,
};
- const pageOption = useRef({page: 1,size: 10})
- const paginationProps = {
- showQuickJumper: true,
- showTotal: () => `共${total}条`,
- total: total,
- page: pageOption.current.page,
+ getList();
+ };
+ const getList = () => {
+ let params = {
+ offset: 1,
+ page: pageOption.current.page - 1,
size: pageOption.current.size,
- onChange: (current, size) => paginationChange(current, size)
- }
- // 当前页面切换
- const paginationChange = async (current, size) => {
- console.log('page', current, size)
- pageOption.current={
- page:current,
- size:size
+ };
+ console.log(params, pageOption);
+ getWorkflow(params).then((ret) => {
+ if (ret.code == 200) {
+ setPipeList(ret.data.content);
+
+ setTotal(ret.data.totalElements);
}
- getList()
- }
- const getList=()=>{
- let params={
- offset:1,
- page:pageOption.current.page-1,
- size:pageOption.current.size
- }
- console.log(params,pageOption);
- getWorkflow(params).then(ret=>{
- if(ret.code==200){
- setPipeList(ret.data.content)
-
- setTotal(ret.data.totalElements)
- }
+ });
+ };
+ useEffect(() => {
+ getList();
+ }, []);
+ const columns = [
+ {
+ title: '序号',
+ dataIndex: 'index',
+ key: 'index',
+ width: 80,
+ render(text, record, index) {
+ return {(pageOption.current.page - 1) * 10 + index + 1};
+ },
+ // render: (text, record, index) => `${((curPage-1)*10)+(index+1)}`,
+ },
+ {
+ title: '流水线名称',
+ dataIndex: 'name',
+ key: 'name',
+ render: (text, record) => routeToEdit(e, record)}>{text},
+ },
+ {
+ title: '流水线描述',
+ dataIndex: 'description',
+ key: 'description',
+ },
+ {
+ title: '创建时间',
+ dataIndex: 'create_time',
+ key: 'create_time',
+ render: (text) => {momnet(text).format('YYYY-MM-DD HH:mm:ss')},
+ },
+ {
+ title: '修改时间',
+ dataIndex: 'update_time',
+ key: 'update_time',
+ render: (text) => {momnet(text).format('YYYY-MM-DD HH:mm:ss')},
+ },
+ {
+ title: '操作',
+ key: 'action',
- })
- }
- useEffect(()=>{
- getList()
- },[])
- const columns = [
- {
- title: '序号',
- dataIndex: 'index',
- key: 'index',
- width: 80,
- render(text, record, index) {
- return (
- {(pageOption.current.page - 1) * 10 + index + 1}
- )
- }
- // render: (text, record, index) => `${((curPage-1)*10)+(index+1)}`,
- },
- {
- title: '流水线名称',
- dataIndex: 'name',
- key: 'name',
- render: (text,record) => routeToEdit(e,record)}>{text},
- },
- {
- title: '流水线描述',
- dataIndex: 'description',
- key: 'description',
- },
- {
- title: '创建时间',
- dataIndex: 'create_time',
- key: 'create_time',
- render: (text) => {momnet(text).format('YYYY-MM-DD HH:mm:ss')},
- },
- {
- title: '修改时间',
- dataIndex: 'update_time',
- key: 'update_time',
- render: (text) => {momnet(text).format('YYYY-MM-DD HH:mm:ss')},
- },
- {
- title: '操作',
- key: 'action',
-
- render: (_, record) => (
-
- }
- onClick={(e) => {
- editTable(e,record)
- }}
- >
- 编辑
-
- }
- onClick={async () => {
- Modal.confirm({
- title: '复制',
- content: '确定复制该条流水线吗?',
- okText: '确认',
- cancelText: '取消',
- onOk: () => {
- console.log(record);
- cloneWorkflow(record.id).then(ret=>{
- if(ret.code==200){
- message.success('复制成功')
- getList()
+ render: (_, record) => (
+
+ }
+ onClick={(e) => {
+ editTable(e, record);
+ }}
+ >
+ 编辑
+
+ }
+ onClick={async () => {
+ Modal.confirm({
+ title: '复制',
+ content: '确定复制该条流水线吗?',
+ okText: '确认',
+ cancelText: '取消',
+ onOk: () => {
+ console.log(record);
+ cloneWorkflow(record.id).then((ret) => {
+ if (ret.code == 200) {
+ message.success('复制成功');
+ getList();
+ } else {
+ message.error('复制失败');
}
- else{
- message.error('复制失败')
+ });
+
+ // if (success) {
+ // if (actionRef.current) {
+ // actionRef.current.reload();
+ // }
+ // }
+ },
+ });
+ }}
+ >
+ 复制
+
+ }
+ onClick={async () => {
+ Modal.confirm({
+ title: '删除',
+ content: '确定删除该条流水线吗?',
+ okText: '确认',
+ cancelText: '取消',
+ onOk: () => {
+ console.log(record);
+ removeWorkflow(record.id).then((ret) => {
+ if (ret.code == 200) {
+ message.success('删除成功');
+ getList();
+ } else {
+ message.error(ret.msg);
}
- });
-
- // if (success) {
- // if (actionRef.current) {
- // actionRef.current.reload();
- // }
- // }
- },
- });
- }}
- >
- 复制
-
+ });
+
+ // if (success) {
+ // if (actionRef.current) {
+ // actionRef.current.reload();
+ // }
+ // }
+ },
+ });
+ }}
+ >
+ 删除
+
+
+ ),
+ },
+ ];
+ return (
+ |