1、个人年度积分功能开发

dev
zhc077 1 year ago
parent f252237312
commit a3b7102024
  1. 173
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualScore/controller/PersonalCompScoreController.java
  2. 115
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualScore/entity/PersonalCompScore.java
  3. 17
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualScore/mapper/PersonalCompScoreMapper.java
  4. 5
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualScore/mapper/xml/PersonalCompScoreMapper.xml
  5. 15
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualScore/service/IPersonalCompScoreService.java
  6. 23
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/annualScore/service/impl/PersonalCompScoreServiceImpl.java
  7. 2
      jeecg-boot-master/jeecg-module-system/jeecg-system-start/src/main/resources/application-dev.yml
  8. 299
      jeecg-boot-master/jeecg-module-system/jeecg-system-start/src/main/resources/application-local.yml
  9. 4
      jeecgboot-vue3-master/.env.development
  10. 64
      jeecgboot-vue3-master/src/views/annualScore/PersonalCompScore.api.ts
  11. 145
      jeecgboot-vue3-master/src/views/annualScore/PersonalCompScore.data.ts
  12. 191
      jeecgboot-vue3-master/src/views/annualScore/PersonalCompScoreList.vue
  13. 70
      jeecgboot-vue3-master/src/views/annualScore/components/PersonalCompScoreForm.vue
  14. 66
      jeecgboot-vue3-master/src/views/annualScore/components/PersonalCompScoreModal.vue

@ -0,0 +1,173 @@
package org.jeecg.modules.demo.annualScore.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.base.controller.JeecgController;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.modules.demo.annualScore.entity.PersonalCompScore;
import org.jeecg.modules.demo.annualScore.service.IPersonalCompScoreService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Arrays;
/**
* @Description: 个人比赛积分
* @Author: jeecg-boot
* @Date: 2023-10-30
* @Version: V1.0
*/
@Api(tags = "个人比赛积分")
@RestController
@RequestMapping("/annualScore/personalCompScore")
@Slf4j
public class PersonalCompScoreController extends JeecgController<PersonalCompScore, IPersonalCompScoreService> {
@Autowired
private IPersonalCompScoreService personalCompScoreService;
/**
* @description: 统计汇总-个人比赛积分
* @param: [personalCompScore]
* @return: org.jeecg.common.api.vo.Result<java.lang.String>
* @author: z.h.c
* @date: 23/10/30 17:26
*/
@ApiOperation(value = "个人比赛积分-统计汇总", notes = "个人比赛积分-统计汇总")
@PostMapping(value = "/collectScore")
public Result<String> collectScore4Person(@RequestBody PersonalCompScore personalCompScore) {
personalCompScoreService.collectScore(personalCompScore);
return Result.OK("操作成功!");
}
/**
* 分页列表查询
*
* @param personalCompScore
* @param pageNo
* @param pageSize
* @param req
* @return
*/
//@AutoLog(value = "个人比赛积分-分页列表查询")
@ApiOperation(value = "个人比赛积分-分页列表查询", notes = "个人比赛积分-分页列表查询")
@GetMapping(value = "/list")
public Result<IPage<PersonalCompScore>> queryPageList(PersonalCompScore personalCompScore,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<PersonalCompScore> queryWrapper = QueryGenerator.initQueryWrapper(personalCompScore, req.getParameterMap());
Page<PersonalCompScore> page = new Page<PersonalCompScore>(pageNo, pageSize);
IPage<PersonalCompScore> pageList = personalCompScoreService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 添加
*
* @param personalCompScore
* @return
*/
@ApiOperation(value = "个人比赛积分-添加", notes = "个人比赛积分-添加")
// @RequiresPermissions("annualScore:personal_comp_score:add")
@PostMapping(value = "/add")
public Result<String> add(@RequestBody PersonalCompScore personalCompScore) {
personalCompScoreService.save(personalCompScore);
return Result.OK("添加成功!");
}
/**
* 编辑
*
* @param personalCompScore
* @return
*/
@ApiOperation(value = "个人比赛积分-编辑", notes = "个人比赛积分-编辑")
// @RequiresPermissions("annualScore:personal_comp_score:edit")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
public Result<String> edit(@RequestBody PersonalCompScore personalCompScore) {
personalCompScoreService.updateById(personalCompScore);
return Result.OK("编辑成功!");
}
/**
* 通过id删除
*
* @param id
* @return
*/
@ApiOperation(value = "个人比赛积分-通过id删除", notes = "个人比赛积分-通过id删除")
// @RequiresPermissions("annualScore:personal_comp_score:delete")
@DeleteMapping(value = "/delete")
public Result<String> delete(@RequestParam(name = "id", required = true) String id) {
personalCompScoreService.removeById(id);
return Result.OK("删除成功!");
}
/**
* 批量删除
*
* @param ids
* @return
*/
@ApiOperation(value = "个人比赛积分-批量删除", notes = "个人比赛积分-批量删除")
// @RequiresPermissions("annualScore:personal_comp_score:deleteBatch")
@DeleteMapping(value = "/deleteBatch")
public Result<String> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
this.personalCompScoreService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
}
/**
* 通过id查询
*
* @param id
* @return
*/
//@AutoLog(value = "个人比赛积分-通过id查询")
@ApiOperation(value = "个人比赛积分-通过id查询", notes = "个人比赛积分-通过id查询")
@GetMapping(value = "/queryById")
public Result<PersonalCompScore> queryById(@RequestParam(name = "id", required = true) String id) {
PersonalCompScore personalCompScore = personalCompScoreService.getById(id);
if (personalCompScore == null) {
return Result.error("未找到对应数据");
}
return Result.OK(personalCompScore);
}
/**
* 导出excel
*
* @param request
* @param personalCompScore
*/
// @RequiresPermissions("annualScore:personal_comp_score:exportXls")
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, PersonalCompScore personalCompScore) {
return super.exportXls(request, personalCompScore, PersonalCompScore.class, "个人比赛积分");
}
/**
* 通过excel导入数据
*
* @param request
* @param response
* @return
*/
@RequiresPermissions("annualScore:personal_comp_score:importExcel")
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
return super.importExcel(request, response, PersonalCompScore.class);
}
}

