update issue

This commit is contained in:
caishi 2022-05-19 17:56:42 +08:00
parent 24bb69cc22
commit f8a9c0785f
6 changed files with 56 additions and 42 deletions

View File

@ -7,6 +7,7 @@
<meta name=”Keywords” Content=”issue,bug,tracker,软件工程,课程实践″>
<meta name=”Description” Content=”持续构建协同、共享、可信的软件创建生态开源创作与软件生产相结合,支持大规模群体开展软件协同创新活动”>
<meta name="theme-color" content="#000000">
<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests" />
<link rel="manifest" href="%PUBLIC_URL%/manifest.json">
<link rel="stylesheet" type="text/css" href="%PUBLIC_URL%css/iconfont.css">

View File

@ -25,7 +25,7 @@ if (isDev) {
}
debugType = window.location.search.indexOf('debug=t') !== -1 ? 'teacher' :
window.location.search.indexOf('debug=s') !== -1 ? 'student' :
window.location.search.indexOf('debug=a') !== -1 ? 'admin' : parsed.debug || 'admin'
window.location.search.indexOf('debug=a') !== -1 ? 'admin' : parsed.debug || 'student'
}
window._debugType = debugType;
export function initAxiosInterceptors(props) {

View File

@ -11,7 +11,7 @@ function SystemNotice({showNotice,system_notification,history,login,hideSystemNo
useEffect(()=>{
if(system_notification && !system_notification.is_read && showNotice && login){
if((system_notification && !system_notification.is_read) && showNotice && login){
setVisible(true);
}
},[system_notification,login])
@ -22,11 +22,12 @@ function SystemNotice({showNotice,system_notification,history,login,hideSystemNo
axios.post(url,{
system_notification_id:system_notification.id
}).then(result=>{
if(result){
setVisible(false);
hideSystemNotice();
}
}).catch(error=>{})
setVisible(false);
hideSystemNotice();
}).catch(error=>{
setVisible(false);
hideSystemNotice();
})
}else{
setVisible(false);
hideSystemNotice();

View File

@ -69,13 +69,23 @@ function Data(props){
}
function handleDownExcel(task_id){
const oa = document.createElement('a');
oa.href = `/api/traces/${owner}/${projectsId}/task_pdf.json?task_id=${task_id}`;
oa.setAttribute('target', '_blank');
oa.setAttribute("download","report.pdf");
document.body.appendChild(oa);
oa.click();
document.body.removeChild(oa);
setSpining(true);
const url = `/api/traces/${owner}/${projectsId}/task_pdf.json?task_id=${task_id}`;
// window.open(`/api/traces/${owner}/${projectsId}/task_pdf.json?task_id=${task_id}`);
const x = new XMLHttpRequest();
x.open('GET', url, true)
x.responseType = 'blob';
x.onload = (e) => {
// DOMStringURL URL document URL File Blob
const url = window.URL.createObjectURL(x.response)
const a = document.createElement('a')
a.href = url;
a.download = "report.pdf";
a.click();
setSpining(false);
}
x.send();
console.log("spining");
}
return(
@ -105,7 +115,7 @@ function Data(props){
<span>分支名称</span>
<span>检测状态</span>
<span>检测时间</span>
<span>操作</span>
{ isManager && <span>操作</span> }
</li>
{
dataSource.map((e,key)=>{
@ -128,33 +138,31 @@ function Data(props){
}
</span>
<span>{e.detect_startdate}</span>
<span>
{
{
isManager &&
<span>
<div className="operationBtns">
{ isManager && (
e.detect_status ==="detecting" ?
<span>重新扫描</span>
:
<a onClick={()=>repeatCheck(e.project_id,e.branch_tag)}>重新扫描</a>
)
}
{
(e.detect_status ==="fail" || e.detect_status ==="detecting") ?
<span>查看<i className="iconfont icon-sanjiaoxing-down"></i></span>
:
<a>查看<i className="iconfont icon-sanjiaoxing-down"></i></a>
}
{
isManager && (
(e.detect_status ==="fail" || e.detect_status ==="detecting") ?
<span>下载报告</span>
:
<a onClick={()=>handleDownExcel(e.task_id)}>下载报告</a>
)
}
</div>
}
</span>
{
e.detect_status ==="detecting" ?
<span>重新扫描</span>
:
<a onClick={()=>repeatCheck(e.project_id,e.branch_tag)}>重新扫描</a>
}
{/* {
(e.detect_status ==="fail" || e.detect_status ==="detecting") ?
<span>查看<i className="iconfont icon-sanjiaoxing-down"></i></span>
:
<a>查看<i className="iconfont icon-sanjiaoxing-down"></i></a>
} */}
{
(e.detect_status ==="fail" || e.detect_status ==="detecting") ?
<span>下载报告</span>
:
<a onClick={()=>handleDownExcel(e.task_id)}>下载报告</a>
}
</div>
</span>
}
</li>
{false && <iframe src="www.baidu.com" id={`htmlIframe_${key}`} frameBorder="0" name={`htmlIframe_${key}`} style={{ background: '#fff', height: '100%', width: '100%' }}></iframe>}
</div>

View File

@ -307,7 +307,10 @@
white-space: nowrap;
text-overflow: ellipsis;
}
&>span:nth-child(3),&>span:nth-child(4){
&>span:nth-child(3){
flex:1;
}
&>span:nth-child(4){
width: 16%;
}
&>span:last-child{

View File

@ -226,6 +226,7 @@ export function TPMIndexHOC(WrappedComponent) {
this.setState({
showNotice:false
})
this.getAppdatausr();
}
showCompeleteDialog=()=>{