dev_aliyun_beta
杨树林 6 years ago
parent 687f52e27c
commit 25450c34d4

@ -2250,51 +2250,52 @@ class PollNewQuestbank extends Component {
//提交题目//没有就创建新的题库新建问newz题和保存题目不一样不能同时保存 这里只是新建 和编辑 标题和须知 //提交题目//没有就创建新的题库新建问newz题和保存题目不一样不能同时保存 这里只是新建 和编辑 标题和须知
submitQuestionnaire = () => { submitQuestionnaire = () => {
this.props.history.push(`/banks/poll/${pollid}`);
// console.log("调用了submitQuestionnaire") // console.log("调用了submitQuestionnaire")
if (this.state.Newedit === true) { // if (this.state.Newedit === true) {
//
this.newword(); // this.newword();
//
} else { // } else {
if (this.state.polls_nametest === undefined || this.state.polls_nametest === "") { // if (this.state.polls_nametest === undefined || this.state.polls_nametest === "") {
this.props.showNotification("请输入标题"); // this.props.showNotification("请输入标题");
return // return
} // }
//
if (this.state.polls_descriptiontest.length > 100) { // if (this.state.polls_descriptiontest.length > 100) {
//
} // }
var pollid; // var pollid;
if (this.state.pollid === undefined) { // if (this.state.pollid === undefined) {
pollid = this.props.match.params.workid; // pollid = this.props.match.params.workid;
} else { // } else {
pollid = this.state.pollid; // pollid = this.state.pollid;
} // }
//
// if(mews ==="new"){ // // if(mews ==="new"){
if (this.state.poll_questions && this.state.poll_questions.length === 0) { // if (this.state.poll_questions && this.state.poll_questions.length === 0) {
this.props.showNotification("至少创建1个题目"); // this.props.showNotification("至少创建1个题目");
return; // return;
} // }
// } // // }
//
var url = `/polls/${pollid}.json`; // var url = `/polls/${pollid}.json`;
axios.put(url, { // axios.put(url, {
polls_name: this.state.polls_nametest, // polls_name: this.state.polls_nametest,
polls_description: this.state.polls_descriptiontest // polls_description: this.state.polls_descriptiontest
}).then((result) => { // }).then((result) => {
try { // try {
// console.log(JSON.stringify(result)) // // console.log(JSON.stringify(result))
if (result.data.status === 0) { // if (result.data.status === 0) {
// console.log("更新题目成功") // // console.log("更新题目成功")
// this.props.showNotification("保存成功"); // // this.props.showNotification("保存成功");
this.props.history.push(`/courses/${this.props.match.params.coursesId}/polls/${pollid}/detail?tab=2`) //
} // }
} catch (e) { // } catch (e) {
//
} // }
}) // })
} // }
} }
cancelmodel = () => { cancelmodel = () => {
@ -2470,7 +2471,9 @@ class PollNewQuestbank extends Component {
} }
//试图 //试图
toWorkDetail = () => { toWorkDetail = () => {
this.props.history.push(`/banks/poll/${this.props.match.params.workId} `); console.log(this.props);
console.log("toWorkDetail");
this.props.history.push(`/banks/poll/${this.props.match.params.workid}`);
this.props.initPublic(undefined); this.props.initPublic(undefined);
} }

Loading…
Cancel
Save