dev_hss
hjm 6 years ago
parent 7b29b3715c
commit 25168fae80

@ -110,24 +110,28 @@ 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;
if (!min_num) { const isGroup = this.props.isGroup()
this.props.showNotification('最小人数不能为空'); if (isGroup) {
return; if (!min_num) {
} else if (min_num < 1) { this.props.showNotification('最小人数不能为空');
this.props.showNotification('最小人数不能小于1'); return;
return; } else if (min_num < 1) {
} else if (!max_num) { this.props.showNotification('最小人数不能小于1');
this.props.showNotification('最大人数不能为空'); return;
return; } else if (!max_num) {
} else if (max_num < min_num) { this.props.showNotification('最大人数不能为空');
this.props.showNotification('最大人数不能小于最小人数'); return;
return; } else if (max_num < min_num) {
} this.props.showNotification('最大人数不能小于最小人数');
if (has_commit) {
if (max_num < init_max_num || min_num > init_min_num) {
this.props.showNotification(`已有提交作品,人数范围只能扩大(原设置为:${init_min_num} - ${init_max_num})`)
return; return;
} }
if (has_commit) {
if (max_num < init_max_num || min_num > init_min_num) {
this.props.showNotification(`已有提交作品,人数范围只能扩大(原设置为:${init_min_num} - ${init_max_num})`)
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

Loading…
Cancel
Save