@@ -246,9 +240,9 @@ function MirrorList() {
placeholder="按数据集名称筛选"
allowClear
onSearch={onSearch}
- onChange={(e) => setSearchText(e.target.value)}
+ onChange={(e) => setInputText(e.target.value)}
style={{ width: 300 }}
- value={searchText}
+ value={inputText}
/>
{activeTab === CommonTabKeys.Private && (
+
+
+
+
+ );
+}
+
+export default AddModelModal;
diff --git a/react-ui/src/pages/Model/index.jsx b/react-ui/src/pages/Model/index.jsx
index 310823f4..f8add51f 100644
--- a/react-ui/src/pages/Model/index.jsx
+++ b/react-ui/src/pages/Model/index.jsx
@@ -1,89 +1,7 @@
-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;
-const { TabPane } = Tabs;
-const leftdataList = [1, 2, 3];
+import ResourcePage from '@/pages/Dataset/components/ResourcePage';
+import { ResourceType } from '@/pages/Dataset/type';
-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 [form] = Form.useForm();
- const [dialogTitle, setDialogTitle] = useState('新建数据');
- // const getModelLists=()=>{
- // getModelList(queryFlow).then(ret=>{
- // console.log(ret);
- // if(ret.code==200){
- // setDatasetList(ret.data.content)
- // setTotal(ret.data.totalElements)
- // }
- // })
- // }
-
- const showModal = () => {
- form.resetFields();
- setDialogTitle('新建数据集');
- setIsModalOpen(true);
- };
- const handleOk = () => {
- console.log(1111);
- setIsModalOpen(false);
- };
- const handleCancel = () => {
- setIsModalOpen(false);
- };
- const onFinish = (values) => {};
- const routeToIntro = (e, record) => {
- e.stopPropagation();
- navgite({ pathname: '/dataset/dataset' });
- };
- const onFinishFailed = (errorInfo) => {
- console.log('Failed:', errorInfo);
- };
- useEffect(() => {
- return () => {};
- }, []);
- return (
-
-
-
-
-
-
-
- }
- >
-
-
-
-
-
- }
- >
-
-
-
-
-
- );
+const ModelPage = () => {
+ return
;
};
-export default Dataset;
+export default ModelPage;
diff --git a/react-ui/src/pages/Model/index.less b/react-ui/src/pages/Model/index.less
index defa446f..596c64d7 100644
--- a/react-ui/src/pages/Model/index.less
+++ b/react-ui/src/pages/Model/index.less
@@ -1,13 +1,3 @@
-.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;
@@ -78,250 +68,11 @@
}
}
}
-.datasetAllBox {
- :global {
- .ant-tabs-nav .ant-tabs-nav-wrap {
- margin: -48px 0 0 30px;
- }
- }
-}
.plusButton {
margin: 0 18px 0 20px;
}
-.datasetCneterBox {
- display: flex;
- justify-content: space-between;
- width: 100%;
- height: 87.5vh;
-
- .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;
- }
- }
- .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: 1;
- flex-direction: column;
- height: 100%;
- overflow-y: auto;
- 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: 23.8%;
- height:164px;
- margin: 0 20px 25px 0;
- background: #ffffff;
- border: 1px solid;
- border-color: #eaeaea;
- border-radius: 4px;
- cursor: pointer;
- .dropdown{
- position: absolute;
- right: 20px;
- top: 15px;
- }
- .itemText {
- position: absolute;
- top: 20px;
- left: 20px;
- height: 6px;
- color: #1d1d20;
- font-size: 16px;
- font-family: 'Alibaba';
- line-height: 0px;
- background: linear-gradient(
- to right,
- rgba(22, 100, 255, 0.3) 0,
- rgba(22, 100, 255, 0) 100%
- );
- }
- .itemDescripition {
- position: absolute;
- top: 57px;
- left: 20px;
- display: -webkit-box;
- padding-right: 28px;
- overflow: hidden;
- color: #575757;
- font-size: 14px;
- word-break: break-all;
- -webkit-line-clamp: 2;
- -webkit-box-orient: vertical;
- }
- .itemTime {
- position: absolute;
- bottom: 22px;
- left: 20px;
- display: flex;
- align-items: center;
- color: #808080;
- font-size: 13px;
- }
- .itemIcon {
- position: absolute;
- right: 20px;
- bottom: 22px;
- display: flex;
- align-items: center;
- color: #808080;
- font-size: 13px;
- }
- }
- .dataItem:hover {
- border-color: #1664ff;
- box-shadow: 0px 0px 6px 1px rgba(0, 0, 0, 0.1);
- }
- .dataItem:hover .itemText {
- color: #1664ff;
- }
- }
- }
-}
-.tipContent{
- color: #c73131;
+.tipContent {
margin-top: 5px;
-}
-.modal {
- :global {
- .ant-modal-content {
- width: 825px;
- padding: 20px 67px;
- background-image: url(/assets/images/modal-back.png);
- background-repeat: no-repeat;
- background-position: top center;
- background-size: 100%;
- border-radius: 21px;
- }
- .ant-modal-header {
- margin: 20px 0;
- background-color: transparent;
- }
- .ant-input {
- height: 40px;
- border-color: #e6e6e6;
- }
- .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;
- }
- }
+ color: #c73131;
}
diff --git a/react-ui/src/pages/Model/modelIntro.jsx b/react-ui/src/pages/Model/modelIntro.jsx
index 5cc9477d..d978f15e 100644
--- a/react-ui/src/pages/Model/modelIntro.jsx
+++ b/react-ui/src/pages/Model/modelIntro.jsx
@@ -1,5 +1,6 @@
import { getAccessToken } from '@/access';
import KFIcon from '@/components/KFIcon';
+import KFModal from '@/components/KFModal';
import {
addModelsVersionDetail,
deleteModelVersion,
@@ -8,18 +9,19 @@ import {
getModelVersionsById,
} from '@/services/dataset/index.js';
import { downLoadZip } from '@/utils/downloadfile';
+import { modalConfirm } from '@/utils/ui';
import { UploadOutlined } from '@ant-design/icons';
-import { Button, Form, Input, Modal, Select, Table, Tabs, Upload, message } from 'antd';
+import { useParams, useSearchParams } from '@umijs/max';
+import { Button, Form, Input, Select, Table, Tabs, Upload, message } from 'antd';
import moment from 'moment';
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 = () => {
const props = {
- action: '/api/mmp/dataset/upload',
+ action: '/api/mmp/models/upload',
// headers: {
// 'X-Requested-With': null
// },
@@ -53,9 +55,11 @@ const Dataset = () => {
const [version, setVersion] = useState(null);
const [versionList, setVersionList] = useState([]);
const locationParams = useParams(); //新版本获取路由参数接口
+ const [searchParams] = useSearchParams();
console.log(locationParams);
const [wordList, setWordList] = useState([]);
const [uuid, setUuid] = useState(Date.now());
+ const isPublic = searchParams.get('isPublic') === 'true';
const getModelByDetail = () => {
getModelById(locationParams.id).then((ret) => {
console.log(ret);
@@ -76,6 +80,9 @@ const Dataset = () => {
);
setVersion(ret.data[0]);
getModelVersions({ version: ret.data[0], models_id: locationParams.id });
+ } else {
+ setVersion(null);
+ setWordList([]);
}
});
};
@@ -96,18 +103,9 @@ const Dataset = () => {
setIsModalOpen(false);
};
const deleteDataset = () => {
- Modal.confirm({
- title: (
-
-

-
删除后,该模型版本将不可恢复
-
- ),
- content:
是否确认删除?
,
+ modalConfirm({
+ title: '删除后,该版本将不可恢复',
+ content: '是否确认删除?',
okText: '确认',
cancelText: '取消',
@@ -262,15 +260,18 @@ const Dataset = () => {
- }
- >
- 删除
-
+ {!isPublic && (
+ }
+ >
+ 删除
+
+ )}
+
{
-
-
- {dialogTitle}
-