diff --git a/public/react/config/webpack.config.dev.js b/public/react/config/webpack.config.dev.js index 6dce2253c..eaacd9f1e 100644 --- a/public/react/config/webpack.config.dev.js +++ b/public/react/config/webpack.config.dev.js @@ -32,7 +32,7 @@ module.exports = { // See the discussion in https://github.com/facebookincubator/create-react-app/issues/343.s // devtool: "cheap-module-eval-source-map", // 开启调试 - devtool: "source-map", // 开启调试 + // devtool: "source-map", // 开启调试 // These are the "entry points" to our application. // 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. diff --git a/public/react/src/modules/courses/Index.js b/public/react/src/modules/courses/Index.js index 607bedb65..bfe82dad4 100644 --- a/public/react/src/modules/courses/Index.js +++ b/public/react/src/modules/courses/Index.js @@ -466,9 +466,8 @@ class CoursesIndex extends Component{ // console.log(commons) return ( - {/*问卷编辑详情*/} - - () } @@ -479,7 +478,7 @@ class CoursesIndex extends Component{ (props) => () } > - {/*毕设内容题库详情*/} + {/*毕设选题题库详情*/} () diff --git a/public/react/src/modules/courses/poll/PollNewQuestbank.js b/public/react/src/modules/courses/poll/PollNewQuestbank.js index c7d5c6389..1935fb625 100644 --- a/public/react/src/modules/courses/poll/PollNewQuestbank.js +++ b/public/react/src/modules/courses/poll/PollNewQuestbank.js @@ -112,16 +112,16 @@ class PollNewQuestbank extends Component { return } - if (this.props.match.params.news !== undefined) { - if (this.props.match.params.news === "new") { - this.state.Newedit === true; - this.setState({ - Newedit: true, - mysave: true, - readOnlys: "", - cancellation: true, - }) - } else { + // if (this.props.match.params.news !== undefined) { + // if (this.props.match.params.news === "new") { + // this.state.Newedit === true; + // this.setState({ + // Newedit: true, + // mysave: true, + // readOnlys: "", + // cancellation: true, + // }) + // } else { this.Initializatio_data(); this.state.Newedit === false; this.setState({ @@ -129,8 +129,8 @@ class PollNewQuestbank extends Component { mysave: false, readOnlys: "readOnly", }) - } - } + // } + // } console.log("问卷返回"); console.log(this.props); @@ -185,7 +185,7 @@ class PollNewQuestbank extends Component { //课堂id let coursesId = this.props.match.params.coursesId; //时间id - let pollid = this.props.match.params.pollid; + let pollid = this.props.match.params.workid; console.log(pollid); // let coursesId = 557; if (pollid === undefined) { @@ -241,49 +241,41 @@ class PollNewQuestbank extends Component { questionnair: false }) } else { - const url = `/polls/${pollid}/edit.json`; + const url = `/exercise_banks/${pollid}.json`; axios.get(url).then((result) => { - if (result !== undefined) - - // console.log("有问卷~~~") - // if (result.status === 200) { - // console.log(JSON.stringify(result.data)) - this.props.form.setFieldsValue({ - polls_nametest: result.data.poll.polls_name, - polls_descriptiontest: result.data.poll.polls_description, - }); - - 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) + 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 + // }) + }).catch((error) => { console.log(error) }) @@ -297,7 +289,7 @@ class PollNewQuestbank extends Component { if (this.state.pollid !== undefined) { pollidsy = this.state.pollid; 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题和保存题目不一样不能同时保存 这里只是新建 和编辑 标题和须知 - submitQuestionnaire = (mews) => { + submitQuestionnaire = () => { // console.log("调用了submitQuestionnaire") if (this.state.Newedit === true) { @@ -2212,7 +2204,7 @@ class PollNewQuestbank extends Component { } var pollid; if (this.state.pollid === undefined) { - pollid = this.props.match.params.pollid; + pollid = this.props.match.params.workid; } else { pollid = this.state.pollid; } @@ -2375,7 +2367,7 @@ class PollNewQuestbank extends Component { var pollid; if (this.state.pollid === undefined) { - pollid = this.props.match.params.pollid; + pollid = this.props.match.params.workid; } else { pollid = this.state.pollid; } @@ -2433,7 +2425,7 @@ class PollNewQuestbank extends Component { // console.log([[`${maps[polls_status && polls_status]}`]] + ""); const IsAdmin = this.props.isAdmin(); - const {getFieldDecorator} = this.props.form; + // const {getFieldDecorator} = this.props.form; const formItemLayout = { labelCol: { xs: {span: 24}, @@ -2470,29 +2462,31 @@ class PollNewQuestbank extends Component {

this.gotohome()}>{this.props.coursedata.name} > - { - this.props.match.params.news === "new"? - 问卷 - : + {/*{*/} + {/* this.props.match.params.news === "new"?*/} + {/* 问卷*/} + {/* :*/} 问卷 - } + {/*}*/} > - {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.props.match.params.news === undefined ? "新建问卷" : this.props.match.params.news === "new" ? "新建问卷" : "编辑问卷"}

