significative 5 months ago
commit 628407e672
  1. 64
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/awardpersion/controller/AwardPersionController.java
  2. 11
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/awardpersion/entity/AwardPersion.java
  3. 144
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/bigScreen/service/CompSystemBigScreenServiceImpl.java
  4. 55
      jeecgboot-vue3-master/src/hooks/system/useListPage.ts
  5. 36
      jeecgboot-vue3-master/src/hooks/system/useMethods.ts
  6. 27
      jeecgboot-vue3-master/src/views/awardpersion/AwardPersion.api.ts
  7. 5
      jeecgboot-vue3-master/src/views/awardpersion/AwardPersion.data.ts
  8. 40
      jeecgboot-vue3-master/src/views/awardpersion/AwardPersionList.vue
  9. 400
      jeecgboot-vue3-master/src/views/awardpersion/AwardPersionList1.vue

@ -422,6 +422,38 @@ public class AwardPersionController extends JeecgController<AwardPersion, IAward
public ModelAndView exportXls(HttpServletRequest request, AwardPersion awardPersion) {
return super.exportXls(request, awardPersion, AwardPersion.class, "获奖管理");
}
/**
* 奖项推荐导出excel
*
* @param request
* @param awardPersion
*/
//@RequiresPermissions("awardpersion:award_persion:exportXls")
@RequestMapping(value = "/exportXlstj")
public ModelAndView exportXlstj(HttpServletRequest request, AwardPersion awardPersion) {
// Step.1 组装查询条件
QueryWrapper<AwardPersion> queryWrapper = QueryGenerator.initQueryWrapper(awardPersion, request.getParameterMap());
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
// 过滤选中数据
queryWrapper.eq("tj","1");
// Step.2 获取导出数据
List<AwardPersion> exportList = awardPersionService.list(queryWrapper);
// Step.3 AutoPoi 导出Excel
ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
//此处设置的filename无效 ,前端会重更新设置一下
mv.addObject(NormalExcelConstants.FILE_NAME, "获奖推荐");
mv.addObject(NormalExcelConstants.CLASS, AwardPersion.class);
//update-begin--Author:liusq Date:20210126 for:图片导出报错,ImageBasePath未设置--------------------
ExportParams exportParams=new ExportParams("获奖推荐" + "报表", "导出人:" + sysUser.getRealname(), "获奖推荐");
exportParams.setImageBasePath(jeecgBaseConfig.getPath().getUpload());
//update-end--Author:liusq Date:20210126 for:图片导出报错,ImageBasePath未设置----------------------
mv.addObject(NormalExcelConstants.PARAMS,exportParams);
mv.addObject(NormalExcelConstants.DATA_LIST, exportList);
return mv;
}
/**
* 导出excel模板
*
@ -613,4 +645,36 @@ public class AwardPersionController extends JeecgController<AwardPersion, IAward
return Result.OK("成功!");
}
/**
* 推荐
*
* @param
* @return
*/
@AutoLog(value = "推荐")
@ApiOperation(value="推荐", notes="推荐")
@GetMapping(value = "/tj")
public Result<String> tj(@RequestParam(name="id",required=true) String id) {
AwardPersion awardPersion = awardPersionService.getById(id);
awardPersion.setTj("1");
awardPersionService.updateById(awardPersion);
return Result.OK("成功!");
}
/**
* 撤销
*
* @param
* @return
*/
@AutoLog(value = "撤销")
@ApiOperation(value="撤销", notes="撤销")
@GetMapping(value = "/cx")
public Result<String> cx(@RequestParam(name="id",required=true) String id) {
AwardPersion awardPersion = awardPersionService.getById(id);
awardPersion.setTj("0");
awardPersionService.updateById(awardPersion);
return Result.OK("成功!");
}
}

