dev_aliyun_beta
杨树明 6 years ago
parent 0e08df1dd4
commit bf5dcbcc2a

@ -256,6 +256,31 @@ const Topicbank= Loadable({
loader: () => import('./modules/topic_bank/Topic_bank'),
loading: Loading,
})
//普通作业题库详情
const Generaljobbankdetails =Loadable({
loader: () => import('./modules/courses/questionbank/Generaljobbankdetails'),
loading: Loading,
});
//分组作业题库详情
const GroupjobbankPage =Loadable({
loader: () => import('./modules/courses/groupjobbank/GroupjobbankPage'),
loading: Loading,
});
//毕设选题详情
const CompletetopicdePage =Loadable({
loader: () => import('./modules/courses/comtopicdetails/CompletetopicdePage'),
loading: Loading,
});
//毕设任务详情
const Completetaskpage =Loadable({
loader: () => import('./modules/courses/completetaskdetails/Completetaskpage'),
loading: Loading,
});
//问卷编辑
const PollNewQuestbank =Loadable({
loader: () => import('./modules/courses/poll/PollNewQuestbank'),
loading: Loading,
});
class App extends Component {
constructor(props) {
super(props)
@ -347,6 +372,36 @@ class App extends Component {
<Certifiedprofessional {...this.props} {...this.state} ModalCancelsy={this.ModalCancelsy} ModalshowCancelsy={this.ModalshowCancelsy}/>
<Router>
<Switch>
{/*题库问卷编辑详情*/}
<Route path="/banks/gtpoll/:workid/edit"
render={
(props) => (<PollNewQuestbank {...this.props} {...props} {...this.state} />)
}
></Route>
{/*毕设任务题库详情*/}
<Route path="/banks/gtask/:workid"
render={
(props) => (<Completetaskpage {...this.props} {...props} {...this.state} />)
}
></Route>
{/*毕设内容题库详情*/}
<Route path="/banks/gtopic/:workid"
render={
(props) => (<CompletetopicdePage {...this.props} {...props} {...this.state} />)
}
></Route>
{/*分组作业题库详情*/}
<Route path="/banks/group/:workid"
render={
(props) => (<GroupjobbankPage {...this.props} {...props} {...this.state} />)
}
></Route>
{/* 普通作业题库详情*/}
<Route path="/banks/normal/:workid"
render={
(props) => (<Generaljobbankdetails {...this.props} {...props} {...this.state} />)
}
></Route>
{/*题库*/}
<Route path="/topicbank/:username/:topicstype"
render={

@ -263,31 +263,7 @@ const GraduationTasksSubmiteditApp=Loadable({
loader: () => import('./graduation/tasks/GraduationTasksSubmitedit'),
loading: Loading,
})
//普通作业题库详情
const Generaljobbankdetails =Loadable({
loader: () => import('../../modules/courses/questionbank/Generaljobbankdetails'),
loading: Loading,
});
//分组作业题库详情
const GroupjobbankPage =Loadable({
loader: () => import('../../modules/courses/groupjobbank/GroupjobbankPage'),
loading: Loading,
});
//毕设选题详情
const CompletetopicdePage =Loadable({
loader: () => import('../../modules/courses/comtopicdetails/CompletetopicdePage'),
loading: Loading,
});
//毕设任务详情
const Completetaskpage =Loadable({
loader: () => import('../../modules/courses/completetaskdetails/Completetaskpage'),
loading: Loading,
});
//问卷编辑
const PollNewQuestbank =Loadable({
loader: () => import('../../modules/courses/poll/PollNewQuestbank'),
loading: Loading,
});
class CoursesIndex extends Component{
constructor(props) {
super(props)
@ -466,36 +442,7 @@ class CoursesIndex extends Component{
// console.log(commons)
return (
<Switch {...this.props}>
{/*题库问卷编辑详情*/}
<Route path="/banks/gtopic/:workid/edit"
render={
(props) => (<PollNewQuestbank {...this.props} {...props} {...this.state} />)
}
></Route>
{/*毕设任务题库详情*/}
<Route path="/banks/gtask/:workid"
render={
(props) => (<Completetaskpage {...this.props} {...props} {...this.state} />)
}
></Route>
{/*毕设内容题库详情*/}
<Route path="/banks/gtopic/:workid"
render={
(props) => (<CompletetopicdePage {...this.props} {...props} {...this.state} />)
}
></Route>
{/*分组作业题库详情*/}
<Route path="/banks/group/:workid"
render={
(props) => (<GroupjobbankPage {...this.props} {...props} {...this.state} />)
}
></Route>
{/* 普通作业题库详情*/}
<Route path="/banks/normal/:workid"
render={
(props) => (<Generaljobbankdetails {...this.props} {...props} {...this.state} />)
}
></Route>
{/* 资源列表页 */}
<Route path="/courses/:coursesId/file/:Id" exact
render={

@ -10,6 +10,7 @@ import {
Tooltip,
notification,
} from "antd";
import AttachmentsList from '../../../common/components/attachment/AttachmentList'
import GroupPackage from './GroupPackage';
import GroupPackage2 from './GroupPackage2';
import './questionbanks.css';
@ -63,11 +64,9 @@ class Groupjobquesanswer extends Component {
<div id="MakedownHTML"className="markdown-body yslquesHeigth yslquesmarkdowntext" dangerouslySetInnerHTML={{__html: markdownToHTML(datas&&(datas.description===null?"无":datas.description==="null"?"无":datas.description)).replace(/▁/g, "▁▁▁")}}/>
{datas.attachments === undefined ? "" : datas.attachments.map((item, key) => {
return (
<GroupPackage key={key} attachments={item}></GroupPackage>
)
})}
{datas.attachments === undefined ? "" :
<AttachmentsList {...this.state} {...this.props} attachments={datas.attachments} ></AttachmentsList>}
<GroupPackage2 datas={datas} bool={true}></GroupPackage2>
</div>

@ -280,9 +280,13 @@ class PollNew extends Component {
questionnair: true,
left_banner_id:result.data.left_banner_id
})
// console.log(this.state.polls_nametest)
// console.log(this.state.polls_descriptiontest)
// }
if( result.data.poll.polls_name){
if( result.data.poll.polls_name.length>0){
this.setState({
addonAfter: result.data.poll.polls_name.length,
})
}
}
}).catch((error) => {
console.log(error)
})
@ -326,7 +330,13 @@ class PollNew extends Component {
polls_descriptiontest: result.data.poll.polls_description,
questionnair: true,
})
if( result.data.poll.polls_name){
if( result.data.poll.polls_name.length>0){
this.setState({
addonAfter: result.data.poll.polls_name.length,
})
}
}
// }
}).catch((error) => {
console.log(error)
@ -2454,8 +2464,9 @@ class PollNew extends Component {
// console.log(this.state.projects===undefined?"":this.state.projects.poll_questions)
var displaymysave = (mysave === true) ? "" : "display:none;";
return (
<div className="newMain">
<div >
{/*提示*/}
{Modalstype && Modalstype === true ? <Modals
modalsType={this.state.Modalstype}
@ -2465,7 +2476,14 @@ class PollNew extends Component {
modalsBottomval={this.state.ModalsBottomval}
loadtype={this.state.Loadtype}
/> : ""}
<div className="educontent mb50">
<style>
{
`
.newMains{ margin: 0 auto; padding-bottom: 235px !important; min-width:1200px; min-height: 800px !important;}
`
}
</style>
<div className="educontent newMains">
<p className="clearfix mb20 mt10">
<a className=" btn colorgrey fl hovercolorblue" onClick={()=>this.gotohome()}>{this.props.coursedata.name}</a>
<span className="color-grey-9 fl ml3 mr3">&gt;</span>

@ -243,39 +243,51 @@ class PollNewQuestbank extends Component {
} else {
const url = `/exercise_banks/${pollid}.json`;
axios.get(url).then((result) => {
if (result)
console.log("247");
console.log(result);
// if(result.data){
// if(result.data.poll){
// if(result.data.poll.polls_name){
// let num = parseInt(result.data.poll.polls_name.length);
// this.setState({
// addonAfter: num < 0 ? 0 : num
// })
// }
// }
//
// }
//
// this.setState({
// projects: result.data,
// pollid: pollid,
// polls_status: result.data.poll.polls_status,
// polls_name: result.data.poll.polls_name,
// polls_description: result.data.poll.polls_description,
// poll_questions: result.data.poll_questions,
// question_types: result.data.question_types,
// mysingles: result.data.question_types.q_singles,
// mydoubles: result.data.question_types.q_doubles,
// mymainsint: result.data.question_types.q_mains,
// polls_nametest: result.data.poll.polls_name,
// polls_descriptiontest: result.data.poll.polls_description,
// questionnair: true,
// left_banner_id:result.data.left_banner_id
// })
if (result){
console.log("247");
console.log(result);
}
if(result.data){
if(result.data.poll){
if(result.data.poll.polls_name){
let num = parseInt(result.data.poll.polls_name.length);
this.setState({
addonAfter: num < 0 ? 0 : num
})
}
}
}
this.setState({
projects: result.data,
pollid: pollid,
polls_status: 1,
polls_name: result.data.poll.name,
polls_description: result.data.poll.description,
poll_questions: result.data.questions,
question_types: result.data.question_types,
mysingles: result.data.question_types.q_singles,
mydoubles: result.data.question_types.q_doubles,
mymainsint: result.data.question_types.q_mains,
q_counts: result.data.question_types.q_counts,
polls_nametest: result.data.poll.name,
polls_descriptiontest: result.data.poll.description,
questionnair: true,
left_banner_id:result.data.left_banner_id
})
if(result.data.poll.name){
if(result.data.poll.name.length>0){
this.setState({
addonAfter:result.data.poll.name.length,
})
}
}
}).catch((error) => {
console.log(error)
})
@ -300,26 +312,40 @@ class PollNewQuestbank extends Component {
const url = `/exercise_banks/${pollidsy}.json`;
axios.get(url).then((result) => {
if (result !== undefined){
this.setState({
projects: result.data,
pollid: pollid,
polls_status: 1,
polls_name: result.data.poll.name,
polls_description: result.data.poll.description,
poll_questions: result.data.questions,
question_types: result.data.question_types,
mysingles: result.data.question_types.q_singles,
mydoubles: result.data.question_types.q_doubles,
mymainsint: result.data.question_types.q_mains,
q_counts: result.data.question_types.q_counts,
polls_nametest: result.data.poll.name,
polls_descriptiontest: result.data.poll.description,
questionnair: true,
left_banner_id:result.data.left_banner_id
});
if(result.data.poll.name){
if(result.data.poll.name.length>0){
this.setState({
addonAfter:result.data.poll.name.length,
})
}
}
}
// console.log("有问卷~~~")
// this.setState({
// projects: result.data,
// pollid: pollidsy,
// polls_status: result.data.poll.polls_status,
// polls_name: result.data.poll.polls_name,
// polls_description: result.data.poll.polls_description,
// poll_questions: result.data.poll_questions,
// question_types: result.data.question_types,
// mysingles: result.data.question_types.q_singles,
// mydoubles: result.data.question_types.q_doubles,
// mymainsint: result.data.question_types.q_mains,
// polls_nametest: result.data.poll.polls_name,
// polls_descriptiontest: result.data.poll.polls_description,
// questionnair: true,
// })
// }
}).catch((error) => {
@ -2326,41 +2352,41 @@ class PollNewQuestbank extends Component {
}
// 创建问卷
onSaveExercise = () => {
if (this.state.Newedit === true) {
if (this.state.polls_nametest === undefined || this.state.polls_nametest === "") {
this.props.showNotification(`请输入标题`);
return
}
let coursesId = this.props.match.params.coursesId;
const urlls = `/courses/${coursesId}/polls.json`
axios.post(urlls, {
polls_name: this.state.polls_nametest,
polls_description: this.state.polls_descriptiontest
}).then((result) => {
if (result === undefined) {
return;
}
this.state.Newedit === false;
this.props.showNotification(`问卷创建成功!`);
this.setState({
pollid: result.data.data.id,
Newedit: false,
mysave: false,
readOnlys: "readOnly",
cancellation: false,
});
// var currenturl = window.location.href;
// var newUrl = (currenturl.split("?"))[0];
// var newr=(newUrl.slice("new"))[0];
// console.log(newUrl);
// console.log("2301");
// console.log(newr);
// window.history.pushState('','',newUrl+'?tab='+e);
window.location.href = `/courses/${coursesId}/polls/${result.data.data.id}/edit`;
})
} else {
// if (this.state.Newedit === true) {
//
// if (this.state.polls_nametest === undefined || this.state.polls_nametest === "") {
// this.props.showNotification(`请输入标题`);
// return
// }
// let coursesId = this.props.match.params.coursesId;
// const urlls = `/courses/${coursesId}/polls.json`
// axios.post(urlls, {
// polls_name: this.state.polls_nametest,
// polls_description: this.state.polls_descriptiontest
// }).then((result) => {
// if (result === undefined) {
// return;
// }
// this.state.Newedit === false;
// this.props.showNotification(`问卷创建成功!`);
// this.setState({
// pollid: result.data.data.id,
// Newedit: false,
// mysave: false,
// readOnlys: "readOnly",
// cancellation: false,
// });
// // var currenturl = window.location.href;
// // var newUrl = (currenturl.split("?"))[0];
// // var newr=(newUrl.slice("new"))[0];
// // console.log(newUrl);
// // console.log("2301");
// // console.log(newr);
// // window.history.pushState('','',newUrl+'?tab='+e);
// // window.location.href = `/courses/${coursesId}/polls/${result.data.data.id}/edit`;
//
// })
// } else {
if (this.state.polls_nametest === undefined || this.state.polls_nametest === "") {
this.props.showNotification("请输入标题");
return
@ -2374,10 +2400,10 @@ class PollNewQuestbank extends Component {
}
var url = `/polls/${pollid}.json`;
var url = `/exercise_banks/${pollid}.json`;
axios.put(url, {
polls_name: this.state.polls_nametest,
polls_description: this.state.polls_descriptiontest
exercise_name: this.state.polls_nametest,
exercise_description: this.state.polls_descriptiontest
}).then((result) => {
if (result !== undefined) {
this.props.showNotification(`问卷更新成功!`);
@ -2388,7 +2414,7 @@ class PollNewQuestbank extends Component {
}
})
}
// }
}
gotohome=()=>{
@ -2449,7 +2475,7 @@ class PollNewQuestbank extends Component {
// console.log(this.state.projects===undefined?"":this.state.projects.poll_questions)
var displaymysave = (mysave === true) ? "" : "display:none;";
return (
<div className="newMain">
<div className=" clearfix">
{/*提示*/}
{Modalstype && Modalstype === true ? <Modals
modalsType={this.state.Modalstype}
@ -2459,7 +2485,14 @@ class PollNewQuestbank extends Component {
modalsBottomval={this.state.ModalsBottomval}
loadtype={this.state.Loadtype}
/> : ""}
<div className="educontent mb50">
<style>
{
`
.newMains{ margin: 0 auto; padding-bottom: 235px !important; min-width:1200px; min-height: 800px !important;}
`
}
</style>
<div className="educontent newMains">
<p className="clearfix mb20 mt10">
<a className=" btn colorgrey fl hovercolorblue" onClick={()=>this.gotohome()}>{this.props.coursedata.name}</a>
<span className="color-grey-9 fl ml3 mr3">&gt;</span>
@ -2479,21 +2512,21 @@ class PollNewQuestbank extends Component {
</p>
<div className="clearfix mb30">
{/*<p className="fl color-black summaryname mt5">{this.props.match.params.news === undefined ? "新建问卷" : this.props.match.params.news === "new" ? "新建问卷" : "编辑问卷"}</p>*/}
<p className="fl color-black summaryname mt5">编辑问卷</p>
<p className="fl color-black summaryname mt5">编辑</p>
{/*{*/}
{/* this.props.match.params.news === "new" ?*/}
{/* <a href={`/courses/${this.props.match.params.coursesId}/polls/${this.props.match.params.pollid}`}*/}
{/* className=" fr font-16">返回</a>*/}
{/* :*/}
<a href={`/courses/${this.props.match.params.coursesId}/polls/${left_banner_id}`}
className=" fr font-16">返回</a>
className=" fr font-16"></a>
{/*}*/}
</div>
{/*<Form {...formItemLayout} onSubmit={this.handleSubmit}>*/}
{
this.state.mysave === false ?
<div className="padding20-30 " style={{ background: '#fff', minHeight: "75px"}}>
<div style={{ background: '#fff', minHeight: "75px",padding: "30px"}}>
<div className="displayTitle font-16">
<span>{this.state.polls_nametest}</span>
@ -2558,7 +2591,7 @@ class PollNewQuestbank extends Component {
</div>
<div style={{
"padding": "20px 30px 50px",
"padding": "30px 30px 70px",
"position": "relative",
"border-bottom": "1px solid #EDEDED",
"margin-bottom": " 0px"
@ -2632,7 +2665,7 @@ class PollNewQuestbank extends Component {
</span>
<span className="fr">合计 <span
className="color-blue">{this.state.mysingles === undefined ? "" : this.state.mydoubles === undefined ? "" : this.state.mymainsint === undefined ? "" : this.state.mysingles + this.state.mydoubles + this.state.mymainsint}</span> </span>
style={{color:"#FF6800"}}>{this.state.q_counts === undefined ? "" :this.state.q_counts}</span> </span>
</div>
}
@ -2641,7 +2674,6 @@ class PollNewQuestbank extends Component {
{polls_status === undefined || polls_status === 1 ?
<div className="edu-back-white bor-bottom-greyE">
<div className=" mb10"></div>
<div style={{"padding": "20px 30px 20px 30px"}}>
<ActionBtn style="green" className="mr20" onClick={() => this.addmysingles()}><i
className="iconfont icon-tianjiafangda font-15 mr10"></i></ActionBtn>

@ -33,7 +33,33 @@ const GtopicBanksEdit = Loadable({
const HomeworkBanksEdit = Loadable({
loader: () => import('./HomeworkBanksEdit'),
loading: Loading,
})
});
//普通作业题库详情
const Generaljobbankdetails =Loadable({
loader: () => import('../../../courses/questionbank/Generaljobbankdetails'),
loading: Loading,
});
//分组作业题库详情
const GroupjobbankPage =Loadable({
loader: () => import('../../../courses/groupjobbank/GroupjobbankPage'),
loading: Loading,
});
//毕设选题详情
const CompletetopicdePage =Loadable({
loader: () => import('../../../courses/comtopicdetails/CompletetopicdePage'),
loading: Loading,
});
//毕设任务详情
const Completetaskpage =Loadable({
loader: () => import('../../../courses/completetaskdetails/Completetaskpage'),
loading: Loading,
});
//问卷编辑
const PollNewQuestbank =Loadable({
loader: () => import('../../../courses/poll/PollNewQuestbank'),
loading: Loading,
});
const GtaskBanksEdit = Loadable({
loader: () => import('./GtaskBanksEditEdit'),
@ -129,6 +155,36 @@ class BanksIndex extends Component{
return (<BanksTabIndex {...this.props} {...props} {...this.state} {...common} />)
}
}></Route>
{/*题库问卷编辑详情*/}
<Route path="/courses/poll/:workid/edit"
render={
(props) => (<PollNewQuestbank {...this.props} {...this.state} {...common} />)
}
></Route>
{/*毕设任务题库详情*/}
<Route path="/banks/gtask/:workid"
render={
(props) => (<Completetaskpage {...this.props} {...this.state} {...common} />)
}
></Route>
{/*毕设内容题库详情*/}
<Route path="/banks/gtopic/:workid"
render={
(props) => (<CompletetopicdePage {...this.props} {...this.state} {...common}/>)
}
></Route>
{/*分组作业题库详情*/}
<Route path="/banks/group/:workid"
render={
(props) => (<GroupjobbankPage {...this.props} {...this.state} {...common} />)
}
></Route>
{/* 普通作业题库详情*/}
<Route path="/banks/normal/:workid"
render={
(props) => (<Generaljobbankdetails {...this.props} {...this.state} {...common} />)
}
></Route>
</Switch>
</div>

Loading…
Cancel
Save