学生端-报名功能重构、登录页logo替换 12.16

main
zhc077 11 months ago
parent 6740903020
commit 6a5daf237b
  1. 1562
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualcompetitionprojectregistration/controller/AnnualCompetitionProjectRegistrationController.java
  2. 12
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualcompetitionprojectregistration/service/IAnnualCompetitionProjectRegistrationService.java
  3. 358
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualcompetitionprojectregistration/service/impl/AnnualCompetitionProjectRegistrationServiceImpl.java
  4. 53
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualcompetitionprojectregistration/vo/StudentSignUpVo.java
  5. BIN
      jeecgboot-vue3-master/src/assets/loginmini/icon/黄淮学院北门.png
  6. 3
      jeecgboot-vue3-master/src/assets/loginmini/style/home.less
  7. 101
      jeecgboot-vue3-master/src/views/annualCompPoint/student2/AnnualCompPoint.api.ts
  8. 444
      jeecgboot-vue3-master/src/views/annualCompPoint/student2/AnnualCompPoint.data.ts
  9. 293
      jeecgboot-vue3-master/src/views/annualCompPoint/student2/AnnualCompPointList.vue
  10. 336
      jeecgboot-vue3-master/src/views/annualCompPoint/student2/AnnualCompPointList2.vue
  11. 370
      jeecgboot-vue3-master/src/views/annualCompPoint/student2/components/AnnualCompPointForm.vue
  12. 75
      jeecgboot-vue3-master/src/views/annualCompPoint/student2/components/AnnualCompPointModal.vue
  13. 52
      jeecgboot-vue3-master/src/views/annualCompPoint/student2/components/StudentSignUp4PersonModal.vue
  14. 51
      jeecgboot-vue3-master/src/views/annualCompPoint/student2/components/StudentSignUp4TeamModal.vue
  15. 2
      jeecgboot-vue3-master/src/views/system/loginmini/MiniLogin.vue

