|
1 | 1 | // cl 2021/8/5 19:12 |
2 | 2 | import React, { useEffect, useState } from 'react'; |
3 | 3 | import { IFileInfo, IProjectInfo, IStepInfo, useAnnotation } from '@/store'; |
4 | | -import { message, Popconfirm, Tag, Spin } from 'antd'; |
| 4 | +import { message, Popconfirm, Tag, Spin, Tooltip } from 'antd'; |
5 | 5 | import { EToolName, TOOL_NAME } from '@/constant/store'; |
6 | 6 | import { |
7 | 7 | DeleteOutlined, |
8 | 8 | QuestionCircleOutlined, |
9 | 9 | EditOutlined, |
10 | 10 | FolderOpenOutlined, |
11 | 11 | DeliveredProcedureOutlined, |
| 12 | + CopyOutlined, |
12 | 13 | } from '@ant-design/icons'; |
13 | 14 | import SelectFolder from '@/ProjectPlatform/CreateProjectModal/SelectFolder'; |
14 | 15 | import ExportData from './ExportData'; |
15 | 16 | import styles from '../index.module.scss'; |
16 | 17 | import { EIpcEvent } from '@/constant/event'; |
17 | | -import { formatDate, jsonParser } from '@/utils/tool/common'; |
| 18 | +import { copyText, formatDate, jsonParser } from '@/utils/tool/common'; |
18 | 19 | import { IProjectType } from '@/ProjectPlatform'; |
19 | 20 | import IconRect from '@/assets/toolIcon/icon_rect.svg'; |
20 | 21 | import IconLine from '@/assets/toolIcon/icon_line.svg'; |
@@ -254,22 +255,37 @@ const ProjectList: React.FC<IProps> = ({ createProject }) => { |
254 | 255 | </div> |
255 | 256 | {hoverIndex === i && ( |
256 | 257 | <div className={styles.deleteButton}> |
257 | | - <DeliveredProcedureOutlined |
258 | | - onClick={(e) => { |
259 | | - e.stopPropagation(); |
260 | | - setProjectInfo(info); |
261 | | - }} |
262 | | - className={styles.icon} |
263 | | - style={{ marginRight: 12 }} |
264 | | - /> |
265 | | - <EditOutlined |
266 | | - onClick={(e) => { |
267 | | - e.stopPropagation(); |
268 | | - editProject(info); |
269 | | - }} |
270 | | - className={styles.icon} |
271 | | - style={{ marginRight: 12 }} |
272 | | - /> |
| 258 | + <Tooltip title={t('CopyProjectConfig')}> |
| 259 | + <CopyOutlined |
| 260 | + onClick={(e) => { |
| 261 | + e.stopPropagation(); |
| 262 | + copyText(JSON.stringify(info.stepList)); |
| 263 | + message.success(t('CopyConfigSuccessfully')); |
| 264 | + }} |
| 265 | + className={styles.icon} |
| 266 | + style={{ marginRight: 12 }} |
| 267 | + /> |
| 268 | + </Tooltip> |
| 269 | + <Tooltip title={t('ExportAnnotationResults')}> |
| 270 | + <DeliveredProcedureOutlined |
| 271 | + onClick={(e) => { |
| 272 | + e.stopPropagation(); |
| 273 | + setProjectInfo(info); |
| 274 | + }} |
| 275 | + className={styles.icon} |
| 276 | + style={{ marginRight: 12 }} |
| 277 | + /> |
| 278 | + </Tooltip> |
| 279 | + <Tooltip title={t('ModifyConfig')}> |
| 280 | + <EditOutlined |
| 281 | + onClick={(e) => { |
| 282 | + e.stopPropagation(); |
| 283 | + editProject(info); |
| 284 | + }} |
| 285 | + className={styles.icon} |
| 286 | + style={{ marginRight: 12 }} |
| 287 | + /> |
| 288 | + </Tooltip> |
273 | 289 | <span |
274 | 290 | onClick={(e) => { |
275 | 291 | e.stopPropagation(); |
|
0 commit comments