- { - this.props.match.params.news === "new" ? - 返回 - : + {/*

{this.props.match.params.news === undefined ? "新建问卷" : this.props.match.params.news === "new" ? "新建问卷" : "编辑问卷"}

*/} +

编辑问卷

+ {/*{*/} + {/* this.props.match.params.news === "new" ?*/} + {/* 返回*/} + {/* :*/} 返回 - } + {/*}*/}
{/*
*/} @@ -2528,15 +2522,16 @@ class PollNewQuestbank extends Component { style={{"color": "#f5222d"}}>*问卷标题 { - 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.adddomeditit()}>
- : "") - :"" + : "" + // ) + // :"" } @@ -3474,25 +3469,7 @@ class PollNewQuestbank extends Component { {polls_status === undefined || polls_status === 1 ? -
- { - this.props.match.params.news === "new" ? - this.state.Newedit === false ? -
-
- -
- this.addmysingles()}>单选题 - this.addmydoubles()}>多选题 - this.addmymainsint()}>主观题 -
-
- : "" - : -
+
this.addmysingles()}>主观题
- } -
:
}
- { - this.props.match.params.news === "new" ? - (this.state.Newedit === false ? -
-
  • - this.props.history.goBack()}>取消 - this.submitQuestionnaire(this.props.match.params.news)}>提交 -
  • - - -
    - - : "") - : -
    -
  • - this.props.history.goBack()}>取消 - this.submitQuestionnaire(this.props.match.params.news)}>提交 -
  • -
    - } - +
    +
  • + this.props.history.goBack()}>取消 + this.submitQuestionnaire()}>提交 +
  • +
    {/*
    */}
    @@ -3557,3 +3506,58 @@ class PollNewQuestbank extends Component { // RouteHOC() export default PollNewQuestbank +{/*
    */} +{/* {*/} +{/* this.props.match.params.news === "new" ?*/} +{/* this.state.Newedit === false ?*/} +{/*
    */} +{/*
    */} + +{/*
    */} +{/* this.addmysingles()}>单选题*/} +{/* this.addmydoubles()}>多选题*/} +{/* this.addmymainsint()}>主观题*/} +{/*
    */} +{/*
    */} +{/* : ""*/} +{/* :*/} +{/*
    */} +{/*
    */} +{/*
    */} +{/* this.addmysingles()}>单选题*/} +{/* this.addmydoubles()}>多选题*/} +{/* this.addmymainsint()}>主观题*/} +{/*
    */} +{/*
    */} +{/* }*/} +{/*
    */} +{/*{*/} +{/* this.props.match.params.news === "new" ?*/} +{/* (this.state.Newedit === false ?*/} +{/* */} +{/*
  • */} +{/* this.props.history.goBack()}>取消*/} +{/* this.submitQuestionnaire(this.props.match.params.news)}>提交*/} +{/*
  • */} + + +{/* */} + +{/* : "")*/} +{/* :*/} +{/* */} +{/*}*/} \ No newline at end of file diff --git a/public/react/src/modules/user/usersInfo/InfosTopics.js b/public/react/src/modules/user/usersInfo/InfosTopics.js index cf2c1eaa0..62ef259ad 100644 --- a/public/react/src/modules/user/usersInfo/InfosTopics.js +++ b/public/react/src/modules/user/usersInfo/InfosTopics.js @@ -457,7 +457,7 @@ class InfosTopics extends Component{