dev_aliyun2
杨树林 5 years ago committed by harry
parent 6374619b91
commit b6fc627ca3

@ -78,6 +78,7 @@ class Paperreview_single extends Component {
} catch (e) { } catch (e) {
itemsnamesy = objectsingle && objectsingle.program_attr && objectsingle.program_attr.description; itemsnamesy = objectsingle && objectsingle.program_attr && objectsingle.program_attr.description;
} }
var fenshul=(objectsingle.score+"分");
return ( return (
<div key={indexxy} <div key={indexxy}
@ -140,31 +141,31 @@ class Paperreview_single extends Component {
> >
({objectsingle.score}) ({objectsingle.score})
</div> </div>
<div className="ml10 lh28 listjihetixingstit markdown-body cretitlecolrlist " style={{ wordBreak: "break-word" }}
dangerouslySetInnerHTML={{ __html: markdownToHTML(objectsingle.name).replace(/▁/g, "▁▁▁") }}> <div id={"titessone"} className="ml10 lh28 listjihetixingstit markdown-body cretitlecolrlist " style={{wordBreak: "break-word"}}
dangerouslySetInnerHTML={{__html: markdownToHTML(fenshul+objectsingle.name).replace(/▁/g, "▁▁▁")}}>
</div> </div>
</div> </div>
: :
<div className="w100s sortinxdirection"> <div className="w100s sortinxdirection titesstwos">
<div className="tites lh28 listjihetixingstit markdown-body cretitlecolrlist " style={{ <div id={"titesstwo"} className="tites titesstwostest lh28 listjihetixingstit markdown-body cretitlecolrlist " style={{wordBreak: "break-word",
wordBreak: "break-word", minWidth:"32px"
minWidth: "32px"
}} }}
> >
({objectsingle.score}) ({objectsingle.score})
</div> </div>
<div className="ml10 lh28 listjihetixingstit cretitlecolrlist programquill" style={{ wordBreak: "break-word" }} <div className={objectsingle.score<10?" lh28 listjihetixingstit text-indents40 cretitlecolrlist programquill":objectsingle.score<100?" lh28 listjihetixingstit text-indents44 cretitlecolrlist programquill":" lh28 listjihetixingstit text-indents50 cretitlecolrlist programquill" }style={{wordBreak: "break-word"}}
> >
{ {
itemssname === null || itemssname === undefined ? itemssname===null|| itemssname===undefined?
"" ""
: :
<QuillForEditor <QuillForEditor
readOnly={true} readOnly={true}
value={itemssname} value={itemssname}
/> />
} }
</div> </div>

@ -220,7 +220,11 @@ class ChoquesEditor extends Component {
const reg = /^[\s\S]*.*[^\s][\s\S]*$/; const reg = /^[\s\S]*.*[^\s][\s\S]*$/;
if (!reg.test(_text)) { if (!reg.test(_text)) {
// 处理编辑器内容为空 // 处理编辑器内容为空
texts = ""; try {
texts=JSON.stringify(value);
}catch (e) {
texts="";
}
} else { } else {
if (_text.length >= 301) { if (_text.length >= 301) {
var result = _text.substring(0, 300); var result = _text.substring(0, 300);
@ -259,9 +263,15 @@ class ChoquesEditor extends Component {
const reg = /^[\s\S]*.*[^\s][\s\S]*$/; const reg = /^[\s\S]*.*[^\s][\s\S]*$/;
if (!reg.test(_text)) { if (!reg.test(_text)) {
// 处理编辑器内容为空 // 处理编辑器内容为空
this.setState({ try {
question_titleysl: "" this.setState({
}) question_titleysl: JSON.stringify(value)
})
}catch (e) {
this.setState({
question_titleysl:""
})
}
} else { } else {
// 提交到后台的内容需要处理一下; // 提交到后台的内容需要处理一下;
var texts = ""; var texts = "";
@ -283,9 +293,15 @@ class ChoquesEditor extends Component {
const reg = /^[\s\S]*.*[^\s][\s\S]*$/; const reg = /^[\s\S]*.*[^\s][\s\S]*$/;
if (!reg.test(_text)) { if (!reg.test(_text)) {
// 处理编辑器内容为空 // 处理编辑器内容为空
this.setState({ try {
question_titlesysl: "" this.setState({
}) question_titlesysl: JSON.stringify(value)
})
}catch (e) {
this.setState({
question_titlesysl:""
})
}
} else { } else {
// 提交到后台的内容需要处理一下; // 提交到后台的内容需要处理一下;
var texts = ""; var texts = "";

@ -175,6 +175,13 @@ class JudquestionEditor extends Component {
} catch (e) { } catch (e) {
} }
const params = this.props && this.props.match && this.props.match.params;
if(JSON.stringify(params) === "{}"){
//新增
this.setState({
zqda:"0"
})
}
} }
componentDidUpdate(prevProps) { componentDidUpdate(prevProps) {
@ -269,15 +276,30 @@ class JudquestionEditor extends Component {
} }
onContentChange = (value, quill) => { onContentChange=(value,quill)=>{
// console.log("这是题干赋值");
// console.log(value);
// console.log(quill);
const _text = quill.getText(); const _text = quill.getText();
const reg = /^[\s\S]*.*[^\s][\s\S]*$/; const reg = /^[\s\S]*.*[^\s][\s\S]*$/;
// console.log(_text);
// console.log(_text.length);
if (!reg.test(_text)) { if (!reg.test(_text)) {
// 处理编辑器内容为空 // 处理编辑器内容为空
this.setState({ try {
question_titleysl: "" this.setState({
}) question_titleysl:JSON.stringify(value)
})
}catch (e) {
this.setState({
question_titleysl:""
})
}
// console.log("空");
} else { } else {
// console.log("有");
// 提交到后台的内容需要处理一下; // 提交到后台的内容需要处理一下;
var texts = ""; var texts = "";
if (_text.length >= 1001) { if (_text.length >= 1001) {
@ -298,9 +320,16 @@ class JudquestionEditor extends Component {
const reg = /^[\s\S]*.*[^\s][\s\S]*$/; const reg = /^[\s\S]*.*[^\s][\s\S]*$/;
if (!reg.test(_text)) { if (!reg.test(_text)) {
// 处理编辑器内容为空 // 处理编辑器内容为空
this.setState({ try {
question_titlesysl: "" this.setState({
}) question_titlesysl:JSON.stringify(value)
})
}catch (e) {
this.setState({
question_titlesysl:""
})
}
} else { } else {
// 提交到后台的内容需要处理一下; // 提交到后台的内容需要处理一下;
var texts = ""; var texts = "";

@ -254,239 +254,252 @@ class Listjihe extends Component {
</p>
</p>
:
<p className="w100s listjihetixingstitsp verticallayout ">
{
items === undefined || items === null ? "" : items.choices.map((object, index) => {
var string=""
try {
string=JSON.parse(object.choice_text);
}catch (e) {
string=object.choice_text;
}
return (
<p className={index === 0 ? "sortinxdirection " : "sortinxdirection mt15 "}>
<p className="lh20s">{tagArray[index]}</p>
<p className="programquill" style={{wordBreak: "break-word"}}>
{object ?
object.choice_text === undefined || object.choice_text=== null || object.choice_text === "" ?
""
:
object.choice_text.length>0?
<QuillForEditor
readOnly={true}
value={string}
/>
:""
:
""
}
</p>
</p>
)
})
}
</p>
}
</div>
<div className="w100s sortinxdirection mt10">
<p
className="listjihetixing">难度<span>{items.difficulty === 1 ? "简单" : items.difficulty === 2 ? "适中" : items.difficulty === 3 ? "困难" : ""}</span>
</p>
<p
className="ml30 listjihetixing">题型<span>{items.item_type === "SINGLE" ? "单选题" : items.item_type === "MULTIPLE" ? "多选题" : items.item_type === "JUDGMENT" ? "判断题" : items.item_type === "PROGRAM" ? "编程题" : ""}</span>
</p>
</div>
{/*更新时间*/}
<div className="w100s sortinxdirection">
<div className="w50s listjihetixingstit sortinxdirection">
<p className="updatetimes lh30">更新时间{items.update_time}</p>
{
this.props.defaultActiveKey === "0" || this.props.defaultActiveKey === 0 ?
""
:
<p className="updatetimes lh30 ml45">创建者{items.author.name}</p>
}
{
items.item_type === "PROGRAM" ?
<p className="updatetimes lh30 ml45">编程语言{items.program_attr.language}</p>
: ""
}
{
items.item_type === "PROGRAM" ?
items.program_attr.status === 0 ?
<p className="updatetimes lh30 ml45 nofabu mt5">未发布</p>
: ""
: ""
}
</div>
<div className="w50s xaxisreverseorder">
{
items.choosed === true ?
<p className="selectionss xiaoshou" onClick={() => this.Selectingpracticaltrainings(items.id)}>
{/*<i className="iconfont icon-jianhao font-12 lg ml7 lh30 icontianjiadaohangcolor mr5"></i>*/}
<span className=" lh30">撤销</span></p>
:
items.item_type === "PROGRAM" ?
items.program_attr.status === 0 ?
<Tooltip placement="top" title={"编程题未发布,不能选用!"}>
<p className="selectionys jinzhixiaoshou">
<i className="iconfont icon-tianjiadaohang font-12 lg ml7 lh30 icontianjiadaohangcolor mr5"></i>
<span className="mr15 lh30">选用</span>
</p>
</Tooltip>
:
<p className="selection xiaoshou" onClick={() => this.Selectingpracticaltraining(items.id)}>
<i className="iconfont icon-tianjiadaohang font-12 lg ml7 lh30 icontianjiadaohangcolor mr5"></i>
<span className="mr15 lh30">选用</span>
</p>
:
<p className="selection xiaoshou" onClick={() => this.Selectingpracticaltraining(items.id)}>
<i className="iconfont icon-tianjiadaohang font-12 lg ml7 lh30 icontianjiadaohangcolor mr5"></i>
<span className="mr15 lh30">选用</span>
</p>
}
{
defaultActiveKey === 0 || defaultActiveKey === "0" ?
<div className="xaxisreverseorder">
<p className="viewparsings xiaoshou mr25" onClick={() => this.props.showmodelysl(items.id)}>
<i className="iconfont icon-shanchu1 font-17 lg ml7 lh30 icontianjiadaohangcolors mr5"></i>
<span>删除</span>
</p>
{
items.item_type === "PROGRAM" ?
this.props.Isitapopup&&this.props.Isitapopup==="true"?
""
:
<a target="_blank" href={`/problems/${items.program_attr.identifier}/edit`}>
<p className="viewparsings xiaoshou mr25">
<i className="iconfont icon-bianji2 font-17 lg ml7 lh30 icontianjiadaohangcolors mr5"></i>
<span>编辑</span>
</p>
</a>
:
this.props.Isitapopup&&this.props.Isitapopup==="true"?
""
:
<a href={`/question/edit/${items.id}`}>
<p className="viewparsings xiaoshou mr25">
<i className="iconfont icon-bianji2 font-17 lg ml7 lh30 icontianjiadaohangcolors mr5"></i>
<span>编辑</span>
</p>
</a>
}
{
items.public === false ?
items.item_type === "PROGRAM" ?
(
items.program_attr.status === 0 ?
""
:
items.apply===false?
<p className="viewparsings xiaoshou mr25" onClick={() => this.props.showmodels(items.id)}>
<i className="iconfont icon-gongkai font-17 lg ml7 lh30 icontianjiadaohangcolors mr5"></i>
<span>公开</span>
</p>
:
(
items.public==true?
""
:
<p className="viewparsings xiaoshou mr25" onClick={(e) => this.props.showmodelsInaudit(e)}>
<i className="iconfont icon-gongkai font-17 lg ml7 lh30 icontianjiadaohangcolors mr5"></i>
<span>公开审核中</span>
</p> </p>
</p> )
: )
<p className="w100s listjihetixingstitsp verticallayout "> :items.apply===false?
{ <p className="viewparsings xiaoshou mr25" onClick={() => this.props.showmodels(items.id)}>
items === undefined || items === null ? "" : items.choices.map((object, index) => { <i className="iconfont icon-gongkai font-17 lg ml7 lh30 icontianjiadaohangcolors mr5"></i>
var string = "" <span>公开</span>
try { </p>
string = JSON.parse(object.choice_text); :
} catch (e) { (
string = object.choice_text; items.public==true?
} ""
return ( :
<p className={index === 0 ? "sortinxdirection " : "sortinxdirection mt15 "}> <p className="viewparsings xiaoshou mr25" onClick={(e) => this.props.showmodelsInaudit(e)}>
<p className="lh20s">{tagArray[index]}</p> <i className="iconfont icon-gongkai font-17 lg ml7 lh30 icontianjiadaohangcolors mr5"></i>
<p className="programquill" style={{ wordBreak: "break-word" }}> <span>公开审核中</span>
{object ?
object.choice_text === undefined || object.choice_text === null || object.choice_text === "" ?
""
:
object.choice_text.length > 0 ?
<QuillForEditor
readOnly={true}
value={string}
/>
: ""
:
""
}
</p>
</p>
)
})
}
</p>
}
</div>
<div className="w100s sortinxdirection mt10">
<p
className="listjihetixing">难度<span>{items.difficulty === 1 ? "简单" : items.difficulty === 2 ? "适中" : items.difficulty === 3 ? "困难" : ""}</span>
</p> </p>
<p )
className="ml30 listjihetixing">题型<span>{items.item_type === "SINGLE" ? "单选题" : items.item_type === "MULTIPLE" ? "多选题" : items.item_type === "JUDGMENT" ? "判断题" : items.item_type === "PROGRAM" ? "编程题" : ""}</span> :
</p> ""
</div> }
{/*更新时间*/}
<div className="w100s sortinxdirection">
<div className="w50s listjihetixingstit sortinxdirection">
<p className="updatetimes lh30">更新时间{items.update_time}</p>
{
this.props.defaultActiveKey === "0" || this.props.defaultActiveKey === 0 ?
""
:
<p className="updatetimes lh30 ml45">创建者{items.author.name}</p>
}
{
items.item_type === "PROGRAM" ?
<p className="updatetimes lh30 ml45">编程语言{items.program_attr.language}</p>
: ""
}
{
items.item_type === "PROGRAM" ?
items.program_attr.status === 0 ?
<p className="updatetimes lh30 ml45 nofabu mt5">未发布</p>
: ""
: ""
}
</div>
<div className="w50s xaxisreverseorder">
{
items.choosed === true ?
<p className="selectionss xiaoshou" onClick={() => this.Selectingpracticaltrainings(items.id)}>
<i className="iconfont icon-jianhao font-12 lg ml7 lh30 icontianjiadaohangcolor mr5"></i>
<span className="mr15 lh30">撤销</span></p>
:
items.item_type === "PROGRAM" ?
items.program_attr.status === 0 ?
<Tooltip placement="top" title={"编程题未发布,不能选用!"}>
<p className="selectionys jinzhixiaoshou">
<i className="iconfont icon-tianjiadaohang font-12 lg ml7 lh30 icontianjiadaohangcolor mr5"></i>
<span className="mr15 lh30">选用</span>
</p>
</Tooltip>
:
<p className="selection xiaoshou" onClick={() => this.Selectingpracticaltraining(items.id)}>
<i className="iconfont icon-tianjiadaohang font-12 lg ml7 lh30 icontianjiadaohangcolor mr5"></i>
<span className="mr15 lh30">选用</span>
</p>
:
<p className="selection xiaoshou" onClick={() => this.Selectingpracticaltraining(items.id)}>
<i className="iconfont icon-tianjiadaohang font-12 lg ml7 lh30 icontianjiadaohangcolor mr5"></i>
<span className="mr15 lh30">选用</span>
</p>
}
{
defaultActiveKey === 0 || defaultActiveKey === "0" ?
<div className="xaxisreverseorder">
<p className="viewparsings xiaoshou mr25" onClick={() => this.props.showmodelysl(items.id)}>
<i className="iconfont icon-shanchu1 font-17 lg ml7 lh30 icontianjiadaohangcolors mr5"></i>
<span>删除</span>
</p>
{
items.item_type === "PROGRAM" ?
this.props.Isitapopup && this.props.Isitapopup === "true" ?
""
:
<a target="_blank" href={`/problems/${items.program_attr.identifier}/edit`}>
<p className="viewparsings xiaoshou mr25">
<i className="iconfont icon-bianji2 font-17 lg ml7 lh30 icontianjiadaohangcolors mr5"></i>
<span>编辑</span>
</p>
</a>
:
this.props.Isitapopup && this.props.Isitapopup === "true" ?
""
:
<a href={`/question/edit/${items.id}`}>
<p className="viewparsings xiaoshou mr25">
<i className="iconfont icon-bianji2 font-17 lg ml7 lh30 icontianjiadaohangcolors mr5"></i>
<span>编辑</span>
</p>
</a>
}
{
items.public === false ?
items.item_type === "PROGRAM" ?
(
items.program_attr.status === 0 ?
""
:
items.apply === false ?
<p className="viewparsings xiaoshou mr25" onClick={() => this.props.showmodels(items.id)}>
<i className="iconfont icon-gongkai font-17 lg ml7 lh30 icontianjiadaohangcolors mr5"></i>
<span>公开</span>
</p>
:
(
items.public == true ?
""
:
<p className="viewparsings xiaoshou mr25" onClick={(e) => this.props.showmodelsInaudit(e)}>
<i className="iconfont icon-gongkai font-17 lg ml7 lh30 icontianjiadaohangcolors mr5"></i>
<span>公开审核中</span>
</p>
)
)
: items.apply === false ?
<p className="viewparsings xiaoshou mr25" onClick={() => this.props.showmodels(items.id)}>
<i className="iconfont icon-gongkai font-17 lg ml7 lh30 icontianjiadaohangcolors mr5"></i>
<span>公开</span>
</p>
:
""
:
""
}
</div> </div>
: "" : ""
} }
{ {
items.item_type === "PROGRAM" ? items.item_type === "PROGRAM" ?
"" ""
: :
<p className="viewparsings xiaoshou mr25" onClick={() => this.props.chakanjiexibool(keindex)}> <p className="viewparsings xiaoshou mr25" onClick={() => this.props.chakanjiexibool(keindex)}>
<i className="iconfont icon-jiexi font-17 lg ml7 lh30 icontianjiadaohangcolors mr5"></i> <i className="iconfont icon-jiexi font-17 lg ml7 lh30 icontianjiadaohangcolors mr5"></i>
查看解析</p> 查看解析</p>
} }
</div>
</div>
{
chakanjiexiboolindex === keindex ? <div>
<div className="w100s questiontypeheng mt23">
</div>
<div className=" sortinxdirection mt15 yldxtit">
{
items.item_type === "SINGLE" ?
<p className=" testfondex yldxtit"
style={{ wordBreak: "break-word" }}
dangerouslySetInnerHTML={{ __html: markdownToHTML("答案:" + tagArrays[rightkey]).replace(/▁/g, "▁▁▁") }}
>
</p>
: items.item_type === "MULTIPLE" ?
<p className=" testfondex yldxtit"
style={{ wordBreak: "break-word" }}
dangerouslySetInnerHTML={{ __html: markdownToHTML("答案:" + MULTIPLEkey).replace(/▁/g, "▁▁▁") }}
>
</p> </div>
: </div>
<p className=" testfondex yldxtit" {
style={{ wordBreak: "break-word" }} chakanjiexiboolindex === keindex ? <div>
dangerouslySetInnerHTML={{ __html: markdownToHTML("答案:" + rightkey).replace(/▁/g, "▁▁▁") }} <div className="w100s questiontypeheng mt23">
>
</p> </div>
} <div className=" sortinxdirection mt15 yldxtit">
</div> {
<div className=" sortinxdirection mt15 yldxtit"> items.item_type === "SINGLE" ?
<p id={"analysisnamesid"} className=" testfondex yldxtit programquill" <p className=" testfondex yldxtit"
style={{ wordBreak: "break-word" }} style={{wordBreak: "break-word"}}
> dangerouslySetInnerHTML={{__html: markdownToHTML("答案:" + tagArrays[rightkey]).replace(/▁/g, "▁▁▁")}}
{items ? >
items.analysis === undefined || items.analysis === null || items.analysis === "" ? </p>
: items.item_type === "MULTIPLE"?
<p className=" testfondex yldxtit"
style={{wordBreak: "break-word"}}
dangerouslySetInnerHTML={{__html: markdownToHTML("答案:" + MULTIPLEkey).replace(/▁/g, "▁▁▁")}}
>
</p>
:
<p className=" testfondex yldxtit"
style={{wordBreak: "break-word"}}
dangerouslySetInnerHTML={{__html: markdownToHTML("答案:" + rightkey).replace(/▁/g, "▁▁▁")}}
>
</p>
}
"" </div>
: <div className=" sortinxdirection mt15 yldxtit">
items.analysis.length > 0 ? <p className=" testfondex yldxtit "
analysisnames === null || analysisnames === undefined ? "" : style={{wordBreak: "break-word"}}
<QuillForEditor >
imgAttrs={{ width: '60px', height: '30px' }} 解析
readOnly={true} </p>
value={analysisnames} <p id={"analysisnamesid"} className="wt930px testfondex yldxtit programquill"
/> style={{wordBreak: "break-word"}}
: >
"" {items ?
: items.analysis=== undefined || items.analysis=== null || items.analysis === "" ?
""
} ""
</p> :
</div> items.analysis.length>0?
</div> : "" analysisnames===null || analysisnames===undefined?"":
} <QuillForEditor
imgAttrs={{width: '60px', height: '30px'}}
readOnly={true}
value={analysisnames}
/>
:
""
:
""
}
</p>
</div>
</div> : ""
}
</div> </div>

@ -242,7 +242,11 @@ class SingleEditor extends Component {
const reg = /^[\s\S]*.*[^\s][\s\S]*$/; const reg = /^[\s\S]*.*[^\s][\s\S]*$/;
if (!reg.test(_text)) { if (!reg.test(_text)) {
// 处理编辑器内容为空 // 处理编辑器内容为空
texts = ""; try {
texts= JSON.stringify(value)
}catch (e) {
texts="";
}
} else { } else {
if (_text.length >= 301) { if (_text.length >= 301) {
var result = _text.substring(0, 300); var result = _text.substring(0, 300);
@ -280,9 +284,15 @@ class SingleEditor extends Component {
const reg = /^[\s\S]*.*[^\s][\s\S]*$/; const reg = /^[\s\S]*.*[^\s][\s\S]*$/;
if (!reg.test(_text)) { if (!reg.test(_text)) {
// 处理编辑器内容为空 // 处理编辑器内容为空
this.setState({ try {
question_titleysl: "" this.setState({
}) question_titleysl: JSON.stringify(value)
})
}catch (e) {
this.setState({
question_titleysl:""
})
}
} else { } else {
// 提交到后台的内容需要处理一下; // 提交到后台的内容需要处理一下;
@ -311,9 +321,15 @@ class SingleEditor extends Component {
const reg = /^[\s\S]*.*[^\s][\s\S]*$/; const reg = /^[\s\S]*.*[^\s][\s\S]*$/;
if (!reg.test(_text)) { if (!reg.test(_text)) {
// 处理编辑器内容为空 // 处理编辑器内容为空
this.setState({ try {
question_titlesysl: "" this.setState({
}) question_titlesysl:JSON.stringify(value)
})
}catch (e) {
this.setState({
question_titlesysl:""
})
}
} else { } else {
var texts = ""; var texts = "";
if (_text.length >= 1001) { if (_text.length >= 1001) {

@ -790,18 +790,22 @@
font-size: 14px; font-size: 14px;
} }
.testfondexsysl{
.yldxtits { width:5% !important;
color: #888888; }
font-size: 14px; .yldxtits{
color: #888888;
font-size: 14px;
} }
.mt25 { .mt25 {
margin-top: 25px; margin-top: 25px;
} }
.wt930px{
.postitonrelati { width: 930px !important;
position: relative; }
.postitonrelati{
position: relative;
} }
.postitonrelatis { .postitonrelatis {
@ -1050,41 +1054,18 @@
white-space: nowrap; white-space: nowrap;
cursor: default; cursor: default;
} }
.titesstwos{
.ball { position: relative;
width: 8px;
height: 8px;
background: #FF6601;
position: absolute;
left: 0;
top: 0;
border-radius: 50%;
opacity: 0;
z-index: 1;
} }
.titesstwostest{
.mt25 { position: absolute;
margin-top: 25px;
} }
.text-indents40{
.mr15 { text-indent:40px
margin-right: 15px;
} }
.text-indents44{
.fangdatwo { text-indent:44px
background: #fefefe;
background-color: #fefefe;
height: 100%;
overflow-y: scroll !important;
width: 100%;
position: fixed;
top: 0px;
bottom: 0px;
left: 0px;
z-index: 999999;
right: 0px;
} }
.text-indents50{
.searchwidth { text-indent: 50px
width: 347px !important;
} }

@ -9,28 +9,30 @@ import SiderBar from "../tpm/SiderBar";
import Headplugselections from "../question/component/Headplugselections"; import Headplugselections from "../question/component/Headplugselections";
import QuestionModal from "./component/QuestionModal"; import QuestionModal from "./component/QuestionModal";
import QuestionModals from "./component/QuestionModals"; import QuestionModals from "./component/QuestionModals";
import QuestionModalys from "./component/QuestionModalys";
class Testpaperlibrary extends Component { class Testpaperlibrary extends Component {
constructor(props) { constructor(props) {
super(props); super(props);
this.state = { this.state = {
Headertop: "", Headertop: "",
disciplinesdata: null, disciplinesdata:null,
discipline_id: null, discipline_id:null,
sub_discipline_id: null, sub_discipline_id:null,
tag_discipline_id: null, tag_discipline_id:null,
public: null, public:null,
difficulty: null, difficulty:null,
item_type: null, item_type:null,
keyword: null, keyword:null,
page: 1, page:1,
per_page: 10, per_page:10,
booljupyterurls: false, booljupyterurls:false,
Contentdata: [], Contentdata:[],
items_count: 0, items_count:0,
defaultActiveKey: "1", defaultActiveKey:"1",
modalsTypes: false, modalsTypes:false,
modalsType: false, modalsType:false,
timuid: 0, timuid:0,
modalsTypeInaudit:false,
} }
} }
getContainer = () => { getContainer = () => {
@ -131,13 +133,18 @@ class Testpaperlibrary extends Component {
} }
//获取数据 //获取数据
getdata = (data) => { getdata=(data,bool)=>{
const url = `/examination_banks.json`; const url = `/examination_banks.json`;
this.setState({ if(bool){
booljupyterurls: true,
}) }else {
axios.get((url), { params: data }).then((response) => { this.setState({
setTimeout(() => { booljupyterurls:true,
})
}
axios.get((url), {params: data}).then((response) => {
setTimeout(()=>{
this.setState({ this.setState({
booljupyterurls: false, booljupyterurls: false,
}) })
@ -281,7 +288,7 @@ class Testpaperlibrary extends Component {
page: this.state.page, page: this.state.page,
per_page: 10, per_page: 10,
}; };
this.getdata(data); this.getdata(data,true);
} }
}).catch((error) => { }).catch((error) => {
////console.log(error); ////console.log(error);
@ -307,7 +314,7 @@ class Testpaperlibrary extends Component {
page: this.state.page, page: this.state.page,
per_page: 10, per_page: 10,
}; };
this.getdata(data); this.getdata(data,true);
} }
}) })
.catch(function (error) { .catch(function (error) {
@ -318,8 +325,8 @@ class Testpaperlibrary extends Component {
showmodels = (id) => { showmodels = (id) => {
this.setState({ this.setState({
modalsType: true, modalsType: true,
titilesm: "在平台审核后,所有成员均可使用试", titilesm: "在平台审核后,所有成员均可使用试",
titiless: "是否设置为公开", titiless: "是否设置为公开",
titbool: true, titbool: true,
timuid: id timuid: id
}) })
@ -330,7 +337,19 @@ class Testpaperlibrary extends Component {
} }
showmodelsInaudit = (e) => {
this.setState({
modalsTypeInaudit: true,
titilesm: "公开申请已提交,请等待管理员的审核",
titiless: "我们将在1-2个工作日内完成审核",
})
};
modalsTypeInauditbool=()=>{
this.setState({
modalsTypeInaudit:false,
})
}
showmodelysl = (id) => { showmodelysl = (id) => {
this.setState({ this.setState({
@ -396,7 +415,7 @@ class Testpaperlibrary extends Component {
render() { render() {
let { Headertop, items_count, page, per_page, modalsTypes, modalsType } = this.state; let{Headertop,items_count,page,per_page,modalsTypes,modalsType,modalsTypeInaudit}=this.state;
const isysladmins = this.props && this.props.current_user && this.props.current_user.admin ? this.props.current_user.admin : false; const isysladmins = this.props && this.props.current_user && this.props.current_user.admin ? this.props.current_user.admin : false;
const is_teacher = this.props && this.props.current_user && this.props.current_user.is_teacher ? this.props.current_user.is_teacher : false; const is_teacher = this.props && this.props.current_user && this.props.current_user.is_teacher ? this.props.current_user.is_teacher : false;
@ -417,6 +436,12 @@ class Testpaperlibrary extends Component {
setDownload={() => this.setDownload()}></QuestionModal> setDownload={() => this.setDownload()}></QuestionModal>
: "" : ""
} }
{
modalsTypeInaudit===true?
<QuestionModalys {...this.props}{...this.state} modalsType={modalsTypeInaudit} modalCancel={() => this.modalsTypeInauditbool()}
setDownload={() => this.modalsTypeInauditbool()}></QuestionModalys>
:""
}
{/*试卷库*/} {/*试卷库*/}
<SiderBar <SiderBar
{...this.props} {...this.props}
@ -437,14 +462,16 @@ class Testpaperlibrary extends Component {
{...this.props} {...this.props}
{...this.state} {...this.state}
Isitapopup={"false"} Isitapopup={"false"}
Testpapereditor={(e) => this.Testpapereditor(e)} Testpapereditor={(e)=>this.Testpapereditor(e)}
setdifficulty={(e) => this.setdifficulty(e)} setdifficulty={(e)=>this.setdifficulty(e)}
showmodels={(e) => this.showmodels(e)} showmodels={(e)=>this.showmodels(e)}
showmodelysl={(e) => this.showmodelysl(e)} showmodelysl={(e)=>this.showmodelysl(e)}
setdatafuns={(key) => this.setdatafuns(key)} setdatafuns={(key)=>this.setdatafuns(key)}
callback={(key) => this.callback(key)} callback={(key)=>this.callback(key)}
setdatafunsval={(key) => this.setdatafunsval(key)} setdatafunsval={(key)=>this.setdatafunsval(key)}
setdifficulty={(bool) => this.setdifficulty(bool)} setdifficulty={(bool)=>this.setdifficulty(bool)}
showmodelsInaudit={(e)=>this.showmodelsInaudit(e)}
> >
</Contentpart> </Contentpart>

@ -222,6 +222,7 @@ class Contentpart extends Component {
showmodels={(e)=>this.props.showmodels(e)} showmodels={(e)=>this.props.showmodels(e)}
showmodelysl={(e)=>this.props.showmodelysl(e)} showmodelysl={(e)=>this.props.showmodelysl(e)}
Isitapopup={this.props.Isitapopup} Isitapopup={this.props.Isitapopup}
showmodelsInaudit={(e)=>this.props.showmodelsInaudit(e)}
> >
</Listjihe> </Listjihe>

@ -133,12 +133,21 @@ class Listjihe extends Component {
} }
{ {
items.public === false ? items.apply===false?
<p className="viewparsings xiaoshou mr25 " onClick={() => this.props.showmodels(items.id)}> <p className="viewparsings xiaoshou mr25 " onClick={() => this.props.showmodels(items.id)}>
<i className="iconfont icon-gongkai font-17 lg ml7 lh30 icontianjiadaohangcolors mr5"></i> <i className="iconfont icon-gongkai font-17 lg ml7 lh30 icontianjiadaohangcolors mr5"></i>
<span>公开</span> <span>公开</span>
</p> </p>
:"" :
(
items.public==true?
""
:
<p className="viewparsings xiaoshou mr25" onClick={(e) => this.props.showmodelsInaudit(e)}>
<i className="iconfont icon-gongkai font-17 lg ml7 lh30 icontianjiadaohangcolors mr5"></i>
<span>公开审核中</span>
</p>
)
} }
</div> </div>
:""} :""}

@ -0,0 +1,42 @@
import React, { Component } from 'react';
import {getImageUrl} from 'educoder';
import { Modal} from 'antd';
import axios from 'axios';
import './../../question/questioncss/questioncom.css'
//立即申请试用
class QuestionModalys extends Component {
constructor(props) {
super(props);
this.state={
}
}
render() {
return(
<Modal
keyboard={false}
closable={false}
footer={null}
destroyOnClose={true}
title="提示"
centered={true}
visible={this.props.modalsType===undefined?false:this.props.modalsType}
width="442px"
>
<div className="educouddiv">
<div className={"tabeltext-alignleft mt10"}><p className="titiles">{this.props.titilesm}</p></div>
<div className={"tabeltext-alignleft mt10"}><p className="titiles">{this.props.titiless}</p></div>
<div className="clearfix mt30 edu-txt-center">
<a className="task-btn task-btn-orange w80" onClick={()=>this.props.setDownload()}>知道啦</a>
</div>
</div>
</Modal>
)
}
}
export default QuestionModalys;
Loading…
Cancel
Save