Merge remote-tracking branch 'origin/main'

main
王家东 3 months ago
commit 3d51e6c8e5
  1. 64
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualCompPoint/entity/AnnualCompPoint.java
  2. 28
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualScore/service/impl/PersonalCompScoreServiceImpl.java
  3. 130
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualcompgroup/controller/AnnualCompGroupController.java
  4. 9
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/teamseq/controller/TeamSeqController.java
  5. 61
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/teamseq/entity/TeamSeq.java
  6. 7
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/upfilegroup/controller/UpfileGroupController.java
  7. 228
      jeecgboot-vue3-master/src/views/annualCompPoint/committee/components/AnnualCompPointForm.vue
  8. 6
      jeecgboot-vue3-master/src/views/annualcompgroup/AnnualCompGroup.api.ts
  9. 16
      jeecgboot-vue3-master/src/views/annualcompgroup/AnnualCompGroupList1.vue

@ -273,68 +273,20 @@ public class AnnualCompPoint implements Serializable {
/** /**
* 第1序 * 位次
*/ */
@ApiModelProperty(value = "第1序号")
@TableField(exist = false) @TableField(exist = false)
private Integer teamSeqFirst;
/**
* 第1序号比值
*/
@TableField(exist = false)
@ApiModelProperty(value = "第1序号比值")
private Integer teamSeqFirstVal;
/**
* 第2序号
*/
@TableField(exist = false)
@ApiModelProperty(value = "第1序号")
private Integer teamSeqSecond;
/**
* 第2序号比值
*/
@ApiModelProperty(value = "第2序号比值")
@TableField(exist = false)
private Integer teamSeqSecondVal;
/**
* 第3序号
*/
@ApiModelProperty(value = "第3序号")
@TableField(exist = false)
private Integer teamSeqThird;
/**
* 第3序号比值
*/
@ApiModelProperty(value = "第3序号比值")
@TableField(exist = false)
private Integer teamSeqThirdVal;
@Excel(name = "队员在队伍中的位次序号", width = 15)
@ApiModelProperty(value = "队员在队伍中的位次序号")
private Integer teamSeq;
/** /**
* 第4序号 * 位次号比值
*/
@ApiModelProperty(value = "第4序号")
@TableField(exist = false)
private Integer teamSeqFourth;
/**
* 第4序号比值
*/ */
@ApiModelProperty(value = "第4序号比值")
@TableField(exist = false) @TableField(exist = false)
private Integer teamSeqFourthVal;
/** @Excel(name = "队员在队伍中的位次序号比值", width = 15)
* 第5序号 @ApiModelProperty(value = "队员在队伍中的位次序号比值")
*/ private Integer teamSeqVal;
@ApiModelProperty(value = "第5序号")
@TableField(exist = false)
private Integer teamSeqFifth;
/**
* 第5序号比值
*/
@ApiModelProperty(value = "第5序号比值")
@TableField(exist = false)
private Integer teamSeqFifthVal;
} }

