forked from Gitlink/forgeplus-react
update issue
This commit is contained in:
parent
f2836b5b7c
commit
9c0c9dfc03
|
@ -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">
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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) => {
|
||||
// 会创建一个 DOMString,其中包含一个表示参数中给出的对象的URL。这个 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>
|
||||
|
|
|
@ -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{
|
||||
|
|
|
@ -226,6 +226,7 @@ export function TPMIndexHOC(WrappedComponent) {
|
|||
this.setState({
|
||||
showNotice:false
|
||||
})
|
||||
this.getAppdatausr();
|
||||
}
|
||||
|
||||
showCompeleteDialog=()=>{
|
||||
|
|
Loading…
Reference in New Issue