@ -1,9 +1,12 @@
package org.jeecg.modules.demo.annualcompetitionprojectregistration.service;
import org.jeecg.common.api.vo.Result;
import org.jeecg.modules.demo.annualcompetitionprojectregistration.entity.TeamManagement;
import org.jeecg.modules.demo.annualcompetitionprojectregistration.entity.InstructorSheet;
import org.jeecg.modules.demo.annualcompetitionprojectregistration.entity.AnnualCompetitionProjectRegistration;
import com.baomidou.mybatisplus.extension.service.IService;
import org.jeecg.modules.demo.annualcompetitionprojectregistration.vo.StudentSignUpVo;
import java.io.Serializable;
import java.util.Collection;
import java.util.List;
@ -24,7 +27,7 @@ public interface IAnnualCompetitionProjectRegistrationService extends IService<A
* @param instructorSheetList
*/
public void saveMain(AnnualCompetitionProjectRegistration annualCompetitionProjectRegistration,List<TeamManagement> teamManagementList,List<InstructorSheet> instructorSheetList) ;
/**
* 修改一对多
*
@ -33,14 +36,14 @@ public interface IAnnualCompetitionProjectRegistrationService extends IService<A
* @param instructorSheetList
*/
public void updateMain(AnnualCompetitionProjectRegistration annualCompetitionProjectRegistration,List<TeamManagement> teamManagementList,List<InstructorSheet> instructorSheetList);
/**
* 删除一对多
*
* @param id
*/
public void delMain (String id);
/**
* 批量删除一对多
*
@ -49,5 +52,6 @@ public interface IAnnualCompetitionProjectRegistrationService extends IService<A
public void delBatchMain (Collection<? extends Serializable> idList);
AnnualCompetitionProjectRegistration getRegistrationByAnnualCompPointId(String annualCompPointId);
void studentSignUp(StudentSignUpVo studentSignUpVo);
}

@ -1,9 +1,17 @@
package org.jeecg.modules.demo.annualcompetitionprojectregistration.service.impl;
import cn.hutool.core.util.IdUtil;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.apache.commons.lang3.StringUtils;
import org.apache.shiro.SecurityUtils;
import org.jeecg.common.system.vo.LoginUser;
import org.jeecg.modules.demo.annual.entity.Annual;
import org.jeecg.modules.demo.annual.service.IAnnualService;
import org.jeecg.modules.demo.annualCompPoint.entity.AnnualCompPoint;
import org.jeecg.modules.demo.annualCompPoint.service.IAnnualCompPointService;
import org.jeecg.modules.demo.annualcomp.entity.AnnualComp;
import org.jeecg.modules.demo.annualcomp.service.IAnnualCompService;
import org.jeecg.modules.demo.annualcompetitionprojectregistration.entity.AnnualCompetitionProjectRegistration;
import org.jeecg.modules.demo.annualcompetitionprojectregistration.entity.InstructorSheet;
import org.jeecg.modules.demo.annualcompetitionprojectregistration.entity.TeamManagement;
@ -11,127 +19,261 @@ import org.jeecg.modules.demo.annualcompetitionprojectregistration.mapper.Annual
import org.jeecg.modules.demo.annualcompetitionprojectregistration.mapper.InstructorSheetMapper;
import org.jeecg.modules.demo.annualcompetitionprojectregistration.mapper.TeamManagementMapper;
import org.jeecg.modules.demo.annualcompetitionprojectregistration.service.IAnnualCompetitionProjectRegistrationService;
import org.jeecg.modules.demo.annualcompetitionprojectregistration.service.IInstructorSheetService;
import org.jeecg.modules.demo.annualcompetitionprojectregistration.service.ITeamManagementService;
import org.jeecg.modules.demo.annualcompetitionprojectregistration.vo.StudentSignUpVo;
import org.jeecg.modules.system.entity.SysUser;
import org.jeecg.modules.system.service.ISysUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.ObjectUtils;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.*;
import java.util.stream.Collectors;
/**
* @Description: 年度比赛项目报名
* @Author: jeecg-boot
* @Date: 2023-08-17
* @Date: 2023-08-17
* @Version: V1.0
*/
@Service
public class AnnualCompetitionProjectRegistrationServiceImpl extends ServiceImpl<AnnualCompetitionProjectRegistrationMapper, AnnualCompetitionProjectRegistration> implements IAnnualCompetitionProjectRegistrationService {
@Autowired
private AnnualCompetitionProjectRegistrationMapper annualCompetitionProjectRegistrationMapper;
@Autowired
private TeamManagementMapper teamManagementMapper;
@Autowired
private InstructorSheetMapper instructorSheetMapper;
@Override
@Transactional(rollbackFor = Exception.class)
public void saveMain(AnnualCompetitionProjectRegistration annualCompetitionProjectRegistration, List<TeamManagement> teamManagementList,List<InstructorSheet> instructorSheetList) {
annualCompetitionProjectRegistrationMapper.insert(annualCompetitionProjectRegistration);
if(teamManagementList!=null && teamManagementList.size()>0) {
for(TeamManagement entity:teamManagementList) {
//外键设置
entity.setEnrollCode(annualCompetitionProjectRegistration.getEnrollCode());
teamManagementMapper.insert(entity);
}
}
if(instructorSheetList!=null && instructorSheetList.size()>0) {
for(InstructorSheet entity:instructorSheetList) {
//外键设置
entity.setEnrollCode(annualCompetitionProjectRegistration.getEnrollCode());
instructorSheetMapper.insert(entity);
}
}
}
@Override
@Transactional(rollbackFor = Exception.class)
public void updateMain(AnnualCompetitionProjectRegistration annualCompetitionProjectRegistration,List<TeamManagement> teamManagementList,List<InstructorSheet> instructorSheetList) {
annualCompetitionProjectRegistrationMapper.updateById(annualCompetitionProjectRegistration);
//1.先删除子表数据
teamManagementMapper.deleteByMainId(annualCompetitionProjectRegistration.getEnrollCode());
instructorSheetMapper.deleteByMainId(annualCompetitionProjectRegistration.getEnrollCode());
//2.子表数据重新插入
if(teamManagementList!=null && teamManagementList.size()>0) {
for(TeamManagement entity:teamManagementList) {
//外键设置
entity.setEnrollCode(annualCompetitionProjectRegistration.getEnrollCode());
teamManagementMapper.insert(entity);
}
}
if(instructorSheetList!=null && instructorSheetList.size()>0) {
for(InstructorSheet entity:instructorSheetList) {
//外键设置
entity.setEnrollCode(annualCompetitionProjectRegistration.getEnrollCode());
instructorSheetMapper.insert(entity);
}
}
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delMain(String id) {
teamManagementMapper.deleteByMainId(id);
instructorSheetMapper.deleteByMainId(id);
annualCompetitionProjectRegistrationMapper.deleteById(id);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delBatchMain(Collection<? extends Serializable> idList) {
for(Serializable id:idList) {
teamManagementMapper.deleteByMainId(id.toString());
instructorSheetMapper.deleteByMainId(id.toString());
annualCompetitionProjectRegistrationMapper.deleteById(id);
}
}
@Override
public AnnualCompetitionProjectRegistration getRegistrationByAnnualCompPointId(
String annualCompPointId
) {
// 获取当前用户的登录信息
LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
// 获取当前用户所有的报名编号
List<TeamManagement> teamManagementList = teamManagementMapper.selectList(
Wrappers.lambdaQuery(TeamManagement.class)
.eq(TeamManagement::getUserId, loginUser.getId())
);
if(teamManagementList==null||teamManagementList.isEmpty()){
return null;
}
// 报名编号列表
List<String> enrollCodes = new ArrayList<>();
teamManagementList.forEach(team ->
enrollCodes.add(team.getEnrollCode()));
if(enrollCodes.isEmpty()) {
return null;
}
// 获取报名信息
return annualCompetitionProjectRegistrationMapper.selectOne(
Wrappers.lambdaQuery(
AnnualCompetitionProjectRegistration.class
)
.eq(AnnualCompetitionProjectRegistration::getAnnualCompid,
annualCompPointId)
.in(AnnualCompetitionProjectRegistration::getEnrollCode,
enrollCodes)
.last("limit 1")
);
}
@Autowired
private AnnualCompetitionProjectRegistrationMapper annualCompetitionProjectRegistrationMapper;
@Autowired
private TeamManagementMapper teamManagementMapper;
@Autowired
private ITeamManagementService iTeamManagementService;
@Autowired
private InstructorSheetMapper instructorSheetMapper;
@Autowired
private IInstructorSheetService iInstructorSheetService;
@Autowired
private IAnnualCompPointService iAnnualCompPointService;
@Autowired
IAnnualCompService iannualCompService;
@Autowired
IAnnualService iAnnualService;
@Autowired
private ISysUserService iSysUserService;
@Override
@Transactional(rollbackFor = Exception.class)
public void saveMain(AnnualCompetitionProjectRegistration annualCompetitionProjectRegistration, List<TeamManagement> teamManagementList, List<InstructorSheet> instructorSheetList) {
annualCompetitionProjectRegistrationMapper.insert(annualCompetitionProjectRegistration);
if (teamManagementList != null && teamManagementList.size() > 0) {
for (TeamManagement entity : teamManagementList) {
//外键设置
entity.setEnrollCode(annualCompetitionProjectRegistration.getEnrollCode());
teamManagementMapper.insert(entity);
}
}
if (instructorSheetList != null && instructorSheetList.size() > 0) {
for (InstructorSheet entity : instructorSheetList) {
//外键设置
entity.setEnrollCode(annualCompetitionProjectRegistration.getEnrollCode());
instructorSheetMapper.insert(entity);
}
}
}
@Override
@Transactional(rollbackFor = Exception.class)
public void updateMain(AnnualCompetitionProjectRegistration annualCompetitionProjectRegistration, List<TeamManagement> teamManagementList, List<InstructorSheet> instructorSheetList) {
annualCompetitionProjectRegistrationMapper.updateById(annualCompetitionProjectRegistration);
//1.先删除子表数据
teamManagementMapper.deleteByMainId(annualCompetitionProjectRegistration.getEnrollCode());
instructorSheetMapper.deleteByMainId(annualCompetitionProjectRegistration.getEnrollCode());
//2.子表数据重新插入
if (teamManagementList != null && teamManagementList.size() > 0) {
for (TeamManagement entity : teamManagementList) {
//外键设置
entity.setEnrollCode(annualCompetitionProjectRegistration.getEnrollCode());
teamManagementMapper.insert(entity);
}
}
if (instructorSheetList != null && instructorSheetList.size() > 0) {
for (InstructorSheet entity : instructorSheetList) {
//外键设置
entity.setEnrollCode(annualCompetitionProjectRegistration.getEnrollCode());
instructorSheetMapper.insert(entity);
}
}
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delMain(String id) {
teamManagementMapper.deleteByMainId(id);
instructorSheetMapper.deleteByMainId(id);
annualCompetitionProjectRegistrationMapper.deleteById(id);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delBatchMain(Collection<? extends Serializable> idList) {
for (Serializable id : idList) {
teamManagementMapper.deleteByMainId(id.toString());
instructorSheetMapper.deleteByMainId(id.toString());
annualCompetitionProjectRegistrationMapper.deleteById(id);
}
}
@Override
public AnnualCompetitionProjectRegistration getRegistrationByAnnualCompPointId(
String annualCompPointId
) {
// 获取当前用户的登录信息
LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
// 获取当前用户所有的报名编号
List<TeamManagement> teamManagementList = teamManagementMapper.selectList(
Wrappers.lambdaQuery(TeamManagement.class)
.eq(TeamManagement::getUserId, loginUser.getId())
);
if (teamManagementList == null || teamManagementList.isEmpty()) {
return null;
}
// 报名编号列表
List<String> enrollCodes = new ArrayList<>();
teamManagementList.forEach(team ->
enrollCodes.add(team.getEnrollCode()));
if (enrollCodes.isEmpty()) {
return null;
}
// 获取报名信息
return annualCompetitionProjectRegistrationMapper.selectOne(
Wrappers.lambdaQuery(
AnnualCompetitionProjectRegistration.class
)
.eq(AnnualCompetitionProjectRegistration::getAnnualCompid,
annualCompPointId)
.in(AnnualCompetitionProjectRegistration::getEnrollCode,
enrollCodes)
.last("limit 1")
);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void studentSignUp(StudentSignUpVo studentSignUpVo) {
AnnualCompPoint annualCompPoint = iAnnualCompPointService.getById(studentSignUpVo.getId());
AnnualComp annualComp = iannualCompService.getById(annualCompPoint.getAnnualCompId());
Annual annual = iAnnualService.getById(annualComp.getAnnualid());
if (ObjectUtils.isEmpty(annualCompPoint) || ObjectUtils.isEmpty(annualComp) || ObjectUtils.isEmpty(annual))
return;
String enrollCode = "";
List<TeamManagement> saveTeamManagementList = new LinkedList<>();
// String signUpName = studentSignUpVo.getSignUpName();
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
// 个人、团队,键值对 N-个人 Y-团队
if (StringUtils.equals("N", annualCompPoint.getEntryForm())) {
enrollCode = builderEnrollCode(annual.getAnnualName() + "gr");
TeamManagement person = new TeamManagement();
person.setEnrollCode(enrollCode);
person.setSysOrgCode(annualCompPoint.getSysOrgCode());
person.setCreateBy(sysUser.getUsername());
person.setUserId(sysUser.getId());
person.setCaptain("1");
saveTeamManagementList.add(person);
} else {//团队赛
enrollCode = builderEnrollCode(annual.getAnnualName() + "td");
String finalEnrollCode = enrollCode;
// 放入队长
TeamManagement teamManagement = new TeamManagement();
teamManagement.setEnrollCode(finalEnrollCode);
teamManagement.setSysOrgCode(annualCompPoint.getSysOrgCode());
teamManagement.setCreateBy(sysUser.getUsername());
teamManagement.setCaptain("1");
teamManagement.setUserId(sysUser.getId());
saveTeamManagementList.add(teamManagement);
// 团队队员
String teamManagementStr = studentSignUpVo.getTeamManagementList();
List<String> teamMemberList = new LinkedList<>();
if (StringUtils.isNotBlank(teamManagementStr)) {
teamMemberList.addAll(Arrays.stream(teamManagementStr.split(",")).collect(Collectors.toList()));
}
if (!ObjectUtils.isEmpty(teamMemberList)) {
teamMemberList.forEach(userNameStr -> {
TeamManagement teamMember = new TeamManagement();
teamMember.setEnrollCode(finalEnrollCode);
teamMember.setSysOrgCode(annualCompPoint.getSysOrgCode());
teamMember.setCreateBy(sysUser.getUsername());
teamMember.setCaptain("0");
SysUser user = iSysUserService.getUserByName(userNameStr);
teamMember.setUserId(user.getId());
saveTeamManagementList.add(teamMember);
});
}
}
AnnualCompetitionProjectRegistration registration = new AnnualCompetitionProjectRegistration();
registration.setAnnualCompid(annualCompPoint.getId());
registration.setEnrollCode(enrollCode);
registration.setEnrollStatic("2");
if ("N".equals(annualCompPoint.getEntryForm())) {
registration.setEntryFormat("0");
} else {
registration.setEntryFormat("1");
}
registration.setTeamName(studentSignUpVo.getTeamName());
registration.setSysOrgCode(annualCompPoint.getSysOrgCode());
registration.setCreateBy(sysUser.getUsername());
List<InstructorSheet> saveInstructorSheetList = new LinkedList<>();
String advisorTeacherInstructorSheet = studentSignUpVo.getAdvisorTeacherInstructorSheet();
if (StringUtils.isNotBlank(advisorTeacherInstructorSheet)) {
InstructorSheet instructorSheet = new InstructorSheet();
instructorSheet.setAnnualCompid(annualCompPoint.getId());
instructorSheet.setCreateBy(sysUser.getUsername());
instructorSheet.setSysOrgCode(annualCompPoint.getSysOrgCode());
instructorSheet.setTeacherType(1);
instructorSheet.setTeacherName(advisorTeacherInstructorSheet);
instructorSheet.setEnrollCode(enrollCode);
saveInstructorSheetList.add(instructorSheet);
}
String leaderTeacherInstructorSheet = studentSignUpVo.getLeaderTeacherInstructorSheet();
if (StringUtils.isNotBlank(leaderTeacherInstructorSheet)) {
InstructorSheet leaderTeacher = new InstructorSheet();
leaderTeacher.setAnnualCompid(annualCompPoint.getId());
leaderTeacher.setCreateBy(sysUser.getUsername());
leaderTeacher.setSysOrgCode(annualCompPoint.getSysOrgCode());
leaderTeacher.setTeacherType(2);
leaderTeacher.setTeacherName(leaderTeacherInstructorSheet);
leaderTeacher.setEnrollCode(enrollCode);
saveInstructorSheetList.add(leaderTeacher);
}
this.save(registration);
iTeamManagementService.saveBatch(saveTeamManagementList);
iInstructorSheetService.saveBatch(saveInstructorSheetList);
}
public String builderEnrollCode(final String type) {
String enrollCode = type;
String uuid = IdUtil.randomUUID().replaceAll("-", "");
enrollCode += uuid.substring(0, 16);
List<AnnualCompetitionProjectRegistration> list = this.query().eq("enroll_code", enrollCode).list();
if (ObjectUtils.isEmpty(list)) {
return enrollCode.toUpperCase();
} else {
return builderEnrollCode(type);
}
}
}

@ -0,0 +1,53 @@
package org.jeecg.modules.demo.annualcompetitionprojectregistration.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* @Description: TODO
* @Author: Z.H.C
* @CreateTime: 2023-12-13 11:22
* @Version: 1.0
*/
@Data
public class StudentSignUpVo implements Serializable {
@ApiModelProperty(value = "年度比赛项目id")
private String id;
@ApiModelProperty(value = "参赛人姓名")
private String signUpName;
/**
* 老师类型 1指导老师2领队老师
*/
/**
* 指导老师
*/
@ApiModelProperty(value = "指导老师")
private String advisorTeacherInstructorSheet;
/**
* 领队老师名称
*/
@ApiModelProperty(value = "领队老师")
private String leaderTeacherInstructorSheet;
/**
* 1:0
* 个人赛自己是队长团队赛报名人是队长
*/
// @ApiModelProperty(value = "是否队长")
// private String captain;
@ApiModelProperty(value = "团队赛成员名称")
private String teamManagementList;
@ApiModelProperty(value = "队伍名称")
private String teamName;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 812 KiB

@ -34,7 +34,8 @@
flex-basis: 60%;
-webkit-flex-basis: 60%;
background-color: #0198cd;
background-image: url(../icon/jeecg_ad.png);
//background-image: url(../icon/jeecg_ad.png);
background-image: url(../icon/黄淮学院北门.png);
background-size: cover;
}

@ -0,0 +1,101 @@
import { defHttp } from '/@/utils/http/axios';
import { useMessage } from "/@/hooks/web/useMessage";
const { createConfirm } = useMessage();
enum Api {
list = '/AnnualCompPoint/annualCompPoint/listStudent',
save='/AnnualCompPoint/annualCompPoint/add',
edit='/AnnualCompPoint/annualCompPoint/edit',
deleteOne = '/AnnualCompPoint/annualCompPoint/delete',
deleteBatch = '/AnnualCompPoint/annualCompPoint/deleteBatch',
importExcel = '/AnnualCompPoint/annualCompPoint/importExcel',
exportXls = '/AnnualCompPoint/annualCompPoint/exportXls',
updateApply = '/AnnualCompPoint/annualCompPoint/updateApply',
studentSignUp = '/annualcompetitionprojectregistration/annualCompetitionProjectRegistration/studentSignUp',
}
/**
* api
* @param params
*/
export const getExportUrl = Api.exportXls;
/**
* api
*/
export const getImportUrl = Api.importExcel;
/**
*
* @param params
*/
export const list = (params) => defHttp.get({ url: Api.list, params });
/**
*
* @param params
* @param handleSuccess
*/
export const deleteOne = (params,handleSuccess) => {
return defHttp.delete({url: Api.deleteOne, params}, {joinParamsToUrl: true}).then(() => {
handleSuccess();
});
}
/**
*
* @param params
* @param handleSuccess
*/
export const batchDelete = (params, handleSuccess) => {
createConfirm({
iconType: 'warning',
title: '确认删除',
content: '是否删除选中数据',
okText: '确认',
cancelText: '取消',
onOk: () => {
return defHttp.delete({url: Api.deleteBatch, data: params}, {joinParamsToUrl: true}).then(() => {
handleSuccess();
});
}
});
}
/**
*
* @param params
* @param isUpdate
*/
export const saveOrUpdate = (params, isUpdate) => {
let url = isUpdate ? Api.edit : Api.save;
return defHttp.post({ url: url, params }, { isTransformResponse: false });
}
/**
*
* @param params
* @param handleSuccess
*/
export const updateApply = (params,handleSuccess) => {
createConfirm({
iconType: 'warning',
title: '确认操作',
content: '确认发送请求吗',
okText: '确认',
cancelText: '取消',
onOk: () => {
return defHttp.post({url: Api.updateApply,params}, {joinParamsToUrl: true}).then(() => {
handleSuccess();
});
}
});
}
/**
* -
*/
export const studentSignUp = (params) => {
return defHttp.post({ url: Api.studentSignUp, params });
};

@ -0,0 +1,444 @@
import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import {rules} from '/@/utils/helper/validator';
import {render} from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
{
title: '年度比赛',
align: "center",
dataIndex: 'annualCompId_dictText'
},
{
title: '项目名称',
align: "center",
dataIndex: 'objName'
},
{
title: '项目层次',
align: "center",
dataIndex: 'objLevel_dictText',
},
{
title: '参与形式',
align: "center",
dataIndex: 'entryForm',
customRender: ({text}) => {
return render.renderSwitch(text, [{text: '团队赛', value: 'Y'}, {text: '个人赛', value: 'N'}]);
},
},
{
title: '是否报名',
align: "center",
dataIndex: 'requireApply',
customRender: ({text}) => {
return render.renderSwitch(text, [{text: '是', value: 'Y'}, {text: '否', value: 'N'}]);
},
},
{
title: '是否选题',
align: "center",
dataIndex: 'requireTopic',
customRender: ({text}) => {
return render.renderSwitch(text, [{text: '是', value: 'Y'}, {text: '否', value: 'N'}]);
},
},
{
title: '是否上传作品',
align: "center",
dataIndex: 'requireUploadWorks',
customRender: ({text}) => {
return render.renderSwitch(text, [{text: '是', value: 'Y'}, {text: '否', value: 'N'}]);
},
},
{
title: '是否评分',
align: "center",
dataIndex: 'requireScore',
customRender: ({text}) => {
return render.renderSwitch(text, [{text: '是', value: 'Y'}, {text: '否', value: 'N'}]);
},
},
{
title: '开始时间',
align: "center",
dataIndex: 'starttime'
},
{
title: '结束时间',
align: "center",
dataIndex: 'endtime'
},
];
//查询数据
export const searchFormSchema: FormSchema[] = [];
//表单数据
export const formSchema: FormSchema[] = [
{
label: '年度比赛',
field: 'annualCompId',
component: 'JPopup',
componentProps: ({formActionType}) => {
const {setFieldsValue} = formActionType;
return {
setFieldsValue: setFieldsValue,
code: "ndbs",
fieldConfig: [
{source: 'name', target: 'annualCompId'},
],
multi: true
}
},
dynamicRules: ({model, schema}) => {
return [
{required: true, message: '请输入年度比赛id!'},
];
},
},
{
label: '项目名称',
field: 'objName',
component: 'Input',
dynamicRules: ({model, schema}) => {
return [
{required: true, message: '请输入项目名称!'},
];
},
},
{
label: '简介',
field: 'introduce',
component: 'InputTextArea',
},
{
label: '项目层次',
field: 'objLevel',
component: 'JPopup',
componentProps: ({formActionType}) => {
const {setFieldsValue} = formActionType;
return {
setFieldsValue: setFieldsValue,
code: "xmcc",
fieldConfig: [
{source: 'level_name', target: 'objLevel'},
],
multi: false
}
},
},
{
label: '参与形式',
field: 'entryForm',
component: 'JSwitch',
componentProps: {},
dynamicRules: ({model, schema}) => {
return [
{required: true, message: '请输入参与形式!'},
];
},
},
{
label: '队伍人数',
field: 'teamNumber',
component: 'InputNumber',
},
{
label: '指导老师人数',
field: 'teacherNumber',
component: 'InputNumber',
},
{
label: '是否需要领队',
field: 'requireLeader',
component: 'JSwitch',
componentProps: {},
},
{
label: '是否需要队伍名称',
field: 'requireTeamName',
component: 'JDictSelectTag',
componentProps: {
dictCode: ""
},
},
{
label: '是否报名',
field: 'requireApply',
component: 'JSwitch',
componentProps: {},
dynamicRules: ({model, schema}) => {
return [
{required: true, message: '请输入是否报名!'},
];
},
},
{
label: '是否选题',
field: 'requireTopic',
component: 'JSwitch',
componentProps: {},
dynamicRules: ({model, schema}) => {
return [
{required: true, message: '请输入是否选题!'},
];
},
},
{
label: '是否上传作品',
field: 'requireUploadWorks',
component: 'JSwitch',
componentProps: {},
dynamicRules: ({model, schema}) => {
return [
{required: true, message: '请输入是否上传作品!'},
];
},
},
{
label: '上传作品类型',
field: 'uploadWorksType',
component: 'JSelectMultiple',
componentProps: {
dictCode: ""
},
},
{
label: '是否评分',
field: 'requireScore',
component: 'JSwitch',
componentProps: {},
dynamicRules: ({model, schema}) => {
return [
{required: true, message: '请输入是否评分!'},
];
},
},
{
label: '开始时间',
field: 'starttime',
component: 'DatePicker',
componentProps: {
showTime: true,
valueFormat: 'YYYY-MM-DD HH:mm:ss'
},
dynamicRules: ({model, schema}) => {
return [
{required: true, message: '请输入开始时间!'},
];
},
},
{
label: '结束时间',
field: 'endtime',
component: 'DatePicker',
componentProps: {
showTime: true,
valueFormat: 'YYYY-MM-DD HH:mm:ss'
},
dynamicRules: ({model, schema}) => {
return [
{required: true, message: '请输入结束时间!'},
];
},
},
{
label: '开关',
field: 'annualCompSwitch',
component: 'JSwitch',
componentProps: {},
},
{
label: '驳回信息',
field: 'message',
component: 'InputTextArea',
},
{
label: '报名开始时间',
field: 'applyStartTime',
component: 'DatePicker',
componentProps: {
showTime: true,
valueFormat: 'YYYY-MM-DD HH:mm:ss'
},
},
{
label: '报名结束时间',
field: 'applyEndTime',
component: 'DatePicker',
componentProps: {
showTime: true,
valueFormat: 'YYYY-MM-DD HH:mm:ss'
},
},
{
label: '选题开始时间',
field: 'topicStartTime',
component: 'DatePicker',
componentProps: {
showTime: true,
valueFormat: 'YYYY-MM-DD HH:mm:ss'
},
},
{
label: '选题结束时间',
field: 'topicEndTime',
component: 'DatePicker',
componentProps: {
showTime: true,
valueFormat: 'YYYY-MM-DD HH:mm:ss'
},
},
{
label: '上传作品开始时间',
field: 'uploadStartTime',
component: 'DatePicker',
componentProps: {
showTime: true,
valueFormat: 'YYYY-MM-DD HH:mm:ss'
},
},
{
label: '上传作品结束时间',
field: 'uploadEndTime',
component: 'DatePicker',
componentProps: {
showTime: true,
valueFormat: 'YYYY-MM-DD HH:mm:ss'
},
},
{
label: '评分开始时间',
field: 'scoreStartTime',
component: 'DatePicker',
componentProps: {
showTime: true,
valueFormat: 'YYYY-MM-DD HH:mm:ss'
},
},
{
label: '评分结束时间',
field: 'scoreEndTime',
component: 'DatePicker',
componentProps: {
showTime: true,
valueFormat: 'YYYY-MM-DD HH:mm:ss'
},
},
// TODO 主键隐藏字段,目前写死为ID
{
label: '',
field: 'id',
component: 'Input',
show: false,
},
];
export const formStudentSignUp4PersonSchema: FormSchema[] = [
{
label: '',
field: 'id',
component: 'Input',
show: false,
},
{
field: 'signUpName',
label: '参赛人',
component: 'Input',
componentProps: {
readOnly: true,
allowClear: false,
},
},
{
field: 'advisorTeacherInstructorSheet',
label: '指导老师',
required: false,
component: 'Input',
// componentProps: {
// rowKey: 'username',
// labelKey: 'realname',
// maxSelectCount: 5,
// },
},
{
field: 'leaderTeacherInstructorSheet',
label: '领队老师',
required: false,
component: 'Input',
// componentProps: {
// rowKey: 'username',
// labelKey: 'realname',
// maxSelectCount: 5,
// },
},
];
export const formStudentSignUp4TeamSchema: FormSchema[] = [
{
label: '',
field: 'id',
component: 'Input',
show: false,
},
{
field: 'signUpName',
label: '参赛人(队长)',
component: 'Input',
componentProps: {
readOnly: true,
allowClear: false,
},
},
{
field: 'teamName',
label: '队伍名称',
required: true,
component: 'Input',
// componentProps: {
// rowKey: 'username',
// labelKey: 'realname',
// maxSelectCount: 5,
// },
},
{
field: 'teamManagementList',
label: '团队成员',
required: true,
component: 'JSelectUser',
componentProps: {
rowKey: 'username',
labelKey: 'realname',
maxSelectCount: 8,
},
},
{
field: 'advisorTeacherInstructorSheet',
label: '指导老师',
required: false,
component: 'Input',
// componentProps: {
// rowKey: 'username',
// labelKey: 'realname',
// maxSelectCount: 5,
// },
},
{
field: 'leaderTeacherInstructorSheet',
label: '领队老师',
required: false,
component: 'Input',
// componentProps: {
// rowKey: 'username',
// labelKey: 'realname',
// maxSelectCount: 5,
// },
},
];

@ -0,0 +1,293 @@
<template>
<div>
<!--查询区域-->
<div class="jeecg-basic-table-form-container">
<a-form ref="formRef" @keyup.enter.native="searchQuery" :model="queryParam" :label-col="labelCol" :wrapper-col="wrapperCol">
<a-row :gutter="24" />
</a-form>
</div>
<!--引用表格-->
<BasicTable @register="registerTable" :rowSelection="rowSelection">
<!--插槽:table标题-->
<template #tableTitle>
<!-- <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>
<!-- <j-upload-button type="primary" preIcon="ant-design:import-outlined" @click="onImportXls"> 导入 </j-upload-button>-->
<a-dropdown v-if="selectedRowKeys.length > 0">
<template #overlay>
<a-menu>
<a-menu-item key="1" @click="batchHandleDelete">
<Icon icon="ant-design:delete-outlined" />
删除
</a-menu-item>
</a-menu>
</template>
<a-button
>批量操作
<Icon icon="mdi:chevron-down" />
</a-button>
</a-dropdown>
</template>
<!--操作栏-->
<template #action="{ record }">
<TableAction :actions="getTableAction(record)" />
</template>
<!--字段回显插槽-->
<template #htmlSlot="{ text }">
<div v-html="text"></div>
</template>
<!--省市区字段回显插槽-->
<template #pcaSlot="{ text }">
{{ getAreaTextByCode(text) }}
</template>
<template #fileSlot="{ text }">
<span v-if="!text" style="font-size: 12px; font-style: italic">无文件</span>
<a-button v-else :ghost="true" type="primary" preIcon="ant-design:download-outlined" size="small" @click="downloadFile(text)">下载 </a-button>
</template>
</BasicTable>
<!-- 表单区域 -->
<AnnualCompPointModal ref="registerModal" @success="handleSuccess" />
</div>
<WorkUpload ref="workUploadRef"/>
</template>
<script lang="ts" name="AnnualCompPoint-annualCompPoint" setup>
import { ref, reactive } from 'vue';
import { BasicTable, useTable, TableAction } from '/@/components/Table';
import { useListPage } from '/@/hooks/system/useListPage';
import { columns } from './AnnualCompPoint.data';
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl, updateApply } from './AnnualCompPoint.api.ts';
import { downloadFile } from '/@/utils/common/renderUtils';
import AnnualCompPointModal from './components/AnnualCompPointModal.vue';
import JSwitch from '/@/components/Form/src/jeecg/components/JSwitch.vue';
import JSelectMultiple from '/@/components/Form/src/jeecg/components/JSelectMultiple.vue';
import JPopup from '/@/components/Form/src/jeecg/components/JPopup.vue';
import {canUpload} from "/@/views/UpfilePersion/UpfilePersion.api.ts";
import { useModal } from '/@/components/Modal';
const [registerModal1, { openModal }] = useModal();
import AnnualCompetitionProjectRegistrationModal from '/@/views/annualcompetitionprojectregistration/student/components/AnnualCompetitionProjectRegistrationModal.vue';
import {useRouter} from "vue-router";
import {award} from "/@/views/award/AwardManagement.api.ts";
const formRef = ref();
const queryParam = reactive<any>({});
const toggleSearchStatus = ref<boolean>(false);
const registerModal = ref();
const workUploadRef = ref()
//table
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
tableProps: {
title: '年度比赛项目管理',
api: list,
columns,
canResize: false,
useSearchForm: false,
actionColumn: {
width: 200,
fixed: 'right',
},
beforeFetch: (params) => {
return Object.assign(params, queryParam);
},
},
exportConfig: {
name: '年度比赛项目管理',
url: getExportUrl,
params: queryParam,
},
importConfig: {
url: getImportUrl,
success: handleSuccess,
},
});
const [registerTable, { reload, collapseAll, updateTableDataRecord, findTableDataRecord, getDataSource }, { rowSelection, selectedRowKeys }] =
tableContext;
const labelCol = reactive({
xs: { span: 24 },
sm: { span: 7 },
});
const wrapperCol = reactive({
xs: { span: 24 },
sm: { span: 16 },
});
/**
* 新增事件
*/
function handleAdd() {
registerModal.value.disableSubmit = false;
registerModal.value.add();
}
const isCanUpload = ref(false)
//
async function handleWorkSubmit(record) {
isCanUpload.value = false
await canUpload({...record})
isCanUpload.value = true
if (isCanUpload.value) {
workUploadRef.value.modalShow(true, record.id)
}
}
/**
* 年度项目管理 评奖
*/
const router = useRouter()
function pingjiang(record: Recordable) {
router.push({
path: '/award/AwardManagementList',
query: {id: record.id}
});
}
/**
* 年度项目管理 作品管理
*/
function workManage(record: Recordable) {
router.push({
path: '/workManage/works',
query: {annualCompPointId: record.id}
});
}
/**
* 年度项目管理 报名
*/
function application(record: Recordable) {
router.push({
path: '/annualcompetitionprojectregistration/student/AnnualCompetitionProjectRegistrationList',
query: {annualCompid: record.objName ,entryFormat: record.entryForm === 'N' ? '个人':'团队', id: record.id}
});
}
/**
* 报名事件
*/
function handleEdit(record: Recordable) {
openModal(true, {
isUpdate: false,
showFooter: true,
});
}
/**
* 详情
*/
function handleDetail(record: Recordable) {
registerModal.value.disableSubmit = true;
registerModal.value.edit(record);
}
/**
* 年度项目管理 提交审核按钮
*/
function handleSubmitandApply(record: Recordable) {
updateApply({ id: record.id, annualCompState: record.annualCompState }, handleSuccess);
}
/**
* 删除事件
*/
async function handleDelete(record) {
await deleteOne({ id: record.id }, handleSuccess);
}
/**
* 批量删除事件
*/
async function batchHandleDelete() {
await batchDelete({ ids: selectedRowKeys.value }, handleSuccess);
}
/**
* 成功回调
*/
function handleSuccess() {
(selectedRowKeys.value = []) && reload();
}
/**
* 操作栏
*/
function getTableAction(record) {
const actions = [
{
label: '报名7',
onClick: application.bind(null, record),
},
{
label: '详情',
onClick: handleDetail.bind(null, record),
},
];
// if (record.annualCompState === '2') {
// actions.unshift({
// label: '',
// onClick: handleSubmitandApply.bind(null, record),
// });
// }
if (record.requireUploadWorks === 'Y') {
actions.unshift({
label: '作品管理',
onClick: workManage.bind(null, record),
});
}
/*if (record.requireTopic === 'Y' && record.annualCompState === '2') {
actions.unshift({
label: '选题',
onClick: handleSubmitandApply.bind(null, record),
});
}*/
return actions;
}
/**
* 查询
*/
function searchQuery() {
reload();
}
/**
* 重置
*/
function searchReset() {
formRef.value.resetFields();
selectedRowKeys.value = [];
//
reload();
}
/**
* popup组件值改变事件
*/
function setFieldsValue(map) {
Object.keys(map).map((key) => {
queryParam[key] = map[key];
});
}
</script>
<style lang="less" scoped>
.jeecg-basic-table-form-container {
.table-page-search-submitButtons {
display: block;
margin-bottom: 24px;
white-space: nowrap;
}
.query-group-cust {
width: calc(50% - 15px);
min-width: 100px !important;
}
.query-group-split-cust {
width: 30px;
display: inline-block;
text-align: center;
}
}
</style>

@ -0,0 +1,336 @@
<template>
<div>
<!--查询区域-->
<div class="jeecg-basic-table-form-container">
<a-form ref="formRef" @keyup.enter.native="searchQuery" :model="queryParam"
:label-col="labelCol" :wrapper-col="wrapperCol">
<a-row :gutter="24"/>
</a-form>
</div>
<!--引用表格-->
<BasicTable @register="registerTable" :rowSelection="rowSelection">
<!--插槽:table标题-->
<template #tableTitle>
<!-- <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>
<!-- <j-upload-button type="primary" preIcon="ant-design:import-outlined" @click="onImportXls"> 导入 </j-upload-button>-->
<a-dropdown v-if="selectedRowKeys.length > 0">
<template #overlay>
<a-menu>
<a-menu-item key="1" @click="batchHandleDelete">
<Icon icon="ant-design:delete-outlined"/>
删除
</a-menu-item>
</a-menu>
</template>
<a-button
>批量操作
<Icon icon="mdi:chevron-down"/>
</a-button>
</a-dropdown>
</template>
<!--操作栏-->
<template #action="{ record }">
<TableAction :actions="getTableAction(record)"/>
</template>
<!--字段回显插槽-->
<template #htmlSlot="{ text }">
<div v-html="text"></div>
</template>
<!--省市区字段回显插槽-->
<template #pcaSlot="{ text }">
{{ getAreaTextByCode(text) }}
</template>
<template #fileSlot="{ text }">
<span v-if="!text" style="font-size: 12px; font-style: italic">无文件</span>
<a-button v-else :ghost="true" type="primary" preIcon="ant-design:download-outlined"
size="small" @click="downloadFile(text)">下载
</a-button>
</template>
</BasicTable>
<!--学生报名-->
<StudentSignUp4PersonModal @register="signUp4PersonModal" @success="reload"/>
<StudentSignUp4TeamModal @register="signUp4TeamModal" @success="reload"/>
<!-- 表单区域 -->
<AnnualCompPointModal ref="registerModal" @success="handleSuccess"/>
</div>
<WorkUpload ref="workUploadRef"/>
</template>
<script lang="ts" name="AnnualCompPoint-annualCompPoint" setup>
import {reactive, ref} from 'vue';
import {BasicTable, TableAction} from '/@/components/Table';
import StudentSignUp4PersonModal from './components/StudentSignUp4PersonModal.vue';
import StudentSignUp4TeamModal from './components/StudentSignUp4TeamModal.vue';
import {useListPage} from '/@/hooks/system/useListPage';
import {columns} from './AnnualCompPoint.data';
import {
batchDelete,
deleteOne,
getExportUrl,
getImportUrl,
list,
updateApply
} from './AnnualCompPoint.api.ts';
import {downloadFile} from '/@/utils/common/renderUtils';
import AnnualCompPointModal from './components/AnnualCompPointModal.vue';
import {canUpload} from "/@/views/UpfilePersion/UpfilePersion.api.ts";
import {useModal} from '/@/components/Modal';
import {useRouter} from "vue-router";
const [registerModal1, {openModal}] = useModal();
const formRef = ref();
const queryParam = reactive<any>({});
const toggleSearchStatus = ref<boolean>(false);
const registerModal = ref();
const workUploadRef = ref()
//model
const [signUp4PersonModal, {openModal: openSignUp4PersonModal}] = useModal();
const [signUp4TeamModal, {openModal: openSignUp4TeamModal}] = useModal();
//table
const {prefixCls, tableContext, onExportXls, onImportXls} = useListPage({
tableProps: {
title: '年度比赛项目管理',
api: list,
columns,
canResize: false,
useSearchForm: false,
actionColumn: {
width: 200,
fixed: 'right',
},
beforeFetch: (params) => {
return Object.assign(params, queryParam);
},
},
exportConfig: {
name: '年度比赛项目管理',
url: getExportUrl,
params: queryParam,
},
importConfig: {
url: getImportUrl,
success: handleSuccess,
},
});
const [registerTable, {
reload,
collapseAll,
updateTableDataRecord,
findTableDataRecord,
getDataSource
}, {rowSelection, selectedRowKeys}] =
tableContext;
const labelCol = reactive({
xs: {span: 24},
sm: {span: 7},
});
const wrapperCol = reactive({
xs: {span: 24},
sm: {span: 16},
});
/**
* 新增事件
*/
function handleAdd() {
registerModal.value.disableSubmit = false;
registerModal.value.add();
}
const isCanUpload = ref(false)
//
async function handleWorkSubmit(record) {
isCanUpload.value = false
await canUpload({...record})
isCanUpload.value = true
if (isCanUpload.value) {
workUploadRef.value.modalShow(true, record.id)
}
}
/**
* 年度项目管理 评奖
*/
const router = useRouter()
function pingjiang(record: Recordable) {
router.push({
path: '/award/AwardManagementList',
query: {id: record.id}
});
}
/**
* 年度项目管理 作品管理
*/
function workManage(record: Recordable) {
router.push({
path: '/workManage/works',
query: {annualCompPointId: record.id}
});
}
/**
* 年度项目管理 报名
*/
function application(record: Recordable) {
router.push({
path: '/annualcompetitionprojectregistration/student/AnnualCompetitionProjectRegistrationList',
query: {
annualCompid: record.objName,
entryFormat: record.entryForm === 'N' ? '个人' : '团队',
id: record.id
}
});
}
/**
* 报名事件
*/
function handleEdit(record: Recordable) {
openModal(true, {
isUpdate: false,
showFooter: true,
});
}
/**
* 详情
*/
function handleDetail(record: Recordable) {
registerModal.value.disableSubmit = true;
registerModal.value.edit(record);
}
/**
* 年度项目管理 提交审核按钮
*/
function handleSubmitandApply(record: Recordable) {
updateApply({id: record.id, annualCompState: record.annualCompState}, handleSuccess);
}
/**
* 删除事件
*/
async function handleDelete(record) {
await deleteOne({id: record.id}, handleSuccess);
}
/**
* 批量删除事件
*/
async function batchHandleDelete() {
await batchDelete({ids: selectedRowKeys.value}, handleSuccess);
}
/**
* 成功回调
*/
function handleSuccess() {
(selectedRowKeys.value = []) && reload();
}
/**
* 打开报名弹窗
*/
function handleSignUpSettings(record) {
if (record.entryForm === "N") {
openSignUp4PersonModal(true, {record});
} else {
openSignUp4TeamModal(true, {record});
}
}
/**
* 操作栏
*/
function getTableAction(record) {
const actions = [
{
label: '报名',
// onClick: application.bind(null, record),
onClick: handleSignUpSettings.bind(null, record),
},
{
label: '详情',
onClick: handleDetail.bind(null, record),
},
];
// if (record.annualCompState === '2') {
// actions.unshift({
// label: '',
// onClick: handleSubmitandApply.bind(null, record),
// });
// }
if (record.requireUploadWorks === 'Y') {
actions.unshift({
label: '作品管理',
onClick: workManage.bind(null, record),
});
}
/*if (record.requireTopic === 'Y' && record.annualCompState === '2') {
actions.unshift({
label: '选题',
onClick: handleSubmitandApply.bind(null, record),
});
}*/
return actions;
}
/**
* 查询
*/
function searchQuery() {
reload();
}
/**
* 重置
*/
function searchReset() {
formRef.value.resetFields();
selectedRowKeys.value = [];
//
reload();
}
/**
* popup组件值改变事件
*/
function setFieldsValue(map) {
Object.keys(map).map((key) => {
queryParam[key] = map[key];
});
}
</script>
<style lang="less" scoped>
.jeecg-basic-table-form-container {
.table-page-search-submitButtons {
display: block;
margin-bottom: 24px;
white-space: nowrap;
}
.query-group-cust {
width: calc(50% - 15px);
min-width: 100px !important;
}
.query-group-split-cust {
width: 30px;
display: inline-block;
text-align: center;
}
}
</style>

@ -0,0 +1,370 @@
<template>
<a-spin :spinning="confirmLoading">
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-row>
<a-col :span="24">
<a-form-item label="年度比赛" v-bind="validateInfos.annualCompId">
<j-popup
placeholder="请选择年度比赛"
v-model:value="formData.annualCompId_dictText"
code="ndbs"
:fieldConfig="[
{ source: 'name', target: 'annualCompId_dictText' },
{ source: 'id', target: 'annualCompId' },
]"
:multi="true"
:setFieldsValue="setFieldsValue"
:disabled="disabled"/>
</a-form-item>
</a-col>
</a-row>
<a-row>
<a-col :span="16">
<a-form-item label="项目名称" v-bind="validateInfos.objName">
<a-input v-model:value="formData.objName" placeholder="请输入项目名称"
:disabled="disabled"></a-input>
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="项目层次" v-bind="validateInfos.objLevel">
<j-popup
placeholder="请选择项目层次"
v-model:value="formData.objLevel_dictText"
code="xmcc"
:fieldConfig="[
{ source: 'level_name', target: 'objLevel_dictText' },
{ source: 'id', target: 'objLevel' },
]"
:multi="false"
:setFieldsValue="setFieldsValue"
:disabled="disabled"/>
</a-form-item>
</a-col>
</a-row>
<a-row>
<a-col :span="10">
<a-form-item label="开始时间" v-bind="validateInfos.starttime">
<a-date-picker placeholder="请选择开始时间" v-model:value="formData.starttime" showTime
value-format="YYYY-MM-DD HH:mm:ss" style="width: 100%"
:disabled="disabled"/>
</a-form-item>
</a-col>
<a-col :span="10">
<a-form-item label="结束时间" v-bind="validateInfos.endtime">
<a-date-picker placeholder="请选择结束时间" v-model:value="formData.endtime" showTime
value-format="YYYY-MM-DD HH:mm:ss" style="width: 100%"
:disabled="disabled"/>
</a-form-item>
</a-col>
</a-row>
<a-row>
<a-col :span="24">
<a-form-item label="简介" v-bind="validateInfos.introduce">
<a-textarea v-model:value="formData.introduce" rows="4" placeholder="请输入简介"
:disabled="disabled"/>
</a-form-item>
</a-col>
</a-row>
<a-row>
<a-col :span="5">
<a-form-item label="参与形式" v-bind="validateInfos.entryForm">
<j-switch checkedChildren="团队" unCheckedChildren="个人" v-model:value="formData.entryForm" :disabled="disabled"></j-switch>
</a-form-item>
</a-col>
<a-col :span="9" v-if="formData.entryForm==='Y'">
<a-form-item label="是否需要领队" v-bind="validateInfos.requireLeader">
<j-switch v-model:value="formData.requireLeader" :disabled="disabled"></j-switch>
</a-form-item>
</a-col>
<a-col :span="9" v-if="formData.entryForm==='Y'">
<a-form-item label="是否需要队伍名称" v-bind="validateInfos.requireTeamName">
<j-dict-select-tag type='radio' v-model:value="formData.requireTeamName" dictCode=""
placeholder="请选择是否需要队伍名称" :disabled="disabled"/>
</a-form-item>
</a-col>
</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-form-item>
</a-col>
<a-col :span="12" v-if="formData.entryForm==='Y'">
<a-form-item label="指导老师人数" v-bind="validateInfos.teacherNumber">
<a-input-number v-model:value="formData.teacherNumber" placeholder="请输入指导老师人数"
style="width: 100%" :disabled="disabled"/>
</a-form-item>
</a-col>
</a-row>
<a-row>
<a-col :span="6">
<a-form-item label="是否报名" v-bind="validateInfos.requireApply">
<j-switch v-model:value="formData.requireApply" :disabled="disabled"></j-switch>
</a-form-item>
</a-col>
<a-col :span="9" v-if="formData.requireApply==='Y'">
<a-form-item label="开始时间" v-bind="validateInfos.applyStartTime">
<a-date-picker placeholder="请选择报名开始时间" v-model:value="formData.applyStartTime" showTime
value-format="YYYY-MM-DD HH:mm:ss" style="width: 100%"
:disabled="disabled"/>
</a-form-item>
</a-col>
<a-col :span="9" v-if="formData.requireApply==='Y'">
<a-form-item label="结束时间" v-bind="validateInfos.applyEndTime">
<a-date-picker placeholder="请选择报名结束时间" v-model:value="formData.applyEndTime" showTime
value-format="YYYY-MM-DD HH:mm:ss" style="width: 100%"
:disabled="disabled"/>
</a-form-item>
</a-col>
</a-row>
<a-row>
<a-col :span="6">
<a-form-item label="是否选题" v-bind="validateInfos.requireTopic">
<j-switch v-model:value="formData.requireTopic" :disabled="disabled"></j-switch>
</a-form-item>
</a-col>
<a-col :span="9" v-if="formData.requireTopic==='Y'">
<a-form-item label="开始时间" v-bind="validateInfos.topicStartTime">
<a-date-picker placeholder="请选择选题开始时间" v-model:value="formData.topicStartTime" showTime
value-format="YYYY-MM-DD HH:mm:ss" style="width: 100%"
:disabled="disabled"/>
</a-form-item>
</a-col>
<a-col :span="9" v-if="formData.requireTopic==='Y'">
<a-form-item label="结束时间" v-bind="validateInfos.topicEndTime">
<a-date-picker placeholder="请选择选题结束时间" v-model:value="formData.topicEndTime" showTime
value-format="YYYY-MM-DD HH:mm:ss" style="width: 100%"
:disabled="disabled"/>
</a-form-item>
</a-col>
</a-row>
<a-row>
<a-col :span="12">
<a-form-item label="是否上传作品" v-bind="validateInfos.requireUploadWorks">
<j-switch v-model:value="formData.requireUploadWorks" :disabled="disabled"></j-switch>
</a-form-item>
</a-col>
<a-col :span="12" v-if="formData.requireUploadWorks==='Y'">
<a-form-item label="上传作品类型" v-bind="validateInfos.uploadWorksType">
<j-select-multiple type="list_multi" v-model:value="formData.uploadWorksType"
dictCode="" placeholder="请选择上传作品类型" :disabled="disabled"
:triggerChange="false"/>
</a-form-item>
</a-col>
<a-col :span="12" v-if="formData.requireUploadWorks==='Y'">
<a-form-item label="上传作品开始时间" v-bind="validateInfos.uploadStartTime">
<a-date-picker placeholder="请选择上传作品开始时间" v-model:value="formData.uploadStartTime"
showTime value-format="YYYY-MM-DD HH:mm:ss" style="width: 100%"
:disabled="disabled"/>
</a-form-item>
</a-col>
<a-col :span="12" v-if="formData.requireUploadWorks==='Y'">
<a-form-item label="上传作品结束时间" v-bind="validateInfos.uploadEndTime">
<a-date-picker placeholder="请选择上传作品结束时间" v-model:value="formData.uploadEndTime" showTime
value-format="YYYY-MM-DD HH:mm:ss" style="width: 100%"
:disabled="disabled"/>
</a-form-item>
</a-col>
</a-row>
<a-row>
<a-col :span="6">
<a-form-item label="是否评分" v-bind="validateInfos.requireScore">
<j-switch v-model:value="formData.requireScore" :disabled="disabled"></j-switch>
</a-form-item>
</a-col>
<a-col :span="9">
<a-form-item label="开始时间" v-bind="validateInfos.scoreStartTime">
<a-date-picker placeholder="请选择评分开始时间" v-model:value="formData.scoreStartTime" showTime
value-format="YYYY-MM-DD HH:mm:ss" style="width: 100%"
:disabled="disabled"/>
</a-form-item>
</a-col>
<a-col :span="9">
<a-form-item label="结束时间" v-bind="validateInfos.scoreEndTime">
<a-date-picker placeholder="请选择评分结束时间" v-model:value="formData.scoreEndTime" showTime
value-format="YYYY-MM-DD HH:mm:ss" style="width: 100%"
:disabled="disabled"/>
</a-form-item>
</a-col>
</a-row>
</a-form>
</a-spin>
</template>
<script lang="ts" setup>
import {ref, reactive, defineExpose, nextTick, defineProps, computed, onMounted} from 'vue';
import {defHttp} from '/@/utils/http/axios';
import {useMessage} from '/@/hooks/web/useMessage';
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
import JSwitch from '/@/components/Form/src/jeecg/components/JSwitch.vue';
import JSelectMultiple from '/@/components/Form/src/jeecg/components/JSelectMultiple.vue';
import JPopup from '/@/components/Form/src/jeecg/components/JPopup.vue';
import {getValueType} from '/@/utils';
import {saveOrUpdate} from '../AnnualCompPoint.api';
import {Form} from 'ant-design-vue';
const props = defineProps({
formDisabled: {type: Boolean, default: false},
formData: {
type: Object, default: () => {
}
},
formBpm: {type: Boolean, default: true}
});
const formRef = ref();
const useForm = Form.useForm;
const emit = defineEmits(['register', 'ok']);
const formData = reactive<Record<string, any>>({
id: '',
annualCompId: '',
objName: '',
introduce: '',
objLevel: '',
entryForm: 'Y',
teamNumber: undefined,
teacherNumber: undefined,
requireLeader: '',
requireTeamName: '',
requireApply: 'Y',
requireTopic: 'Y',
requireUploadWorks: 'Y',
uploadWorksType: '',
requireScore: 'Y',
starttime: '',
endtime: '',
annualCompSwitch: '',
message: '',
applyStartTime: '',
applyEndTime: '',
topicStartTime: '',
topicEndTime: '',
uploadStartTime: '',
uploadEndTime: '',
scoreStartTime: '',
scoreEndTime: '',
});
const {createMessage} = useMessage();
const labelCol = ref<any>({xs: {span: 24}, sm: {span: 5}});
const wrapperCol = ref<any>({xs: {span: 24}, sm: {span: 16}});
const confirmLoading = ref<boolean>(false);
//
const validatorRules = {
annualCompId: [{required: true, message: '请输入年度比赛id!'},],
objName: [{required: true, message: '请输入项目名称!'},],
entryForm: [{required: true, message: '请输入参与形式!'},],
requireApply: [{required: true, message: '请输入是否报名!'},],
requireTopic: [{required: true, message: '请输入是否选题!'},],
requireUploadWorks: [{required: true, message: '请输入是否上传作品!'},],
requireScore: [{required: true, message: '请输入是否评分!'},],
starttime: [{required: true, message: '请输入开始时间!'},],
endtime: [{required: true, message: '请输入结束时间!'},],
};
const {resetFields, validate, validateInfos} = useForm(formData, validatorRules, {immediate: true});
//
const disabled = computed(() => {
if (props.formBpm === true) {
if (props.formData.disabled === false) {
return false;
} else {
return true;
}
}
return props.formDisabled;
});
/**
* 新增
*/
function add() {
edit({});
}
/**
* 编辑
*/
function edit(record) {
nextTick(() => {
resetFields();
//
Object.assign(formData, record);
});
}
/**
* 提交数据
*/
async function submitForm() {
//
await validate();
confirmLoading.value = true;
const isUpdate = ref<boolean>(false);
//
let model = formData;
if (model.id) {
isUpdate.value = true;
}
//
for (let data in model) {
//
if (model[data] instanceof Array) {
let valueType = getValueType(formRef.value.getProps, data);
//
if (valueType === 'string') {
model[data] = model[data].join(',');
}
}
}
await saveOrUpdate(model, isUpdate.value)
.then((res) => {
if (res.success) {
createMessage.success(res.message);
emit('ok');
} else {
createMessage.warning(res.message);
}
})
.finally(() => {
confirmLoading.value = false;
});
}
/**
* popup组件值改变事件
*/
function setFieldsValue(map) {
Object.keys(map).map((key) => {
formData[key] = map[key];
});
}
defineExpose({
add,
edit,
submitForm,
});
</script>
<style lang="less" scoped>
.antd-modal-form {
min-height: 500px !important;
overflow-y: auto;
padding: 24px 24px 24px 24px;
}
</style>