@ -0,0 +1,115 @@
package org.jeecg.modules.demo.annualScore.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.jeecg.common.aspect.annotation.Dict;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.util.Date;
/**
* @Description: 个人比赛积分
* @Author: jeecg-boot
* @Date: 2023-10-30
* @Version: V1.0
*/
@Data
@TableName("personal_comp_score")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "personal_comp_score对象", description = "个人比赛积分")
public class PersonalCompScore implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
@TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value = "主键")
private String id;
/**
* 创建人
*/
@ApiModelProperty(value = "创建人")
private String createBy;
/**
* 创建日期
*/
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "创建日期")
private Date createTime;
/**
* 更新人
*/
@ApiModelProperty(value = "更新人")
private String updateBy;
/**
* 更新日期
*/
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "更新日期")
private Date updateTime;
/**
* 所属院系
*/
@Excel(name = "所属院系", width = 15)
@ApiModelProperty(value = "所属院系")
@Dict(dictTable = "sys_depart",dicCode = "id",dicText = "depart_name")
private String depet;
/**
* 学号
*/
@Excel(name = "学号", width = 15)
@ApiModelProperty(value = "学号")
private String workOn;
/**
* 姓名
*/
@Excel(name = "姓名", width = 15)
@ApiModelProperty(value = "姓名")
private String name;
/**
* 年度
*/
@Excel(name = "年度", width = 15)
@ApiModelProperty(value = "年度")
@Dict(dictTable = "annual",dicCode = "id",dicText = "annual_name")
private String annualId;
/**
* 年度比赛
*/
@Excel(name = "年度比赛", width = 15)
@ApiModelProperty(value = "年度比赛")
@Dict(dictTable = "annual_comp",dicCode = "id",dicText = "name")
private String annualCompId;
/**
* 年度比赛项目
*/
@Excel(name = "年度比赛项目", width = 15)
@Dict(dictTable = "annual_comp_point",dicCode = "id",dicText = "obj_name")
@ApiModelProperty(value = "年度比赛项目")
private String annualCompP;
/**
* 个人积分
*/
@Excel(name = "个人积分", width = 15)
@ApiModelProperty(value = "个人积分")
private Double score;
/**
* 备注
*/
@Excel(name = "备注", width = 15)
@ApiModelProperty(value = "备注")
private String remark;
}