@ -77,16 +77,16 @@ public class AwardPersion implements Serializable {
@ApiModelProperty(value = "奖项名称")
private java.lang.String awardname;
/**状态*/
@Excel(name = "状态", width = 15, dicCode = "sh_status")
/*@Excel(name = "状态", width = 15, dicCode = "sh_status")*/
@Dict(dicCode = "sh_status")
@ApiModelProperty(value = "状态")
private java.lang.Integer status;
/**奖项顺序*/
@Excel(name = "奖项顺序", width = 15)
/*@Excel(name = "奖项顺序", width = 15)*/
@ApiModelProperty(value = "奖项顺序")
private java.lang.Integer awardsort;
/**奖项*/
@Excel(name = "奖项", width = 15)
/*@Excel(name = "奖项", width = 15)*/
@ApiModelProperty(value = "奖项")
private java.lang.String awardid;
/**学生姓名*/
@ -117,5 +117,10 @@ public class AwardPersion implements Serializable {
@ApiModelProperty(value = "上传证书")
private String sczs;
/**推荐*/
@Excel(name = "是否推荐", width = 15, dicCode = "yn")
@Dict(dicCode = "yn")
@ApiModelProperty(value = "推荐")
private String tj;
}

@ -1,6 +1,8 @@
package org.jeecg.modules.demo.bigScreen.service;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.jeecg.common.util.ComputeUtils;
import org.jeecg.common.util.DateUtils;
import org.jeecg.modules.demo.abilityEvaluation.entity.DepartAbilityEvaluation;
@ -15,11 +17,12 @@ import org.jeecg.modules.demo.annualCompPoint.entity.AnnualCompPoint;
import org.jeecg.modules.demo.annualCompPoint.service.IAnnualCompPointService;
import org.jeecg.modules.demo.annualScore.entity.PersonalCompScore;
import org.jeecg.modules.demo.annualScore.entity.PersonalCompTotalScore;
import org.jeecg.modules.demo.annualScore.service.IDepartCompTotalScoreService;
import org.jeecg.modules.demo.annualScore.service.IPersonalCompScoreService;
import org.jeecg.modules.demo.annualScore.service.IPersonalCompTotalScoreService;
import org.jeecg.modules.demo.annualcomp.entity.AnnualComp;
import org.jeecg.modules.demo.annualcomp.service.IAnnualCompService;
import org.jeecg.modules.demo.annualcompaward.entity.AnnualCompAward;
import org.jeecg.modules.demo.annualcompaward.service.IAnnualCompAwardService;
import org.jeecg.modules.demo.annualcompetitionprojectregistration.entity.AnnualCompetitionProjectRegistration;
import org.jeecg.modules.demo.annualcompetitionprojectregistration.entity.TeamManagement;
import org.jeecg.modules.demo.annualcompetitionprojectregistration.service.IAnnualCompetitionProjectRegistrationService;
@ -30,6 +33,8 @@ import org.jeecg.modules.demo.bigScreen.vo.CompVo;
import org.jeecg.modules.demo.bigScreen.vo.Last5YearDataVo;
import org.jeecg.modules.demo.comp.entity.Comp;
import org.jeecg.modules.demo.comp.service.ICompService;
import org.jeecg.modules.demo.comptype.entity.CompType;
import org.jeecg.modules.demo.comptype.service.ICompTypeService;
import org.jeecg.modules.system.entity.SysDepart;
import org.jeecg.modules.system.entity.SysUser;
import org.jeecg.modules.system.service.ISysDepartService;
@ -54,6 +59,7 @@ import java.util.stream.Collectors;
* @Version: 1.0
*/
@Service
@Slf4j
public class CompSystemBigScreenServiceImpl implements CompSystemBigScreenService {
@Autowired
@ -65,11 +71,14 @@ public class CompSystemBigScreenServiceImpl implements CompSystemBigScreenServic
@Autowired
private ICompService iCompService;
@Autowired
private ICompTypeService iCompTypeService;
@Autowired
private ISysDepartService iSysDepartService;
@Autowired
private IDepartCompTotalScoreService iDepartCompTotalScoreService;
private IAnnualCompAwardService iAnnualCompAwardService;
@Autowired
private IAnnualCompetitionProjectRegistrationService iAnnualCompetitionProjectRegistrationService;
@ -104,6 +113,10 @@ public class CompSystemBigScreenServiceImpl implements CompSystemBigScreenServic
//二级部门id
private final String BASE_PARENT_ID = "1693446350597038081";
private static final Integer ONE_HUNDRED = 100;
private static final Double ZERO_POINT_FIVE = 0.5;
private static final Double ZERO_POINT_TWO = 0.2;
@Override
public List<Map<String, Object>> canSai() {
@ -231,35 +244,112 @@ public class CompSystemBigScreenServiceImpl implements CompSystemBigScreenServic
List<SysDepart> departList = iSysDepartService.list(new LambdaQueryWrapper<SysDepart>().eq(SysDepart::getParentId, BASE_PARENT_ID));
Optional.ofNullable(departList).orElse(new LinkedList<>()).stream().forEach(depart -> {
Map<String, Object> resultMap = new LinkedHashMap<>();
List<Comp> compList = iCompService.list(new LambdaQueryWrapper<Comp>().eq(Comp::getCompOrgan, depart.getParentId()));
List<Comp> compList = iCompService.list(new LambdaQueryWrapper<Comp>().eq(Comp::getCompOrgan, depart.getId()));
//比赛类型
Map<String, List<Comp>> compTypeListMap = Optional.ofNullable(compList).orElse(new LinkedList<>()).stream()
.collect(Collectors.groupingBy(Comp::getCompTypeId));
//TODO
//遍历分组后的结果
// DecimalFormat decimalFormat = new DecimalFormat();
// decimalFormat.setMaximumFractionDigits(2); // 保留两位小数
// decimalFormat.setRoundingMode(RoundingMode.HALF_UP); // 设置具体的进位机制
// List<CompVo> vos = new ArrayList<>();
// Optional.ofNullable(compTypeListMap).orElse(new LinkedHashMap<>()).forEach((key, value) -> {
//
// double ratio = ComputeUtils.div2(value.size(), registrationList.size());
// CompVo vo = new CompVo();
// vo.setCompOrganId(depart.getId());
// vo.setCompOrganName(depart.getDepartName());
// vo.setNumber(registrationList.size());
// vo.setAwardName(key);
// vo.setAwardNumber(value.size());
// vo.setAwardRatio(ratio + "");
// vos.add(vo);
// });
resultMap.put(depart.getDepartName(), null);
List<Map<String, Object>> vos = new ArrayList<>();
Optional.ofNullable(compTypeListMap).orElse(new LinkedHashMap<>()).forEach((key, comps) -> {
AtomicReference<BigDecimal> score4CompType = new AtomicReference<>(new BigDecimal(0));
CompType compType = iCompTypeService.getById(key.toString());
Optional.ofNullable(comps).orElse(new ArrayList<>()).stream().forEach(comp -> {
List<AnnualComp> annualComps = iAnnualCompService.list(new LambdaQueryWrapper<AnnualComp>().eq(AnnualComp::getCompid, comp.getId()));
Set<String> annualCompIds = Optional.ofNullable(annualComps).orElse(new ArrayList<>()).stream().map(bo -> bo.getAnnualid()).collect(Collectors.toSet());
if (!ObjectUtils.isEmpty(annualCompIds)) {
List<AnnualCompPoint> annualCompPointList = iAnnualCompPointService.list(new LambdaQueryWrapper<AnnualCompPoint>().in(AnnualCompPoint::getAnnualCompId, annualCompIds));
Optional.ofNullable(annualCompPointList).orElse(new ArrayList<>()).stream().forEach(annualCompPoint -> {
BigDecimal score = convertScore(annualCompPoint, comp);
score4CompType.getAndUpdate(val -> val.add(new BigDecimal(score.toString())));
});
}
});
Map<String, Object> typeMap = new LinkedHashMap<>();
typeMap.put(compType.getTypeName(), score4CompType.get());
vos.add(typeMap);
});
resultMap.put(depart.getDepartName(), vos);
resultList.add(resultMap);
});
return resultList;
}
BigDecimal convertScore(AnnualCompPoint annualCompPoint, Comp comp) {
AtomicReference<BigDecimal> score4Point = new AtomicReference<>(new BigDecimal(0));
if (!ObjectUtils.isEmpty(annualCompPoint) && !ObjectUtils.isEmpty(comp)) {
//年度比赛项目 奖项设置
AnnualCompAward annualCompAward = iAnnualCompAwardService.getOne(new LambdaQueryWrapper<AnnualCompAward>()
.eq(AnnualCompAward::getAnnucompid, annualCompPoint.getId()));
if (ObjectUtils.isEmpty(annualCompAward)) return score4Point.get();
//1、根据年度比赛项目id,查询获取管理(award_persion)列表,即参赛人员及获取奖项顺序号
List<AwardPersion> awardPersionList = iAwardPersionService.list(new LambdaQueryWrapper<AwardPersion>()
.eq(AwardPersion::getAnnualCompP, annualCompPoint.getId()));
//项目分值
double compweight_val = comp.getCompweight().doubleValue();
//2、遍历获奖管理(award_persion)列表,根据奖项id查询比赛奖项设置表(annual_comp_award)
Optional.ofNullable(awardPersionList).orElse(new LinkedList<>()).forEach(en -> {
//2.1、比赛奖项设置 根据awardsort奖项顺序,获取对应的奖项权重值
//奖项顺序与奖项权重值映射关系: wardsort(1:first_weight,2:second_weight,3:third_weight,4:fourth_weight,5:fifth_weight)
//奖项权重值 百分比
String weightVal;
switch (en.getAwardsort()) {
case 1:
weightVal = annualCompAward.getFirstWeight();
break;
case 2:
weightVal = annualCompAward.getSecondWeight();
break;
case 3:
weightVal = annualCompAward.getThirdWeight();
break;
case 4:
weightVal = annualCompAward.getFourthWeight();
break;
case 5:
weightVal = annualCompAward.getFifthWeight();
break;
default:
weightVal = "100";
}
//参与形式 个人、团队,键值对 N-个人 Y-团队
String entryForm = annualCompPoint.getEntryForm();
//2.2 根据报名编号查询参赛者信息
List<TeamManagement> managementList = iTeamManagementService.list(new LambdaQueryWrapper<TeamManagement>()
.eq(TeamManagement::getEnrollCode, en.getEnrollCode())
);
if (ObjectUtils.isEmpty(managementList)) return;
//3、计算积分 项目分值*项目奖项权重值/100
log.info("***************年度比赛项目-{},项目分值:{},奖项权重值:{}", annualCompPoint.getObjName(), compweight_val, weightVal);
double baseScore = ComputeUtils.mul(compweight_val, ComputeUtils.div2(new Double(weightVal), ONE_HUNDRED));
AtomicReference<Double> score = new AtomicReference<>((double) 0);
if (StringUtils.equals("Y", entryForm)) { //团队赛
Optional.ofNullable(managementList).orElse(new ArrayList<>()).forEach(e -> {
// 参与形式是团队时,队长积分*0.5,职员积分*0.2
//captain 是否队长
if (StringUtils.equals("0", e.getCaptain())) {
// score.set(ComputeUtils.mul(baseScore, ZERO_POINT_FIVE));
score4Point.getAndUpdate(val -> val.add(new BigDecimal(ComputeUtils.mul(baseScore, ZERO_POINT_FIVE))));
} else {
// score.set(ComputeUtils.mul(baseScore, ZERO_POINT_TWO));
score4Point.getAndUpdate(val -> val.add(new BigDecimal(ComputeUtils.mul(baseScore, ZERO_POINT_TWO))));
}
});
} else { //个人赛
// score.set(baseScore);
score4Point.getAndUpdate(val -> val.add(new BigDecimal(baseScore)));
}
});
}
return score4Point.get();
}
/**
* @description: 单项比赛数据展示
* 使用大数据页面的形式全面展示某项比赛的各种综合数据包括年度比赛列表比赛项目数参赛人数统计多维度能力评价分析数据近五年比赛人数对比比赛获奖列表参赛人员积分列表需要提供功能截图
@ -459,7 +549,7 @@ public class CompSystemBigScreenServiceImpl implements CompSystemBigScreenServic
// compCounts.put("pointCount", pointCount);
//总报名数
long count = Optional.ofNullable(compVoList).orElse(new LinkedList<>()).stream().mapToInt(vo -> vo.getNumber()).sum();
//总报名数
//总报名
compCounts.put("count", count);
Long personCount = iAnnualCompetitionProjectRegistrationService.count(new LambdaQueryWrapper<AnnualCompetitionProjectRegistration>()
.eq(AnnualCompetitionProjectRegistration::getEntryFormat, "0")
@ -467,8 +557,12 @@ public class CompSystemBigScreenServiceImpl implements CompSystemBigScreenServic
//学生人数
compCounts.put("personCompCount", personCount);
Long teamCount = count - personCount;
//队伍数
compCounts.put("teamCompCount", teamCount);
if (count < personCount) {
compCounts.put("teamCompCount", 0);//队伍数
} else {
//队伍数
compCounts.put("teamCompCount", teamCount);
}
//比赛统计
resultMap.put("compCounts", compCounts);

@ -8,7 +8,7 @@ import { useMessage } from '/@/hooks/web/useMessage';
import { useMethods } from '/@/hooks/system/useMethods';
import { useDesign } from '/@/hooks/web/useDesign';
import { filterObj } from '/@/utils/common/compUtils';
const { handleExportXls, handleImportXls,handleExportXlsMb } = useMethods();
const { handleExportXls, handleImportXls,handleExportXlsMb,handleExportXlstj } = useMethods();
// 定义 useListPage 方法所需参数
interface ListPageOptions {
@ -33,6 +33,13 @@ interface ListPageOptions {
//导出参数
params?: object;
};
exportConfigtj?: {
url: string | (() => string);
// 导出文件名
name?: string | (() => string);
//导出参数
params?: object;
};
// 导入配置
importConfig?: {
//update-begin-author:taoyan date:20220507 for: erp代码生成 子表 导入地址是动态的
@ -158,6 +165,51 @@ export function useListPage(options: ListPageOptions) {
}
}
// 导出奖项推荐数据 excel
async function onExportXlstj() {
//update-begin---author:wangshuai ---date:20220411 for:导出新增自定义参数------------
let { url, name, params } = options?.exportConfigtj ?? {};
let realUrl = typeof url === 'function' ? url() : url;
if (realUrl) {
let title = typeof name === 'function' ? name() : name;
//update-begin-author:taoyan date:20220507 for: erp代码生成 子表 导出报错,原因未知-
let paramsForm:any = {};
try {
paramsForm = await getForm().validate();
} catch (e) {
console.error(e);
}
//update-end-author:taoyan date:20220507 for: erp代码生成 子表 导出报错,原因未知-
//update-begin-author:liusq date:20230410 for:[/issues/409]导出功能没有按排序结果导出,设置导出默认排序,创建时间倒序
if(!paramsForm?.column){
Object.assign(paramsForm,{column:'createTime',order:'desc'});
}
//update-begin-author:liusq date:20230410 for: [/issues/409]导出功能没有按排序结果导出,设置导出默认排序,创建时间倒序
//如果参数不为空,则整合到一起
//update-begin-author:taoyan date:20220507 for: erp代码生成 子表 导出动态设置mainId
if (params) {
Object.keys(params).map((k) => {
let temp = (params as object)[k];
if (temp) {
paramsForm[k] = unref(temp);
}
});
}
//update-end-author:taoyan date:20220507 for: erp代码生成 子表 导出动态设置mainId
if (selectedRowKeys.value && selectedRowKeys.value.length > 0) {
paramsForm['selections'] = selectedRowKeys.value.join(',');
}
console.log()
return handleExportXlstj(title as string, realUrl, filterObj(paramsForm));
//update-end---author:wangshuai ---date:20220411 for:导出新增自定义参数--------------
} else {
$message.createMessage.warn('没有传递 exportConfig.url 参数');
return Promise.reject();
}
}
// 导入 excel
function onImportXls(file) {
let { url, success } = options?.importConfig ?? {};
@ -220,6 +272,7 @@ export function useListPage(options: ListPageOptions) {
...$message,
onExportXls,
onExportXlsMb,
onExportXlstj,
onImportXls,
doRequest,
doDeleteRecord,

@ -49,6 +49,41 @@ export function useMethods() {
window.URL.revokeObjectURL(url); //释放掉blob对象
}
}
/**
* xls
* @param name
* @param url
*/
async function exportXlstj(name, url, params, isXlsx = false) {
const data = await defHttp.get({ url: url, params: params, responseType: 'blob' }, { isTransformResponse: false });
if (!data) {
createMessage.warning('文件下载失败');
return;
}
if (!name || typeof name != 'string') {
name = '导出文件';
}
let blobOptions = { type: 'application/vnd.ms-excel' };
let fileSuffix = '.xls';
if (isXlsx === true) {
blobOptions['type'] = XLSX_MIME_TYPE;
fileSuffix = XLSX_FILE_SUFFIX;
}
if (typeof window.navigator.msSaveBlob !== 'undefined') {
window.navigator.msSaveBlob(new Blob([data], blobOptions), name + fileSuffix);
} else {
let url = window.URL.createObjectURL(new Blob([data], blobOptions));
let link = document.createElement('a');
link.style.display = 'none';
link.href = url;
link.setAttribute('download', name + fileSuffix);
document.body.appendChild(link);
link.click();
document.body.removeChild(link); //下载完成移除元素
window.URL.revokeObjectURL(url); //释放掉blob对象
}
}
/**
* xls
* @param name
@ -128,5 +163,6 @@ export function useMethods() {
handleImportXls: (data, url, success) => importXls(data, url, success),
handleExportXlsx: (name: string, url: string, params?: object) => exportXls(name, url, params, true),
handleExportXlsMb: (name: string, url: string, params?: object) => exportXlsMb(name, url, params),
handleExportXlstj: (name: string, url: string, params?: object) => exportXlstj(name, url, params),
};
}

@ -17,7 +17,9 @@ enum Api {
queryOptions = '/awardpersion/awardPersion/queryOptions',
personalAbilityEvaluation = '/abilityEvaluation/personalAbilityEvaluation/personalAbilityEvaluation2',
sczs='/awardpersion/awardPersion/sczs',
exportXlstj = '/awardpersion/awardPersion/exportXlstj',
tj = '/awardpersion/awardPersion/tj',
qxtj = '/awardpersion/awardPersion/cx',
}
/**
@ -26,6 +28,7 @@ enum Api {
*/
export const getExportUrl = Api.exportXls;
export const getExportUrlMb = Api.exportXlsMb;
export const getExportUrltj = Api.exportXlstj;
/**
* api
@ -51,6 +54,28 @@ export const deleteOne = (params,handleSuccess) => {
});
}
/**
*
* @param params
* @param handleSuccess
*/
export const tj = (params,handleSuccess) => {
return defHttp.get({url: Api.tj, params}, {joinParamsToUrl: true}).then(() => {
handleSuccess();
});
}
/**
*
* @param params
* @param handleSuccess
*/
export const qxtj = (params,handleSuccess) => {
return defHttp.get({url: Api.qxtj, params}, {joinParamsToUrl: true}).then(() => {
handleSuccess();
});
}
/**
*
* @param params

@ -45,6 +45,11 @@ export const columns: BasicColumn[] = [
dataIndex: 'sczs',
customRender: render.renderImagezs,
},
{
title: '是否推荐',
align: "center",
dataIndex: 'tj_dictText'
},
/* {
title: '状态',
align: "center",

@ -40,6 +40,7 @@
<a-button type="primary" @click="cxhq" preIcon="ant-design:sync-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="onExportXlsMb"> 导出模板</a-button>
<a-button type="primary" preIcon="ant-design:export-outlined" @click="onExportXlstj"> 导出推荐</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>
@ -118,6 +119,9 @@ import {
getImportUrl,
getExportUrl,
getExportUrlMb,
getExportUrltj,
tj,
qxtj,
// personalAbilityEvaluation
} from './AwardPersion.api';
import { downloadFile } from '/@/utils/common/renderUtils';
@ -135,7 +139,7 @@ const registerModal = ref();
const registerModal1 = ref();
const registerModal2 = ref();
//table
const { prefixCls, tableContext, onExportXls, onImportXls, onExportXlsMb } = useListPage({
const { prefixCls, tableContext, onExportXls, onImportXls, onExportXlsMb,onExportXlstj } = useListPage({
tableProps: {
title: '获奖管理',
api: list,
@ -160,6 +164,11 @@ const { prefixCls, tableContext, onExportXls, onImportXls, onExportXlsMb } = use
url: getExportUrlMb,
params: null,
},
exportConfigtj: {
name: "获奖推荐",
url: getExportUrltj,
params: null,
},
importConfig: {
url: getImportUrl,
success: handleSuccess
@ -213,6 +222,18 @@ function handleDetail(record: Recordable) {
async function handleDelete(record) {
await deleteOne({ id: record.id }, handleSuccess);
}
/**
* 推荐事件
*/
async function tjjx(record) {
await tj({ id: record.id }, handleSuccess);
}
/**
* 取消推荐事件
*/
async function qxtjjx(record) {
await qxtj({ id: record.id }, handleSuccess);
}
/**
* 上传证书事件
@ -267,6 +288,23 @@ function getTableAction(record) {
confirm: handleDelete.bind(null, record),
}
});
if (record.tj === "0") {
actions.unshift({
label: '推荐',
popConfirm: {
title: '是否确认推荐',
confirm: tjjx.bind(null, record),
}
});
}else {
actions.unshift({
label: '取消推荐',
popConfirm: {
title: '是否取消推荐',
confirm: qxtjjx.bind(null, record),
}
});
}
return actions;
}

@ -3,12 +3,12 @@
<!--查询区域-->
<div class="jeecg-basic-table-form-container">
<a-form ref="formRef" @keyup.enter.native="searchQuery" :model="queryParam" :label-col="labelCol"
:wrapper-col="wrapperCol">
:wrapper-col="wrapperCol">
<a-row :gutter="24">
<a-col :lg="8">
<a-form-item label="年度" name="annualid">
<j-dict-select-tag placeholder="请选择年度" v-model:value="queryParam.annualid"
dictCode="annual,annual_name,id" />
dictCode="annual,annual_name,id" />
</a-form-item>
</a-col>
<a-col :lg="8">
@ -21,7 +21,7 @@
<a-col :lg="6">
<a-button type="primary" preIcon="ant-design:search-outlined" @click="searchQuery">查询</a-button>
<a-button type="primary" preIcon="ant-design:reload-outlined" @click="searchReset"
style="margin-left: 8px">重置</a-button>
style="margin-left: 8px">重置</a-button>
<a @click="toggleSearchStatus = !toggleSearchStatus" style="margin-left: 8px">
{{ toggleSearchStatus ? '收起' : '展开' }}
<Icon :icon="toggleSearchStatus ? 'ant-design:up-outlined' : 'ant-design:down-outlined'" />
@ -65,7 +65,7 @@
<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>
@click="downloadFile(text)">下载</a-button>
</template>
<!--图标查看---->-->
<template #bodyCell="{ column, record }">
@ -74,9 +74,9 @@
<template #icon>
<div style="width: 20px;height: 20px;position: relative;">
<Icon icon="mainHome-awPictureOutlined|svg" :size="25" v-if="!record.sczs"
style="position: absolute;inset: 0;z-index:8;" />
style="position: absolute;inset: 0;z-index:8;" />
<ImagePreview :imageList="[{ src: getImgView(record.sczs), width: 25 }]"
style="position: absolute;inset: 0px;z-index:9;" />
style="position: absolute;inset: 0px;z-index:9;" />
</div>
</template>
</Avatar>
@ -91,203 +91,203 @@
</template>
<script lang="ts" name="awardpersion-awardPersion" setup>
// ===========================================
import { Avatar } from 'ant-design-vue';
import { ImagePreview } from '/@/components/Preview/index';
import { getFileAccessHttpUrlzs } from '/@/utils/common/compUtils';
function getImgView(text) {
if (text && text.indexOf(',') > 0) {
text = text.substring(0, text.indexOf(','));
// ===========================================
import { Avatar } from 'ant-design-vue';
import { ImagePreview } from '/@/components/Preview/index';
import { getFileAccessHttpUrlzs } from '/@/utils/common/compUtils';
function getImgView(text) {
if (text && text.indexOf(',') > 0) {
text = text.substring(0, text.indexOf(','));
}
return getFileAccessHttpUrlzs(text)
}
return getFileAccessHttpUrlzs(text)
}
// ===========================================^
import { ref, reactive } from 'vue';
import { BasicTable, useTable, TableAction } from '/@/components/Table';
import { useListPage } from '/@/hooks/system/useListPage';
import { columns } from './AwardPersion.data';
import {
list,
deleteOne,
batchDelete,
getImportUrl,
getExportUrl,
getExportUrlMb,
// personalAbilityEvaluation
} from './AwardPersion.api';
import { downloadFile } from '/@/utils/common/renderUtils';
import AwardPersionModal from './components/AwardPersionModal.vue'
import AwardPersionModal1 from './components/AwardPersionModal1.vue'
import AwardPersionModal2 from './components/AwardPersionModal2.vue'
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
import JSearchSelect from '/@/components/Form/src/jeecg/components/JSearchSelect.vue';
import { collectScore } from "/@/views/annualCompPoint/committee/AnnualCompPoint.api";
// ===========================================^
import { ref, reactive } from 'vue';
import { BasicTable, useTable, TableAction } from '/@/components/Table';
import { useListPage } from '/@/hooks/system/useListPage';
import { columns } from './AwardPersion.data';
import {
list,
deleteOne,
batchDelete,
getImportUrl,
getExportUrl,
getExportUrlMb,
// personalAbilityEvaluation
} from './AwardPersion.api';
import { downloadFile } from '/@/utils/common/renderUtils';
import AwardPersionModal from './components/AwardPersionModal.vue'
import AwardPersionModal1 from './components/AwardPersionModal1.vue'
import AwardPersionModal2 from './components/AwardPersionModal2.vue'
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
import JSearchSelect from '/@/components/Form/src/jeecg/components/JSearchSelect.vue';
import { collectScore } from "/@/views/annualCompPoint/committee/AnnualCompPoint.api";
const formRef = ref();
const queryParam = reactive<any>({});
const toggleSearchStatus = ref<boolean>(false);
const registerModal = ref();
const registerModal1 = ref();
const registerModal2 = ref();
//table
const { prefixCls, tableContext, onExportXls, onImportXls, onExportXlsMb } = useListPage({
tableProps: {
title: '获奖管理',
api: list,
columns,
canResize: false,
useSearchForm: false,
actionColumn: {
width: 230,
fixed: 'right',
const formRef = ref();
const queryParam = reactive<any>({});
const toggleSearchStatus = ref<boolean>(false);
const registerModal = ref();
const registerModal1 = ref();
const registerModal2 = ref();
//table
const { prefixCls, tableContext, onExportXls, onImportXls, onExportXlsMb } = useListPage({
tableProps: {
title: '获奖管理',
api: list,
columns,
canResize: false,
useSearchForm: false,
actionColumn: {
width: 230,
fixed: 'right',
},
beforeFetch: (params) => {
return Object.assign(params, queryParam);
},
},
beforeFetch: (params) => {
return Object.assign(params, queryParam);
exportConfig: {
name: "获奖管理",
url: getExportUrl,
params: queryParam,
},
},
exportConfig: {
name: "获奖管理",
url: getExportUrl,
params: queryParam,
},
exportConfigMb: {
name: "获奖管理",
url: getExportUrlMb,
params: null,
},
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();
}
exportConfigMb: {
name: "获奖管理",
url: getExportUrlMb,
params: null,
},
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 cxhq() {
registerModal1.value.disableSubmit = false;
registerModal1.value.add();
}
/**
* 新增事件
*/
function handleAdd() {
registerModal.value.disableSubmit = false;
registerModal.value.add();
}
/**
* 编辑事件
*/
function handleEdit(record: Recordable) {
registerModal.value.disableSubmit = false;
registerModal.value.edit(record);
}
/**
* 重新获取事件
*/
function cxhq() {
registerModal1.value.disableSubmit = false;
registerModal1.value.add();
}
/**
* 详情
*/
function handleDetail(record: Recordable) {
registerModal.value.disableSubmit = true;
registerModal.value.edit(record);
}
/**
* 编辑事件
*/
function handleEdit(record: Recordable) {
registerModal.value.disableSubmit = false;
registerModal.value.edit(record);
}
/**
* 删除事件
*/
async function handleDelete(record) {
await deleteOne({ id: record.id }, handleSuccess);
}
/**
* 详情
*/
function handleDetail(record: Recordable) {
registerModal.value.disableSubmit = true;
registerModal.value.edit(record);
}
/**
* 上传证书事件
*/
async function sczs(record) {
registerModal2.value.disableSubmit = false;
registerModal2.value.add(record);
}
/**
* 删除事件
*/
async function handleDelete(record) {
await deleteOne({ id: record.id }, handleSuccess);
}
/**
* 批量删除事件
*/
async function batchHandleDelete() {
await batchDelete({ ids: selectedRowKeys.value }, handleSuccess);
}
/**
* 上传证书事件
*/
async function sczs(record) {
registerModal2.value.disableSubmit = false;
registerModal2.value.add(record);
}
/**
* 成功回调
*/
function handleSuccess() {
(selectedRowKeys.value = []) && reload();
}
/**
* 批量删除事件
*/
async function batchHandleDelete() {
await batchDelete({ ids: selectedRowKeys.value }, handleSuccess);
}
// /**
// *
// */
// function handlePersonalAbilityEvaluation(record: Recordable) {
// personalAbilityEvaluation({annualCompP: record.annualCompP, enrollCode: record.enrollCode}, handleSuccess);
// }
/**
* 成功回调
*/
function handleSuccess() {
(selectedRowKeys.value = []) && reload();
}
/**
* 操作栏
*/
function getTableAction(record) {
const actions = [];
actions.unshift({
label: '上传证书',
onClick: sczs.bind(null, record),
});
actions.unshift({
label: '详情',
onClick: handleDetail.bind(null, record),
});
return actions;
}
// /**
// *
// */
// function handlePersonalAbilityEvaluation(record: Recordable) {
// personalAbilityEvaluation({annualCompP: record.annualCompP, enrollCode: record.enrollCode}, handleSuccess);
// }
/**
* 下拉操作栏
*/
function getDropDownAction(record) {
return [
{
/**
* 操作栏
*/
function getTableAction(record) {
const actions = [];
actions.unshift({
label: '上传证书',
onClick: sczs.bind(null, record),
});
actions.unshift({
label: '详情',
onClick: handleDetail.bind(null, record),
}, {
label: '删除',
popConfirm: {
title: '是否确认删除',
confirm: handleDelete.bind(null, record),
}
},
]
}
});
return actions;
}
/**
* 查询
*/
function searchQuery() {
reload();
}
/**
* 下拉操作栏
*/
function getDropDownAction(record) {
return [
{
label: '详情',
onClick: handleDetail.bind(null, record),
}, {
label: '删除',
popConfirm: {
title: '是否确认删除',
confirm: handleDelete.bind(null, record),
}
},
]
}
/**
* 查询
*/
function searchQuery() {
reload();
}
/**
* 重置
*/
function searchReset() {
formRef.value.resetFields();
selectedRowKeys.value = [];
//
reload();
}
/**
* 重置
*/
function searchReset() {
formRef.value.resetFields();
selectedRowKeys.value = [];
//
reload();
}
@ -295,22 +295,22 @@ function searchReset() {
</script>
<style lang="less" scoped>
.jeecg-basic-table-form-container {
.table-page-search-submitButtons {
display: block;
margin-bottom: 24px;
white-space: nowrap;
}
.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-cust {
width: calc(50% - 15px);
min-width: 100px !important;
}
.query-group-split-cust {
width: 30px;
display: inline-block;
text-align: center
.query-group-split-cust {
width: 30px;
display: inline-block;
text-align: center
}
}
}
</style>

Loading…
Cancel
Save