@ -0,0 +1,75 @@
<template>
<a-modal :title="title" :width="width" :visible="visible" @ok="handleOk" :okButtonProps="{ class: { 'jee-hidden': disableSubmit } }" @cancel="handleCancel" cancelText="关闭">
<AnnualCompPointForm ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false"></AnnualCompPointForm>
</a-modal>
</template>
<script lang="ts" setup>
import { ref, nextTick, defineExpose } from 'vue';
import AnnualCompPointForm from './AnnualCompPointForm.vue'
const title = ref<string>('');
const width = ref<number>(800);
const visible = ref<boolean>(false);
const disableSubmit = ref<boolean>(false);
const registerForm = ref();
const emit = defineEmits(['register', 'success']);
/**
* 新增
*/
function add() {
title.value = '新增';
visible.value = true;
nextTick(() => {
registerForm.value.add();
});
}
/**
* 编辑
* @param record
*/
function edit(record) {
title.value = disableSubmit.value ? '详情' : '编辑';
visible.value = true;
nextTick(() => {
registerForm.value.edit(record);
});
}
/**
* 确定按钮点击事件
*/
function handleOk() {
registerForm.value.submitForm();
}
/**
* form保存回调事件
*/
function submitCallback() {
handleCancel();
emit('success');
}
/**
* 取消按钮回调事件
*/
function handleCancel() {
visible.value = false;
}
defineExpose({
add,
edit,
disableSubmit,
});
</script>
<style>
/**隐藏样式-modal确定按钮 */
.jee-hidden {
display: none !important;
}
</style>

