解决冲突

ecloud_sso
daiao 5 years ago
commit e1e7cc725b

@ -6,10 +6,12 @@ module ControllerRescueHandler
Util.logger_error e Util.logger_error e
render json: {status: -1, message: e.message} render json: {status: -1, message: e.message}
end end
rescue_from ActiveRecord::StatementInvalid do |e| rescue_from ActiveRecord::StatementInvalid do |e|
Util.logger_error e Util.logger_error e
render json: {status: -1, message: "接口数据异常"} render json: {status: -1, message: "接口数据异常"}
end end
rescue_from NoMethodError do |e| rescue_from NoMethodError do |e|
Util.logger_error e Util.logger_error e
render json: {status: -1, message: "接口方法异常"} render json: {status: -1, message: "接口方法异常"}
@ -18,6 +20,7 @@ module ControllerRescueHandler
rescue_from ActionController::UnknownFormat do |e| rescue_from ActionController::UnknownFormat do |e|
render json: {status: -1, message: "接口调用非JSON格式"} render json: {status: -1, message: "接口调用非JSON格式"}
end end
# rescue_from ActionView::MissingTemplate, with: :object_not_found # rescue_from ActionView::MissingTemplate, with: :object_not_found
# rescue_from ActiveRecord::RecordNotFound, with: :object_not_found # rescue_from ActiveRecord::RecordNotFound, with: :object_not_found
rescue_from Educoder::TipException, with: :tip_show rescue_from Educoder::TipException, with: :tip_show
@ -32,6 +35,7 @@ module ControllerRescueHandler
rescue_from ActiveRecord::RecordInvalid do |ex| rescue_from ActiveRecord::RecordInvalid do |ex|
render_error(ex.record.errors.full_messages.join(',')) render_error(ex.record.errors.full_messages.join(','))
end end
# rescue_from RuntimeError do |ex| # rescue_from RuntimeError do |ex|
# Util.logger_error "#######ex:#{ex}" # Util.logger_error "#######ex:#{ex}"
# render_error(ex.message) # render_error(ex.message)