@ -0,0 +1,17 @@
package org.jeecg.modules.demo.annualScore.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.jeecg.modules.demo.annualScore.entity.PersonalCompScore;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @Description: 个人比赛积分
* @Author: jeecg-boot
* @Date: 2023-10-30
* @Version: V1.0
*/
public interface PersonalCompScoreMapper extends BaseMapper<PersonalCompScore> {
}

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.jeecg.modules.demo.annualScore.mapper.PersonalCompScoreMapper">
</mapper>

@ -0,0 +1,15 @@
package org.jeecg.modules.demo.annualScore.service;
import org.jeecg.modules.demo.annualScore.entity.PersonalCompScore;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* @Description: 个人比赛积分
* @Author: jeecg-boot
* @Date: 2023-10-30
* @Version: V1.0
*/
public interface IPersonalCompScoreService extends IService<PersonalCompScore> {
void collectScore(PersonalCompScore personalCompScore);
}

@ -0,0 +1,23 @@
package org.jeecg.modules.demo.annualScore.service.impl;
import org.jeecg.modules.demo.annualScore.entity.PersonalCompScore;
import org.jeecg.modules.demo.annualScore.mapper.PersonalCompScoreMapper;
import org.jeecg.modules.demo.annualScore.service.IPersonalCompScoreService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
* @Description: 个人比赛积分
* @Author: jeecg-boot
* @Date: 2023-10-30
* @Version: V1.0
*/
@Service
public class PersonalCompScoreServiceImpl extends ServiceImpl<PersonalCompScoreMapper, PersonalCompScore> implements IPersonalCompScoreService {
@Override
public void collectScore(PersonalCompScore personalCompScore) {
}
}

@ -1,5 +1,5 @@
server:
port: 8080
port: 18082
tomcat:
max-swallow-size: -1
error:

