From a05860387a071c628f12f4838ffbda4093224188 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Thu, 8 Aug 2019 09:40:40 +0800 Subject: [PATCH 1/9] =?UTF-8?q?=E8=80=81=E7=94=A8=E6=88=B7=EF=BC=88?= =?UTF-8?q?=E5=85=B7=E4=BD=93=E5=8E=9F=E5=9B=A0=E6=9C=AA=E7=9F=A5=EF=BC=89?= =?UTF-8?q?=E5=9C=A8=E4=B8=AA=E4=BA=BA=E4=B8=BB=E9=A1=B5=E4=BB=8D=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E4=B8=BA=E8=AF=95=E7=94=A8=E7=94=B3=E8=AF=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/homepage_info.json.jbuilder | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/users/homepage_info.json.jbuilder b/app/views/users/homepage_info.json.jbuilder index 1621448f3..3fabd110b 100644 --- a/app/views/users/homepage_info.json.jbuilder +++ b/app/views/users/homepage_info.json.jbuilder @@ -16,7 +16,7 @@ json.college_identifier @user.college_identifier json.followed User.current.watched?(@user) if @user.logged_user? - json.can_apply_trial @user.can_apply_trial? + #json.can_apply_trial @user.can_apply_trial? json.attendance_signed @user.attendance_signed? json.tomorrow_attendance_gold @user.tomorrow_attendance_gold end From 9c8e70eb4d1b35d63a3eb908d6499fe85aad83ee Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Thu, 8 Aug 2019 10:05:13 +0800 Subject: [PATCH 2/9] =?UTF-8?q?=E5=B8=96=E5=AD=90=E8=AF=A6=E6=83=85?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=EF=BC=8Cmemo=E5=A2=9E=E5=8A=A0=E8=BF=94?= =?UTF-8?q?=E5=9B=9E=E5=AD=97=E6=AE=B5forum=5Fid=EF=BC=8C=E7=94=A8?= =?UTF-8?q?=E4=BA=8E=E5=89=8D=E7=AB=AF=E9=9D=A2=E5=8C=85=E5=B1=91=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E7=9B=AE=E5=BD=95=E4=BF=A1=E6=81=AF=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/memos/_memo.json.jbuilder | 1 + 1 file changed, 1 insertion(+) diff --git a/app/views/memos/_memo.json.jbuilder b/app/views/memos/_memo.json.jbuilder index f0ac5cd3d..f0d2c147f 100644 --- a/app/views/memos/_memo.json.jbuilder +++ b/app/views/memos/_memo.json.jbuilder @@ -1,5 +1,6 @@ json.memo do json.id memo.id + json.forum_id memo.forum_id json.subject memo.subject json.is_md memo.is_md json.content memo.content From 5d87411130b8448c5c1cf8c52be293b3e5739768 Mon Sep 17 00:00:00 2001 From: caishi <1149225589@qq.com> Date: Thu, 8 Aug 2019 10:11:19 +0800 Subject: [PATCH 3/9] =?UTF-8?q?=E4=B8=AA=E4=BA=BA=E4=B8=BB=E9=A1=B5?= =?UTF-8?q?=E5=8E=BB=E6=8E=89=E8=AF=95=E7=94=A8=E7=94=B3=E8=AF=B7=E6=8C=89?= =?UTF-8?q?=E9=92=AE=EF=BC=8C=EF=BC=88=E8=AF=95=E7=94=A8=E7=94=B3=E8=AF=B7?= =?UTF-8?q?=E6=B5=81=E7=A8=8B=E5=B7=B2=E7=BB=8F=E5=8E=BB=E9=99=A4=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/modules/user/usersInfo/Infos.js | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/public/react/src/modules/user/usersInfo/Infos.js b/public/react/src/modules/user/usersInfo/Infos.js index 343f8ac59..80b223e43 100644 --- a/public/react/src/modules/user/usersInfo/Infos.js +++ b/public/react/src/modules/user/usersInfo/Infos.js @@ -342,16 +342,14 @@ class Infos extends Component{ is_current ?
{ - data && data.can_apply_trial == false ? - data.attendance_signed ? - - 已签到 -

明日签到 +{next_gold} 金币

-
- : - 签到 + data && data.attendance_signed ? + + 已签到 +

明日签到 +{next_gold} 金币

+
: - 试用申请 + 签到 + // 试用申请 }
: From 405020dbf0c312f8757bd8ca638426af7df2065a Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Thu, 8 Aug 2019 10:27:11 +0800 Subject: [PATCH 4/9] =?UTF-8?q?=E6=9C=AA=E5=AE=8C=E5=96=84=E8=B5=84?= =?UTF-8?q?=E6=96=99=E4=B8=8D=E6=8F=90=E7=A4=BA=E4=BB=BB=E4=BD=95=E4=BF=A1?= =?UTF-8?q?=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/application_controller.rb | 4 ++-- app/views/memos/_memo.json.jbuilder | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 7aa89dbd7..64ba19e5f 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -189,8 +189,8 @@ class ApplicationController < ActionController::Base # 资料是否完善 def check_account if !current_user.profile_completed? - info_url = '/account/profile' - tip_exception(402, info_url) + #info_url = '/account/profile' + tip_exception(402) end end diff --git a/app/views/memos/_memo.json.jbuilder b/app/views/memos/_memo.json.jbuilder index f0d2c147f..a09b7f293 100644 --- a/app/views/memos/_memo.json.jbuilder +++ b/app/views/memos/_memo.json.jbuilder @@ -10,6 +10,6 @@ json.memo do json.tag memo.tag_repertoires.map(&:name) json.time memo.created_at json.replies_count memo.all_replies_count - json.user_praise memo.praise_treads.user_liker(@user.try(:id)).count > 0 ? true : false + json.user_praise memo.praise_treads.user_liker(@user.try(:id)).count > 0 json.memo_praise_count memo.praise_treads.liker.count end From 05e48faf7a1a1a654bc4f7edc8c6225dbe02554d Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Thu, 8 Aug 2019 10:28:08 +0800 Subject: [PATCH 5/9] =?UTF-8?q?=E6=A0=B7=E5=BC=8F=E9=87=8D=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../courses/members/modal/AddTeacherModal.js | 75 ++++++++++--------- 1 file changed, 39 insertions(+), 36 deletions(-) diff --git a/public/react/src/modules/courses/members/modal/AddTeacherModal.js b/public/react/src/modules/courses/members/modal/AddTeacherModal.js index 7dfda8c11..02bf59106 100644 --- a/public/react/src/modules/courses/members/modal/AddTeacherModal.js +++ b/public/react/src/modules/courses/members/modal/AddTeacherModal.js @@ -219,8 +219,7 @@ class AddTeacherModal extends Component{ } .df span.label { margin-right: 8px; - text-align: right; - margin-left: 12px; + text-align: left; } .df .ant-input-affix-wrapper { width: 32%; @@ -232,11 +231,11 @@ class AddTeacherModal extends Component{ `}
- 姓名: + 姓名: {this.setState({name: e.target.value})}} - style={{ width: '200px'}}> + style={{ width: '200px', marginRight: '18px' }}> - 单位: + 单位: 搜索
{/* graduation_groups && !!graduation_groups.length */} - { this.hasGraduationModule() &&
- 答辩组: - -
} - { course_groups && !!course_groups.length &&
- 管理权限: - -
} +

