dev_aliyun_beta
杨树林 6 years ago
parent f0215eae80
commit 2087c9c306

@ -32,7 +32,7 @@ module.exports = {
// See the discussion in https://github.com/facebookincubator/create-react-app/issues/343.s // See the discussion in https://github.com/facebookincubator/create-react-app/issues/343.s
// devtool: "cheap-module-eval-source-map", // devtool: "cheap-module-eval-source-map",
// 开启调试 // 开启调试
devtool: "source-map", // 开启调试 // devtool: "source-map", // 开启调试
// These are the "entry points" to our application. // These are the "entry points" to our application.
// This means they will be the "root" imports that are included in JS bundle. // This means they will be the "root" imports that are included in JS bundle.
// The first two entry points enable "hot" CSS and auto-refreshes for JS. // The first two entry points enable "hot" CSS and auto-refreshes for JS.

@ -466,9 +466,8 @@ class CoursesIndex extends Component{
// console.log(commons) // console.log(commons)
return ( return (
<Switch {...this.props}> <Switch {...this.props}>
{/*问卷编辑详情*/} {/*题库问卷编辑详情*/}
<Route path="/courses/questreediting/:workid/edit"
<Route path="/courses/questreediting/:workid"
render={ render={
(props) => (<PollNewQuestbank {...this.props} {...props} {...this.state} />) (props) => (<PollNewQuestbank {...this.props} {...props} {...this.state} />)
} }
@ -479,7 +478,7 @@ class CoursesIndex extends Component{
(props) => (<Completetaskpage {...this.props} {...props} {...this.state} />) (props) => (<Completetaskpage {...this.props} {...props} {...this.state} />)
} }
></Route> ></Route>
{/*毕设内容题库详情*/} {/*毕设选题题库详情*/}
<Route path="/courses/completetopic/:workid" <Route path="/courses/completetopic/:workid"
render={ render={
(props) => (<CompletetopicdePage {...this.props} {...props} {...this.state} />) (props) => (<CompletetopicdePage {...this.props} {...props} {...this.state} />)

@ -112,16 +112,16 @@ class PollNewQuestbank extends Component {
return return
} }
if (this.props.match.params.news !== undefined) { // if (this.props.match.params.news !== undefined) {
if (this.props.match.params.news === "new") { // if (this.props.match.params.news === "new") {
this.state.Newedit === true; // this.state.Newedit === true;
this.setState({ // this.setState({
Newedit: true, // Newedit: true,
mysave: true, // mysave: true,
readOnlys: "", // readOnlys: "",
cancellation: true, // cancellation: true,
}) // })
} else { // } else {
this.Initializatio_data(); this.Initializatio_data();
this.state.Newedit === false; this.state.Newedit === false;
this.setState({ this.setState({
@ -129,8 +129,8 @@ class PollNewQuestbank extends Component {
mysave: false, mysave: false,
readOnlys: "readOnly", readOnlys: "readOnly",
}) })
} // }
} // }
console.log("问卷返回"); console.log("问卷返回");
console.log(this.props); console.log(this.props);
@ -185,7 +185,7 @@ class PollNewQuestbank extends Component {
//课堂id //课堂id
let coursesId = this.props.match.params.coursesId; let coursesId = this.props.match.params.coursesId;
//时间id //时间id
let pollid = this.props.match.params.pollid; let pollid = this.props.match.params.workid;
console.log(pollid); console.log(pollid);
// let coursesId = 557; // let coursesId = 557;
if (pollid === undefined) { if (pollid === undefined) {
@ -241,49 +241,41 @@ class PollNewQuestbank extends Component {
questionnair: false questionnair: false
}) })
} else { } else {
const url = `/polls/${pollid}/edit.json`; const url = `/exercise_banks/${pollid}.json`;
axios.get(url).then((result) => { axios.get(url).then((result) => {
if (result !== undefined) if (result)
console.log("247");
// console.log("有问卷~~~") console.log(result);
// if (result.status === 200) {
// console.log(JSON.stringify(result.data)) // if(result.data){
this.props.form.setFieldsValue({ // if(result.data.poll){
polls_nametest: result.data.poll.polls_name, // if(result.data.poll.polls_name){
polls_descriptiontest: result.data.poll.polls_description, // let num = parseInt(result.data.poll.polls_name.length);
}); // this.setState({
// addonAfter: num < 0 ? 0 : num
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
})
// console.log(this.state.polls_nametest)
// console.log(this.state.polls_descriptiontest)
// } // }
//
// 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
// })
}).catch((error) => { }).catch((error) => {
console.log(error) console.log(error)
}) })
@ -297,7 +289,7 @@ class PollNewQuestbank extends Component {
if (this.state.pollid !== undefined) { if (this.state.pollid !== undefined) {
pollidsy = this.state.pollid; pollidsy = this.state.pollid;
if (pollidsy === null || pollidsy === undefined) { if (pollidsy === null || pollidsy === undefined) {
pollidsy = this.props.match.params.pollid; pollidsy = this.props.match.params.workid;
} }
} }
@ -2195,7 +2187,7 @@ class PollNewQuestbank extends Component {
} }
//提交题目//没有就创建新的题库新建问newz题和保存题目不一样不能同时保存 这里只是新建 和编辑 标题和须知 //提交题目//没有就创建新的题库新建问newz题和保存题目不一样不能同时保存 这里只是新建 和编辑 标题和须知
submitQuestionnaire = (mews) => { submitQuestionnaire = () => {
// console.log("调用了submitQuestionnaire") // console.log("调用了submitQuestionnaire")
if (this.state.Newedit === true) { if (this.state.Newedit === true) {
@ -2212,7 +2204,7 @@ class PollNewQuestbank extends Component {
} }
var pollid; var pollid;
if (this.state.pollid === undefined) { if (this.state.pollid === undefined) {
pollid = this.props.match.params.pollid; pollid = this.props.match.params.workid;
} else { } else {
pollid = this.state.pollid; pollid = this.state.pollid;
} }
@ -2375,7 +2367,7 @@ class PollNewQuestbank extends Component {
var pollid; var pollid;
if (this.state.pollid === undefined) { if (this.state.pollid === undefined) {
pollid = this.props.match.params.pollid; pollid = this.props.match.params.workid;
} else { } else {
pollid = this.state.pollid; pollid = this.state.pollid;
} }
@ -2433,7 +2425,7 @@ class PollNewQuestbank extends Component {
// console.log([[`${maps[polls_status && polls_status]}`]] + ""); // console.log([[`${maps[polls_status && polls_status]}`]] + "");
const IsAdmin = this.props.isAdmin(); const IsAdmin = this.props.isAdmin();
const {getFieldDecorator} = this.props.form; // const {getFieldDecorator} = this.props.form;
const formItemLayout = { const formItemLayout = {
labelCol: { labelCol: {
xs: {span: 24}, xs: {span: 24},
@ -2470,29 +2462,31 @@ class PollNewQuestbank extends Component {
<p className="clearfix mb20 mt10"> <p className="clearfix mb20 mt10">
<a className=" btn colorgrey fl hovercolorblue" onClick={()=>this.gotohome()}>{this.props.coursedata.name}</a> <a className=" btn colorgrey fl hovercolorblue" onClick={()=>this.gotohome()}>{this.props.coursedata.name}</a>
<span className="color-grey-9 fl ml3 mr3">&gt;</span> <span className="color-grey-9 fl ml3 mr3">&gt;</span>
{ {/*{*/}
this.props.match.params.news === "new"? {/* this.props.match.params.news === "new"?*/}
<a className=" btn colorgrey fl hovercolorblue" {/* <a className=" btn colorgrey fl hovercolorblue"*/}
href={`/courses/${this.props.match.params.coursesId}/polls/${this.props.match.params.pollid}`}>问卷</a> {/* href={`/courses/${this.props.match.params.coursesId}/polls/${this.props.match.params.pollid}`}>问卷</a>*/}
: {/* :*/}
<a className=" btn colorgrey fl hovercolorblue" <a className=" btn colorgrey fl hovercolorblue"
href={`/courses/${this.props.match.params.coursesId}/polls/${left_banner_id}`}>问卷</a> href={`/courses/${this.props.match.params.coursesId}/polls/${left_banner_id}`}>问卷</a>
} {/*}*/}
<span className="color-grey-9 fl ml3 mr3">&gt;</span> <span className="color-grey-9 fl ml3 mr3">&gt;</span>
<span>{this.props.match.params.news === undefined ? "新建" : this.props.match.params.news === "new" ? "新建" : "编辑"}</span> {/*<span>{this.props.match.params.news === undefined ? "新建" : this.props.match.params.news === "new" ? "新建" : "编辑"}</span>*/}
<span>编辑</span>
</p> </p>
<div className="clearfix mb30"> <div className="clearfix mb30">
<p {/*<p className="fl color-black summaryname mt5">{this.props.match.params.news === undefined ? "新建问卷" : this.props.match.params.news === "new" ? "新建问卷" : "编辑问卷"}</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>
{ {/*{*/}
this.props.match.params.news === "new" ? {/* this.props.match.params.news === "new" ?*/}
<a href={`/courses/${this.props.match.params.coursesId}/polls/${this.props.match.params.pollid}`} {/* <a href={`/courses/${this.props.match.params.coursesId}/polls/${this.props.match.params.pollid}`}*/}
className=" fr font-16">返回</a> {/* className=" fr font-16">返回</a>*/}
: {/* :*/}
<a href={`/courses/${this.props.match.params.coursesId}/polls/${left_banner_id}`} <a href={`/courses/${this.props.match.params.coursesId}/polls/${left_banner_id}`}
className=" fr font-16">返回</a> className=" fr font-16">返回</a>
} {/*}*/}
</div> </div>
{/*<Form {...formItemLayout} onSubmit={this.handleSubmit}>*/} {/*<Form {...formItemLayout} onSubmit={this.handleSubmit}>*/}
@ -2528,15 +2522,16 @@ class PollNewQuestbank extends Component {
style={{"color": "#f5222d"}}>*</span> style={{"color": "#f5222d"}}>*</span>
</div> </div>
{ {
this.props.match.params.news === undefined ? "" : this.props.match.params.news === "new" ? // this.props.match.params.news === undefined ? "" : this.props.match.params.news === "new" ?
( // (
this.state.mysave === false ? this.state.mysave === false ?
<div className="fr"> <div className="fr">
<span><a onClick={() => this.adddomeditit()}><Tooltip title="编辑"><i <span><a onClick={() => this.adddomeditit()}><Tooltip title="编辑"><i
className="color-green font-18 iconfont icon-bianjidaibeijing"></i></Tooltip></a></span> className="color-green font-18 iconfont icon-bianjidaibeijing"></i></Tooltip></a></span>
</div> </div>
: "") : ""
:"" // )
// :""
} }
</div> </div>
@ -3474,25 +3469,7 @@ class PollNewQuestbank extends Component {
{polls_status === undefined || polls_status === 1 ? {polls_status === undefined || polls_status === 1 ?
<div> <div>
{
this.props.match.params.news === "new" ?
this.state.Newedit === false ?
<div>
<div className=" mb10"></div>
<div style={{"padding": "10px 30px 20px 30px"}}>
<ActionBtn style="green" className="mr20" onClick={() => this.addmysingles()}><i
className="iconfont icon-tianjiafangda font-15 mr10"></i></ActionBtn>
<ActionBtn style="green" className="mr20" onClick={() => this.addmydoubles()}><i
className="iconfont icon-tianjiafangda font-15 mr10"></i></ActionBtn>
<ActionBtn style="green" className="mr20" onClick={() => this.addmymainsint()}><i
className="iconfont icon-tianjiafangda font-15 mr10"></i></ActionBtn>
</div>
</div>
: ""
:
<div>
<div className=" mb10"></div> <div className=" mb10"></div>
<div style={{"padding": "10px 30px 20px 30px"}}> <div style={{"padding": "10px 30px 20px 30px"}}>
<ActionBtn style="green" className="mr20" onClick={() => this.addmysingles()}><i <ActionBtn style="green" className="mr20" onClick={() => this.addmysingles()}><i
@ -3503,49 +3480,21 @@ class PollNewQuestbank extends Component {
className="iconfont icon-tianjiafangda font-15 mr10"></i></ActionBtn> className="iconfont icon-tianjiafangda font-15 mr10"></i></ActionBtn>
</div> </div>
</div> </div>
}
</div>
: <div></div>} : <div></div>}
</div> </div>
</div> </div>
{ <div
this.props.match.params.news === "new" ? style={{
(this.state.Newedit === false ?
<div "width": "100%",
style={{ }}
"display": "flex", >
"justify-content": "center", <li className="clearfix mt30 mb50 fl">
"align-items": "center", <a className="defalutCancelbtn fl mr20"onClick={() => this.props.history.goBack()}>取消</a>
"width": "100%", <a type="primary" className=" defalutSubmitbtn fl"
}} onClick={() => this.submitQuestionnaire()}>提交</a>
> </li>
<li className="clearfix mt30 mb50"> </div>
<a className="defalutCancelbtn fl mr20" onClick={() => this.props.history.goBack()}>取消</a>
<a type="primary" className="defalutSubmitbtn fl"
onClick={() => this.submitQuestionnaire(this.props.match.params.news)}>提交</a>
</li>
</div>
: "")
:
<div
style={{
"display": "flex",
"justify-content": "center",
"align-items": "center",
"width": "100%",
}}
>
<li className="clearfix mt30 mb50">
<a className="defalutCancelbtn fl mr20"onClick={() => this.props.history.goBack()}>取消</a>
<a type="primary" className=" defalutSubmitbtn fl"
onClick={() => this.submitQuestionnaire(this.props.match.params.news)}>提交</a>
</li>
</div>
}
{/*</Form>*/} {/*</Form>*/}
</div> </div>
<div ref='targetElement'></div> <div ref='targetElement'></div>
@ -3557,3 +3506,58 @@ class PollNewQuestbank extends Component {
// RouteHOC() // RouteHOC()
export default PollNewQuestbank export default PollNewQuestbank
{/*<div>*/}
{/* {*/}
{/* this.props.match.params.news === "new" ?*/}
{/* this.state.Newedit === false ?*/}
{/* <div>*/}
{/* <div className=" mb10"></div>*/}
{/* <div style={{"padding": "10px 30px 20px 30px"}}>*/}
{/* <ActionBtn style="green" className="mr20" onClick={() => this.addmysingles()}><i*/}
{/* className="iconfont icon-tianjiafangda font-15 mr10"></i>单选题</ActionBtn>*/}
{/* <ActionBtn style="green" className="mr20" onClick={() => this.addmydoubles()}><i*/}
{/* className="iconfont icon-tianjiafangda font-15 mr10"></i>多选题</ActionBtn>*/}
{/* <ActionBtn style="green" className="mr20" onClick={() => this.addmymainsint()}><i*/}
{/* className="iconfont icon-tianjiafangda font-15 mr10"></i>主观题</ActionBtn>*/}
{/* </div>*/}
{/* </div>*/}
{/* : ""*/}
{/* :*/}
{/* <div>*/}
{/* <div className=" mb10"></div>*/}
{/* <div style={{"padding": "10px 30px 20px 30px"}}>*/}
{/* <ActionBtn style="green" className="mr20" onClick={() => this.addmysingles()}><i*/}
{/* className="iconfont icon-tianjiafangda font-15 mr10"></i>单选题</ActionBtn>*/}
{/* <ActionBtn style="green" className="mr20" onClick={() => this.addmydoubles()}><i*/}
{/* className="iconfont icon-tianjiafangda font-15 mr10"></i>多选题</ActionBtn>*/}
{/* <ActionBtn style="green" className="mr20" onClick={() => this.addmymainsint()}><i*/}
{/* className="iconfont icon-tianjiafangda font-15 mr10"></i>主观题</ActionBtn>*/}
{/* </div>*/}
{/* </div>*/}
{/* }*/}
{/*</div>*/}
{/*{*/}
{/* this.props.match.params.news === "new" ?*/}
{/* (this.state.Newedit === false ?*/}
{/* <div*/}
{/* style={{*/}
{/* "display": "flex",*/}
{/* "justify-content": "center",*/}
{/* "align-items": "center",*/}
{/* "width": "100%",*/}
{/* }}*/}
{/* >*/}
{/* <li className="clearfix mt30 mb50">*/}
{/* <a className="defalutCancelbtn fl mr20" onClick={() => this.props.history.goBack()}>取消</a>*/}
{/* <a type="primary" className="defalutSubmitbtn fl"*/}
{/* onClick={() => this.submitQuestionnaire(this.props.match.params.news)}>提交</a>*/}
{/* </li>*/}
{/* </div>*/}
{/* : "")*/}
{/* :*/}
{/* */}
{/*}*/}

@ -457,7 +457,7 @@ class InfosTopics extends Component{
<a className="btn colorblue mr25 font-16 fr" <a className="btn colorblue mr25 font-16 fr"
href={category==="normal"?`/courses/ordinarywork/${item.id}?tab=0`: href={category==="normal"?`/courses/ordinarywork/${item.id}?tab=0`:
category==="group"?`/courses/groupingwork/${item.id}?tab=0`: category==="group"?`/courses/groupingwork/${item.id}?tab=0`:
category==="poll"?`/courses/poll/${item.id}`: category==="poll"?`/courses/questreediting/${item.id}/edit`:
category==="exercise"?`/courses/poll/${item.id}`: category==="exercise"?`/courses/poll/${item.id}`:
category==="gtask"?`/courses/completetask/${item.id}`: category==="gtask"?`/courses/completetask/${item.id}`:
category==="gtopic"?`/courses/completetopic/${item.id}`:"" category==="gtopic"?`/courses/completetopic/${item.id}`:""

Loading…
Cancel
Save