修复杂项
This commit is contained in:
parent
ad17736e30
commit
1dab7230f3
@ -35,6 +35,6 @@ public class HitCompetitionAPI extends BaseController
|
||||
@GetMapping("/list")
|
||||
public AjaxResult getCompetition(HitCompetition competition){
|
||||
startPage();
|
||||
return success(competitionService.selectHitCompetitionList(competition));
|
||||
return success(competitionService.selectHitCompetitionListByTime(competition));
|
||||
}
|
||||
}
|
||||
|
@ -29,6 +29,14 @@ public interface IHitCompetitionService extends IService<HitCompetition>
|
||||
*/
|
||||
public List<HitCompetition> selectHitCompetitionList(HitCompetition hitCompetition);
|
||||
|
||||
/**
|
||||
* 查询大赛信息列表
|
||||
*
|
||||
* @param hitCompetition 大赛信息
|
||||
* @return 大赛信息集合
|
||||
*/
|
||||
public List<HitCompetition> selectHitCompetitionListByTime(HitCompetition hitCompetition);
|
||||
|
||||
/**
|
||||
* 新增大赛信息
|
||||
*
|
||||
|
@ -1,6 +1,7 @@
|
||||
package com.ruoyi.cms.service.impl;
|
||||
|
||||
import cn.hutool.core.lang.Snowflake;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.ruoyi.cms.domain.HitCompetition;
|
||||
import com.ruoyi.cms.mapper.HitCompetitionMapper;
|
||||
@ -9,6 +10,7 @@ import com.ruoyi.common.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@ -47,6 +49,17 @@ public class HitCompetitionServiceImpl extends ServiceImpl<HitCompetitionMapper,
|
||||
return baseMapper.selectHitCompetitionList(hitCompetition);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询大赛信息列表
|
||||
*
|
||||
* @param hitCompetition 大赛信息
|
||||
* @return 大赛信息集合
|
||||
*/
|
||||
@Override
|
||||
public List<HitCompetition> selectHitCompetitionListByTime(HitCompetition hitCompetition){
|
||||
return baseMapper.selectList(new QueryWrapper<HitCompetition>().gt("reg_end_time", new Date()));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增大赛信息
|
||||
*
|
||||
|
@ -161,6 +161,7 @@
|
||||
</el-form-item>
|
||||
<el-form-item label="报名时间" prop="inRegDate">
|
||||
<el-date-picker
|
||||
@input="changeDate"
|
||||
format="yyyy-MM-dd HH:mm"
|
||||
:picker-options="pickerOptions"
|
||||
v-model="form.inRegDate"
|
||||
@ -172,6 +173,7 @@
|
||||
</el-form-item>
|
||||
<el-form-item label="大赛时间" prop="inCpDate">
|
||||
<el-date-picker
|
||||
@input="changeDate"
|
||||
format="yyyy-MM-dd HH:mm"
|
||||
:picker-options="pickerOptions"
|
||||
v-model="form.inCpDate"
|
||||
@ -335,6 +337,7 @@ export default {
|
||||
this.open = true;
|
||||
this.title = "修改大赛信息";
|
||||
});
|
||||
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
@ -402,7 +405,7 @@ export default {
|
||||
},
|
||||
judgeRegTime(){
|
||||
if (this.form.regEndTime > this.form.cpBeginTime){
|
||||
this.$modal.msgError("新增失败,报名结束时间在大赛开始时间之前")
|
||||
this.$modal.msgError((!this.form.id ? "新增" : "修改") + "失败,报名结束时间在大赛开始时间之前")
|
||||
return false
|
||||
}
|
||||
return true
|
||||
@ -421,7 +424,11 @@ export default {
|
||||
let s = date.getSeconds();
|
||||
s = s < 10 ? "0" + s : s;
|
||||
return y + "-" + MM + "-" + d + " " + h + ":" + m;
|
||||
}
|
||||
},
|
||||
changeDate() {
|
||||
this.$forceUpdate()
|
||||
},
|
||||
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
@ -61,7 +61,7 @@ export default {
|
||||
},
|
||||
methods:{
|
||||
tabClick(url,id){
|
||||
console.log(url,id)
|
||||
if (url === 'home') url = "gw";
|
||||
this.$router.push({
|
||||
name: url,
|
||||
query:{ id: id }
|
||||
|
Loading…
Reference in New Issue
Block a user