@ -0,0 +1,299 @@
server:
port: 18082
tomcat:
max-swallow-size: -1
error:
include-exception: true
include-stacktrace: ALWAYS
include-message: ALWAYS
servlet:
context-path: /jeecg-boot
compression:
enabled: true
min-response-size: 1024
mime-types: application/javascript,application/json,application/xml,text/html,text/xml,text/plain,text/css,image/*
management:
endpoints:
web:
exposure:
include: metrics,httptrace
spring:
servlet:
multipart:
max-file-size: 10MB
max-request-size: 10MB
mail:
host: smtp.163.com
username: jeecgos@163.com
password: ??
properties:
mail:
smtp:
auth: true
starttls:
enable: true
required: true
## quartz定时任务,采用数据库方式
quartz:
job-store-type: jdbc
initialize-schema: embedded
#定时任务启动开关,true-开 false-关
auto-startup: true
#延迟1秒启动定时任务
startup-delay: 1s
#启动时更新己存在的Job
overwrite-existing-jobs: true
properties:
org:
quartz:
scheduler:
instanceName: MyScheduler
instanceId: AUTO
jobStore:
class: org.springframework.scheduling.quartz.LocalDataSourceJobStore
driverDelegateClass: org.quartz.impl.jdbcjobstore.StdJDBCDelegate
tablePrefix: QRTZ_
isClustered: true
misfireThreshold: 12000
clusterCheckinInterval: 15000
threadPool:
class: org.quartz.simpl.SimpleThreadPool
threadCount: 10
threadPriority: 5
threadsInheritContextClassLoaderOfInitializingThread: true
#json 时间戳统一转换
jackson:
date-format: yyyy-MM-dd HH:mm:ss
time-zone: GMT+8
jpa:
open-in-view: false
aop:
proxy-target-class: true
#配置freemarker
freemarker:
# 设置模板后缀名
suffix: .ftl
# 设置文档类型
content-type: text/html
# 设置页面编码格式
charset: UTF-8
# 设置页面缓存
cache: false
prefer-file-system-access: false
# 设置ftl文件路径
template-loader-path:
- classpath:/templates
template_update_delay: 0
# 设置静态文件路径,js,css等
mvc:
static-path-pattern: /**
#Spring Boot 2.6+后映射匹配的默认策略已从AntPathMatcher更改为PathPatternParser,需要手动指定为ant-path-matcher
pathmatch:
matching-strategy: ant_path_matcher
resource:
static-locations: classpath:/static/,classpath:/public/
autoconfigure:
exclude: com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure
datasource:
druid:
stat-view-servlet:
enabled: true
loginUsername: admin
loginPassword: 123456
allow:
web-stat-filter:
enabled: true
dynamic:
druid: # 全局druid参数,绝大部分值和默认保持一致。(现已支持的参数如下,不清楚含义不要乱设置)
# 连接池的配置信息
# 初始化大小,最小,最大
initial-size: 5
min-idle: 5
maxActive: 20
# 配置获取连接等待超时的时间
maxWait: 60000
# 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
timeBetweenEvictionRunsMillis: 60000
# 配置一个连接在池中最小生存的时间,单位是毫秒
minEvictableIdleTimeMillis: 300000
validationQuery: SELECT 1
testWhileIdle: true
testOnBorrow: false
testOnReturn: false
# 打开PSCache,并且指定每个连接上PSCache的大小
poolPreparedStatements: true
maxPoolPreparedStatementPerConnectionSize: 20
# 配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙
filters: stat,wall,slf4j
# 通过connectProperties属性来打开mergeSql功能;慢SQL记录
connectionProperties: druid.stat.mergeSql\=true;druid.stat.slowSqlMillis\=5000
datasource:
master:
url: jdbc:mysql://182.92.169.222:3306/comp?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
username: root
password: ycwl2022.
driver-class-name: com.mysql.cj.jdbc.Driver
# 多数据源配置
#multi-datasource1:
#url: jdbc:mysql://localhost:3306/jeecg-boot2?useUnicode=true&characterEncoding=utf8&autoReconnect=true&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
#username: root
#password: root
#driver-class-name: com.mysql.cj.jdbc.Driver
#redis 配置
redis:
database: 2
host: 182.92.169.222
port: 6379
password: 'redis@ycwl2022.'
#mybatis plus 设置
mybatis-plus:
mapper-locations: classpath*:org/jeecg/modules/**/xml/*Mapper.xml
global-config:
# 关闭MP3.0自带的banner
banner: false
db-config:
#主键类型 0:"数据库ID自增",1:"该类型为未设置主键类型", 2:"用户输入ID",3:"全局唯一ID (数字类型唯一ID)", 4:"全局唯一ID UUID",5:"字符串全局唯一ID (idWorker 的字符串表示)";
id-type: ASSIGN_ID
# 默认数据库表下划线命名
table-underline: true
configuration:
# 这个配置会将执行的sql打印出来,在开发或测试的时候可以用
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
# 返回类型为Map,显示null对应的字段
call-setters-on-nulls: true
#jeecg专用配置
minidao:
base-package: org.jeecg.modules.jmreport.*,org.jeecg.modules.drag.*
jeecg:
# 是否启用安全模式
safeMode: false
# 签名密钥串(前后端要一致,正式发布请自行修改)
signatureSecret: dd05f1c54d63749eda95f9fa6d49v442a
# 签名拦截接口
signUrls: /sys/dict/getDictItems/*,/sys/dict/loadDict/*,/sys/dict/loadDictOrderByValue/*,/sys/dict/loadDictItem/*,/sys/dict/loadTreeData,/sys/api/queryTableDictItemsByCode,/sys/api/queryFilterTableDictInfo,/sys/api/queryTableDictByKeys,/sys/api/translateDictFromTable,/sys/api/translateDictFromTableByKeys
#local、minio、alioss
uploadType: local
# 前端访问地址
domainUrl:
pc: http://localhost:3100
app: http://localhost:8051
path:
#文件上传根目录 设置
upload: /opt/upFiles
#webapp文件路径
webapp: /opt/webapp
shiro:
excludeUrls: /test/jeecgDemo/demo3,/test/jeecgDemo/redisDemo/**,/category/**,/visual/**,/map/**,/jmreport/bigscreen2/**
#阿里云oss存储和大鱼短信秘钥配置
oss:
accessKey: ??
secretKey: ??
endpoint: oss-cn-beijing.aliyuncs.com
bucketName: jeecgdev
# ElasticSearch 6设置
elasticsearch:
cluster-name: jeecg-ES
cluster-nodes: 127.0.0.1:9200
check-enabled: false
# 在线预览文件服务器地址配置
file-view-domain: http://fileview.jeecg.com
# minio文件上传
minio:
minio_url: http://minio.jeecg.com
minio_name: ??
minio_pass: ??
bucketName: otatest
#大屏报表参数设置
jmreport:
mode: dev
#数据字典是否进行saas数据隔离,自己看自己的字典
saas: false
#xxl-job配置
xxljob:
enabled: false
adminAddresses: http://127.0.0.1:9080/xxl-job-admin
appname: ${spring.application.name}
accessToken: ''
address: 127.0.0.1:30007
ip: 127.0.0.1
port: 30007
logPath: logs/jeecg/job/jobhandler/
logRetentionDays: 30
#分布式锁配置
redisson:
address: 127.0.0.1:6379
password:
type: STANDALONE
enabled: true
#cas单点登录
cas:
prefixUrl: http://cas.example.org:8443/cas
#Mybatis输出sql日志
logging:
level:
org.jeecg.modules.system.mapper: info
#swagger
knife4j:
#开启增强配置
enable: true
#开启生产环境屏蔽
production: false
basic:
enable: false
username: jeecg
password: jeecg1314
#第三方登录
justauth:
enabled: true
type:
GITHUB:
client-id: ??
client-secret: ??
redirect-uri: http://sso.test.com:8080/jeecg-boot/sys/thirdLogin/github/callback
WECHAT_ENTERPRISE:
client-id: ??
client-secret: ??
redirect-uri: http://sso.test.com:8080/jeecg-boot/sys/thirdLogin/wechat_enterprise/callback
agent-id: ??
DINGTALK:
client-id: ??
client-secret: ??
redirect-uri: http://sso.test.com:8080/jeecg-boot/sys/thirdLogin/dingtalk/callback
WECHAT_OPEN:
client-id: ??
client-secret: ??
redirect-uri: http://sso.test.com:8080/jeecg-boot/sys/thirdLogin/wechat_open/callback
cache:
type: default
prefix: 'demo::'
timeout: 1h
#第三方APP对接
third-app:
enabled: false
type:
#企业微信
WECHAT_ENTERPRISE:
enabled: false
#CORP_ID
client-id: ??
#SECRET
client-secret: ??
#自建应用id
agent-id: ??
#自建应用秘钥(新版企微需要配置)
# agent-app-secret: ??
#钉钉
DINGTALK:
enabled: false
# appKey
client-id: ??
# appSecret
client-secret: ??
agent-id: ??
comp:
work:
# 作品目录,目录分隔符无论操作系统请用"/",路径末尾一定要有"/"
save-path: E:/tmp/

@ -5,7 +5,7 @@ VITE_USE_MOCK = true
VITE_PUBLIC_PATH = /
# 跨域代理,您可以配置多个 ,请注意,没有换行符
VITE_PROXY = [["/jeecgboot","http://localhost:8080/jeecg-boot"],["/upload","http://localhost:3300/upload"]]
VITE_PROXY = [["/jeecgboot","http://localhost:18082/jeecg-boot"],["/upload","http://localhost:3300/upload"]]
# 控制台不输出
VITE_DROP_CONSOLE = false
@ -14,7 +14,7 @@ VITE_DROP_CONSOLE = false
VITE_GLOB_API_URL=/jeecgboot
#后台接口全路径地址(必填)
VITE_GLOB_DOMAIN_URL=http://localhost:8080/jeecg-boot
VITE_GLOB_DOMAIN_URL=http://localhost:18082/jeecg-boot
# 接口前缀
VITE_GLOB_API_URL_PREFIX=

@ -0,0 +1,64 @@
import {defHttp} from '/@/utils/http/axios';
import { useMessage } from "/@/hooks/web/useMessage";
const { createConfirm } = useMessage();
enum Api {
list = '/annualScore/personalCompScore/list',
save='/annualScore/personalCompScore/add',
edit='/annualScore/personalCompScore/edit',
deleteOne = '/annualScore/personalCompScore/delete',
deleteBatch = '/annualScore/personalCompScore/deleteBatch',
importExcel = '/annualScore/personalCompScore/importExcel',
exportXls = '/annualScore/personalCompScore/exportXls',
}
/**
* 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});
/**
*
*/
export const deleteOne = (params,handleSuccess) => {
return defHttp.delete({url: Api.deleteOne, params}, {joinParamsToUrl: true}).then(() => {
handleSuccess();
});
}
/**
*
* @param params
*/
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
*/
export const saveOrUpdate = (params, isUpdate) => {
let url = isUpdate ? Api.edit : Api.save;
return defHttp.post({url: url, params});
}

