dev_hss
hjm 6 years ago
parent 7b29b3715c
commit 25168fae80

@ -110,6 +110,8 @@ class NewWorkForm extends Component{
{/* min={has_commit ? init_max_num : (min_num == undefined ? 2 : min_num + 1) } */} {/* min={has_commit ? init_max_num : (min_num == undefined ? 2 : min_num + 1) } */}
// 已有提交作品,人数范围只能扩大 // 已有提交作品,人数范围只能扩大
const { has_commit, max_num, init_max_num, min_num, init_min_num } = this.state; const { has_commit, max_num, init_max_num, min_num, init_min_num } = this.state;
const isGroup = this.props.isGroup()
if (isGroup) {
if (!min_num) { if (!min_num) {
this.props.showNotification('最小人数不能为空'); this.props.showNotification('最小人数不能为空');
return; return;
@ -123,12 +125,14 @@ class NewWorkForm extends Component{
this.props.showNotification('最大人数不能小于最小人数'); this.props.showNotification('最大人数不能小于最小人数');
return; return;
} }
if (has_commit) { if (has_commit) {
if (max_num < init_max_num || min_num > init_min_num) { if (max_num < init_max_num || min_num > init_min_num) {
this.props.showNotification(`已有提交作品,人数范围只能扩大(原设置为:${init_min_num} - ${init_max_num})`) this.props.showNotification(`已有提交作品,人数范围只能扩大(原设置为:${init_min_num} - ${init_max_num})`)
return; return;
} }
} }
}
// const errKeys = Object.keys(err); // || errKeys.length == 1 && errKeys[0] == 'content' && mdContnet // const errKeys = Object.keys(err); // || errKeys.length == 1 && errKeys[0] == 'content' && mdContnet
if (!err) { if (!err) {

Loading…
Cancel
Save