@ -0,0 +1,52 @@
<template>
<BasicModal v-bind="$attrs" @register="registerModal" :width="800" title="个人赛" @ok="handleSubmit">
<BasicForm @register="registerForm" />
</BasicModal>
</template>
<script lang="ts" setup>
import { ref, computed, unref } from 'vue';
import { BasicModal, useModalInner } from '/@/components/Modal';
import { BasicForm, useForm } from '/@/components/Form/index';
import { formStudentSignUp4PersonSchema } from '../AnnualCompPoint.data';
import { studentSignUp } from '../AnnualCompPoint.api';
import { useUserStore } from '/@/store/modules/user';
const userStore = useUserStore();
// Emits
const emit = defineEmits(['success', 'register']);
//
const [registerForm, { resetFields, setFieldsValue, validate }] = useForm({
schemas: formStudentSignUp4PersonSchema,
showActionButtonGroup: false,
});
//
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
//
console.log("----11111---data:",JSON.stringify(data.record))
await resetFields();
setModalProps({ confirmLoading: false });
//
// const res = await getUserAgent({ userName: data.userName });
// data = res.result ? res.result : data;
data.signUpName = userStore.getUserInfo.realname;
data.id = data.record.id;
//
await setFieldsValue({ ...data });
});
//
async function handleSubmit() {
try {
const values = await validate();
setModalProps({ confirmLoading: true });
// console.log("----values------values:",JSON.stringify(values))
//
await studentSignUp(values);
//
closeModal();
//
emit('success');
} finally {
setModalProps({ confirmLoading: false });
}
}
</script>