@ -39,6 +39,7 @@ import java.util.LinkedList;
import java.util.List; import java.util.List;
import java.util.Optional; import java.util.Optional;
import java.util.concurrent.atomic.AtomicReference; import java.util.concurrent.atomic.AtomicReference;
import java.util.stream.Collectors;
/** /**
* @Description: 个人比赛积分 * @Description: 个人比赛积分
@ -174,7 +175,8 @@ public class PersonalCompScoreServiceImpl extends ServiceImpl<PersonalCompScoreM
}*/ }*/
//modify by zhc 8.23 //modify by zhc 8.23
score.set(ComputeUtils.mul2(baseScore, this.covertVal(annualCompPoint, e))); List<TeamSeq> seqList = iTeamSeqService.list(new LambdaQueryWrapper<TeamSeq>().eq(TeamSeq::getPointId, annualCompPoint.getId()));
score.set(ComputeUtils.mul2(baseScore, this.covertVal(seqList, e)));
PersonalCompScore bean = new PersonalCompScore(); PersonalCompScore bean = new PersonalCompScore();
bean.setAnnualCompId(annualCompId); bean.setAnnualCompId(annualCompId);
bean.setAnnualCompP(annualCompPoint.getId()); bean.setAnnualCompP(annualCompPoint.getId());
@ -228,27 +230,11 @@ public class PersonalCompScoreServiceImpl extends ServiceImpl<PersonalCompScoreM
* @author: z.h.c * @author: z.h.c
* @date: 24/8/23 10:00 * @date: 24/8/23 10:00
*/ */
double covertVal(AnnualCompPoint annualCompPoint, TeamManagement en) { double covertVal(List<TeamSeq> teamSeq, TeamManagement en) {
TeamSeq teamSeq = iTeamSeqService.getById(annualCompPoint.getId());
Integer weightVal = 100; Integer weightVal = 100;
if (!ObjectUtils.isEmpty(teamSeq)) { if (!ObjectUtils.isEmpty(teamSeq) && !ObjectUtils.isEmpty(en.getTeamSeq())) {
switch (en.getTeamSeq()) { List<TeamSeq> seqSet = teamSeq.stream().filter(b -> b.getTeamSeq() == en.getTeamSeq()).collect(Collectors.toList());
case 1: weightVal = seqSet.get(0).getTeamSeqVal();
weightVal = teamSeq.getTeamSeqFifthVal();
break;
case 2:
weightVal = teamSeq.getTeamSeqSecondVal();
break;
case 3:
weightVal = teamSeq.getTeamSeqThirdVal();
break;
case 4:
weightVal = teamSeq.getTeamSeqFourthVal();
break;
case 5:
weightVal = teamSeq.getTeamSeqFifthVal();
break;
}
} }
double val = ComputeUtils.div2(new Double(weightVal), ONE_HUNDRED); double val = ComputeUtils.div2(new Double(weightVal), ONE_HUNDRED);
return val; return val;

@ -15,6 +15,10 @@ import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.query.QueryGenerator; import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.common.system.vo.LoginUser; import org.jeecg.common.system.vo.LoginUser;
import org.jeecg.common.util.oConvertUtils; import org.jeecg.common.util.oConvertUtils;
import org.jeecg.modules.demo.anncomgrotop.entity.AnnComGroTop;
import org.jeecg.modules.demo.anncomgrotop.service.IAnnComGroTopService;
import org.jeecg.modules.demo.anncomgrotopp.entity.AnnComGroTopP;
import org.jeecg.modules.demo.anncomgrotopp.service.IAnnComGroTopPService;
import org.jeecg.modules.demo.annualCompPoint.entity.AnnualCompPoint; import org.jeecg.modules.demo.annualCompPoint.entity.AnnualCompPoint;
import org.jeecg.modules.demo.annualCompPoint.service.IAnnualCompPointService; import org.jeecg.modules.demo.annualCompPoint.service.IAnnualCompPointService;
import org.jeecg.modules.demo.annualcomp.entity.AnnualComp; import org.jeecg.modules.demo.annualcomp.entity.AnnualComp;
@ -28,10 +32,14 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.jeecg.modules.demo.awardpersion.entity.AwardPersion; import org.jeecg.modules.demo.awardpersion.entity.AwardPersion;
import org.jeecg.modules.demo.chooseTopicPersion.entity.ChaoseTopicPersion;
import org.jeecg.modules.demo.chooseTopicPersion.service.IChaoseTopicPersionService;
import org.jeecg.modules.demo.comp.entity.Comp; import org.jeecg.modules.demo.comp.entity.Comp;
import org.jeecg.modules.demo.comp.service.ICompService; import org.jeecg.modules.demo.comp.service.ICompService;
import org.jeecg.modules.demo.scoresta.entity.ScoreSta; import org.jeecg.modules.demo.scoresta.entity.ScoreSta;
import org.jeecg.modules.demo.scoresta.service.IScoreStaService; import org.jeecg.modules.demo.scoresta.service.IScoreStaService;
import org.jeecg.modules.demo.upfile_persion.entity.UpfilePersion;
import org.jeecg.modules.demo.upfile_persion.service.IUpfilePersionService;
import org.jeecgframework.poi.excel.ExcelImportUtil; import org.jeecgframework.poi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants; import org.jeecgframework.poi.excel.def.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams; import org.jeecgframework.poi.excel.entity.ExportParams;
@ -75,6 +83,18 @@ public class AnnualCompGroupController extends JeecgController<AnnualCompGroup,
@Autowired @Autowired
private IAnnualCompPointService annualCompPointService; private IAnnualCompPointService annualCompPointService;
@Autowired
private IAnnComGroTopPService annComGroTopPService;
@Autowired
private IUpfilePersionService upfilePersionService;
@Autowired
private IChaoseTopicPersionService chaoseTopicPersionService;
@Autowired
private IAnnComGroTopService annComGroTopService;
/** /**
* 分页列表查询 * 分页列表查询
@ -311,4 +331,114 @@ public class AnnualCompGroupController extends JeecgController<AnnualCompGroup,
return super.importExcel(request, response, AnnualCompGroup.class); return super.importExcel(request, response, AnnualCompGroup.class);
} }
/**
* 自动分配作品
*
* @return
*/
@ApiOperation(value="自动分配作品", notes="自动分配作品")
@GetMapping(value = "/zdfpzp")
public Result<?> zdfpzp(AnnualCompGroup annualCompGroup, HttpServletRequest req) {
LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal();
QueryWrapper<Comp> queryWrappercomp = new QueryWrapper<>();
queryWrappercomp.eq("comp_admin", user.getUsername());
List<Comp> list = compService.list(queryWrappercomp);
if (list.size() == 0) {
return Result.error("分配失败,该用户无负责比赛");
}
List<String> ids = list.stream().map(Comp::getId).collect(Collectors.toList());
QueryWrapper<AnnualComp> queryWrapperAnnual = new QueryWrapper<>();
queryWrapperAnnual.in("compid", ids);
List<AnnualComp> listAnnual = annualCompService.list(queryWrapperAnnual);
if (listAnnual.size() == 0) {
return Result.error("分配失败,该用户无负责年度比赛");
}
List<String> annualIds = listAnnual.stream().map(AnnualComp::getId).collect(Collectors.toList());
QueryWrapper<AnnualCompGroup> queryWrapper = QueryGenerator.initQueryWrapper(annualCompGroup, req.getParameterMap());
queryWrapper.in(annualIds.size() != 0, "annal_comp", annualIds);
QueryWrapper<AnnualCompPoint> queryWrapperacp = new QueryWrapper<>();
queryWrapperacp.in("annual_comp_id", annualIds);
queryWrapperacp.eq("annual_comp_switch", "Y"); // 比赛必须是开启的
List<AnnualCompPoint> listacp = annualCompPointService.list(queryWrapperacp);
if (listacp.size() == 0) {
return Result.error("分配失败,该用户无负责年度比赛项目");
}
List<String> acpIds = listacp.stream().map(AnnualCompPoint::getId).collect(Collectors.toList());
queryWrapper.in(acpIds.size() != 0, "ann_comp_p", acpIds);
List<AnnualCompGroup> pageList = annualCompGroupService.list(queryWrapper);
if (pageList.size() == 0) {
return Result.error("分配失败,无可分配的专家组");
}
List<String> annualids = pageList.stream().map(AnnualCompGroup::getAnnal).collect(Collectors.toList());
List<String> annualcpids = pageList.stream().map(AnnualCompGroup::getAnnCompP).collect(Collectors.toList());
QueryWrapper<UpfilePersion> queryWrapperup = new QueryWrapper<>();
queryWrapperup.in("annual_id", annualids);
queryWrapperup.in("annual_comp_point_id", annualcpids);
queryWrapperup.eq("status", "0");
QueryWrapper<AnnComGroTopP> queryWrapperagt = new QueryWrapper<>();
//queryWrapperagt.eq("ann_com_gro_topid",xmtmid);
queryWrapperagt.in("annid", annualids);
queryWrapperagt.in("ann_com_p", annualcpids);
List<AnnComGroTopP> listact = annComGroTopPService.list(queryWrapperagt);
String str = "";
for (int i = 0; i < listact.size(); i++) {
str = str + listact.get(i).getBmcode() + ",";
}
if (str != "") {
queryWrapperup.notIn("apply_code", str.split(","));
}
List<UpfilePersion> listup = upfilePersionService.list(queryWrapperup);
//作品的年度比赛项目必须和组的年度比赛项目相同才可以分配作品
for (int o = 0; o < listup.size(); o++) {
QueryWrapper<ChaoseTopicPersion> queryWrapperctp1 = new QueryWrapper<>();
queryWrapperctp1.eq("bmcode", listup.get(o).getApplyCode());
List<ChaoseTopicPersion> listctp1 = chaoseTopicPersionService.list(queryWrapperctp1);
if (listctp1.size() == 0) {
return Result.error(listup.get(o).getTopicName() + "未选题,绑定失败!");
}
}
//List<String> acgids = pageList.stream().map(AnnualCompGroup::getId).collect(Collectors.toList());
int upsum = listup.size();
int acgsum = pageList.size();
int pjz = upsum / acgsum;
int syz = upsum % acgsum;
for (int y = 0; y < pageList.size(); y++) {
QueryWrapper<AnnComGroTop> queryWrapperatp = new QueryWrapper<>();
queryWrapperatp.eq("ann_com_p_g", pageList.get(y).getId());
List<AnnComGroTop> listtop = annComGroTopService.list(queryWrapperatp);
int upnum = 0;
for (int i = 0; i < listup.size(); i++) {
if(upnum==pjz&&pjz!=0&&listup.size()>syz){
break;
}
for (int k = 0; k < listtop.size(); k++) {
QueryWrapper<ChaoseTopicPersion> queryWrapperctp = new QueryWrapper<>();
queryWrapperctp.eq("bmcode", listup.get(i).getApplyCode());
List<ChaoseTopicPersion> listctp = chaoseTopicPersionService.list(queryWrapperctp);
if (listtop.get(k).getTopid().equals(listctp.get(0).getTimul())) {
AnnComGroTopP annComGroTopP = new AnnComGroTopP();
annComGroTopP.setAnnComGroTopid(listtop.get(k).getId());
annComGroTopP.setBmcode(listup.get(i).getApplyCode());
annComGroTopP.setAnnid(listtop.get(k).getAnnid());
annComGroTopP.setAnnComP(listtop.get(k).getAnnComP());
annComGroTopP.setAnnComPG(listtop.get(k).getAnnComPG());
annComGroTopP.setTopicName(listup.get(i).getTopicName());
annComGroTopP.setTopid(listtop.get(k).getTopid());
annComGroTopPService.save(annComGroTopP);
listup.remove(i);
upnum++;
i=-1;
break;
}
}
}
}
return Result.OK("自动分配作品成功");
}
} }

