diff --git a/app/controllers/hack_user_lastest_codes_controller.rb b/app/controllers/hack_user_lastest_codes_controller.rb index b7ec6fb8e..814d16d51 100644 --- a/app/controllers/hack_user_lastest_codes_controller.rb +++ b/app/controllers/hack_user_lastest_codes_controller.rb @@ -23,7 +23,7 @@ class HackUserLastestCodesController < ApplicationController # 同步代码 def sync_code - @my_hack.update_attributes(code: @hack.code, modify_time: @hack.modify_time) + @my_hack.update_attributes(code: @hack.code, modify_time: Time.now) end # 调试代码 diff --git a/public/react/src/AppConfig.js b/public/react/src/AppConfig.js index 064c64db1..d88d5f05f 100644 --- a/public/react/src/AppConfig.js +++ b/public/react/src/AppConfig.js @@ -33,7 +33,7 @@ if (isDev) { // 超管 // debugType="admin"; // 老师 -// debugType="teacher"; +//ebugType="teacher"; // 学生 //debugType="student"; diff --git a/public/react/src/common/components/ModalConfirm.js b/public/react/src/common/components/ModalConfirm.js new file mode 100644 index 000000000..bb29fed03 --- /dev/null +++ b/public/react/src/common/components/ModalConfirm.js @@ -0,0 +1,30 @@ +/* + * @Description: + * @Author: tangjiang + * @Github: + * @Date: 2019-12-13 10:28:15 + * @LastEditors: tangjiang + * @LastEditTime: 2019-12-13 10:37:17 + */ +import { Modal } from 'antd'; + +export function ModalConfirm ( + title, + content, + handleOk, + handleCancel +) { + + Modal.confirm({ + title, + content, + okText: '确定', + cancelText: '取消', + onOk () { + handleOk && handleOk(); + }, + onCancel () { + handleCancel && handleCancel(); + } + }); +} diff --git a/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js b/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js index 1bf7ac181..10b12eb0a 100644 --- a/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js +++ b/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js @@ -315,6 +315,7 @@ class ShixunWorkReport extends Component { // let showAppraiseModals=this.props&&this.props.isAdminOrTeacher()===true?work_comment===null||work_comment===undefined?false:true:work_comment===null||work_comment===undefined?false:true; let showAppraiseModals=work_comment===null||work_comment===undefined?false:true; document.title=data&&data.course_name; + return ( data===undefined?"": @@ -366,10 +367,15 @@ class ShixunWorkReport extends Component {

{data&&data.shixun_name}

{/*{this.props.isAdmin()?导出实训报告数据:""}*/} 返回 - this.confirmysl(`/student_works/${homeworkid}/export_shixun_work_report.pdf`)} - > 导出实训报告数据 + > 导出实训报告数据: + parseInt(this.props&&this.props.user.user_id)===parseInt(data&&data.user_id)?this.confirmysl(`/student_works/${homeworkid}/export_shixun_work_report.pdf`)} + > 导出实训报告数据:"" + } {/*{this.props.isAdmin() ?work_comment_hidden===true? "":this.showAppraiseModal(1)}*/} diff --git a/public/react/src/modules/developer/DeveloperHome.js b/public/react/src/modules/developer/DeveloperHome.js index 178e13ef5..5f787659e 100644 --- a/public/react/src/modules/developer/DeveloperHome.js +++ b/public/react/src/modules/developer/DeveloperHome.js @@ -44,6 +44,13 @@ const maps = { 'value': '2' } ], + 'languageMenu': [ + { + 'key': 'c', + 'name': 'C语言', + 'value': 'c' + } + ], 'difficultMenu': [ { 'key': '1', @@ -119,15 +126,14 @@ class DeveloperHome extends React.PureComponent { > {/* */} - ), @@ -197,7 +203,6 @@ class DeveloperHome extends React.PureComponent { componentDidMount() { // 是否是我的,如果是我的 显示编辑按钮 const { isMySource } = this.props; - console.log(this.props); if (isMySource) { this.handleFilterSearch({come_from: 'mine'}); let _columns = this.columns.concat([this.options]); @@ -346,6 +351,14 @@ class DeveloperHome extends React.PureComponent { }); this.handleFilterSearch({category: +item.key === 0 ? '' : +item.key}); } + // 下拉语言 + handleLanguageMenuClick = (item) => { + this.addShowFilterCtx({ + type: 'language', + key: item.key + }); + this.handleFilterSearch({language: item.key}) + } // 难度下拉 handleHardMenuClick = (item) => { this.addShowFilterCtx({ @@ -421,6 +434,7 @@ class DeveloperHome extends React.PureComponent { // const { testReducer, handleClick } = this.props; const { ojListReducer: {hacks_list, top_data, hacks_count}, + user, pagination } = this.props; const {passed_count = 0, simple_count = 0, medium_count = 0, diff_count = 0} = top_data; @@ -443,7 +457,11 @@ class DeveloperHome extends React.PureComponent { >{ctx} )}); }; - + // console.log('=====>>>>>>>>>.', this.props); + + const newBtnStyle = user && (user.admin || (user.is_teacher && user.professional_certification) || user.business) + ? { display: 'block'} + : { display: 'none'}; return (
@@ -457,7 +475,8 @@ class DeveloperHome extends React.PureComponent {
-
@@ -468,6 +487,9 @@ class DeveloperHome extends React.PureComponent { 分类 + + 语言 + 难度 diff --git a/public/react/src/modules/developer/components/controlSetting/index.js b/public/react/src/modules/developer/components/controlSetting/index.js index 690bbad36..587e1bee9 100644 --- a/public/react/src/modules/developer/components/controlSetting/index.js +++ b/public/react/src/modules/developer/components/controlSetting/index.js @@ -4,7 +4,7 @@ * @Github: * @Date: 2019-11-27 16:02:36 * @LastEditors: tangjiang - * @LastEditTime: 2019-12-10 09:30:27 + * @LastEditTime: 2019-12-13 17:32:33 */ import './index.scss'; import React, { useState, useRef } from 'react'; @@ -84,7 +84,7 @@ const ControlSetting = (props) => { diff --git a/public/react/src/modules/developer/components/controlSetting/index.scss b/public/react/src/modules/developer/components/controlSetting/index.scss index 4a2c221c1..97838ce5c 100644 --- a/public/react/src/modules/developer/components/controlSetting/index.scss +++ b/public/react/src/modules/developer/components/controlSetting/index.scss @@ -2,6 +2,7 @@ position: absolute; bottom: 0; width: 100%; + background:rgba(30,30,30,1); // height: 56px; .control_tab{ position: absolute; @@ -51,7 +52,8 @@ height: 56px; padding-right: 30px; padding-left: 10px; - background: #000; + // background: #000; + background:rgba(48,48,48,1); } .setting_drawer{ diff --git a/public/react/src/modules/developer/components/initTabCtx/index.js b/public/react/src/modules/developer/components/initTabCtx/index.js index 19f4230b1..3834a3e11 100644 --- a/public/react/src/modules/developer/components/initTabCtx/index.js +++ b/public/react/src/modules/developer/components/initTabCtx/index.js @@ -4,7 +4,7 @@ * @Github: * @Date: 2019-11-27 19:46:14 * @LastEditors: tangjiang - * @LastEditTime: 2019-12-10 09:31:00 + * @LastEditTime: 2019-12-13 17:38:42 */ import './index.scss'; import React, { useState, useEffect, useRef, useImperativeHandle, forwardRef } from 'react'; @@ -50,6 +50,7 @@ function InitTabCtx (props, ref) { ], initialValue: inputValue })(