@ -0,0 +1,145 @@
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: 'depet_dictText'
},
{
title: '学号',
align:"center",
dataIndex: 'workOn'
},
{
title: '姓名',
align:"center",
dataIndex: 'name'
},
{
title: '年度',
align:"center",
dataIndex: 'annualId_dictText'
},
{
title: '年度比赛',
align:"center",
dataIndex: 'annualCompId_dictText'
},
{
title: '年度比赛项目',
align:"center",
dataIndex: 'annualCompP_dictText'
},
{
title: '个人积分',
align: "center",
dataIndex: 'score',
},
// {
// title: '备注',
// align:"center",
// dataIndex: 'remark'
// },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
{
label: "所属院系",
field: 'depet',
component: 'Input',
colProps: {span: 6},
},
{
label: "学号",
field: 'workOn',
component: 'Input',
colProps: {span: 6},
},
{
label: "姓名",
field: 'name',
component: 'Input',
colProps: {span: 6},
},
{
label: "年度",
field: 'annualId',
component: 'Input',
colProps: {span: 6},
},
{
label: "年度比赛",
field: 'annualCompId',
component: 'Input',
colProps: {span: 6},
},
{
label: "年度比赛项目",
field: 'annualCompP',
component: 'Input',
colProps: {span: 6},
},
];
//表单数据
export const formSchema: FormSchema[] = [
{
label: '学号777',
field: 'workOn',
component: 'Input',
readonly:true
},
{
label: '姓名',
field: 'name',
component: 'Input',
},
{
label: '年度',
field: 'annualId',
component: 'Input',
},
{
label: '年度比赛',
field: 'annualCompId',
component: 'Input',
},
{
label: '年度比赛项目',
field: 'annualCompP',
component: 'Input',
componentProps: { readOnly: true },
},
{
label: '个人积分',
field: 'score',
component: 'InputNumber',
isFieldEditable: false,
},
{
label: '备注',
field: 'remark',
component: 'Input',
},
// TODO 主键隐藏字段,目前写死为ID
{
label: '',
field: 'id',
component: 'Input',
show: false
},
];
/**
* formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[]{
// 默认和原始表单保持一致 如果流程中配置了权限数据,这里需要单独处理formSchema
return formSchema;
}

@ -0,0 +1,191 @@
<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-col :lg="8">-->
<!-- <a-form-item label="院系" name="depet">-->
<!-- <j-dict-select-tag placeholder="请选择院系" v-model:value="queryParam.depet" dictCode="sys_dept,dept_name,id"/>-->
<!-- </a-form-item>-->
<!-- </a-col>-->
<a-col :lg="8">
<a-form-item label="年度" name="annal_id">
<j-dict-select-tag placeholder="请选择年度" v-model:value="queryParam.annal_id" dictCode="annual,annual_name,id"/>
</a-form-item>
</a-col>
<a-col :lg="8">
<a-form-item label="名称" name="name">
<a-input placeholder="请输入名称" v-model:value="queryParam.name"></a-input>
</a-form-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<span style="float: left; overflow: hidden" class="table-page-search-submitButtons">
<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>
</a-col>
</span>
</a-col>
</a-row>
</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>
</template>
<!--操作栏-->
<template #action="{ record }">
<!-- <TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)" />-->
<TableAction :actions="getTableAction(record)"/>
</template>
</BasicTable>
<!-- 表单区域 -->
<PersonalCompScoreModal @register="registerModal" @success="handleSuccess"></PersonalCompScoreModal>
</div>
</template>
<script lang="ts" name="annualScore-personalCompScore" setup>
import {ref, computed, unref, reactive} from 'vue';
import {BasicTable, useTable, TableAction} from '/@/components/Table';
import {useModal} from '/@/components/Modal';
import { useListPage } from '/@/hooks/system/useListPage'
import PersonalCompScoreModal from './components/PersonalCompScoreModal.vue'
import {columns, searchFormSchema} from './PersonalCompScore.data';
import {list, deleteOne, batchDelete, getImportUrl,getExportUrl} from './PersonalCompScore.api';
import { downloadFile } from '/@/utils/common/renderUtils';
import {useRouter} from "vue-router";
const checkedKeys = ref<Array<string | number>>([]);
// const router = useRouter();
const formRef = ref();
const queryParam = reactive<any>({});
//model
const [registerModal, {openModal}] = useModal();
//table
const { prefixCls,tableContext,onExportXls,onImportXls } = useListPage({
tableProps:{
title: '个人比赛积分',
api: list,
columns,
canResize:false,
formConfig: {
//labelWidth: 120,
schemas: searchFormSchema,
autoSubmitOnEnter:true,
showAdvancedButton:true,
fieldMapToNumber: [
],
fieldMapToTime: [
],
},
actionColumn: {
width: 120,
fixed:'right'
},
beforeFetch: (params) => {
return Object.assign(params, queryParam);
},
},
exportConfig: {
name:"个人比赛积分",
url: getExportUrl,
},
importConfig: {
url: getImportUrl,
success: handleSuccess
},
})
const [registerTable, {reload},{ rowSelection, selectedRowKeys }] = tableContext
/**
* 新增事件
*/
function handleAdd() {
openModal(true, {
isUpdate: false,
showFooter: true,
});
}
/**
* 编辑事件
*/
function handleEdit(record: Recordable) {
openModal(true, {
record,
isUpdate: true,
showFooter: true,
});
}
/**
* 详情
*/
function handleDetail(record: Recordable) {
openModal(true, {
record,
isUpdate: true,
showFooter: false,
});
}
/**
* 删除事件
*/
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){
return [
// {
// label: '',
// onClick: handleEdit.bind(null, record),
// },
{
label: '详情',
onClick: handleDetail.bind(null, record),
}
]
}
/**
* 下拉操作栏
*/
function getDropDownAction(record){
return [
{
label: '详情',
onClick: handleDetail.bind(null, record),
}, {
label: '删除',
popConfirm: {
title: '是否确认删除',
confirm: handleDelete.bind(null, record),
}
}
]
}
</script>
<style scoped>
</style>

