From 9efc0344f6af8da000c976dc738326de847b61eb Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Mon, 8 Jul 2019 17:44:53 +0800 Subject: [PATCH 01/15] max-width: 86%; --- public/react/src/modules/page/layers/ImageLayerOfCommentHOC.js | 2 +- public/react/src/modules/page/layers/TaskResultLayer.css | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/public/react/src/modules/page/layers/ImageLayerOfCommentHOC.js b/public/react/src/modules/page/layers/ImageLayerOfCommentHOC.js index 61342de37..50072c627 100644 --- a/public/react/src/modules/page/layers/ImageLayerOfCommentHOC.js +++ b/public/react/src/modules/page/layers/ImageLayerOfCommentHOC.js @@ -18,7 +18,7 @@ export function ImageLayerOfCommentHOC(options = {}) { const imageSrc = event.target.src || event.target.getAttribute('src') || event.target.getAttribute('href') // 判断imageSrc是否是图片 const fileName = event.target.innerHTML.trim() - if (isImageExtension(imageSrc.trim()) || isImageExtension(fileName)) { + if (isImageExtension(imageSrc.trim()) || isImageExtension(fileName) || event.target.tagName == 'IMG') { // 非回复里的头像图片; 非emoticons if (imageSrc.indexOf('/images/avatars/User') === -1 && imageSrc.indexOf('kindeditor/plugins/emoticons') === -1 ) { diff --git a/public/react/src/modules/page/layers/TaskResultLayer.css b/public/react/src/modules/page/layers/TaskResultLayer.css index a684abdf4..0dd118470 100644 --- a/public/react/src/modules/page/layers/TaskResultLayer.css +++ b/public/react/src/modules/page/layers/TaskResultLayer.css @@ -41,9 +41,10 @@ align-items: center; display: -webkit-flex; height: 100%; + text-align: center; } .passImg{ - max-width: 100%; + max-width: 86%; max-height: 100%; } /* ImageLayer ----------------- End */ From 18a37dda3ad1ab61d8d9585b40ed0e81b908f2cf Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Tue, 9 Jul 2019 09:15:22 +0800 Subject: [PATCH 02/15] lock --- public/react/src/modules/page/main/CodeEvaluateView.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/react/src/modules/page/main/CodeEvaluateView.js b/public/react/src/modules/page/main/CodeEvaluateView.js index 6c9ae2c6d..eba71d4fa 100644 --- a/public/react/src/modules/page/main/CodeEvaluateView.js +++ b/public/react/src/modules/page/main/CodeEvaluateView.js @@ -159,7 +159,7 @@ class CodeEvaluateView extends Component { let headIconClass = ''; let _headLockIconClass = ''; - if (item.is_public === 0) { + if (item.is_public == 0) { if (game.test_sets_view === true || power === 1){ _headLockIconClass = 'fas fa-unlock-alt' } else { From 41c65dc8652db9c01ed79b800707811d3a2e8c7d Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Tue, 9 Jul 2019 09:38:23 +0800 Subject: [PATCH 03/15] css --- public/react/src/modules/page/main/LeftView.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/public/react/src/modules/page/main/LeftView.js b/public/react/src/modules/page/main/LeftView.js index b2469ec44..ec3d4665b 100644 --- a/public/react/src/modules/page/main/LeftView.js +++ b/public/react/src/modules/page/main/LeftView.js @@ -283,6 +283,9 @@ class LeftView extends Component { color: #CDCDCD; flex: 0 0 45px; } + .markdown-body ol, .markdown-body ul { + padding-left: 2.5em; + } `}
@@ -293,7 +296,7 @@ class LeftView extends Component {
{item.name}
已解锁
-
+
})} From f7684fb38ad013b27dccb82422917c1f6d692195 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Tue, 9 Jul 2019 09:49:37 +0800 Subject: [PATCH 04/15] top --- public/react/src/modules/page/main/CodeEvaluateView.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/react/src/modules/page/main/CodeEvaluateView.js b/public/react/src/modules/page/main/CodeEvaluateView.js index eba71d4fa..d402e6bce 100644 --- a/public/react/src/modules/page/main/CodeEvaluateView.js +++ b/public/react/src/modules/page/main/CodeEvaluateView.js @@ -175,7 +175,7 @@ class CodeEvaluateView extends Component { testSetsComponentArray.push(
+ style={{cursor:'pointer', 'margin-top':index == 0 ? '4px' : ''}} key={index+'-0'}>

From 10ac320117a58c79a9fdfdab80bbfdbb1eb32e59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Tue, 9 Jul 2019 11:01:28 +0800 Subject: [PATCH 05/15] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/package.json | 3 --- public/react/src/modules/courses/Resource/Fileslistitem.js | 1 - .../src/modules/courses/shixunHomework/ShixunStudentWork.js | 1 - .../src/modules/courses/shixunHomework/ShixunWorkReport.js | 1 - .../src/modules/courses/shixunHomework/Trainingjobsetting.js | 1 - .../modules/courses/shixunHomework/Workquestionandanswer.js | 1 - 6 files changed, 8 deletions(-) diff --git a/public/react/package.json b/public/react/package.json index d2b6a23ea..e0989f47c 100644 --- a/public/react/package.json +++ b/public/react/package.json @@ -42,8 +42,6 @@ "immutability-helper": "^2.6.6", "install": "^0.12.2", "jest": "20.0.4", - "js-base64": "^2.5.1", - "js-file-download": "^0.4.7", "lodash": "^4.17.5", "loglevel": "^1.6.1", "material-ui": "^1.0.0-beta.40", @@ -165,7 +163,6 @@ "babel-plugin-import": "^1.11.0", "concat": "^1.0.3", "happypack": "^5.0.1", - "videojs-for-react": "^0.0.3", "webpack-bundle-analyzer": "^3.0.3", "webpack-parallel-uglify-plugin": "^1.1.0" } diff --git a/public/react/src/modules/courses/Resource/Fileslistitem.js b/public/react/src/modules/courses/Resource/Fileslistitem.js index 8a8ff674c..c3998700f 100644 --- a/public/react/src/modules/courses/Resource/Fileslistitem.js +++ b/public/react/src/modules/courses/Resource/Fileslistitem.js @@ -6,7 +6,6 @@ import {getImageUrl} from 'educoder'; import axios from 'axios' import {getUrl} from 'educoder'; import moment from 'moment' -import { Base64 } from 'js-base64'; import CoursesListType from '../coursesPublic/CoursesListType'; import Showoldfiles from "../coursesPublic/Showoldfiles"; import Modals from '../../modals/Modals'; diff --git a/public/react/src/modules/courses/shixunHomework/ShixunStudentWork.js b/public/react/src/modules/courses/shixunHomework/ShixunStudentWork.js index 90bc23d99..879f90cc7 100644 --- a/public/react/src/modules/courses/shixunHomework/ShixunStudentWork.js +++ b/public/react/src/modules/courses/shixunHomework/ShixunStudentWork.js @@ -33,7 +33,6 @@ import '../css/Courses.css' import './style.css' import moment from 'moment'; import 'moment/locale/zh-cn'; -import {Base64} from 'js-base64'; const Search = Input.Search; const CheckboxGroup = Checkbox.Group; diff --git a/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js b/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js index fc34e0667..9a331cdef 100644 --- a/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js +++ b/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js @@ -20,7 +20,6 @@ import '../css/Courses.css'; import './style.css'; import moment from 'moment'; import 'moment/locale/zh-cn'; -import {Base64} from 'js-base64'; class ShixunWorkReport extends Component { diff --git a/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js b/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js index 51b491861..06c4dfba2 100644 --- a/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js +++ b/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js @@ -4,7 +4,6 @@ import HomeworkModal from "../coursesPublic/HomeworkModal"; import {WordsBtn, ActionBtn, handleDateString} from 'educoder'; import PollDetailTabForthRules from '../poll/PollDetailTabForthRules'; import ShixunWorkModal from './Shixunworkdetails/ShixunWorkModal'; -import {Base64} from 'js-base64'; import { Button, Checkbox, diff --git a/public/react/src/modules/courses/shixunHomework/Workquestionandanswer.js b/public/react/src/modules/courses/shixunHomework/Workquestionandanswer.js index 5cb496847..9616eae58 100644 --- a/public/react/src/modules/courses/shixunHomework/Workquestionandanswer.js +++ b/public/react/src/modules/courses/shixunHomework/Workquestionandanswer.js @@ -23,7 +23,6 @@ import { import {Link, Switch, Route, Redirect} from 'react-router-dom'; import moment from 'moment'; import 'moment/locale/zh-cn'; -import {Base64} from 'js-base64'; import axios from 'axios'; import '../css/members.css' import "../common/formCommon.css" From b7e2556aaea15193dfc9259d3fa73ed236df7660 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Tue, 9 Jul 2019 14:00:37 +0800 Subject: [PATCH 06/15] =?UTF-8?q?=E5=B7=B2=E5=AE=A1=E6=89=B9=E5=BE=85?= =?UTF-8?q?=E5=AE=A1=E6=89=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/courses/members/teacherList.js | 118 +++++++++++++++--- 1 file changed, 98 insertions(+), 20 deletions(-) diff --git a/public/react/src/modules/courses/members/teacherList.js b/public/react/src/modules/courses/members/teacherList.js index 2c5108f8d..18915f20c 100644 --- a/public/react/src/modules/courses/members/teacherList.js +++ b/public/react/src/modules/courses/members/teacherList.js @@ -1,5 +1,5 @@ import React,{ Component } from "react"; -import { Input,Checkbox,Table, Divider, Tooltip,Spin } from "antd"; +import { Input,Checkbox,Table, Divider, Tooltip,Spin, Menu } from "antd"; import CourseLayoutcomponent from '../common/CourseLayoutComponent' @@ -27,11 +27,14 @@ const ROLE_ADMIN = "管理员" const ROLE_TEACHER = "教师" const ROLE_TEACHER_ASSISTANT = "助教" const pageSize = 20; + function buildColumns(that) { + let sortedInfo = that.state.sortedInfo || {} const isAdmin = that.props.isAdmin() const isAdminOrCreator = that.props.isAdminOrCreator(); const isAdminOrTeacher = that.props.isAdminOrTeacher() - const { course_groups } = that.state + const { course_groups, filterKey } = that.state + const showSorter = filterKey == '1' const columns = [{ title: '序号', dataIndex: 'name', @@ -55,6 +58,8 @@ function buildColumns(that) { dataIndex: 'name', width: 120, key: 'name', + sorter: showSorter, + sortOrder: sortedInfo.columnKey === 'name' && sortedInfo.order, render: (name, record) => { return 4 ? name : ''}`}>{name} @@ -63,6 +68,11 @@ function buildColumns(that) { title: '角色', dataIndex: 'role', key: 'role', + sorter: showSorter, + // 'ascend' | 'descend' + defaultSortOrder: 'ascend', + sortOrder: sortedInfo.columnKey === 'role' && sortedInfo.order, + }] that.state.course_groups && that.state.course_groups.length && columns.push({ title: 管理权限, @@ -138,8 +148,11 @@ function buildColumns(that) { columns.push({ title: '答辩组', // width: 90, + sorter: showSorter, key: 'graduation_group', dataIndex: 'graduation_group', + sortOrder: sortedInfo.columnKey === 'graduation_group' && sortedInfo.order, + render: text => ( {text} @@ -200,6 +213,7 @@ class studentsList extends Component{ this.state={ headIndex:"1", page:1, + sortedInfo: { columnKey: 'role', order: 'ascend'}, totalPage:undefined, searchValue:"", order: ORDER_BY_DATE, @@ -209,7 +223,8 @@ class studentsList extends Component{ checkBoxValues: [], isSpin:false, application_list: [], - checkAllArray: [] + checkAllArray: [], + filterKey: 1, // 1 已审批 2 待审批 } } onCheckAllChange = (e, item, index) => { @@ -339,7 +354,7 @@ class studentsList extends Component{ console.log(error); }); } - fetchAll=(argPage)=>{ + fetchAll = (argPage) => { this.setState({ isSpin:true }) @@ -347,9 +362,28 @@ class studentsList extends Component{ if (argPage) { this.setState({ page: argPage }) } + + const sortedInfo = this.state.sortedInfo; let page = argPage || this.state.page - let { order, searchValue }=this.state - let url=`/courses/${id}/teachers.json?order=${order}&page=${page}`; + let { searchValue, filterKey }=this.state + let order = 1; + if (sortedInfo.columnKey == 'role') { + order = 1; + } else if (sortedInfo.columnKey == 'name') { + order = 2; + } else if (sortedInfo.columnKey == 'graduation_group') { + order = 3; + } + let sort = 'desc' + if (sortedInfo.order == 'ascend') { + sort = 'asc' + } + let url=`/courses/${id}/teachers.json?order=${order}&page=${page}&sort=${sort}`; + if (filterKey == '1') { + + } else if (filterKey == '2') { + url = `/courses/${id}/apply_teachers.json?_a=1` + } if(searchValue!=""){ url+='&search='+searchValue; } @@ -358,8 +392,17 @@ class studentsList extends Component{ this.setState({ teachers: result.data.teacher_list, total_count: result.data.teacher_list_size, - application_list: result.data.application_list, + // application_list: result.data.application_list || [], + is_admin: result.data.is_admin, + apply_size: result.data.apply_size, + isSpin:false + }) + } else if (result.data.application_list) { + this.setState({ + total_count: result.data.teacher_list_size, + application_list: result.data.application_list || [], is_admin: result.data.is_admin, + apply_size: result.data.apply_size, isSpin:false }) } @@ -529,13 +572,33 @@ class studentsList extends Component{ }) return result && result.length > 0 } - + onTableChange = (pagination, filters, sorter) => { + console.log('Various parameters', pagination, filters, sorter); + this.setState({ + sortedInfo: sorter, + }, () => { + this.fetchAll() + }); + }; + clearSelection = () => { + this.setState({ checkBoxValues: [] }) + } + selectedStatus=(e)=>{ + this.clearSelection() + this.setState({ + filterKey: e.key, + page:1, + isSpin:true + }, () => { + this.fetchAll(); + }) + } render(){ const isAdmin = this.props.isAdmin() const columns = buildColumns(this) let { searchValue, checkBoxValues, checkAllValue, - groupList, total_count, teachers, order, page + groupList, total_count, teachers, order, page, apply_size, filterKey }=this.state let currentOrderName = '加入时间排序' @@ -544,12 +607,13 @@ class studentsList extends Component{ } else if (order == ORDER_BY_GRADUATION_GROUP) { currentOrderName = '答辩组排序' } - const combineArray = teachers.slice(0) - if (page == 1) { - this.state.application_list && this.state.application_list.slice(0).reverse().forEach(item => { - item.isApply = true - combineArray.unshift(item) - }) + let combineArray = teachers.slice(0) + if (page == 1 && filterKey == '2') { + // this.state.application_list && this.state.application_list.slice(0).reverse().forEach(item => { + // item.isApply = true + // combineArray.unshift(item) + // }) + combineArray = this.state.application_list } const isAdminOrTeacher = this.props.isAdminOrTeacher() const hasGraduationModule = this.hasGraduationModule() @@ -585,12 +649,25 @@ class studentsList extends Component{ } secondRowLeft={ - total_count ? : '' + isAdminOrTeacher ?

+ + 已审批({total_count}) + 待审批({apply_size}) + +
: + (total_count ? : '') } onPressEnter={this.onPressEnter} > + + ~ + {/*可选最大*/} + + + (学生答题时,系统对其选择的选项个数进行限制,--表示不限制) +
+ + + + + ) + + : (
) + + } + +
+ {itemo.question.question_type === 2 ? + ( + this.state.polls_status === undefined || this.state.polls_status === 1 ? +
+ +
this.Ewoption(itemo.question.id, itemo)}>新增选项 + + { + this.state.newoption === false ? this.Addanotheroption(itemo.question.id)}>新增其他选项 : "" + } + +
+ + + + this.Deleteadddom(indexo)}>取消 + this.Deleteadddomthree(indexo, itemo)}>保存 + this.Deleteadddomtwo(indexo, itemo)}>保存并继续 + +
+ + + : +
+ + this.Deleteadddom(indexo)}>取消 + this.Deleteadddomthree(indexo, itemo)}>保存 + this.Deleteadddomtwo(indexo, itemo)}>保存并继续 + +
+ ) + + : itemo.question.question_type === 3 ? +
+ + this.Deleteadddom(indexo)}>取消 + this.Deleteadddomthree(indexo, itemo)}>保存 + this.Deleteadddomtwo(indexo, itemo)}>保存并继续 + +
+ : + ""} + + +
+ + + + return ( +
+ {resultDomtwo} +
+ ) + })} + + + + : item.question.question_type === 2 ? - ( +
+ {item.question.answers === undefined ? "" : item.question.answers.map((items, i) => { return (
{items.answer_text} - - {/*{items.answer_text}*/}
) })} -
) - : item.question.question_type === 3 ? (
) : (
)} -
- - return ( -
- {resultDom} -
- ) - })} - {/**************************************************************************/} - {/*编辑用的新增用的*/} - {/**************************************************************************/} - - {this.state.adddom === undefined ? "" : this.state.adddom.map((itemo, indexo) => { - // console.log('打印this.state.adddom') - // console.log(this.state.adddom); - let arrid = itemo.question.id; - let resultDomtwo; - resultDomtwo = -
+ + {/*多选题*/} +
+ {this.state.adddom === undefined ? "" : item.question.question_type === 2&&this.state.adddom.map((itemo, indexo) => { + let arrid = itemo.question.id; + let resultDomtwo; + resultDomtwo = +
{itemo.question.question_type === 1 ? "单选题" : itemo.question.question_type === 2 ? "多选题" : "主观题"} this.onCheckAllChange(e, indexo)} + onChange={(e) => this.OnCheckAllChange(e, indexo)} className="lineh-40" style={{"marginLeft": "20px"}}>必答 - - - {itemo.question.answers === undefined ? "" : itemo.question.answers.map((itemt, indext) => { - return ( -
- {itemt.answer_text === undefined ? ( -
) : itemt.answer_text === "其他" ? ( -

+ + + {itemo.question.answers === undefined ? "" : itemo.question.answers.map((itemt, indext) => { + return ( +

+ {itemt.answer_text === undefined ? ( +
) : itemt.answer_text === "其他" ? ( +

其它 - - {polls_status === undefined || polls_status === 1 ? - this.deleteentrys(arrid, indext, true)}> - : ""} -

) : (

+ + {this.state.polls_status === undefined || this.state.polls_status === 1 ? + this.Deleteentrys(arrid, indext, true)}> + : ""} +

) : (

选项 - - {polls_status === undefined || polls_status === 1 ? - this.deleteentrys(arrid, indext, false)}> - : ""} -

)} -
- ) - })} - -
- {itemo.question.question_type === 1 ? ( -
-
- {polls_status === undefined || polls_status === 1 ? - this.ewoption(itemo.question.id, itemo)}>新增选项 - - : ""} - {polls_status === undefined || polls_status === 1 ? - - (newoption === false ? - this.addanotheroption(itemo.question.id)}>新增其他选项 - : "") - : ""} - + + {this.state.polls_status === undefined || this.state.polls_status === 1 ? + this.Deleteentrys(arrid, indext, false)}> + : ""} +

)} +
+ ) + })} + +
+ {itemo.question.question_type === 1 ? ( +
+
+ {this.state.polls_status === undefined || this.state.polls_status === 1 ? + this.Ewoption(itemo.question.id, itemo)}>新增选项 + + : ""} + {this.state.polls_status === undefined || this.state.polls_status === 1 ? + + (this.state.newoption === false ? + this.Addanotheroption(itemo.question.id)}>新增其他选项 + : "") + : ""} + this.deleteadddom(indexo)}>取消 + onClick={() => this.Deleteadddom(indexo)}>取消 this.deleteadddomthree(indexo, itemo)}>保存 + onClick={() => this.Deleteadddomthree(indexo, itemo)}>保存 this.deleteadddomtwo(indexo, itemo)}>保存并继续 + onClick={() => this.Deleteadddomtwo(indexo, itemo)}>保存并继续 -
-
+
+
- ) + ) - : itemo.question.question_type === 2 ? ( - //////////////////////////////////////////// 可选 -
-
-
+ : itemo.question.question_type === 2 ? ( + //////////////////////////////////////////// 可选 +
+
+
可选 -
- {/*可选最小*/} - - - ~ - {/*可选最大*/} - - - (学生答题时,系统对其选择的选项个数进行限制,--表示不限制) -
+ } + + + ~ + {/*可选最大*/} + + + (学生答题时,系统对其选择的选项个数进行限制,--表示不限制) +
+ +
+
+
+ ) + + : (
) + + } +
+
+ {itemo.question.question_type === 2 ? + ( + this.state.polls_status === undefined || this.state.polls_status === 1 ? +
+ +
this.Ewoption(itemo.question.id, itemo)}>新增选项 + + { + this.state.newoption === false ? this.Addanotheroption(itemo.question.id)}>新增其他选项 : "" + } + +
+ + + + this.Deleteadddom(indexo)}>取消 + this.Deleteadddomthree(indexo, itemo)}>保存 + this.Deleteadddomtwo(indexo, itemo)}>保存并继续 + +
+ + + : +
+ + this.Deleteadddom(indexo)}>取消 + this.Deleteadddomthree(indexo, itemo)}>保存 + this.Deleteadddomtwo(indexo, itemo)}>保存并继续 + +
+ ) + + : itemo.question.question_type === 3 ? +
+ + this.Deleteadddom(indexo)}>取消 + this.Deleteadddomthree(indexo, itemo)}>保存 + this.Deleteadddomtwo(indexo, itemo)}>保存并继续 + +
+ : + ""} +
-
- ) - : (
) - } -
-
- {itemo.question.question_type === 2 ? - ( - polls_status === undefined || polls_status === 1 ? -
+ return ( +
+ {resultDomtwo} +
+ ) + })} +
+
-
this.ewoption(itemo.question.id, itemo)}>新增选项 + : item.question.question_type === 3 ? + // 主观题 + (
+ {this.state.adddom === undefined ? "" : item.question.question_type === 3&&this.state.adddom.map((itemo, indexo) => { + let arrid = itemo.question.id; + let resultDomtwo; + resultDomtwo = +
+ {itemo.question.question_type === 1 ? "单选题" : itemo.question.question_type === 2 ? "多选题" : "主观题"} + this.OnCheckAllChange(e, indexo)} + className="lineh-40" + style={{"marginLeft": "20px"}}>必答 + - { - newoption === false ? this.addanotheroption(itemo.question.id)}>新增其他选项 : "" - } + + + {itemo.question.answers === undefined ? "" : itemo.question.answers.map((itemt, indext) => { + return ( +
+ {itemt.answer_text === undefined ? ( +
) : itemt.answer_text === "其他" ? ( +

+ 其它 -

+ + {this.state.polls_status === undefined || this.state.polls_status === 1 ? + this.Deleteentrys(arrid, indext, true)}> + : ""} +

) : (

+ 选项 + + {this.state.polls_status === undefined || this.state.polls_status === 1 ? + this.Deleteentrys(arrid, indext, false)}> + : ""} +

)} +
+ ) + })} + +
+ {itemo.question.question_type === 1 ? ( +
+
+ {this.state.polls_status === undefined || this.state.polls_status === 1 ? + this.Ewoption(itemo.question.id, itemo)}>新增选项 + + : ""} + {this.state.polls_status === undefined || this.state.polls_status === 1 ? + + (this.state.newoption === false ? + this.Addanotheroption(itemo.question.id)}>新增其他选项 + : "") + : ""} + + this.Deleteadddom(indexo)}>取消 + this.Deleteadddomthree(indexo, itemo)}>保存 + this.Deleteadddomtwo(indexo, itemo)}>保存并继续 + +
+
- + + ) + + + : itemo.question.question_type === 2 ? ( + //////////////////////////////////////////// 可选 +
+
+
+ 可选 +
+ {/*可选最小*/} + + + ~ + {/*可选最大*/} + + + (学生答题时,系统对其选择的选项个数进行限制,--表示不限制) +
+ +
+
+
+ ) + + : (
) + + } +
+
+ {itemo.question.question_type === 2 ? + ( + this.state.polls_status === undefined || this.state.polls_status === 1 ? +
+ +
this.Ewoption(itemo.question.id, itemo)}>新增选项 + + { + this.state.newoption === false ? this.Addanotheroption(itemo.question.id)}>新增其他选项 : "" + } + +
+ + + this.deleteadddom(indexo)}>取消 + onClick={() => this.Deleteadddom(indexo)}>取消 this.deleteadddomthree(indexo, itemo)}>保存 + onClick={() => this.Deleteadddomthree(indexo, itemo)}>保存 this.deleteadddomtwo(indexo, itemo)}>保存并继续 + onClick={() => this.Deleteadddomtwo(indexo, itemo)}>保存并继续 -
+
- : -
+ : +
this.deleteadddom(indexo)}>取消 + onClick={() => this.Deleteadddom(indexo)}>取消 this.deleteadddomthree(indexo, itemo)}>保存 + onClick={() => this.Deleteadddomthree(indexo, itemo)}>保存 this.deleteadddomtwo(indexo, itemo)}>保存并继续 + onClick={() => this.Deleteadddomtwo(indexo, itemo)}>保存并继续 -
- ) +
+ ) - : itemo.question.question_type === 3 ? -
+ : itemo.question.question_type === 3 ? +
this.deleteadddom(indexo)}>取消 + onClick={() => this.Deleteadddom(indexo)}>取消 this.deleteadddomthree(indexo, itemo)}>保存 + onClick={() => this.Deleteadddomthree(indexo, itemo)}>保存 this.deleteadddomtwo(indexo, itemo)}>保存并继续 + onClick={() => this.Deleteadddomtwo(indexo, itemo)}>保存并继续 -
- : - ""} +
+ : + ""} -
-
+
+
+ + return ( +
+ {resultDomtwo} +
+ ) + })} +
) : (
)} + return (
- {resultDomtwo} + {resultDom}
) })} - {/**************************************************************************/} + +
{polls_status === undefined || polls_status === 1 ?
{ @@ -2820,24 +3298,24 @@ class PollNew extends Component { className="iconfont icon-tianjiafangda font-15 mr10">主观题
- : "" :
-
- this.addmysingles()}>单选题 - this.addmydoubles()}>多选题 - this.addmymainsint()}>主观题 -
+
+ this.addmysingles()}>单选题 + this.addmydoubles()}>多选题 + this.addmymainsint()}>主观题 +
} :
} + { this.props.match.params.news === "new" ? (this.state.Newedit === false ? diff --git a/public/react/src/modules/courses/poll/components/Editingcomponent.js b/public/react/src/modules/courses/poll/components/Editingcomponent.js new file mode 100644 index 000000000..5a27a42e2 --- /dev/null +++ b/public/react/src/modules/courses/poll/components/Editingcomponent.js @@ -0,0 +1,332 @@ +import React, {Component} from "react"; +import '../pollStyle.css' +import {Input, Tooltip, Checkbox, Radio, Select} from 'antd' +import {WordsBtn, ActionBtn} from 'educoder' +const TextArea = Input.TextArea +const RadioGroup = Radio.Group +const CheckboxGroup = Checkbox.Group +class Editingcomponent extends Component { + + constructor(props) { + super(props); + this.state = { + adddom:this.props.adddom, + Newedit:this.props.Newedit, + } + } + componentWillReceiveProps(nextProps) { + const { adddom } = this.state + const newdata = nextProps.adddom.toString() + if (adddom.toString() !== newdata) { + this.setState({ + adddom: nextProps.adddom, + }) + } + } + // componentWillReceiveProps(nextProps) { + // // console.log("46"); + // // console.log(nextProps); + // // console.log(this.props); + // if (nextProps.adddom != this.props.adddom) { + // // console.log("50"); + // // console.log(nextProps.user); + // if (nextProps.adddom !== undefined) { + // // console.log("53"); + // // console.log(nextProps.user); + // this.setState({ + // adddom: nextProps.adddom, + // }) + // } + // + // + // } + // } + + OnCheckAllChange =(e, indexo)=>{ + this.props.OnCheckAllChange(e, indexo); + } + + HandleInputTopic = (e, indexo)=>{ + this.props.HandleInputTopic(e, indexo); + + } + + Deleteentrys=(id, i, stirngname)=>{ + this.props.Deleteentrys(id, i, stirngname); + } + + HandleInputChanges=(e, i, k)=>{ + console.log("handleInputChanges"+" "+e); + console.log("handleInputChanges"+" "+i); + console.log("handleInputChanges"+" "+k); + + this.props.HandleInputChanges(e, i, k); + } + + Ewoption = (id, object) => { + this.props.Ewoption(id, object) + } + + Addanotheroption = (id) => { + this.props.Addanotheroption(id); + } + Deleteadddom = (indexo) => { + this.props.Deleteadddom(indexo); + } + Deleteadddomthree= (indexo, object)=>{ + this.props.Deleteadddomthree(indexo, object); + } + Deleteadddomtwo =(indexo, object)=>{ + this.props.Deleteadddomtwo(indexo, object); + } + HandleGradationGroupChangee = (value, index, max, length) => { + this.props.HandleGradationGroupChangee(value, index, max, length); + } + HandleGradationGroupChangeee= (value, index) => { + this.props.HandleGradationGroupChangeee(value, index); + } + + render() { + return ( +
+ {this.state.adddom === undefined ? "" : this.state.adddom.map((itemo, indexo) => { + let arrid = itemo.question.id; + let resultDomtwo; + resultDomtwo = +
+ {itemo.question.question_type === 1 ? "单选题" : itemo.question.question_type === 2 ? "多选题" : "主观题"} + this.OnCheckAllChange(e, indexo)} + className="lineh-40" + style={{"marginLeft": "20px"}}>必答 + + + + + {itemo.question.answers === undefined ? "" : itemo.question.answers.map((itemt, indext) => { + return ( +
+ {itemt.answer_text === undefined ? ( +
) : itemt.answer_text === "其他" ? ( +

+ 其它 + + + {this.state.polls_status === undefined || this.state.polls_status === 1 ? + this.Deleteentrys(arrid, indext, true)}> + : ""} +

) : (

+ 选项 + + + {this.state.polls_status === undefined || this.state.polls_status === 1 ? + this.Deleteentrys(arrid, indext, false)}> + : ""} +

)} +
+ ) + })} + +
+ {itemo.question.question_type === 1 ? ( +
+
+ {this.state.polls_status === undefined || this.state.polls_status === 1 ? + this.Ewoption(itemo.question.id, itemo)}>新增选项 + + : ""} + {this.state.polls_status === undefined || this.state.polls_status === 1 ? + + (this.state.newoption === false ? + this.Addanotheroption(itemo.question.id)}>新增其他选项 + : "") + : ""} + + this.Deleteadddom(indexo)}>取消 + this.Deleteadddomthree(indexo, itemo)}>保存 + this.Deleteadddomtwo(indexo, itemo)}>保存并继续 + +
+
+ + + ) + + + : itemo.question.question_type === 2 ? ( + //////////////////////////////////////////// 可选 +
+
+
+ 可选 +
+ {/*可选最小*/} + + + ~ + {/*可选最大*/} + + + (学生答题时,系统对其选择的选项个数进行限制,--表示不限制) +
+ +
+
+
+ ) + + : (
) + + } +
+
+ {itemo.question.question_type === 2 ? + ( + this.state.polls_status === undefined || this.state.polls_status === 1 ? +
+ +
this.Ewoption(itemo.question.id, itemo)}>新增选项 + + { + this.state.newoption === false ? this.Addanotheroption(itemo.question.id)}>新增其他选项 : "" + } + +
+ + + + this.Deleteadddom(indexo)}>取消 + this.Deleteadddomthree(indexo, itemo)}>保存 + this.Deleteadddomtwo(indexo, itemo)}>保存并继续 + +
+ + + : +
+ + this.Deleteadddom(indexo)}>取消 + this.Deleteadddomthree(indexo, itemo)}>保存 + this.Deleteadddomtwo(indexo, itemo)}>保存并继续 + +
+ ) + + : itemo.question.question_type === 3 ? +
+ + this.Deleteadddom(indexo)}>取消 + this.Deleteadddomthree(indexo, itemo)}>保存 + this.Deleteadddomtwo(indexo, itemo)}>保存并继续 + +
+ : + ""} + + +
+
+ + + return ( +
+ {resultDomtwo} +
+ ) + })} +
+ ) + + } +} +export default (Editingcomponent); diff --git a/public/react/src/modules/courses/poll/pollStyle.css b/public/react/src/modules/courses/poll/pollStyle.css index ffe13eb10..27a88b95e 100644 --- a/public/react/src/modules/courses/poll/pollStyle.css +++ b/public/react/src/modules/courses/poll/pollStyle.css @@ -1,342 +1,345 @@ -/* 单选或多选 */ -.ant-form{ - color:#05101A; -} -.ant-radio-disabled + span,.ant-checkbox-disabled + span{ - color: #666!important; - cursor: default -} -.ant-radio-wrapper { - color: #666!important; -} -.ant-checkbox-wrapper + .ant-checkbox-wrapper{ - margin-left: 0px!important; -} -/* 下拉 */ -.ant-select-selection,.ant-select-selection-selected-value{ - min-height: 40px; - min-line-height: 40px; -} - -/* 选答 */ -.chooseAnswer{ - display: inline-block; - width: 68px; - text-align: center; - height: 24px; - line-height: 24px; - background: #EDEDED; - color: #666; - margin-left: 10px; - border-radius: 12px; -} - -.problemShow{ - padding:30px; - border-bottom: 1px solid #eee; -} -.problemShow:last-child{ - border-bottom: none; -} - -/* 问卷详情 */ -/* 答题列表 */ -.unlimit{ - height: 24px; - line-height: 24px; - padding:0px 10px; - border-radius: 12px; - cursor: pointer; - border:1px solid #cdcdcd; - color:#666; -} -.unlimit.active{ - background-color: #4CACFF; - border:1px solid #4CACFF; - color: #fff; -} -.edu-table thead th,.edu-table tbody tr:last-child td{ - border-bottom: none!important; -} -.edu-table tbody tr:hover td{ - background-color: #fff!important; -} -/* 统计结果 */ -.countList p.countHeader{ - background-color: #f8f8f8; - color: #666; - height: 38px; - font-size: 16px; - justify-content: center; - align-items: center; - display: -webkit-flex; -} -.countList p.countHeader ul{ - width: 100%; - padding:0px 30px -} -.countList p.countHeader span,.countList div.countBody span{ - float: left; -} -.countList div.countBody{ - margin:0px 30px; - border-bottom:1px solid #EBEBEB; - padding:12px 0px; -} -.countList div.countBody:last-child{ - border-bottom: none; -} -.countList p.countHeader span:nth-child(1),.countList div.countBody span:nth-child(1){ - width: 50%; - text-align: left; -} -.countList p.countHeader span:nth-child(2),.countList div.countBody span:nth-child(2){ - width:15%; - text-align: center; -} -.countList p.countHeader span:nth-child(3),.countList div.countBody span:nth-child(3){ - width:35%; - text-align: left; -} -.percentForm{ - width: 340px; - height: 11px; - background: #F5F5F5; - border-radius: 6px; - position: relative; - margin-top: 7px; -} -.percentValue{ - position: absolute; - top:0px; - left: 0px; - height: 11px; - background: #29BD8B; - border-radius: 6px; -} -.answerTxt{ - max-height: 500px; - background-color: #F2F9FF; - width: 100%; - margin-top: 10px; - padding:10px; - box-sizing: border-box; - color: #4c4c4c; -} -.otherTxt{ - border:none!important; - border-bottom: 1px solid #eee!important; - background: transparent!important; - flex:1; - height: 20px!important; - line-height: 20px!important; -} -.otherTxt.ant-input:hover,.otherTxt.ant-input:focus{ - border:none!important; - border-bottom: 1px solid #eee!important; - background: #F8F8F8!important; -} - -/* 必答 */ -.mustAnswer{ - padding:0px 10px; - border-radius: 15px; - height: 22px; - line-height: 22px; - background: #eaeaea; - color: #999; - font-size: 14px; -} -/* 问卷内容 */ -.previewList{ - border-bottom: 1px solid #ebebeb; -} -.previewList:last-child{ - border-bottom:none; -} -.textLine{ - flex: 1; - height:22px; - border-bottom: 1px solid #ebebeb; -} -.answerList{ - box-sizing: border-box; - width: 100%; - margin-bottom: 20px; -} -.answerList li{ - padding:10px 30px; - box-sizing: border-box; - line-height:20px; - width: 100%; -} -.answerList li:hover{ - background: #F8F8F8; -} -textarea:read-only{ - background: #f3f3f3; -} -.ant-calendar-picker-input{ - height: 40px; -} - -/* 问卷答题 */ -.questionsNo{ - position: relative; - padding: 30px; - border-bottom: 1px solid #ebebeb; -} -.questionsfixed{ - position: fixed; - padding: 30px; - z-index: 12; - top: 60px; - width: 1200px; - background: #fff; -} -.answered,.unanswer,.answerTure,.answerFalse,.answerHalf{ - position: relative; -} -.answered::after{ - position: absolute; - right:35px; - top:4px; - width: 12px; - height: 12px; - border-radius: 50%; - background: #CBCBCB; - content: ""; -} -.unanswer::after{ - position: absolute; - right:35px; - top:4px; - width: 12px; - height: 12px; - border-radius: 50%; - background: #fff; - content: ""; - border:1px solid rgba(203,203,203,1); -} -.answerTure::after{ - position: absolute; - right:35px; - top:4px; - width: 20px; - height: 10px; - border-radius: 5px; - background: #29BD8B; - content: ""; -} -.answerFalse::after{ - position: absolute; - right:35px; - top:4px; - width: 20px; - height: 10px; - border-radius: 5px; - background: #FF3756; - content: ""; -} -.color-red{color: #FF3756!important} -.answerHalf::after{ - position: absolute; - left:-25px; - top:4px; - width: 20px; - height: 10px; - border-radius: 5px; - background: #FF6800; - content: ""; -} -.leaderNav,.leaderMainNav{ - margin-top: 20px; -} -.leaderNav a,.leaderMainNav a{ - display: block; - float: left; - margin-right: 10px; - border-radius: 50%; - border:1px solid #CBCBCB; - height: 40px; - line-height: 40px; - width: 40px; - text-align: center; - color: #999999; - cursor: pointer; - margin-bottom: 5px; -} -.leaderMainNav a{ - background: #FF3756; - color: #fff; - border:1px solid #FF3756; -} -.leaderNav a.acted{ - background:rgba(203,203,203,1); - color: #fff; -} -.leaderMainNav a.acted{ - background-color: #29BD8B; - color: #fff; - border:1px solid #29BD8B; -} -.leaderMainNav a.half{ - background-color: #FF6800; - color: #fff; - border:1px solid #FF6800; -} - -/* 问卷设置 */ -.pollForm .ant-form-item-control{ - line-height: 20px; -} -.pollForm.ant-form-item{ - margin-bottom: 0px -} -.setInfo .ant-select-selection__rendered{ - line-height: 40px; -} - -/* 下拉搜索框 */ -.ant-select-dropdown-menu .ant-select-dropdown-menu-item{ - padding:5px 15px; -} -.ant-select-dropdown.ant-select-dropdown--multiple .ant-select-dropdown-menu-item .ant-select-selected-icon{ - right: 15px; -} - -.noticeTip{ - border:1px solid #FF0000; - border-radius: 5px; -} - -/* 试卷 */ -.setScoreInput{ - width: 60px!important;height: 30px!important;box-sizing: border-box; - text-align: center!important; - background: #F8F8F8; - color:#666; -} -.setScoreInput:focus{ - background: #fff; - color:#FF6800 -} -.standardAnswer p{ - line-height: 20px!important; -} -/* 倒计时 */ -.remainingTime li{ - float: left; - width: 40px; - line-height: 40px; - background-color: #111C24; - color: #fff; - border-radius: 4px; - text-align: center -} -.remainingTime span{ - float: left; - width: 20px; - line-height: 40px; - text-align: center; -} +/* 单选或多选 */ +.ant-form{ + color:#05101A; +} +.ant-radio-disabled + span,.ant-checkbox-disabled + span{ + color: #666!important; + cursor: default +} +.ant-radio-wrapper { + color: #666!important; +} +.ant-checkbox-wrapper + .ant-checkbox-wrapper{ + margin-left: 0px!important; +} +/* 下拉 */ +.ant-select-selection,.ant-select-selection-selected-value{ + min-height: 40px; + min-line-height: 40px; +} + +/* 选答 */ +.chooseAnswer{ + display: inline-block; + width: 68px; + text-align: center; + height: 24px; + line-height: 24px; + background: #EDEDED; + color: #666; + margin-left: 10px; + border-radius: 12px; +} + +.problemShow{ + padding:30px; + border-bottom: 1px solid #eee; +} +.problemShow:last-child{ + border-bottom: none; +} + +/* 问卷详情 */ +/* 答题列表 */ +.unlimit{ + height: 24px; + line-height: 24px; + padding:0px 10px; + border-radius: 12px; + cursor: pointer; + border:1px solid #cdcdcd; + color:#666; +} +.unlimit.active{ + background-color: #4CACFF; + border:1px solid #4CACFF; + color: #fff; +} +.edu-table thead th,.edu-table tbody tr:last-child td{ + border-bottom: none!important; +} +.edu-table tbody tr:hover td{ + background-color: #fff!important; +} +/* 统计结果 */ +.countList p.countHeader{ + background-color: #f8f8f8; + color: #666; + height: 38px; + font-size: 16px; + justify-content: center; + align-items: center; + display: -webkit-flex; +} +.countList p.countHeader ul{ + width: 100%; + padding:0px 30px +} +.countList p.countHeader span,.countList div.countBody span{ + float: left; +} +.countList div.countBody{ + margin:0px 30px; + border-bottom:1px solid #EBEBEB; + padding:12px 0px; +} +.countList div.countBody:last-child{ + border-bottom: none; +} +.countList p.countHeader span:nth-child(1),.countList div.countBody span:nth-child(1){ + width: 50%; + text-align: left; +} +.countList p.countHeader span:nth-child(2),.countList div.countBody span:nth-child(2){ + width:15%; + text-align: center; +} +.countList p.countHeader span:nth-child(3),.countList div.countBody span:nth-child(3){ + width:35%; + text-align: left; +} +.percentForm{ + width: 340px; + height: 11px; + background: #F5F5F5; + border-radius: 6px; + position: relative; + margin-top: 7px; +} +.percentValue{ + position: absolute; + top:0px; + left: 0px; + height: 11px; + background: #29BD8B; + border-radius: 6px; +} +.answerTxt{ + max-height: 500px; + background-color: #F2F9FF; + width: 100%; + margin-top: 10px; + padding:10px; + box-sizing: border-box; + color: #4c4c4c; +} +.otherTxt{ + border:none!important; + border-bottom: 1px solid #eee!important; + background: transparent!important; + flex:1; + height: 20px!important; + line-height: 20px!important; +} +.otherTxt.ant-input:hover,.otherTxt.ant-input:focus{ + border:none!important; + border-bottom: 1px solid #eee!important; + background: #F8F8F8!important; +} + +/* 必答 */ +.mustAnswer{ + padding:0px 10px; + border-radius: 15px; + height: 22px; + line-height: 22px; + background: #eaeaea; + color: #999; + font-size: 14px; +} +/* 问卷内容 */ +.previewList{ + border-bottom: 1px solid #ebebeb; +} +.previewList:last-child{ + border-bottom:none; +} +.textLine{ + flex: 1; + height:22px; + border-bottom: 1px solid #ebebeb; +} +.answerList{ + box-sizing: border-box; + width: 100%; + margin-bottom: 20px; +} +.answerList li{ + padding:10px 30px; + box-sizing: border-box; + line-height:20px; + width: 100%; +} +.answerList li:hover{ + background: #F8F8F8; +} +textarea:read-only{ + background: #f3f3f3; +} +.ant-calendar-picker-input{ + height: 40px; +} + +/* 问卷答题 */ +.questionsNo{ + position: relative; + padding: 30px; + border-bottom: 1px solid #ebebeb; +} +.questionsfixed{ + position: fixed; + padding: 30px; + z-index: 12; + top: 60px; + width: 1200px; + background: #fff; +} +.answered,.unanswer,.answerTure,.answerFalse,.answerHalf{ + position: relative; +} +.answered::after{ + position: absolute; + right:35px; + top:4px; + width: 12px; + height: 12px; + border-radius: 50%; + background: #CBCBCB; + content: ""; +} +.unanswer::after{ + position: absolute; + right:35px; + top:4px; + width: 12px; + height: 12px; + border-radius: 50%; + background: #fff; + content: ""; + border:1px solid rgba(203,203,203,1); +} +.answerTure::after{ + position: absolute; + right:35px; + top:4px; + width: 20px; + height: 10px; + border-radius: 5px; + background: #29BD8B; + content: ""; +} +.answerFalse::after{ + position: absolute; + right:35px; + top:4px; + width: 20px; + height: 10px; + border-radius: 5px; + background: #FF3756; + content: ""; +} +.color-red{color: #FF3756!important} +.answerHalf::after{ + position: absolute; + left:-25px; + top:4px; + width: 20px; + height: 10px; + border-radius: 5px; + background: #FF6800; + content: ""; +} +.leaderNav,.leaderMainNav{ + margin-top: 20px; +} +.leaderNav a,.leaderMainNav a{ + display: block; + float: left; + margin-right: 10px; + border-radius: 50%; + border:1px solid #CBCBCB; + height: 40px; + line-height: 40px; + width: 40px; + text-align: center; + color: #999999; + cursor: pointer; + margin-bottom: 5px; +} +.leaderMainNav a{ + background: #FF3756; + color: #fff; + border:1px solid #FF3756; +} +.leaderNav a.acted{ + background:rgba(203,203,203,1); + color: #fff; +} +.leaderMainNav a.acted{ + background-color: #29BD8B; + color: #fff; + border:1px solid #29BD8B; +} +.leaderMainNav a.half{ + background-color: #FF6800; + color: #fff; + border:1px solid #FF6800; +} + +/* 问卷设置 */ +.pollForm .ant-form-item-control{ + line-height: 20px; +} +.pollForm.ant-form-item{ + margin-bottom: 0px +} +.setInfo .ant-select-selection__rendered{ + line-height: 40px; +} + +/* 下拉搜索框 */ +.ant-select-dropdown-menu .ant-select-dropdown-menu-item{ + padding:5px 15px; +} +.ant-select-dropdown.ant-select-dropdown--multiple .ant-select-dropdown-menu-item .ant-select-selected-icon{ + right: 15px; +} + +.noticeTip{ + border:1px solid #FF0000; + border-radius: 5px; +} + +/* 试卷 */ +.setScoreInput{ + width: 60px!important;height: 30px!important;box-sizing: border-box; + text-align: center!important; + background: #F8F8F8; + color:#666; +} +.setScoreInput:focus{ + background: #fff; + color:#FF6800 +} +.standardAnswer p{ + line-height: 20px!important; +} +/* 倒计时 */ +.remainingTime li{ + float: left; + width: 40px; + line-height: 40px; + background-color: #111C24; + color: #fff; + border-radius: 4px; + text-align: center +} +.remainingTime span{ + float: left; + width: 20px; + line-height: 40px; + text-align: center; +} +.myyslwidth { + min-width:1200px +} \ No newline at end of file From fb867c7d08ecfaa09616781227488b52fbef7224 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Tue, 9 Jul 2019 15:50:41 +0800 Subject: [PATCH 10/15] b --- .../react/src/modules/courses/poll/PollNew.js | 1 - .../poll/components/Editingcomponent.js | 332 ------------------ 2 files changed, 333 deletions(-) delete mode 100644 public/react/src/modules/courses/poll/components/Editingcomponent.js diff --git a/public/react/src/modules/courses/poll/PollNew.js b/public/react/src/modules/courses/poll/PollNew.js index 39a16e8a6..a3513db40 100644 --- a/public/react/src/modules/courses/poll/PollNew.js +++ b/public/react/src/modules/courses/poll/PollNew.js @@ -9,7 +9,6 @@ import '../css/Courses.css' import axios from 'axios' import moment from "../new/CoursesNew"; import Modals from "../../modals/Modals"; -import Editingcomponent from "./components/Editingcomponent" const TextArea = Input.TextArea const RadioGroup = Radio.Group diff --git a/public/react/src/modules/courses/poll/components/Editingcomponent.js b/public/react/src/modules/courses/poll/components/Editingcomponent.js deleted file mode 100644 index 5a27a42e2..000000000 --- a/public/react/src/modules/courses/poll/components/Editingcomponent.js +++ /dev/null @@ -1,332 +0,0 @@ -import React, {Component} from "react"; -import '../pollStyle.css' -import {Input, Tooltip, Checkbox, Radio, Select} from 'antd' -import {WordsBtn, ActionBtn} from 'educoder' -const TextArea = Input.TextArea -const RadioGroup = Radio.Group -const CheckboxGroup = Checkbox.Group -class Editingcomponent extends Component { - - constructor(props) { - super(props); - this.state = { - adddom:this.props.adddom, - Newedit:this.props.Newedit, - } - } - componentWillReceiveProps(nextProps) { - const { adddom } = this.state - const newdata = nextProps.adddom.toString() - if (adddom.toString() !== newdata) { - this.setState({ - adddom: nextProps.adddom, - }) - } - } - // componentWillReceiveProps(nextProps) { - // // console.log("46"); - // // console.log(nextProps); - // // console.log(this.props); - // if (nextProps.adddom != this.props.adddom) { - // // console.log("50"); - // // console.log(nextProps.user); - // if (nextProps.adddom !== undefined) { - // // console.log("53"); - // // console.log(nextProps.user); - // this.setState({ - // adddom: nextProps.adddom, - // }) - // } - // - // - // } - // } - - OnCheckAllChange =(e, indexo)=>{ - this.props.OnCheckAllChange(e, indexo); - } - - HandleInputTopic = (e, indexo)=>{ - this.props.HandleInputTopic(e, indexo); - - } - - Deleteentrys=(id, i, stirngname)=>{ - this.props.Deleteentrys(id, i, stirngname); - } - - HandleInputChanges=(e, i, k)=>{ - console.log("handleInputChanges"+" "+e); - console.log("handleInputChanges"+" "+i); - console.log("handleInputChanges"+" "+k); - - this.props.HandleInputChanges(e, i, k); - } - - Ewoption = (id, object) => { - this.props.Ewoption(id, object) - } - - Addanotheroption = (id) => { - this.props.Addanotheroption(id); - } - Deleteadddom = (indexo) => { - this.props.Deleteadddom(indexo); - } - Deleteadddomthree= (indexo, object)=>{ - this.props.Deleteadddomthree(indexo, object); - } - Deleteadddomtwo =(indexo, object)=>{ - this.props.Deleteadddomtwo(indexo, object); - } - HandleGradationGroupChangee = (value, index, max, length) => { - this.props.HandleGradationGroupChangee(value, index, max, length); - } - HandleGradationGroupChangeee= (value, index) => { - this.props.HandleGradationGroupChangeee(value, index); - } - - render() { - return ( -
- {this.state.adddom === undefined ? "" : this.state.adddom.map((itemo, indexo) => { - let arrid = itemo.question.id; - let resultDomtwo; - resultDomtwo = -
- {itemo.question.question_type === 1 ? "单选题" : itemo.question.question_type === 2 ? "多选题" : "主观题"} - this.OnCheckAllChange(e, indexo)} - className="lineh-40" - style={{"marginLeft": "20px"}}>必答 - - - - - {itemo.question.answers === undefined ? "" : itemo.question.answers.map((itemt, indext) => { - return ( -
- {itemt.answer_text === undefined ? ( -
) : itemt.answer_text === "其他" ? ( -

- 其它 - - - {this.state.polls_status === undefined || this.state.polls_status === 1 ? - this.Deleteentrys(arrid, indext, true)}> - : ""} -

) : (

- 选项 - - - {this.state.polls_status === undefined || this.state.polls_status === 1 ? - this.Deleteentrys(arrid, indext, false)}> - : ""} -

)} -
- ) - })} - -
- {itemo.question.question_type === 1 ? ( -
-
- {this.state.polls_status === undefined || this.state.polls_status === 1 ? - this.Ewoption(itemo.question.id, itemo)}>新增选项 - - : ""} - {this.state.polls_status === undefined || this.state.polls_status === 1 ? - - (this.state.newoption === false ? - this.Addanotheroption(itemo.question.id)}>新增其他选项 - : "") - : ""} - - this.Deleteadddom(indexo)}>取消 - this.Deleteadddomthree(indexo, itemo)}>保存 - this.Deleteadddomtwo(indexo, itemo)}>保存并继续 - -
-
- - - ) - - - : itemo.question.question_type === 2 ? ( - //////////////////////////////////////////// 可选 -
-
-
- 可选 -
- {/*可选最小*/} - - - ~ - {/*可选最大*/} - - - (学生答题时,系统对其选择的选项个数进行限制,--表示不限制) -
- -
-
-
- ) - - : (
) - - } -
-
- {itemo.question.question_type === 2 ? - ( - this.state.polls_status === undefined || this.state.polls_status === 1 ? -
- -
this.Ewoption(itemo.question.id, itemo)}>新增选项 - - { - this.state.newoption === false ? this.Addanotheroption(itemo.question.id)}>新增其他选项 : "" - } - -
- - - - this.Deleteadddom(indexo)}>取消 - this.Deleteadddomthree(indexo, itemo)}>保存 - this.Deleteadddomtwo(indexo, itemo)}>保存并继续 - -
- - - : -
- - this.Deleteadddom(indexo)}>取消 - this.Deleteadddomthree(indexo, itemo)}>保存 - this.Deleteadddomtwo(indexo, itemo)}>保存并继续 - -
- ) - - : itemo.question.question_type === 3 ? -
- - this.Deleteadddom(indexo)}>取消 - this.Deleteadddomthree(indexo, itemo)}>保存 - this.Deleteadddomtwo(indexo, itemo)}>保存并继续 - -
- : - ""} - - -
-
- - - return ( -
- {resultDomtwo} -
- ) - })} -
- ) - - } -} -export default (Editingcomponent); From 083c6f8b5244e65ae611a965e028a587ad6cb871 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Tue, 9 Jul 2019 16:37:50 +0800 Subject: [PATCH 11/15] =?UTF-8?q?=E5=88=86=E7=8F=AD=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E5=B0=81=E8=A3=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../courses/members/CourseGroupChooser.js | 80 +++++++++++++++++++ .../modules/courses/members/teacherList.js | 62 ++++---------- 2 files changed, 96 insertions(+), 46 deletions(-) create mode 100644 public/react/src/modules/courses/members/CourseGroupChooser.js diff --git a/public/react/src/modules/courses/members/CourseGroupChooser.js b/public/react/src/modules/courses/members/CourseGroupChooser.js new file mode 100644 index 000000000..7974b70dd --- /dev/null +++ b/public/react/src/modules/courses/members/CourseGroupChooser.js @@ -0,0 +1,80 @@ +import React, { useState, useEffect } from 'react' +import { trigger } from 'educoder' +import { Input, Checkbox } from "antd"; + +function CourseGroupChooser({ course_groups, isAdminOrCreator, item, index, arg_course_groups, checkAllValue + , coursesids, onCheckAllChange, joinCourseGroup }) { + const [state, setState] = useState({counter: 0}) + const [search, setSearch] = useState('') + // useEffect(() => { + // console.log(' cdm') + // return () => { + // console.log(' cwum') + // }; + // // , [state.counter] 加了这个后,onClick就消失了 加错位置了? + // }, [state.counter] ) + // TODO 为什么每次onClick都会执行 cwum + + // const add1ToCounter = () => { + // const newCounterValue = state.counter + 1 + // setState({ counter: newCounterValue }) + // } + + /** + that.state.groupSearchValue + that.setState({groupSearchValue: e.target.value}) + + that.onCheckAllChange(e, item, index) - onCheckAllChange(e, item, index) + that.joinCourseGroup(checkedValues, item, index) - joinCourseGroup(checkedValues, item, index) + + that.state.checkAllArray[index] - checkAllValue + */ + + return ( + + ) +} +export default CourseGroupChooser \ No newline at end of file diff --git a/public/react/src/modules/courses/members/teacherList.js b/public/react/src/modules/courses/members/teacherList.js index a3cc08437..95d5148c9 100644 --- a/public/react/src/modules/courses/members/teacherList.js +++ b/public/react/src/modules/courses/members/teacherList.js @@ -21,6 +21,7 @@ import { from } from "array-flatten"; import AddGraduationGroupModal from './modal/AddGraduationGroupModal' import AddAdminModal from './modal/AddAdminModal' import { ROLE_TEACHER_NUM, ROLE_ASSISTANT_NUM } from './common' +import CourseGroupChooser from './CourseGroupChooser' const Search = Input.Search; const ROLE_ADMIN = "管理员" @@ -95,49 +96,13 @@ function buildColumns(that) { { isAdmin && - {!noGroups && } + {!noGroups && } } ) @@ -328,7 +293,7 @@ class studentsList extends Component{ }); } joinCourseGroup = (ids, item, index) => { - console.log('join ', ids, item) + // console.log('join ', ids, item) const courseId = this.props.match.params.coursesId @@ -663,6 +628,11 @@ class studentsList extends Component{ >
-
+ {filterKey == '1' &&
{ isAdminOrTeacher && hasGraduationModule && 已选 {checkBoxValues.length} 个 } { filterKey == '1' &&
{ hasGraduationModule && isAdminOrTeacher &&
  • @@ -715,7 +685,7 @@ class studentsList extends Component{
  • */}
    } -
    +
    }
    From 0d9a38a8a44153a074243b71f8f6ff88c218510f Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Tue, 9 Jul 2019 17:52:40 +0800 Subject: [PATCH 12/15] drag --- public/react/public/js/js_min_all.js | 27 +++++++++++++++++--- public/react/src/modules/page/MainContent.js | 10 +++++++- 2 files changed, 33 insertions(+), 4 deletions(-) diff --git a/public/react/public/js/js_min_all.js b/public/react/public/js/js_min_all.js index 79134fc55..0d7a8988e 100755 --- a/public/react/public/js/js_min_all.js +++ b/public/react/public/js/js_min_all.js @@ -211,20 +211,35 @@ $(function(){ var FF = !(window.mozInnerScreenX == null); var websshLineHeight = FF ? 19 : 18 - + function throttle(method, delay, duration){ + var timer = null, begin = new Date(); + return function(){ + var context = this, args = arguments, current = new Date(); + clearTimeout(timer); + if(current-begin >= duration){ + method.apply(context, args); + begin = current; + } else { + timer = setTimeout(function(){ + method.apply(context, args); + }, delay); + } + } + } doc.live('mousemove touchmove',function(e){ $(".-brother").show();// 代码行的遮罩显示 if(dragging) { clickX = e.pageX || e.originalEvent.touches[0].pageX;; if(clickX > leftOffset+0&&clickX