@ -21,7 +21,9 @@ import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.util.Arrays; import java.util.Arrays;
import java.util.LinkedHashMap;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* @Description: 团队赛队员积分计算配置 * @Description: 团队赛队员积分计算配置
@ -61,8 +63,11 @@ public class TeamSeqController extends JeecgController<TeamSeq, ITeamSeqService>
@ApiOperation(value = "团队赛队员积分计算配置-分页列表查询", notes = "团队赛队员积分计算配置-分页列表查询") @ApiOperation(value = "团队赛队员积分计算配置-分页列表查询", notes = "团队赛队员积分计算配置-分页列表查询")
@GetMapping(value = "/listByPointId") @GetMapping(value = "/listByPointId")
public Result<List<TeamSeq>> queryPageList(String pointId) { public Result<Object> queryPageList(String pointId) {
return Result.OK(teamSeqService.list(new LambdaQueryWrapper<TeamSeq>().eq(TeamSeq::getPointId,pointId))); List<TeamSeq> list = teamSeqService.list(new LambdaQueryWrapper<TeamSeq>().eq(TeamSeq::getPointId, pointId));
Map<String,Object> map = new LinkedHashMap<>();
map.put("records",list);
return Result.OK(map);
} }
/** /**

@ -68,61 +68,16 @@ public class TeamSeq implements Serializable {
@ApiModelProperty(value = "年度比赛项目id") @ApiModelProperty(value = "年度比赛项目id")
private String pointId; private String pointId;
/**
* 第1序号
*/
@Excel(name = "第1序号", width = 15)
@ApiModelProperty(value = "第1序号")
private Integer teamSeqFirst;
/**
* 第1序号比值
*/
@Excel(name = "第1序号比值", width = 15)
@ApiModelProperty(value = "第1序号比值")
private Integer teamSeqFirstVal;
/**
* 第2序号
*/
@ApiModelProperty(value = "第1序号")
private Integer teamSeqSecond;
/**
* 第2序号比值
*/
@ApiModelProperty(value = "第2序号比值")
private Integer teamSeqSecondVal;
/**
* 第3序号
*/
@ApiModelProperty(value = "第3序号")
private Integer teamSeqThird;
/**
* 第3序号比值
*/
@ApiModelProperty(value = "第3序号比值")
private Integer teamSeqThirdVal;
/**
* 第4序号
*/
@ApiModelProperty(value = "第4序号")
private Integer teamSeqFourth;
/**
* 第4序号比值
*/
@ApiModelProperty(value = "第4序号比值")
private Integer teamSeqFourthVal;
/** /**
* 第5序 * 位次号
*/ */
@ApiModelProperty(value = "第5序号") @Excel(name = "队员在队伍中的位次序号", width = 15)
private Integer teamSeqFifth; @ApiModelProperty(value = "队员在队伍中的位次序号")
private Integer teamSeq;
/** /**
* 第5序号比值 * 位次号比值
*/ */
@ApiModelProperty(value = "第5序号比值") @Excel(name = "队员在队伍中的位次序号比值", width = 15)
private Integer teamSeqFifthVal; @ApiModelProperty(value = "队员在队伍中的位次序号比值")
private Integer teamSeqVal;
} }

