This commit is contained in:
xixi 2024-07-15 18:41:42 +08:00
parent 75c8a8a788
commit f2202f1674
3 changed files with 67 additions and 26 deletions

View File

@ -164,6 +164,7 @@ export default function CardProj(props: any) {
<img src={downloadUrl(data.codeTypePage.previewImgs)} width={'249px'} height={'143px'} alt="" />
</div>
</Carousel>
</div>
{/* <img src={downloadUrl(data.codeTypePage.previewImgs)} className='cpb-left-img' alt="" /> */}

View File

@ -7,7 +7,7 @@ import {
message, Modal,
Tag, Upload,
// GetProp,
UploadProps,
UploadProps,
} from "antd";
import { UploadOutlined } from '@ant-design/icons';
import TextArea from "antd/es/input/TextArea";
@ -50,6 +50,8 @@ import DisplayOrderShow from '../../route/proj/edit/ProjConfigMenuListShow.tsx'
// }
// type FileType = Parameters<GetProp<UploadProps, 'beforeUpload'>>[0];
export default function ProjEditAll() {
//证书img
const [certificate, setcertificate] = useState('')
// 回复信息
const [aContent, setaContent] = useState('')
// 回复问题的id
@ -58,6 +60,7 @@ export default function ProjEditAll() {
const [uploadedFiles, setUploadedFiles] = useState<any[]>([]);
// 接口需要的文件id数组
// const [aFiles, setAFiles] = useState<string[]>([])
const [isUploadDisabled, setIsUploadDisabled] = useState(false);
const props: UploadProps = {
maxCount: 6,//上传限制最多6个
action: uploadFileUrl(),
@ -82,6 +85,7 @@ export default function ProjEditAll() {
return Upload.LIST_IGNORE; // 不允许上传重复文件
}
return true; // 允许上传文件
},
onChange: (info) => {
@ -89,16 +93,20 @@ export default function ProjEditAll() {
if (info.file.status === 'done') {
message.success('上传成功');
// info.file.name = '协议文件';
console.log('列表', info.fileList);
console.log('列表', info.file);
setUploadedFiles([...uploadedFiles, info.file]); // 将上传成功的文件信息添加到列表中
// setUploadSignFileId(info.file.response.data.fileId);
} else if (info.file.status === 'error') {
message.error('上传失败');
}
setIsUploadDisabled(info.fileList.length >= 6);
},
// action={uploadFileUrl()}
onRemove: (info) => {
console.log('删除', info);
setUploadedFiles(prevFiles => prevFiles.filter(prevFile => prevFile.uid !== info.uid));
}
};
// const [uploadSignFileId, setUploadSignFileId] = useState('');
@ -334,8 +342,11 @@ export default function ProjEditAll() {
const renderData = () => {
get<any>({
messageApi: messageApi,
url: `/api/proj/get/${pathParams.projId}`,
// url: `/api/proj/get/${pathParams.projId}`,
url: `/api/proj/claim/get/${pathParams.projId}`,
onSuccess({ data }) {
console.log('嘻嘻', data);
setcertificate(data.certificates)
console.log('状态判断', data.pay.chargeAdditionals);
// setShowZpi(true)
// const isShow = data.pay.chargeAdditionals.includes('PKG')
@ -573,6 +584,15 @@ export default function ProjEditAll() {
window.open(`${Axios.defaults?.baseURL}/route/proj/download/code/${pathParams.projId}`)
}}
/>
<CardProjDownload title="证书下载"
desc="点击下载证书"
canBtnClick={certificate!=''}
handleDownload={() => {
window.open(downloadUrl(certificate,false),'_blank')
}}
/>
{/*<CardProjJump title="找代理"*/}
{/* desc="到软著代理完成软著申请"*/}
{/* handleJump={() => {*/}
@ -589,7 +609,7 @@ export default function ProjEditAll() {
<div style={{ display: questionList.length == 0 ? 'block' : 'none' }} className='editAll-boxNo-con'>
</div>
<div style={{ marginTop: 50, maxHeight: `${height - 230}px`, overflow: 'auto' }}>
<div style={{ marginTop: 50, maxHeight: `${height - 230}px`, overflow: 'auto',width:'100%' }}>
{questionList.length == 0 ? (<>
</>) : (<>
{questionList.map((item, index) => (
@ -607,27 +627,44 @@ export default function ProjEditAll() {
{item.qContent}
</div>
<div className='unReason' style={{ display: item.status == 'UN_PASSED' ? 'block' : 'none' }}>:{item.reason}</div>
<div className='fileBox' >
<a style={{ cursor: 'pointer' }} onClick={() => {
{/* <div style={{ cursor: 'pointer' }} onClick={() => {
window.open(downloadUrl(item.qFiles))
}}>{item.qFiles}</a>
}}>{item.qFiles}</div> */}
{item.qFileKVs.length == 0 ? (<></>) : (<>
{item.qFileKVs.map((item: any, index: number) => (
<span key={index}>
<div style={{ cursor: 'pointer', color: 'var(--color-blue)', wordWrap: 'break-word', widows: '100%' }} onClick={() => {
// window.open(downloadUrl(item.key))
window.open(downloadUrl(item.key,false),'_blank')
}}>{item.value} </div>
{/* <span style={{ marginRight: 5, visibility: index + 1 == JSON.parse(item.aFiles).length ? 'hidden' : 'visible' }}>,</span> */}
</span>
))}
</>)}
</div>
<div className='unReason' style={{ display: item.status == 'UN_PASSED' ? 'block' : 'none' }}>:{item.reason}</div>
</div>
<div className='boxtitle' style={{}}></div>
<div className='boxtextBot'>
<div style={{ maxHeight: '100px', overflow: 'auto', fontSize: 16 }}>{item.aContent}</div>
<div className='fileBox'>
{JSON.parse(item.aFiles).map((fileName: string, index: number) => (
<span key={index}>
<a style={{ cursor: 'pointer', }} onClick={() => {
window.open(downloadUrl(fileName))
}}>{fileName} </a>
{item.aFileKVs.length == 0 ? (<></>) : (<>
{item.aFileKVs.map((item: any, index: number) => (
<span key={index}>
<div style={{ cursor: 'pointer', color: 'var(--color-blue)' }} onClick={() => {
// window.open(downloadUrl(item.key))
window.open(downloadUrl(item.key,false),'_blank')
}}>{item.value} </div>
{/* <span style={{ marginRight: 5, visibility: index + 1 == JSON.parse(item.aFiles).length ? 'hidden' : 'visible' }}>,</span> */}
</span>
))}
</>)}
<span style={{marginRight:5, visibility: index + 1 == JSON.parse(item.aFiles).length ? 'hidden' : 'visible' }}>,</span>
</span>
))}
</div>
<div style={{ display: 'flex', justifyContent: 'flex-end' }}>
@ -962,25 +999,27 @@ export default function ProjEditAll() {
width={800}
onOk={() => {
console.log('上传文件', uploadedFiles);
// return
console.log('上传信息', aContent)
if(aContent==''){
if (aContent == '') {
messageApi.open({
type: 'error',
content: '请回复内容'
})
}else if(uploadedFiles.length == 0){
} else if (uploadedFiles.length == 0) {
messageApi.open({
type: 'error',
content: '请上传文件'
})
}else{
} else {
put({
messageApi,
url: `/api/proj/materials/add/update-a/${projMaterialsAddId}`,
body: {
aContent,
aFiles: uploadedFiles.map(file => file.response.data.fileId)
// aFiles: uploadedFiles.map(file => file.response.data.fileId)
aFiles: uploadedFiles.map(file => file.response.data.fileId).join(',')
},
onBefore() {
},
@ -1047,7 +1086,7 @@ export default function ProjEditAll() {
</div>
<Upload {...props} listType="picture" multiple>
<Button icon={<UploadOutlined />}></Button>
<Button disabled={isUploadDisabled} icon={<UploadOutlined />}></Button>
</Upload>
</div>
</div>

View File

@ -116,7 +116,8 @@
margin-top: 10px;
min-height: 40px;
/* overflow: scroll; */
text-align: justify; /* 让文字两端对齐 */
/* text-align: justify; 让文字两端对齐 */
width: 100%;
}