@ -0,0 +1,70 @@
<template>
<div style="min-height: 400px">
<BasicForm @register="registerForm"></BasicForm>
<div style="width: 100%;text-align: center" v-if="!formDisabled">
<a-button @click="submitForm" pre-icon="ant-design:check" type="primary"> </a-button>
</div>
</div>
</template>
<script lang="ts">
import {BasicForm, useForm} from '/@/components/Form/index';
import {computed, defineComponent} from 'vue';
import {defHttp} from '/@/utils/http/axios';
import { propTypes } from '/@/utils/propTypes';
import {getBpmFormSchema} from '../PersonalCompScore.data';
import {saveOrUpdate} from '../PersonalCompScore.api';
export default defineComponent({
name: "PersonalCompScoreForm",
components:{
BasicForm
},
props:{
formData: propTypes.object.def({}),
formBpm: propTypes.bool.def(true),
},
setup(props){
const [registerForm, { setFieldsValue, setProps, getFieldsValue }] = useForm({
labelWidth: 150,
schemas: getBpmFormSchema(props.formData),
showActionButtonGroup: false,
baseColProps: {span: 24}
});
const formDisabled = computed(()=>{
if(props.formData.disabled === false){
return false;
}
return true;
});
let formData = {};
const queryByIdUrl = '/annualScore/personalCompScore/queryById';
async function initFormData(){
let params = {id: props.formData.dataId};
const data = await defHttp.get({url: queryByIdUrl, params});
formData = {...data}
//
await setFieldsValue(formData);
//
await setProps({disabled: formDisabled.value})
}
async function submitForm() {
let data = getFieldsValue();
let params = Object.assign({}, formData, data);
console.log('表单数据', params)
await saveOrUpdate(params, true)
}
initFormData();
return {
registerForm,
formDisabled,
submitForm,
}
}
});
</script>

