This commit is contained in:
parent
d447a6f0f3
commit
dc93dc0438
|
@ -198,6 +198,17 @@ export default [
|
|||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: '代码配置',
|
||||
path: 'codeConfig',
|
||||
routes: [
|
||||
{
|
||||
name: '代码配置',
|
||||
path: '',
|
||||
component: './CodeConfig/List',
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
|
|
|
@ -10,6 +10,12 @@ export enum CommonTabKeys {
|
|||
Public = 'Public', // 公开
|
||||
}
|
||||
|
||||
// 公开还是私有
|
||||
export enum AvailableRange {
|
||||
Public = 1, // 公开
|
||||
Private = 0, // 私有
|
||||
}
|
||||
|
||||
// 实验状态
|
||||
export enum ExperimentStatus {
|
||||
Running = 'Running', // 运行中
|
||||
|
|
|
@ -9,7 +9,7 @@ import { App, Button, Input, Pagination, PaginationProps } from 'antd';
|
|||
import { Ref, forwardRef, useEffect, useImperativeHandle, useState } from 'react';
|
||||
import { CategoryData, ResourceData, ResourceType, resourceConfig } from '../../config';
|
||||
import AddDatasetModal from '../AddDatasetModal';
|
||||
import ResourceItem from '../Resourcetem';
|
||||
import ResourceItem from '../ResourceItem';
|
||||
import styles from './index.less';
|
||||
|
||||
export type ResourceListRef = {
|
||||
|
@ -161,7 +161,7 @@ function ResourceList(
|
|||
<span>数据总数:{total}个</span>
|
||||
<div>
|
||||
<Input.Search
|
||||
placeholder="按数据名称筛选"
|
||||
placeholder={`按${config.name}名称筛选`}
|
||||
allowClear
|
||||
onSearch={handleSearch}
|
||||
style={{
|
||||
|
|
|
@ -1,61 +0,0 @@
|
|||
.resource-item {
|
||||
position: relative;
|
||||
width: calc(25% - 15px);
|
||||
padding: 20px;
|
||||
background: white;
|
||||
border: 1px solid #eaeaea;
|
||||
border-radius: 4px;
|
||||
cursor: pointer;
|
||||
|
||||
@media screen and (max-width: 1860px) {
|
||||
& {
|
||||
width: calc(33.33% - 13.33px);
|
||||
}
|
||||
}
|
||||
|
||||
&__name {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
height: 24px;
|
||||
margin: 0 10px 0 0 !important;
|
||||
color: @text-color;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
&__description {
|
||||
height: 44px;
|
||||
margin-bottom: 20px;
|
||||
color: @text-color-secondary;
|
||||
font-size: 14px;
|
||||
.multiLine(2);
|
||||
}
|
||||
&__time {
|
||||
display: flex;
|
||||
flex: 0 1 content;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
color: #808080;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
border-color: @primary-color;
|
||||
box-shadow: 0px 0px 6px 1px rgba(0, 0, 0, 0.1);
|
||||
|
||||
.resource-item__name {
|
||||
color: @primary-color;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.resource-item__name {
|
||||
&::after {
|
||||
position: absolute;
|
||||
top: 14px;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 6px;
|
||||
background: linear-gradient(to right, rgba(22, 100, 255, 0.3) 0, rgba(22, 100, 255, 0) 100%);
|
||||
content: '';
|
||||
}
|
||||
}
|
|
@ -1,54 +0,0 @@
|
|||
import clock from '@/assets/img/clock.png';
|
||||
import creatByImg from '@/assets/img/creatBy.png';
|
||||
import KFIcon from '@/components/KFIcon';
|
||||
import { formatDate } from '@/utils/date';
|
||||
import { Button, Flex, Typography } from 'antd';
|
||||
import { ResourceData } from '../../config';
|
||||
import styles from './index.less';
|
||||
|
||||
type ResourceItemProps = {
|
||||
item: ResourceData;
|
||||
isPublic: boolean;
|
||||
onRemove: (item: ResourceData) => void;
|
||||
onClick: (item: ResourceData) => void;
|
||||
};
|
||||
|
||||
function ResourceItem({ item, isPublic, onClick, onRemove }: ResourceItemProps) {
|
||||
return (
|
||||
<div className={styles['resource-item']} onClick={() => onClick(item)}>
|
||||
<Flex justify="space-between" align="center" style={{ marginBottom: '20px', height: '32px' }}>
|
||||
<Typography.Paragraph
|
||||
className={styles['resource-item__name']}
|
||||
ellipsis={{ tooltip: item.name }}
|
||||
>
|
||||
{item.name}
|
||||
</Typography.Paragraph>
|
||||
{!isPublic && (
|
||||
<Button
|
||||
type="text"
|
||||
shape="circle"
|
||||
onClick={(e) => {
|
||||
e.stopPropagation();
|
||||
onRemove(item);
|
||||
}}
|
||||
>
|
||||
<KFIcon type="icon-shanchu" font={17} />
|
||||
</Button>
|
||||
)}
|
||||
</Flex>
|
||||
<div className={styles['resource-item__description']}>{item.description}</div>
|
||||
<Flex justify="space-between">
|
||||
<div className={styles['resource-item__time']}>
|
||||
<img style={{ width: '17px', marginRight: '6px' }} src={creatByImg} alt="" />
|
||||
<span>{item.create_by}</span>
|
||||
</div>
|
||||
<div className={styles['resource-item__time']}>
|
||||
<img style={{ width: '12px', marginRight: '5px' }} src={clock} alt="" />
|
||||
<span>最近更新: {formatDate(item.update_time, 'YYYY-MM-DD')}</span>
|
||||
</div>
|
||||
</Flex>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export default ResourceItem;
|
|
@ -166,7 +166,7 @@ function EditorList() {
|
|||
key: 'name',
|
||||
width: '30%',
|
||||
render: (text, record) =>
|
||||
record.url ? (
|
||||
record.url && record.status === DevEditorStatus.Running ? (
|
||||
<a className="kf-table-row-link" onClick={(e) => gotoEditorPage(e, record)}>
|
||||
{text}
|
||||
</a>
|
||||
|
|
Loading…
Reference in New Issue