@ -25,6 +25,7 @@ import org.jeecg.modules.demo.annualCompPoint.service.IAnnualCompPointService;
import org.jeecg.modules.demo.annualcomp.entity.AnnualComp; import org.jeecg.modules.demo.annualcomp.entity.AnnualComp;
import org.jeecg.modules.demo.annualcomp.service.IAnnualCompService; import org.jeecg.modules.demo.annualcomp.service.IAnnualCompService;
import org.jeecg.modules.demo.annualcompgroup.entity.AnnualCompGroup; import org.jeecg.modules.demo.annualcompgroup.entity.AnnualCompGroup;
import org.jeecg.modules.demo.annualcompgroup.service.IAnnualCompGroupService;
import org.jeecg.modules.demo.chooseTopicPersion.entity.ChaoseTopicPersion; import org.jeecg.modules.demo.chooseTopicPersion.entity.ChaoseTopicPersion;
import org.jeecg.modules.demo.chooseTopicPersion.service.IChaoseTopicPersionService; import org.jeecg.modules.demo.chooseTopicPersion.service.IChaoseTopicPersionService;
import org.jeecg.modules.demo.comp.entity.Comp; import org.jeecg.modules.demo.comp.entity.Comp;
@ -96,6 +97,9 @@ public class UpfileGroupController extends JeecgController<UpfileGroup, IUpfileG
@Autowired @Autowired
private IAnnComGroTopPService annComGroTopPService; private IAnnComGroTopPService annComGroTopPService;
@Autowired
private IAnnualCompGroupService annualCompGroupService;
/** /**
* 分页列表查询 * 分页列表查询
* *
@ -215,9 +219,10 @@ public class UpfileGroupController extends JeecgController<UpfileGroup, IUpfileG
//去除已绑定作品id //去除已绑定作品id
List<String> zpidslisttemp = new ArrayList<>(); List<String> zpidslisttemp = new ArrayList<>();
zpidslisttemp.addAll(zpidslist); zpidslisttemp.addAll(zpidslist);
String ndbsxmid = annualCompGroupService.getById(xmtmid).getAnnCompP();
for (int h = 0 ; h < zpidslisttemp.size() ; h++){ for (int h = 0 ; h < zpidslisttemp.size() ; h++){
QueryWrapper<AnnComGroTopP> queryWrappertpp = new QueryWrapper<>(); QueryWrapper<AnnComGroTopP> queryWrappertpp = new QueryWrapper<>();
queryWrappertpp.eq("ann_com_p_g",xmtmid); queryWrappertpp.eq("ann_com_p",ndbsxmid);
List<AnnComGroTopP> listtopp = annComGroTopPService.list(queryWrappertpp); List<AnnComGroTopP> listtopp = annComGroTopPService.list(queryWrappertpp);
for (int r = 0 ; r < listtopp.size() ; r++){ for (int r = 0 ; r < listtopp.size() ; r++){
if(listtopp.get(r).getBmcode().equals(upfilePersionService.getById(zpidslisttemp.get(h)).getApplyCode())){ if(listtopp.get(r).getBmcode().equals(upfilePersionService.getById(zpidslisttemp.get(h)).getApplyCode())){

@ -92,98 +92,22 @@
</a-row> </a-row>
<a-row> <a-row>
<a-col :span="12" v-if="formData.entryForm==='Y'">
<a-form-item label="队伍人数" v-bind="validateInfos.teamNumber">
<a-input-number v-model:value="formData.teamNumber" placeholder="请输入队伍人数"
style="width: 100%" :disabled="disabled"/>
<a-button @click="showModel">队伍比值配置</a-button>
</a-form-item>
</a-col>
<a-col :span="12" v-if="formData.entryForm==='Y'"> <a-col :span="12" v-if="formData.entryForm==='Y'">
<a-form-item label="指导老师人数" v-bind="validateInfos.teacherNumber"> <a-form-item label="指导老师人数" v-bind="validateInfos.teacherNumber">
<a-input-number v-model:value="formData.teacherNumber" placeholder="请输入指导老师人数" <a-input-number v-model:value="formData.teacherNumber" placeholder="请输入指导老师人数"
style="width: 100%" :disabled="disabled"/> style="width: 100%" :disabled="disabled"/>
</a-form-item> </a-form-item>
</a-col> </a-col>
</a-row> <a-col :span="12" v-if="formData.entryForm==='Y'">
<a-form-item label="队伍人数" v-bind="validateInfos.teamNumber">
<!-- <a-input-number v-model:value="formData.teamNumber" placeholder="请输入队伍人数"
<a-row v-if="formData.entryForm ==='Y'"> style="width: 100%" :disabled="disabled"/>
<a-col :span="12"> <a-button @click="showModel" type="primary">配置队伍位次比值</a-button>
<a-form-item label="队伍第1编号" >
<a-input-number v-model:value="formData.teamSeqFirst" placeholder="请输入队伍第1编号" style="width: 100%" disabled/>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="第1编号比值" v-bind="formData.teamSeqFirstVal">
<a-input-number v-model:value="formData.teamSeqFirstVal" placeholder="请输入第1编号比值"
style="width: 100%" />
</a-form-item>
</a-col>
</a-row>
<a-row v-if="formData.entryForm ==='Y'">
<a-col :span="12">
<a-form-item label="队伍第2编号" v-bind="formData.teamSeqSecond">
<a-input-number v-model:value="formData.teamSeqSecond" placeholder="请输入队伍第2编号" style="width: 100%" disabled/>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="第2编号比值" v-bind="formData.teamSeqSecondVal">
<a-input-number v-model:value="formData.teamSeqSecondVal" placeholder="请输入第2编号比值"
style="width: 100%" />
</a-form-item>
</a-col>
</a-row>
<a-row v-if="formData.entryForm ==='Y'">
<a-col :span="12">
<a-form-item label="队伍第3编号" v-bind="formData.teamSeqThird">
<a-input-number v-model:value="formData.teamSeqThird" placeholder="请输入队伍第3编号" style="width: 100%" disabled/>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="第3编号比值" v-bind="formData.teamSeqThirdVal">
<a-input-number v-model:value="formData.teamSeqThirdVal" placeholder="请输入第3编号比值"
style="width: 100%" />
</a-form-item>
</a-col>
</a-row>
<a-row v-if="formData.entryForm ==='Y'">
<a-col :span="12">
<a-form-item label="队伍第4编号" v-bind="formData.teamSeqFourth">
<a-input-number v-model:value="formData.teamSeqFourth" placeholder="请输入队伍第4编号" style="width: 100%" disabled/>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="第4编号比值" v-bind="formData.teamSeqFourthVal">
<a-input-number v-model:value="formData.teamSeqFourthVal" placeholder="请输入第4编号比值"
style="width: 100%" />
</a-form-item>
</a-col>
</a-row>
<a-row v-if="formData.entryForm ==='Y'">
<a-col :span="12">
<a-form-item label="队伍第5编号" v-bind="formData.teamSeqFifth">
<a-input-number v-model:value="formData.teamSeqFifth" placeholder="请输入队伍第5编号" style="width: 100%" disabled/>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="第5编号比值" v-bind="formData.teamSeqFifthVal">
<a-input-number v-model:value="formData.teamSeqFifthVal" placeholder="请输入第5编号比值"
style="width: 100%" />
</a-form-item> </a-form-item>
</a-col> </a-col>
</a-row> </a-row>
-->
<a-row> <a-row>
<a-col :span="5"> <a-col :span="5">
<a-form-item label="是否报名" v-bind="validateInfos.requireApply" :labelCol="labelCol4" <a-form-item label="是否报名" v-bind="validateInfos.requireApply" :labelCol="labelCol4"
:wrapperCol="wrapperCol4"> :wrapperCol="wrapperCol4">
@ -319,7 +243,8 @@
@register="register" @register="register"
title="比值配置" title="比值配置"
:height="800" :height="800"
@ok="handleOk" :width="800"
:footer="null"
> >
<!-- <div v-for="(item,index) in num" :key="index">--> <!-- <div v-for="(item,index) in num" :key="index">-->
<!-- <a-input-number v-model="item.index"></a-input-number>--> <!-- <a-input-number v-model="item.index"></a-input-number>-->
@ -330,17 +255,18 @@
<!-- <a-button type="primary" @click="setModalProps">从内部修改title</a-button>--> <!-- <a-button type="primary" @click="setModalProps">从内部修改title</a-button>-->
<JVxeTable <JVxeTable
ref="tableRef"
stripe
toolbar toolbar
:toolbarConfig="toolbarConfig"
rowNumber rowNumber
rowSelection rowSelection
rowExpand keepSource
resizable asyncRemove
:maxHeight="480" :height="340"
:loading="loading"
:columns="columns" :columns="columns"
:dataSource="dataSource" :dataSource="dataSource"
@save="handleTableSave" @save="handleTableSave"
@removed="handleTableRemove"
/> />
</BasicModal> </BasicModal>
</template> </template>
@ -364,62 +290,43 @@ const disableSubmit = ref<boolean>(false);
const realForm = ref(); const realForm = ref();
import {JVxeTable} from '/@/components/jeecg/JVxeTable'; import {JVxeTable} from '/@/components/jeecg/JVxeTable';
import {JVxeColumn, JVxeTypes} from '/@/components/jeecg/JVxeTable/types'; import {JVxeColumn, JVxeTypes} from '/@/components/jeecg/JVxeTable/types';
import {result} from "lodash-es";
// //
const loading = ref(false); const loading = ref(false);
//
const pagination = reactive({
//
current: 1,
//
pageSize: 200,
//
pageSizeOptions: ['10', '20', '30', '100', '200'],
// 0
total: 0,
});
// //
const selectedRows = ref<Recordable[]>([]); const selectedRows = ref<Recordable[]>([]);
// //
const dataSource = ref<Recordable[]>([]); const dataSource = ref<Recordable[]>([]);
//
const toolbarConfig = reactive({
// add remove clearSelection
btn: ['add', 'save', 'remove', 'clearSelection'],
});
// //
const columns = ref<JVxeColumn[]>([ const columns = ref<JVxeColumn[]>([
// { key: 'num', title: '', width: 80, type: JVxeTypes.normal }, // { key: 'num', title: '', width: 80, type: JVxeTypes.normal },
{ key: 'teamSeqFirst', title: '序号1', width: 80, type: JVxeTypes.normal }, // { key: 'pointId', title: 'id', width: 80, type: JVxeTypes.hidden,},
{ key: 'teamSeq', title: '位次号', width: 180, type: JVxeTypes.inputNumber,
placeholder: '请输入${title}',
validateRules: [
{
required: true, //
message: '请输入${title}', //
}
],
},
{ {
title: '比值', title: '比值',
key: 'teamSeqFirstVal', key: 'teamSeqVal',
type: JVxeTypes.input, type: JVxeTypes.inputNumber,
width: 180, width: 180,
defaultValue: '', defaultValue: 100,
placeholder: '请输入${title}', placeholder: '请输入${title}',
validateRules: [ validateRules: [
{ {
required: true, // required: true, //
message: '请输入${title}', // message: '请输入${title}', //
},
// {
// pattern: /^[a-z|A-Z][a-z|A-Z\d_-]*$/, //
// message: '线',
// },
// {
// unique: true,
// message: '${title}',
// },
{
handler({cellValue, row, column}, callback, target) {
// cellValue
// callback(flag, message)
// flag = null
// message = 使 message
// target
if (cellValue === 'abc') {
callback(false, '${title}不能是abc') // false =
} else {
callback(true) // true =
} }
},
message: '${title}默认提示',
},
], ],
}, },
]) ])
@ -434,12 +341,11 @@ enum Api {
} }
// //
async function loadData() { function loadData() {
alert(formData.id) // alert(formData.id)
// loading.value = true; // loading.value = true;
// //
await defHttp defHttp.get({
.get({
// //
url: Api.getData, url: Api.getData,
// // // //
@ -448,25 +354,19 @@ async function loadData() {
// pageNo: pagination.current, // pageNo: pagination.current,
// pageSize: pagination.pageSize, // pageSize: pagination.pageSize,
}, },
}) }).then((result) => {
.then((result) => {
// total // total
// pagination.total = result.total; // pagination.total = result.total;
// dataSource // dataSource
dataSource.value = result.records; dataSource.value = result.records;
// //
selectedRows.value = []; selectedRows.value = [];
}) }).finally(() => {
.finally(() => {
// loading // loading
loading.value = false; loading.value = false;
}); });
} }
function handleOk() {
alert("handleOk")
}
function handleTableSave({$table, target}) { function handleTableSave({$table, target}) {
// //
$table.validate().then((errMap) => { $table.validate().then((errMap) => {
@ -474,30 +374,53 @@ function handleTableSave({$table, target}) {
if (!errMap) { if (!errMap) {
// //
let tableData = target.getTableData(); let tableData = target.getTableData();
console.log('当前保存的数据是:', tableData); // console.log('$table', $table);
// console.log('target', target);
console.log('当前保存的数据(tableData)是:', JSON.stringify(tableData));
tableData.forEach(item => {
item.pointId = formData.id
})
// //
let newData = target.getNewData(); // let newData = target.getNewData();
console.log('-- 新增的数据:', newData); // console.log('-- ', newData);
// // for (let itemindex = 0; itemindex < newData.length; itemindex++) {
let deleteData = target.getDeleteData(); // this.$set(jsonObject, newData[itemindex].key+"", newData[itemindex].value+"");
console.log('-- 删除的数据:', deleteData); // }
// //
loading.value = true; // loading.value = true;
defHttp defHttp
.post({ .post({
url: Api.saveAll, url: Api.saveAll,
params: tableData, params: tableData,
}) })
.then(() => { .then(() => {
createMessage.success(`保存成功!`); // createMessage.success(``);
}) })
.finally(() => { .finally(() => {
loading.value = false; // loading.value = false;
}); });
} }
}); });
} }
//
function handleTableRemove(event) {
// event.deleteRows
console.log('待删除的数据: ', event.deleteRows);
// IDID
let deleteIds = event.deleteRows.map((row) => row.id);
console.log('待删除的数据ids: ', deleteIds);
//
loading.value = true;
window.setTimeout(() => {
loading.value = false;
createMessage.success('删除成功');
// confirmRemove()
event.confirmRemove();
}, 1000);
}
const props = defineProps({ const props = defineProps({
// objLevelll: { type: Array, default: () => [] }, // objLevelll: { type: Array, default: () => [] },
formDisabled: {type: Boolean, default: false}, formDisabled: {type: Boolean, default: false},
@ -511,10 +434,7 @@ const [register, {openModal}] = useModal();
// const [register, { closeModal, setModalProps,openModal }] = useModalInner(); // const [register, { closeModal, setModalProps,openModal }] = useModalInner();
const showModel = () => { const showModel = () => {
loadData(); loadData();
openModal() openModal()
// console.log(1111)
} }
let num = ref([ let num = ref([
@ -567,16 +487,6 @@ const formData = reactive<Record<string, any>>({
uploadEndTime: '', uploadEndTime: '',
scoreStartTime: '', scoreStartTime: '',
scoreEndTime: '', scoreEndTime: '',
teamSeqFirst: 1,
teamSeqSecond: 2,
teamSeqThird: 3,
teamSeqFourth: 4,
teamSeqFifth: 5,
teamSeqFifthVal: '',
teamSeqFourthVal: '',
teamSeqThirdVal: '',
teamSeqSecondVal: '',
teamSeqFirstVal: '',
}); });
const {createMessage} = useMessage(); const {createMessage} = useMessage();
const labelCol = ref<any>({xs: {span: 24}, sm: {span: 6}}); const labelCol = ref<any>({xs: {span: 24}, sm: {span: 6}});

@ -13,6 +13,12 @@ enum Api {
exportXls = '/annualcompgroup/annualCompGroup/exportXls', exportXls = '/annualcompgroup/annualCompGroup/exportXls',
queryCompId = '/annualcompgroup/annualCompGroup/queryCompId', queryCompId = '/annualcompgroup/annualCompGroup/queryCompId',
saveTop = '/topic/topic/szadd', saveTop = '/topic/topic/szadd',
zdfpzp = '/annualcompgroup/annualCompGroup/zdfpzp',
}
export const zdfpzp = () => {
let url = Api.zdfpzp;
return defHttp.get({ url: url}, { isTransformResponse: false });
} }
/** /**

@ -36,6 +36,7 @@
<!-- <a-button type="primary" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button> <!-- <a-button type="primary" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button>
<a-button type="primary" preIcon="ant-design:export-outlined" @click="onExportXls"> 导出</a-button> <a-button type="primary" preIcon="ant-design:export-outlined" @click="onExportXls"> 导出</a-button>
<j-upload-button type="primary" preIcon="ant-design:import-outlined" @click="onImportXls">导入</j-upload-button>--> <j-upload-button type="primary" preIcon="ant-design:import-outlined" @click="onImportXls">导入</j-upload-button>-->
<a-button type="primary" @click="zdfpzpbu" preIcon="ant-design:plus-outlined"> 自动分配作品</a-button>
<a-dropdown v-if="selectedRowKeys.length > 0"> <a-dropdown v-if="selectedRowKeys.length > 0">
<template #overlay> <template #overlay>
<a-menu> <a-menu>
@ -78,18 +79,20 @@
import { BasicTable, useTable, TableAction } from '/@/components/Table'; import { BasicTable, useTable, TableAction } from '/@/components/Table';
import { useListPage } from '/@/hooks/system/useListPage'; import { useListPage } from '/@/hooks/system/useListPage';
import { columns } from './AnnualCompGroup.data'; import { columns } from './AnnualCompGroup.data';
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl,saveOrUpdateTop } from './AnnualCompGroup.api'; import { list, deleteOne, batchDelete, getImportUrl, getExportUrl,saveOrUpdateTop,zdfpzp } from './AnnualCompGroup.api';
import { downloadFile } from '/@/utils/common/renderUtils'; import { downloadFile } from '/@/utils/common/renderUtils';
import AnnualCompGroupModal from './components/AnnualCompGroupModal.vue' import AnnualCompGroupModal from './components/AnnualCompGroupModal.vue'
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue'; import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
import JSearchSelect from '/@/components/Form/src/jeecg/components/JSearchSelect.vue'; import JSearchSelect from '/@/components/Form/src/jeecg/components/JSearchSelect.vue';
import {saveOrUpdate} from "/@/views/anncomgrotop/components/Topic.api"; import {saveOrUpdate} from "/@/views/anncomgrotop/components/Topic.api";
import {defHttp} from "/@/utils/http/axios"; import {defHttp} from "/@/utils/http/axios";
import {useMessage} from "../../hooks/web/useMessage";
const router = useRouter(); const router = useRouter();
const formRef = ref(); const formRef = ref();
const queryParam = reactive<any>({}); const queryParam = reactive<any>({});
const toggleSearchStatus = ref<boolean>(false); const toggleSearchStatus = ref<boolean>(false);
const registerModal = ref(); const registerModal = ref();
const { createMessage } = useMessage();
//table //table
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({ const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
tableProps: { tableProps: {
@ -134,6 +137,17 @@
registerModal.value.add(); registerModal.value.add();
} }
function zdfpzpbu() {
zdfpzp()
.then((res) => {
if (res.success) {
createMessage.success(res.message);
} else {
createMessage.warning(res.message);
}
});
}
/** /**
* 编辑事件 * 编辑事件
*/ */

Loading…
Cancel
Save