dev_aliyun2
杨树林 5 years ago committed by harry
parent 96397374ec
commit 4f55badfaa

@ -1,5 +1,5 @@
import React, {Component} from "react";
import {Link, NavLink} from 'react-router-dom';
import {Link, NavLink,Prompt} from 'react-router-dom';
import {WordsBtn, ActionBtn, SnackbarHOC, getImageUrl,queryString} from 'educoder';
import axios from 'axios';
import { Breadcrumb } from "antd";
@ -163,6 +163,20 @@ class Questionitem_banks extends Component {
}
componentWillMount () {
// 拦截判断是否离开当前页面
window.addEventListener('beforeunload', this.beforeunload);
}
componentWillUnmount () {
// 销毁拦截判断是否离开当前页面
window.removeEventListener('beforeunload', this.beforeunload);
}
beforeunload (e) {
let confirmationMessage = '你确定离开此页面吗?';
(e || window.event).returnValue = confirmationMessage;
return confirmationMessage;
}
getdata = (data) => {
// const url=`/item_banks.json`;
@ -501,6 +515,10 @@ class Questionitem_banks extends Component {
<div>
<div id={"Itembankstopid"} className="newMain clearfix intermediatecenter "
>
<Prompt
when={true}
message={() => '你确定离开此页面吗?'}
/>
<style>
{

@ -784,9 +784,12 @@ class NewHeader extends Component {
width:'93px',
height:'80px',
}}>
<a href={'/question'} className={"popovertests"} ><p className="questiontype">试题库</p></a>
<Link to={'/question'} className={"popovertests"} ><p className="questiontype">试题库</p></Link>
{/*<a href={'/question'} className={"popovertests"} ><p className="questiontype">试题库</p></a>*/}
<p className="questiontypeheng"></p>
<a href={'/paperlibrary'} className={"popovertests"} ><p className="questiontype">试卷库</p></a>
{/*<a href={'/paperlibrary'} className={"popovertests"} ><p className="questiontype">试卷库</p></a>*/}
<Link to={'/paperlibrary'} className={"popovertests"} ><p className="questiontype">试卷库</p></Link>
</div>
);

Loading…
Cancel
Save