issues25489
commit
1686fb6c81
@ -0,0 +1,33 @@
|
|||||||
|
wb = xlsx_package.workbook
|
||||||
|
|
||||||
|
wb.styles do |s|
|
||||||
|
blue_cell = s.add_style :bg_color => "FAEBDC", :sz => 10,:height => 25,:b => true, :border => { :style => :thin, :color =>"000000" },:alignment => {wrap_text: true,:horizontal => :center,:vertical => :center}
|
||||||
|
wb.add_worksheet(name: "#{@competition.name}证书审批列表") do |sheet|
|
||||||
|
sheet.add_row %w(序号 排名 奖项 战队ID 战队名称 姓名 职业 学号 学校名称 学院名称 地区 实名认证 职业认证 手机号码 队长 签领/开户行及银行卡号 审批时间 审批人), :height => 25,:style => blue_cell
|
||||||
|
|
||||||
|
@all_prize_users.each_with_index do |prize_user, index|
|
||||||
|
user = prize_user.user
|
||||||
|
data = [
|
||||||
|
index + 1,
|
||||||
|
prize_user.rank,
|
||||||
|
prize_user.competition_prize.name,
|
||||||
|
prize_user.competition_team_id,
|
||||||
|
prize_user.competition_team.name,
|
||||||
|
user.real_name,
|
||||||
|
user.identity,
|
||||||
|
user.student_id,
|
||||||
|
user.school_name,
|
||||||
|
user.department_name,
|
||||||
|
user.location,
|
||||||
|
user.auth_status,
|
||||||
|
user.pro_status,
|
||||||
|
user.phone,
|
||||||
|
prize_user.leader? ? "是" : "-",
|
||||||
|
[prize_user.extra&.[]('bank'), prize_user.extra&.[]('second_bank'), prize_user.extra&.[]('card_no')].compact.join('/'),
|
||||||
|
prize_user.approved_at&.strftime('%Y-%m-%d %H:%M'),
|
||||||
|
prize_user.approver&.real_name
|
||||||
|
]
|
||||||
|
sheet.add_row(data)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
@ -1,2 +1,2 @@
|
|||||||
json.extract! message, :id, :parent_id, :subject, :created_on, :total_replies_count, :total_praises_count,
|
json.extract! message, :id, :parent_id, :subject, :created_on, :total_replies_count, :total_praises_count,
|
||||||
:is_md, :praises_count, :visits, :sticky, :is_hidden, :is_public
|
:is_md, :praises_count, :visits, :sticky, :is_hidden, :is_public, :email_notify
|
||||||
|
@ -0,0 +1,5 @@
|
|||||||
|
class AddEmailNotifyToMessages < ActiveRecord::Migration[5.2]
|
||||||
|
def change
|
||||||
|
add_column :messages, :email_notify, :boolean, default: 0
|
||||||
|
end
|
||||||
|
end
|
After Width: | Height: | Size: 153 KiB |
@ -0,0 +1,111 @@
|
|||||||
|
import React, { Component } from 'react';
|
||||||
|
import {Button, Card, Row, Col ,Upload,Icon,message,Tabs,Form,Input} from 'antd';
|
||||||
|
import axios from 'axios';
|
||||||
|
import {getImageUrl,getUrl} from 'educoder';
|
||||||
|
import TPMMDEditor from '../tpm/challengesnew/TPMMDEditor';
|
||||||
|
class Osshackathonmd extends Component{
|
||||||
|
constructor(props) {
|
||||||
|
super(props)
|
||||||
|
this.contentMdRef = React.createRef();
|
||||||
|
this.state={
|
||||||
|
title_num: 0,
|
||||||
|
title_value: undefined
|
||||||
|
}
|
||||||
|
}
|
||||||
|
componentDidUpdate =(prevState)=>{
|
||||||
|
// if(prevState!=this.props){
|
||||||
|
// let url=`/osshackathon/edit_hackathon.json`;
|
||||||
|
// axios.get(url).then((result)=>{
|
||||||
|
// if(result.status==200){
|
||||||
|
// this.setState({
|
||||||
|
// title_value:result.data.name
|
||||||
|
// })
|
||||||
|
// this.contentMdRef.current.setValue(result.data.description);
|
||||||
|
// }
|
||||||
|
// })
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
componentDidMount(){
|
||||||
|
let url=`/osshackathon/edit_hackathon.json`;
|
||||||
|
axios.get(url).then((result)=>{
|
||||||
|
if(result.status==200){
|
||||||
|
this.setState({
|
||||||
|
title_value:result.data.name
|
||||||
|
})
|
||||||
|
this.contentMdRef.current.setValue(result.data.description);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 输入title
|
||||||
|
changeTitle = (e) => {
|
||||||
|
// title_num: 60 - parseInt(e.target.value.length),
|
||||||
|
this.setState({
|
||||||
|
title_num: e.target.value.length,
|
||||||
|
title_value: e.target.value
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
handleSubmit = () => {
|
||||||
|
let {title_value}=this.state;
|
||||||
|
const mdContnet = this.contentMdRef.current.getValue().trim();
|
||||||
|
// if(mdContnet.length>10000){
|
||||||
|
// this.props.showNotification("内容超过10000个字");
|
||||||
|
// return
|
||||||
|
// }
|
||||||
|
|
||||||
|
let url=`/osshackathon/update_hackathon.json`;
|
||||||
|
axios.post(url,{
|
||||||
|
name:title_value,
|
||||||
|
description:mdContnet,
|
||||||
|
}
|
||||||
|
).then((response) => {
|
||||||
|
if(response.data.status===0){
|
||||||
|
this.props.getosshackathon()
|
||||||
|
this.props.hidehackathonedit()
|
||||||
|
this.props.showNotification(`提交成功`);
|
||||||
|
}
|
||||||
|
}).catch((error) => {
|
||||||
|
console.log(error)
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
render() {
|
||||||
|
|
||||||
|
|
||||||
|
// console.log(this.props.tabkey)
|
||||||
|
// console.log(chart_rules)
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className={"mt20"}>
|
||||||
|
<Form>
|
||||||
|
<Form.Item label="标题">
|
||||||
|
<Input placeholder="请输入标题"
|
||||||
|
value={this.state.title_value}
|
||||||
|
onInput={this.changeTitle}
|
||||||
|
className="searchView searchViewAfter h45input" style={{"width": "100%"}} maxLength="60"
|
||||||
|
addonAfter={String(this.state.title_value===undefined?0:this.state.title_value.length)+"/60"}
|
||||||
|
/>
|
||||||
|
</Form.Item>
|
||||||
|
|
||||||
|
<Form.Item label="描述">
|
||||||
|
<TPMMDEditor ref={this.contentMdRef} placeholder="请输入描述" mdID={'courseContentMD'} refreshTimeout={1500}
|
||||||
|
className="courseMessageMD" initValue={this.state.description}></TPMMDEditor>
|
||||||
|
</Form.Item>
|
||||||
|
</Form>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<div className="clearfix mt30 mb30">
|
||||||
|
<div className={"fr"}>
|
||||||
|
<Button type="primary" onClick={this.handleSubmit} className="defalutSubmitbtn fl mr20">提交</Button>
|
||||||
|
<a className="defalutCancelbtn fl" onClick={() => this.props.hidehackathonedit()}>取消</ a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
export default Osshackathonmd;
|
@ -0,0 +1,217 @@
|
|||||||
|
import React, { Component } from 'react';
|
||||||
|
import {Button, Card, Row, Col ,Upload,Icon,message,Tabs,Form,Input,Modal} from 'antd';
|
||||||
|
import axios from 'axios';
|
||||||
|
import {getImageUrl,getUrl,WordNumberTextarea} from 'educoder';
|
||||||
|
|
||||||
|
class Osshackathonmodel extends Component{
|
||||||
|
constructor(props) {
|
||||||
|
super(props)
|
||||||
|
this.state={
|
||||||
|
title_num: 0,
|
||||||
|
title_value: undefined,
|
||||||
|
Textarea_comment:undefined
|
||||||
|
}
|
||||||
|
}
|
||||||
|
componentDidUpdate =(prevState)=>{
|
||||||
|
// if(prevState!=this.props){
|
||||||
|
// let name=this.props&&this.props.modelname;
|
||||||
|
// let mdvalue=this.props&&this.props.modeldescription;
|
||||||
|
// this.setState({
|
||||||
|
// title_value:name,
|
||||||
|
// Textarea_comment:mdvalue
|
||||||
|
// })
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
componentDidMount(){
|
||||||
|
if(this.props.modelid===undefined){
|
||||||
|
this.setState({
|
||||||
|
title_value:undefined,
|
||||||
|
Textarea_comment:undefined
|
||||||
|
})
|
||||||
|
}else{
|
||||||
|
let url=`/osshackathon/${this.props.modelid}/edit.json`;
|
||||||
|
axios.get(url).then((result)=>{
|
||||||
|
if(result.status==200){
|
||||||
|
this.setState({
|
||||||
|
title_value:result.data.name,
|
||||||
|
Textarea_comment:result.data.description
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
handleSubmit = () => {
|
||||||
|
let {title_value,Textarea_comment}=this.state;
|
||||||
|
// if(mdContnet.length>10000){
|
||||||
|
// this.props.showNotification("内容超过10000个字");
|
||||||
|
// return
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
|
||||||
|
if(this.props.modelid===undefined){
|
||||||
|
let url=`/osshackathon.json`;
|
||||||
|
axios.post(url,{
|
||||||
|
name:title_value,
|
||||||
|
description:Textarea_comment,
|
||||||
|
}
|
||||||
|
).then((response) => {
|
||||||
|
if(response.data.status===0){
|
||||||
|
|
||||||
|
this.props.getosshackathon()
|
||||||
|
this.props.hideeditSignupentry()
|
||||||
|
this.props.showNotification(`提交成功`);
|
||||||
|
}
|
||||||
|
}).catch((error) => {
|
||||||
|
console.log(error)
|
||||||
|
})
|
||||||
|
}else{
|
||||||
|
let url=`/osshackathon/${this.props.modelid}.json`
|
||||||
|
axios.put(url,{
|
||||||
|
name:title_value,
|
||||||
|
description:Textarea_comment,
|
||||||
|
}
|
||||||
|
).then((response) => {
|
||||||
|
if(response.data.status===0){
|
||||||
|
|
||||||
|
this.props.getosshackathon()
|
||||||
|
this.props.hideeditSignupentry()
|
||||||
|
this.props.showNotification(`提交成功`);
|
||||||
|
}
|
||||||
|
}).catch((error) => {
|
||||||
|
console.log(error)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
changeTitle=(e)=>{
|
||||||
|
this.setState({
|
||||||
|
title_value:e.target.value,
|
||||||
|
title_num:e.target.value.length,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
Textarea_comment=(e)=>{
|
||||||
|
this.setState({
|
||||||
|
Textarea_comment:e.target.value,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
render() {
|
||||||
|
let {textareavaltype}=this.state;
|
||||||
|
// console.log(this.props.tabkey)
|
||||||
|
console.log(this.props.Osshackathonmodeltype)
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
{
|
||||||
|
`
|
||||||
|
@media (max-width: 2000px) {
|
||||||
|
.WordNumberTextarea{
|
||||||
|
height: 130px !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width: 1350px) {
|
||||||
|
.HomeworkModal{
|
||||||
|
top:10px !important;
|
||||||
|
}
|
||||||
|
.WordNumberTextarea{
|
||||||
|
height: 80px !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width: 1250px) {
|
||||||
|
.HomeworkModal{
|
||||||
|
top:0px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.WordNumberTextarea{
|
||||||
|
height: 40px !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
`
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<Modal
|
||||||
|
keyboard={false}
|
||||||
|
className={"HomeworkModal"}
|
||||||
|
title={"新建项目"}
|
||||||
|
visible={this.props.Osshackathonmodeltype}
|
||||||
|
closable={false}
|
||||||
|
footer={null}
|
||||||
|
destroyOnClose={true}
|
||||||
|
>
|
||||||
|
|
||||||
|
<div className={"pd015"}>
|
||||||
|
<style>
|
||||||
|
{
|
||||||
|
`
|
||||||
|
.pd015{
|
||||||
|
padding: 0px 15px 15px 15px;
|
||||||
|
}
|
||||||
|
.font{
|
||||||
|
font-size: 14px;
|
||||||
|
font-weight: 400;
|
||||||
|
color: rgba(5,16,26,1);
|
||||||
|
}
|
||||||
|
.newfont{
|
||||||
|
height: 16px;
|
||||||
|
font-size: 16px;
|
||||||
|
font-weight: 400;
|
||||||
|
color: rgba(5,16,26,1);
|
||||||
|
line-height: 16px;
|
||||||
|
margin-bottom: 5px;
|
||||||
|
}
|
||||||
|
.Osshackathonmodelinput .ant-input, .ant-input .ant-input-suffix{
|
||||||
|
background: #fff !important;
|
||||||
|
}
|
||||||
|
.Osshackathonmodelinput .ant-input-group-wrapper{
|
||||||
|
width:510px !important;
|
||||||
|
margin-left: 10px;
|
||||||
|
}
|
||||||
|
`
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<div className="clearfix">
|
||||||
|
<p className={"font mt10 mb10 ml10"}>
|
||||||
|
名称
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<Input placeholder="请输入项目名称"
|
||||||
|
value={this.state.title_value}
|
||||||
|
onInput={(e)=>this.changeTitle(e)}
|
||||||
|
className={"Osshackathonmodelinput"}
|
||||||
|
style={{"width": "100%"}} maxLength="60"
|
||||||
|
addonAfter={String(this.state.title_value===undefined?0:this.state.title_value.length)+"/60"}
|
||||||
|
/>
|
||||||
|
|
||||||
|
<p className={"font mt10 mb10 ml10"}>
|
||||||
|
描述
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<WordNumberTextarea
|
||||||
|
placeholder={"请输入项目描述"}
|
||||||
|
onInput={(e)=>this.Textarea_comment(e)}
|
||||||
|
value={this.state.Textarea_comment}
|
||||||
|
maxlength={500}
|
||||||
|
/>
|
||||||
|
|
||||||
|
<li style={{height:"20px",lineHeight:"20px"}} className={textareavaltype===true?"color-red mt20 mb10":"none"}><span>评阅内容至少有一个不为空</span></li>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className={textareavaltype===false?"mt20 clearfix edu-txt-center":"clearfix edu-txt-center mt20"}>
|
||||||
|
<a className="task-btn color-white mr30" onClick={()=>this.props.hideeditSignupentry()}>取消</a>
|
||||||
|
<a className="task-btn task-btn-orange" onClick={()=>this.handleSubmit()}>确定</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</Modal>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
export default Osshackathonmodel;
|
Loading…
Reference in new issue