@ -0,0 +1,51 @@
<template>
<BasicModal v-bind="$attrs" @register="registerModal" :width="800" title="团队赛" @ok="handleSubmit">
<BasicForm @register="registerForm" />
</BasicModal>
</template>
<script lang="ts" setup>
import { ref, computed, unref } from 'vue';
import { BasicModal, useModalInner } from '/@/components/Modal';
import { BasicForm, useForm } from '/@/components/Form/index';
import { formStudentSignUp4TeamSchema } from '../AnnualCompPoint.data';
import { studentSignUp } from '../AnnualCompPoint.api';
import { useUserStore } from '/@/store/modules/user';
const userStore = useUserStore();
// Emits
const emit = defineEmits(['success', 'register']);
//
const [registerForm, { resetFields, setFieldsValue, validate }] = useForm({
schemas: formStudentSignUp4TeamSchema,
showActionButtonGroup: false,
});
//
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
//
// console.log("----11111---data:",JSON.stringify(data.record))
await resetFields();
setModalProps({ confirmLoading: false });
data.signUpName = userStore.getUserInfo.realname;
data.id = data.record.id;
// console.log("----2222------data:",data)
//
await setFieldsValue({ ...data });
});
//
async function handleSubmit() {
try {
const values = await validate();
setModalProps({ confirmLoading: true });
// console.log("----values------values:",JSON.stringify(values))
//
await studentSignUp(values);
//
closeModal();
//
emit('success');
} finally {
setModalProps({ confirmLoading: false });
}
}
</script>

@ -21,7 +21,7 @@
<div class="aui-image">
<div class="aui-image-text">
<!-- <img :src="adTextImg" />-->
<img :src="logoImg_huanghuai" />
<!-- <img :src="logoImg_huanghuai" />-->
</div>
</div>
<div class="aui-formBox">

Loading…
Cancel
Save