From 8aab67c9207fdfcd4271a1b6ed1a8eb601cda164 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Thu, 19 Sep 2019 16:26:52 +0800 Subject: [PATCH 001/200] setting init --- .../EditableCourseSupportSetting.js | 475 ++++++++++++++++++ .../ShowTableCourseSupportSetting.js | 150 ++++++ .../subroute/ecCourseSupportSetting/index.js | 324 ++++++++++++ .../subroute/ecCourseSupportSetting/style.css | 44 ++ 4 files changed, 993 insertions(+) create mode 100644 public/react/src/modules/ecs/subroute/ecCourseSupportSetting/EditableCourseSupportSetting.js create mode 100644 public/react/src/modules/ecs/subroute/ecCourseSupportSetting/ShowTableCourseSupportSetting.js create mode 100644 public/react/src/modules/ecs/subroute/ecCourseSupportSetting/index.js create mode 100644 public/react/src/modules/ecs/subroute/ecCourseSupportSetting/style.css diff --git a/public/react/src/modules/ecs/subroute/ecCourseSupportSetting/EditableCourseSupportSetting.js b/public/react/src/modules/ecs/subroute/ecCourseSupportSetting/EditableCourseSupportSetting.js new file mode 100644 index 000000000..ec5805947 --- /dev/null +++ b/public/react/src/modules/ecs/subroute/ecCourseSupportSetting/EditableCourseSupportSetting.js @@ -0,0 +1,475 @@ +import React, { Component } from 'react'; + +import moment from 'moment' +import { getUrl } from 'educoder' +import { Form, Input, Icon, Button, Select, InputNumber } from 'antd'; +const { TextArea } = Input; +const { Option } = Select; + +let _url_origin = getUrl() +const $ = window.$ +// https://www.educoder.net/stylesheets/css/common.css?1546618720 +if (!window['EcLoaded']) { + $('head').append( $('') + .attr('href', `${_url_origin}/stylesheets/css/common.css?1525440977`) ); + window['EcLoaded'] = true +} + +let id = 0; + + +/** + target_id + position + target_weight + target_contents + + subitem_id + index + subitem_contents + +*/ +const data = +[{"position":0,"target_weight":0.02,"target_contents":"12","standard_grade":2,"subitem_id":"65"},{"position":3,"target_id":"0","target_weight":0.1,"target_contents":"理解数据管理技术和数据库技术的发展,区分不同数据模型的作用和特点,描述数据库系统的类型、结构、数据独立性。","standard_grade":60,"subitem_id":"66"},{"position":4,"target_weight":1,"target_contents":"22","standard_grade":33,"subitem_id":"66"},{"position":11,"target_id":"1","target_weight":0.1,"target_contents":"理解数据管理技术和数据库技术的发展,区分不同数据模型的作用和特点,描述数据库系统的类型、结构、数据独立性。","standard_grade":61,"subitem_id":"65"}] +; +let _data = [ + { + target_id: 0, + position: 1, + target_weight: 0.1, + target_contents: '理解数据管理技术和数据库技术的发展,区分不同数据模型的作用和特点,描述数据库系统的类型、结构、数据独立性。', + standard_grade: 60, + // biyeYaoqiuZhibiaodian: ':能够运用相关的工程基础和专业知识辨别材料生产中出现的技术、工艺、质量等问题', + "subitem_id": 64, + "index": "1-1", + "subitem_contents": "能够运用相关的工程基础和专业知识辨别材料生产中出现的技术、工艺、质量等问题" + }, + { + target_id: 1, + position: 2, + target_weight: 0.1, + target_contents: '理解数据管理技术和数据库技术的发展,区分不同数据模型的作用和特点,描述数据库系统的类型、结构、数据独立性。', + standard_grade: 61, + // biyeYaoqiuZhibiaodian: ':能够运用相关的工程基础和专业知识辨别材料生产中出现的技术、工艺、质量等问题', + "subitem_id": 65, + "index": "1-2", + "subitem_contents": "222能够运用相关的工程基础和专业知识辨别材料生产中出现的技术、工艺、质量等问题" + } +] +const item = {} + +class EditableCourseSupportSetting extends Component { + constructor(props) { + super(props) + this.state = { + addOrDeleting: false, + errorMsg: '' + } + } + onRemove = (k) => { + let fValues = this.props.form.getFieldsValue(); + if ( + // fValues.standard_grade[k] && fValues.standard_grade[k] != 75 + // || fValues.subitem_id[k] + // || + fValues.target_contents[k] + // || fValues.target_weight[k] + ) { + this.props.showModal('提示', '确定要删除吗?', () => { + this.remove(k) + }) + } else { + this.remove(k) + } + } + remove = (k) => { + const { form } = this.props; + // can use data-binding to get + const keys = form.getFieldValue('keys'); + // We need at least one passenger + // if (keys.length === 1) { + // return; + // } + if (keys.length === 1) { + this.setState({ errorMsg: '至少得保留一条数据' }) + return; + } + // 清除悬浮tip + window.$('.data-tip-down').hide() + + console.log('remove :' , k , this.position2Target_idMap[k]) + delete this.position2Target_idMap[k] + // can use data-binding to set + form.setFieldsValue({ + keys: keys.filter(key => key !== k), + }); + } + _reverseMap = (map) => { + let newMap = {} + for (var k in map) { + newMap[map[k]] = k; + } + return newMap + } + addIfNewKeyExist = (newKey, index_arg) => { + this.setState({ addOrDeleting: true }) + const { form } = this.props; + const keys = form.getFieldValue('keys'); + /** + [0,1,2,3] + ['11', '22', '33', '44'] + -> + [0,1,2,3,4] + ['11', '22', empty, '33', '44'] + + */ + const target_weight = form.getFieldValue('target_weight'); + const target_contents = form.getFieldValue('target_contents'); + const standard_grade = form.getFieldValue('standard_grade'); + const subitem_id = form.getFieldValue('subitem_id'); + keys.splice(index_arg, 0, newKey); + + // position2Target_idMap + // {1:2, 2:3, 3:4, 4:6 } --> {1:2, 2:3, 3:7, 4:4, 5:6 } + // 更新key/position 映射到target_id的map + // 两次revers,用这个结构,达到给position加1的效果 + let reverseMap = this._reverseMap(this.position2Target_idMap); + for (let i = index_arg ; i < keys.length; i++) { + if(keys[i] === keys[i+1]) { // 找到开始+1的行 + continue; + } + let target_id = this.position2Target_idMap[keys[i]]; + reverseMap[target_id] = parseInt(reverseMap[target_id]) + 1; + keys[i] = keys[i] + 1; + } + for (let i = 0 ; i < keys.length - 1; i++) { + if (keys[i] == keys[i + 1]) { + debugger; + } + } + this.position2Target_idMap = this._reverseMap(reverseMap); + + + target_weight.splice(newKey, 0, undefined); + target_contents.splice(newKey, 0, undefined); + standard_grade.splice(newKey, 0, undefined); + subitem_id.splice(newKey, 0, undefined); + + setTimeout(() => { + form.setFieldsValue({ + target_weight, + target_contents, + standard_grade, + subitem_id + }); + window.$('.data-tip-down').hide() + this.setState({ addOrDeleting: false }) + + }, 300) + form.setFieldsValue({ + keys: keys + }); + + } + add = (k, index) => { + this.setState({ errorMsg: '' }) + + const { form } = this.props; + // can use data-binding to get + const keys = form.getFieldValue('keys'); + let nextKeys ; + let newKey = k + 1; + + const newKeyIndex = keys.indexOf(newKey) + if (newKeyIndex != -1) { + // 新key存在,将新key位置及以后的row后移,直到找到一个之后的空位置 + this.addIfNewKeyExist(newKey, index) + } else { // 如果这个新key不存在 + // keys[newIndex] = newKey + keys.splice(index === 0 && k === -1 ? 0 : index, 0, newKey); + } + // can use data-binding to set + // important! notify form to detect changes + form.setFieldsValue({ + keys: keys, + }); + } + + handleSubmit = (e) => { + if (!this.props.is_manager) { + this.props.showModal('提示', '您没权限编辑,请联系管理员。') + return; + } + this.setState({ errorMsg: '' }) + e.preventDefault && e.preventDefault(); + this.props.form.validateFieldsAndScroll((err, values) => { + if (!err) { + let keysLen = values.keys.length + if (keysLen < 1) { + this.setState({ errorMsg: '至少得保留一条数据' }) + } + var data = [] + while( keysLen-- ) { + data.push({}) + } + for (var valKey in values) { + + let dataIndex = 0 + values[valKey].forEach( (item,index) => { + let _val = values[valKey][index]; + if (_val || _val == 0) { + data[dataIndex][valKey === 'keys' ? 'position' : valKey] = _val + if (valKey === 'keys' && (this.position2Target_idMap[_val] || this.position2Target_idMap[_val] === 0) ) { + data[dataIndex].target_id = this.position2Target_idMap[_val] + } + dataIndex++; + } + }) + } + + console.log('Received values of form: ', values, data); + + let totalWeight = 0; + values.target_weight.forEach(item => { + if (item) { + totalWeight += item + } + }) + // 精度问题 0.2 + 0.7 = 0.8999999999 + if (parseInt((totalWeight * 100).toFixed(1)) != 100) { + this.setState({ errorMsg: '请先保证权重和等于1' }) + return; + } + + this.props.updateCourseTargets(data) + } else { + + const keyRowNumMap = {} + let rowNum = 1; + for (var key in values.target_contents) { + keyRowNumMap[key] = rowNum; + rowNum++; + } + + // err.target_contents[1].errors[0] + // {message: "请填入目标内容", field: "target_contents[1]"} + for (var key in err) { + for (var _k in err[key]) { + let errorObj = err[key][_k].errors[0]; + + let _key = errorObj.field.match(`[(0-9)]`) + this.setState({ errorMsg: `第${keyRowNumMap[_key]}行,${errorObj.message}` }) + return; + // console.log(`第${keyRowNumMap[_key]}行,${errorObj.message}`); + } + } + } + + + }); + } + + componentDidMount = () => { + this.position2Target_idMap = {} + const { form } = this.props; + + const data = this.props.course_targets + + let target_weight = [] + let target_contents = [] + let standard_grade = [] + // let biyeYaoqiuZhibiaodian = [] + let subitem_id = [] + let keys = [] + + data.forEach(item => { + keys.push(item.position); + target_weight[item.position] = (item.target_weight) + target_contents[item.position] = (item.target_contents); + standard_grade[item.position] = (item.standard_grade); + // biyeYaoqiuZhibiaodian[item.position] = (item.biyeYaoqiuZhibiaodian); + + subitem_id[item.position] = item.subitem_id ? (item.subitem_id).toString() : item.subitem_id; + + this.position2Target_idMap[item.position] = item.target_id + }) + form.setFieldsValue({ + keys + }); + setTimeout(() => { + form.setFieldsValue({ + target_weight, + target_contents, + standard_grade, + // biyeYaoqiuZhibiaodian, + subitem_id, + }); + // this.forceUpdate() + }, 300) + + + } + + + render() { + const { getFieldDecorator, getFieldValue } = this.props.form; + const { requirements } = this.props; + const { addOrDeleting } = this.state; + const formItemLayout = { + labelCol: { + xs: { span: 24 }, + sm: { span: 4 }, + }, + wrapperCol: { + xs: { span: 24 }, + sm: { span: 20 }, + }, + }; + const formItemLayoutWithOutLabel = { + wrapperCol: { + xs: { span: 24, offset: 0 }, + sm: { span: 20, offset: 4 }, + }, + }; + getFieldDecorator('keys', { initialValue: [] }); + const keys = getFieldValue('keys'); + const formItems = keys.map((k, index) => ( +
  • + + { index + 1 } + + {getFieldDecorator(`target_weight[${k}]`, { + // validateTrigger: ['onChange', 'onBlur'], + rules: [{ + required: true, + whitespace: true, + type: 'number', + message: "请填入权重", + }], + })( + + )} + + + {getFieldDecorator(`target_contents[${k}]`, { + // validateTrigger: ['onChange', 'onBlur'], + rules: [{ + required: true, + // whitespace: true, + message: "请填入目标内容", + }], + })( + ' + + $(".newMain").after(html).hide(); + + editormd.markdownToHTML("MDContent", { + htmlDecode: "style,script,iframe", // you can filter tags decode + taskList: true, + tex: true, // 默认不解析 + flowChart: true, // 默认不解析 + sequenceDiagram: true // 默认不解析 + }); +} +function removeElasticLayer(){ + $(".layerContent").hide(); + $(".newMain").show(); +} +window.elasticLayer = elasticLayer +window.doElasticLayer = doElasticLayer +window.removeElasticLayer = removeElasticLayer + class Ecs extends React.Component { render() { From 4e61419e9c8ba7c3b9ba05aa07df502d460056b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Thu, 26 Sep 2019 10:53:09 +0800 Subject: [PATCH 029/200] =?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/src/AppConfig.js | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/public/react/src/AppConfig.js b/public/react/src/AppConfig.js index 4de5d9d88..be734a82e 100644 --- a/public/react/src/AppConfig.js +++ b/public/react/src/AppConfig.js @@ -22,14 +22,14 @@ let hashTimeout // TODO 开发期多个身份切换 let debugType ="" if (isDev) { - const _search = window.location.search; - let parsed = {}; - if (_search) { - parsed = queryString.parse(_search); - } - debugType = window.location.search.indexOf('debug=t') != -1 ? 'teacher' : - window.location.search.indexOf('debug=s') != -1 ? 'student' : - window.location.search.indexOf('debug=a') != -1 ? 'admin' : parsed.debug || 'admin' + const _search = window.location.search; + let parsed = {}; + if (_search) { + parsed = queryString.parse(_search); + } + debugType = window.location.search.indexOf('debug=t') != -1 ? 'teacher' : + window.location.search.indexOf('debug=s') != -1 ? 'student' : + window.location.search.indexOf('debug=a') != -1 ? 'admin' : parsed.debug || 'admin' } window._debugType = debugType; export function initAxiosInterceptors(props) { @@ -83,9 +83,9 @@ export function initAxiosInterceptors(props) { } config.url = `${proxy}${url}`; if (config.url.indexOf('?') == -1) { - config.url = `${config.url}?debug=${'student'}` + config.url = `${config.url}?debug=${'admin'}` } else { - config.url = `${config.url}&debug=${'student'}` + config.url = `${config.url}&debug=${'admin'}` } } else { // 加api前缀 From 7032fa8ea7973fbd8bdc4864d05639815d41ff97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Thu, 26 Sep 2019 11:49:02 +0800 Subject: [PATCH 030/200] =?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/src/modules/ecs/EcSetting/index.js | 8 ++++---- public/react/src/modules/ecs/curriculum/Curriculum.js | 10 +++++----- .../src/modules/ecs/curriculum/CurriculumSubpage.js | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/public/react/src/modules/ecs/EcSetting/index.js b/public/react/src/modules/ecs/EcSetting/index.js index 69d309c46..601c68790 100644 --- a/public/react/src/modules/ecs/EcSetting/index.js +++ b/public/react/src/modules/ecs/EcSetting/index.js @@ -75,11 +75,11 @@ class EcSetting extends React.Component { let type = stepTypes[stepIndex]; this.setState({ stepIndex: stepIndex }); - if(type==="courses"){ - this.props.history.push(`/ecs/major_schools/${majorId}/years/${yearId}/${type}/ec_course_support_setting/1`); - }else { + // if(type==="courses"){ + // this.props.history.push(`/ecs/major_schools/${majorId}/years/${yearId}/${type}/ec_course_support_setting/1`); + // }else { this.props.history.push(`/ecs/major_schools/${majorId}/years/${yearId}/${type}`); - } + // } } setupStep = () => { diff --git a/public/react/src/modules/ecs/curriculum/Curriculum.js b/public/react/src/modules/ecs/curriculum/Curriculum.js index e75d118da..f00589781 100644 --- a/public/react/src/modules/ecs/curriculum/Curriculum.js +++ b/public/react/src/modules/ecs/curriculum/Curriculum.js @@ -233,19 +233,19 @@ class Curriculum extends Component { {/*Curriculumtwo 测试用*/} {/*课程目标*/} - (this.Ontitine(i)} />) }> {/*课程考核方式与数据来源*/} - (this.Ontitine(i)}/>) }> {/*成绩等级设置*/} - (this.Ontitine(i)}/>) }> {/*4课程目标评价方法*/} - (this.Ontitine(i)}/>) }> {/*5课程达成评价结果*/} - (this.Ontitine(i)}/>) }> diff --git a/public/react/src/modules/ecs/curriculum/CurriculumSubpage.js b/public/react/src/modules/ecs/curriculum/CurriculumSubpage.js index 9037705d7..a0df7f63b 100644 --- a/public/react/src/modules/ecs/curriculum/CurriculumSubpage.js +++ b/public/react/src/modules/ecs/curriculum/CurriculumSubpage.js @@ -16,7 +16,7 @@ class CurriculumSubpage extends Component { console.log(this.props.match.params); } Curriculumstructure=()=>{ - this.props.history.push('/ecs/major_schools/:majorId/years/:yearId/subpage/courses') + this.props.history.push(`/ecs/major_schools/${this.props.match.params.majorId}/years/${this.props.match.params.yearId}/subpage/courses`); } From 25941dbcf468c8bb18fc08464fc0db40c273af79 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Thu, 26 Sep 2019 14:59:57 +0800 Subject: [PATCH 031/200] =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../RequirementVsObjective/SelectTable.js | 123 +++++++++++++++ .../EcSetting/RequirementVsObjective/index.js | 144 ++++++++++++++++++ .../react/src/modules/ecs/EcSetting/index.js | 12 +- 3 files changed, 278 insertions(+), 1 deletion(-) create mode 100644 public/react/src/modules/ecs/EcSetting/RequirementVsObjective/SelectTable.js create mode 100644 public/react/src/modules/ecs/EcSetting/RequirementVsObjective/index.js diff --git a/public/react/src/modules/ecs/EcSetting/RequirementVsObjective/SelectTable.js b/public/react/src/modules/ecs/EcSetting/RequirementVsObjective/SelectTable.js new file mode 100644 index 000000000..9e95d9eb8 --- /dev/null +++ b/public/react/src/modules/ecs/EcSetting/RequirementVsObjective/SelectTable.js @@ -0,0 +1,123 @@ +import React, { Component } from 'react'; + +import classNames from 'classnames' + +import axios from 'axios'; + +import { Table, Divider, Tag, Checkbox, InputNumber, Spin, Icon, Tooltip } from 'antd'; + +class SelectTable extends Component { + constructor(props) { + super(props) + this.state={ + + } + } + + componentDidMount(){ + + } + + render() { + const { match, columns, tableData } = this.props + if (!tableData || !tableData.length) return ''; + return ( + + + + + + {columns.map((item, index) => { + if (index == 0) return ; + return ( + + + + ) + })} + {/* + + + + */} + + { tableData.map((item, rowIndex) => { + const cells = item.map((cell, colIndex) => { + if(colIndex == 0) return + + + return ( + + ) + }) + return ( + + {cells} + + ) + })} + {/* + + + + + + + */} + {/* + + + + + + + + + + + + + + + */} + +
    {columns[0][0]}{columns[0][1]}目标{index}目标1目标2目标3目标4目标5
    指标点{rowIndex + 1} this.props.onCellClick(rowIndex, colIndex, !!cell)}> + +
    指标点1 + + + + + + + + + +
    指标点2 + + + + + + + + + +
    指标点3 + + + + + + + + + +
    + + + ); + } +} + +export default (SelectTable) ; diff --git a/public/react/src/modules/ecs/EcSetting/RequirementVsObjective/index.js b/public/react/src/modules/ecs/EcSetting/RequirementVsObjective/index.js new file mode 100644 index 000000000..49b056950 --- /dev/null +++ b/public/react/src/modules/ecs/EcSetting/RequirementVsObjective/index.js @@ -0,0 +1,144 @@ +import React, { Component } from 'react'; + +import classNames from 'classnames' + +import axios from 'axios'; + +import { Table, Divider, Tag, Checkbox, InputNumber, Spin, Icon } from 'antd'; +import SelectTable from './SelectTable' +import update from 'immutability-helper' +const testState = { + "graduation_requirements": [ + { + "id": 1, + "position": 1, + "content": "毕业要求一" + }, + { + "id": 2, + "position": 2, + "content": "毕业要求二" + } + ], + "training_subitems": [ + { + "id": 1, + "content": "培养目标一" + }, + { + "id": 2, + "content": "培养目标二" + } + ], + "requirement_support_objectives": [ + { + "graduation_requirement_id": 1, + "training_subitem_id": 1 + }, + { + "graduation_requirement_id": 2, + "training_subitem_id": 2 + }, + ] +} +class RequirementVsObjective extends Component { + constructor(props) { + super(props) + this.state={ + ...testState + } + } + + componentDidMount(){ + // this.init() + // return; + + const yearId = this.props.match.params.yearId + const url = `/ec_years/${yearId}/requirement_support_objectives.json` + axios.get(url).then((response) => { + if (response.data.graduation_requirements) { + this.setState( {...response.data} , () => { + this.init() + }) + } + }).catch((e) => { + + }) + } + init = () => { + this.graduationRequirementsIdIndexMap = {} + this.trainingSubitemsIdIndexMap = {} + this.state.graduation_requirements.forEach((item, index) => { + this.graduationRequirementsIdIndexMap[item.id] = index + }) + this.state.training_subitems.forEach((item, index) => { + this.trainingSubitemsIdIndexMap[item.id] = index + }) + const tableData = [] + this.state.graduation_requirements.forEach((item, index) => { + tableData.push([item.content, ...Array(this.state.training_subitems.length)]) + }) + this.state.requirement_support_objectives.forEach(item => { + tableData[this.graduationRequirementsIdIndexMap[item.graduation_requirement_id]][this.trainingSubitemsIdIndexMap[item.training_subitem_id]] + = true + }) + this.setState({ tableData }) + } + onCellClick = (rowIndex, colIndex, select) => { + console.log( rowIndex, colIndex, select ) + const ec_graduation_requirement_id = this.state.graduation_requirements[rowIndex].id + const ec_training_subitem_id = this.state.training_subitems[colIndex].id + const yearId = this.props.match.params.yearId + const url = `/ec_years/${yearId}/requirement_support_objectives.json` + const method = select ? axios.delete : axios.post + method(url, + select ? { + params: { + ec_graduation_requirement_id, + ec_training_subitem_id + } + } : { + ec_graduation_requirement_id, + ec_training_subitem_id + } + ).then((response) => { + if (response.data.status == 0) { + this.setState( + (prevState) => ({ + tableData : update(prevState.tableData, {[rowIndex]: {[colIndex]: {$set: select ? false : true}}}) + }) + ) + this.props.showNotification(`${select ? '取消' : '选择'}成功`) + } + }).catch((e) => { + + }) + if (select) { // 取消 + + } else { // 选择 + + } + } + render() { + const { match, history, current_user } = this.props + const { tableData, training_subitems, graduation_requirements, is_manager } = this.state + + const columns = training_subitems && [['毕业要求', '培养目标'], ...training_subitems.map(item => item.content)] + const columnIdIndexMap = {} + console.log(columns, tableData) + return ( + +
    + requirementVsObjective + +
    + + ); + } +} + +export default (RequirementVsObjective) ; diff --git a/public/react/src/modules/ecs/EcSetting/index.js b/public/react/src/modules/ecs/EcSetting/index.js index 69d309c46..fd3ac436a 100644 --- a/public/react/src/modules/ecs/EcSetting/index.js +++ b/public/react/src/modules/ecs/EcSetting/index.js @@ -40,6 +40,11 @@ const ReachCalculationInfo=Loadable({ loader: () => import('./reachCalculationInfo/index'), loading: Loading, }); +const RequirementVsObjective=Loadable({ + loader: () => import('./RequirementVsObjective/index'), + loading: Loading, +}); + class EcSetting extends React.Component { @@ -132,8 +137,13 @@ class EcSetting extends React.Component { render={ (props) => () }> () }> + () }> - + {/* 毕业要求对培养目标的支撑 */} + () }> + {/*学生*/} () }> From 12f28bcfae2766af5905d758d0545bf1eadb5f20 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Thu, 26 Sep 2019 15:08:22 +0800 Subject: [PATCH 032/200] place --- .../modules/ecs/EcSetting/RequirementVsObjective/SelectTable.js | 1 + 1 file changed, 1 insertion(+) diff --git a/public/react/src/modules/ecs/EcSetting/RequirementVsObjective/SelectTable.js b/public/react/src/modules/ecs/EcSetting/RequirementVsObjective/SelectTable.js index 9e95d9eb8..5975cafb3 100644 --- a/public/react/src/modules/ecs/EcSetting/RequirementVsObjective/SelectTable.js +++ b/public/react/src/modules/ecs/EcSetting/RequirementVsObjective/SelectTable.js @@ -43,6 +43,7 @@ class SelectTable extends Component { { tableData.map((item, rowIndex) => { const cells = item.map((cell, colIndex) => { + // placement="bottom" if(colIndex == 0) return 指标点{rowIndex + 1} From 018c2a3ee70ef43106d6cba0cb201e83c9714060 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Thu, 26 Sep 2019 16:16:57 +0800 Subject: [PATCH 033/200] =?UTF-8?q?=E5=88=97=E6=95=B0=E4=B8=8D=E5=AF=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../RequirementVsObjective/SelectTable.js | 2 +- .../EcSetting/RequirementVsObjective/index.js | 17 ++++++++++++++--- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/public/react/src/modules/ecs/EcSetting/RequirementVsObjective/SelectTable.js b/public/react/src/modules/ecs/EcSetting/RequirementVsObjective/SelectTable.js index 5975cafb3..81021cf88 100644 --- a/public/react/src/modules/ecs/EcSetting/RequirementVsObjective/SelectTable.js +++ b/public/react/src/modules/ecs/EcSetting/RequirementVsObjective/SelectTable.js @@ -48,7 +48,7 @@ class SelectTable extends Component { 指标点{rowIndex + 1} return ( - this.props.onCellClick(rowIndex, colIndex, !!cell)}> + this.props.onCellClick(rowIndex, colIndex , !!cell)}> ) diff --git a/public/react/src/modules/ecs/EcSetting/RequirementVsObjective/index.js b/public/react/src/modules/ecs/EcSetting/RequirementVsObjective/index.js index 49b056950..cfd264cbe 100644 --- a/public/react/src/modules/ecs/EcSetting/RequirementVsObjective/index.js +++ b/public/react/src/modules/ecs/EcSetting/RequirementVsObjective/index.js @@ -72,7 +72,8 @@ class RequirementVsObjective extends Component { this.graduationRequirementsIdIndexMap[item.id] = index }) this.state.training_subitems.forEach((item, index) => { - this.trainingSubitemsIdIndexMap[item.id] = index + // 对应table的列数 + this.trainingSubitemsIdIndexMap[item.id] = index + 1 }) const tableData = [] this.state.graduation_requirements.forEach((item, index) => { @@ -87,7 +88,7 @@ class RequirementVsObjective extends Component { onCellClick = (rowIndex, colIndex, select) => { console.log( rowIndex, colIndex, select ) const ec_graduation_requirement_id = this.state.graduation_requirements[rowIndex].id - const ec_training_subitem_id = this.state.training_subitems[colIndex].id + const ec_training_subitem_id = this.state.training_subitems[colIndex - 1].id const yearId = this.props.match.params.yearId const url = `/ec_years/${yearId}/requirement_support_objectives.json` const method = select ? axios.delete : axios.post @@ -129,7 +130,17 @@ class RequirementVsObjective extends Component { return (
    - requirementVsObjective + Date: Thu, 26 Sep 2019 16:30:38 +0800 Subject: [PATCH 034/200] =?UTF-8?q?=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../EcSetting/RequirementVsObjective/index.js | 22 ++++++++++++------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/public/react/src/modules/ecs/EcSetting/RequirementVsObjective/index.js b/public/react/src/modules/ecs/EcSetting/RequirementVsObjective/index.js index cfd264cbe..e4a944d95 100644 --- a/public/react/src/modules/ecs/EcSetting/RequirementVsObjective/index.js +++ b/public/react/src/modules/ecs/EcSetting/RequirementVsObjective/index.js @@ -129,23 +129,29 @@ class RequirementVsObjective extends Component { console.log(columns, tableData) return ( -
    +
    - +
    +

    + 表示支撑 + 表示不支撑 +

    + +
    ); From d7008219e9eba7f5ed5326ee919ffa9cc14b3e25 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Thu, 26 Sep 2019 16:48:40 +0800 Subject: [PATCH 035/200] init --- .../EcSetting/RequirementVsObjective/index.js | 2 +- .../EcSetting/RequirementVsStandard/index.js | 128 ++++++++++++++++++ .../react/src/modules/ecs/EcSetting/index.js | 8 +- 3 files changed, 136 insertions(+), 2 deletions(-) create mode 100644 public/react/src/modules/ecs/EcSetting/RequirementVsStandard/index.js diff --git a/public/react/src/modules/ecs/EcSetting/RequirementVsObjective/index.js b/public/react/src/modules/ecs/EcSetting/RequirementVsObjective/index.js index e4a944d95..dfc4aa663 100644 --- a/public/react/src/modules/ecs/EcSetting/RequirementVsObjective/index.js +++ b/public/react/src/modules/ecs/EcSetting/RequirementVsObjective/index.js @@ -45,7 +45,7 @@ class RequirementVsObjective extends Component { constructor(props) { super(props) this.state={ - ...testState + // ...testState } } diff --git a/public/react/src/modules/ecs/EcSetting/RequirementVsStandard/index.js b/public/react/src/modules/ecs/EcSetting/RequirementVsStandard/index.js new file mode 100644 index 000000000..45ea17811 --- /dev/null +++ b/public/react/src/modules/ecs/EcSetting/RequirementVsStandard/index.js @@ -0,0 +1,128 @@ +import React, { Component } from 'react'; + +import classNames from 'classnames' + +import axios from 'axios'; + +import { Table, Divider, Tag, Checkbox, InputNumber, Spin, Icon } from 'antd'; +import SelectTable from '../RequirementVsObjective/SelectTable' +import update from 'immutability-helper' + +class RequirementVsObjective extends Component { + constructor(props) { + super(props) + this.state={ + + } + } + + componentDidMount(){ + // this.init() + // return; + + const yearId = this.props.match.params.yearId + const url = `/ec_years/${yearId}/requirement_support_objectives.json` + axios.get(url).then((response) => { + if (response.data.graduation_requirements) { + this.setState( {...response.data} , () => { + this.init() + }) + } + }).catch((e) => { + + }) + } + init = () => { + this.graduationRequirementsIdIndexMap = {} + this.trainingSubitemsIdIndexMap = {} + this.state.graduation_requirements.forEach((item, index) => { + this.graduationRequirementsIdIndexMap[item.id] = index + }) + this.state.training_subitems.forEach((item, index) => { + // 对应table的列数 + this.trainingSubitemsIdIndexMap[item.id] = index + 1 + }) + const tableData = [] + this.state.graduation_requirements.forEach((item, index) => { + tableData.push([item.content, ...Array(this.state.training_subitems.length)]) + }) + this.state.requirement_support_objectives.forEach(item => { + tableData[this.graduationRequirementsIdIndexMap[item.graduation_requirement_id]][this.trainingSubitemsIdIndexMap[item.training_subitem_id]] + = true + }) + this.setState({ tableData }) + } + onCellClick = (rowIndex, colIndex, select) => { + console.log( rowIndex, colIndex, select ) + const ec_graduation_requirement_id = this.state.graduation_requirements[rowIndex].id + const ec_training_subitem_id = this.state.training_subitems[colIndex - 1].id + const yearId = this.props.match.params.yearId + const url = `/ec_years/${yearId}/requirement_support_objectives.json` + const method = select ? axios.delete : axios.post + method(url, + select ? { + params: { + ec_graduation_requirement_id, + ec_training_subitem_id + } + } : { + ec_graduation_requirement_id, + ec_training_subitem_id + } + ).then((response) => { + if (response.data.status == 0) { + this.setState( + (prevState) => ({ + tableData : update(prevState.tableData, {[rowIndex]: {[colIndex]: {$set: select ? false : true}}}) + }) + ) + this.props.showNotification(`${select ? '取消' : '选择'}成功`) + } + }).catch((e) => { + + }) + if (select) { // 取消 + + } else { // 选择 + + } + } + render() { + const { match, history, current_user } = this.props + const { tableData, training_subitems, graduation_requirements, is_manager } = this.state + + const columns = training_subitems && [['毕业要求', '培养目标'], ...training_subitems.map(item => item.content)] + const columnIdIndexMap = {} + console.log(columns, tableData) + return ( + +
    + +
    +

    + 表示支撑 + 表示不支撑 +

    + +
    +
    + + ); + } +} + +export default (RequirementVsObjective) ; diff --git a/public/react/src/modules/ecs/EcSetting/index.js b/public/react/src/modules/ecs/EcSetting/index.js index ad3e4caf0..b4a388744 100644 --- a/public/react/src/modules/ecs/EcSetting/index.js +++ b/public/react/src/modules/ecs/EcSetting/index.js @@ -44,7 +44,10 @@ const RequirementVsObjective=Loadable({ loader: () => import('./RequirementVsObjective/index'), loading: Loading, }); - +const RequirementVsStandard=Loadable({ + loader: () => import('./RequirementVsStandard/index'), + loading: Loading, +}); class EcSetting extends React.Component { @@ -143,6 +146,9 @@ class EcSetting extends React.Component { {/* 毕业要求对培养目标的支撑 */} () }> + {/* 毕业要求对通用标准的支撑 */} + () }> {/*学生*/} Date: Thu, 26 Sep 2019 17:22:54 +0800 Subject: [PATCH 036/200] =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../RequirementVsObjective/SelectTable.js | 4 +- .../EcSetting/RequirementVsStandard/index.js | 40 ++++++++++--------- 2 files changed, 24 insertions(+), 20 deletions(-) diff --git a/public/react/src/modules/ecs/EcSetting/RequirementVsObjective/SelectTable.js b/public/react/src/modules/ecs/EcSetting/RequirementVsObjective/SelectTable.js index 81021cf88..9e357aebd 100644 --- a/public/react/src/modules/ecs/EcSetting/RequirementVsObjective/SelectTable.js +++ b/public/react/src/modules/ecs/EcSetting/RequirementVsObjective/SelectTable.js @@ -31,7 +31,7 @@ class SelectTable extends Component { if (index == 0) return {columns[0][0]}{columns[0][1]}; return ( - 目标{index} + {this.props.columnName || '目标'}{index} ) })} @@ -45,7 +45,7 @@ class SelectTable extends Component { const cells = item.map((cell, colIndex) => { // placement="bottom" if(colIndex == 0) return - 指标点{rowIndex + 1} + 指标点{this.props.firstColIndexArray ? this.props.firstColIndexArray[rowIndex] : rowIndex + 1} return ( this.props.onCellClick(rowIndex, colIndex , !!cell)}> diff --git a/public/react/src/modules/ecs/EcSetting/RequirementVsStandard/index.js b/public/react/src/modules/ecs/EcSetting/RequirementVsStandard/index.js index 45ea17811..a1d652cf2 100644 --- a/public/react/src/modules/ecs/EcSetting/RequirementVsStandard/index.js +++ b/public/react/src/modules/ecs/EcSetting/RequirementVsStandard/index.js @@ -21,9 +21,9 @@ class RequirementVsObjective extends Component { // return; const yearId = this.props.match.params.yearId - const url = `/ec_years/${yearId}/requirement_support_objectives.json` + const url = `/ec_years/${yearId}/subitem_support_standards.json` axios.get(url).then((response) => { - if (response.data.graduation_requirements) { + if (response.data.graduation_subitems) { this.setState( {...response.data} , () => { this.init() }) @@ -35,39 +35,41 @@ class RequirementVsObjective extends Component { init = () => { this.graduationRequirementsIdIndexMap = {} this.trainingSubitemsIdIndexMap = {} - this.state.graduation_requirements.forEach((item, index) => { + this.state.graduation_subitems.forEach((item, index) => { this.graduationRequirementsIdIndexMap[item.id] = index }) - this.state.training_subitems.forEach((item, index) => { + this.state.graduation_standards.forEach((item, index) => { // 对应table的列数 this.trainingSubitemsIdIndexMap[item.id] = index + 1 }) const tableData = [] - this.state.graduation_requirements.forEach((item, index) => { - tableData.push([item.content, ...Array(this.state.training_subitems.length)]) + const firstColIndexArray = [] + this.state.graduation_subitems.forEach((item, index) => { + tableData.push([item.content, ...Array(this.state.graduation_standards.length)]) + firstColIndexArray.push(`${item.position}-${item.graduation_requirement_position}`) }) - this.state.requirement_support_objectives.forEach(item => { - tableData[this.graduationRequirementsIdIndexMap[item.graduation_requirement_id]][this.trainingSubitemsIdIndexMap[item.training_subitem_id]] + this.state.subitem_support_standards.forEach(item => { + tableData[this.graduationRequirementsIdIndexMap[item.graduation_subitem_id]][this.trainingSubitemsIdIndexMap[item.graduation_standard_id]] = true }) - this.setState({ tableData }) + this.setState({ tableData, firstColIndexArray }) } onCellClick = (rowIndex, colIndex, select) => { console.log( rowIndex, colIndex, select ) - const ec_graduation_requirement_id = this.state.graduation_requirements[rowIndex].id - const ec_training_subitem_id = this.state.training_subitems[colIndex - 1].id + const ec_graduation_subitem_id = this.state.graduation_subitems[rowIndex].id + const ec_graduation_standard_id = this.state.graduation_standards[colIndex - 1].id const yearId = this.props.match.params.yearId - const url = `/ec_years/${yearId}/requirement_support_objectives.json` + const url = `/ec_years/${yearId}/subitem_support_standards.json` const method = select ? axios.delete : axios.post method(url, select ? { params: { - ec_graduation_requirement_id, - ec_training_subitem_id + ec_graduation_subitem_id, + ec_graduation_standard_id } } : { - ec_graduation_requirement_id, - ec_training_subitem_id + ec_graduation_subitem_id, + ec_graduation_standard_id } ).then((response) => { if (response.data.status == 0) { @@ -89,9 +91,9 @@ class RequirementVsObjective extends Component { } render() { const { match, history, current_user } = this.props - const { tableData, training_subitems, graduation_requirements, is_manager } = this.state + const { tableData, graduation_standards, graduation_subitems, is_manager, firstColIndexArray } = this.state - const columns = training_subitems && [['毕业要求', '培养目标'], ...training_subitems.map(item => item.content)] + const columns = graduation_standards && [['毕业要求', '通用标准'], ...graduation_standards.map(item => item.content)] const columnIdIndexMap = {} console.log(columns, tableData) return ( @@ -116,7 +118,9 @@ class RequirementVsObjective extends Component {
    From 9bd98fb62d5ee4257dc62385f629b1f126d5fc1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Fri, 27 Sep 2019 09:14:40 +0800 Subject: [PATCH 037/200] =?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/src/modules/ecs/curriculum/CurriculumSubpage.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/react/src/modules/ecs/curriculum/CurriculumSubpage.js b/public/react/src/modules/ecs/curriculum/CurriculumSubpage.js index a0df7f63b..a187e688d 100644 --- a/public/react/src/modules/ecs/curriculum/CurriculumSubpage.js +++ b/public/react/src/modules/ecs/curriculum/CurriculumSubpage.js @@ -16,7 +16,7 @@ class CurriculumSubpage extends Component { console.log(this.props.match.params); } Curriculumstructure=()=>{ - this.props.history.push(`/ecs/major_schools/${this.props.match.params.majorId}/years/${this.props.match.params.yearId}/subpage/courses`); + this.props.history.push(`/ecs/major_schools/${this.props.match.params.majorId}/years/${this.props.match.params.yearId}/subpage/courses/ec_course_support_setting/1`); } @@ -25,7 +25,7 @@ class CurriculumSubpage extends Component { // console.log(this.props); return (
    - this.Curriculumstructure()}>测试 + this.Curriculumstructure()}>点我进去课程体系
    ) } From 2e00d1413bf0ce6acf8ea295818a0327961ac021 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Fri, 27 Sep 2019 09:53:38 +0800 Subject: [PATCH 038/200] =?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/favicon.ico | Bin 0 -> 9049 bytes .../src/modules/ecs/curriculum/Curriculum.js | 1 + .../EcCompletionCalculation.js | 7 ++++--- .../EcCourseEvaluationsbottom.js | 16 +++++++++++----- .../subroute/ecCourseSupportSetting/index.js | 11 +++++++++-- 5 files changed, 25 insertions(+), 10 deletions(-) mode change 100644 => 100755 public/favicon.ico diff --git a/public/favicon.ico b/public/favicon.ico old mode 100644 new mode 100755 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..05b9d163e5267afb1d933b189a1d6210fc2fe634 GIT binary patch literal 9049 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 literal 0 HcmV?d00001 diff --git a/public/react/src/modules/ecs/curriculum/Curriculum.js b/public/react/src/modules/ecs/curriculum/Curriculum.js index f00589781..025f6740f 100644 --- a/public/react/src/modules/ecs/curriculum/Curriculum.js +++ b/public/react/src/modules/ecs/curriculum/Curriculum.js @@ -59,6 +59,7 @@ class Curriculum extends Component { // window.document.title = '课程达成评价结果'; } componentDidMount(){ + console.log("Curriculum"); console.log(this.props); } sync_course_data=()=>{ diff --git a/public/react/src/modules/ecs/subroute/ecCompletion_calculation/EcCompletionCalculation.js b/public/react/src/modules/ecs/subroute/ecCompletion_calculation/EcCompletionCalculation.js index 4be7c11d3..7480d3b83 100644 --- a/public/react/src/modules/ecs/subroute/ecCompletion_calculation/EcCompletionCalculation.js +++ b/public/react/src/modules/ecs/subroute/ecCompletion_calculation/EcCompletionCalculation.js @@ -54,9 +54,9 @@ class EcCompletionCalculation extends Component { let ec_course_id =this.props.match.params.ec_course_id; this.UpdateClassData(true); const Url =`/ec_major_schools/get_navigation_data?ec_course_id=`+ec_course_id; - axios.get(Url, { - withCredentials: true, - }) + axios.get(Url, { + withCredentials: true, + }) .then((response) => { if(response.status===200){ // if(response.data.allow_visit===false){ @@ -71,6 +71,7 @@ class EcCompletionCalculation extends Component { .catch(function (error) { console.log(error); }); + this.props.Ontitine("competition_calculation_info"); } targetsget_navigation_data=(ec_year_id,ec_course_id)=>{ diff --git a/public/react/src/modules/ecs/subroute/ecCourseEvaluations/EcCourseEvaluationsbottom.js b/public/react/src/modules/ecs/subroute/ecCourseEvaluations/EcCourseEvaluationsbottom.js index 59a8a560e..afce608f8 100644 --- a/public/react/src/modules/ecs/subroute/ecCourseEvaluations/EcCourseEvaluationsbottom.js +++ b/public/react/src/modules/ecs/subroute/ecCourseEvaluations/EcCourseEvaluationsbottom.js @@ -56,6 +56,7 @@ class EcCourseEvaluationsbottom extends Component { if(newec_course_idbottom!=undefined){ // const url ='ec_courses/:course_id/course_targets.json'; // const url = `/ec_course_achievement_methods?ec_course_id=`+newec_course_idbottom; + const url =`/ec_courses/${course_id}/course_targets/course_achievement_methods.json`; axios.get(url, { withCredentials: true, }) @@ -114,8 +115,10 @@ class EcCourseEvaluationsbottom extends Component { }); } componentDidMount(){ - let ec_course_id=this.props.match.params.ec_course_id; - const url = `/ec_course_achievement_methods?ec_course_id=`+ec_course_id; + let ec_course_id=this.props.match.params.ec_course_id; + const course_id = 706 + const url =`/ec_courses/${course_id}/course_targets/course_achievement_methods.json`; + // const url = `/ec_course_achievement_methods?ec_course_id=`+course_id; axios.get(url, { withCredentials: true, }) @@ -129,10 +132,11 @@ class EcCourseEvaluationsbottom extends Component { console.log(error); }); - this.getNavigationData(ec_course_id); + // this.getNavigationData(ec_course_id); this.setState({ - newec_course_idbottom:ec_course_id + newec_course_idbottom:course_id }) + this.props.Ontitine("evaluation_methods"); } editecCourseEvaluationslist=(e)=>{ let id =e.target.getAttribute("target_id"); @@ -555,7 +559,9 @@ class EcCourseEvaluationsbottom extends Component { } - var Url = '/ec_course_achievement_methods/create_evaluation_methods'; + // var Url = '/ec_course_achievement_methods/create_evaluation_methods'; + var Url = '/ec_courses/:course_id/course_targets/:target_id/course_achievement_methods.json'; + axios.post(Url, { ec_course_target_id: newec_course_target_id, achievement_methods:achievement_methods diff --git a/public/react/src/modules/ecs/subroute/ecCourseSupportSetting/index.js b/public/react/src/modules/ecs/subroute/ecCourseSupportSetting/index.js index bb6c2f5d9..dd6a72fe9 100644 --- a/public/react/src/modules/ecs/subroute/ecCourseSupportSetting/index.js +++ b/public/react/src/modules/ecs/subroute/ecCourseSupportSetting/index.js @@ -109,6 +109,7 @@ class EcCourseSupportSetting extends Component { } fetchCourseTargets = () => { const ec_course_id = this.props.match.params.ec_course_id; + //这里给了一个默认的参数。。。。。。。。。。。。。 const course_id = 706 const url = `/ec_courses/${course_id}/course_targets.json` // `/ec_courses/${ec_course_id}/ec_course_support_setting_data` @@ -179,11 +180,17 @@ class EcCourseSupportSetting extends Component { }); } componentDidMount = () => { - console.log('componentDidMount ' + this.props) + // console.log('componentDidMountEcCourseSupportSetting'); + // console.log(this.props); + // console.log(this.props.match); + // console.log(this.props.match.params); + // console.log(this.props.match.params.ec_course_id); + this.fetchCourseTargets(); const ec_course_id = this.props.match.params.ec_course_id; - this.getNavigationData(ec_course_id) + this.getNavigationData(ec_course_id); + this.props.Ontitine("ec_course_support_setting"); } setEditableMode = (mode) => { From 611dc5d29c599f48625036fee67560d92b595bdd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Fri, 27 Sep 2019 10:00:22 +0800 Subject: [PATCH 039/200] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../EcCompletionCalculation.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/public/react/src/modules/ecs/subroute/ecCompletion_calculation/EcCompletionCalculation.js b/public/react/src/modules/ecs/subroute/ecCompletion_calculation/EcCompletionCalculation.js index 7480d3b83..05ec1805b 100644 --- a/public/react/src/modules/ecs/subroute/ecCompletion_calculation/EcCompletionCalculation.js +++ b/public/react/src/modules/ecs/subroute/ecCompletion_calculation/EcCompletionCalculation.js @@ -51,12 +51,13 @@ class EcCompletionCalculation extends Component { } componentDidMount(){ - let ec_course_id =this.props.match.params.ec_course_id; - this.UpdateClassData(true); - const Url =`/ec_major_schools/get_navigation_data?ec_course_id=`+ec_course_id; - axios.get(Url, { - withCredentials: true, - }) + // let ec_course_id =this.props.match.params.ec_course_id; + // this.UpdateClassData(true); + + // const url =`/ec_major_schools/get_navigation_data?ec_course_id=`+ec_course_id; + const ec_course_id=706; + const url =`/ec_courses/${ec_course_id}/evaluation.json`; + axios.get(url) .then((response) => { if(response.status===200){ // if(response.data.allow_visit===false){ From 2561d437a33f6843e710752e1c18d6b72568950b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Fri, 27 Sep 2019 10:17:05 +0800 Subject: [PATCH 040/200] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../EcCompletionCalculation.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/public/react/src/modules/ecs/subroute/ecCompletion_calculation/EcCompletionCalculation.js b/public/react/src/modules/ecs/subroute/ecCompletion_calculation/EcCompletionCalculation.js index 05ec1805b..4525afe7e 100644 --- a/public/react/src/modules/ecs/subroute/ecCompletion_calculation/EcCompletionCalculation.js +++ b/public/react/src/modules/ecs/subroute/ecCompletion_calculation/EcCompletionCalculation.js @@ -268,11 +268,11 @@ class EcCompletionCalculation extends Component { this.setState({ Spintype:true }) - let {ec_course_id}=this.state; - const Orl =`/ec_courses/`+ec_course_id+`/sync_data`; - axios.get(Orl, { - withCredentials:true, - }) + // let {ec_course_id}=this.state; + const ec_course_id=706; + // const Orl =`/ec_courses/`+ec_course_id+`/sync_data`; + const Orl =`/ec_courses/${ec_course_id}/evaluation.json`; + axios.get(Orl) .then((response) => { if(response.data.status===1){ this.setState({ From 032e5dd3f264fc3692b470ba56efb34ae5ebf17b Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Fri, 27 Sep 2019 10:53:09 +0800 Subject: [PATCH 041/200] =?UTF-8?q?=E8=BF=99=E9=87=8C=E4=BC=9A=E5=AD=98?= =?UTF-8?q?=E5=9C=A8=E5=BE=88=E9=95=BF=E7=9A=84=E5=AD=97=E7=AC=A6=E4=B8=B2?= =?UTF-8?q?=EF=BC=8C=E5=A6=82=E6=9E=9C=E4=B8=8D=E6=8A=98=E8=A1=8C=E4=BC=9A?= =?UTF-8?q?=E5=BD=B1=E5=93=8D=E9=98=85=E8=AF=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/stylesheets/educoder/edu-all.css | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/public/stylesheets/educoder/edu-all.css b/public/stylesheets/educoder/edu-all.css index c20b648db..0b3f53503 100644 --- a/public/stylesheets/educoder/edu-all.css +++ b/public/stylesheets/educoder/edu-all.css @@ -3739,7 +3739,8 @@ a.singlepublishtwo{ } .ant-tooltip{ - max-width: 100% !important; + /* 这里会存在很长的字符串,如果不折行会影响阅读 */ + max-width: 600px !important; } .square-main p{ From c08eaf8012912e7284c586eaa4fe5f0cb85e3d03 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Fri, 27 Sep 2019 11:01:43 +0800 Subject: [PATCH 042/200] =?UTF-8?q?=E5=AF=BC=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/modules/ecs/EcSetting/RequirementVsObjective/index.js | 2 ++ .../src/modules/ecs/EcSetting/RequirementVsStandard/index.js | 2 ++ 2 files changed, 4 insertions(+) diff --git a/public/react/src/modules/ecs/EcSetting/RequirementVsObjective/index.js b/public/react/src/modules/ecs/EcSetting/RequirementVsObjective/index.js index dfc4aa663..ce78eb54f 100644 --- a/public/react/src/modules/ecs/EcSetting/RequirementVsObjective/index.js +++ b/public/react/src/modules/ecs/EcSetting/RequirementVsObjective/index.js @@ -140,6 +140,8 @@ class RequirementVsObjective extends Component {

  • + 导出矩阵

    diff --git a/public/react/src/modules/ecs/EcSetting/RequirementVsStandard/index.js b/public/react/src/modules/ecs/EcSetting/RequirementVsStandard/index.js index a1d652cf2..dbc40a621 100644 --- a/public/react/src/modules/ecs/EcSetting/RequirementVsStandard/index.js +++ b/public/react/src/modules/ecs/EcSetting/RequirementVsStandard/index.js @@ -109,6 +109,8 @@ class RequirementVsObjective extends Component {

    + 导出矩阵

    From 2911459aa88763948667f25de91995b7b9aebbd5 Mon Sep 17 00:00:00 2001 From: jingquan huang Date: Fri, 27 Sep 2019 16:23:19 +0800 Subject: [PATCH 043/200] git log --- app/controllers/gits_controller.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/controllers/gits_controller.rb b/app/controllers/gits_controller.rb index b52e75353..aa7ccd8cd 100644 --- a/app/controllers/gits_controller.rb +++ b/app/controllers/gits_controller.rb @@ -8,7 +8,10 @@ class GitsController < ApplicationController # 供 git-workhorse反向调用认证 def auth # HTTP_AUTHORIZATION: "Basic 这里base64编码的的密码(user:passwd)" + decodes = %W(2 3 4 5 6 7 8 9 a b c f e f g h i j k l m n o p q r s t u v w x y z) + rand_code = decodes.sample(10).join logger.info("11111112222223333 HTTP_AUTHORIZATION: #{request.env["HTTP_AUTHORIZATION"]}") + logger.info("1111111 git auth start: code is #{rand_code}, time is #{Time.now}") # logger.info("#########-----request_env: #{request.env}") # {"service"=>"git-receive-pack", "controller"=>"gits", "action"=>"auth", # "url"=>"forge01/cermyt39.git/info/refs"} @@ -68,6 +71,7 @@ class GitsController < ApplicationController authenticate_or_request_with_http_basic do |username, password| result + logger.info("1111111 git auth end: code is #{rand_code}, time is #{Time.now}") end end From 4e1e83f8fe394ffcb5fef3b2ee1b223e31e5c726 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Fri, 27 Sep 2019 18:13:51 +0800 Subject: [PATCH 044/200] =?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/src/AppConfig.js | 4 ++-- .../tasks/GraduationTasksSubmitedit.js | 18 ++++++------------ 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/public/react/src/AppConfig.js b/public/react/src/AppConfig.js index bc7fa8070..42fa73857 100644 --- a/public/react/src/AppConfig.js +++ b/public/react/src/AppConfig.js @@ -84,9 +84,9 @@ export function initAxiosInterceptors(props) { } config.url = `${proxy}${url}`; if (config.url.indexOf('?') == -1) { - config.url = `${config.url}?debug=${debugType}`; + config.url = `${config.url}?debug=${'student'}`; } else { - config.url = `${config.url}&debug=${debugType}`; + config.url = `${config.url}&debug=${'student'}`; } } else { // 加api前缀 diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTasksSubmitedit.js b/public/react/src/modules/courses/graduation/tasks/GraduationTasksSubmitedit.js index 21d340200..02e7177fa 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduationTasksSubmitedit.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduationTasksSubmitedit.js @@ -334,24 +334,22 @@ class GraduationTasksSubmitedit extends Component{ } - delecttask_status=(id,student_id)=>{ - let newid=id===undefined||id===null?student_id:id; + delecttask_status=(id)=>{ + let{selectmemberslist,task_status}=this.state; let newlist=task_status; let selects=selectmemberslist; for(var i=0; i 0 ?

    this.delecttask_status(item.user_id,item.student_id)}> + onClick={() => this.delecttask_status(item.user_id)}>
    : ""}
    From 31fc3b373dbbd422e17ee2c234fb37ade837d1b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Fri, 27 Sep 2019 18:14:01 +0800 Subject: [PATCH 045/200] =?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/src/AppConfig.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/react/src/AppConfig.js b/public/react/src/AppConfig.js index 42fa73857..bc7fa8070 100644 --- a/public/react/src/AppConfig.js +++ b/public/react/src/AppConfig.js @@ -84,9 +84,9 @@ export function initAxiosInterceptors(props) { } config.url = `${proxy}${url}`; if (config.url.indexOf('?') == -1) { - config.url = `${config.url}?debug=${'student'}`; + config.url = `${config.url}?debug=${debugType}`; } else { - config.url = `${config.url}&debug=${'student'}`; + config.url = `${config.url}&debug=${debugType}`; } } else { // 加api前缀 From 2cd042f0947e442bdd0dd2224c1f409efb64ce58 Mon Sep 17 00:00:00 2001 From: SylorHuang Date: Sat, 28 Sep 2019 09:29:23 +0800 Subject: [PATCH 046/200] =?UTF-8?q?=E8=AF=95=E5=8D=B7=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E8=BF=81=E7=A7=BB=E6=96=87=E4=BB=B6=E7=9A=84=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...27091948_change_user_p02389416_exercise.rb | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/db/migrate/20190927091948_change_user_p02389416_exercise.rb b/db/migrate/20190927091948_change_user_p02389416_exercise.rb index bea1e28b7..c4026f75b 100644 --- a/db/migrate/20190927091948_change_user_p02389416_exercise.rb +++ b/db/migrate/20190927091948_change_user_p02389416_exercise.rb @@ -6,15 +6,26 @@ class ChangeUserP02389416Exercise < ActiveRecord::Migration[5.2] # 分数分别为:2分,2分,5分,2分,2分,2分,2分,2分 合计19分 question_ids = [37411,37414,37417,37418,37419,37423,37424,37429] choice_ids = [117788,117797,117806,117809,117811,117816,117818,117828] + question_scores = [2,2,5,2,2,2,2,2] question_ids.each_with_index do |q, index| - ExerciseAnswer.create(user_id: 45442, exercise_question_id: q, exercise_choice_id: choice_ids[index]) + ex_exercise_user = ExerciseAnswer.where(user_id: 45442, exercise_question_id: q, exercise_choice_id: choice_ids[index]) + if ex_exercise_user.exists? + ex_exercise_user.first.update_attribute(:score,question_scores[index]) + else + ExerciseAnswer.create(user_id: 45442, exercise_question_id: q, exercise_choice_id: choice_ids[index], score: question_scores[index]) + end end ex_user = ExerciseUser.where(user_id: 45442, exercise_id: 2561)&.first if ex_user.present? - obj_score = ex_user.objective_score.to_i + 19 - total_score = ex_user.score.to_i + 19 + if ex_user.score > 65 || ex_user.objective_score > 65 + ex_user.update_attributes(score: 65, objective_score: 65) + else + obj_score = ex_user.objective_score.to_i + 19 + total_score = ex_user.score.to_i + 19 + + ex_user.update_attributes(score: total_score, objective_score: obj_score) + end - ex_user.update_attributes(score: total_score, objective_score: obj_score) end puts "====> end_to_create user exercise_answer" From fec9fb7f2649b1e66fe7b159057a240a00a25257 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Sat, 28 Sep 2019 10:15:03 +0800 Subject: [PATCH 047/200] =?UTF-8?q?=E9=97=AE=E5=8D=B7=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E5=AD=A6=E5=91=98=E5=8D=95=E4=BD=8D=E5=88=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/polls_controller.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/controllers/polls_controller.rb b/app/controllers/polls_controller.rb index 6ffe277a3..6be131d7a 100644 --- a/app/controllers/polls_controller.rb +++ b/app/controllers/polls_controller.rb @@ -1318,7 +1318,7 @@ class PollsController < ApplicationController poll_ques_titles = poll_questions.pluck(:question_title).map {|k| ActionController::Base.helpers.strip_tags(k) if k.present?} poll_un_anony = poll.un_anonymous if poll_un_anony #是否匿名,默认为false - user_info = %w(登陆名 真实姓名 邮箱 学号) + user_info = %w(登陆名 真实姓名 邮箱 学号 学员单位) else user_info = [] end @@ -1392,7 +1392,8 @@ class PollsController < ApplicationController user_login = u_user.login user_name = u_user.real_name.present? ? u_user.real_name : "--" user_student_id = u_user.student_id.present? ? u_user.student_id : "--" - user_cell += [user_login,user_name, u_user.mail, user_student_id] + user_school_name = u_user.school_name.present? ? u_user.school_name : "--" + user_cell += [user_login,user_name, u_user.mail, user_student_id, user_school_name] end all_user_cell = user_cell + user_answer_array user_commit.push(all_user_cell) From 1d2097611be3de30016dbdfa2c0ebff6a337d4b1 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Sat, 28 Sep 2019 10:23:48 +0800 Subject: [PATCH 048/200] =?UTF-8?q?=E9=80=89=E6=8B=A9=E9=A2=98=E7=AD=94?= =?UTF-8?q?=E6=A1=88=E6=98=BE=E7=A4=BA=E4=B8=8D=E4=BA=86=E5=85=AC=E5=BC=8F?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/package.json | 1 - .../react/src/modules/page/component/ChooseAnswerView.js | 8 +++----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/public/react/package.json b/public/react/package.json index e91e61f03..3e86dae98 100644 --- a/public/react/package.json +++ b/public/react/package.json @@ -79,7 +79,6 @@ "react-url-query": "^1.4.0", "redux": "^4.0.0", "redux-thunk": "2.3.0", - "showdown": "^1.8.6", "store": "^2.0.12", "style-loader": "0.19.0", "styled-components": "^4.1.3", diff --git a/public/react/src/modules/page/component/ChooseAnswerView.js b/public/react/src/modules/page/component/ChooseAnswerView.js index 6edc083e2..b40c96507 100644 --- a/public/react/src/modules/page/component/ChooseAnswerView.js +++ b/public/react/src/modules/page/component/ChooseAnswerView.js @@ -6,10 +6,8 @@ import { withStyles } from 'material-ui/styles'; import Table, { TableBody, TableCell, TableHead, TableRow } from 'material-ui/Table'; import Paper from 'material-ui/Paper'; -import showdown from 'showdown' -const converter = new showdown.Converter() - // text = '# hello, markdown!', - // html = converter.makeHtml(text); +import { markdownToHTML } from 'educoder' + const styles = theme => ({ root: { @@ -34,7 +32,7 @@ const ChooseAnswerView = ({ gameAnswer, classes }) => { return (

    第{index+1}题

    -

    +

    ); })} From b5941cf2e9b2c00723103dd490ec1d124e8a4e0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Sat, 28 Sep 2019 11:13:30 +0800 Subject: [PATCH 049/200] b --- public/react/config/webpack.config.dev.js | 2 +- .../courses/coursesPublic/ModulationModal.js | 14 +++++++++++++- .../courses/graduation/tasks/GraduationAcross.js | 9 +++++---- .../graduation/tasks/GraduationTaskssettinglist.js | 12 +++++++----- .../paths/PathDetail/DetailCardsEditAndAdd.js | 1 + .../paths/PathDetail/DetailCardsEditAndEdit.js | 1 + 6 files changed, 28 insertions(+), 11 deletions(-) diff --git a/public/react/config/webpack.config.dev.js b/public/react/config/webpack.config.dev.js index fe525154f..ef38a18f8 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/coursesPublic/ModulationModal.js b/public/react/src/modules/courses/coursesPublic/ModulationModal.js index 974077793..1857f6814 100644 --- a/public/react/src/modules/courses/coursesPublic/ModulationModal.js +++ b/public/react/src/modules/courses/coursesPublic/ModulationModal.js @@ -94,7 +94,19 @@ class ModulationModal extends Component{
  • 原因不能为空
  • -
  • + + + +
  • e.user_name.indexOf(searchValue)>-1) : teachers; const course_groupsList = searchValue ? course_groups&&course_groups.filter(e=>e.name.indexOf(searchValue)>-1) : course_groups; - return( + const graduation_groupslist =searchValue ? graduation_groups&&graduation_groups.filter(e=>e.name.indexOf(searchValue)>-1) : graduation_groups; + return( :""} {comment_status == 2 &&teacherList&&teacherList.length>2? this.checkonChange(e,teacherList)}>全选:""} - {comment_status != 2 &&course_groupsList&&course_groupsList.length>2? this.checkonChange(e,course_groupsList)}>全选:""} + {comment_status != 2 &&graduation_groupslist&&graduation_groupslist.length>2? this.checkonChange(e,graduation_groupslist)}>全选:""} {menu}
    @@ -515,7 +516,7 @@ class GraduationAcross extends Component{ teacherList && teacherList.map((i,key)=>{ return }): - course_groupsList && course_groupsList.map((i,key)=>{ + graduation_groupslist && graduation_groupslist.map((i,key)=>{ return }) } diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettinglist.js b/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettinglist.js index 318955479..f3495f7e4 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettinglist.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduationTaskssettinglist.js @@ -535,10 +535,12 @@ class GraduationTaskssettinglist extends Component{ // console.log(result) if(result.data.status===0){ this.seacthdata(teacher_comment,task_status,course_group,cross_comment,order,b_order,search,this.state.page); + this.props.showNotification(result.data.message); + this.cancelmodel(); this.setState({ - Modalstype:true, + Modalstype:false, Allocationtype:false, - Modalstopval:result.data.message, + // Modalstopval:result.data.message, ModalSave:this.cancelmodel, }) } @@ -866,10 +868,10 @@ class GraduationTaskssettinglist extends Component{ {tag.name} : -

    this.showModulationtype(tag.id):tag.name==="分配"?taskslistdata&&taskslistdata.cross_comment===true?"":"":""}> {tag.name==="分配"?taskslistdata&&taskslistdata.cross_comment===true?"":"":tag.name} -

    + } } @@ -972,7 +974,7 @@ class GraduationTaskssettinglist extends Component{ white-space: nowrap; } .ant-table-tbody>tr>td, .ant-table-thead>tr>th{ - padding:16px 8px; + padding:16px 5px; } ` } diff --git a/public/react/src/modules/paths/PathDetail/DetailCardsEditAndAdd.js b/public/react/src/modules/paths/PathDetail/DetailCardsEditAndAdd.js index ed4cc85eb..159c40475 100644 --- a/public/react/src/modules/paths/PathDetail/DetailCardsEditAndAdd.js +++ b/public/react/src/modules/paths/PathDetail/DetailCardsEditAndAdd.js @@ -389,6 +389,7 @@ class DetailCardsEditAndAdd extends Component{ :""} {selectShixun===true? Date: Sat, 28 Sep 2019 11:42:05 +0800 Subject: [PATCH 050/200] =?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/src/modules/courses/exercise/Exercisetablesmubu.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/react/src/modules/courses/exercise/Exercisetablesmubu.js b/public/react/src/modules/courses/exercise/Exercisetablesmubu.js index d2d6103b8..501a7ebf5 100644 --- a/public/react/src/modules/courses/exercise/Exercisetablesmubu.js +++ b/public/react/src/modules/courses/exercise/Exercisetablesmubu.js @@ -96,7 +96,7 @@ class Exercisetablesmubus extends Component { '0%': '#29BD8B', '100%': '#29BD8B', }} - percent={record.max_score*100} showInfo={false}/>
    {record.max_score*100}%
    } + percent={(record.max_score*100).toFixed()} showInfo={false}/>
    {(record.max_score*100).toFixed()}%
    } ), }]; From c469e59ad160153e4ad855cd4968d657928497dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Sat, 28 Sep 2019 14:59:57 +0800 Subject: [PATCH 051/200] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/modules/courses/graduation/tasks/GraduationAcross.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationAcross.js b/public/react/src/modules/courses/graduation/tasks/GraduationAcross.js index 5ff1c0551..b672d1b81 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduationAcross.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduationAcross.js @@ -472,9 +472,9 @@ class GraduationAcross extends Component{ 分配给{ comment_status && comment_status == 2 ? "老师":"答辩组"}: + +
    + +
    + + +
    + <%= check_box_tag(:online, 1, image.online?, id: nil, class: 'online-check-box', data: { id: image.id, toggle: 'tooltip', title: '首页展示' }) %> + <%= delete_link '删除', admins_carousel_path(image, element: ".custom-carousel-item-#{image.id}", not_refresh: true), class: 'delete-btn' do %> + + <% end %> +
    + + + <% end %> + + + + +<%= render partial: 'admins/carousels/shared/add_carousel_modal' %> +<%= render partial: 'admins/shared/modal/upload_file_modal' %> \ No newline at end of file diff --git a/app/views/admins/carousels/shared/_add_carousel_modal.html.erb b/app/views/admins/carousels/shared/_add_carousel_modal.html.erb new file mode 100644 index 000000000..d1e75e29e --- /dev/null +++ b/app/views/admins/carousels/shared/_add_carousel_modal.html.erb @@ -0,0 +1,36 @@ + \ No newline at end of file diff --git a/app/views/admins/shared/_sidebar.html.erb b/app/views/admins/shared/_sidebar.html.erb index 2d9461f45..553820e69 100644 --- a/app/views/admins/shared/_sidebar.html.erb +++ b/app/views/admins/shared/_sidebar.html.erb @@ -77,7 +77,8 @@
  • - <%= sidebar_item_group('#helps-submenu', '帮助中心', icon: 'info-circle') do %> + <%= sidebar_item_group('#setting-submenu', '网站建设', icon: 'cogs') do %> +
  • <%= sidebar_item(admins_carousels_path, '轮播图', icon: 'image', controller: 'admins-carousels') %>
  • <%= sidebar_item(edit_admins_about_path, '关于我们', icon: 'smile-o', controller: 'admins-abouts') %>
  • <%= sidebar_item(edit_admins_contact_us_path, '联系我们', icon: 'commenting-o', controller: 'admins-contact_us') %>
  • <%= sidebar_item(admins_cooperatives_path, '合作伙伴', icon: 'handshake-o', controller: 'admins-cooperatives') %>
  • diff --git a/config/routes.rb b/config/routes.rb index 706583619..2c02c6a79 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -962,6 +962,9 @@ Rails.application.routes.draw do post :drag, on: :collection post :replace_image_url, on: :member end + resources :carousels, only: [:index, :create, :update, :destroy] do + post :drag, on: :collection + end end resources :colleges, only: [] do diff --git a/db/migrate/20190930010405_resort_portal_image_data.rb b/db/migrate/20190930010405_resort_portal_image_data.rb new file mode 100644 index 000000000..665b48466 --- /dev/null +++ b/db/migrate/20190930010405_resort_portal_image_data.rb @@ -0,0 +1,7 @@ +class ResortPortalImageData < ActiveRecord::Migration[5.2] + def change + PortalImage.order(position: :asc).each_with_index do |image, index| + image.update!(position: index + 1) + end + end +end From a25b193015f671c7319eca96199a148e14168c61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Mon, 30 Sep 2019 10:13:16 +0800 Subject: [PATCH 091/200] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../EcCompletionCalculation.js | 26 ++++++++++++++----- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/public/react/src/modules/ecs/subroute/ecCompletion_calculation/EcCompletionCalculation.js b/public/react/src/modules/ecs/subroute/ecCompletion_calculation/EcCompletionCalculation.js index e33037d15..bbb810429 100644 --- a/public/react/src/modules/ecs/subroute/ecCompletion_calculation/EcCompletionCalculation.js +++ b/public/react/src/modules/ecs/subroute/ecCompletion_calculation/EcCompletionCalculation.js @@ -547,7 +547,7 @@ class EcCompletionCalculation extends Component { -
    +
    { graduation_list.length===0? @@ -604,16 +604,28 @@ class EcCompletionCalculation extends Component { Spintype===false?graduation_list.map((item,key)=>{ return( -
  • 5 ? (76*(ec_course_targets_count+4)+380):1160+"px"}}> - {/* {item.ec_graduation_name} */} + +

    5 ? (76*(ec_course_targets_count+4)+380+15):1200+"px"}}> {key+1} {item.content} {item.status==="not_achieved"?"未完成":"完成"} - {item.objective_achievement===null?0:item.objective_achievement} - {item.actually_achievement===null?0:item.actually_achievement} - {item.weights===null||item.weights===0?立即配置:{item.weights}} + {item.objective_achievement===null?0:item.objective_achievement} + {item.actually_achievement===null?0:item.actually_achievement} + {item.weights===null||item.weights===0?立即配置:{item.weights}} {TargetresContentList(ec_course_targets_count,item.target_position)} -

  • +

    + + + //
  • 5 ? (76*(ec_course_targets_count+4)+380):1200+"px"}}> + // {/* {item.ec_graduation_name} */} + // {key+1} + // {item.content} + // {item.status==="not_achieved"?"未完成":"完成"} + // {item.objective_achievement===null?0:item.objective_achievement} + // {item.actually_achievement===null?0:item.actually_achievement} + // {item.weights===null||item.weights===0?立即配置:{item.weights}} + // {TargetresContentList(ec_course_targets_count,item.target_position)} + //
  • ) }):"" From b7578443ae64ff276207ff978c5d168fb5c9b68d Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Mon, 30 Sep 2019 10:14:42 +0800 Subject: [PATCH 092/200] =?UTF-8?q?=E4=BA=A4=E6=B5=81=E9=97=AE=E7=AD=94?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=80=9A=E7=9F=A5=E5=85=AC=E5=91=8Atab?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/memos_controller.rb | 4 ++-- app/helpers/memos_helper.rb | 2 +- app/models/forum.rb | 1 + db/migrate/20190930020534_migrate_forum_name.rb | 9 +++++++++ 4 files changed, 13 insertions(+), 3 deletions(-) create mode 100644 db/migrate/20190930020534_migrate_forum_name.rb diff --git a/app/controllers/memos_controller.rb b/app/controllers/memos_controller.rb index 88139fe7e..d2c386681 100644 --- a/app/controllers/memos_controller.rb +++ b/app/controllers/memos_controller.rb @@ -25,9 +25,9 @@ class MemosController < ApplicationController !search.blank? ? "forum_id = #{forum_id} and root_id is null and subject like '%#{search}%'" : "forum_id = #{forum_id} and root_id is null" elsif !search.blank? - "forum_id in(3, 5) and root_id is null and subject like '%#{search}%'" + "forum_id in(3, 5, 16) and root_id is null and subject like '%#{search}%'" else - "forum_id in(3, 5) and root_id is null" + "forum_id in(3, 5, 16) and root_id is null" end if tag_repertoire_id diff --git a/app/helpers/memos_helper.rb b/app/helpers/memos_helper.rb index 434d9b66a..ea84ec2c1 100644 --- a/app/helpers/memos_helper.rb +++ b/app/helpers/memos_helper.rb @@ -1,6 +1,6 @@ module MemosHelper def forum_list - [{id: 5, name: "技术分享"}, {id: 3, name: "操作指南"}] + [{id: 5, name: "技术分享"}, {id: 3, name: "操作指南"}, {id: 16, name: "通知公告"}] end end diff --git a/app/models/forum.rb b/app/models/forum.rb index 88aafa676..cd9b76a96 100644 --- a/app/models/forum.rb +++ b/app/models/forum.rb @@ -1,2 +1,3 @@ class Forum < ApplicationRecord + has_many :memos, dependent: :destroy end diff --git a/db/migrate/20190930020534_migrate_forum_name.rb b/db/migrate/20190930020534_migrate_forum_name.rb new file mode 100644 index 000000000..102d8c9a0 --- /dev/null +++ b/db/migrate/20190930020534_migrate_forum_name.rb @@ -0,0 +1,9 @@ +class MigrateForumName < ActiveRecord::Migration[5.2] + def change + forum = Forum.find_by(id: 16) + if forum.present? + forum.update_attributes(name: "通知公告") + forum.memos.destroy_all + end + end +end From 04bc9b9a158072e6fc217425ee7389bc3ee133c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Mon, 30 Sep 2019 10:42:51 +0800 Subject: [PATCH 093/200] =?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/src/modules/forums/MemoNew.js | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/public/react/src/modules/forums/MemoNew.js b/public/react/src/modules/forums/MemoNew.js index 2f6eb196d..4b3fd6550 100644 --- a/public/react/src/modules/forums/MemoNew.js +++ b/public/react/src/modules/forums/MemoNew.js @@ -119,11 +119,13 @@ function create_editorMD(id, width, high, placeholder, imageUrl, callback){ const typeNameMap = { '技术分享': 5, - '操作指南': 3, + '操作指南': 3, + '通知公告':16, } export const typeNameMap2 = { 5: '技术分享', - 3: '操作指南', + 3: '操作指南', + 16: '通知公告', } const defaultType = '技术分享' @@ -171,7 +173,8 @@ class MemoNew extends Component { currentSelectRepertoiresIndex: -1, repertoiresTagMap: {}, - fileList: [] + fileList: [], + forums:[{id:5,name:"技术分享"},{id:3,name:"技术指南"},{id:16,name:"通知公告"}], } } onCommit() { @@ -336,6 +339,13 @@ class MemoNew extends Component { $('head').append( $('') ) $('head').append( $(``) ) } + if(data.forums){ + this.setState({ + forums: data.forums===undefined||data.forums===null||data.forums.length===0? this.state.forums:data.forums + // repertoires, + // repertoiresTagMap + }) + } }).catch((error) => { console.log(error) }) @@ -607,7 +617,7 @@ class MemoNew extends Component { }); } render() { - const { match, history } = this.props + const { match, history,forums } = this.props const { // repertoires, repertoiresTagMap, currentSelectRepertoiresIndex, memoRepertoire, tag_list, @@ -750,10 +760,14 @@ class MemoNew extends Component {
    *
    + { + forums.length>0 + }
    From 91cedff462abc8e4ffe01a4676a4941c5fbca59c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Mon, 30 Sep 2019 10:54:20 +0800 Subject: [PATCH 094/200] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../react/src/modules/forums/ForumsNavTab.js | 206 +++++++++--------- public/react/src/modules/forums/MemoNew.js | 3 - 2 files changed, 106 insertions(+), 103 deletions(-) diff --git a/public/react/src/modules/forums/ForumsNavTab.js b/public/react/src/modules/forums/ForumsNavTab.js index 60dc36a25..8e12912bb 100644 --- a/public/react/src/modules/forums/ForumsNavTab.js +++ b/public/react/src/modules/forums/ForumsNavTab.js @@ -1,100 +1,106 @@ -import React, { Component } from 'react'; -import { Redirect } from 'react-router'; - -import { BrowserRouter as Router, Route, Link, Switch } from "react-router-dom"; - -import PropTypes from 'prop-types'; - -import classNames from 'classnames' - -class ForumsNavTab extends Component { - constructor(props) { - super(props) - - this.state = { - - } - } - - onNavClick(active) { - // TODO 为什么事件发不过去 - // https://github.com/facebook/react/issues/3249#issuecomment-177750141 - // window.$(window).trigger('setSearchValue', '', true); - this.props.setSearchValue('') - - if (!active) { - this.props.initForumState({ - selectedHotLabelIndex: -1, - }) - } - } - render() { - const { match, history, currentPage } = this.props - - const techSharePath = `/forums/categories/5` - const guidePath = `/forums/categories/3` - - const hottestPath = `/forums/categories/all?order=hottest` // ?order=hottest - const newestPath = `/forums/categories/all?order=newest` // ?order=newest - - const shixunDiscussPath = `/forums/categories/shixun_discuss` - const locationPath = history.location.pathname + history.location.search - /* -
      -
    • - techShare -
    • -
    • - guide -
    • -
    - */ - return ( -
    -

    - {/* - 技术分享 - 219 - */} - this.onNavClick(locationPath.indexOf('order=newest') !== -1)} - > - 最新回复 - - this.onNavClick(locationPath.indexOf('order=hottest') !== -1)} - > - 热门话题 - - this.onNavClick(locationPath.indexOf('shixun_discuss') !== -1)} - > - 实训回复 - - - this.onNavClick(locationPath.indexOf(techSharePath) === 0)} - > - 技术分享 - - this.onNavClick(locationPath.indexOf(guidePath) === 0)} - > - 操作指南 - - {/* - 实训交流 - 1391 - */} -

    -
    - ); - } -} - -export default ForumsNavTab; +import React, { Component } from 'react'; +import { Redirect } from 'react-router'; + +import { BrowserRouter as Router, Route, Link, Switch } from "react-router-dom"; + +import PropTypes from 'prop-types'; + +import classNames from 'classnames' + +class ForumsNavTab extends Component { + constructor(props) { + super(props) + + this.state = { + + } + } + + onNavClick(active) { + // TODO 为什么事件发不过去 + // https://github.com/facebook/react/issues/3249#issuecomment-177750141 + // window.$(window).trigger('setSearchValue', '', true); + this.props.setSearchValue('') + + if (!active) { + this.props.initForumState({ + selectedHotLabelIndex: -1, + }) + } + } + render() { + const { match, history, currentPage } = this.props + + const techSharePath = `/forums/categories/5` + const guidePath = `/forums/categories/3` + const guidePaths = `/forums/categories/16` + const hottestPath = `/forums/categories/all?order=hottest` // ?order=hottest + const newestPath = `/forums/categories/all?order=newest` // ?order=newest + + const shixunDiscussPath = `/forums/categories/shixun_discuss` + const locationPath = history.location.pathname + history.location.search + /* +
      +
    • + techShare +
    • +
    • + guide +
    • +
    + */ + return ( +
    +

    + {/* + 技术分享 + 219 + */} + this.onNavClick(locationPath.indexOf('order=newest') !== -1)} + > + 最新回复 + + this.onNavClick(locationPath.indexOf('order=hottest') !== -1)} + > + 热门话题 + + this.onNavClick(locationPath.indexOf('shixun_discuss') !== -1)} + > + 实训回复 + + + this.onNavClick(locationPath.indexOf(techSharePath) === 0)} + > + 技术分享 + + this.onNavClick(locationPath.indexOf(guidePath) === 0)} + > + 操作指南 + + this.onNavClick(locationPath.indexOf(guidePaths) === 0)} + > + 通知公告 + + {/* + 实训交流 + 1391 + */} +

    +
    + ); + } +} + +export default ForumsNavTab; diff --git a/public/react/src/modules/forums/MemoNew.js b/public/react/src/modules/forums/MemoNew.js index 4b3fd6550..962e74f22 100644 --- a/public/react/src/modules/forums/MemoNew.js +++ b/public/react/src/modules/forums/MemoNew.js @@ -760,9 +760,6 @@ class MemoNew extends Component {
    *
    - { - forums.length>0 - } this.editlevelslist(e,key)}/> + + {key===editlevels.length-1?小于:大于或等于} + + this.editlevelslists(e,key)}/> + + + {key===editlevels.length-1? + + + this.deleteditecGrade(key)}> + + + + + this.additecGrade(key)}> + + + :""} + + ) + }) + } + 内容不能为空 + + + +
    +
    提交
    +
    取消
    +
    + +
    + + + +
    +
    +
    ) } From 2424509691c6a077496242b406bbe2c106ae00c5 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Wed, 9 Oct 2019 09:31:59 +0800 Subject: [PATCH 137/200] =?UTF-8?q?=E5=AD=A6=E7=94=9F=E8=BA=AB=E4=BB=BD?= =?UTF-8?q?=E6=9F=A5=E7=9C=8B=E8=AF=95=E5=8D=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/exercise.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/exercise.rb b/app/models/exercise.rb index 825f7cd9f..8469d25b6 100644 --- a/app/models/exercise.rb +++ b/app/models/exercise.rb @@ -131,7 +131,7 @@ class Exercise < ApplicationRecord status = 4 else if user.present? && user.student_of_course?(course) #当为学生的时候,需根据分班来判断试卷状态 - ex_time = get_exercise_times(user_id,false) + ex_time = get_exercise_times(user.id,false) pb_time = ex_time[:publish_time] ed_time = ex_time[:end_time] if pb_time.present? && ed_time.present? && pb_time <= Time.now && ed_time > Time.now From 252a2258bf5da7ba93abcf0c0f061e441017df41 Mon Sep 17 00:00:00 2001 From: p31729568 Date: Wed, 9 Oct 2019 09:38:53 +0800 Subject: [PATCH 138/200] ec: modify api --- .../course_achievement_methods_controller.rb | 8 ++- .../wechats/js_sdk_signatures_controller.rb | 2 +- app/libs/util/wechat.rb | 56 ++------------- app/libs/util/wechat_store.rb | 72 +++++++++++++++++++ app/models/ec_course.rb | 2 +- app/models/ec_course_evaluation.rb | 19 +++++ ...reate_course_achievement_method_service.rb | 18 ++--- ...ec_course_achievement_method.json.jbuilder | 2 + .../course_evaluations/slimmer.json.jbuilder | 8 ++- 9 files changed, 121 insertions(+), 66 deletions(-) create mode 100644 app/libs/util/wechat_store.rb diff --git a/app/controllers/ecs/course_achievement_methods_controller.rb b/app/controllers/ecs/course_achievement_methods_controller.rb index 389169258..62d609ea7 100644 --- a/app/controllers/ecs/course_achievement_methods_controller.rb +++ b/app/controllers/ecs/course_achievement_methods_controller.rb @@ -5,13 +5,17 @@ class Ecs::CourseAchievementMethodsController < Ecs::CourseBaseController end def create - @course_target = Ecs::CreateCourseAchievementMethodsService.call(current_course_target, create_params) + Ecs::CreateCourseAchievementMethodsService.call(current_course_target, create_params) + render_ok end private def create_params - params.permit(course_achievement_methods: %i[id course_evaluation_id course_evaluation_subitem_ids score percentage]) + params.permit(course_achievement_methods: [ + :id, :course_evaluation_id, :score, :percentage, + course_evaluation_relates: %i[:subitem_id position] + ]) end def current_course_target diff --git a/app/controllers/wechats/js_sdk_signatures_controller.rb b/app/controllers/wechats/js_sdk_signatures_controller.rb index 0b66cc263..f6a01b0e2 100644 --- a/app/controllers/wechats/js_sdk_signatures_controller.rb +++ b/app/controllers/wechats/js_sdk_signatures_controller.rb @@ -5,7 +5,7 @@ class Wechats::JsSdkSignaturesController < ApplicationController signature = Util::Wechat.js_sdk_signature(params[:url], noncestr, timestamp) render_ok(appid: Util::Wechat.appid, timestamp: timestamp, noncestr: noncestr, signature: signature) - rescue Util::Wechat::Error => ex + rescue Util::WechatStore::Error => ex render_error(ex.message) end end \ No newline at end of file diff --git a/app/libs/util/wechat.rb b/app/libs/util/wechat.rb index 1b064ba94..cb7b9044d 100644 --- a/app/libs/util/wechat.rb +++ b/app/libs/util/wechat.rb @@ -13,63 +13,15 @@ module Util::Wechat end def access_token - # 7200s 有效时间 - Rails.cache.fetch(access_token_cache_key, expires_in: 100.minutes) do - result = request(:get, '/cgi-bin/token', appid: appid, secret: secret, grant_type: 'client_credential') - result['access_token'] - end - end - - def refresh_access_token - Rails.cache.delete(access_token_cache_key) - access_token + wechat_store.access_token end def jsapi_ticket - # 7200s 有效时间 - Rails.cache.fetch(jsapi_ticket_cache_key, expires_in: 100.minutes) do - result = request(:get, '/cgi-bin/ticket/getticket', access_token: access_token, type: 'jsapi') - result['ticket'] - end - end - - def refresh_jsapi_ticket - Rails.cache.delete(jsapi_ticket_cache_key) - jsapi_ticket - end - - def access_token_cache_key - "#{base_cache_key}/access_token" - end - - def jsapi_ticket_cache_key - "#{base_cache_key}/jsapi_ticket" + wechat_store.jsapi_ticket end - def base_cache_key - "wechat/#{appid}" - end - - private - - def request(method, url, **params) - Rails.logger.error("[wechat] request: #{method} #{url} #{params.inspect}") - - client = Faraday.new(url: BASE_SITE) - response = client.public_send(method, url, params) - result = JSON.parse(response.body) - - Rails.logger.error("[wechat] response:#{response.status} #{result.inspect}") - - if response.status != 200 - raise Error, result.inspect - end - - if result['errcode'].present? && result['errcode'].to_i.nonzero? - raise Error, result.inspect - end - - result + def wechat_store + @_wechat_store ||= ::Util::WechatStore.new(appid, secret) end end end \ No newline at end of file diff --git a/app/libs/util/wechat_store.rb b/app/libs/util/wechat_store.rb new file mode 100644 index 000000000..a6f3ac76a --- /dev/null +++ b/app/libs/util/wechat_store.rb @@ -0,0 +1,72 @@ +class Util::WechatStore + BASE_SITE = 'https://api.weixin.qq.com'.freeze + + Error = Class.new(StandardError) + + attr_reader :appid, :secret + + def initialize(appid, secret) + @appid = appid + @secret = secret + end + + def access_token + # 7200s 有效时间 + Rails.cache.fetch(access_token_cache_key, expires_in: 100.minutes) do + result = request(:get, '/cgi-bin/token', appid: appid, secret: secret, grant_type: 'client_credential') + result['access_token'] + end + end + + def refresh_access_token + Rails.cache.delete(access_token_cache_key) + access_token + end + + def jsapi_ticket + # 7200s 有效时间 + Rails.cache.fetch(jsapi_ticket_cache_key, expires_in: 100.minutes) do + result = request(:get, '/cgi-bin/ticket/getticket', access_token: access_token, type: 'jsapi') + result['ticket'] + end + end + + def refresh_jsapi_ticket + Rails.cache.delete(jsapi_ticket_cache_key) + jsapi_ticket + end + + def access_token_cache_key + "#{base_cache_key}/access_token" + end + + def jsapi_ticket_cache_key + "#{base_cache_key}/jsapi_ticket" + end + + def base_cache_key + "wechat/#{appid}" + end + + private + + def request(method, url, **params) + Rails.logger.error("[wechat] request: #{method} #{url} #{params.inspect}") + + client = Faraday.new(url: BASE_SITE) + response = client.public_send(method, url, params) + result = JSON.parse(response.body) + + Rails.logger.error("[wechat] response:#{response.status} #{result.inspect}") + + if response.status != 200 + raise Error, result.inspect + end + + if result['errcode'].present? && result['errcode'].to_i.nonzero? + raise Error, result.inspect + end + + result + end +end \ No newline at end of file diff --git a/app/models/ec_course.rb b/app/models/ec_course.rb index 6f5480ea8..4e7202f05 100644 --- a/app/models/ec_course.rb +++ b/app/models/ec_course.rb @@ -6,7 +6,7 @@ class EcCourse < ApplicationRecord has_many :ec_graduation_subitem_course_targets, through: :ec_course_targets # 课程负责教师 has_many :ec_course_users - has_many :course_managers, through: :ec_course_users, class_name: 'User' + has_many :course_managers, through: :ec_course_users, source: :user # 课程考核标准 has_many :ec_course_evaluations, dependent: :destroy # 课程等级 diff --git a/app/models/ec_course_evaluation.rb b/app/models/ec_course_evaluation.rb index e96f1c98b..40fd10dfa 100644 --- a/app/models/ec_course_evaluation.rb +++ b/app/models/ec_course_evaluation.rb @@ -16,4 +16,23 @@ class EcCourseEvaluation < ApplicationRecord def imported? import_status? end + + def evaluation_relates + # 总成绩支撑只有课程考核标准的名称, 分项成绩支撑是课程考核标准名称与考核分项的笛卡尔积 + if status == 1 + return evaluation_count.times.map { |index| { id: -1, name: "#{name}(#{index + 1})", position: index + 1 } } + end + + if is_course_type? + ec_course_evaluation_subitems.map.with_index { |item, index| { id: item.id, name: item.name, position: index + 1 } } + else + data = [] + ec_course_evaluation_subitems.each do |item| + evaluation_count.times do |i| + data << { id: item.id, name: "#{name}(#{i + 1})#{item.name}", position: i + 1 } + end + end + data + end + end end diff --git a/app/services/ecs/create_course_achievement_method_service.rb b/app/services/ecs/create_course_achievement_method_service.rb index 01f09ff2b..0c086631f 100644 --- a/app/services/ecs/create_course_achievement_method_service.rb +++ b/app/services/ecs/create_course_achievement_method_service.rb @@ -31,8 +31,8 @@ class Ecs::CreateCourseAchievementMethodsService < ApplicationService # 创建新的评价方法时,全部为新建 if item[:id].blank? || course_target.ec_course_achievement_methods.find_by(id: item[:id]).blank? item[:ec_achievement_evaluation_relates_attributes] = - Array(*item[:course_evaluation_subitem_ids]).uniq.map do |subitem_id| - { ec_course_evaluation_subitem_id: subitem_id.to_i } + item[:course_evaluation_relates].map do |relate| + { ec_course_evaluation_subitem_id: relate[:subitem_id].to_i, position: relate[:position] } end return end @@ -41,22 +41,22 @@ class Ecs::CreateCourseAchievementMethodsService < ApplicationService relates = achievement_method.ec_achievement_evaluation_relates # 获取传入的 subitem id数组和已存在的 subitem id数组 - old_subitem_ids = relates.map(&:ec_course_evaluation_subitem_id).uniq - new_subitem_ids = Array(*item[:course_evaluation_subitem_ids]).map(&:to_i).uniq + old_data = relates.map { |e| [e.ec_course_evaluation_subitem_id, e.position] } + new_data = item[:course_evaluation_relates].map { |e| [e[:subitem_id, e[:position]]] } # 分别得到需要移除的 subitem ID数组和需要创建的 subitem ID数组 - destroy_subitem_ids = old_subitem_ids - new_subitem_ids - create_subitem_ids = new_subitem_ids - old_subitem_ids + destroy_data = old_data - new_data + create_data = new_data - old_data # 生成需要创建关系的 subitem id 数据 - create_attributes = create_subitem_ids.map { |item_id| { ec_course_evaluation_subitem_id: item_id } } + create_attributes = create_data.map { |arr| { ec_course_evaluation_subitem_id: arr[0], position: arr[1] } } # 处理需要更新或者删除的记录 exists_attributes = relates.map do |relate| - if destroy_subitem_ids.include?(relate.ec_course_evaluation_subitem_id) + if destroy_data.include?([relate.ec_course_evaluation_subitem_id, relate.position]) { id: relate.id, _destroy: true } else - relate.as_json(only: %i[id ec_course_evaluation_subitem_id ec_course_achievement_method_id]) + relate.as_json(only: %i[id ec_course_evaluation_subitem_id ec_course_achievement_method_id position]) end end diff --git a/app/views/ecs/course_achievement_methods/shared/_ec_course_achievement_method.json.jbuilder b/app/views/ecs/course_achievement_methods/shared/_ec_course_achievement_method.json.jbuilder index 5cc3220a4..868e7822c 100644 --- a/app/views/ecs/course_achievement_methods/shared/_ec_course_achievement_method.json.jbuilder +++ b/app/views/ecs/course_achievement_methods/shared/_ec_course_achievement_method.json.jbuilder @@ -7,3 +7,5 @@ end json.course_evaluation_subitems ec_course_achievement_method.ec_course_evaluation_subitems, partial: 'ecs/shared/ec_course_evaluation_subitem', as: :ec_course_evaluation_subitem + +json.course_evaluation_relates ec_course_achievement_method.ec_course_evaluation.evaluation_relates diff --git a/app/views/ecs/course_evaluations/slimmer.json.jbuilder b/app/views/ecs/course_evaluations/slimmer.json.jbuilder index 6e0faef3e..1f4dc0cc0 100644 --- a/app/views/ecs/course_evaluations/slimmer.json.jbuilder +++ b/app/views/ecs/course_evaluations/slimmer.json.jbuilder @@ -1 +1,7 @@ -json.course_evaluations @course_evaluations, partial: 'ecs/course_evaluations/shared/ec_course_evaluation_slim', as: :ec_course_evaluation +json.course_evaluations do + json.array! @course_evaluations do |course_evaluation| + json.partial! 'ecs/course_evaluations/shared/ec_course_evaluation_slim', ec_course_evaluation: course_evaluation + + json.evaluation_relates course_evaluation.evaluation_relates + end +end \ No newline at end of file From 05a0e4f8326e8b9309c6dd24363f790edd67a9ef Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Wed, 9 Oct 2019 10:00:38 +0800 Subject: [PATCH 139/200] =?UTF-8?q?=E8=AF=95=E5=8D=B7=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E7=9A=84=E6=98=BE=E7=A4=BA=EF=BC=88=E5=AD=A6=E7=94=9F=E8=BA=AB?= =?UTF-8?q?=E4=BB=BD=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/exercises_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/exercises_controller.rb b/app/controllers/exercises_controller.rb index f2e8508f0..cfe72effc 100644 --- a/app/controllers/exercises_controller.rb +++ b/app/controllers/exercises_controller.rb @@ -46,8 +46,8 @@ class ExercisesController < ApplicationController @exercises = member_show_exercises.exists? ? member_show_exercises.unified_setting : [] else #已分班级的成员,可以查看统一设置和单独设置(试卷是发布在该班级)试卷 # 已发布 当前用户班级分组的 试卷id - not_exercise_ids = @course.exercise_group_settings.exercise_group_not_published.where("course_group_id = #{@member_group_id}").pluck(:exercise_id) - @exercises = member_show_exercises.where.not(id: not_exercise_ids) + publish_exercise_ids = @course.exercise_group_settings.exercise_group_published.where("course_group_id = #{@member_group_id}").pluck(:exercise_id) + @exercises = member_show_exercises.unified_setting.or(id: publish_exercise_ids) end else #用户未登陆或不是该课堂成员,仅显示统一设置的(已发布的/已截止的),如有公开,则不显示锁,不公开,则显示锁 @is_teacher_or = 0 From d1f3534542f54af4afe8f3dd70cfc52a0e5114ac Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Wed, 9 Oct 2019 10:03:14 +0800 Subject: [PATCH 140/200] tiaoz --- app/controllers/exercises_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/exercises_controller.rb b/app/controllers/exercises_controller.rb index cfe72effc..30fef596d 100644 --- a/app/controllers/exercises_controller.rb +++ b/app/controllers/exercises_controller.rb @@ -47,7 +47,7 @@ class ExercisesController < ApplicationController else #已分班级的成员,可以查看统一设置和单独设置(试卷是发布在该班级)试卷 # 已发布 当前用户班级分组的 试卷id publish_exercise_ids = @course.exercise_group_settings.exercise_group_published.where("course_group_id = #{@member_group_id}").pluck(:exercise_id) - @exercises = member_show_exercises.unified_setting.or(id: publish_exercise_ids) + @exercises = member_show_exercises.unified_setting.or(member_show_exercises.where(id: publish_exercise_ids)) end else #用户未登陆或不是该课堂成员,仅显示统一设置的(已发布的/已截止的),如有公开,则不显示锁,不公开,则显示锁 @is_teacher_or = 0 From a1f6dd67314859efc35bdd75944291fcaf656461 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Wed, 9 Oct 2019 10:09:53 +0800 Subject: [PATCH 141/200] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../react/src/modules/courses/coursesPublic/ShixunChooseModal.js | 1 + 1 file changed, 1 insertion(+) diff --git a/public/react/src/modules/courses/coursesPublic/ShixunChooseModal.js b/public/react/src/modules/courses/coursesPublic/ShixunChooseModal.js index f4f00e5e0..4c360c82a 100644 --- a/public/react/src/modules/courses/coursesPublic/ShixunChooseModal.js +++ b/public/react/src/modules/courses/coursesPublic/ShixunChooseModal.js @@ -101,6 +101,7 @@ class ShixunChooseModal extends Component{ return( shixunmodal===true? Date: Wed, 9 Oct 2019 10:43:54 +0800 Subject: [PATCH 142/200] =?UTF-8?q?=E8=B0=83=E6=95=B4=E7=BC=96=E8=BE=91?= =?UTF-8?q?=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../courses/busyWork/CommonWorkSetting.js | 5 +++-- .../modules/courses/exercise/Exercisesetting.js | 9 +++++---- .../graduation/tasks/GraduationTaskssetting.js | 7 +++++-- .../modules/courses/poll/PollDetailTabForth.js | 5 ++++- .../shixunHomework/Trainingjobsetting.js | 7 +++++-- public/stylesheets/educoder/edu-main.css | 17 +++++++++-------- 6 files changed, 31 insertions(+), 19 deletions(-) diff --git a/public/react/src/modules/courses/busyWork/CommonWorkSetting.js b/public/react/src/modules/courses/busyWork/CommonWorkSetting.js index 9f36996ef..3217b7318 100644 --- a/public/react/src/modules/courses/busyWork/CommonWorkSetting.js +++ b/public/react/src/modules/courses/busyWork/CommonWorkSetting.js @@ -1029,8 +1029,9 @@ class CommonWorkSetting extends Component{ 发布设置 { !startEditFlag && isAdmin ? - { this.setState({startEditFlag: true}) }}> - + { this.setState({startEditFlag: true}) }}> + 编辑设置 + {/**/} :"" } diff --git a/public/react/src/modules/courses/exercise/Exercisesetting.js b/public/react/src/modules/courses/exercise/Exercisesetting.js index 54a4306d8..ca1e6eddf 100644 --- a/public/react/src/modules/courses/exercise/Exercisesetting.js +++ b/public/react/src/modules/courses/exercise/Exercisesetting.js @@ -618,10 +618,11 @@ class Exercisesetting extends Component{ 发布设置 { !flagPageEdit&&this.props.isAdmin()===true ? - - - - + + 编辑设置 + {/**/} + {/**/} + {/**/} :"" } diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationTaskssetting.js b/public/react/src/modules/courses/graduation/tasks/GraduationTaskssetting.js index ff7564b8f..19980cca5 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduationTaskssetting.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduationTaskssetting.js @@ -1001,8 +1001,11 @@ debugger
    { !flagPageEdit && this.props.isAdmin() === true ? - + + 编辑设置 + {/**/} + : "" } {/*内容*/} diff --git a/public/react/src/modules/courses/poll/PollDetailTabForth.js b/public/react/src/modules/courses/poll/PollDetailTabForth.js index 57fd91cfd..a64f92b5b 100644 --- a/public/react/src/modules/courses/poll/PollDetailTabForth.js +++ b/public/react/src/modules/courses/poll/PollDetailTabForth.js @@ -518,7 +518,10 @@ class PollDetailTabForth extends Component{ { !flagPageEdit && isAdmin ? - + + 编辑设置 + {/**/} + :"" }

    diff --git a/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js b/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js index 23776ab1f..c9f0b7b53 100644 --- a/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js +++ b/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js @@ -2150,8 +2150,11 @@ class Trainingjobsetting extends Component { 发布设置 { !flagPageEdit && this.props.isAdmin() === true ? - + + 编辑设置 + {/**/} + : "" }

    diff --git a/public/stylesheets/educoder/edu-main.css b/public/stylesheets/educoder/edu-main.css index f283c1e95..64663634c 100644 --- a/public/stylesheets/educoder/edu-main.css +++ b/public/stylesheets/educoder/edu-main.css @@ -146,14 +146,15 @@ a.decoration{text-decoration: underline} .margin20{margin:20px;} /*行高*/ -.lineh-12{line-height: 12px} -.lineh-15{line-height: 15px} -.lineh-17{line-height: 17px} -.lineh-20{line-height: 20px} -.lineh-25{line-height: 25px} -.lineh-30{line-height: 30px} -.lineh-35{line-height: 35px} -.lineh-40{line-height: 40px} +.lineh-12{line-height: 12px !important;} +.lineh-15{line-height: 15px !important;} +.lineh-17{line-height: 17px !important;} +.lineh-20{line-height: 20px !important;} +.lineh-24{line-height: 24px !important;} +.lineh-25{line-height: 25px !important;} +.lineh-30{line-height: 30px !important;} +.lineh-35{line-height: 35px !important;} +.lineh-40{line-height: 40px !important;} /*pre标签换行*/ .break_word{word-break: break-all;word-wrap: break-word;} From 693f22ee8d06a34f0d41fb2697744512cacf3aa9 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Wed, 9 Oct 2019 10:45:19 +0800 Subject: [PATCH 143/200] =?UTF-8?q?top=5Fbanner=E5=A2=9E=E5=8A=A0first=5Fc?= =?UTF-8?q?ategory=5Furl?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/courses/top_banner.json.jbuilder | 1 + 1 file changed, 1 insertion(+) diff --git a/app/views/courses/top_banner.json.jbuilder b/app/views/courses/top_banner.json.jbuilder index 916fccb05..73cad0b76 100644 --- a/app/views/courses/top_banner.json.jbuilder +++ b/app/views/courses/top_banner.json.jbuilder @@ -25,4 +25,5 @@ json.excellent @course.excellent if @course.is_end == 0 json.days_remaining (@course.end_date.to_date - Time.now.to_date).to_i end +json.first_category_url module_url(@course.none_hidden_course_modules.first, @course) From 1dd52f9acc7ed40773899369e15f1426e0a7f8c9 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Wed, 9 Oct 2019 10:51:58 +0800 Subject: [PATCH 144/200] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/courses/top_banner.json.jbuilder | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/app/views/courses/top_banner.json.jbuilder b/app/views/courses/top_banner.json.jbuilder index 73cad0b76..877ffcdf1 100644 --- a/app/views/courses/top_banner.json.jbuilder +++ b/app/views/courses/top_banner.json.jbuilder @@ -24,6 +24,4 @@ json.course_identity @user_course_identity json.excellent @course.excellent if @course.is_end == 0 json.days_remaining (@course.end_date.to_date - Time.now.to_date).to_i -end -json.first_category_url module_url(@course.none_hidden_course_modules.first, @course) - +end \ No newline at end of file From 21462cd45e37ee2f42489cd43b46e24314756636 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Wed, 9 Oct 2019 10:57:38 +0800 Subject: [PATCH 145/200] =?UTF-8?q?=E8=B0=83=E6=95=B4=E8=B7=B3=E8=BD=AC?= =?UTF-8?q?=E4=BD=93=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../courses/coursesDetail/CoursesBanner.js | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/public/react/src/modules/courses/coursesDetail/CoursesBanner.js b/public/react/src/modules/courses/coursesDetail/CoursesBanner.js index 437471436..8bd1e980e 100644 --- a/public/react/src/modules/courses/coursesDetail/CoursesBanner.js +++ b/public/react/src/modules/courses/coursesDetail/CoursesBanner.js @@ -55,7 +55,11 @@ class CoursesBanner extends Component { } } componentDidMount() { - + if(this.props.match.path==="/courses/:coursesId"){ + if(this.props.user!=undefined){ + this.props.history.push(this.props.user.first_category_url) + } + } this.onloadupdatabanner() on('updatabanner', this.updatabanner) axios.interceptors.response.use((response) => { @@ -69,9 +73,17 @@ class CoursesBanner extends Component { } return response; }, (error) => { - }); } + componentDidUpdate(prevProps) { + if(prevProps.user!=this.props.user){ + if(this.props.match.path==="/courses/:coursesId"){ + if(this.props.user!=undefined){ + this.props.history.push(this.props.user.first_category_url) + } + } + } + } componentWillUnmount() { off('updatabanner', this.updatabanner) } From 28f9f03bebc7c44c5f0084476eaf4983550777ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Wed, 9 Oct 2019 10:58:22 +0800 Subject: [PATCH 146/200] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../react/src/modules/courses/coursesDetail/CoursesBanner.js | 5 ----- 1 file changed, 5 deletions(-) diff --git a/public/react/src/modules/courses/coursesDetail/CoursesBanner.js b/public/react/src/modules/courses/coursesDetail/CoursesBanner.js index 8bd1e980e..0f38971fd 100644 --- a/public/react/src/modules/courses/coursesDetail/CoursesBanner.js +++ b/public/react/src/modules/courses/coursesDetail/CoursesBanner.js @@ -55,11 +55,6 @@ class CoursesBanner extends Component { } } componentDidMount() { - if(this.props.match.path==="/courses/:coursesId"){ - if(this.props.user!=undefined){ - this.props.history.push(this.props.user.first_category_url) - } - } this.onloadupdatabanner() on('updatabanner', this.updatabanner) axios.interceptors.response.use((response) => { From 35937ad3c4fb96ac06a9eaf5e9ad91d9c026a718 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Wed, 9 Oct 2019 11:46:07 +0800 Subject: [PATCH 147/200] =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=B7=A6=E4=BE=A7?= =?UTF-8?q?=E8=AF=BE=E5=A0=82=E5=AF=BC=E8=88=AA=E6=A0=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../courses/coursesDetail/CoursesLeftNav.js | 90 +++++++++++++++---- .../react/src/modules/courses/css/Courses.css | 1 + 2 files changed, 76 insertions(+), 15 deletions(-) diff --git a/public/react/src/modules/courses/coursesDetail/CoursesLeftNav.js b/public/react/src/modules/courses/coursesDetail/CoursesLeftNav.js index 70794be19..a97a827b6 100644 --- a/public/react/src/modules/courses/coursesDetail/CoursesLeftNav.js +++ b/public/react/src/modules/courses/coursesDetail/CoursesLeftNav.js @@ -57,6 +57,7 @@ class Coursesleftnav extends Component{ positiontype:undefined, toopvisible:false, toopvisibleindex:undefined, + toopvisibleindexs:undefined, sandiantypes:undefined, antIcon:false, chapterupdate:false, @@ -314,7 +315,11 @@ class Coursesleftnav extends Component{ twosandianshow=(e,key,type)=>{ + // console.log("twosandianshow"); + // console.log(key); + // console.log(type); this.setState({ + toopvisibleindexs:key, twosandiantype:key, toopvisible:false, toopvisibleindex:undefined, @@ -322,11 +327,29 @@ class Coursesleftnav extends Component{ }) e.stopPropagation();//阻止冒泡 } - + twosandianshowys=(e,key,type)=>{ + // console.log("twosandianshow"); + // console.log(key); + // console.log(type); + this.setState({ + toopvisibleindexs:key, + }) + e.stopPropagation();//阻止冒泡 + } + twosandianshowyss=(e,key,type)=>{ + // console.log("twosandianshow"); + // console.log(key); + // console.log(type); + this.setState({ + toopvisibleindexs:undefined, + }) + e.stopPropagation();//阻止冒泡 + } twosandianhide=(e,index,type)=>{ // console.log(index) this.setState({ + toopvisibleindexs:undefined, twosandiantype:undefined, twosandiantypenum:undefined, toopvisible:true, @@ -336,6 +359,13 @@ class Coursesleftnav extends Component{ e.stopPropagation();//阻止冒泡 } + twosandianhideys=(e,index,type)=>{ + // console.log(index) + this.setState({ + toopvisibleindexs:undefined, + }) + e.stopPropagation();//阻止冒泡 + } //置顶 editSetup=(e,id)=>{ @@ -820,6 +850,7 @@ class Coursesleftnav extends Component{ ModalSave, loadtype, twosandiantypes, + toopvisibleindexs }=this.state; let {course_modules,hidden_modules,is_teacher} =this.props; @@ -992,6 +1023,8 @@ class Coursesleftnav extends Component{ } } } + // console.log(iem.category_name); + // console.log(iem.category_name.length); return( {(provided, snapshot) => ( {/*"/courses/"+this.props.match.params.coursesId+"/"+item.type+"/"+iem.category_type+"/"+iem.category_id*/} - -
  • this.selectnavids(e,key,iem.category_id,item.type+"child",iem.second_category_url,key)} onMouseLeave={(e)=>this.twosandianhide(e,index,item.type)} onMouseEnter={(e)=>this.twosandianshow(e,index,item.type)} + +
  • this.selectnavids(e,key,iem.category_id,item.type+"child",iem.second_category_url,key)} onMouseLeave={(e)=>this.twosandianhide(e,index,item.type)} onMouseEnter={(e)=>this.twosandianshow(e,index,item.type)} key={index} ref={provided.innerRef} {...provided.draggableProps} {...provided.dragHandleProps} - title={iem.category_name.length<10?"":iem.category_name} + // title={iem.category_name.length<10?"":iem.category_name} > - - {iem.category_name} + this.twosandianshowys(e,index,item.type)}>{iem.category_name} + {iem.category_count===0?"":iem.category_count} {item.type===twosandiantypes&&twosandiantype===index? iem.category_id===0?"": iem.category_type==="graduation_topics"||iem.category_type==="graduation_tasks"? - {iem.category_count===0?"":iem.category_count} - : + ( + iem.category_name.length<13? + {iem.category_count===0?"":iem.category_count} + : + + {iem.category_count===0?"":iem.category_count} + + ) + : + ( + iem.category_name.length<13? + this.twosandianshowyss(e)}> + + + : + + this.twosandianshowyss(e)}> - :""} + + + ) + :""} - {provided.placeholder} +
  • +
    )} @@ -1087,17 +1140,24 @@ class Coursesleftnav extends Component{ } } } + // console.log(iem.category_name); + // console.log(iem.category_name.length);一开始是10 显示是13 return( -
  • - this.selectnavids(e,key,iem.category_id,item.type+"child",iem.second_category_url,key)} > - - {/*{iem.category_name}*/} - {iem.category_name} + {/*title={iem.category_name.length<10?"":iem.category_name}*/} +
  • + + this.selectnavids(e,key,iem.category_id,item.type+"child",iem.second_category_url,key)} > + {/*{iem.category_name}*/} + {/*{iem.category_name.length<10?"":*/} + {/* iem.category_name}*/} + {iem.category_name} {iem.category_count===0?"":iem.category_count} +
  • + ) }) diff --git a/public/react/src/modules/courses/css/Courses.css b/public/react/src/modules/courses/css/Courses.css index 305c9f5f1..12c4e8d3e 100644 --- a/public/react/src/modules/courses/css/Courses.css +++ b/public/react/src/modules/courses/css/Courses.css @@ -427,6 +427,7 @@ a.white-btn.use_scope-btn:hover{ .ebebeb{border-bottom: 1px solid #EBEBEB;} .CheckboxGroup{background:rgba(249,249,249,1);} .maxwidth155{max-width: 155px; color:#666666;font-size: 14px;} +.maxwidth170{max-width: 170px; color:#666666;font-size: 14px;} .pl46{ margin-left: 46px !important; border-bottom: 1px solid #eeee; width: 90% !important;} .hidden{overflow: hidden;} .pd0{padding: 0px !important;} From e65b5730122bf5e8be009d39d819aa45f40f1583 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Wed, 9 Oct 2019 13:51:38 +0800 Subject: [PATCH 148/200] =?UTF-8?q?=E8=B0=83=E6=95=B4=E6=97=A0=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/modules/message/js/MessagSub.js | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/public/react/src/modules/message/js/MessagSub.js b/public/react/src/modules/message/js/MessagSub.js index f92ea71c4..24f2df5ed 100644 --- a/public/react/src/modules/message/js/MessagSub.js +++ b/public/react/src/modules/message/js/MessagSub.js @@ -6,7 +6,7 @@ import { import axios from 'axios'; import {getImageUrl, markdownToHTML} from 'educoder'; import "../css/messagemy.css" - +import NoneData from '../../../modules/courses/coursesPublic/NoneData' //消息页面 class MessagSub extends Component { constructor(props) { @@ -515,7 +515,7 @@ class MessagSub extends Component { render() { let {page, limit, typeysl, count, isSpin, data} = this.state; // console.log("6868686868"); - // console.log(data); + console.log(data); return (
    {/*头部筛选数据*/} @@ -549,11 +549,10 @@ class MessagSub extends Component { { - data === undefined ? "" : data.length === 0 ? -
    - -

    暂无数据哦~

    -
    + data === undefined ? + : + data.length === 0 ? + : data.map((item, key) => { // console.log(data) // ridinglist-subs From 8ff3babbb15285123131f3794f05a61c03b6b15d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Wed, 9 Oct 2019 13:56:01 +0800 Subject: [PATCH 149/200] =?UTF-8?q?=E8=B0=83=E6=95=B4=E6=8F=90=E7=A4=BA?= =?UTF-8?q?=E6=96=87=E5=AD=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/modules/courses/shixunHomework/Trainingjobsetting.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js b/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js index c9f0b7b53..4ae306158 100644 --- a/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js +++ b/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js @@ -2443,7 +2443,7 @@ class Trainingjobsetting extends Component {

    关卡名称(需要学生完成的任务请选中)

    + className="color-grey-c font-12 ml10">(需要学生完成的任务请选中,暂不支持跳关选择)

    {this.state.challenge_settings === undefined ? "" : this.state.challenge_settings.map((object, index) => { return ( From 76f7d94349771b0e25105bf0d9c3cd4e628f97d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Wed, 9 Oct 2019 14:00:01 +0800 Subject: [PATCH 150/200] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../shixunHomework/Trainingjobsetting.js | 72 +++++++++---------- 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js b/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js index 4ae306158..47f33327c 100644 --- a/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js +++ b/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js @@ -2147,7 +2147,7 @@ class Trainingjobsetting extends Component {

    - 发布设置 + 发布设置 { !flagPageEdit && this.props.isAdmin() === true ? @@ -2161,10 +2161,10 @@ class Trainingjobsetting extends Component { { group_settings&&group_settings.length>0?

    :
    } @@ -2180,7 +2180,7 @@ class Trainingjobsetting extends Component { unifiedsetting === undefined ? "" : unifiedsetting=== true ?
    - 发布时间: + 发布时间:
    - (学生收到作业的时间) + (学生收到作业的时间)

    { @@ -2213,7 +2213,7 @@ class Trainingjobsetting extends Component { }

    - 截止时间: + 截止时间:
    - (学生“按时”提交作品的时间截点) + (学生“按时”提交作品的时间截点)

    { @@ -2267,16 +2267,16 @@ class Trainingjobsetting extends Component { {/*补交设置*/}

    -
    补交设置
    +
    补交设置
    {/*value={this.state.allowreplenishment}*/}
    开启补交 (选中,则允许学生延时提交作品) + className={"font-14 ml10 color-grey-c"} style={{textAlign:"left",fontSize:"14px"}} >(选中,则允许学生延时提交作品)
    - 迟交扣分: + 迟交扣分: - (延时提交作品时,学生成绩将被扣减的分值) + (延时提交作品时,学生成绩将被扣减的分值) {/*{latepenaltytype===true?
    :""}*/}
    { @@ -2311,7 +2311,7 @@ class Trainingjobsetting extends Component { :"" }
    - 结束时间: + 结束时间: - (学生“延时”提交作品的时间截点) + (学生“延时”提交作品的时间截点) {/*{latetimetype===true?
    结束时间不能小于截止时间
    :""}*/} ") end @@ -335,7 +335,7 @@ class MyshixunsController < ApplicationController if edu_js.present? js_path = edu_js.split(",") js_path.each do |path| - file_content = GitService.file_content(repo_path: @repo_path, path: path)["content"] + file_content = GitService.git_fle_content(repo_path: @repo_path, path: path)["content"] file_content = tran_base64_decode64(file_content) unless file_content.blank? @contents = @contents.sub(/EDUCODERJS/, "") end From 343f33c4e4ef7fb002bf98ec0b2607f1ca7bf293 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Wed, 9 Oct 2019 21:24:04 +0800 Subject: [PATCH 169/200] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/myshixuns_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/myshixuns_controller.rb b/app/controllers/myshixuns_controller.rb index f8ab58e71..74f02f1ab 100644 --- a/app/controllers/myshixuns_controller.rb +++ b/app/controllers/myshixuns_controller.rb @@ -326,7 +326,7 @@ class MyshixunsController < ApplicationController if edu_css.present? css_path = edu_css.split(",") css_path.each do |path| - file_content = GitService.git_fle_content(repo_path: @repo_path, path: path)["content"] + file_content = git_fle_content(@repo_path, path)["content"] file_content = tran_base64_decode64(file_content) unless file_content.blank? @contents = @contents.sub(/EDUCODERCSS/, "") end @@ -335,7 +335,7 @@ class MyshixunsController < ApplicationController if edu_js.present? js_path = edu_js.split(",") js_path.each do |path| - file_content = GitService.git_fle_content(repo_path: @repo_path, path: path)["content"] + file_content = git_fle_content(@repo_path, path)["content"] file_content = tran_base64_decode64(file_content) unless file_content.blank? @contents = @contents.sub(/EDUCODERJS/, "") end From e0a80f2e49b93a145fcf46b3c8905ca732adc6f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Thu, 10 Oct 2019 09:02:28 +0800 Subject: [PATCH 170/200] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../courses/coursesDetail/CoursesLeftNav.js | 33 ++++++++++++------- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/public/react/src/modules/courses/coursesDetail/CoursesLeftNav.js b/public/react/src/modules/courses/coursesDetail/CoursesLeftNav.js index a97a827b6..e47f83c1f 100644 --- a/public/react/src/modules/courses/coursesDetail/CoursesLeftNav.js +++ b/public/react/src/modules/courses/coursesDetail/CoursesLeftNav.js @@ -1055,7 +1055,7 @@ class Coursesleftnav extends Component{ iem.category_id===0?"": iem.category_type==="graduation_topics"||iem.category_type==="graduation_tasks"? ( - iem.category_name.length<13? + iem.category_name&&iem.category_name.length<13? {iem.category_count===0?"":iem.category_count} : @@ -1064,7 +1064,7 @@ class Coursesleftnav extends Component{ ) : ( - iem.category_name.length<13? + iem.category_name&&iem.category_name.length<13? this.twosandianshowyss(e)}> @@ -1147,15 +1147,26 @@ class Coursesleftnav extends Component{ {/*title={iem.category_name.length<10?"":iem.category_name}*/}
  • - - this.selectnavids(e,key,iem.category_id,item.type+"child",iem.second_category_url,key)} > - {/*{iem.category_name}*/} - {/*{iem.category_name.length<10?"":*/} - {/* iem.category_name}*/} - {iem.category_name} - {iem.category_count===0?"":iem.category_count} - - + { + iem.category_name&&iem.category_name.length<13? + this.selectnavids(e,key,iem.category_id,item.type+"child",iem.second_category_url,key)} > + {/*{iem.category_name}*/} + {/*{iem.category_name.length<10?"":*/} + {/* iem.category_name}*/} + {iem.category_name} + {iem.category_count===0?"":iem.category_count} + + : + + this.selectnavids(e,key,iem.category_id,item.type+"child",iem.second_category_url,key)} > + {/*{iem.category_name}*/} + {/*{iem.category_name.length<10?"":*/} + {/* iem.category_name}*/} + {iem.category_name} + {iem.category_count===0?"":iem.category_count} + + + }
  • From 5fa875bf55e15d78766b7305e787e9593e76332a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Thu, 10 Oct 2019 09:07:13 +0800 Subject: [PATCH 171/200] =?UTF-8?q?=E8=B0=83=E6=95=B4=E7=A7=81=E6=9C=89?= =?UTF-8?q?=E5=B1=9E=E6=80=A7=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/modules/courses/Resource/Fileslistitem.js | 2 +- public/react/src/modules/courses/boards/BoardsListItem.js | 2 +- public/react/src/modules/courses/busyWork/CommonWorkItem.js | 2 +- public/react/src/modules/courses/exercise/ExerciseListItem.js | 2 +- .../src/modules/courses/graduation/tasks/GraduateTaskItem.js | 2 +- .../src/modules/courses/graduation/topics/GraduateTopicItem.js | 2 +- public/react/src/modules/courses/poll/PollListItem.js | 2 +- .../src/modules/courses/shixunHomework/ShixunhomeWorkItem.js | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/public/react/src/modules/courses/Resource/Fileslistitem.js b/public/react/src/modules/courses/Resource/Fileslistitem.js index 8027e94bb..418c201b5 100644 --- a/public/react/src/modules/courses/Resource/Fileslistitem.js +++ b/public/react/src/modules/courses/Resource/Fileslistitem.js @@ -242,7 +242,7 @@ class Fileslistitem extends Component{ { discussMessage.is_lock === true ? - + :"" diff --git a/public/react/src/modules/courses/boards/BoardsListItem.js b/public/react/src/modules/courses/boards/BoardsListItem.js index 021a41b7a..2b9c05126 100644 --- a/public/react/src/modules/courses/boards/BoardsListItem.js +++ b/public/react/src/modules/courses/boards/BoardsListItem.js @@ -70,7 +70,7 @@ class BoardsListItem extends Component{ { !!discussMessage.sticky && 置顶 } { - discussMessage.is_public == false ? ( + discussMessage.is_public == false ? ( ) : "" } diff --git a/public/react/src/modules/courses/busyWork/CommonWorkItem.js b/public/react/src/modules/courses/busyWork/CommonWorkItem.js index c92d91c48..75676557a 100644 --- a/public/react/src/modules/courses/busyWork/CommonWorkItem.js +++ b/public/react/src/modules/courses/busyWork/CommonWorkItem.js @@ -175,7 +175,7 @@ class CommonWorkItem extends Component{ {/* 只有非课堂成员且作业是私有的情况下才会为true */} { item.private_icon===true ? - ( + ( ) : "" } diff --git a/public/react/src/modules/courses/exercise/ExerciseListItem.js b/public/react/src/modules/courses/exercise/ExerciseListItem.js index 28ead276c..ef500ba0b 100644 --- a/public/react/src/modules/courses/exercise/ExerciseListItem.js +++ b/public/react/src/modules/courses/exercise/ExerciseListItem.js @@ -134,7 +134,7 @@ class ExerciseListItem extends Component{ { item.lock_status === 0 ? - + :"" diff --git a/public/react/src/modules/courses/graduation/tasks/GraduateTaskItem.js b/public/react/src/modules/courses/graduation/tasks/GraduateTaskItem.js index 427ef30d4..39a2f0876 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduateTaskItem.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduateTaskItem.js @@ -256,7 +256,7 @@ class GraduateTaskItem extends Component{ { this.props.discussMessage.private_icon===true? - + : diff --git a/public/react/src/modules/courses/graduation/topics/GraduateTopicItem.js b/public/react/src/modules/courses/graduation/topics/GraduateTopicItem.js index d11c90703..a2c19ecbd 100644 --- a/public/react/src/modules/courses/graduation/topics/GraduateTopicItem.js +++ b/public/react/src/modules/courses/graduation/topics/GraduateTopicItem.js @@ -103,7 +103,7 @@ class GraduateTopicItem extends Component{ } { discussMessage.private_icon===true? - + :"" diff --git a/public/react/src/modules/courses/poll/PollListItem.js b/public/react/src/modules/courses/poll/PollListItem.js index 9f13e5465..ec1eb2fa3 100644 --- a/public/react/src/modules/courses/poll/PollListItem.js +++ b/public/react/src/modules/courses/poll/PollListItem.js @@ -63,7 +63,7 @@ class PollListItem extends Component{ } { item.lock_status === 0 ? - + :"" diff --git a/public/react/src/modules/courses/shixunHomework/ShixunhomeWorkItem.js b/public/react/src/modules/courses/shixunHomework/ShixunhomeWorkItem.js index 085e7619f..557e1ca89 100644 --- a/public/react/src/modules/courses/shixunHomework/ShixunhomeWorkItem.js +++ b/public/react/src/modules/courses/shixunHomework/ShixunhomeWorkItem.js @@ -337,7 +337,7 @@ class ShixunhomeWorkItem extends Component{ { this.props.discussMessage.private_icon===true? - + : From d35e54e948f9e9927865f564952b2020f41e4440 Mon Sep 17 00:00:00 2001 From: p31729568 Date: Thu, 10 Oct 2019 09:17:25 +0800 Subject: [PATCH 172/200] modify wechat --- app/libs/wechat/app.rb | 11 +++++++++++ app/libs/wechat/client.rb | 6 +++++- app/libs/wechat/official_account.rb | 10 ++-------- 3 files changed, 18 insertions(+), 9 deletions(-) create mode 100644 app/libs/wechat/app.rb diff --git a/app/libs/wechat/app.rb b/app/libs/wechat/app.rb new file mode 100644 index 000000000..54f60fa2a --- /dev/null +++ b/app/libs/wechat/app.rb @@ -0,0 +1,11 @@ +class Wechat::App + class << self + attr_accessor :appid, :secret + + delegate :access_token, :jscode2session, to: :client + + def client + @_client ||= Wechat::Client.new(appid, secret) + end + end +end \ No newline at end of file diff --git a/app/libs/wechat/client.rb b/app/libs/wechat/client.rb index 0d34b9dda..5ac0a28f2 100644 --- a/app/libs/wechat/client.rb +++ b/app/libs/wechat/client.rb @@ -34,6 +34,10 @@ class Wechat::Client jsapi_ticket end + def jscode2session(code) + request(:get, '/sns/jscode2session', appid: appid, secret: secret, js_code: code, grant_type: 'authorization_code') + end + def access_token_cache_key "#{base_cache_key}/access_token" end @@ -49,7 +53,7 @@ class Wechat::Client private def request(method, url, **params) - Rails.logger.error("[wechat] request: #{method} #{url} #{params.inspect}") + Rails.logger.error("[wechat] request: #{method} #{url} #{params.except(:secret).inspect}") client = Faraday.new(url: BASE_SITE) response = client.public_send(method, url, params) diff --git a/app/libs/wechat/official_account.rb b/app/libs/wechat/official_account.rb index 320fbdba3..88208d6f3 100644 --- a/app/libs/wechat/official_account.rb +++ b/app/libs/wechat/official_account.rb @@ -2,20 +2,14 @@ class Wechat::OfficialAccount class << self attr_accessor :appid, :secret + delegate :access_token, :jsapi_ticket, to: :client + def js_sdk_signature(url, noncestr, timestamp) data = { jsapi_ticket: jsapi_ticket, noncestr: noncestr, timestamp: timestamp, url: url } str = data.map { |k, v| "#{k}=#{v}" }.join('&') Digest::SHA1.hexdigest(str) end - def access_token - client.access_token - end - - def jsapi_ticket - client.jsapi_ticket - end - def client @_client ||= Wechat::Client.new(appid, secret) end From 564b0bdd953b4593137c9cc868e73bd45ac09bd6 Mon Sep 17 00:00:00 2001 From: p31729568 Date: Thu, 10 Oct 2019 10:27:58 +0800 Subject: [PATCH 173/200] ecs: modify add course manager api --- .../ecs/course_managers_controller.rb | 3 ++- .../ecs/create_course_manager_service.rb | 26 ++++++++++--------- .../ecs/course_managers/create.json.jbuilder | 1 - 3 files changed, 16 insertions(+), 14 deletions(-) delete mode 100644 app/views/ecs/course_managers/create.json.jbuilder diff --git a/app/controllers/ecs/course_managers_controller.rb b/app/controllers/ecs/course_managers_controller.rb index 714dac580..132a212d7 100644 --- a/app/controllers/ecs/course_managers_controller.rb +++ b/app/controllers/ecs/course_managers_controller.rb @@ -3,7 +3,8 @@ class Ecs::CourseManagersController < Ecs::CourseBaseController before_action :check_major_manager_permission!, only: [:create, :destroy] def create - @user = Ecs::CreateCourseManagerService.call(current_course, params[:user_id]) + Ecs::CreateCourseManagerService.call(current_course, params[:user_ids]) + render_ok rescue Ecs::CreateCourseManagerService::Error => ex render_error(ex.message) end diff --git a/app/services/ecs/create_course_manager_service.rb b/app/services/ecs/create_course_manager_service.rb index 58e803bcf..162a0da55 100644 --- a/app/services/ecs/create_course_manager_service.rb +++ b/app/services/ecs/create_course_manager_service.rb @@ -3,27 +3,29 @@ class Ecs::CreateCourseManagerService < ApplicationService COURSE_MANAGER_COUNT_LIMIT = 2 # 课程管理员数量限制 - attr_reader :ec_course, :user_id + attr_reader :ec_course, :user_ids - def initialize(ec_course, user_id) + def initialize(ec_course, user_ids) @ec_course = ec_course - @user_id = user_id + @user_ids = user_ids end def call - user = User.find_by(id: params[:user_id]) - raise Error, '该用户不存在' if user.blank? + users_count = User.where(id: user_ids).count + raise Error, '用户不存在' if users_count != user_ids.size - if ec_course.ec_course_users.exists?(user_id: user.id) - raise Error, '该用户已经是该课程的管理员了' + if ec_course.ec_course_users.exists?(user_id: user_ids) + raise Error, '用户已经是该课程的管理员' end - if ec_course.ec_course_users.count >= COURSE_MANAGER_COUNT_LIMIT - raise Error, '该课程管理员数量已达上限' + if ec_course.ec_course_users.count + user_ids.size >= COURSE_MANAGER_COUNT_LIMIT + raise Error, "课程管理员数量过多(最多#{COURSE_MANAGER_COUNT_LIMIT})" end - ec_course.ec_course_users.create!(user: user) - - user + ActiveRecord::Base.transaction do + user_ids.each do |user_id| + ec_course.ec_course_users.create!(user_id: user_id) + end + end end end \ No newline at end of file diff --git a/app/views/ecs/course_managers/create.json.jbuilder b/app/views/ecs/course_managers/create.json.jbuilder deleted file mode 100644 index ff7ff01e5..000000000 --- a/app/views/ecs/course_managers/create.json.jbuilder +++ /dev/null @@ -1 +0,0 @@ -json.partial! 'ecs/shared/user', user: @user From 707d3c08ed126a3a294db1aea4e0da48770c1ed0 Mon Sep 17 00:00:00 2001 From: p31729568 Date: Thu, 10 Oct 2019 10:38:44 +0800 Subject: [PATCH 174/200] ecs: fix api --- app/services/ecs/create_course_manager_service.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/services/ecs/create_course_manager_service.rb b/app/services/ecs/create_course_manager_service.rb index 162a0da55..4d3633bfd 100644 --- a/app/services/ecs/create_course_manager_service.rb +++ b/app/services/ecs/create_course_manager_service.rb @@ -18,7 +18,7 @@ class Ecs::CreateCourseManagerService < ApplicationService raise Error, '用户已经是该课程的管理员' end - if ec_course.ec_course_users.count + user_ids.size >= COURSE_MANAGER_COUNT_LIMIT + if ec_course.ec_course_users.count + user_ids.size > COURSE_MANAGER_COUNT_LIMIT raise Error, "课程管理员数量过多(最多#{COURSE_MANAGER_COUNT_LIMIT})" end From acd913a588a5b60e1c6f70fca93ede519170b697 Mon Sep 17 00:00:00 2001 From: p31729568 Date: Thu, 10 Oct 2019 10:59:16 +0800 Subject: [PATCH 175/200] add template show api --- app/controllers/templates_controller.rb | 5 +++++ app/views/templates/show.json.jbuilder | 3 +++ config/routes.rb | 1 + 3 files changed, 9 insertions(+) create mode 100644 app/controllers/templates_controller.rb create mode 100644 app/views/templates/show.json.jbuilder diff --git a/app/controllers/templates_controller.rb b/app/controllers/templates_controller.rb new file mode 100644 index 000000000..efb114bdc --- /dev/null +++ b/app/controllers/templates_controller.rb @@ -0,0 +1,5 @@ +class TemplatesController < ApplicationController + def show + @template = EcTemplate.find_by_name!(params[:name]) + end +end \ No newline at end of file diff --git a/app/views/templates/show.json.jbuilder b/app/views/templates/show.json.jbuilder new file mode 100644 index 000000000..cff89037b --- /dev/null +++ b/app/views/templates/show.json.jbuilder @@ -0,0 +1,3 @@ +json.template do + json.partial! 'attachments/attachment_simple', attachment: @template.attachments.last +end \ No newline at end of file diff --git a/config/routes.rb b/config/routes.rb index 2c02c6a79..847afaa83 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -818,6 +818,7 @@ Rails.application.routes.draw do post :feedback end end + resource :template, only: [:show] end namespace :admins do From 92218bb829c12da5456247c6a99a95432c8f3ac0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Thu, 10 Oct 2019 14:31:50 +0800 Subject: [PATCH 176/200] =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=BE=97=E5=88=86?= =?UTF-8?q?=E8=A7=84=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../courses/busyWork/CommonWorkDetailIndex.js | 6 +-- .../busyWork/common/WorkDetailPageHeader.js | 6 +-- .../shixunHomework/Listofworksstudentone.js | 40 ++++++++++--------- .../shixunHomework/ShixunHomeworkPage.js | 4 +- .../shixunHomework/Trainingjobsetting.js | 7 +++- 5 files changed, 32 insertions(+), 31 deletions(-) diff --git a/public/react/src/modules/courses/busyWork/CommonWorkDetailIndex.js b/public/react/src/modules/courses/busyWork/CommonWorkDetailIndex.js index 8985aa07e..e49d4fb28 100644 --- a/public/react/src/modules/courses/busyWork/CommonWorkDetailIndex.js +++ b/public/react/src/modules/courses/busyWork/CommonWorkDetailIndex.js @@ -308,15 +308,11 @@ class CommonWorkDetailIndex extends Component{ onClick={() => this.setState({moduleName: '参考答案'})} className={`${childModuleName == '参考答案' ? 'active' : '' } `} to={`/courses/${courseId}/${moduleEngName}/${workId}/answer`}>参考答案} - - {this.props.isAdmin() ? this.setState({moduleName: '设置'})} className={`${childModuleName == '设置' ? 'active' : '' } `} style={{paddingLeft:'38px'}} - to={`/courses/${courseId}/${moduleEngName}/${workId}/setting`}>设置: - "" - } + to={`/courses/${courseId}/${moduleEngName}/${workId}/setting`}>{this.props.isAdmin()?"设置":"得分规则"} {/* { this.props.tabRightComponents } */} diff --git a/public/react/src/modules/courses/busyWork/common/WorkDetailPageHeader.js b/public/react/src/modules/courses/busyWork/common/WorkDetailPageHeader.js index 68a16d89e..89c9df772 100644 --- a/public/react/src/modules/courses/busyWork/common/WorkDetailPageHeader.js +++ b/public/react/src/modules/courses/busyWork/common/WorkDetailPageHeader.js @@ -144,13 +144,11 @@ class WorkDetailPageHeader extends Component{ {view_answer == true && 参考答案} - {this.props.isAdmin()? + 设置: - "" - } + to={`/courses/${courseId}/${moduleEngName}/${workId}/setting`}>{this.props.isAdmin()?"设置":"得分规则"} { this.props.tabRightComponents } diff --git a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js index 2380df531..73070497b 100644 --- a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js +++ b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js @@ -1535,6 +1535,7 @@ class Listofworksstudentone extends Component { // console.log("获取作品列表"); // console.log("935"); // debugger + let searchtype=this.props.history.location.search; let urll = `/homework_commons/${homeworkid}/works_list.json`; var datasysl = { search: this.state.searchtext, @@ -1587,13 +1588,14 @@ class Listofworksstudentone extends Component { if(this.props.isAdmin() === true){ if(result.data.update_score===true){ if(bool===true){ - + if(searchtype==="?tab=0"){ try { this.props.yslslowCheckresults(); }catch (e) { } - this.setComputeTimet(); + this.setComputeTimet(); + } } } } @@ -3242,21 +3244,25 @@ class Listofworksstudentone extends Component { {/*作品状态GraduationTaskssettinglist*/}
    :""} diff --git a/public/react/src/modules/courses/graduation/topics/index.js b/public/react/src/modules/courses/graduation/topics/index.js index ef4257e2e..2f02113bc 100644 --- a/public/react/src/modules/courses/graduation/topics/index.js +++ b/public/react/src/modules/courses/graduation/topics/index.js @@ -447,7 +447,7 @@ onBoardsNew=()=>{ { course_public && course_public==1 ?
  • this.onDelete(2)}>设为公开
  • :"" } -
  • this.onDelete(3)}>加入题库
  • + {/*
  • this.onDelete(3)}>加入题库
  • */} {/*
  • 加入题库
  • */}
    diff --git a/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js b/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js index a7ed222cd..9f9eb3d5e 100644 --- a/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js +++ b/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js @@ -1723,7 +1723,7 @@ class Trainingjobsetting extends Component { flagPageEditsthrees:deadline, flagPageEditsfor:endtime, completionefficiencyscore:true, - work_efficiencys:true, + work_efficiencys:this.state.work_efficiencys, unifiedsetting:this.state.unifiedsetting, latedeductiontwo:20, }); @@ -1839,7 +1839,7 @@ class Trainingjobsetting extends Component { flagPageEditsthrees:deadline, flagPageEditsfor:endtime, completionefficiencyscore:true, - work_efficiencys:true, + work_efficiencys:result.data.work_efficiency, unifiedsetting:datas.data.unified_setting, latedeductiontwo:20, }); diff --git a/public/react/src/modules/message/js/MessagSub.js b/public/react/src/modules/message/js/MessagSub.js index 24f2df5ed..791b5c063 100644 --- a/public/react/src/modules/message/js/MessagSub.js +++ b/public/react/src/modules/message/js/MessagSub.js @@ -545,7 +545,7 @@ class MessagSub extends Component { {/*下面内容页面*/}
    {/*这里可以进行数据处理*/} -
    +
    { @@ -641,23 +641,24 @@ class MessagSub extends Component { })} - {/*页数*/} - {data === undefined ? "" - : - (count > 10 ? -
    -
    - -
    -
    : "" - ) - }
    + {/*页数*/} + {data === undefined ? "" + : + (count > 10 ? +
    +
    + +
    +
    : "" + ) + + }
    ) } diff --git a/public/react/src/modules/message/js/MessagePrivate.js b/public/react/src/modules/message/js/MessagePrivate.js index ec7c20121..dc8e32e67 100644 --- a/public/react/src/modules/message/js/MessagePrivate.js +++ b/public/react/src/modules/message/js/MessagePrivate.js @@ -8,6 +8,7 @@ import moment from 'moment'; import {getImageUrl,markdownToHTML} from 'educoder'; import "../css/messagemy.css" import WriteaprivateletterModal from '../messagemodal/WriteaprivateletterModal'; +import NoneData from '../../../modules/courses/coursesPublic/NoneData' //私信页面 class MessagePrivate extends Component{ constructor(props) { @@ -160,11 +161,8 @@ class MessagePrivate extends Component{ { - data===undefined?"":data.length===0? -
    - -

    暂无数据哦~

    -
    + data===undefined? :data.length===0? + :data.map((item,key)=>{ return(
    this.smyJump(3,item.target.id)}> diff --git a/public/react/src/modules/user/usersInfo/InfosTopics.js b/public/react/src/modules/user/usersInfo/InfosTopics.js index 76979c9f5..3b76bfa28 100644 --- a/public/react/src/modules/user/usersInfo/InfosTopics.js +++ b/public/react/src/modules/user/usersInfo/InfosTopics.js @@ -297,8 +297,8 @@ class InfosTopics extends Component{ let categorylist=[ {val:"普通作业",type:"normal"}, {val:"分组作业",type:"group"}, - {val:"毕设选题",type:"gtopic"}, - {val:"毕设任务",type:"gtask"}, + // {val:"毕设选题",type:"gtopic"}, + // {val:"毕设任务",type:"gtask"}, {val:"试卷",type:"exercise"}, {val:"问卷",type:"poll"}, ] From c6c37bf5d7c5c7e4f616c05eeae3d6b60bfa4dac Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Thu, 10 Oct 2019 15:21:27 +0800 Subject: [PATCH 179/200] =?UTF-8?q?=E9=97=AE=E5=8D=B7=E7=9A=84=E6=8F=90?= =?UTF-8?q?=E4=BA=A4=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/polls_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/polls_controller.rb b/app/controllers/polls_controller.rb index 6be131d7a..dcbded6fe 100644 --- a/app/controllers/polls_controller.rb +++ b/app/controllers/polls_controller.rb @@ -692,7 +692,7 @@ class PollsController < ApplicationController else unified_setting = @poll.unified_setting end - show_result = params[:show_result].to_i + show_result = params[:show_result] un_anonymous = params[:un_anonymous] ? true : false # 统一设置或者分班为0,则更新问卷,并删除问卷分组 if unified_setting || (course_group_ids.size == 0) From 1c94493f2e0fab099883b73c891758931fdcba4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Thu, 10 Oct 2019 15:22:12 +0800 Subject: [PATCH 180/200] =?UTF-8?q?=E5=AE=89=E5=85=A8=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E4=B8=AD=E7=9A=84=E6=89=8B=E6=9C=BA=E5=92=8C=E9=82=AE=E7=AE=B1?= =?UTF-8?q?=E8=AF=B7=E4=BB=8E=E6=8E=A5=E5=8F=A3=E4=B8=AD=E8=AF=BB=E5=8F=96?= =?UTF-8?q?=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/modules/user/account/AccountSecure.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/react/src/modules/user/account/AccountSecure.js b/public/react/src/modules/user/account/AccountSecure.js index e5b03e36b..797b350d2 100644 --- a/public/react/src/modules/user/account/AccountSecure.js +++ b/public/react/src/modules/user/account/AccountSecure.js @@ -284,7 +284,7 @@ class AccountSecure extends Component {
    { basicInfo && basicInfo.phone ? - { regPhoneAndEmail(basicInfo.phone) } + { basicInfo.phone } : 未绑定 } @@ -348,7 +348,7 @@ class AccountSecure extends Component {
    { basicInfo && basicInfo.mail ? - { regPhoneAndEmail(basicInfo.mail) } + { basicInfo.mail } : 未绑定 } From 05a14d2a3e75c1e12b0af066f87e76b14cb38cad Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Thu, 10 Oct 2019 15:28:12 +0800 Subject: [PATCH 181/200] =?UTF-8?q?tpi=E7=9B=AE=E5=BD=95=E6=A0=91=EF=BC=8C?= =?UTF-8?q?=E5=BD=93=E7=9B=AE=E5=BD=95=E4=B8=8B=E6=B2=A1=E6=9C=89=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E6=97=B6=EF=BC=8C=E4=B8=80=E7=9B=B4=E5=A4=84=E4=BA=8E?= =?UTF-8?q?=E5=8A=A0=E8=BD=BD=E4=B8=AD=EF=BC=8C=E6=8A=A5=E8=84=9A=E6=9C=AC?= =?UTF-8?q?=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/page/main/CodeRepositoryViewContainer.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/public/react/src/modules/page/main/CodeRepositoryViewContainer.js b/public/react/src/modules/page/main/CodeRepositoryViewContainer.js index 279402e66..c30ec0386 100644 --- a/public/react/src/modules/page/main/CodeRepositoryViewContainer.js +++ b/public/react/src/modules/page/main/CodeRepositoryViewContainer.js @@ -21,8 +21,11 @@ function getNewTreeData(treeData, curKey, child, level) { data.forEach((item) => { // 这里不能用indexOf 同一级可能出现test目录和test.py文件 if (item.key == curKey) { - child = addPrePath(child, curKey); - item.children = child; + if (child && child.length) { // 可能没有子节点 + child = addPrePath(child, curKey); + item.children = child; + } + item.isLeaf = false; } else { if (item.children) { loop(item.children); @@ -153,6 +156,10 @@ class CodeRepositoryViewContainer extends Component { }); } map2OldData = (treeData) => { + if (!treeData || treeData.length == 0) { + return [] + } + if (!treeData || treeData.length === 0) return treeData; treeData = treeData.map(item => { return { From 1fd9315791837e23806072fac040e0ea19267e56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Thu, 10 Oct 2019 15:34:05 +0800 Subject: [PATCH 182/200] =?UTF-8?q?=E7=BB=9F=E4=B8=80=E8=A7=86=E9=A2=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../user/usersInfo/video/InfosVideo.js | 22 ++++++++++++++----- 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/public/react/src/modules/user/usersInfo/video/InfosVideo.js b/public/react/src/modules/user/usersInfo/video/InfosVideo.js index cb66434d0..dfda982f2 100644 --- a/public/react/src/modules/user/usersInfo/video/InfosVideo.js +++ b/public/react/src/modules/user/usersInfo/video/InfosVideo.js @@ -288,12 +288,22 @@ function InfoVideo (props) { 个视频 - {categoryObj.category == 'all' && } + {/*{categoryObj.category == 'all' && }*/} + + {categoryObj.category == 'all' &&
    +
  • + {sortKey=="published_at-desc"?"最新上传":"最早上传"} +
      +
    • onSortChange("published_at-desc",0)}>最新上传
    • +
    • onSortChange("published_at-asc",1)}>最早上传
    • +
    +
  • +
    }
    From 3f3484c8154045b190e130fdaa6a402676d3180b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Thu, 10 Oct 2019 15:42:08 +0800 Subject: [PATCH 183/200] =?UTF-8?q?=E8=B0=83=E6=95=B4=E8=AF=95=E5=8D=B7?= =?UTF-8?q?=E5=92=8C=E9=97=AE=E5=8D=B7=E7=BC=96=E8=BE=91=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../react/src/modules/courses/exercise/Exercisesetting.js | 4 ++++ public/react/src/modules/courses/poll/PollDetailTabForth.js | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/public/react/src/modules/courses/exercise/Exercisesetting.js b/public/react/src/modules/courses/exercise/Exercisesetting.js index ca1e6eddf..7b3732c9f 100644 --- a/public/react/src/modules/courses/exercise/Exercisesetting.js +++ b/public/react/src/modules/courses/exercise/Exercisesetting.js @@ -104,6 +104,10 @@ class Exercisesetting extends Component{ if(this.props.Commonheadofthetestpaper!=undefined){ this.editSetting() } + + if(this.props.isAdmin() === false){ + this.cancelEdit() + } } componentDidUpdate = (prevProps) => { if(prevProps.Commonheadofthetestpaper!= this.props.Commonheadofthetestpaper){ diff --git a/public/react/src/modules/courses/poll/PollDetailTabForth.js b/public/react/src/modules/courses/poll/PollDetailTabForth.js index a64f92b5b..e06e30223 100644 --- a/public/react/src/modules/courses/poll/PollDetailTabForth.js +++ b/public/react/src/modules/courses/poll/PollDetailTabForth.js @@ -86,6 +86,10 @@ class PollDetailTabForth extends Component{ if(this.props.pollDetail!=undefined){ this.editSetting(); } + + if(this.props.isAdmin() === false){ + this.cancelEdit() + } } componentDidUpdate = (prevProps) => { if(prevProps.pollDetail!= this.props.pollDetail){ @@ -640,7 +644,7 @@ class PollDetailTabForth extends Component{
    { - flagPageEdit ? + flagPageEdit&& this.props.isAdmin() === true ?
    取消 From 64294fa85f6c9a2fbaa3724740d323491a8821d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Thu, 10 Oct 2019 15:46:47 +0800 Subject: [PATCH 184/200] =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/modules/courses/shixunHomework/Trainingjobsetting.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js b/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js index 9f9eb3d5e..d5481a391 100644 --- a/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js +++ b/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js @@ -1839,7 +1839,7 @@ class Trainingjobsetting extends Component { flagPageEditsthrees:deadline, flagPageEditsfor:endtime, completionefficiencyscore:true, - work_efficiencys:result.data.work_efficiency, + work_efficiencys:datas.data.work_efficiency, unifiedsetting:datas.data.unified_setting, latedeductiontwo:20, }); From f8ca6f1792d00301dfa9f4a5c904943a92a13237 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Thu, 10 Oct 2019 15:48:26 +0800 Subject: [PATCH 185/200] =?UTF-8?q?=E8=B0=83=E6=95=B4=E8=B5=84=E6=BA=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/modules/courses/Resource/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/react/src/modules/courses/Resource/index.js b/public/react/src/modules/courses/Resource/index.js index 02b1d5be1..1fea29f84 100644 --- a/public/react/src/modules/courses/Resource/index.js +++ b/public/react/src/modules/courses/Resource/index.js @@ -593,7 +593,7 @@ class Fileslists extends Component{ modalname:"立即发布", visible:true, typs:"start", - Topval:"学生将能立即查看和下载发布资源", + Topval:"学生将能立即收到资源", // Botvalleft:"暂不发布", // Botval:`本操作只对"未发布"的分班有效`, // starttime:"发布时间:"+moment(moment(new Date())).format("YYYY-MM-DD HH:mm"), From ba862bc5bdb08612ccac46cdd39d096ad72cce1c Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Thu, 10 Oct 2019 15:55:15 +0800 Subject: [PATCH 186/200] =?UTF-8?q?=E5=88=86=E7=8F=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/modules/courses/Index.js | 5 ++++ .../src/modules/courses/ListPageIndex.js | 5 ++++ .../modules/courses/members/studentsList.js | 27 ++++++++++++++----- .../modules/courses/members/teacherList.js | 5 +++- 4 files changed, 35 insertions(+), 7 deletions(-) diff --git a/public/react/src/modules/courses/Index.js b/public/react/src/modules/courses/Index.js index c414df55a..70cc43f4c 100644 --- a/public/react/src/modules/courses/Index.js +++ b/public/react/src/modules/courses/Index.js @@ -661,6 +661,11 @@ class CoursesIndex extends Component{ (props) => () } > + () + } + > {/* 普通作业 */} () } > + () + } + > { const { course_groups , sortedInfo } = that.state let showSorter = isParent==true @@ -581,6 +583,16 @@ class studentsList extends Component{ // console.log(paramsString); // console.log(checkBoxValues); // console.log(searchValue); + let pageType = TYPE_STUDENTS + if (this.props.match.path.endsWith('students')) { + + } else if (course_group_id) { + pageType = TYPE_COURSE_GOURP_PARENT + } else { + pageType = TYPE_COURSE_GOURP_CHILD + } + + return( {course_group_name || '未分班'} {isAdmin && invite_code && @@ -617,15 +629,18 @@ class studentsList extends Component{ searchPlaceholder={ '请输入姓名、学号进行搜索' } firstRowRight={ - { isSuperAdmin && + { pageType !== TYPE_STUDENTS && isSuperAdmin && this.refs['createGroupByImportModal'].setVisible(true)}>导入创建分班 } - { !isCourseEnd && isAdmin && isParent && this.addDir()}>添加分班 } - { isAdmin && !isParent && course_group_id != 0 && this.deleteDir()}>删除分班 } - { isAdmin && !isParent && course_group_id != 0 && this.renameDir()}>分班重命名 } + { pageType !== TYPE_STUDENTS && + !isCourseEnd && isAdmin && isParent && this.addDir()}>添加分班 } + { + isAdmin && !isParent && course_group_id != 0 && this.deleteDir()}>删除分班 } + { + isAdmin && !isParent && course_group_id != 0 && this.renameDir()}>分班重命名 }

    - 可见:(学生可查看老师的评阅内容) + 可见(学生可查看老师的评阅内容)

    {/**/} {/*可见 (学生查看老师的评阅内容)*/} @@ -167,7 +167,7 @@ class AppraiseModal extends Component{ />

    - 不可见:(仅对课堂老师可见) + 不可见(仅对课堂老师可见)

    :""} -
    this.props.modalCloss()}> +
    :""} diff --git a/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js b/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js index d5481a391..142d1e074 100644 --- a/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js +++ b/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js @@ -2078,7 +2078,7 @@ class Trainingjobsetting extends Component { // console.log(this.props.isAdmin()) // console.log(this.state.code_review===false) // console.log("引入的分值"); - // console.log(this.state.work_efficiencys); + console.log(this.state.work_efficiencys); @@ -2186,7 +2186,7 @@ class Trainingjobsetting extends Component {
    发布时间: - +
    截止时间: - +
    Date: Thu, 10 Oct 2019 17:14:28 +0800 Subject: [PATCH 192/200] window.location.reload() --- public/react/src/modules/courses/members/modal/AddAdminModal.js | 1 + 1 file changed, 1 insertion(+) diff --git a/public/react/src/modules/courses/members/modal/AddAdminModal.js b/public/react/src/modules/courses/members/modal/AddAdminModal.js index 5ca1867e7..80ad75f66 100644 --- a/public/react/src/modules/courses/members/modal/AddAdminModal.js +++ b/public/react/src/modules/courses/members/modal/AddAdminModal.js @@ -95,6 +95,7 @@ class AddAdminModal extends Component{ user_id: this.state.radioBoxValue.user_id }).then((result)=>{ if(result.data.status==0){ + window.location.reload() this.props.showNotification('操作成功。') // this.fetchAll() this.setVisible(false) From 7f09f745c36bbdc6021bd60412fea60744124016 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Thu, 10 Oct 2019 17:21:10 +0800 Subject: [PATCH 193/200] =?UTF-8?q?this.props.showNotification('=E6=93=8D?= =?UTF-8?q?=E4=BD=9C=E6=88=90=E5=8A=9F=E3=80=82')?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/modules/courses/members/modal/AddAdminModal.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/react/src/modules/courses/members/modal/AddAdminModal.js b/public/react/src/modules/courses/members/modal/AddAdminModal.js index 80ad75f66..a1ec2e8f0 100644 --- a/public/react/src/modules/courses/members/modal/AddAdminModal.js +++ b/public/react/src/modules/courses/members/modal/AddAdminModal.js @@ -95,8 +95,8 @@ class AddAdminModal extends Component{ user_id: this.state.radioBoxValue.user_id }).then((result)=>{ if(result.data.status==0){ - window.location.reload() this.props.showNotification('操作成功。') + window.location.reload() // this.fetchAll() this.setVisible(false) this.props.changeAdminSuccess && this.props.changeAdminSuccess() From a86c3478052784e4ef3ebe52a822054663acbfdf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Thu, 10 Oct 2019 17:30:10 +0800 Subject: [PATCH 194/200] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/modules/courses/shixunHomework/Listofworksstudentone.js | 1 + 1 file changed, 1 insertion(+) diff --git a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js index 73070497b..0cd04f5d5 100644 --- a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js +++ b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js @@ -3344,6 +3344,7 @@ class Listofworksstudentone extends Component { ` .edu-position-hide li a:hover { background: #F0F0F0; + color: #05101A; } ` } From abb5ec8cfd871d5754cd2c3378556c7ad9e65a23 Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Thu, 10 Oct 2019 17:45:08 +0800 Subject: [PATCH 195/200] if (this.props.isCourseAdmin()) { --- .../src/modules/courses/members/modal/AddAdminModal.js | 4 +++- public/react/src/modules/tpm/TPMIndexHOC.js | 7 ++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/public/react/src/modules/courses/members/modal/AddAdminModal.js b/public/react/src/modules/courses/members/modal/AddAdminModal.js index a1ec2e8f0..5cbf0c204 100644 --- a/public/react/src/modules/courses/members/modal/AddAdminModal.js +++ b/public/react/src/modules/courses/members/modal/AddAdminModal.js @@ -96,7 +96,9 @@ class AddAdminModal extends Component{ }).then((result)=>{ if(result.data.status==0){ this.props.showNotification('操作成功。') - window.location.reload() + if (this.props.isCourseAdmin()) { + window.location.reload() + } // this.fetchAll() this.setVisible(false) this.props.changeAdminSuccess && this.props.changeAdminSuccess() diff --git a/public/react/src/modules/tpm/TPMIndexHOC.js b/public/react/src/modules/tpm/TPMIndexHOC.js index c39042308..dd4572bcc 100644 --- a/public/react/src/modules/tpm/TPMIndexHOC.js +++ b/public/react/src/modules/tpm/TPMIndexHOC.js @@ -222,7 +222,7 @@ export function TPMIndexHOC(WrappedComponent) { # 课程权限判断 ADMIN = 0 # 超级管理员 BUSINESS = 1 # 运营人员 - CREATOR = 2 # 课程创建者 + CREATOR = 2 # 课程创建者 课堂管理员 PROFESSOR = 3 # 课程老师 ASSISTANT_PROFESSOR = 4 # 课程助教 STUDENT = 5 # 学生 @@ -233,6 +233,9 @@ export function TPMIndexHOC(WrappedComponent) { isSuperAdmin = () => { // return false return this.state.coursedata&&this.state.coursedata.course_identity === 0 + } + isCourseAdmin = () => { + return this.state.coursedata&&this.state.coursedata.course_identity === 2 } //超管、运维0-1 isClassManagement = () => { @@ -537,6 +540,8 @@ export function TPMIndexHOC(WrappedComponent) { isSuperAdmin:this.isSuperAdmin, isAdminOrCreator:this.isAdminOrCreator, isClassManagement:this.isClassManagement, + isCourseAdmin:this.isCourseAdmin, + isAdmin: this.isAdmin, isAdminOrTeacher: this.isAdminOrTeacher, isStudent: this.isStudent, From d54d26e7b1338b55c80ee23d7cc28bbb95758a24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Thu, 10 Oct 2019 17:51:31 +0800 Subject: [PATCH 196/200] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/modules/courses/graduation/tasks/GraduationAcross.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/public/react/src/modules/courses/graduation/tasks/GraduationAcross.js b/public/react/src/modules/courses/graduation/tasks/GraduationAcross.js index b3fd37878..18dac8041 100644 --- a/public/react/src/modules/courses/graduation/tasks/GraduationAcross.js +++ b/public/react/src/modules/courses/graduation/tasks/GraduationAcross.js @@ -189,7 +189,8 @@ class GraduationAcross extends Component{ cross_teachers: item.cross_teachers, student_id:item.student_id, user_name:item.user_name, - work_id:item.work_id + work_id:item.work_id, + cross_groups:item.cross_groups } return list; }), From a91cf878c0bb5e18f406842cccd6f88779b1a745 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Fri, 11 Oct 2019 09:44:04 +0800 Subject: [PATCH 197/200] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../courses/shixunHomework/Listofworksstudentone.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js index 0cd04f5d5..5eed392d5 100644 --- a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js +++ b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js @@ -2627,9 +2627,11 @@ class Listofworksstudentone extends Component { // return // } this.setState({ - loadingstate: true + loadingstate: true, + page:1, + limit:20, }) - this.Startsortingt(this.state.orders, this.state.course_groupyslstwo, this.state.checkedValuesineinfo, value, this.state.page, this.state.limit); + this.Startsortingt(this.state.orders, this.state.course_groupyslstwo, this.state.checkedValuesineinfo, value, 1,20); // console.log(value) @@ -2641,9 +2643,11 @@ class Listofworksstudentone extends Component { // this.onSearch(); // console.log("使用了回车键"); this.setState({ - loadingstate: true + loadingstate: true, + page:1, + limit:20, }) - this.Startsortingt(this.state.orders, this.state.course_groupyslstwo, this.state.checkedValuesineinfo, this.state.searchtext, this.state.page, this.state.limit); + this.Startsortingt(this.state.orders, this.state.course_groupyslstwo, this.state.checkedValuesineinfo, this.state.searchtext, 1,20); } } //排序 From 764d0cc071242da038549a43e960234d78514698 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Fri, 11 Oct 2019 09:48:49 +0800 Subject: [PATCH 198/200] =?UTF-8?q?=E6=AF=95=E8=AE=BE=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E7=9A=84=E6=88=AA=E6=AD=A2=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/graduation_tasks/_public_navigation.json.jbuilder | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/views/graduation_tasks/_public_navigation.json.jbuilder b/app/views/graduation_tasks/_public_navigation.json.jbuilder index 00280c31b..992d03fd8 100644 --- a/app/views/graduation_tasks/_public_navigation.json.jbuilder +++ b/app/views/graduation_tasks/_public_navigation.json.jbuilder @@ -2,4 +2,5 @@ json.partial! "graduation_topics/show_navigation", locals: {course: course, grad json.task_status task_curr_status(graduation, course)[:status] json.task_name graduation.name json.task_id graduation.id -json.status graduation.status \ No newline at end of file +json.status graduation.status +json.end_time graduation.end_time \ No newline at end of file From 3ed24f333d611fa69ad87defdfee4671b4045584 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Fri, 11 Oct 2019 11:09:59 +0800 Subject: [PATCH 199/200] =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=AE=9E=E8=AE=AD?= =?UTF-8?q?=E4=BD=9C=E4=B8=9A=E6=8F=8F=E8=BF=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/modules/courses/shixunHomework/ShixunhomeWorkItem.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/react/src/modules/courses/shixunHomework/ShixunhomeWorkItem.js b/public/react/src/modules/courses/shixunHomework/ShixunhomeWorkItem.js index 557e1ca89..4ebe801c5 100644 --- a/public/react/src/modules/courses/shixunHomework/ShixunhomeWorkItem.js +++ b/public/react/src/modules/courses/shixunHomework/ShixunhomeWorkItem.js @@ -354,8 +354,8 @@ class ShixunhomeWorkItem extends Component{ {/* {discussMessage.author.name} */} { discussMessage.author && {discussMessage.author} } - {discussMessage.commit_count===undefined?"":{discussMessage.commit_count} 已交} - {discussMessage.uncommit_count===undefined?"":{discussMessage.uncommit_count} 未交} + {discussMessage.commit_count===undefined?"":{discussMessage.commit_count} 已开始做题} + {discussMessage.uncommit_count===undefined?"":{discussMessage.uncommit_count} 未开始做题} {/*{discussMessage.replies_count} 3 未评*/} { From 4846cb348747d9491ea886802a338c06729a38bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Fri, 11 Oct 2019 11:24:46 +0800 Subject: [PATCH 200/200] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/modules/courses/shixunHomework/ShixunhomeWorkItem.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/react/src/modules/courses/shixunHomework/ShixunhomeWorkItem.js b/public/react/src/modules/courses/shixunHomework/ShixunhomeWorkItem.js index 4ebe801c5..8b63a3471 100644 --- a/public/react/src/modules/courses/shixunHomework/ShixunhomeWorkItem.js +++ b/public/react/src/modules/courses/shixunHomework/ShixunhomeWorkItem.js @@ -381,7 +381,7 @@ class ShixunhomeWorkItem extends Component{ { discussMessage && discussMessage.upper_category_name && 22 }> - { {discussMessage.upper_category_name}} + { {discussMessage.upper_category_name}} }