@ -44,9 +44,9 @@ if (isDev) {
// 超管 // 超管
debugType="admin"; debugType="admin";
// 老师 // 老师
//debugType="teacher"; // debugType="teacher";
// 学生 // 学生
//debugType="student"; // debugType="student";

@ -22,8 +22,8 @@ import FillBlot from './FillBlot';
const Size = Quill.import('attributors/style/size'); const Size = Quill.import('attributors/style/size');
const Font = Quill.import('formats/font'); const Font = Quill.import('formats/font');
// const Color = Quill.import('attributes/style/color'); // const Color = Quill.import('attributes/style/color');
Size.whitelist = ['12px', '14px', '16px', '18px', '20px', false]; Size.whitelist = ['14px', '16px', '18px', '20px', false];
Font.whitelist = ['SimSun', 'SimHei','Microsoft-YaHei','KaiTi','FangSong','Arial','Times-New-Roman','sans-serif']; Font.whitelist = ['Microsoft-YaHei','SimSun', 'SimHei','KaiTi','FangSong','Arial','Times-New-Roman','sans-serif'];
window.Quill = Quill; window.Quill = Quill;
window.katex = katex; window.katex = katex;
@ -55,10 +55,11 @@ function QuillForEditor ({
// toolbar 默认值 // toolbar 默认值
const defaultConfig = [ const defaultConfig = [
'bold', 'italic', 'underline', 'bold', 'italic', 'underline',
{size: ['12px', '14px', '16px', '18px', '20px']}, {size: ['14px', '16px', '18px', '20px']},
{align: []}, {list: 'ordered'}, {list: 'bullet'}, // 列表 {align: []}, {list: 'ordered'}, {list: 'bullet'}, // 列表
{script: 'sub'}, {script: 'super'}, {script: 'sub'}, {script: 'super'},
{ 'color': [] }, { 'background': [] }, { 'color': [] }, { 'background': [] },
{ 'font': ['Microsoft-YaHei','SimSun', 'SimHei','KaiTi','FangSong','Arial','Times-New-Roman','sans-serif']},
{header: [1,2,3,4,5,false]}, {header: [1,2,3,4,5,false]},
'blockquote', 'code-block', 'blockquote', 'code-block',
'link', 'image', 'video', 'link', 'image', 'video',
@ -99,7 +100,7 @@ function QuillForEditor ({
*/ */
handler: function (range, context) { handler: function (range, context) {
/** /**
* index: 删除元素的位置 * index: 删除元素的位置
* length: 删除元素的个数 * length: 删除元素的个数
*/ */
const {index, length} = range; const {index, length} = range;
@ -123,7 +124,7 @@ function QuillForEditor ({
let delIndexs = []; let delIndexs = [];
// 获取删除元素的下标 // 获取删除元素的下标
delArrs.forEach((item, i) => { delArrs.forEach((item, i) => {
leaveLen === 0 ? delIndexs.push(i) : delIndexs.push(leaveLen + i); leaveLen === 0 ? delIndexs.push(i) : delIndexs.push(leaveLen + i);
}); });
deleteFill && deleteFill(delIndexs); // 调用删除回调, 返回删除的元素下标[] deleteFill && deleteFill(delIndexs); // 调用删除回调, 返回删除的元素下标[]
return true return true

@ -174,4 +174,4 @@ class LiveItem extends Component{
) )
} }
} }
export default LiveItem; export default LiveItem;

@ -294,4 +294,4 @@ class VideoIndex extends Component{
) )
} }
} }
export default VideoIndex; export default VideoIndex;

@ -4,7 +4,7 @@
* @Github: * @Github:
* @Date: 2019-12-30 13:51:19 * @Date: 2019-12-30 13:51:19
* @LastEditors : tangjiang * @LastEditors : tangjiang
* @LastEditTime : 2020-01-07 15:46:24 * @LastEditTime : 2020-02-11 16:34:18
*/ */
import './index.scss'; import './index.scss';
import React, { useState, useEffect } from 'react'; import React, { useState, useEffect } from 'react';
@ -22,7 +22,6 @@ function KnowLedge (props) {
showAdd, // 显示新增图标 showAdd, // 显示新增图标
addKnowledge // 调用新增知识点接口 addKnowledge // 调用新增知识点接口
} = props; } = props;
useEffect(() => { useEffect(() => {
const _options = []; const _options = [];
const _selects = []; const _selects = [];

@ -35,7 +35,10 @@ const NewOrEditTask = (props) => {
getUserInfoForNew, getUserInfoForNew,
handleCancelPublish, handleCancelPublish,
validateOjForm, validateOjForm,
getQuestion getQuestion,
saveSearchParams,
setOjInitialValue,
courseQuestions
// updateTestAndValidate, // updateTestAndValidate,
} = props; } = props;
@ -54,14 +57,35 @@ const NewOrEditTask = (props) => {
useEffect(() => { useEffect(() => {
// 获取用户信息 // 获取用户信息
getUserInfoForNew(); getUserInfoForNew();
// console.log('获取路由参数: ====', props.match.params);
const id = props.match.params.id;
// 保存OJForm的id号指明是编辑还是新增
props.saveOJFormId(id);
// 获取地址栏查询参数
const $searchs = window.location.search && window.location.search.substring(1);
if ($searchs) {
const $params = $searchs.split('&') || [];
let obj = Object.create(null);
$params.forEach(item => {
const keys = item.split('=');
obj[keys[0]] = keys[1];
});
// 保存初始值
if (obj['newoj']) {
const tags = obj['tag_discipline_id'];
const tag_arrs = (tags && tags.split(',').map(tag => +tag)) || [];
setOjInitialValue({
difficult: obj['difficult'],
sub_discipline_id: obj['sub_discipline_id'],
tag_discipline_id: tag_arrs
});
}
saveSearchParams({searchParams: $searchs, curPage: obj['pages']});
}
// 获取课程列表 // 获取课程列表
getQuestion({ getQuestion({
source: 'question' source: 'question'
}); });
// console.log('获取路由参数: ====', props.match.params);
const id = props.match.params.id;
// 保存OJForm的id号指明是编辑还是新增
props.saveOJFormId(id);
if (id) { // id号即 identifier if (id) { // id号即 identifier
// TODO id 存在时, 编辑, 获取 store 中的记录数 // TODO id 存在时, 编辑, 获取 store 中的记录数
props.getOJFormById(id); props.getOJFormById(id);
@ -96,7 +120,8 @@ const NewOrEditTask = (props) => {
props.clearOJFormStore(); props.clearOJFormStore();
// 清空描述信息 // 清空描述信息
toStore('oj_description', ''); toStore('oj_description', '');
props.history.push('/problems'); // props.history.push('/problems');
props.history.push(`/question?${props.searchParams}`);
} }
// 发布 // 发布
@ -236,7 +261,7 @@ const NewOrEditTask = (props) => {
} }
const mapStateToProps = (state) => { const mapStateToProps = (state) => {
const { ojForm, identifier, testCases, isPublish } = state.ojFormReducer; const { ojForm, identifier, testCases, isPublish, searchParams, courseQuestions } = state.ojFormReducer;
const { publishLoading, submitLoading } = state.commonReducer; const { publishLoading, submitLoading } = state.commonReducer;
const { userInfo } = state.userReducer; const { userInfo } = state.userReducer;
return { return {
@ -246,7 +271,9 @@ const mapStateToProps = (state) => {
isPublish, // 是否已发布 isPublish, // 是否已发布
publishLoading, publishLoading,
submitLoading, submitLoading,
userInfo userInfo,
searchParams,
courseQuestions
} }
}; };
@ -278,7 +305,9 @@ const mapDispatchToProps = (dispatch) => ({
// 新建时获取信息 // 新建时获取信息
getUserInfoForNew: () => dispatch(actions.getUserInfoForNew()), getUserInfoForNew: () => dispatch(actions.getUserInfoForNew()),
validateOjForm: (props, type, cb) => dispatch(actions.validateOjForm(props, type, cb)), validateOjForm: (props, type, cb) => dispatch(actions.validateOjForm(props, type, cb)),
getQuestion: (params) => dispatch(actions.getQuestion(params)) getQuestion: (params) => dispatch(actions.getQuestion(params)),
saveSearchParams: (params) => dispatch(actions.saveSearchParams(params)),
setOjInitialValue: (params) => dispatch(actions.setOjInitialValue(params))
}); });
export default withRouter(connect( export default withRouter(connect(

@ -4,7 +4,7 @@
* @Github: * @Github:
* @Date: 2019-11-20 10:35:40 * @Date: 2019-11-20 10:35:40
* @LastEditors : tangjiang * @LastEditors : tangjiang
* @LastEditTime : 2020-02-05 13:26:58 * @LastEditTime : 2020-02-11 16:44:57
*/ */
import './index.scss'; import './index.scss';
// import 'katex/dist/katex.css'; // import 'katex/dist/katex.css';
@ -61,7 +61,7 @@ class EditTab extends React.Component {
top: 500, top: 500,
bottom: 20, bottom: 20,
offsetTop: 0, offsetTop: 0,
showAdd: false showAdd: props.tag_discipline_id || false
// knowledges: [], // knowledges: [],
// coursers: [] // 选中的课程 // coursers: [] // 选中的课程
} }

@ -4,7 +4,7 @@
* @Github: * @Github:
* @Date: 2019-11-23 10:53:19 * @Date: 2019-11-23 10:53:19
* @LastEditors : tangjiang * @LastEditors : tangjiang
* @LastEditTime : 2020-01-06 15:27:34 * @LastEditTime : 2020-02-10 18:24:01
*/ */
import './index.scss'; import './index.scss';
import React, { useEffect, useState } from 'react'; import React, { useEffect, useState } from 'react';
@ -31,7 +31,9 @@ function StudentStudy (props) {
// user_program_identifier, // user_program_identifier,
restoreInitialCode, restoreInitialCode,
changeUserCodeTab, changeUserCodeTab,
changeShowOrHideControl changeShowOrHideControl,
searchParams,
saveSearchParams
} = props; } = props;
const { const {
@ -47,7 +49,16 @@ function StudentStudy (props) {
saveUserProgramIdentifier(id); saveUserProgramIdentifier(id);
// startProgramQuestion(id); // startProgramQuestion(id);
getUserProgramDetail(id); getUserProgramDetail(id);
const $searchs = window.location.search && window.location.search.substring(1);
if ($searchs) {
const $params = $searchs.split('&') || [];
let obj = Object.create(null);
$params.forEach(item => {
const keys = item.split('=');
obj[keys[0]] = keys[1];
});
saveSearchParams({searchParams: $searchs, curPage: obj['pages']});
}
if (tab) { if (tab) {
changeUserCodeTab(tab); changeUserCodeTab(tab);
} }
@ -97,7 +108,7 @@ function StudentStudy (props) {
changeShowOrHideControl(false); changeShowOrHideControl(false);
props.saveEditorCodeForDetail(''); props.saveEditorCodeForDetail('');
props.clearOjForUserReducer(); props.clearOjForUserReducer();
props.history.push(`/problems/${identifier}/edit`); props.history.push(`/problems/${identifier}/edit?{searchParams}`);
} }
// 处理退出 // 处理退出
const handleClickQuit = () => { const handleClickQuit = () => {
@ -106,7 +117,8 @@ function StudentStudy (props) {
// 将控制台关闭 // 将控制台关闭
changeShowOrHideControl(false); changeShowOrHideControl(false);
props.saveEditorCodeForDetail(''); props.saveEditorCodeForDetail('');
props.history.push('/problems'); // props.history.push('/problems');
props.history.push(`/question?${searchParams}`);
} }
return ( return (
@ -163,11 +175,13 @@ function StudentStudy (props) {
const mapStateToProps = (state) => { const mapStateToProps = (state) => {
const { userInfo } = state.userReducer; const { userInfo } = state.userReducer;
const { hack_identifier, user_program_identifier, hack } = state.ojForUserReducer; const { hack_identifier, user_program_identifier, hack } = state.ojForUserReducer;
const { searchParams } = state.ojFormReducer;
return { return {
hack, hack,
userInfo, userInfo,
user_program_identifier, user_program_identifier,
hack_identifier hack_identifier,
searchParams
}; };
}; };
@ -182,7 +196,8 @@ const mapDispatchToProps = (dispatch) => ({
restoreInitialCode: (identifier, msg) => dispatch(actions.restoreInitialCode(identifier, msg)), restoreInitialCode: (identifier, msg) => dispatch(actions.restoreInitialCode(identifier, msg)),
changeShowOrHideControl: (flag) => dispatch(actions.changeShowOrHideControl(flag)), changeShowOrHideControl: (flag) => dispatch(actions.changeShowOrHideControl(flag)),
clearOjForUserReducer: () => dispatch(actions.clearOjForUserReducer()), clearOjForUserReducer: () => dispatch(actions.clearOjForUserReducer()),
changeUserCodeTab: (tab) => dispatch(actions.changeUserCodeTab(tab)) changeUserCodeTab: (tab) => dispatch(actions.changeUserCodeTab(tab)),
saveSearchParams: (params) => dispatch(actions.saveSearchParams(params))
}); });
export default withRouter(connect( export default withRouter(connect(

@ -406,14 +406,14 @@ class Paperreview extends Component {
Cohetepaperbool===false? Cohetepaperbool===false?
artificialtype==="artificial"? artificialtype==="artificial"?
<Breadcrumb separator=">"> <Breadcrumb separator=">">
<Breadcrumb.Item href="/question">试题库</Breadcrumb.Item> <Breadcrumb.Item >试题库</Breadcrumb.Item>
<Breadcrumb.Item className={"xiaoshou"}>人工组卷</Breadcrumb.Item> <Breadcrumb.Item className={"xiaoshou"} href="/question">人工组卷</Breadcrumb.Item>
<Breadcrumb.Item className={"xiaoshout"}>试卷预览</Breadcrumb.Item> <Breadcrumb.Item className={"xiaoshout"}>试卷预览</Breadcrumb.Item>
</Breadcrumb> </Breadcrumb>
: :
<Breadcrumb separator=">"> <Breadcrumb separator=">">
<Breadcrumb.Item href="/paperlibrary">试卷库</Breadcrumb.Item> <Breadcrumb.Item >试卷库</Breadcrumb.Item>
<Breadcrumb.Item className={"/Integeneration"}>智能组卷</Breadcrumb.Item> <Breadcrumb.Item className={"/Integeneration"} href="/paperlibrary">智能组卷</Breadcrumb.Item>
<Breadcrumb.Item className={"xiaoshout"}>试卷预览</Breadcrumb.Item> <Breadcrumb.Item className={"xiaoshout"}>试卷预览</Breadcrumb.Item>
</Breadcrumb> </Breadcrumb>
: :
@ -449,7 +449,7 @@ class Paperreview extends Component {
<Bottomsubmit {...this.props} {...this.state} bottomvalue={Cohetepaperbool===false?"保存组卷":"完成"} <Bottomsubmit {...this.props} {...this.state} bottomvalue={Cohetepaperbool===false?"保存组卷":"完成"}
setCohetepaperbool={(bool)=>this.setCohetepaperbool(bool)} setCohetepaperbool={(bool)=>this.setCohetepaperbool(bool)}
onSubmits={() => this.preservation()} url={'/question'}></Bottomsubmit> onSubmits={() => this.preservation()} url={ artificialtype==="artificial"?'/question':'/paperlibrary'}></Bottomsubmit>
</div> </div>
) )

@ -90,7 +90,10 @@ 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+"分");
const options = [
'bold', // 加粗
]
return ( return (
<div key={indexxy} <div key={indexxy}
className={ "w100s borderwdswuh mb20 pd20 "} className={ "w100s borderwdswuh mb20 pd20 "}
@ -122,7 +125,7 @@ class Paperreview_single extends Component {
{/*顶部*/} {/*顶部*/}
<div className="w100s sortinxdirection "> <div className="w100s sortinxdirection ">
<div className=" sortinxdirection "> <div className=" sortinxdirection ">
<p className="cretitlecolrlis lh28">{indexx}</p> <p className="cretitlecolrlis lh28" style={{fontWeight:"bold"}}>{indexx}</p>
</div> </div>
<style> <style>
{ {
@ -133,12 +136,18 @@ class Paperreview_single extends Component {
line-height: 28px; line-height: 28px;
} }
.markdown-body p { .markdown-body p {
color: #333333; color: #333333;
font-size: 14px !important; font-size: 14px !important;
line-height: 28px; line-height: 28px;
font-weight: bold;
} }
.bodyysls .ql-editor p span{
font-weight: bold;
}
` `
} }
</style> </style>
@ -146,25 +155,26 @@ class Paperreview_single extends Component {
objectsingle.item_type==="PROGRAM"? objectsingle.item_type==="PROGRAM"?
<div className="w100s sortinxdirection"> <div className="w100s sortinxdirection">
<div className=" tites lh28 listjihetixingstit markdown-body cretitlecolrlist " style={{wordBreak: "break-word", <div className=" tites lh28 listjihetixingstit markdown-body cretitlecolrlist " style={{wordBreak: "break-word",
minWidth:"32px" minWidth:"32px",fontWeight:"bold"
}} }}
> >
({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",fontWeight:"bold"}}
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={{wordBreak: "break-word", <div id={"titesstwo"} className="tites titesstwostest lh28 listjihetixingstit markdown-body cretitlecolrlist " style={{wordBreak: "break-word",
minWidth:"32px" minWidth:"32px",fontWeight:"bold"
}} }}
> >
({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 bodyysls cretitlecolrlist programquill":objectsingle.score<100?" lh28 listjihetixingstit text-indents44 bodyysls cretitlecolrlist programquill":" lh28 listjihetixingstit text-indents50 bodyysls cretitlecolrlist programquill" }style={{wordBreak: "break-word",fontWeight:"bold"}}
> >
{ {
itemssname===null|| itemssname===undefined? itemssname===null|| itemssname===undefined?
@ -207,7 +217,7 @@ class Paperreview_single extends Component {
<p className={"sortinxdirection mt15"}> <p className={"sortinxdirection mt15"}>
{ {
objectsingle&&objectsingle.program_attr&&objectsingle.program_attr.description? objectsingle&&objectsingle.program_attr&&objectsingle.program_attr.description?
<p className="programquill" style={{wordBreak: "break-word"}} <p className="programquill " style={{wordBreak: "break-word"}}
> >
{ {
itemsnamesy===null || itemsnamesy===undefined? itemsnamesy===null || itemsnamesy===undefined?

@ -118,6 +118,7 @@ class Question extends Component {
setsub_discipline_id=(discipline_id,sub_discipline_id)=>{ setsub_discipline_id=(discipline_id,sub_discipline_id)=>{
this.setState({ this.setState({
sub_discipline_id:sub_discipline_id, sub_discipline_id:sub_discipline_id,
discipline_id:discipline_id,
tag_discipline_id:null, tag_discipline_id:null,
keyword:"", keyword:"",
page:1, page:1,
@ -937,6 +938,7 @@ class Question extends Component {
/> />
{/*头部*/} {/*头部*/}
<Contentpart {...this.state} {...this.props} <Contentpart {...this.state} {...this.props}
pages={this.state.page}
Isitapopup={"false"} Isitapopup={"false"}
chakanjiexiboolindex={this.state.chakanjiexiboolindex} chakanjiexiboolindex={this.state.chakanjiexiboolindex}
chakanjiexibool={(e)=>this.chakanjiexibool(e)} chakanjiexibool={(e)=>this.chakanjiexibool(e)}

@ -1,6 +1,6 @@
import React, {Component} from "react"; import React, {Component} from "react";
import {Link, NavLink} from 'react-router-dom'; import {Link, NavLink} from 'react-router-dom';
import {WordsBtn, ActionBtn, SnackbarHOC, getImageUrl} from 'educoder'; import {WordsBtn, ActionBtn, SnackbarHOC, getImageUrl,queryString} from 'educoder';
import axios from 'axios'; import axios from 'axios';
import { import {
notification, notification,
@ -35,13 +35,25 @@ class Questionitem_banks extends Component {
myquestion_choicesco: [], myquestion_choicesco: [],
disciplinesdata: [], disciplinesdata: [],
knowledgepoints: [], knowledgepoints: [],
disciplmy:[] disciplmy:[],
pages:1,
} }
} }
//初始化 //初始化
componentDidMount() { componentDidMount() {
const query = this.props.location.search;
const parsed = queryString.parse(query);
console.log(parsed);
try {
this.setState({
pages:parsed.pages
})
}catch (e) {
}
// let {defaultActiveKey}= this.state; // let {defaultActiveKey}= this.state;
// var data={ // var data={
// public:defaultActiveKey // public:defaultActiveKey
@ -454,6 +466,7 @@ class Questionitem_banks extends Component {
} }
if (this.state.item_type === "PROGRAM") { if (this.state.item_type === "PROGRAM") {
//编程题 跳转到 oj 中创建 //编程题 跳转到 oj 中创建
// debugger
var myrbkc=[]; var myrbkc=[];
var Getdatasdatas=Getdatasdata[2].rbzsd; var Getdatasdatas=Getdatasdata[2].rbzsd;
for(let myda of Getdatasdatas) { for(let myda of Getdatasdatas) {
@ -465,7 +478,12 @@ class Questionitem_banks extends Component {
sub_discipline_id: Getdatasdata[3].rbkc[1], sub_discipline_id: Getdatasdata[3].rbkc[1],
tag_discipline_id: myrbkc, tag_discipline_id: myrbkc,
}); });
window.open("/problems/new");
let arrays=myrbkc.join(',');
// console.log("开始打印了");
// console.log(arrays);
window.open( `/problems/new?difficult=${Getdatasdata[0].rbnd}&sub_discipline_id=${Getdatasdata[3].rbkc[1]}&tag_discipline_id=${arrays}&newoj=1&pages=${this.state.pages}`);
} }
@ -491,7 +509,10 @@ class Questionitem_banks extends Component {
<style> <style>
{ {
` `
body{
width: 100%!important;
}
.newFooter{ .newFooter{
display: none; display: none;
} }

@ -230,17 +230,14 @@ 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 {
} else { texts=JSON.stringify(value);
if(_text.length>=301){ }catch (e) {
var result = _text.substring(0,300); texts="";
texts={"ops":[{"insert":result}]};
texts=JSON.stringify(texts);
}else {
// 提交到后台的内容需要处理一下;
value = JSON.stringify(value);
texts=value;
} }
} else {
value = JSON.stringify(value);
texts=value;
} }
let question_choices = this.state.question_choices.slice(0); let question_choices = this.state.question_choices.slice(0);
question_choices[index] = texts; question_choices[index] = texts;
@ -265,24 +262,24 @@ class ChoquesEditor extends Component{
} }
onContentChange=(value,quill)=>{ onContentChange=(value,quill)=>{
// debugger
const _text = quill.getText(); const _text = quill.getText();
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=""; let texts="";
if(_text.length>=1001){ texts = JSON.stringify(value);
var result = _text.substring(0,1000);
texts={"ops":[{"insert":result}]};
texts=JSON.stringify(texts);
}else {
value = JSON.stringify(value)
texts=value;
}
this.setState({ this.setState({
question_titleysl:texts question_titleysl:texts
}) })
@ -293,20 +290,20 @@ 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=""; let texts="";
if(_text.length>=1001){
var result = _text.substring(0,1000); texts = JSON.stringify(value);
texts={"ops":[{"insert":result}]};
texts=JSON.stringify(texts);
}else {
value = JSON.stringify(value)
texts=value;
}
this.setState({ this.setState({
question_titlesysl:texts question_titlesysl:texts
}) })
@ -336,7 +333,10 @@ class ChoquesEditor extends Component{
// //////console.log("xuanzheshijuan"); // //////console.log("xuanzheshijuan");
// //////console.log(answerTagArray); // //////console.log(answerTagArray);
// //////console.log(!exerciseIsPublish); // //////console.log(!exerciseIsPublish);
const options=['code-block', 'image', 'formula',{size: ['14px', '16px', '18px', '20px']},
{ 'color': ['#333333','#e60000','#ff9900','#ffff00','#ffffff']},
{ 'font': ['Microsoft-YaHei','SimSun', 'SimHei','KaiTi','FangSong','Arial','Times-New-Roman','sans-serif']}
]
return( return(
<div className="padding20-30 signleEditor duoxuano" id={qNumber}> <div className="padding20-30 signleEditor duoxuano" id={qNumber}>
<style>{` <style>{`
@ -357,6 +357,12 @@ class ChoquesEditor extends Component{
#e_tips_mdEditor_question_undefined4{ #e_tips_mdEditor_question_undefined4{
display: none; display: none;
} }
.signleEditor .quill_editor_for_react_area .ql-toolbar .ql-formats .ql-size {
line-height: 20px;
}
.signleEditor .quill_editor_for_react_area .ql-toolbar .ql-formats .ql-font {
line-height: 20px;
}
`}</style> `}</style>
<p className="mb10 clearfix"> <p className="mb10 clearfix">
{/* {!question_id ? '新建' : '编辑'} */} {/* {!question_id ? '新建' : '编辑'} */}
@ -369,7 +375,7 @@ class ChoquesEditor extends Component{
imgAttrs={{width: '146px', height: '136px'}} imgAttrs={{width: '146px', height: '136px'}}
style={{ height: '155px'}} style={{ height: '155px'}}
placeholder="请您输入题干" placeholder="请您输入题干"
options={['code-block', 'image', 'formula']} options={options}
value={question_title} value={question_title}
onContentChange={this.onContentChange} onContentChange={this.onContentChange}
@ -403,7 +409,7 @@ class ChoquesEditor extends Component{
imgAttrs={{width: '146px', height: '136px'}} imgAttrs={{width: '146px', height: '136px'}}
style={{ height: '166px'}} style={{ height: '166px'}}
placeholder="请您输入题干" placeholder="请您输入题干"
options={['code-block', 'image', 'formula']} options={options}
value={item} value={item}
onContentChange={(value,quill) => this.onOptionContentChange(value,quill,index)} onContentChange={(value,quill) => this.onOptionContentChange(value,quill,index)}
/> />
@ -413,7 +419,7 @@ class ChoquesEditor extends Component{
imgAttrs={{width: '146px', height: '136px'}} imgAttrs={{width: '146px', height: '136px'}}
style={{ height: '166px'}} style={{ height: '166px'}}
placeholder="请您输入题干" placeholder="请您输入题干"
options={['code-block', 'image', 'formula']} options={options}
value={JSON.parse(item)} value={JSON.parse(item)}
onContentChange={(value,quill) => this.onOptionContentChange(value,quill,index)} onContentChange={(value,quill) => this.onOptionContentChange(value,quill,index)}
/> />
@ -452,7 +458,7 @@ class ChoquesEditor extends Component{
imgAttrs={{width: '146px', height: '136px'}} imgAttrs={{width: '146px', height: '136px'}}
style={{height: '166px' }} style={{height: '166px' }}
placeholder="请您输入题目解析" placeholder="请您输入题目解析"
options={['code-block', 'image', 'formula']} options={options}
value={question_titles} value={question_titles}
onContentChange={this.onContentChanges} onContentChange={this.onContentChanges}
/> />

@ -38,7 +38,7 @@ class Contentpart extends Component {
} }
componentDidUpdate(prevProps) { componentDidUpdate(prevProps) {
if(prevProps.current_user !== this.props.current_user) { if(prevProps.current_user !== this.props.current_user) {
debugger
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;
const professional_certification=this.props&&this.props.current_user&&this.props.current_user.professional_certification?this.props.current_user.professional_certification:false; const professional_certification=this.props&&this.props.current_user&&this.props.current_user.professional_certification?this.props.current_user.professional_certification:false;
@ -53,50 +53,51 @@ class Contentpart extends Component {
} }
} }
xinzenw=(e)=>{ xinzenw=(e)=>{
var urls="?"; var urls="";
if(this.props.discipline_id){ if(this.props.discipline_id){
if(urls==="?"){ // if(urls==="?"){
urls=urls+`discipline_id=${this.props.discipline_id}` // urls=urls+`discipline_id=${this.props.discipline_id}`
}else { // }else {
urls=urls+`&discipline_id=${this.props.discipline_id}` urls=urls+`&discipline_id=${this.props.discipline_id}`
} // }
} }
if(this.props.sub_discipline_id){ if(this.props.sub_discipline_id){
if(urls==="?"){ // if(urls==="?"){
urls=urls+`sub_discipline_id=${this.props.sub_discipline_id}` // urls=urls+`sub_discipline_id=${this.props.sub_discipline_id}`
}else { // }else {
urls=urls+`&sub_discipline_id=${this.props.sub_discipline_id}` urls=urls+`&sub_discipline_id=${this.props.sub_discipline_id}`
} // }
} }
if(this.props.tag_discipline_id){ if(this.props.tag_discipline_id){
if(urls==="?"){ // if(urls==="?"){
urls=urls+`sub_discipline_id=${this.props.tag_discipline_id}` // urls=urls+`sub_discipline_id=${this.props.tag_discipline_id}`
}else { // }else {
urls=urls+`&sub_discipline_id=${this.props.tag_discipline_id}` urls=urls+`&sub_discipline_id=${this.props.tag_discipline_id}`
} // }
} }
if(this.props.difficulty){ if(this.props.difficulty){
if(urls==="?"){ // if(urls==="?"){
urls=urls+`difficulty=${this.props.difficulty}&` // urls=urls+`difficulty=${this.props.difficulty}&`
}else { // }else {
urls=urls+`&difficulty=${this.props.difficulty}` urls=urls+`&difficulty=${this.props.difficulty}`
} // }
} }
if(this.props.item_type){ if(this.props.item_type){
if(urls==="?"){ // if(urls==="?"){
urls=urls+`item_type=${this.props.item_type}` // urls=urls+`item_type=${this.props.item_type}`
}else { // }else {
urls=urls+`&item_type=${this.props.item_type}` urls=urls+`&item_type=${this.props.item_type}`
} // }
} }
this.props.history.push("/question/newitem?pages="+this.props.pages+urls);
this.props.history.push("/question/newitem"+urls);
} }
render() { render() {
let {page}=this.state; let {page}=this.state;
let {defaultActiveKey,item_type,booljupyterurls}=this.props; let {defaultActiveKey,item_type,booljupyterurls}=this.props;
const defaultActiveKeys=defaultActiveKey+'';
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;
const professional_certification=this.props&&this.props.current_user&&this.props.current_user.professional_certification?this.props.current_user.professional_certification:false; const professional_certification=this.props&&this.props.current_user&&this.props.current_user.professional_certification?this.props.current_user.professional_certification:false;
@ -166,14 +167,14 @@ class Contentpart extends Component {
{ {
isysladmins===true||(is_teacher===true&&professional_certification===true)? isysladmins===true||(is_teacher===true&&professional_certification===true)?
<Tabs activeKey={defaultActiveKey} onChange={(e)=>this.props.callback(e)}> <Tabs activeKey={defaultActiveKeys} onChange={(e)=>this.props.callback(e)}>
<TabPane tab="公共" key="1"> <TabPane tab="公共" key="1">
</TabPane> </TabPane>
<TabPane tab="我的" key="0"> <TabPane tab="我的" key="0">
</TabPane> </TabPane>
</Tabs> </Tabs>
: :
<Tabs activeKey={1} onChange={(e)=>this.props.callback(e)}> <Tabs activeKey={"1"} onChange={(e)=>this.props.callback(e)}>
<TabPane tab="公共" key="1"> <TabPane tab="公共" key="1">
</TabPane> </TabPane>
</Tabs> </Tabs>
@ -316,6 +317,7 @@ class Contentpart extends Component {
keindex={index} keindex={index}
items={object} items={object}
key={index} key={index}
pages={this.props.pages}
getitem_basketss={(id)=>this.props.getitem_basketss(id)} getitem_basketss={(id)=>this.props.getitem_basketss(id)}
getitem_baskets={(e)=>this.props.getitem_baskets(e)} getitem_baskets={(e)=>this.props.getitem_baskets(e)}
showmodels={(e)=>this.props.showmodels(e)} showmodels={(e)=>this.props.showmodels(e)}

@ -80,10 +80,36 @@ class Headplugselections extends Component {
}catch (e) { }catch (e) {
} }
}
shixunserdchAlls=(itme,id)=>{
if(id!=undefined){
this.setState({
shixunsearchAllvalue:id,
})
try {
this.props.setdiscipline_id(id);
}catch (e) {
}
}
// console.log(itme);
// console.log(itme[0]);
if(itme!=undefined){
try {
this.props.setsub_discipline_id(id,itme[0].id);
}catch (e) {
}
}
} }
//获取方向 //获取方向
shixunsearchAll = (id) => { shixunsearchAll = (id) => {
//大写A
//console.log("获取方向"); //console.log("获取方向");
//console.log(id); //console.log(id);
if(id!=undefined){ if(id!=undefined){
@ -128,7 +154,8 @@ class Headplugselections extends Component {
getshixunchildValue = (id,ids) => { getshixunchildValue = (id,ids) => {
// //console.log("getshixunchildValue"); // //console.log("getshixunchildValue");
// //console.log(id); // console.log(id);
// console.log(ids);
// debugger // debugger
if(id!=undefined ||ids!=undefined){ if(id!=undefined ||ids!=undefined){
this.setState({ this.setState({
@ -141,6 +168,7 @@ class Headplugselections extends Component {
} }
} }
} }
render() { render() {
let {shixunhoverData, shixunchildValues, shixunsearchAllvalue, InputValue,openStatus,openLevel} = this.state; let {shixunhoverData, shixunchildValues, shixunsearchAllvalue, InputValue,openStatus,openLevel} = this.state;
@ -232,8 +260,8 @@ class Headplugselections extends Component {
disciplinesdata&&disciplinesdata.map((item,key)=>{ disciplinesdata&&disciplinesdata.map((item,key)=>{
return( return(
item.sub_disciplines.length>0? item.sub_disciplines.length>0?
<Dropdown getPopupContainer={trigger => trigger.parentNode} overlay={ overlaymenu(item.sub_disciplines,item.id)} key={key} placement={item.id<4?"bottomRight":item.id>=8?"bottomLeft":"bottomCenter"}> <Dropdown getPopupContainer={trigger => trigger.parentNode} overlay={ overlaymenu(item.sub_disciplines,item.id)} key={key} placement={"bottomRight"}>
<li key={key} className={parseInt(shixunsearchAllvalue)===item.id?"shaiItem shixun_repertoire active":"shaiItem shixun_repertoire"} value={item.id} onClick={()=>this.shixunsearchAll(item.id)}> <li key={key} className={parseInt(shixunsearchAllvalue)===item.id?"shaiItem shixun_repertoire active":"shaiItem shixun_repertoire"} value={item.id} onClick={()=>this.shixunserdchAlls(item.sub_disciplines,item.id)}>
{item.name} {item.name}
</li> </li>
</Dropdown> </Dropdown>

@ -681,6 +681,9 @@ class Itembankstop extends Component {
<style> <style>
{ {
` `
body{
width: 100%!important;
}
.ant-form-item{ .ant-form-item{
margin-bottom: 0px !important; margin-bottom: 0px !important;

@ -187,6 +187,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) {
@ -282,24 +289,32 @@ 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=""; let texts="";
if(_text.length>=1001){ texts = JSON.stringify(value);
var result = _text.substring(0,1000);
texts={"ops":[{"insert":result}]};
texts=JSON.stringify(texts);
}else {
value = JSON.stringify(value)
texts=value;
}
this.setState({ this.setState({
question_titleysl:texts question_titleysl:texts
}) })
@ -310,20 +325,21 @@ 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=""; let texts="";
if(_text.length>=1001){
var result = _text.substring(0,1000); texts = JSON.stringify(value);
texts={"ops":[{"insert":result}]};
texts=JSON.stringify(texts);
}else {
value =JSON.stringify(value);
texts=value;
}
this.setState({ this.setState({
question_titlesysl:texts question_titlesysl:texts
}) })
@ -352,6 +368,10 @@ class JudquestionEditor extends Component{
// ////////console.log(answerTagArray); // ////////console.log(answerTagArray);
// ////////console.log(!exerciseIsPublish); // ////////console.log(!exerciseIsPublish);
const params= this.props&&this.props.match&&this.props.match.params; const params= this.props&&this.props.match&&this.props.match.params;
const options=['code-block', 'image', 'formula',{size: ['14px', '16px', '18px', '20px']},
{ 'color': ['#333333','#e60000','#ff9900','#ffff00','#ffffff']},
{ 'font': ['Microsoft-YaHei','SimSun', 'SimHei','KaiTi','FangSong','Arial','Times-New-Roman','sans-serif']}
]
return( return(
<div className="padding20-30 signleEditor danxuano" id={qNumber}> <div className="padding20-30 signleEditor danxuano" id={qNumber}>
<style>{` <style>{`
@ -372,6 +392,12 @@ class JudquestionEditor extends Component{
#e_tips_mdEditor_question_undefined4{ #e_tips_mdEditor_question_undefined4{
display: none; display: none;
} }
.signleEditor .quill_editor_for_react_area .ql-toolbar .ql-formats .ql-size {
line-height: 20px;
}
.signleEditor .quill_editor_for_react_area .ql-toolbar .ql-formats .ql-font {
line-height: 20px;
}
`}</style> `}</style>
<p className="mb10 clearfix"> <p className="mb10 clearfix">
{/* {!question_id ? '新建' : '编辑'} */} {/* {!question_id ? '新建' : '编辑'} */}
@ -384,7 +410,7 @@ class JudquestionEditor extends Component{
imgAttrs={{width: '146px', height: '136px'}} imgAttrs={{width: '146px', height: '136px'}}
style={{ height: '155px'}} style={{ height: '155px'}}
placeholder="请您输入题干" placeholder="请您输入题干"
options={['code-block', 'image', 'formula']} options={options}
value={question_title} value={question_title}
onContentChange={this.onContentChange} onContentChange={this.onContentChange}
@ -434,7 +460,7 @@ class JudquestionEditor extends Component{
imgAttrs={{width: '146px', height: '136px'}} imgAttrs={{width: '146px', height: '136px'}}
style={{height: '166px' }} style={{height: '166px' }}
placeholder="请您输入题目解析" placeholder="请您输入题目解析"
options={['code-block', 'image', 'formula']} options={options}
value={question_titles} value={question_titles}
onContentChange={this.onContentChanges} onContentChange={this.onContentChanges}
/> />

@ -151,10 +151,13 @@ class Listjihe extends Component {
}catch (e) { }catch (e) {
analysisnames=items&&items.analysis; analysisnames=items&&items.analysis;
} }
console.log(items.name); // console.log(items.name);
console.log(itemsnamesy); // console.log(itemsnamesy);
//
console.log(analysisnames); // console.log(analysisnames);
const options = [
'bold', // 加粗
]
return ( return (
<div key={keindex} <div key={keindex}
className={chakanjiexiboolindex === keindex ? "w100s borderwds283 pd20 mb20 listjihecolors" : "w100s borderwds pd20 mb20 listjihecolors"}> className={chakanjiexiboolindex === keindex ? "w100s borderwds283 pd20 mb20 listjihecolors" : "w100s borderwds pd20 mb20 listjihecolors"}>
@ -165,18 +168,29 @@ class Listjihe extends Component {
padding-left: 0px !important; padding-left: 0px !important;
padding-top: 0px !important; padding-top: 0px !important;
} }
.markdown-body .ql-editor p span{
font-weight: bold;
}
.markdown-body .ql-editor p {
font-weight: bold;
}
.programquill .ql-editor{ .programquill .ql-editor{
padding-left: 0px !important; padding-left: 0px !important;
padding-top: 0px !important; padding-top: 0px !important;
} }
.ql-editor{
display: inline-block;
text-align: justify;
}
` `
} }
</style> </style>
<div className="w100s sortinxdirection"> <div className="w100s sortinxdirection">
<div className="listjihetixingstitsy"> <div className="listjihetixingstitsy" style={{
fontWeight:"bold"
}} >
{ {
this.props.listjihe this.props.listjihe
}. }.
@ -184,10 +198,11 @@ class Listjihe extends Component {
{ {
items.item_type==="PROGRAM"? items.item_type==="PROGRAM"?
<a href={`/problems/${items.program_attr.identifier}/edit`}> <a href={`/problems/${items.program_attr.identifier}/edit`}>
<div className="ml10 w100s " style={{wordBreak: "break-word"}} dangerouslySetInnerHTML={{__html: markdownToHTML(items&&items.name).replace(/▁/g, "▁▁▁")}}></div> <div className="ml10 w100s " style={{wordBreak: "break-word",fontWeight:"bold"}} dangerouslySetInnerHTML={{__html: markdownToHTML(items&&items.name).replace(/▁/g, "▁▁▁")}}></div>
</a> </a>
: :
<div className="ml10 w100s markdown-body" style={{wordBreak: "break-word"}}> <div className="ml10 w100s markdown-body" style={{wordBreak: "break-word",fontWeight:"bold"}}>
{ items===undefined||items===null||items===""?"": { items===undefined||items===null||items===""?"":
items.name === undefined || items.name === null || items.name === "" ? items.name === undefined || items.name === null || items.name === "" ?
"" ""
@ -319,8 +334,8 @@ class Listjihe extends Component {
{ {
items.choosed === true ? items.choosed === true ?
<p className="selectionss xiaoshou" onClick={() => this.Selectingpracticaltrainings(items.id)}> <p className="selectionss xiaoshou" onClick={() => this.Selectingpracticaltrainings(items.id)}>
<i className="iconfont icon-jianhao font-12 lg ml7 lh30 icontianjiadaohangcolor mr5"></i> {/*<i className="iconfont icon-jianhao font-12 lg ml7 lh30 icontianjiadaohangcolor mr5"></i>*/}
<span className="mr15 lh30">撤销</span></p> <span className=" lh30">撤销</span></p>
: :
items.item_type === "PROGRAM" ? items.item_type === "PROGRAM" ?
items.program_attr.status === 0 ? items.program_attr.status === 0 ?
@ -354,7 +369,7 @@ class Listjihe extends Component {
this.props.Isitapopup&&this.props.Isitapopup==="true"? this.props.Isitapopup&&this.props.Isitapopup==="true"?
"" ""
: :
<a target="_blank" href={`/problems/${items.program_attr.identifier}/edit`}> <a target="_blank" href={`/problems/${items.program_attr.identifier}/edit?editoj=1&pages=`+this.props.pages}>
<p className="viewparsings xiaoshou mr25"> <p className="viewparsings xiaoshou mr25">
<i className="iconfont icon-bianji2 font-17 lg ml7 lh30 icontianjiadaohangcolors mr5"></i> <i className="iconfont icon-bianji2 font-17 lg ml7 lh30 icontianjiadaohangcolors mr5"></i>
<span>编辑</span> <span>编辑</span>
@ -364,7 +379,7 @@ class Listjihe extends Component {
this.props.Isitapopup&&this.props.Isitapopup==="true"? this.props.Isitapopup&&this.props.Isitapopup==="true"?
"" ""
: :
<a href={`/question/edit/${items.id}`}> <a target="_blank" href={`/question/edit/${items.id}`}>
<p className="viewparsings xiaoshou mr25"> <p className="viewparsings xiaoshou mr25">
<i className="iconfont icon-bianji2 font-17 lg ml7 lh30 icontianjiadaohangcolors mr5"></i> <i className="iconfont icon-bianji2 font-17 lg ml7 lh30 icontianjiadaohangcolors mr5"></i>
<span>编辑</span> <span>编辑</span>
@ -400,7 +415,15 @@ class Listjihe extends Component {
<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>
)
: :
"" ""
} }
@ -451,13 +474,18 @@ class Listjihe extends Component {
</div> </div>
<div className=" sortinxdirection mt15 yldxtit"> <div className=" sortinxdirection mt15 yldxtit">
<p id={"analysisnamesid"} className=" testfondex yldxtit programquill" <p className=" testfondex yldxtit "
style={{wordBreak: "break-word"}}
>
解析
</p>
<p id={"analysisnamesid"} className="wt930px testfondex yldxtit programquill"
style={{wordBreak: "break-word"}} style={{wordBreak: "break-word"}}
> >
{items ? {items ?
items.analysis=== undefined || items.analysis=== null || items.analysis === "" ? items.analysis=== undefined || items.analysis=== null || items.analysis === "" ?
"" "暂无解析"
: :
items.analysis.length>0? items.analysis.length>0?
analysisnames===null || analysisnames===undefined?"": analysisnames===null || analysisnames===undefined?"":
@ -467,7 +495,7 @@ class Listjihe extends Component {
value={analysisnames} value={analysisnames}
/> />
: :
"" "暂无解析"
: :
"" ""
} }

@ -9,7 +9,10 @@ class PaperDeletModel extends Component {
constructor(props) { constructor(props) {
super(props); super(props);
this.state={ this.state={
newkntypeinput:"" newkntypeinput:"",
errores:false,
errorestit:'',
addonAfteronelens3:0,
} }
} }
isNull=( str )=>{ isNull=( str )=>{
@ -28,12 +31,13 @@ class PaperDeletModel extends Component {
// }) // })
// //console.log(e.target.value); // //console.log(e.target.value);
// //console.log(e.target.value.length); // //console.log(e.target.value.length);
if(this.isNull(e.target.value)===true){
this.props.showNotification('不能输入空格');
return
}
this.setState({ this.setState({
newkntypeinput: e.target.value newkntypeinput: e.target.value,
addonAfteronelens3:e.target.value.length,
errorestit:'',
errores:false,
boolred:false,
}) })
this.props.setboolred(false); this.props.setboolred(false);
// //
@ -48,7 +52,8 @@ class PaperDeletModel extends Component {
// }) // })
// } // }
// } // }
} };
mysinputOnBlur=(e)=>{ mysinputOnBlur=(e)=>{
//console.log("失去焦点了"); //console.log("失去焦点了");
} }
@ -57,8 +62,28 @@ class PaperDeletModel extends Component {
//console.log("获取焦点"); //console.log("获取焦点");
} }
NewknTypedeltyoedels=()=>{
debugger
if(this.state.newkntypeinput.length===0){
this.setState({
errorestit:'请输入知识点',
errores:true,
boolred:true,
})
return
}
if(this.isNull(this.state.newkntypeinput)===true){
this.setState({
errorestit:'不能输入空格',
errores:true,
boolred:true,
})
return
}
this.props.NewknTypedeltyoedel(this.state.newkntypeinput)
}
render() { render() {
let{errores,errorestit,addonAfteronelens3}=this.state;
return( return(
<Modal <Modal
keyboard={false} keyboard={false}
@ -71,12 +96,32 @@ class PaperDeletModel extends Component {
width="442px" width="442px"
> >
<div className="educouddiv"> <div className="educouddiv">
<div className={this.props.boolred===true?"tabeltext-alignleft mt10 inpustred":"tabeltext-alignleft mt10"}> <style>
<Input onInput={this.handleChange} maxLength={15} onBlur={this.mysinputOnBlur } onFocus={this.inputOnFocus }/> {
`
.eduinpus .ant-input{
width: 310px !important;
border-right: 0px solid #FFFFff !important;
}
body{
width: 100%!important;
}
`
}
</style>
<div className={this.props.boolred===true?"tabeltext-alignleft mt10 inpustred inpustredysl eduinpus":errores===true?"tabeltext-alignleft mt10 inpustred inpustredysl eduinpus":"tabeltext-alignleft mt10 eduinpus"}>
<Input className={"eduinpus"} onInput={this.handleChange} maxLength={15} onBlur={this.mysinputOnBlur } addonAfter={String(addonAfteronelens3)+"/15"} onFocus={this.inputOnFocus }/>
</div> </div>
<div className="clearfix mt30 edu-txt-center"> {
errores===true?
<p className={"xingcolor"}>{errorestit}</p>
:""
}
<div className={errores===true?"clearfix mt10 edu-txt-center":"clearfix mt30 edu-txt-center"}>
<a className="task-btn mr30 w80" onClick={()=>this.props.NewknTypedeldel(false)}>取消</a> <a className="task-btn mr30 w80" onClick={()=>this.props.NewknTypedeldel(false)}>取消</a>
<a className="task-btn task-btn-orange w80" onClick={()=>this.props.NewknTypedeltyoedel(this.state.newkntypeinput)}>确定</a> <a className="task-btn task-btn-orange w80" onClick={ ()=>this.NewknTypedeltyoedels()}>确定</a>
</div> </div>
</div> </div>
</Modal> </Modal>

@ -20,6 +20,25 @@ class Paperreview_itemModel extends Component {
}) })
} }
setDownloadysl=()=>{
var re = /^[0-9]+.?[0-9]*$/; //判断字符串是否为数字 //判断正整数 /^[1-9]+[0-9]*]*$/
var nubmer = this.state.value;
if (!re.test(nubmer)) {
this.props.showNotification(`必须为数值`);
return;
}
try {
if(nubmer<1){
this.props.showNotification(`不能小于0`);
return;
}
}catch (e) {
}
this.props.setDownloady(this.state.value)
}
render() { render() {
return( return(
@ -56,7 +75,7 @@ width: 124px !important;
</div> </div>
<div className="clearfix mt30 edu-txt-center"> <div className="clearfix mt30 edu-txt-center">
<a className="task-btn mr30 w80" onClick={()=>this.props.Singlemagazine("",false)}>取消</a> <a className="task-btn mr30 w80" onClick={()=>this.props.Singlemagazine("",false)}>取消</a>
<a className="task-btn task-btn-orange w80" onClick={()=>this.props.setDownloady(this.state.value)}>确定</a> <a className="task-btn task-btn-orange w80" onClick={()=>this.setDownloadysl()}>确定</a>
</div> </div>
</div> </div>
</Modal> </Modal>

@ -21,6 +21,28 @@ class Paperreview_itemModels extends Component {
}) })
} }
setDownloadysl=()=>{
var re = /^[0-9]+.?[0-9]*$/; //判断字符串是否为数字 //判断正整数 /^[1-9]+[0-9]*]*$/
var nubmer = this.state.value;
if (!re.test(nubmer)) {
this.props.showNotification(`必须为数值`);
return;
}
try {
if(nubmer<1){
this.props.showNotification(`不能小于0`);
return;
}
}catch (e) {
}
console.log("必须为数值s");
this.props.setDownloadys(this.state.value);
}
render() { render() {
return( return(
@ -57,7 +79,7 @@ width: 124px !important;
</div> </div>
<div className="clearfix mt30 edu-txt-center"> <div className="clearfix mt30 edu-txt-center">
<a className="task-btn mr30 w80" onClick={()=>this.props.Singlemagazines(false,null)}>取消</a> <a className="task-btn mr30 w80" onClick={()=>this.props.Singlemagazines(false,null)}>取消</a>
<a className="task-btn task-btn-orange w80" onClick={()=>this.props.setDownloadys(this.state.value)}>确定</a> <a className="task-btn task-btn-orange w80" onClick={()=>this.setDownloadysl()}>确定</a>
</div> </div>
</div> </div>
</Modal> </Modal>

@ -21,7 +21,6 @@ const tagArray = [
'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',
'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z' 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'
] ]
//题库的试卷 单选题 组件 //题库的试卷 单选题 组件
class SingleEditor extends Component{ class SingleEditor extends Component{
constructor(props){ constructor(props){
@ -253,17 +252,14 @@ 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 {
} else { texts= JSON.stringify(value)
if(_text.length>=301){ }catch (e) {
var result = _text.substring(0,300); texts="";
texts={"ops":[{"insert":result}]};
texts=JSON.stringify(texts);
}else {
// 提交到后台的内容需要处理一下;
value = JSON.stringify(value)
texts=value;
} }
} else {
value = JSON.stringify(value);
texts=value;
} }
let question_choices = this.state.question_choices.slice(0); let question_choices = this.state.question_choices.slice(0);
question_choices[index] = texts; question_choices[index] = texts;
@ -291,30 +287,21 @@ 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 {
// 提交到后台的内容需要处理一下; let texts = JSON.stringify(value);
var texts="";
if(_text.length>=1001){
var result = _text.substring(0,1000);
texts={"ops":[{"insert":result}]};
texts=JSON.stringify(texts);
}else {
value = JSON.stringify(value)
texts=value;
}
this.setState({ this.setState({
question_titleysl:texts question_titleysl:texts
}) })
try {
//console.log("onContentChange");
//console.log(quill.getText().length);
}catch (e) {
}
} }
} }
onContentChanges=(value,quill)=>{ onContentChanges=(value,quill)=>{
@ -322,19 +309,18 @@ 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)
} else { })
var texts=""; }catch (e) {
if(_text.length>=1001){ this.setState({
var result = _text.substring(0,1000); question_titlesysl:""
texts={"ops":[{"insert":result}]}; })
texts=JSON.stringify(texts);
}else {
value = JSON.stringify(value)
texts=value;
} }
} else {
let texts = JSON.stringify(value);
this.setState({ this.setState({
question_titlesysl:texts question_titlesysl:texts
}) })
@ -368,6 +354,10 @@ class SingleEditor extends Component{
// //////console.log("xuanzheshijuan"); // //////console.log("xuanzheshijuan");
// //////console.log(answerTagArray); // //////console.log(answerTagArray);
// //////console.log(!exerciseIsPublish); // //////console.log(!exerciseIsPublish);
const options=['code-block', 'image', 'formula',{size: ['14px', '16px', '18px', '20px']},
{ 'color': ['#333333','#e60000','#ff9900','#ffff00','#ffffff']},
{ 'font': ['Microsoft-YaHei','SimSun', 'SimHei','KaiTi','FangSong','Arial','Times-New-Roman','sans-serif']}
]
return( return(
<div className="padding20-30 signleEditor danxuano" id={qNumber}> <div className="padding20-30 signleEditor danxuano" id={qNumber}>
@ -389,6 +379,12 @@ class SingleEditor extends Component{
#e_tips_mdEditor_question_undefined4{ #e_tips_mdEditor_question_undefined4{
display: none; display: none;
} }
.signleEditor .quill_editor_for_react_area .ql-toolbar .ql-formats .ql-size {
line-height: 20px;
}
.signleEditor .quill_editor_for_react_area .ql-toolbar .ql-formats .ql-font {
line-height: 20px;
}
`}</style> `}</style>
<p className="mb10 clearfix"> <p className="mb10 clearfix">
{/* {!question_id ? '新建' : '编辑'} */} {/* {!question_id ? '新建' : '编辑'} */}
@ -401,7 +397,7 @@ class SingleEditor extends Component{
imgAttrs={{width: '146px', height: '136px'}} imgAttrs={{width: '146px', height: '136px'}}
style={{ height: '155px'}} style={{ height: '155px'}}
placeholder="请您输入题干" placeholder="请您输入题干"
options={['code-block', 'image', 'formula']} options={options}
value={question_title} value={question_title}
onContentChange={this.onContentChange} onContentChange={this.onContentChange}
/> />
@ -433,7 +429,7 @@ class SingleEditor extends Component{
imgAttrs={{width: '146px', height: '136px'}} imgAttrs={{width: '146px', height: '136px'}}
style={{ height: '166px'}} style={{ height: '166px'}}
placeholder="请您输入题干" placeholder="请您输入题干"
options={['code-block', 'image', 'formula']} options={options}
value={item} value={item}
onContentChange={(value,quill) => this.onOptionContentChange(value,quill,index)} onContentChange={(value,quill) => this.onOptionContentChange(value,quill,index)}
/> />
@ -443,7 +439,7 @@ class SingleEditor extends Component{
imgAttrs={{width: '146px', height: '136px'}} imgAttrs={{width: '146px', height: '136px'}}
style={{ height: '166px'}} style={{ height: '166px'}}
placeholder="请您输入题干" placeholder="请您输入题干"
options={['code-block', 'image', 'formula']} options={options}
value={JSON.parse(item)} value={JSON.parse(item)}
onContentChange={(value,quill) => this.onOptionContentChange(value,quill,index)} onContentChange={(value,quill) => this.onOptionContentChange(value,quill,index)}
/> />
@ -484,7 +480,7 @@ class SingleEditor extends Component{
imgAttrs={{width: '146px', height: '136px'}} imgAttrs={{width: '146px', height: '136px'}}
style={{height: '166px' }} style={{height: '166px' }}
placeholder="请您输入题目解析" placeholder="请您输入题目解析"
options={['code-block', 'image', 'formula']} options={options}
value={question_titles} value={question_titles}
onContentChange={this.onContentChanges} onContentChange={this.onContentChanges}
/> />

@ -621,6 +621,9 @@ class Comthetestpaperst extends Component {
<style> <style>
{ {
` `
body{
width: 100%!important;
}
.ant-form-item{ .ant-form-item{
margin-bottom: 0px !important; margin-bottom: 0px !important;

@ -533,6 +533,9 @@ class Intelligentcomponents extends Component {
<style> <style>
{ {
` `
body{
width: 100%!important;
}
.ant-form-item{ .ant-form-item{
margin-bottom: 0px !important; margin-bottom: 0px !important;

@ -705,6 +705,9 @@
font-size: 14px; font-size: 14px;
} }
.testfondexsysl{
width:5% !important;
}
.yldxtits{ .yldxtits{
color: #888888; color: #888888;
font-size: 14px; font-size: 14px;
@ -712,7 +715,9 @@
.mt25{ .mt25{
margin-top: 25px; margin-top: 25px;
} }
.wt930px{
width: 930px !important;
}
.postitonrelati{ .postitonrelati{
position: relative; position: relative;
} }
@ -991,8 +996,28 @@
} }
.inpustred .ant-input{ .inpustred .ant-input{
border: 1px solid #f30707; border: 1px solid #f30707 !important;
border-radius: 5px; border-right: 0px solid #FFFFff !important;
}
.inpustredysl .ant-input:hover{
border: 1px solid #f30707 !important;
border-right: 0px solid #FFFFff !important;
}
.inpustredysl .ant-input:active{
border: 1px solid #f30707 !important;
border-right: 0px solid #FFFFff !important;
}
.inpustredysl .ant-input-group-addon{
border: 1px solid #f30707 !important;
border-left: 0px solid #FFFFff !important;
}
.inpustredysl .ant-input-group-addon:hover{
border: 1px solid #f30707 !important;
border-left: 0px solid #FFFFff !important;
}
.inpustredysl .ant-input-group-addon:active{
border: 1px solid #f30707 !important;
border-left: 0px solid #FFFFff !important;
} }
.mt15{ .mt15{
@ -1072,3 +1097,18 @@
.lh34{ .lh34{
line-height: 34px !important; line-height: 34px !important;
} }
.titesstwos{
position: relative;
}
.titesstwostest{
position: absolute;
}
.text-indents40{
text-indent:40px
}
.text-indents44{
text-indent:44px
}
.text-indents50{
text-indent: 50px
}

@ -1,6 +1,6 @@
import React, {Component} from "react"; import React, {Component} from "react";
import {Link, NavLink} from 'react-router-dom'; import {Link, NavLink} from 'react-router-dom';
import {WordsBtn, ActionBtn, SnackbarHOC, getImageUrl} from 'educoder'; import {WordsBtn, ActionBtn, SnackbarHOC, getImageUrl,queryString} from 'educoder';
import axios from 'axios'; import axios from 'axios';
import { import {
notification, notification,
@ -37,6 +37,7 @@ class Paperlibraryeditid extends Component {
disciplmy: [], disciplmy: [],
item_banksedit: [], item_banksedit: [],
newmyshixunmodelbool:false, newmyshixunmodelbool:false,
defaultActiveKey:"0",
} }
@ -110,6 +111,26 @@ class Paperlibraryeditid extends Component {
} }
}); });
const query = this.props.location.search;
const parsed = queryString.parse(query);
if(JSON.stringify(parsed)==="{}"){
this.setState({
defaultActiveKey:"0",
})
}else {
if(parsed.defaultActiveKey==="0"){
this.setState({
defaultActiveKey:"0",
})
}else{
this.setState({
defaultActiveKey:"1",
})
}
}
} }
@ -206,10 +227,10 @@ class Paperlibraryeditid extends Component {
} }
render() { render() {
let {paperlibrartdata,newmyshixunmodelbool} = this.state; let {paperlibrartdata,newmyshixunmodelbool,defaultActiveKey} = this.state;
const params = this.props && this.props.match && this.props.match.params; const params = this.props && this.props.match && this.props.match.params;
// //console.log("newmyshixunmodelbool"); let urlsysl=`/paperlibrary?defaultActiveKey=${defaultActiveKey}`;
// //console.log(newmyshixunmodelbool);
return ( return (
<div> <div>
<div id={"Itembankstopid"} className="newMain clearfix intermediatecenter " <div id={"Itembankstopid"} className="newMain clearfix intermediatecenter "
@ -246,8 +267,8 @@ class Paperlibraryeditid extends Component {
<div className="w1200ms"> <div className="w1200ms">
<div className="w100s mt30"> <div className="w100s mt30">
<Breadcrumb separator=">"> <Breadcrumb separator=">">
<Breadcrumb.Item href="/paperlibrary">试卷库</Breadcrumb.Item> <Breadcrumb.Item className={"shubiao"} >试卷库</Breadcrumb.Item>
<Breadcrumb.Item className={"shubiao"}>公告试卷库</Breadcrumb.Item> <Breadcrumb.Item href={urlsysl}>{defaultActiveKey==="1"?"公开试卷库":"我的试卷库"}</Breadcrumb.Item>
<Breadcrumb.Item className={"shubiao"}>试卷编辑</Breadcrumb.Item> <Breadcrumb.Item className={"shubiao"}>试卷编辑</Breadcrumb.Item>
</Breadcrumb> </Breadcrumb>
</div> </div>
@ -304,7 +325,7 @@ class Paperlibraryeditid extends Component {
newmyshixunmodelbool === true ? "" : newmyshixunmodelbool === true ? "" :
<Bottomsubmit {...this.props} {...this.state} bottomvalue={"保存"} <Bottomsubmit {...this.props} {...this.state} bottomvalue={"保存"}
setCohetepaperbool={(bool) => this.setCohetepaperbool(bool)} setCohetepaperbool={(bool) => this.setCohetepaperbool(bool)}
onSubmits={() => this.preservation()} url={'/paperlibrary'}></Bottomsubmit> onSubmits={() => this.preservation()} url={urlsysl}></Bottomsubmit>
} }
</div> </div>
) )

@ -1,6 +1,6 @@
import React, {Component} from "react"; import React, {Component} from "react";
import {Link, NavLink} from 'react-router-dom'; import {Link, NavLink} from 'react-router-dom';
import {WordsBtn, ActionBtn, SnackbarHOC, getImageUrl} from 'educoder'; import {WordsBtn, ActionBtn, SnackbarHOC, getImageUrl,queryString} from 'educoder';
import axios from 'axios'; import axios from 'axios';
import { import {
notification, notification,
@ -26,6 +26,7 @@ class Paperlibraryseeid extends Component {
this.contentMdRef = React.createRef(); this.contentMdRef = React.createRef();
this.state = { this.state = {
paperlibrartdata:[], paperlibrartdata:[],
defaultActiveKey:"0",
} }
@ -37,7 +38,24 @@ class Paperlibraryseeid extends Component {
componentDidMount() { componentDidMount() {
////console.log("Paperlibraryseeid"); ////console.log("Paperlibraryseeid");
this.getdata(); this.getdata();
const query = this.props.location.search;
const parsed = queryString.parse(query);
if(JSON.stringify(parsed)==="{}"){
this.setState({
defaultActiveKey:"0",
})
}else {
if(parsed.defaultActiveKey==="0"){
this.setState({
defaultActiveKey:"0",
})
}else{
this.setState({
defaultActiveKey:"1",
})
}
}
} }
@ -92,9 +110,10 @@ class Paperlibraryseeid extends Component {
this.contentMdRef = Ref; this.contentMdRef = Ref;
} }
render() { render() {
let {paperlibrartdata} = this.state; let {paperlibrartdata,defaultActiveKey} = this.state;
const params = this.props && this.props.match && this.props.match.params; const params = this.props && this.props.match && this.props.match.params;
// ////console.log(params); // ////console.log(params);
let urlsysl=`/paperlibrary?defaultActiveKey=${defaultActiveKey}`;
return ( return (
<div> <div>
<div id={"Itembankstopid"} className="newMain clearfix intermediatecenter " <div id={"Itembankstopid"} className="newMain clearfix intermediatecenter "
@ -113,8 +132,8 @@ class Paperlibraryseeid extends Component {
<div className="w1200ms"> <div className="w1200ms">
<div className="w100s mt30"> <div className="w100s mt30">
<Breadcrumb separator=">"> <Breadcrumb separator=">">
<Breadcrumb.Item href="/paperlibrary">试卷库</Breadcrumb.Item> <Breadcrumb.Item className={"shubiao"} >试卷库</Breadcrumb.Item>
<Breadcrumb.Item className={"shubiao"}>公告试卷库</Breadcrumb.Item> <Breadcrumb.Item href={urlsysl}>{defaultActiveKey==="1"?"公开试卷库":"我的试卷库"}</Breadcrumb.Item>
<Breadcrumb.Item className={"shubiao"}>试卷查看</Breadcrumb.Item> <Breadcrumb.Item className={"shubiao"}>试卷查看</Breadcrumb.Item>
</Breadcrumb> </Breadcrumb>
</div> </div>
@ -171,7 +190,7 @@ class Paperlibraryseeid extends Component {
<Bottomsubmit {...this.props} {...this.state} bottomvalue={"发起考试"} <Bottomsubmit {...this.props} {...this.state} bottomvalue={"发起考试"}
setCohetepaperbool={(bool)=>this.setCohetepaperbool(bool)} setCohetepaperbool={(bool)=>this.setCohetepaperbool(bool)}
onSubmits={() => this.preservation()} url={'/paperlibrary'}></Bottomsubmit> onSubmits={() => this.preservation()} url={urlsysl}></Bottomsubmit>
</div> </div>
) )

@ -18,6 +18,7 @@ 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);
@ -40,6 +41,8 @@ class Testpaperlibrary extends Component {
modalsTypes:false, modalsTypes:false,
modalsType:false, modalsType:false,
timuid:0, timuid:0,
modalsTypeInaudit:false,
defaultActiveKeybool:false,
} }
} }
getContainer = () => { getContainer = () => {
@ -75,6 +78,9 @@ class Testpaperlibrary extends Component {
}) })
} }
}); });
} }
paginationonChange=(pages)=>{ paginationonChange=(pages)=>{
@ -117,12 +123,21 @@ class Testpaperlibrary extends Component {
} }
this.getdata(data); this.getdata(data);
} }
callback = (key) => { callback = (key,bool) => {
try {
var currenturl = window.location.href;
var newUrl = (currenturl.split("?"))[0];
window.history.pushState('','',newUrl+'?defaultActiveKey='+key);
}catch (e) {
}
this.setState({ this.setState({
defaultActiveKey: key, defaultActiveKey: key,
difficulty:null, difficulty:null,
keyword:null, keyword:null,
page:1, page:1,
defaultActiveKeybool:bool,
}) })
var data={ var data={
page:1, page:1,
@ -138,11 +153,16 @@ 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 {
this.setState({
booljupyterurls:true,
})
}
axios.get((url), {params: data}).then((response) => { axios.get((url), {params: data}).then((response) => {
setTimeout(()=>{ setTimeout(()=>{
this.setState({ this.setState({
@ -288,7 +308,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);
@ -314,7 +334,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) {
@ -325,19 +345,31 @@ 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
}) })
}; };
Testpapereditor=(id)=>{ Testpapereditor=(id)=>{
this.props.history.push(`/paperlibrary/edit/${id}`); this.props.history.push(`/paperlibrary/edit/${id}?defaultActiveKey=${this.state.defaultActiveKey}`);
} }
showmodelsInaudit = (e) => {
this.setState({
modalsTypeInaudit: true,
titilesm: "公开申请已提交,请等待管理员的审核",
titiless: "我们将在1-2个工作日内完成审核",
})
};
modalsTypeInauditbool=()=>{
this.setState({
modalsTypeInaudit:false,
})
}
showmodelysl = (id) => { showmodelysl = (id) => {
this.setState({ this.setState({
@ -403,7 +435,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;
@ -424,6 +456,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}
@ -449,9 +487,11 @@ class Testpaperlibrary extends Component {
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,bool)=>this.callback(key,bool)}
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>

@ -1,6 +1,6 @@
import React, {Component} from "react"; import React, {Component} from "react";
import {Link, NavLink} from 'react-router-dom'; import {Link, NavLink} from 'react-router-dom';
import {WordsBtn, ActionBtn,SnackbarHOC,getImageUrl} from 'educoder'; import {WordsBtn, ActionBtn,SnackbarHOC,getImageUrl,queryString} from 'educoder';
import axios from 'axios'; import axios from 'axios';
import { import {
notification, notification,
@ -24,12 +24,32 @@ class Contentpart extends Component {
super(props); super(props);
this.state = { this.state = {
page:1, page:1,
defaultActiveKeyss:"0",
} }
} }
//初始化 //初始化
componentDidMount(){ componentDidMount(){
const query = this.props.location.search;
const parsed = queryString.parse(query);
console.log("Contentpart");
console.log(parsed);
if(JSON.stringify(parsed)==="{}"){
this.setState({
defaultActiveKeyss:"0",
})
}else {
if(parsed.defaultActiveKey==="0"){
this.setState({
defaultActiveKeyss:"0",
})
}else{
this.setState({
defaultActiveKeyss:"1",
})
}
}
} }
//跳转人工组卷 //跳转人工组卷
@ -44,20 +64,33 @@ class Contentpart extends Component {
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;
const professional_certification=this.props&&this.props.current_user&&this.props.current_user.professional_certification?this.props.current_user.professional_certification:false; const professional_certification=this.props&&this.props.current_user&&this.props.current_user.professional_certification?this.props.current_user.professional_certification:false;
let {defaultActiveKey} = this.props; let {defaultActiveKey} = this.props;
var defaultActiveKeys=defaultActiveKey; let defaultActiveKeys=defaultActiveKey;
if(isysladmins===true||(is_teacher===true&&professional_certification===true)){ if(isysladmins===true||(is_teacher===true&&professional_certification===true)){
defaultActiveKeys="0" defaultActiveKeys="0"
}else{ }else{
defaultActiveKeys="1" defaultActiveKeys="1"
} }
this.props.callback(defaultActiveKeys); try {
if(this.props.defaultActiveKeybool===false){
if (this.state.defaultActiveKeyss==="0"){
defaultActiveKeys="0"
} else {
defaultActiveKeys="1"
}
}
}catch (e) {
}
this.props.callback(defaultActiveKeys,false);
} }
} }
render() { render() {
let {page}=this.state; let {page,defaultActiveKeyss}=this.state;
let {defaultActiveKey}=this.props; let {defaultActiveKey,defaultActiveKeybool}=this.props;
let defaultActiveKeys=defaultActiveKey+'';
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;
@ -79,6 +112,15 @@ class Contentpart extends Component {
</div> </div>
); );
if(defaultActiveKeybool===false){
if(defaultActiveKeyss==="0"){
defaultActiveKeys="0";
}else {
defaultActiveKeys="1";
}
}
return ( return (
<div className=" clearfix mt25"> <div className=" clearfix mt25">
@ -108,14 +150,14 @@ class Contentpart extends Component {
{ {
isysladmins===true||(is_teacher===true&&professional_certification===true)? isysladmins===true||(is_teacher===true&&professional_certification===true)?
<Tabs activeKey={defaultActiveKey} onChange={(e)=>this.props.callback(e)}> <Tabs activeKey={defaultActiveKeys} onChange={(e)=>this.props.callback(e,true)}>
<TabPane tab="公共" key="1"> <TabPane tab="公共" key="1">
</TabPane> </TabPane>
<TabPane tab="我的" key="0"> <TabPane tab="我的" key="0">
</TabPane> </TabPane>
</Tabs> </Tabs>
: :
<Tabs activeKey={1} onChange={(e)=>this.props.callback(e)}> <Tabs activeKey={"1"} onChange={(e)=>this.props.callback(e,true)}>
<TabPane tab="公共" key="1"> <TabPane tab="公共" key="1">
</TabPane> </TabPane>
</Tabs> </Tabs>
@ -222,6 +264,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>

@ -58,7 +58,7 @@ class Listjihe extends Component {
gotoseesj=(id)=>{ gotoseesj=(id)=>{
this.props.history.push(`/paperlibrary/see/${id}`); this.props.history.push(`/paperlibrary/see/${id}?defaultActiveKey=${this.props.defaultActiveKey}`);
} }
@ -73,6 +73,8 @@ class Listjihe extends Component {
const update_times=items&&items.update_time&&items.update_time; const update_times=items&&items.update_time&&items.update_time;
const quotess =items&&items.quotes&&items.quotes; const quotess =items&&items.quotes&&items.quotes;
const authors=items&&items.author&&items.author.name; const authors=items&&items.author&&items.author.name;
return ( return (
<div className={" borderwdsst pd20 mb20 intermediatecenter listjihecolor "} > <div className={" borderwdsst pd20 mb20 intermediatecenter listjihecolor "} >
<div className="sortinxdirection w100s"> <div className="sortinxdirection w100s">
@ -133,12 +135,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>
:""} :""}

@ -87,6 +87,9 @@ class Paperlibraryseeid_items extends Component {
}catch (e) { }catch (e) {
itemsnamesy=objectsingle&&objectsingle.program_attr&&objectsingle.program_attr.description; itemsnamesy=objectsingle&&objectsingle.program_attr&&objectsingle.program_attr.description;
} }
const options = [
'bold', // 加粗
]
return ( return (
<div key={indexxy} <div key={indexxy}
className={ "w100s borderwdswuh mb20 pd20 "} className={ "w100s borderwdswuh mb20 pd20 "}
@ -118,7 +121,7 @@ class Paperlibraryseeid_items extends Component {
{/*顶部*/} {/*顶部*/}
<div className="w100s sortinxdirection "> <div className="w100s sortinxdirection ">
<div className=" sortinxdirection "> <div className=" sortinxdirection ">
<p className="cretitlecolrlis lh28">{indexx}</p> <p className="cretitlecolrlis lh28" style={{fontWeight:"bold"}}>{indexx}</p>
</div> </div>
<style> <style>
{ {
@ -133,8 +136,16 @@ class Paperlibraryseeid_items extends Component {
color: #333333; color: #333333;
font-size: 14px !important; font-size: 14px !important;
line-height: 28px; line-height: 28px;
font-weight: bold;
} }
.bodyysls .ql-editor p span{
font-weight: bold;
}
.markdown-body .ql-editor p {
font-weight: bold;
}
` `
} }
</style> </style>
@ -142,12 +153,12 @@ class Paperlibraryseeid_items extends Component {
objectsingle.item_type==="PROGRAM"? objectsingle.item_type==="PROGRAM"?
<div className="w100s sortinxdirection"> <div className="w100s sortinxdirection">
<div className=" tites lh28 listjihetixingstit markdown-body cretitlecolrlist " style={{wordBreak: "break-word", <div className=" tites lh28 listjihetixingstit markdown-body cretitlecolrlist " style={{wordBreak: "break-word",
minWidth:"32px" minWidth:"32px",fontWeight:"bold"
}} }}
> >
({objectsingle.score}) ({objectsingle.score})
</div> </div>
<div className="ml10 lh28 listjihetixingstit markdown-body cretitlecolrlist " style={{wordBreak: "break-word"}} <div className="ml10 lh28 listjihetixingstit markdown-body cretitlecolrlist " style={{wordBreak: "break-word",fontWeight:"bold"}}
dangerouslySetInnerHTML={{__html: markdownToHTML(objectsingle.name).replace(/▁/g, "▁▁▁")}}> dangerouslySetInnerHTML={{__html: markdownToHTML(objectsingle.name).replace(/▁/g, "▁▁▁")}}>
</div> </div>
@ -155,11 +166,11 @@ class Paperlibraryseeid_items extends Component {
: :
<div className="w100s sortinxdirection"> <div className="w100s sortinxdirection">
<div className="tites lh28 listjihetixingstit markdown-body cretitlecolrlist " style={{wordBreak: "break-word", <div className="tites lh28 listjihetixingstit markdown-body cretitlecolrlist " style={{wordBreak: "break-word",
minWidth:"32px"}} minWidth:"32px",fontWeight:"bold"}}
> >
({objectsingle.score}) ({objectsingle.score})
</div> </div>
<div className="ml10 lh28 listjihetixingstit cretitlecolrlist programquill" style={{wordBreak: "break-word"}} <div className="ml10 lh28 listjihetixingstit bodyysls cretitlecolrlist programquill" style={{wordBreak: "break-word",fontWeight:"bold"}}
> >
{ {
itemssname===null || itemssname===undefined? itemssname===null || itemssname===undefined?

@ -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;

@ -37,6 +37,7 @@ const types = {
GET_COURSE_QUESTION: 'GET_COURSE_QUESTION', // 获取编辑题 GET_COURSE_QUESTION: 'GET_COURSE_QUESTION', // 获取编辑题
CHANGE_KNOWLEDGES: 'CHANGE_KNOWLEDGES', // 保存所选择的知识点 CHANGE_KNOWLEDGES: 'CHANGE_KNOWLEDGES', // 保存所选择的知识点
SET_OJ_INITIAL_VALUE: 'SET_OJ_INITIAL_VALUE', // 设置初始值 SET_OJ_INITIAL_VALUE: 'SET_OJ_INITIAL_VALUE', // 设置初始值
SET_SEARCH_PARAMS: 'SET_SEARCH_PARAMS', // 只在地址栏参数
// study // study
SAVE_USER_PROGRAM_ID: 'SAVE_USER_PROGRAM_ID',// 保存用户编程题id值 SAVE_USER_PROGRAM_ID: 'SAVE_USER_PROGRAM_ID',// 保存用户编程题id值
USER_PROGRAM_DETAIL: 'USER_PROGRAM_DETAIL', // 用户编程题详情 USER_PROGRAM_DETAIL: 'USER_PROGRAM_DETAIL', // 用户编程题详情

@ -38,7 +38,8 @@ import {
getQuestion, getQuestion,
saveKnowledge, saveKnowledge,
setOjInitialValue, setOjInitialValue,
tagDisciplines tagDisciplines,
saveSearchParams
} from './ojForm'; } from './ojForm';
import { import {
@ -145,6 +146,7 @@ export default {
saveKnowledge, saveKnowledge,
setOjInitialValue, setOjInitialValue,
tagDisciplines, tagDisciplines,
saveSearchParams,
// //
addTestCase, addTestCase,
deleteTestCase, deleteTestCase,

@ -4,7 +4,7 @@
* @Github: * @Github:
* @Date: 2019-11-27 13:42:11 * @Date: 2019-11-27 13:42:11
* @LastEditors : tangjiang * @LastEditors : tangjiang
* @LastEditTime : 2020-01-09 14:14:47 * @LastEditTime : 2020-02-10 18:17:00
*/ */
import types from "./actionTypes"; import types from "./actionTypes";
import { Base64 } from 'js-base64'; import { Base64 } from 'js-base64';
@ -24,7 +24,9 @@ import { notification } from "antd";
// 进入编程页面时,首先调用开启编程题接口 // 进入编程页面时,首先调用开启编程题接口
export const startProgramQuestion = (id, props) => { export const startProgramQuestion = (id, props) => {
return (dispatch) => { return (dispatch, getState) => {
const {searchParams} = getState().ojFormReducer;
console.log(searchParams);
fetchStartProgram(id).then(res => { fetchStartProgram(id).then(res => {
const { status, data } = res; const { status, data } = res;
if (status === 200) { if (status === 200) {
@ -48,7 +50,7 @@ export const startProgramQuestion = (id, props) => {
// console.log(path); // console.log(path);
// props.history.push(`/myproblems/${identifier}`); // props.history.push(`/myproblems/${identifier}`);
props.history.push({ props.history.push({
pathname: `/myproblems/${identifier}`, pathname: `/myproblems/${identifier}?${searchParams}`,
}); });
} }
} }

@ -4,7 +4,7 @@
* @Github: * @Github:
* @Date: 2019-11-20 16:35:46 * @Date: 2019-11-20 16:35:46
* @LastEditors : tangjiang * @LastEditors : tangjiang
* @LastEditTime : 2020-01-07 16:45:34 * @LastEditTime : 2020-02-11 16:29:32
*/ */
import types from './actionTypes'; import types from './actionTypes';
import CONST from '../../constants'; import CONST from '../../constants';
@ -206,7 +206,7 @@ export const validateOjForm = (props, type, cb) => {
if (hasSuccess) { if (hasSuccess) {
// console.log('表单保存的数据为: ', getState()); // console.log('表单保存的数据为: ', getState());
const {ojFormReducer} = getState(); const {ojFormReducer} = getState();
const {code, score, ojForm, testCases = [], tag_discipline_id = []} = ojFormReducer; const {code, score, ojForm, testCases = [], tag_discipline_id = [], curPage = 1} = ojFormReducer;
const {category, description, difficult, language, name, openOrNot, timeLimit, sub_discipline_id} = ojForm; const {category, description, difficult, language, name, openOrNot, timeLimit, sub_discipline_id} = ojForm;
let paramsObj = {}; let paramsObj = {};
const hack = { // 编程题干 const hack = { // 编程题干
@ -312,14 +312,19 @@ export const validateOjForm = (props, type, cb) => {
payload: identifier payload: identifier
}); });
console.log(identifier , props.identifier); // console.log(identifier , props.identifier);
if (identifier || props.identifier) { if (identifier || props.identifier) {
dispatch(getOJFormById(identifier || props.identifier)); dispatch(getOJFormById(identifier || props.identifier));
} }
// 保存成功后,调用编辑接口并改变路 // 保存成功后,调用编辑接口并改变路
if (paramsObj['submitType'] === 'add' && identifier) { if (paramsObj['submitType'] === 'add' && identifier) {
//更改查询参数
props.history.push(`/problems/${identifier}/edit`); dispatch({
type: types.SET_SEARCH_PARAMS,
searchParams: `editoj=1&pages=${curPage}`,
curPage: curPage
});
props.history.push(`/problems/${identifier}/edit?editoj=1&pages=${curPage}`);
}; };
} }
// 保存或更新后调用start接口 // 保存或更新后调用start接口
@ -691,7 +696,7 @@ export const getQuestion = (params) => {
disciplines.forEach(c => { disciplines.forEach(c => {
if (sub_discipline_id && c.sub_disciplines) { if (sub_discipline_id && c.sub_disciplines) {
c.sub_disciplines.forEach(sub => { c.sub_disciplines.forEach(sub => {
if (+sub.id === sub_discipline_id) { if (+sub.id === +sub_discipline_id) {
temp_knowledges = sub.tag_disciplines || []; temp_knowledges = sub.tag_disciplines || [];
} }
}); });
@ -763,3 +768,11 @@ export const tagDisciplines = (params) => {
}); });
} }
} }
// 保存地址栏参数
export const saveSearchParams = (params) => {
return {
type: types.SET_SEARCH_PARAMS,
payload: params
}
}

@ -4,7 +4,7 @@
* @Github: * @Github:
* @Date: 2019-11-20 16:40:32 * @Date: 2019-11-20 16:40:32
* @LastEditors : tangjiang * @LastEditors : tangjiang
* @LastEditTime : 2020-01-03 17:38:50 * @LastEditTime : 2020-02-10 17:59:55
*/ */
import { Base64 } from 'js-base64'; import { Base64 } from 'js-base64';
import types from '../actions/actionTypes'; import types from '../actions/actionTypes';
@ -75,6 +75,8 @@ const init = {
isPublish: 0, // 是否是发布状态: 0 未发布 1 已发布 isPublish: 0, // 是否是发布状态: 0 未发布 1 已发布
courseQuestions: [], // 课程题库 courseQuestions: [], // 课程题库
knowledges: [], // 知识点下拉值 knowledges: [], // 知识点下拉值
searchParams: '', // 地址栏参数
curPage: 1, // 当前页数
} }
const tcValidateObj = { const tcValidateObj = {
@ -350,11 +352,18 @@ const ojFormReducer = (state = initialState, action) => {
} }
case types.SET_OJ_INITIAL_VALUE: case types.SET_OJ_INITIAL_VALUE:
const _p = action.payload; const _p = action.payload;
console.log(_p.tag_discipline_id);
return { return {
...state, ...state,
ojForm: Object.assign({}, state.ojForm, {difficult: _p.difficult, sub_discipline_id: _p.sub_discipline_id}), ojForm: Object.assign({}, state.ojForm, {difficult: _p.difficult, sub_discipline_id: _p.sub_discipline_id}),
tag_discipline_id: _p.tag_discipline_id || [] tag_discipline_id: _p.tag_discipline_id || []
} }
case types.SET_SEARCH_PARAMS:
return {
...state,
searchParams: action.payload.searchParams,
curPage: action.payload.curPage
}
default: default:
return state; return state;
} }

Loading…
Cancel
Save