@ -0,0 +1,66 @@
<template>
<BasicModal v-bind="$attrs" @register="registerModal" destroyOnClose :title="title" :width="800" @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 {formSchema} from '../PersonalCompScore.data';
import {saveOrUpdate} from '../PersonalCompScore.api';
// Emits
const emit = defineEmits(['register','success']);
const isUpdate = ref(true);
//
const [registerForm, {setProps,resetFields, setFieldsValue, validate}] = useForm({
//labelWidth: 150,
schemas: formSchema,
showActionButtonGroup: false,
baseColProps: {span: 24}
});
//
const [registerModal, {setModalProps, closeModal}] = useModalInner(async (data) => {
//
await resetFields();
setModalProps({confirmLoading: false,showCancelBtn:!!data?.showFooter,showOkBtn:!!data?.showFooter});
isUpdate.value = !!data?.isUpdate;
if (unref(isUpdate)) {
//
await setFieldsValue({
...data.record,
});
}
//
setProps({ disabled: !data?.showFooter })
});
//
const title = computed(() => (!unref(isUpdate) ? '新增' : '编辑'));
//
async function handleSubmit(v) {
try {
let values = await validate();
setModalProps({confirmLoading: true});
//
await saveOrUpdate(values, isUpdate.value);
//
closeModal();
//
emit('success');
} finally {
setModalProps({confirmLoading: false});
}
}
</script>
<style lang="less" scoped>
/** 时间和数字输入框样式 */
:deep(.ant-input-number){
width: 100%
}
:deep(.ant-calendar-picker){
width: 100%
}
</style>
Loading…
Cancel
Save