@@ -339,6 +308,40 @@ class AddTeacherModal extends Component{ : } +

+ { this.hasGraduationModule() &&
+ 添加至答辩组: + +
} + + { course_groups && !!course_groups.length &&
+ 管理权限: + +
} +
) } From 9302b69fcdf7c84f60e4943cbab37434149e9263 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, 8 Aug 2019 10:46:40 +0800 Subject: [PATCH 6/9] =?UTF-8?q?=E7=94=B3=E8=AF=B7=E6=96=B0=E5=BB=BA?= =?UTF-8?q?=E8=84=9A=E6=9C=AC=E7=A7=BB=E6=A4=8D=E5=88=B0=E7=BC=96=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/modules/tpm/TPMBanner.js | 23 +- .../modules/tpm/TPMsettings/TPMsettings.js | 390 +++++++++++++++--- .../tpm/TPMsettings/css/TPMsettings.css | 12 +- .../src/modules/tpm/newshixuns/Newshixuns.js | 8 +- .../modules/tpm/newshixuns/css/Newshixuns.css | 3 + .../src/modules/tpm/shixuns/css/TPMBanner.css | 5 + 6 files changed, 370 insertions(+), 71 deletions(-) diff --git a/public/react/src/modules/tpm/TPMBanner.js b/public/react/src/modules/tpm/TPMBanner.js index 26e2350a6..b5059cf34 100644 --- a/public/react/src/modules/tpm/TPMBanner.js +++ b/public/react/src/modules/tpm/TPMBanner.js @@ -900,18 +900,25 @@ class TPMBanner extends Component { {this.state.Senttothevcaluetype===true?
请选择你要发送的课堂
:""} -
- 12 ? "block" : "none"}} +
12 ? "block" : "none"}}> + +
- 确定 +
+
+
+
+ 取消 + 确定 +
- 取消 -
+ +
diff --git a/public/react/src/modules/tpm/TPMsettings/TPMsettings.js b/public/react/src/modules/tpm/TPMsettings/TPMsettings.js index 2e34bcffb..ef79f739f 100644 --- a/public/react/src/modules/tpm/TPMsettings/TPMsettings.js +++ b/public/react/src/modules/tpm/TPMsettings/TPMsettings.js @@ -3,7 +3,7 @@ import React, { Component } from 'react'; import MonacoEditor from 'react-monaco-editor'; //MonacoDiffEditor 对比模式 -import {Input, Select, Radio, Checkbox, Popconfirm, message, Modal,Icon,DatePicker,Breadcrumb} from 'antd'; +import {Input, Select, Radio, Checkbox, Popconfirm, message, Modal,Icon,DatePicker,Breadcrumb,Upload,Button,notification} from 'antd'; // import "antd/dist/antd.css"; @@ -207,6 +207,7 @@ export default class TPMsettings extends Component { constructor(props) { super(props) this.state = { + fileList: [], commandLine: 0, Openpublic: 0, settingsData: undefined, @@ -268,7 +269,8 @@ export default class TPMsettings extends Component { pod_exist_time: undefined, pod_exist_timetype: false, shixunmemoMDvalue:"", - language:"" + language:"", + deleteisnot:true } } descriptionMD=(initValue, id)=> { @@ -1011,32 +1013,160 @@ export default class TPMsettings extends Component { }) } - sendsure_apply = () => { - let {sendsure_applyvalue} = this.state; - let url = "/shixuns/apply_shixun_mirror.json"; - axios.post(url, { - note: sendsure_applyvalue - }).then((response) => { - if (response.status === 200) { - if (response.data.status == 1) { - this.setState({ - postapplyvisible: false, - postapplytitle: true - }) - } + setlanguagewrite = (e)=>{ + this.setState({ + languagewrite: e.target.value + }) + } - } - }).catch((error) => { - console.log(error) - }); + setsystemenvironment = (e) => { + this.setState({ + systemenvironment: e.target.value + }) + } - } + settestcoderunmode = (e) => { + this.setState({ + testcoderunmode: e.target.value + }) - sendhideModaly = () => { - this.setState({ - postapplyvisible: false - }) - } + } + + sendsure_apply = () => { + let {languagewrite,systemenvironment,testcoderunmode} = this.state; + // console.log("点击确定") + // console.log("languagewrite"+languagewrite); + // console.log("systemenvironment"+systemenvironment); + // console.log("testcoderunmode"+testcoderunmode); + + // let attachment_ids = undefined + // if (this.state.fileList) { + // attachment_ids = this.state.fileList.map(item => { + // return item.response ? item.response.id : item.id + // }) + // } + if(languagewrite === undefined || languagewrite === "" ){ + // this.props.showNotification(`请填写该镜像是基于什么语言`); + this.setState({ + languagewritetype:true + }) + return + } + if(systemenvironment === undefined || systemenvironment === ""){ + // this.props.showNotification(`请填写该镜像是基于什么语言系统环境`); + this.setState({ + systemenvironmenttype:true + }) + return; + + } + if(testcoderunmode === undefined || testcoderunmode === "") { + // this.props.showNotification(`请填写该镜像中测试代码运行方式`); + this.setState({ + testcoderunmodetype:true + }) + return; + } + var attachment_ids=undefined; + if (this.state.fileList) { + attachment_ids = this.state.fileList.map(item => { + return item.response ? item.response.id : item.id + }) + } + + if( attachment_ids === undefined || attachment_ids.length===0){ + + // notification.open( + // { + // message: '提示', + // description: + // '请上传附件!', + // + // } + // ) + this.setState({ + attachmentidstype:true + }) + return; + } + // console.log("attachment_ids"+attachment_ids); + + // alert(languagewrite +" "+systemenvironment +" "+testcoderunmode + " "+attachment_ids); + + var data={ + language:languagewrite, + runtime:systemenvironment, + run_method:testcoderunmode, + attachment_id:attachment_ids[0], + } + var url =`/shixuns/apply_shixun_mirror.json`; + axios.post(url,data + ).then((response) => { + + try { + if (response.data) { + // const { id } = response.data; + // if (id) { + if(this.state.file !== undefined){ + console.log("549"); + // this.deleteAttachment(this.state.file); + this.setState({ + file:undefined, + languagewrite:"", + systemenvironment:"", + testcoderunmode:"", + }) + }else { + this.setState({ + file:undefined, + languagewrite:"", + systemenvironment:"", + testcoderunmode:"", + }) + } + // this.props.showNotification('提交成功!'); + notification.open( + { + message: '提示', + description: + '提交成功!', + + } + ) + this.sendhideModaly() + // this.props.history.push(`/courses/${cid}/graduation_topics`); + // } + } + }catch (e) { + + } + + }) + + } + + sendhideModaly = () => { + this.setState({ + postapplyvisible: false, + }) + if(this.state.file !== undefined){ + console.log("580"); + // this.deleteAttachment(this.state.file); + this.setState({ + file:undefined, + languagewrite:"", + systemenvironment:"", + testcoderunmode:"", + }) + }else { + this.setState({ + file:undefined, + languagewrite:"", + systemenvironment:"", + testcoderunmode:"", + }) + } + } yeshidemodel = () => { this.setState({ @@ -1198,29 +1328,76 @@ export default class TPMsettings extends Component { }) } + handleChange = (info) => { + console.log("handleChange1"); + let fileList = info.fileList; + this.setState({ fileList:fileList, + deleteisnot:false}); + } + + onAttachmentRemove = (file) => { + confirm({ + title: '确定要删除这个附件吗?', + okText: '确定', + cancelText: '取消', + // content: 'Some descriptions', + onOk: () => { + console.log("665") + this.deleteAttachment(file) + }, + onCancel() { + console.log('Cancel'); + }, + }); + return false; + } + + deleteAttachment = (file) => { + console.log(file); + let id=file.response ==undefined ? file.id : file.response.id + const url = `/attachments/${id}.json` + axios.delete(url, { + }) + .then((response) => { + if (response.data) { + const { status } = response.data; + if (status == 0) { + // console.log('--- success') + + this.setState((state) => { + + const index = state.fileList.indexOf(file); + const newFileList = state.fileList.slice(); + newFileList.splice(index, 1); + return { + fileList: newFileList, + deleteisnot:true + }; + }); + } + } + }) + .catch(function (error) { + console.log(error); + }); + } + + - render() { + render() { let { postapplyvisible, - sendsure_applyvalue, postapplytitle, shixunnametype, shixunmaintype, evaluate_scripttype, - exec_timetype, traineetype, standard_scripts, - description, - evaluate_script, name, settingsData, webssh, use_scope, - shixunsstatus, shixunsID, - exec_time, - pod_exist_time, - pod_exist_timetype, can_copy, choice_standard_scripts, Executiveordervalue, @@ -1241,19 +1418,15 @@ export default class TPMsettings extends Component { standard_scriptsModal, standard_scriptsModals, SelectTheCommandtype, - status, - opers, - operss, - opersss, testscripttiptype, operateshixunstype, opening_time, - opensmail, scope_partmenttype, newuse_scope, scope_partments, shixunmemoMDvalue,delType, - shixun_service_configs + shixun_service_configs, + fileList, } = this.state; let options; @@ -1265,7 +1438,46 @@ export default class TPMsettings extends Component { ) }) } + const uploadProps = { + width: 600, + fileList, + multiple: true, + // https://github.com/ant-design/ant-design/issues/15505 + // showUploadList={false},然后外部拿到 fileList 数组自行渲染列表。 + // showUploadList: false, + action: `${getUrl()}/api/attachments.json`, + onChange: this.handleChange, + onRemove: this.onAttachmentRemove, + beforeUpload: (file) => { + // console.log('beforeUpload', file.name); + const isLt150M = file.size / 1024 / 1024 < 50; + if (!isLt150M) { + // this.props.showNotification(`文件大小必须小于50MB`); + notification.open( + { + message: '提示', + description: + '文件大小必须小于50MB', + + } + ) + } + if(thiss.state.file !== undefined){ + console.log("763") + // thiss.deleteAttachment(thiss.state.file); + thiss.setState({ + file:file + }) + }else { + thiss.setState({ + file:file + }) + } + console.log("handleChange2"); + return isLt150M; + }, + } const dateFormat = 'YYYY-MM-DD HH:mm:ss'; let operateauthority=this.props.identity===1?true:this.props.identity<5&&this.state.status==0?true:false; @@ -1391,13 +1603,13 @@ export default class TPMsettings extends Component { }) } - {/**/} - {/*列表中没有?*/} - {/*申请新建*/} - {/*

*/} +

+ 列表中没有? + 申请新建 +

-
  • - +
  • + + style={{width:'89%',height:'100px'}} + onInput={this.setlanguagewrite} + value={this.state.languagewrite} + placeholder="请填写该镜像是基于什么语言:示例:Python" + id="demand_info"> +
  • +
    {this.state.languagewritetype===true?"请填写该镜像语言":""}
    +
  • + + +
  • +
    {this.state.systemenvironmenttype===true?"请填写该镜像语言系统环境":""}
    +
  • + + + +
  • +
    {this.state.testcoderunmodetype===true?"请填写该镜像测试代码运行方式":""}
    +
  • + +
    + { + this.state.deleteisnot=== true? + + + 上传附件 + (单个文件50M以内) + + + : + + + 上传附件 + (单个文件50M以内) + + + } +
    +
  • +
    + {this.state.attachmentidstype===true?"请上传附件":""} +
    +
  • + this.sendhideModaly()} + >取消 +
  • - this.sendsure_apply()} - className="task-btn task-btn-orange fr mr12">确定 - this.sendhideModaly()} - >取消
    +
    + + + {/*
    */}
    -
  • +
  • {this.state.languagewritetype===true?"请填写该镜像语言":""}
    -
  • +