system-copyright-react/src/components/card/CardProjDownload.tsx

120 lines
7.5 KiB
TypeScript
Raw Normal View History

2024-03-15 18:18:29 +08:00
import './card-proj-download.css';
2024-05-10 11:33:40 +08:00
import { IProjDownload } from "../../interfaces/card/ICardProj.ts";
2025-02-26 16:57:47 +08:00
import {
CloseOutlined, RedoOutlined,
} from '@ant-design/icons';
// import { useEffect } from "react";
2024-03-15 18:18:29 +08:00
export default function CardProjDownload(props: IProjDownload) {
2025-02-26 16:57:47 +08:00
// useEffect(() => {
// console.log(props);
// }, [])
2024-03-15 18:18:29 +08:00
return (
2024-05-10 11:33:40 +08:00
// <div className="card-proj-download">
<div className={props.canBtnClick ? 'card-proj-download' : 'card-proj-nodownload'}>
<div className="cpDown-title">{props.title}</div>
<div className='cpDown-bot'>
<div className="cpDown-desc">{props.desc}</div>
<div className="cpDown-option">
{
props.canBtnClick ? (
2024-09-13 16:45:01 +08:00
<div>
2025-03-11 15:34:41 +08:00
<div style={{ display: props.title == '证书下载' ? 'unset' : 'none' }}>
2024-09-13 16:45:01 +08:00
<a href="/#" className="cpDown-edit" style={{ minWidth: 30 }} onClick={(e) => {
e.preventDefault();
props.handleDownload();
}}></a>
2025-02-26 16:57:47 +08:00
</div>
<div style={{ display: props.title == '安装包' ? 'unset' : 'none' }}>
<a href="/#" className="cpDown-edit" style={{ minWidth: 30, display: props.pkgStatus == 'SUCCESS' ? 'unset' : 'none' }} onClick={(e) => {
e.preventDefault();
props.handleDownload();
}}></a>
<div title='安装包打包失败,点击重新打包'
onClick={()=>{
props.againPkg()
}}
style={{ minWidth: 30, display: props.pkgStatus == 'FAIL' ? 'unset' : 'none',color:'red',fontWeight:700,cursor:'pointer',whiteSpace: 'nowrap', }}>
<span style={{marginRight:5}}></span><CloseOutlined />
</div>
<div title='正在打包,点击刷新状态' style={{ minWidth: 30, display: props.pkgStatus == 'PKGING' ? 'unset' : 'none',cursor:'pointer',color:'rgba(64, 149, 229, 1)',
//禁止换行
whiteSpace: 'nowrap',
}}
onClick={()=>{
props.upData()
}}
>
<span style={{marginRight:5}}></span><span style={{color:'green'}}>< RedoOutlined spin /></span>
</div>
</div>
<div style={{ display: props.title == '演示视频' ? 'unset' : 'none' }} >
<a href="/#" className="cpDown-edit" style={{ minWidth: 30,display:props.videoStatus == 'SUCCESS'?'unset':'none'}} onClick={(e) => {
e.preventDefault();
props.handleDownload();
}}></a>
<div title='演示视频打包失败,点击重新打包'
onClick={()=>{
// props.againPkg()
props.againVideo()
}}
style={{ minWidth: 30, display: props.videoStatus == 'FAIL' ? 'unset' : 'none',color:'red',fontWeight:700,cursor:'pointer' ,whiteSpace: 'nowrap',}}>
<span style={{marginRight:5}}></span><CloseOutlined />
</div>
<div title='正在打包,点击刷新状态' style={{ minWidth: 30, display: props.videoStatus == 'PKGING' ? 'unset' : 'none',cursor:'pointer',color:'rgba(64, 149, 229, 1)',
//禁止换行
whiteSpace: 'nowrap',
}}
onClick={()=>{
// props.upData()
props.upVideoData()
}}
>
<span style={{marginRight:5}}></span><span style={{color:'green'}}>< RedoOutlined spin /></span>
</div>
2024-09-13 16:45:01 +08:00
</div>
2025-03-11 15:34:41 +08:00
<div style={{ display: props.title == '申请表' ||props.title == '操作手册' || props.title == '源代码' ? 'unset' : 'none' }}>
2024-09-13 16:45:01 +08:00
2025-02-26 16:57:47 +08:00
<a href="/#" className="cpDown-edit" style={{ minWidth: 30}} onClick={(e) => {
2024-09-13 16:45:01 +08:00
e.preventDefault();
props.handleDownload();
}}>word</a>
<a href="/#" className="cpDown-edit" style={{ minWidth: 30, marginLeft: 5 }} onClick={(e) => {
e.preventDefault();
props.downPdf();
2025-03-11 15:34:41 +08:00
}}>{props.title == '申请表'?'txt':'pdf'}</a>
2024-09-13 16:45:01 +08:00
</div>
</div>
2024-05-10 11:33:40 +08:00
) : (
2024-09-13 16:45:01 +08:00
// <a href="/#" className="cpDown-noedit" style={{ color: '#c2c2c2',minWidth:30 }} onClick={(e) => {
// e.preventDefault();
// }}>下载</a>
<div>
2025-03-11 15:34:41 +08:00
<div style={{ display: props.title == '代码压缩包' ? 'unset' : 'none' }}>
2024-09-13 16:45:01 +08:00
<a href="/#" className="cpDown-noedit" style={{ color: '#c2c2c2', minWidth: 30 }} onClick={(e) => {
e.preventDefault();
}}></a>
</div>
2025-03-11 15:34:41 +08:00
<div style={{ display: props.title == '申请表' || props.title == '操作手册' || props.title == '源代码' ? 'unset' : 'none' }}>
2025-02-26 16:57:47 +08:00
2024-09-13 16:45:01 +08:00
<div style={{ color: '#c2c2c2' }}> <a href="/#" className="cpDown-noedit" style={{ color: '#c2c2c2', minWidth: 30 }} onClick={(e) => {
e.preventDefault();
}} >word</a> <a href="/#" className="cpDown-noedit" style={{ color: '#c2c2c2', minWidth: 30 }} onClick={(e) => {
e.preventDefault();
2025-03-11 15:34:41 +08:00
}}>{props.title == '申请表'?'txt':'pdf'}</a></div>
2024-09-13 16:45:01 +08:00
</div>
</div>
2024-05-10 11:33:40 +08:00
)
}
2024-03-26 21:09:41 +08:00
2024-05-10 11:33:40 +08:00
</div>
2024-03-15 18:18:29 +08:00
</div>
2024-05-10 11:37:55 +08:00
<div className='downBoxx'></div>
2024-03-15 18:18:29 +08:00
</div>
)
}