Merge branch 'dev_aliyun' of http://bdgit.educoder.net/Hjqreturn/educoder into dev_aliyun

dev_daiao
cxt 6 years ago
commit 2a98c58638

@ -2,7 +2,7 @@ import React, {Component} from 'react';
import './public-path'; import './public-path';
import logo from './logo.svg'; import logo from './logo.svg';
import './App.css'; import './App.css';
import {LocaleProvider} from 'antd' import {ConfigProvider} from 'antd'
import zhCN from 'antd/lib/locale-provider/zh_CN'; import zhCN from 'antd/lib/locale-provider/zh_CN';
import { import {
BrowserRouter as Router, BrowserRouter as Router,
@ -483,7 +483,7 @@ class App extends Component {
// console.log(mygetHelmetapi); // console.log(mygetHelmetapi);
return ( return (
<Provider store={store}> <Provider store={store}>
<LocaleProvider locale={zhCN}> <ConfigProvider locale={zhCN}>
<MuiThemeProvider theme={theme}> <MuiThemeProvider theme={theme}>
<Accountnewprofile {...this.props}{...this.state}/> <Accountnewprofile {...this.props}{...this.state}/>
<LoginDialog {...this.props} {...this.state} Modifyloginvalue={()=>this.Modifyloginvalue()}></LoginDialog> <LoginDialog {...this.props} {...this.state} Modifyloginvalue={()=>this.Modifyloginvalue()}></LoginDialog>
@ -708,7 +708,7 @@ class App extends Component {
</Switch> </Switch>
</Router> </Router>
</MuiThemeProvider> </MuiThemeProvider>
</LocaleProvider> </ConfigProvider>
</Provider> </Provider>
); );
} }

@ -132,7 +132,9 @@ class Trainingjobsetting extends Component {
CalculateMax: 100,//总分值 CalculateMax: 100,//总分值
borredszf:"ml10 color-grey-9", borredszf:"ml10 color-grey-9",
borredszfl:true, borredszfl:true,
borredszfls:'' borredszfls:'',
total_scoretwo:0,
total_score:0,
} }
// console.log("获取到的值") // console.log("获取到的值")
// console.log("Trainingjobsetting") // console.log("Trainingjobsetting")
@ -302,7 +304,10 @@ class Trainingjobsetting extends Component {
proportion: result.data.shixun_evaluation === 0 ? "均分比例" : result.data.shixun_evaluation === 1 ? "经验值比例" : result.data.shixun_evaluation === 2 ? "自定义分值" : "", proportion: result.data.shixun_evaluation === 0 ? "均分比例" : result.data.shixun_evaluation === 1 ? "经验值比例" : result.data.shixun_evaluation === 2 ? "自定义分值" : "",
publicwork: result.data.work_public, publicwork: result.data.work_public,
challenge_settings: result.data.challenge_settings, challenge_settings: result.data.challenge_settings,
code_review: result.data.code_review code_review: result.data.code_review,
total_scoretwo:result.data.total_score,
total_score:result.data.total_score,
}) })
this.props.Getdataback(result, result.data); this.props.Getdataback(result, result.data);
@ -646,6 +651,7 @@ class Trainingjobsetting extends Component {
if (this.state.completionefficiencyscore === true) { if (this.state.completionefficiencyscore === true) {
latedeductiontwos = this.state.latedeductiontwo; latedeductiontwos = this.state.latedeductiontwo;
} }
//从这里开始记得等于0的时候还要做判断
if (challenge_scoredata.length > 0) { if (challenge_scoredata.length > 0) {
var len = 0; var len = 0;
for (var k = 0; k < challenge_scoredata.length; k++) { for (var k = 0; k < challenge_scoredata.length; k++) {
@ -680,6 +686,16 @@ class Trainingjobsetting extends Component {
} }
}else{
try {
if(parseFloat(this.state.CalculateMax)!==parseFloat(0)){
this.props.showNotification(`分值之和必须等于总分值:${this.state.CalculateMax}`);
this.scrollToAnchor("zongfentimeid");
return;
}
}catch (e) {
}
} }
var url = `/homework_commons/${homeworkid}/update_settings.json`; var url = `/homework_commons/${homeworkid}/update_settings.json`;
@ -707,7 +723,9 @@ class Trainingjobsetting extends Component {
shixun_evaluation: this.state.proportion === "均分比例" ? 0 : this.state.proportion === "经验值比例" ? 1 : this.state.proportion === "自定义分值" ? 2 : 0, shixun_evaluation: this.state.proportion === "均分比例" ? 0 : this.state.proportion === "经验值比例" ? 1 : this.state.proportion === "自定义分值" ? 2 : 0,
challenge_settings: array, challenge_settings: array,
score_open: this.state.publicwork, score_open: this.state.publicwork,
total_score:this.state.CalculateMax total_score:this.state.CalculateMax,
total_scoretwo:this.state.CalculateMax,//记录总分值点击取消的时候还原总分值
} }
} else { } else {
// //非统一配置 // //非统一配置
@ -738,7 +756,8 @@ class Trainingjobsetting extends Component {
shixun_evaluation: this.state.proportion === "均分比例" ? 0 : this.state.proportion === "经验值比例" ? 1 : this.state.proportion === "自定义分值" ? 2 : 0, shixun_evaluation: this.state.proportion === "均分比例" ? 0 : this.state.proportion === "经验值比例" ? 1 : this.state.proportion === "自定义分值" ? 2 : 0,
challenge_settings: array, challenge_settings: array,
score_open: this.state.publicwork, score_open: this.state.publicwork,
total_score:this.state.CalculateMax total_score:this.state.CalculateMax,
total_scoretwo:this.state.CalculateMax
} }
} }
@ -1193,8 +1212,7 @@ class Trainingjobsetting extends Component {
} }
//总比分 //总比分
Totalscorecalculation = (value) => { Totalscorecalculation = (value) => {
debugger
this.setState({ this.setState({
CalculateMax: value, CalculateMax: value,
}) })
@ -2150,6 +2168,9 @@ class Trainingjobsetting extends Component {
}) })
this.refs.targetElementTrainingjobsetting.scrollIntoView(); this.refs.targetElementTrainingjobsetting.scrollIntoView();
this.getTrainingjobsetting(false); this.getTrainingjobsetting(false);
this.setState({
CalculateMax:this.state.total_scoretwo,
})
} }
rulesCheckInfo = (rules) => { rulesCheckInfo = (rules) => {

@ -136,7 +136,7 @@ class AccountBasic extends Component {
} }
handleSubmit = () => { handleSubmit = () => {
this.props.form.validateFieldsAndScroll((err, values) => { this.props.form.validateFieldsAndScroll({ force: true }, (err, values) => {
console.log(values); console.log(values);
let {basicInfo}=this.props; let {basicInfo}=this.props;
if(!err ){ if(!err ){
@ -390,13 +390,13 @@ class AccountBasic extends Component {
this.props.showNotification("请先选择正确的单位或者学校!"); this.props.showNotification("请先选择正确的单位或者学校!");
} }
} }
checkNameLength = (rule, value, callback) => { // checkNameLength = (rule, value, callback) => {
if (value && value.length <= MAX_NAME_LENGTH) { // if (value && value.length <= MAX_NAME_LENGTH) {
callback(); // callback();
return; // return;
} // }
callback(`请输入真实姓名,最大限制${MAX_NAME_LENGTH}个字符`); // callback(`请输入真实姓名,最大限制${MAX_NAME_LENGTH}个字符`);
} // }
// 切换职称 // 切换职称
changeJob=(e)=>{ changeJob=(e)=>{
this.setState({ this.setState({
@ -410,7 +410,51 @@ class AccountBasic extends Component {
}) })
} }
} }
//昵称
handleSubmitName(rule, value, callback){
if (value) {
let iconRule1 = /[`~!@#$%^&*()\-+=<>?:"{}|,.\/;'\\[\]·~@#¥%……&*()——\-+={}|《》?:“”【】、;‘’,。、]/im;
// 判断是否含有emoji表情
let iconRule2 = /[\uD83C|\uD83D|\uD83E][\uDC00-\uDFFF][\u200D|\uFE0F]|[\uD83C|\uD83D|\uD83E][\uDC00-\uDFFF]|[0-9|*|#]\uFE0F\u20E3|[0-9|#]\u20E3|[\u203C-\u3299]\uFE0F\u200D|[\u203C-\u3299]\uFE0F|[\u2122-\u2B55]|\u303D|[\A9|\AE]\u3030|\uA9|\uAE|\u3030/ig;
// 如果为true字符串含有emoji表情 false不含
const iconRule2s =iconRule2.test(value);
// 如果为true字符串含有特殊符号 false不
const iconRule1s =iconRule1.test(value);
if (iconRule2s===true|| iconRule1s===true) {
callback('2-20位中英文、数字及下划线');
}
else if(value.length<2){
callback('2-20位中英文、数字及下划线');
}else if(value.length>=21){
callback('2-20位中英文、数字及下划线');
}
}
callback();
}
// 姓名
handleSubmitNames(rule, value, callback){
if (value) {
let iconRule1 = /[`~!@#$%^&*()_\-+=<>?:"{}|,.\/;'\\[\]·~@#¥%……&*()——\-+={}|《》?:“”【】、;‘’,。、]/im;
// 判断是否含有emoji表情
let iconRule2 = /[\uD83C|\uD83D|\uD83E][\uDC00-\uDFFF][\u200D|\uFE0F]|[\uD83C|\uD83D|\uD83E][\uDC00-\uDFFF]|[0-9|*|#]\uFE0F\u20E3|[0-9|#]\u20E3|[\u203C-\u3299]\uFE0F\u200D|[\u203C-\u3299]\uFE0F|[\u2122-\u2B55]|\u303D|[\A9|\AE]\u3030|\uA9|\uAE|\u3030/ig;
// 如果为true字符串含有emoji表情 false不含
const iconRule2s =iconRule2.test(value);
// 如果为true字符串含有特殊符号 false不
const iconRule1s =iconRule1.test(value);
if (iconRule2s===true|| iconRule1s===true) {
callback('2-10位中英文、数字');
}
else if(value.length<2){
callback('2-10位中英文、数字');
}else if(value.length>=11){
callback('2-10位中英文、数字');
}
}
callback();
}
render() { render() {
let{ let{
nameLength, nameLength,
@ -527,7 +571,10 @@ class AccountBasic extends Component {
// initialValue: this.state.cityDefaultValue, // initialValue: this.state.cityDefaultValue,
required: true, required: true,
message: '请输入您的昵称', message: '请输入您的昵称',
}], },
{ validator: this.handleSubmitName },
],
validateTrigger: 'onSubmit', // 设置进行表单验证的时机为onSubmit
})( })(
<Input placeholder={`请输入您的昵称,最大限制${MAX_NICKNAME_LENGTH}个字符`} className="exercicenewinputysl" onInput={this.changeNickName} maxLength={MAX_NICKNAME_LENGTH} addonAfter ={ <Input placeholder={`请输入您的昵称,最大限制${MAX_NICKNAME_LENGTH}个字符`} className="exercicenewinputysl" onInput={this.changeNickName} maxLength={MAX_NICKNAME_LENGTH} addonAfter ={
<span className="color-grey-6 font-13">{String(nameLength)}/{MAX_NICKNAME_LENGTH}</span> <span className="color-grey-6 font-13">{String(nameLength)}/{MAX_NICKNAME_LENGTH}</span>
@ -554,8 +601,11 @@ class AccountBasic extends Component {
// initialValue: this.state.cityDefaultValue, // initialValue: this.state.cityDefaultValue,
required: true, required: true,
message: `请输入真实姓名,最大限制${MAX_NAME_LENGTH}个字符`, message: `请输入真实姓名,最大限制${MAX_NAME_LENGTH}个字符`,
validator: this.checkNameLength },
}], { validator: this.handleSubmitNames },
],
validateTrigger: 'onSubmit', // 设置进行表单验证的时机为onSubmit
})( })(
<Input placeholder={`请输入真实姓名,最大限制${MAX_NAME_LENGTH}个字符`} className="yslgraduainputedit" disabled={!showRealName && this.state.forDisable == true } addonAfter={ <Input placeholder={`请输入真实姓名,最大限制${MAX_NAME_LENGTH}个字符`} className="yslgraduainputedit" disabled={!showRealName && this.state.forDisable == true } addonAfter={
<i className={showRealName?"iconfont icon-xianshi font-18 color-blue":"iconfont icon-yincang font-18 color-blue"} <i className={showRealName?"iconfont icon-xianshi font-18 color-blue":"iconfont icon-yincang font-18 color-blue"}

Loading…
Cancel
Save