专家模块/专家项目模块

master
王家东 4 weeks ago
parent df77236902
commit 4e7007cc04
  1. 394
      jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/expert/controller/ExpertController.java
  2. 43
      jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/expert/entity/Expert.java
  3. 32
      jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/expert/mapper/ExpertMapper.java
  4. 25
      jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/expert/service/IExpertService.java
  5. 67
      jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/expert/service/impl/ExpertServiceImpl.java
  6. 336
      jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/expproject/controller/ExpprojectController.java
  7. 81
      jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/expproject/entity/Expandpro.java
  8. 76
      jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/expproject/entity/Expproject.java
  9. 39
      jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/expproject/mapper/ExpandproMapper.java
  10. 17
      jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/expproject/mapper/ExpprojectMapper.java
  11. 16
      jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/expproject/mapper/xml/ExpandproMapper.xml
  12. 5
      jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/expproject/mapper/xml/ExpprojectMapper.xml
  13. 26
      jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/expproject/service/IExpandproService.java
  14. 48
      jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/expproject/service/IExpprojectService.java
  15. 37
      jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/expproject/service/impl/ExpandproServiceImpl.java
  16. 77
      jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/expproject/service/impl/ExpprojectServiceImpl.java
  17. 77
      jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/expproject/vo/ExpprojectPage.java
  18. 1
      jeecgboot-vue3/src/locales/lang/zh-CN/sys.ts
  19. 21
      jeecgboot-vue3/src/views/expert/admin/Expert.api.ts
  20. 38
      jeecgboot-vue3/src/views/expert/admin/Expert.data.ts
  21. 46
      jeecgboot-vue3/src/views/expert/admin/ExpertList.vue
  22. 0
      jeecgboot-vue3/src/views/expert/admin/V20240926_1__menu_insert_Expert.sql
  23. 0
      jeecgboot-vue3/src/views/expert/admin/V20240929_1__menu_insert_Expert.sql
  24. 0
      jeecgboot-vue3/src/views/expert/admin/V20240930_1__menu_insert_Expert.sql
  25. 56
      jeecgboot-vue3/src/views/expert/admin/components/ExpertForm.vue
  26. 2
      jeecgboot-vue3/src/views/expert/admin/components/ExpertModal.vue
  27. 87
      jeecgboot-vue3/src/views/expproject/admin/Expproject.api.ts
  28. 105
      jeecgboot-vue3/src/views/expproject/admin/Expproject.data.ts
  29. 277
      jeecgboot-vue3/src/views/expproject/admin/ExpprojectList.vue
  30. 26
      jeecgboot-vue3/src/views/expproject/admin/V20241023_1__menu_insert_Expproject.sql
  31. 227
      jeecgboot-vue3/src/views/expproject/admin/components/ExpprojectForm.vue
  32. 67
      jeecgboot-vue3/src/views/expproject/admin/components/ExpprojectModal.vue
  33. 17
      jeecgboot-vue3/src/views/system/loginmini/MiniLogin.vue
  34. 353
      jeecgboot-vue3/src/views/system/loginmini/MiniRegisterexp.vue
  35. 2
      jeecgboot-vue3/src/views/system/user/user.data.ts

@ -7,10 +7,13 @@ import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.shiro.SecurityUtils;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.constant.CommonConstant;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.common.system.query.QueryRuleEnum;
import org.jeecg.common.system.vo.LoginUser;
import org.jeecg.common.util.PasswordUtil;
import org.jeecg.common.util.oConvertUtils;
import org.jeecg.modules.demo.expert.entity.Expert;
@ -21,7 +24,9 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.modules.system.entity.SysDepart;
import org.jeecg.modules.system.entity.SysUser;
import org.jeecg.modules.system.service.ISysDepartService;
import org.jeecg.modules.system.service.ISysUserService;
import org.jeecgframework.poi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
@ -55,6 +60,8 @@ public class ExpertController extends JeecgController<Expert, IExpertService> {
private IExpertService expertService;
@Autowired
private ISysUserService sysUserService;
@Autowired
private ISysDepartService sysDepartService;
/**
* 分页列表查询
@ -66,26 +73,163 @@ public class ExpertController extends JeecgController<Expert, IExpertService> {
* @return
*/
//@AutoLog(value = "专家管理-分页列表查询")
@ApiOperation(value="专家管理-分页列表查询", notes="专家管理-分页列表查询")
@GetMapping(value = "/list")
public Result<IPage<Expert>> queryPageList(Expert expert,
@ApiOperation(value="专家管理-分页列表查询/管理员角色", notes="专家管理-分页列表查询/管理员角色")
@GetMapping(value = "/listadmin")
public Result<IPage<Expert>> listadmin(Expert expert,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
//用于查看所有信息无论是否审核,无论哪个部门
QueryWrapper<Expert> queryWrapper = QueryGenerator.initQueryWrapper(expert, req.getParameterMap());
Page<Expert> page = new Page<Expert>(pageNo, pageSize);
IPage<Expert> pageList = expertService.page(page, queryWrapper);
return Result.OK(pageList);
pageList.getRecords().forEach(experttemp -> {
//开始用于修改数据
SysUser sysUser = sysUserService.query().eq("username",experttemp.getSeusername()).one();
String depid = expertService.getdeps(sysUser.getId());
SysDepart sysDepart = sysDepartService.getById(depid);
experttemp.setRealname(sysUser.getRealname());
experttemp.setWorkon(sysUser.getWorkNo());
experttemp.setSex(sysUser.getSex());
experttemp.setTopPic(sysUser.getAvatar());
experttemp.setPhone(sysUser.getPhone());
experttemp.setEmails(sysUser.getEmail());
experttemp.setSsdep(sysDepart.getDepartName());
experttemp.setPsd(sysUser.getPassword());
experttemp.setSepsd(sysUser.getPassword());
});
return Result.OK(pageList);
}
/**
* 添加
@ApiOperation(value="专家管理-分页列表查询/县区管理员角色", notes="专家管理-分页列表查询/县区管理员角色")
@GetMapping(value = "/listcounty")
public Result<IPage<Expert>> listcounty(Expert expert,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
//用于检测县区管理员添加的专家是否是本县区以及以下单位
LoginUser user= (LoginUser) SecurityUtils.getSubject().getPrincipal();
//根据当前登录的用户去获取所在县区的部门id
String countdepid = expertService.getcountdepid(user.getId());
//创建一个list将县区的部门id以及下属部门的id保存起来
List<String> depidlist = new ArrayList<>();
depidlist.add(countdepid);
//获取下属部门的id
List<String> subdepidlist = expertService.getsubdepid(countdepid);
depidlist.addAll(subdepidlist);
//查询本县区下面的所有的用户的id
List<String> userdepids = expertService.getuserbydeps(depidlist);
//根据权限去查询专家
List<String> userbyrole=expertService.userbyrole("1843478958968647681");
//开始对比两个List获取相同部分,获取的交叉id就是需要的id
List<String> commonElements = userdepids.stream().filter(userbyrole::contains).collect(Collectors.toList());
//根据查询的userid去获取username
List<SysUser> sysUserList = sysUserService.query().in("id",commonElements).list();
//根据查询的结果获取username的list
List<String> usernames = sysUserList.stream().map(SysUser::getUsername).collect(Collectors.toList());
//用于查看本县区下面的专家信息无论是否审核,无论哪个部门
QueryWrapper<Expert> queryWrapper = QueryGenerator.initQueryWrapper(expert, req.getParameterMap());
queryWrapper.in("seusername",usernames);
Page<Expert> page = new Page<Expert>(pageNo, pageSize);
IPage<Expert> pageList = expertService.page(page, queryWrapper);
pageList.getRecords().forEach(experttemp -> {
//开始用于修改数据
SysUser sysUser = sysUserService.query().eq("username",experttemp.getSeusername()).one();
String depid = expertService.getdeps(sysUser.getId());
SysDepart sysDepart = sysDepartService.getById(depid);
experttemp.setRealname(sysUser.getRealname());
experttemp.setWorkon(sysUser.getWorkNo());
experttemp.setSex(sysUser.getSex());
experttemp.setTopPic(sysUser.getAvatar());
experttemp.setPhone(sysUser.getPhone());
experttemp.setEmails(sysUser.getEmail());
experttemp.setSsdep(sysDepart.getDepartName());
experttemp.setPsd(sysUser.getPassword());
});
return Result.OK(pageList);
}
@ApiOperation(value="专家管理-分页列表查询/公司管理员角色", notes="专家管理-分页列表查询/公司管理员角色")
@GetMapping(value = "/listfirm")
public Result<IPage<Expert>> listfirm(Expert expert,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
LoginUser user= (LoginUser) SecurityUtils.getSubject().getPrincipal();
//根据当前登录的用户去获取所在部门id
String countdepid = expertService.getcountdepid(user.getId());
//根据部门id去查询userid
List<String> idlistss = expertService.idlistss(countdepid);
//根据权限去查询专家
List<String> userbyrole=expertService.userbyrole("1843478958968647681");
//开始对比两个List获取相同部分,获取的交叉id就是需要的id
List<String> commonElements = idlistss.stream().filter(userbyrole::contains).collect(Collectors.toList());
//根据查询的userid去获取username
List<SysUser> sysUserList = sysUserService.query().in("id",commonElements).list();
//根据查询的结果获取username的list
List<String> usernames = sysUserList.stream().map(SysUser::getUsername).collect(Collectors.toList());
//用于查看本公司下面的专家信息无论是否审核,无论哪个部门
QueryWrapper<Expert> queryWrapper = QueryGenerator.initQueryWrapper(expert, req.getParameterMap());
queryWrapper.eq("isdone","Y");
queryWrapper.in("seusername",usernames);
Page<Expert> page = new Page<Expert>(pageNo, pageSize);
IPage<Expert> pageList = expertService.page(page, queryWrapper);
pageList.getRecords().forEach(experttemp -> {
//开始用于修改数据
SysUser sysUser = sysUserService.query().eq("username",experttemp.getSeusername()).one();
String depid = expertService.getdeps(sysUser.getId());
SysDepart sysDepart = sysDepartService.getById(depid);
experttemp.setRealname(sysUser.getRealname());
experttemp.setWorkon(sysUser.getWorkNo());
experttemp.setSex(sysUser.getSex());
experttemp.setTopPic(sysUser.getAvatar());
experttemp.setPhone(sysUser.getPhone());
experttemp.setEmails(sysUser.getEmail());
experttemp.setSsdep(sysDepart.getDepartName());
experttemp.setPsd(sysUser.getPassword());
});
return Result.OK(pageList);
}
@ApiOperation(value="专家管理-分页列表查询/公司管理员角色", notes="专家管理-分页列表查询/公司管理员角色")
@GetMapping(value = "/listself")
public Result<IPage<Expert>> listself(Expert expert,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
LoginUser user121= (LoginUser) SecurityUtils.getSubject().getPrincipal();
//用于查看自己的的专家信息
QueryWrapper<Expert> queryWrapper = QueryGenerator.initQueryWrapper(expert, req.getParameterMap());
queryWrapper.eq("seusername",user121.getUsername());
Page<Expert> page = new Page<Expert>(pageNo, pageSize);
IPage<Expert> pageList = expertService.page(page, queryWrapper);
pageList.getRecords().forEach(experttemp -> {
//开始用于修改数据
SysUser sysUser = sysUserService.query().eq("username",experttemp.getSeusername()).one();
String depid = expertService.getdeps(sysUser.getId());
SysDepart sysDepart = sysDepartService.getById(depid);
experttemp.setRealname(sysUser.getRealname());
experttemp.setWorkon(sysUser.getWorkNo());
experttemp.setSex(sysUser.getSex());
experttemp.setTopPic(sysUser.getAvatar());
experttemp.setPhone(sysUser.getPhone());
experttemp.setEmails(sysUser.getEmail());
experttemp.setSsdep(sysDepart.getDepartName());
experttemp.setPsd(sysUser.getPassword());
});
return Result.OK(pageList);
}
/**
* 市局管理员添加
*
* @param expert
* @return
*/
@AutoLog(value = "专家管理-添加")
@ApiOperation(value="专家管理-添加", notes="专家管理-添加")
@AutoLog(value = "专家管理(市局管理员)-添加")
@ApiOperation(value="专家管理(市局管理员)-添加", notes="专家管理(市局管理员)-添加")
@PostMapping(value = "/add")
public Result<?> add(@RequestBody Expert expert) {
//先判断两个密码是否相同
@ -112,6 +256,9 @@ public class ExpertController extends JeecgController<Expert, IExpertService> {
if (isemils.equals("1")){
Result.OK().error500("当前的电子邮件已经存在");
}
expert.setIsdone("Y");
expert.setAdminopen("2");
expert.setCompopen("2");
//开始添加到用户表
SysUser user = new SysUser();
@ -135,17 +282,121 @@ public class ExpertController extends JeecgController<Expert, IExpertService> {
return Result.OK("添加成功!");
}
/**
/**
* 县区管理员添加
*
* @param expert
* @return
*/
@AutoLog(value = "专家管理(县区管理)-添加")
@ApiOperation(value="专家管理(县区管理)-添加", notes="专家管理(县区管理)-添加")
@PostMapping(value = "/addcounty")
public Result<?> addcounty(@RequestBody Expert expert) {
//先判断两个密码是否相同
if (!expert.getPsd().equals(expert.getSepsd())){
return Result.OK().error500("两次输入的密码不同");
}
//判断是用户名是否存在
String isusername = expertService.isusername(expert.getSeusername());
if(isusername.equals("1")){
Result.OK().error500("当前的用户名已经存在");
}
//判断工号是否存在
String isworkon =expertService.isworkon(expert.getWorkon());
if (isworkon.equals("1")){
Result.OK().error500("当前的工号已经存在");
}
//判断电话号码是否存在
String isphone = expertService.isphone(expert.getPhone());
if (isphone.equals("1")){
Result.OK().error500("当前的电话号码已经存在");
}
//判断电子邮件是否存在
String isemils = expertService.isemils(expert.getEmails());
if (isemils.equals("1")){
Result.OK().error500("当前的电子邮件已经存在");
}
//用于检测县区管理员添加的专家是否是本县区以及以下单位
LoginUser user12= (LoginUser) SecurityUtils.getSubject().getPrincipal();
//根据当前登录的用户去获取所在县区的部门id
String countdepid = expertService.getcountdepid(user12.getId());
//创建一个list将县区的部门id以及下属部门的id保存起来
List<String> depidlist = new ArrayList<>();
depidlist.add(countdepid);
//获取下属部门的id
List<String> subdepidlist = expertService.getsubdepid(countdepid);
depidlist.addAll(subdepidlist);
//开始对比,将传入的id和查询的id对比,如果不存在就报错
boolean contains = containsString(depidlist, expert.getSsdep());
if (contains){
Result.OK().error500("当前仅允许选择本县区以及属于本县区的机构");
}
expert.setIsdone("Y");
expert.setAdminopen("2");
expert.setCompopen("2");
//开始添加到用户表
SysUser user = new SysUser();
user.setAvatar(expert.getTopPic());
user.setSex(expert.getSex());
user.setRealname(expert.getRealname());
user.setUsername(expert.getSeusername());
user.setWorkNo(expert.getWorkon());
user.setEmail(expert.getEmails());
user.setPhone(expert.getPhone());
user.setCreateTime(new Date());//设置创建时间
String salt = oConvertUtils.randomGen(8);
user.setSalt(salt);
String passwordEncode = PasswordUtil.encrypt(expert.getSeusername(), expert.getPsd(), salt);
user.setPassword(passwordEncode);
user.setStatus(1);
user.setDelFlag(CommonConstant.DEL_FLAG_0);
sysUserService.saveUser(user, "1843478958968647681", expert.getSsdep(), "");
expertService.save(expert);
//
return Result.OK("添加成功!");
}
// 检查List中是否包含指定的String
public static boolean containsString(List<String> list, String str) {
for (String item : list) {
if (item.equals(str)) {
return true;
}
}
return false;
}
/**
* 编辑
*
* @param expert
* @return
*/
@AutoLog(value = "专家管理-编辑")
@ApiOperation(value="专家管理-编辑", notes="专家管理-编辑")
@AutoLog(value = "专家管理(市局管理员)-编辑")
@ApiOperation(value="专家管理(市局管理员)-编辑", notes="专家管理(市局管理员)-编辑")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
public Result<String> edit(@RequestBody Expert expert) {
expertService.updateById(expert);
//开始添加到用户表
SysUser user = new SysUser();
user.setAvatar(expert.getTopPic());
user.setSex(expert.getSex());
user.setRealname(expert.getRealname());
user.setUsername(expert.getSeusername());
user.setWorkNo(expert.getWorkon());
user.setEmail(expert.getEmails());
user.setPhone(expert.getPhone());
user.setCreateTime(new Date());//设置创建时间
String salt = oConvertUtils.randomGen(8);
user.setSalt(salt);
String passwordEncode = PasswordUtil.encrypt(expert.getSeusername(), expert.getPsd(), salt);
user.setPassword(passwordEncode);
user.setStatus(1);
user.setDelFlag(CommonConstant.DEL_FLAG_0);
sysUserService.editUser(user,"1843478958968647681", expert.getSsdep(), "", "");
return Result.OK("编辑成功!");
}
@ -163,6 +414,29 @@ public class ExpertController extends JeecgController<Expert, IExpertService> {
return Result.OK("删除成功!");
}
/**
* 通过id完善信息
*
* @param id
* @return
*/
@AutoLog(value = "专家管理-完善了之后提交审核")
@ApiOperation(value="专家管理-完善了之后提交审核", notes="专家管理-完善了之后提交审核")
@GetMapping(value = "/handleup")
public Result<String> handleup(@RequestParam(name="id",required=true) String id) {
Expert expert = expertService.getById(id);
String str ="";
if (expert.getIsdone().equals("N")) {
//修改提交审核状态
expertService.updatetj(id);
str ="提交成功";
} else if (expert.getIsdone().equals("Y")){
str ="无需重复提交";
}
return Result.OK(str);
}
/**
* 批量删除
*
@ -217,4 +491,102 @@ public class ExpertController extends JeecgController<Expert, IExpertService> {
return super.importExcel(request, response, Expert.class);
}
//这个是专家的自己的公司审核
@AutoLog(value = "专家管理-这个是专家的自己的公司审核")
@ApiOperation(value="专家管理-这个是专家的自己的公司审核", notes="专家管理-这个是专家的自己的公司审核")
@GetMapping(value = "handleupupfirm")
public Result<String> handleupupfirm(@RequestParam(name="id",required=true) String id) {
String str ="";
Expert expert =expertService.getById(id);
if (expert.getCompopen().equals("1")) {
//修改提交审核状态
expertService.handleupupfirm(id);
str ="通过审核";
} else if (expert.getCompopen().equals("2")) {
str ="无需重复提交";
}
return Result.OK(str);
}
//这个是专家的自己的公司审核
@AutoLog(value = "专家管理-这个是专家的自己的公司驳回")
@ApiOperation(value="专家管理-这个是专家的自己的公司审核", notes="专家管理-这个是专家的自己的公司驳回")
@GetMapping(value = "handlebackbackfirm")
public Result<String> handlebackbackfirm(@RequestParam(name="id",required=true) String id) {
String str ="";
Expert expert =expertService.getById(id);
if (expert.getCompopen().equals("1")) {
//修改提交审核状态
expertService.handlebackbackfirm(id);
str ="驳回审核!请到编辑页面确定问题数据并填写驳回原因";
} else if (expert.getCompopen().equals("3") || expert.getCompopen().equals("2") ) {
str ="已驳回或者是已通过审核";
}
return Result.OK(str);
}
//这个是专家的上级管理员审核
@AutoLog(value = "专家管理-这个是上级管理员的通过审核")
@ApiOperation(value="专家管理-这个是上级管理员的通过审核", notes="专家管理-这个是上级管理员的通过审核")
@GetMapping(value = "handleupcount")
public Result<String> handleupcount(@RequestParam(name="id",required=true) String id) {
String str ="";
Expert expert =expertService.getById(id);
if (expert.getCompopen().equals("2") && expert.getAdminopen().equals("1")) {
//修改提交审核状态
expertService.handleupcount(id);
str ="审核通过";
} else if (expert.getCompopen().equals("1") || expert.getCompopen().equals("3") ) {
str ="只有当专家所属机构审核之后才可以审核";
}
return Result.OK(str);
}
@AutoLog(value = "专家管理-这个是上级管理员的通过驳回")
@ApiOperation(value="专家管理-这个是上级管理员的通过驳回", notes="专家管理-这个是上级管理员的通过驳回")
@GetMapping(value = "handlebackcoount")
public Result<String> handlebackcoount(@RequestParam(name="id",required=true) String id) {
String str ="";
Expert expert =expertService.getById(id);
if (expert.getCompopen().equals("2") && expert.getAdminopen().equals("1")) {
//修改提交审核状态
expertService.handlebackcount(id);
str ="驳回完成!请到编辑页面确定问题数据并填写驳回原因";
} else if (expert.getCompopen().equals("2") || expert.getAdminopen().equals("3") ) {
str ="只有当专家所属机构审核之后且已通过不可驳回才可以驳回";
}
return Result.OK(str);
}
@AutoLog(value = "专家管理-这个是超级管理员审核")
@ApiOperation(value="专家管理-这个是超级管理员审核", notes="专家管理-这个是超级管理员审核")
@GetMapping(value = "handleadminup")
public Result<String> handleadminup(@RequestParam(name="id",required=true) String id) {
Expert expert =expertService.getById(id);
String str="";
if (expert.getIsdone().equals("Y")) {
expert.setAdminopen("2");
expert.setCompopen("2");
expertService.updateById(expert);
str="通过成功";
}else {
/*return Result.OK().error500("需要专家先提交审核");*/
str="需要专家先提交审核";
}
return Result.OK(str);
}
@AutoLog(value = "专家管理-这个是超级管理员驳回")
@ApiOperation(value="专家管理-这个是超级管理员驳回", notes="专家管理-这个是超级管理员驳回")
@GetMapping(value = "handleadminback")
public Result<String> handleadminback(@RequestParam(name="id",required=true) String id) {
Expert expert =expertService.getById(id);
expert.setAdminopen("1");
expert.setCompopen("1");
expert.setIsdone("N");
expertService.updateById(expert);
return Result.OK("驳回成功!请到编辑页面确定问题数据并填写驳回原因");
}
}

@ -67,10 +67,11 @@ public class Expert implements Serializable {
@Excel(name = "专业", width = 15)
@ApiModelProperty(value = "专业")
private String major;
/**研究方向*/
@Excel(name = "研究方向", width = 15)
/**研究方向*/
@Excel(name = "研究方向", width = 15, dictTable = "discipline_fieid", dicText = "name", dicCode = "id")
@Dict(dictTable = "discipline_fieid", dicText = "name", dicCode = "id")
@ApiModelProperty(value = "研究方向")
private String directioncal;
private java.lang.String directioncal;
/**研究类型*/
@Excel(name = "研究类型", width = 15)
@ApiModelProperty(value = "研究类型")
@ -83,14 +84,6 @@ public class Expert implements Serializable {
@Excel(name = "专家简介", width = 15)
@ApiModelProperty(value = "专家简介")
private String expinfo;
/**部门审核*/
@Excel(name = "部门审核", width = 15,replace = {"是_Y","否_N"} )
@ApiModelProperty(value = "部门审核")
private String compopen;
/**管理员审核*/
@Excel(name = "管理员审核", width = 15,replace = {"是_Y","否_N"} )
@ApiModelProperty(value = "管理员审核")
private String adminopen;
@TableField(exist = false)
private String psd;
@ -110,4 +103,32 @@ public class Expert implements Serializable {
private String emails;
@TableField(exist = false)
private Integer sex;
/**提交审核*/
// @Excel(name = "提交审核", width = 15,replace = {"是_Y","否_N"} )
@ApiModelProperty(value = "提交审核")
private java.lang.String isdone;
/**专家状态*/
@Excel(name = "专家状态", width = 15,replace = {"是_Y","否_N"} )
@ApiModelProperty(value = "专家状态")
private java.lang.String expsture;
/**异常备注*/
@Excel(name = "异常备注", width = 15)
@ApiModelProperty(value = "异常备注")
private java.lang.String errinfo;
/**部门审核*/
@Excel(name = "部门审核", width = 15, dicCode = "examstures")
@Dict(dicCode = "examstures")
@ApiModelProperty(value = "部门审核")
private java.lang.String compopen;
/**管理员审核*/
@Excel(name = "管理员审核", width = 15, dicCode = "examstures")
@Dict(dicCode = "examstures")
@ApiModelProperty(value = "管理员审核")
private java.lang.String adminopen;
}

@ -4,8 +4,10 @@ import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.jeecg.modules.demo.expert.entity.Expert;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.jeecg.modules.system.entity.SysUser;
/**
* @Description: 专家管理
@ -26,4 +28,34 @@ public interface ExpertMapper extends BaseMapper<Expert> {
@Select("SELECT COUNT(*) FROM sys_user WHERE email =#{emails}")
String isemils(String emails);
@Select("select dep_id from sys_user_depart where user_id =#{id}")
String getdeps(String id);
@Select("SELECT dep_id FROM sys_user_depart WHERE user_id=#{id}")
String getcountdepid(String id);
@Select("SELECT id FROM sys_depart WHERE parent_id =#{countdepid}")
List<String> getsubdepid(String countdepid);
@Select("SELECT user_id FROM sys_user_depart WHERE dep_id =#{depidlist}")
List<String> getuserbydeps(String depidlist);
@Select("SELECT user_id FROM sys_user_role WHERE role_id =#{number}")
List<String> userbyrole(String number);
@Update("UPDATE expert SET isdone = 'Y' WHERE id = #{id}")
void updatetj(String id);
@Update("UPDATE expert SET compopen = '2' WHERE id = #{id}")
void handleupupfirm(String id);
@Update("UPDATE expert SET compopen = '3' , isdone = 'N' WHERE id = #{id}")
void handlebackbackfirm(String id);
@Update("UPDATE expert SET adminopen = '2' WHERE id = #{id}")
void handleupcount(String id);
@Update("UPDATE expert SET adminopen = '3' , isdone = 'N' WHERE id = #{id}")
void handlebackcount(String id);
}

@ -2,6 +2,9 @@ package org.jeecg.modules.demo.expert.service;
import org.jeecg.modules.demo.expert.entity.Expert;
import com.baomidou.mybatisplus.extension.service.IService;
import org.jeecg.modules.system.entity.SysUser;
import java.util.List;
/**
* @Description: 专家管理
@ -18,4 +21,26 @@ public interface IExpertService extends IService<Expert> {
String isphone(String phone);
String isemils(String emails);
String getdeps(String id);
String getcountdepid(String id);
List<String> getsubdepid(String countdepid);
List<String> getuserbydeps(List<String> depidlist);
List<String> userbyrole(String number);
void updatetj(String id);
List<String> idlistss(String countdepid);
void handleupupfirm(String id);
void handlebackbackfirm(String id);
void handleupcount(String id);
void handlebackcount(String id);
}

@ -3,11 +3,15 @@ package org.jeecg.modules.demo.expert.service.impl;
import org.jeecg.modules.demo.expert.entity.Expert;
import org.jeecg.modules.demo.expert.mapper.ExpertMapper;
import org.jeecg.modules.demo.expert.service.IExpertService;
import org.jeecg.modules.system.entity.SysUser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import java.util.ArrayList;
import java.util.List;
/**
* @Description: 专家管理
* @Author: jeecg-boot
@ -40,4 +44,67 @@ public class ExpertServiceImpl extends ServiceImpl<ExpertMapper, Expert> impleme
public String isemils(String emails) {
return expertMapper.isemils(emails);
}
@Override
public String getdeps(String id) {
return expertMapper.getdeps(id);
}
@Override
public String getcountdepid(String id) {
return expertMapper.getcountdepid(id);
}
@Override
public List<String> getsubdepid(String countdepid) {
return expertMapper.getsubdepid(countdepid);
}
@Override
public List<String> getuserbydeps(List<String> depidlist) {
List<String> userids= new ArrayList<>();
for (int i=0;i<depidlist.size();i++){
List<String> str = expertMapper.getuserbydeps(depidlist.get(i));
userids.addAll(str);
}
return userids;
}
@Override
public List<String> userbyrole(String number) {
return expertMapper.userbyrole(number);
}
@Override
public void updatetj(String id) {
expertMapper.updatetj(id);
}
@Override
public List<String> idlistss(String countdepid) {
return expertMapper.getuserbydeps(countdepid);
}
@Override
public void handleupupfirm(String id) {
expertMapper.handleupupfirm(id);
}
@Override
public void handlebackbackfirm(String id) {
expertMapper.handlebackbackfirm(id);
}
@Override
public void handleupcount(String id) {
expertMapper.handleupcount(id);
}
@Override
public void handlebackcount(String id) {
expertMapper.handlebackcount(id);
}
}

@ -0,0 +1,336 @@
package org.jeecg.modules.demo.expproject.controller;
import java.io.UnsupportedEncodingException;
import java.io.IOException;
import java.net.URLDecoder;
import java.util.*;
import java.util.stream.Collectors;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.aspectj.apache.bcel.classfile.Module;
import org.jeecg.modules.demo.expert.entity.Expert;
import org.jeecg.modules.demo.expert.service.IExpertService;
import org.jeecg.modules.system.entity.SysUser;
import org.jeecg.modules.system.service.ISysUserService;
import org.jeecgframework.poi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams;
import org.jeecgframework.poi.excel.entity.ImportParams;
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
import org.jeecg.common.system.vo.LoginUser;
import org.apache.shiro.SecurityUtils;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.common.system.query.QueryRuleEnum;
import org.jeecg.common.util.oConvertUtils;
import org.jeecg.modules.demo.expproject.entity.Expandpro;
import org.jeecg.modules.demo.expproject.entity.Expproject;
import org.jeecg.modules.demo.expproject.vo.ExpprojectPage;
import org.jeecg.modules.demo.expproject.service.IExpprojectService;
import org.jeecg.modules.demo.expproject.service.IExpandproService;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.extern.slf4j.Slf4j;
import com.alibaba.fastjson.JSON;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.jeecg.common.aspect.annotation.AutoLog;
/**
* @Description: 专家项目表
* @Author: jeecg-boot
* @Date: 2024-10-23
* @Version: V1.0
*/
@Api(tags="专家项目表")
@RestController
@RequestMapping("/expproject/expproject")
@Slf4j
public class ExpprojectController {
@Autowired
private IExpprojectService expprojectService;
@Autowired
private IExpandproService expandproService;
@Autowired
private IExpertService expertService;
@Autowired
private ISysUserService sysUserService;
/**
* 分页列表查询
*
* @param expproject
* @param pageNo
* @param pageSize
* @param req
* @return
*/
//@AutoLog(value = "专家项目表-分页列表查询")
@ApiOperation(value="专家项目表-分页列表查询", notes="专家项目表-分页列表查询")
@GetMapping(value = "/list")
public Result<IPage<Expproject>> queryPageList(Expproject expproject,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<Expproject> queryWrapper = QueryGenerator.initQueryWrapper(expproject, req.getParameterMap());
Page<Expproject> page = new Page<Expproject>(pageNo, pageSize);
IPage<Expproject> pageList = expprojectService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 添加
*
* @param expprojectPage
* @return
*/
@AutoLog(value = "专家项目表-添加")
@ApiOperation(value="专家项目表-添加", notes="专家项目表-添加")
@PostMapping(value = "/add")
public Result<String> add(@RequestBody ExpprojectPage expprojectPage) {
Expproject expproject = new Expproject();
BeanUtils.copyProperties(expprojectPage, expproject);
if (expproject.getNeedexp()>=expprojectPage.getExpandproList().size()) {
expprojectService.saveMain(expproject, expprojectPage.getExpandproList());
return Result.OK("添加成功!");
}else {
return Result.error("确定项目专家数量");
}
}
/**
* 编辑
*
* @param expprojectPage
* @return
*/
@AutoLog(value = "专家项目表-编辑")
@ApiOperation(value="专家项目表-编辑", notes="专家项目表-编辑")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
public Result<String> edit(@RequestBody ExpprojectPage expprojectPage) {
Expproject expproject = new Expproject();
BeanUtils.copyProperties(expprojectPage, expproject);
Expproject expprojectEntity = expprojectService.getById(expproject.getId());
if(expprojectEntity==null) {
return Result.error("未找到对应数据");
}
if (expproject.getNeedexp()>=expprojectPage.getExpandproList().size()) {
expprojectService.updateMain(expproject, expprojectPage.getExpandproList());
return Result.OK("编辑成功!");
}else {
return Result.error("确定项目专家数量");
}
}
/**
* 通过id删除
*
* @param id
* @return
*/
@AutoLog(value = "专家项目表-通过id删除")
@ApiOperation(value="专家项目表-通过id删除", notes="专家项目表-通过id删除")
@DeleteMapping(value = "/delete")
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
expprojectService.delMain(id);
return Result.OK("删除成功!");
}
/**
* 批量删除
*
* @param ids
* @return
*/
@AutoLog(value = "专家项目表-批量删除")
@ApiOperation(value="专家项目表-批量删除", notes="专家项目表-批量删除")
@DeleteMapping(value = "/deleteBatch")
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
this.expprojectService.delBatchMain(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
}
/**
* 通过id查询
*
* @param id
* @return
*/
//@AutoLog(value = "专家项目表-通过id查询")
@ApiOperation(value="专家项目表-通过id查询", notes="专家项目表-通过id查询")
@GetMapping(value = "/queryById")
public Result<Expproject> queryById(@RequestParam(name="id",required=true) String id) {
Expproject expproject = expprojectService.getById(id);
if(expproject==null) {
return Result.error("未找到对应数据");
}
return Result.OK(expproject);
}
/**
* 随机生成专家
*
* @param id
* @return
*/
//@AutoLog(value = "专家项目表-随机生成专家")
@ApiOperation(value="专家项目表-随机生成专家", notes="专家项目表-随机生成专家")
@GetMapping(value = "/createexpawait")
public Result<String> createexpawait(@RequestParam(name="id",required=true) String id) {
String str = "";
Expproject expproject = expprojectService.getById(id);
int intce = expproject.getNeedexp();
List<Expandpro> expandproList = expandproService.query().eq("expprojectid",id).list();
if (expandproList.size()==intce ){
str="此项目专家已经足够";
} else if (expandproList.size()<intce){
int a = intce-expandproList.size();
List<String> usernamelist = expandproService.getusernamelist();
Collections.shuffle(usernamelist);
List<String> randomUsers = getRandomUsers(usernamelist, a);
Expandpro expandpro =new Expandpro();
List<Expert> expertList = expertService.query().in("seusername",randomUsers).list();
for (int i=0;i<expertList.size();i++){
expandpro.setExpid(expertList.get(i).getSeusername());
expandpro.setExpprojectid(id);
expandpro.setSsdep(expandproService.getdepid(expertList.get(i).getSeusername()));
expandpro.setExptype(expertList.get(i).getDirectioncal());
expandpro.setPhone(expertList.get(i).getPhone());
expandpro.setEmil(expertList.get(i).getEmails());
expandproService.save(expandpro);
}
str="生成完成";
}
return Result.OK(str);
}
/**
* 通过id查询
*
* @param id
* @return
*/
//@AutoLog(value = "评审专家通过主表ID查询")
@ApiOperation(value="评审专家主表ID查询", notes="评审专家-通主表ID查询")
@GetMapping(value = "/queryExpandproByMainId")
public Result<List<Expandpro>> queryExpandproListByMainId(@RequestParam(name="id",required=true) String id) {
List<Expandpro> expandproList = expandproService.selectByMainId(id);
return Result.OK(expandproList);
}
/**
* 导出excel
*
* @param request
* @param expproject
*/
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, Expproject expproject) {
// Step.1 组装查询条件查询数据
QueryWrapper<Expproject> queryWrapper = QueryGenerator.initQueryWrapper(expproject, request.getParameterMap());
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
//配置选中数据查询条件
String selections = request.getParameter("selections");
if(oConvertUtils.isNotEmpty(selections)) {
List<String> selectionList = Arrays.asList(selections.split(","));
queryWrapper.in("id",selectionList);
}
//Step.2 获取导出数据
List<Expproject> expprojectList = expprojectService.list(queryWrapper);
// Step.3 组装pageList
List<ExpprojectPage> pageList = new ArrayList<ExpprojectPage>();
for (Expproject main : expprojectList) {
ExpprojectPage vo = new ExpprojectPage();
BeanUtils.copyProperties(main, vo);
List<Expandpro> expandproList = expandproService.selectByMainId(main.getId());
vo.setExpandproList(expandproList);
pageList.add(vo);
}
// Step.4 AutoPoi 导出Excel
ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
mv.addObject(NormalExcelConstants.FILE_NAME, "专家项目表列表");
mv.addObject(NormalExcelConstants.CLASS, ExpprojectPage.class);
mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("专家项目表数据", "导出人:"+sysUser.getRealname(), "专家项目表"));
mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
return mv;
}
/**
* 通过excel导入数据
*
* @param request
* @param response
* @return
*/
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
// 获取上传文件对象
MultipartFile file = entity.getValue();
ImportParams params = new ImportParams();
params.setTitleRows(2);
params.setHeadRows(1);
params.setNeedSave(true);
try {
List<ExpprojectPage> list = ExcelImportUtil.importExcel(file.getInputStream(), ExpprojectPage.class, params);
for (ExpprojectPage page : list) {
Expproject po = new Expproject();
BeanUtils.copyProperties(page, po);
expprojectService.saveMain(po, page.getExpandproList());
}
return Result.OK("文件导入成功!数据行数:" + list.size());
} catch (Exception e) {
log.error(e.getMessage(),e);
return Result.error("文件导入失败:"+e.getMessage());
} finally {
try {
file.getInputStream().close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
return Result.OK("文件导入失败!");
}
public static List<String> getRandomUsers(List<String> userlist, int numberOfUsers) {
List<String> result = new ArrayList<>();
Random random = new Random();
int listSize = userlist.size();
// 如果想要选择的用户数量超过了列表中的用户数量,就循环选择直到达到所需数量
// 注意:这将允许结果中有重复的用户
for (int i = 0; i < numberOfUsers; i++) {
int index = random.nextInt(listSize); // 生成一个0到listSize-1之间的随机索引
result.add(userlist.get(index)); // 将随机选择的用户添加到结果列表中
}
// 如果需要,可以对结果列表进行打乱(虽然在这个特定情况下可能不是必需的)
// Collections.shuffle(result);
return result;
}
}

@ -0,0 +1,81 @@
package org.jeecg.modules.demo.expproject.entity;
import java.io.Serializable;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableLogic;
import org.jeecg.common.constant.ProvinceCityArea;
import org.jeecg.common.util.SpringContextUtils;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import org.jeecgframework.poi.excel.annotation.Excel;
import java.util.Date;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.UnsupportedEncodingException;
/**
* @Description: 评审专家
* @Author: jeecg-boot
* @Date: 2024-10-23
* @Version: V1.0
*/
@ApiModel(value="expandpro对象", description="评审专家")
@Data
@TableName("expandpro")
public class Expandpro 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;
/**所属部门*/
@ApiModelProperty(value = "所属部门")
private String sysOrgCode;
/**专家id*/
@Excel(name = "专家id", width = 15)
@ApiModelProperty(value = "专家id")
private String expid;
/**外键id*/
@ApiModelProperty(value = "外键id")
private String expprojectid;
/**专家名称*/
@Excel(name = "专家名称", width = 15)
@ApiModelProperty(value = "专家名称")
private String expname;
/**所属领域*/
@Excel(name = "所属领域", width = 15)
@ApiModelProperty(value = "所属领域")
private String exptype;
/**所属单位*/
@Excel(name = "所属单位", width = 15, dictTable = "sys_depart", dicText = "depart_name", dicCode = "id")
@ApiModelProperty(value = "所属单位")
private String ssdep;
/**专家电话*/
@Excel(name = "专家电话", width = 15)
@ApiModelProperty(value = "专家电话")
private String phone;
/**专家邮箱*/
@Excel(name = "专家邮箱", width = 15)
@ApiModelProperty(value = "专家邮箱")
private String emil;
}

@ -0,0 +1,76 @@
package org.jeecg.modules.demo.expproject.entity;
import java.io.Serializable;
import java.io.UnsupportedEncodingException;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableLogic;
import org.jeecg.common.constant.ProvinceCityArea;
import org.jeecg.common.util.SpringContextUtils;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.jeecg.common.aspect.annotation.Dict;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/**
* @Description: 专家项目表
* @Author: jeecg-boot
* @Date: 2024-10-23
* @Version: V1.0
*/
@ApiModel(value="expproject对象", description="专家项目表")
@Data
@TableName("expproject")
public class Expproject 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;
/**所属部门*/
@ApiModelProperty(value = "所属部门")
private String sysOrgCode;
/**项目名称*/
@Excel(name = "项目名称", width = 15)
@ApiModelProperty(value = "项目名称")
private String proname;
/**专家类型*/
@Excel(name = "专家类型", width = 15, dictTable = "discipline_fieid", dicText = "name", dicCode = "id")
@Dict(dictTable = "discipline_fieid", dicText = "name", dicCode = "id")
@ApiModelProperty(value = "专家类型")
private String exptype;
/**需要专家个数*/
@Excel(name = "需要专家个数", width = 15)
@ApiModelProperty(value = "需要专家个数")
private Integer needexp;
/**简介*/
@Excel(name = "简介", width = 15)
@ApiModelProperty(value = "简介")
private String proinfo;
/**附件*/
@Excel(name = "附件", width = 15)
@ApiModelProperty(value = "附件")
private String profile;
}

@ -0,0 +1,39 @@
package org.jeecg.modules.demo.expproject.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Select;
import org.jeecg.modules.demo.expproject.entity.Expandpro;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
/**
* @Description: 评审专家
* @Author: jeecg-boot
* @Date: 2024-10-23
* @Version: V1.0
*/
public interface ExpandproMapper extends BaseMapper<Expandpro> {
/**
* 通过主表id删除子表数据
*
* @param mainId 主表id
* @return boolean
*/
public boolean deleteByMainId(@Param("mainId") String mainId);
/**
* 通过主表id查询子表数据
*
* @param mainId 主表id
* @return List<Expandpro>
*/
public List<Expandpro> selectByMainId(@Param("mainId") String mainId);
@Select("select seusername from expert WHERE expsture='N' AND isdone='Y' AND adminopen='2' AND compopen='2'")
List<String> getusernamelist();
@Select("SELECT dep_id FROM expert AS expe LEFT JOIN sys_user AS sysu ON sysu.username = expe.seusername LEFT JOIN sys_user_depart AS sysud ON sysu.id =sysud.user_id WHERE expe.seusername =#{seusername} ")
String getdepid(String seusername);
}

@ -0,0 +1,17 @@
package org.jeecg.modules.demo.expproject.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.jeecg.modules.demo.expproject.entity.Expproject;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @Description: 专家项目表
* @Author: jeecg-boot
* @Date: 2024-10-23
* @Version: V1.0
*/
public interface ExpprojectMapper extends BaseMapper<Expproject> {
}

@ -0,0 +1,16 @@
<?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.expproject.mapper.ExpandproMapper">
<delete id="deleteByMainId" parameterType="java.lang.String">
DELETE
FROM expandpro
WHERE
expprojectid = #{mainId} </delete>
<select id="selectByMainId" parameterType="java.lang.String" resultType="org.jeecg.modules.demo.expproject.entity.Expandpro">
SELECT *
FROM expandpro
WHERE
expprojectid = #{mainId} </select>
</mapper>

@ -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.expproject.mapper.ExpprojectMapper">
</mapper>

@ -0,0 +1,26 @@
package org.jeecg.modules.demo.expproject.service;
import org.jeecg.modules.demo.expproject.entity.Expandpro;
import com.baomidou.mybatisplus.extension.service.IService;
import java.util.List;
/**
* @Description: 评审专家
* @Author: jeecg-boot
* @Date: 2024-10-23
* @Version: V1.0
*/
public interface IExpandproService extends IService<Expandpro> {
/**
* 通过主表id查询子表数据
*
* @param mainId 主表id
* @return List<Expandpro>
*/
public List<Expandpro> selectByMainId(String mainId);
List<String> getusernamelist();
String getdepid(String seusername);
}

@ -0,0 +1,48 @@
package org.jeecg.modules.demo.expproject.service;
import org.jeecg.modules.demo.expproject.entity.Expandpro;
import org.jeecg.modules.demo.expproject.entity.Expproject;
import com.baomidou.mybatisplus.extension.service.IService;
import java.io.Serializable;
import java.util.Collection;
import java.util.List;
/**
* @Description: 专家项目表
* @Author: jeecg-boot
* @Date: 2024-10-23
* @Version: V1.0
*/
public interface IExpprojectService extends IService<Expproject> {
/**
* 添加一对多
*
* @param expproject
* @param expandproList
*/
public void saveMain(Expproject expproject,List<Expandpro> expandproList) ;
/**
* 修改一对多
*
* @param expproject
* @param expandproList
*/
public void updateMain(Expproject expproject,List<Expandpro> expandproList);
/**
* 删除一对多
*
* @param id
*/
public void delMain (String id);
/**
* 批量删除一对多
*
* @param idList
*/
public void delBatchMain (Collection<? extends Serializable> idList);
}

@ -0,0 +1,37 @@
package org.jeecg.modules.demo.expproject.service.impl;
import org.jeecg.modules.demo.expproject.entity.Expandpro;
import org.jeecg.modules.demo.expproject.mapper.ExpandproMapper;
import org.jeecg.modules.demo.expproject.service.IExpandproService;
import org.springframework.stereotype.Service;
import java.util.List;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
/**
* @Description: 评审专家
* @Author: jeecg-boot
* @Date: 2024-10-23
* @Version: V1.0
*/
@Service
public class ExpandproServiceImpl extends ServiceImpl<ExpandproMapper, Expandpro> implements IExpandproService {
@Autowired
private ExpandproMapper expandproMapper;
@Override
public List<Expandpro> selectByMainId(String mainId) {
return expandproMapper.selectByMainId(mainId);
}
@Override
public List<String> getusernamelist() {
return expandproMapper.getusernamelist();
}
@Override
public String getdepid(String seusername) {
return expandproMapper.getdepid(seusername);
}
}

@ -0,0 +1,77 @@
package org.jeecg.modules.demo.expproject.service.impl;
import org.jeecg.modules.demo.expproject.entity.Expproject;
import org.jeecg.modules.demo.expproject.entity.Expandpro;
import org.jeecg.modules.demo.expproject.mapper.ExpandproMapper;
import org.jeecg.modules.demo.expproject.mapper.ExpprojectMapper;
import org.jeecg.modules.demo.expproject.service.IExpprojectService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import java.io.Serializable;
import java.util.List;
import java.util.Collection;
/**
* @Description: 专家项目表
* @Author: jeecg-boot
* @Date: 2024-10-23
* @Version: V1.0
*/
@Service
public class ExpprojectServiceImpl extends ServiceImpl<ExpprojectMapper, Expproject> implements IExpprojectService {
@Autowired
private ExpprojectMapper expprojectMapper;
@Autowired
private ExpandproMapper expandproMapper;
@Override
@Transactional(rollbackFor = Exception.class)
public void saveMain(Expproject expproject, List<Expandpro> expandproList) {
expprojectMapper.insert(expproject);
if(expandproList!=null && expandproList.size()>0) {
for(Expandpro entity:expandproList) {
//外键设置
entity.setExpprojectid(expproject.getId());
expandproMapper.insert(entity);
}
}
}
@Override
@Transactional(rollbackFor = Exception.class)
public void updateMain(Expproject expproject,List<Expandpro> expandproList) {
expprojectMapper.updateById(expproject);
//1.先删除子表数据
expandproMapper.deleteByMainId(expproject.getId());
//2.子表数据重新插入
if(expandproList!=null && expandproList.size()>0) {
for(Expandpro entity:expandproList) {
//外键设置
entity.setExpprojectid(expproject.getId());
expandproMapper.insert(entity);
}
}
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delMain(String id) {
expandproMapper.deleteByMainId(id);
expprojectMapper.deleteById(id);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delBatchMain(Collection<? extends Serializable> idList) {
for(Serializable id:idList) {
expandproMapper.deleteByMainId(id.toString());
expprojectMapper.deleteById(id);
}
}
}

@ -0,0 +1,77 @@
package org.jeecg.modules.demo.expproject.vo;
import java.util.List;
import org.jeecg.modules.demo.expproject.entity.Expproject;
import org.jeecg.modules.demo.expproject.entity.Expandpro;
import lombok.Data;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.jeecgframework.poi.excel.annotation.ExcelEntity;
import org.jeecgframework.poi.excel.annotation.ExcelCollection;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
import org.jeecg.common.aspect.annotation.Dict;
import org.jeecg.common.constant.ProvinceCityArea;
import org.jeecg.common.util.SpringContextUtils;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/**
* @Description: 专家项目表
* @Author: jeecg-boot
* @Date: 2024-10-23
* @Version: V1.0
*/
@Data
@ApiModel(value="expprojectPage对象", description="专家项目表")
public class ExpprojectPage {
/**主键*/
@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;
/**所属部门*/
@ApiModelProperty(value = "所属部门")
private String sysOrgCode;
/**项目名称*/
@Excel(name = "项目名称", width = 15)
@ApiModelProperty(value = "项目名称")
private String proname;
/**专家类型*/
@Excel(name = "专家类型", width = 15, dictTable = "discipline_fieid", dicText = "name", dicCode = "id")
@Dict(dictTable = "discipline_fieid", dicText = "name", dicCode = "id")
@ApiModelProperty(value = "专家类型")
private String exptype;
/**需要专家个数*/
@Excel(name = "需要专家个数", width = 15)
@ApiModelProperty(value = "需要专家个数")
private Integer needexp;
/**简介*/
@Excel(name = "简介", width = 15)
@ApiModelProperty(value = "简介")
private String proinfo;
/**附件*/
@Excel(name = "附件", width = 15)
@ApiModelProperty(value = "附件")
private String profile;
@ExcelCollection(name="评审专家")
@ApiModelProperty(value = "评审专家")
private List<Expandpro> expandproList;
}

@ -76,6 +76,7 @@ export default {
loginButton: '登录',
registerButton: '注册',
registerButton4faren: '法人注册',
registerButtonexp: '专家注册',
registerButton4shenbaoren: '申报人注册',
rememberMe: '记住我',
forgetPassword: '忘记密码?',

@ -1,16 +1,18 @@
import { defHttp } from '/@/utils/http/axios';
import { useMessage } from "/@/hooks/web/useMessage";
import { defHttp } from '/src/utils/http/axios';
import { useMessage } from "/src/hooks/web/useMessage";
const { createConfirm } = useMessage();
enum Api {
list = '/expert/expert/list',
list = '/expert/expert/listadmin',
save='/expert/expert/add',
edit='/expert/expert/edit',
deleteOne = '/expert/expert/delete',
deleteBatch = '/expert/expert/deleteBatch',
importExcel = '/expert/expert/importExcel',
exportXls = '/expert/expert/exportXls',
handleadminback = '/expert/expert/handleadminback',
handleadminup = '/expert/expert/handleadminup',
}
/**
@ -28,6 +30,19 @@ export const getImportUrl = Api.importExcel;
* 列表接口
* @param params
*/
export const handleadminup = (params) => defHttp.get({ url: Api.handleadminup, params });
/**
* 管理员驳回
* @param params
*/
export const handleadminback = (params) => defHttp.get({ url: Api.handleadminback, params });
/**
* 管理员通过审核
* @param params
*/
export const list = (params) => defHttp.get({ url: Api.list, params });
/**

@ -1,8 +1,8 @@
import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
import { getWeekMonthQuarterYear } from '/@/utils';
import {BasicColumn} from '/src/components/Table';
import {FormSchema} from '/src/components/Table';
import { rules} from '/src/utils/helper/validator';
import { render } from '/src/utils/common/renderUtils';
import { getWeekMonthQuarterYear } from '/src/utils';
//
export const columns: BasicColumn[] = [
{
@ -23,7 +23,7 @@ export const columns: BasicColumn[] = [
{
title: '研究方向',
align: "center",
dataIndex: 'directioncal'
dataIndex: 'directioncal_dictText'
},
{
title: '研究类型',
@ -40,21 +40,33 @@ export const columns: BasicColumn[] = [
align: "center",
dataIndex: 'expinfo'
},
{
title: '部门审核',
align: "center",
dataIndex: 'compopen',
customRender:({text}) => {
return render.renderSwitch(text, [{text:'是',value:'Y'},{text:'否',value:'N'}]);
},
dataIndex: 'compopen_dictText'
},
{
title: '管理员审核',
align: "center",
dataIndex: 'adminopen',
dataIndex: 'adminopen_dictText'
},
{
title: '是否完善信息',
align: "center",
dataIndex: 'isdone',
customRender:({text}) => {
return render.renderSwitch(text, [{text:'是',value:'Y'},{text:'否',value:'N'}]);
},
},
{
title: '专家状态',
align: "center",
dataIndex: 'expsture',
customRender:({text}) => {
return render.renderSwitch(text, [{text:'是',value:'Y'},{text:'否',value:'N'}]);
},
return render.renderSwitch(text, [{text:'是',value:'Y'},{text:'否',value:'N'}]);
},
},
];

@ -76,16 +76,16 @@
<script lang="ts" name="expert-expert" setup>
import { ref, reactive } from 'vue';
import { BasicTable, useTable, TableAction } from '/@/components/Table';
import { useListPage } from '/@/hooks/system/useListPage';
import { BasicTable, useTable, TableAction } from '/src/components/Table';
import { useListPage } from '/src/hooks/system/useListPage';
import { columns, superQuerySchema } from './Expert.data';
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './Expert.api';
import { downloadFile } from '/@/utils/common/renderUtils';
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl,handleadminup,handleadminback } from './Expert.api';
import { downloadFile } from '/src/utils/common/renderUtils';
import ExpertModal from './components/ExpertModal.vue'
import { useUserStore } from '/@/store/modules/user';
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 { useUserStore } from '/src/store/modules/user';
import JDictSelectTag from '/src/components/Form/src/jeecg/components/JDictSelectTag.vue';
import JSwitch from '/src/components/Form/src/jeecg/components/JSwitch.vue';
import JSelectMultiple from '/src/components/Form/src/jeecg/components/JSelectMultiple.vue';
const formRef = ref();
const queryParam = reactive<any>({});
@ -174,6 +174,21 @@
await deleteOne({ id: record.id }, handleSuccess);
}
/**
* 删除事件
*/
async function handlebackadmin(record) {
await handleadminback({ id: record.id }, handleSuccess);
}
/**
* 删除事件
*/
async function handleupadmin(record) {
await handleadminup({ id: record.id }, handleSuccess);
}
/**
* 批量删除事件
*/
@ -215,7 +230,20 @@
confirm: handleDelete.bind(null, record),
placement: 'topLeft',
},
auth: 'expert:expert:delete'
}, {
label: '通过审核',
popConfirm: {
title: '是否通过审核',
confirm: handleupadmin.bind(null, record),
placement: 'topLeft',
},
}, {
label: '驳回审核',
popConfirm: {
title: '是否v',
confirm: handlebackadmin.bind(null, record),
placement: 'topLeft',
},
}
]
}

@ -9,14 +9,14 @@
<a-input v-model:value="formData.seusername" placeholder="请输入用户名" ></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-col :span="24" >
<a-form-item label="密码" v-bind="validateInfos.psd" name="psd">
<a-input-password v-model:value="formData.psd" placeholder="请输入密码" ></a-input-password>
</a-form-item>
</a-col>
<a-col :span="24">
<a-col :span="24" >
<a-form-item label="确人密码" v-bind="validateInfos.sepsd" name="sepsd">
<a-input-password v-model:value="formData.sepsd" placeholder="确认用户名" ></a-input-password>
<a-input-password v-model:value="formData.sepsd" placeholder="确认密码" ></a-input-password>
</a-form-item>
</a-col>
@ -26,13 +26,13 @@
</a-form-item>
</a-col>
<a-col :span="24">
<a-col :span="24" >
<a-form-item label="工号" v-bind="validateInfos.workon" name="workon">
<a-input v-model:value="formData.workon" placeholder="请输入工号" ></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="性别" v-bind="validateInfos.sex" id="TestDemoForm-sex" name="sex">
<a-form-item label="性别" v-bind="validateInfos.sex" name="sex">
<j-dict-select-tag v-model:value="formData.sex" dictCode="sex" placeholder="请选择性别" allow-clear />
</a-form-item>
</a-col>
@ -69,11 +69,11 @@
<a-input v-model:value="formData.major" placeholder="请输入专业" allow-clear ></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="研究方向" v-bind="validateInfos.directioncal" id="ExpertForm-directioncal" name="directioncal">
<a-input v-model:value="formData.directioncal" placeholder="请输入研究方向" allow-clear ></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="研究方向" v-bind="validateInfos.directioncal" id="ExpertForm-directioncal" name="directioncal">
<j-dict-select-tag v-model:value="formData.directioncal" dictCode="discipline_fieid,name,id" placeholder="请选择研究方向" allow-clear />
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="研究类型" v-bind="validateInfos.research" id="ExpertForm-research" name="research">
<a-input v-model:value="formData.research" placeholder="请输入研究类型" allow-clear ></a-input>
@ -84,11 +84,29 @@
<a-input v-model:value="formData.educationcal" placeholder="请输入学历" allow-clear ></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-col :span="24">
<a-form-item label="专家简介" v-bind="validateInfos.expinfo" id="ExpertForm-expinfo" name="expinfo">
<a-textarea v-model:value="formData.expinfo" :rows="4" placeholder="请输入专家简介" />
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="专家状态" v-bind="validateInfos.expsture" id="ExpertForm-expsture" name="expsture">
<j-switch v-model:value="formData.expsture" ></j-switch>
</a-form-item>
</a-col>
<a-col :span="24" v-if="formData.expsture === 'Y'">
<a-form-item label="异常备注" v-bind="validateInfos.errinfo" id="ExpertForm-errinfo" name="errinfo">
<a-input v-model:value="formData.errinfo" placeholder="请输入异常备注" allow-clear ></a-input>
</a-form-item>
</a-col>
<a-col :span="24" v-if="formData.adminopen === '3' || formData.compopen === '3'">
<a-form-item label="异常备注" v-bind="validateInfos.errinfo" id="ExpertForm-backinfo" name="backinfo">
<a-input v-model:value="formData.backinfo" placeholder="请输入异常备注" allow-clear ></a-input>
</a-form-item>
</a-col>
</a-row>
</a-form>
</template>
@ -97,17 +115,17 @@
</template>
<script lang="ts" setup>
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
import JSelectDept from '/@/components/Form/src/jeecg/components/JSelectDept.vue';
import JImageUpload from '/@/components/Form/src/jeecg/components/JImageUpload.vue';
import JDictSelectTag from '/src/components/Form/src/jeecg/components/JDictSelectTag.vue';
import JSelectDept from '/src/components/Form/src/jeecg/components/JSelectDept.vue';
import JImageUpload from '/src/components/Form/src/jeecg/components/JImageUpload.vue';
import { ref, reactive, defineExpose, nextTick, defineProps, computed, onMounted } from 'vue';
import { defHttp } from '/@/utils/http/axios';
import { useMessage } from '/@/hooks/web/useMessage';
import JSwitch from '/@/components/Form/src/jeecg/components/JSwitch.vue';
import { getValueType } from '/@/utils';
import { defHttp } from '/src/utils/http/axios';
import { useMessage } from '/src/hooks/web/useMessage';
import JSwitch from '/src/components/Form/src/jeecg/components/JSwitch.vue';
import { getValueType } from '/src/utils';
import { saveOrUpdate } from '../Expert.api';
import { Form } from 'ant-design-vue';
import JFormContainer from '/@/components/Form/src/container/JFormContainer.vue';
import JFormContainer from '/src/components/Form/src/container/JFormContainer.vue';
const props = defineProps({
formDisabled: { type: Boolean, default: false },
formData: { type: Object, default: () => ({})},

@ -7,7 +7,7 @@
<script lang="ts" setup>
import { ref, nextTick, defineExpose } from 'vue';
import ExpertForm from './ExpertForm.vue'
import JModal from '/@/components/Modal/src/JModal/JModal.vue';
import JModal from '/src/components/Modal/src/JModal/JModal.vue';
const title = ref<string>('');
const width = ref<number>(800);

@ -0,0 +1,87 @@
import {defHttp} from '/@/utils/http/axios';
import { useMessage } from "/@/hooks/web/useMessage";
const { createConfirm } = useMessage();
enum Api {
list = '/expproject/expproject/list',
save='/expproject/expproject/add',
edit='/expproject/expproject/edit',
deleteOne = '/expproject/expproject/delete',
deleteBatch = '/expproject/expproject/deleteBatch',
importExcel = '/expproject/expproject/importExcel',
exportXls = '/expproject/expproject/exportXls',
queryDataById = '/expproject/expproject/queryById',
expandproList = '/expproject/expproject/queryExpandproByMainId',
createexpawaitup= '/expproject/expproject/createexpawait',
}
/**
* 导出api
* @param params
*/
export const getExportUrl = Api.exportXls;
/**
* 导入api
*/
export const getImportUrl = Api.importExcel;
/**
* 查询子表数据
* @param params
*/
export const queryExpandproListByMainId = (id) => defHttp.get({url: Api.expandproList, params:{ id }});
/**
* 列表接口
* @param params
*/
export const list = (params) =>
defHttp.get({url: Api.list, params});
/**
* 随机生成专家接口
* @param params
*/
export const createexpawait = (params) => defHttp.get({url: Api.createexpawaitup, 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});
}
/**
* 根据id查询数据
* @param params
*/
export const queryDataById = (id) => defHttp.get({url: Api.queryDataById, params:{ id }});

@ -0,0 +1,105 @@
import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
import {JVxeTypes,JVxeColumn} from '/@/components/jeecg/JVxeTable/types'
import { getWeekMonthQuarterYear } from '/@/utils';
//
export const columns: BasicColumn[] = [
{
title: '专家类型',
align:"center",
dataIndex: 'exptype_dictText'
},
{
title: '需要专家个数',
align:"center",
dataIndex: 'needexp'
},
{
title: '简介',
align:"center",
dataIndex: 'proinfo'
},
{
title: '附件',
align:"center",
dataIndex: 'profile',
},
];
//
export const expandproColumns: JVxeColumn[] = [
{
title: '专家名称',
key: 'expname',
type: JVxeTypes.popup,
popupCode:"findexp",
fieldConfig: [
{ source: 'id', target: 'expid' },
{ source: 'realname', target: 'expname' },
{ source: 'directioncal', target: 'exptype' },
{ source: 'depid', target: 'ssdep' },
{ source: 'phone', target: 'phone' },
{ source: 'email', target: 'emil' },
],
width:"200px",
placeholder: '请输入${title}',
defaultValue:'',
},
{
title: '所属领域',
key: 'exptype',
type: JVxeTypes.input,
disabled:true,
width:"200px",
placeholder: '请输入${title}',
defaultValue:'',
},
{
title: '所属单位',
key: 'ssdep',
type: JVxeTypes.selectSearch,
dictCode:"sys_depart,depart_name,id",
width:"200px",
placeholder: '请输入${title}',
defaultValue:'',
},
{
title: '专家电话',
key: 'phone',
type: JVxeTypes.input,
width:"200px",
placeholder: '请输入${title}',
defaultValue:'',
},
{
title: '专家邮箱',
key: 'emil',
type: JVxeTypes.input,
width:"200px",
placeholder: '请输入${title}',
defaultValue:'',
},
]
//
export const superQuerySchema = {
exptype: {title: '专家类型',order: 1,view: 'sel_search', type: 'string',dictTable: "discipline_fieid", dictCode: 'id', dictText: 'name',},
needexp: {title: '需要专家个数',order: 2,view: 'number', type: 'number',},
proinfo: {title: '简介',order: 3,view: 'text', type: 'string',},
profile: {title: '附件',order: 4,view: 'file', type: 'string',},
//
expandpro: {
title: '评审专家',
view: 'table',
fields: {
expname: {title: '专家名称',order: 1,view: 'popup', type: 'string',code: 'findexp', orgFields: 'realname', destFields: 'expname', popupMulti: false,},
exptype: {title: '所属领域',order: 2,view: 'text', type: 'string',},
ssdep: {title: '所属单位',order: 3,view: 'sel_search', type: 'string',dictTable: "sys_depart", dictCode: 'id', dictText: 'depart_name',},
phone: {title: '专家电话',order: 4,view: 'text', type: 'string',},
emil: {title: '专家邮箱',order: 5,view: 'text', type: 'string',},
}
},
};

@ -0,0 +1,277 @@
<template>
<div class="p-2">
<!--查询区域-->
<div class="jeecg-basic-table-form-container">
<a-form ref="formRef" @keyup.enter.native="reload" :model="queryParam" :label-col="labelCol" :wrapper-col="wrapperCol">
<a-row :gutter="24">
<a-col :lg="6">
<a-form-item name="proname">
<template #label><span title="项目名称">项目名称</span></template>
<a-input placeholder="请输入项目名称" v-model:value="queryParam.proname" allow-clear ></a-input>
</a-form-item>
</a-col>
<a-col :lg="6">
<a-form-item name="exptype">
<template #label><span title="专家类型">专家类型</span></template>
<j-search-select placeholder="请选择专家类型" v-model:value="queryParam.exptype" dict="discipline_fieid,name,id" allow-clear />
</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="reload">查询</a-button>
<a-button preIcon="ant-design:reload-outlined" @click="searchReset" 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'" />
</a>
</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>
<j-upload-button type="primary" v-auth="'expproject:expproject:importExcel'" 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"></Icon>
删除
</a-menu-item>
</a-menu>
</template>
<a-button >批量操作
<Icon icon="mdi:chevron-down"></Icon>
</a-button>
</a-dropdown>
<!-- 高级查询 -->
<super-query :config="superQueryConfig" @search="handleSuperQuery" />
</template>
<!--操作栏-->
<template #action="{ record }">
<TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)"/>
</template>
<!--字段回显插槽-->
<template v-slot:bodyCell="{ column, record, index, text }">
<template v-if="column.dataIndex==='profile'">
<!--文件字段回显插槽-->
<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>
</template>
</BasicTable>
<!-- 表单区域 -->
<ExpprojectModal @register="registerModal" @success="handleSuccess"></ExpprojectModal>
</div>
</template>
<script lang="ts" name="expproject-expproject" setup>
import {ref, reactive, computed, unref} from 'vue';
import {BasicTable, useTable, TableAction} from '/@/components/Table';
import { useListPage } from '/@/hooks/system/useListPage'
import {useModal} from '/@/components/Modal';
import ExpprojectModal from './components/ExpprojectModal.vue'
import {columns, superQuerySchema} from './Expproject.data';
import {list, deleteOne, batchDelete, getImportUrl,getExportUrl,createexpawait} from './Expproject.api';
import {downloadFile} from '/@/utils/common/renderUtils';
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
import JSelectMultiple from '/@/components/Form/src/jeecg/components/JSelectMultiple.vue';
import JSearchSelect from '/@/components/Form/src/jeecg/components/JSearchSelect.vue';
import { useUserStore } from '/@/store/modules/user';
const formRef = ref();
const queryParam = reactive<any>({});
const checkedKeys = ref<Array<string | number>>([]);
//model
const [registerModal, {openModal}] = useModal();
const userStore = useUserStore();
//table
const { prefixCls,tableContext,onExportXls,onImportXls } = useListPage({
tableProps:{
title: '专家项目表',
api: list,
columns,
canResize:false,
useSearchForm: false,
actionColumn: {
width: 120,
fixed:'right'
},
beforeFetch: async (params) => {
return Object.assign(params, queryParam);
},
},
exportConfig: {
name:"专家项目表",
url: getExportUrl,
params: queryParam,
},
importConfig: {
url: getImportUrl,
success: handleSuccess
},
})
const [registerTable, {reload},{ rowSelection, selectedRowKeys }] = tableContext
//
const superQueryConfig = reactive(superQuerySchema);
/**
* 高级查询事件
*/
function handleSuperQuery(params) {
Object.keys(params).map((k) => {
queryParam[k] = params[k];
});
reload();
}
/**
* 新增事件
*/
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 createexp(record) {
await createexpawait({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),
}
]
}
/**
* 下拉操作栏
*/
function getDropDownAction(record){
return [
{
label: '详情',
onClick: handleDetail.bind(null, record),
}, {
label: '删除',
popConfirm: {
title: '是否确认删除',
confirm: handleDelete.bind(null, record),
placement: 'topLeft'
},
}, {
label: '生成专家',
popConfirm: {
title: '是否随机生成专家',
confirm: createexp.bind(null, record),
placement: 'topLeft'
},
}
]
}
/* ----------------------以下为原生查询需要添加的-------------------------- */
const toggleSearchStatus = ref<boolean>(false);
const labelCol = reactive({
xs:24,
sm:4,
xl:6,
xxl:4
});
const wrapperCol = reactive({
xs: 24,
sm: 20,
});
/**
* 重置
*/
function searchReset() {
formRef.value.resetFields();
selectedRowKeys.value = [];
//
reload();
}
</script>
<style lang="less" scoped>
.jeecg-basic-table-form-container {
padding: 0;
.table-page-search-submitButtons {
display: block;
margin-bottom: 24px;
white-space: nowrap;
}
.query-group-cust{
min-width: 100px !important;
}
.query-group-split-cust{
width: 30px;
display: inline-block;
text-align: center
}
.ant-form-item:not(.ant-form-item-with-help){
margin-bottom: 16px;
height: 32px;
}
:deep(.ant-picker),:deep(.ant-input-number){
width: 100%;
}
}
</style>

@ -0,0 +1,26 @@
-- 注意该页面对应的前台目录为views/expproject文件夹下
-- 如果你想更改到其他目录请修改sql中component字段对应的值
INSERT INTO sys_permission(id, parent_id, name, url, component, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_route, is_leaf, keep_alive, hidden, hide_tab, description, status, del_flag, rule_flag, create_by, create_time, update_by, update_time, internal_or_external)
VALUES ('202410230508460320', NULL, '专家项目表', '/expproject/expprojectList', 'expproject/ExpprojectList', NULL, NULL, 0, NULL, '1', 0.00, 0, NULL, 1, 0, 0, 0, 0, NULL, '1', 0, 0, 'admin', '2024-10-23 17:08:32', NULL, NULL, 0);
-- 权限控制sql
-- 新增
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('202410230508460321', '202410230508460320', '添加专家项目表', NULL, NULL, 0, NULL, NULL, 2, 'expproject:expproject:add', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2024-10-23 17:08:32', NULL, NULL, 0, 0, '1', 0);
-- 编辑
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('202410230508460322', '202410230508460320', '编辑专家项目表', NULL, NULL, 0, NULL, NULL, 2, 'expproject:expproject:edit', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2024-10-23 17:08:32', NULL, NULL, 0, 0, '1', 0);
-- 删除
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('202410230508460323', '202410230508460320', '删除专家项目表', NULL, NULL, 0, NULL, NULL, 2, 'expproject:expproject:delete', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2024-10-23 17:08:32', NULL, NULL, 0, 0, '1', 0);
-- 批量删除
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('202410230508460324', '202410230508460320', '批量删除专家项目表', NULL, NULL, 0, NULL, NULL, 2, 'expproject:expproject:deleteBatch', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2024-10-23 17:08:32', NULL, NULL, 0, 0, '1', 0);
-- 导出excel
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('202410230508460325', '202410230508460320', '导出excel_专家项目表', NULL, NULL, 0, NULL, NULL, 2, 'expproject:expproject:exportXls', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2024-10-23 17:08:32', NULL, NULL, 0, 0, '1', 0);
-- 导入excel
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('202410230508460326', '202410230508460320', '导入excel_专家项目表', NULL, NULL, 0, NULL, NULL, 2, 'expproject:expproject:importExcel', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2024-10-23 17:08:32', NULL, NULL, 0, 0, '1', 0);

@ -0,0 +1,227 @@
<template>
<a-spin :spinning="loading">
<JFormContainer :disabled="disabled">
<template #detail>
<a-form v-bind="formItemLayout" name="ExpprojectForm" ref="formRef">
<a-row>
<a-col :span="24">
<a-form-item label="项目名称" v-bind="validateInfos.proname" id="ExpprojectForm-proname" name="proname">
<a-input v-model:value="formData.proname" placeholder="请输入项目名称" allow-clear ></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="专家类型" v-bind="validateInfos.exptype" id="ExpprojectForm-exptype" name="exptype">
<j-search-select v-model:value="formData.exptype" dict="discipline_fieid,name,id" allow-clear />
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="需要专家个数" v-bind="validateInfos.needexp" id="ExpprojectForm-needexp" name="needexp">
<a-input-number v-model:value="formData.needexp" placeholder="请输入需要专家个数" style="width: 100%" />
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="简介" v-bind="validateInfos.proinfo" id="ExpprojectForm-proinfo" name="proinfo">
<a-textarea v-model:value="formData.proinfo" :rows="4" placeholder="请输入简介" />
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="附件" v-bind="validateInfos.profile" id="ExpprojectForm-profile" name="profile">
<j-upload v-model:value="formData.profile" ></j-upload>
</a-form-item>
</a-col>
</a-row>
</a-form>
</template>
</JFormContainer>
<!-- 子表单区域 -->
<a-tabs v-model:activeKey="activeKey" animated>
<a-tab-pane tab="评审专家" key="expandpro" :forceRender="true">
<j-vxe-table
:keep-source="true"
resizable
ref="expandproTableRef"
:loading="expandproTable.loading"
:columns="expandproTable.columns"
:dataSource="expandproTable.dataSource"
:height="340"
:disabled="disabled"
:rowNumber="true"
:rowSelection="true"
:toolbar="true"/>
</a-tab-pane>
</a-tabs>
</a-spin>
</template>
<script lang="ts">
import { defineComponent, ref, reactive, computed, toRaw, onMounted } from 'vue';
import { defHttp } from '/@/utils/http/axios';
import { useValidateAntFormAndTable } from '/@/hooks/system/useJvxeMethods';
import { queryExpandproListByMainId, queryDataById, saveOrUpdate } from '../Expproject.api';
import { JVxeTable } from '/@/components/jeecg/JVxeTable';
import {expandproColumns} from '../Expproject.data';
import JSearchSelect from '/@/components/Form/src/jeecg/components/JSearchSelect.vue';
import JUpload from '/@/components/Form/src/jeecg/components/JUpload/JUpload.vue';
import JFormContainer from '/@/components/Form/src/container/JFormContainer.vue';
import { Form } from 'ant-design-vue';
const useForm = Form.useForm;
export default defineComponent({
name: "ExpprojectForm",
components:{
JSearchSelect,
JUpload,
JVxeTable,
JFormContainer,
},
props:{
formDisabled:{
type: Boolean,
default: false
},
formData: { type: Object, default: ()=>{} },
formBpm: { type: Boolean, default: true }
},
emits:['success'],
setup(props, {emit}) {
const loading = ref(false);
const formRef = ref();
const expandproTableRef = ref();
const expandproTable = reactive<Record<string, any>>({
loading: false,
columns: expandproColumns,
dataSource: []
});
const activeKey = ref('expandpro');
const formData = reactive<Record<string, any>>({
id: '',
proname: '',
exptype: '',
needexp: 0,
proinfo: '',
profile: '',
});
//
const validatorRules = reactive({
needexp: [{ required: false}, { pattern: /^-?\d+$/, message: '请输入整数!'},],
});
const {resetFields, validate, validateInfos} = useForm(formData, validatorRules, {immediate: false});
const dbData = {};
const formItemLayout = {
labelCol: {xs: {span: 24}, sm: {span: 5}},
wrapperCol: {xs: {span: 24}, sm: {span: 16}},
};
//
const disabled = computed(()=>{
if(props.formBpm === true){
if(props.formData.disabled === false){
return false;
}else{
return true;
}
}
return props.formDisabled;
});
function add() {
resetFields();
expandproTable.dataSource = [];
}
async function edit(row) {
//
await queryMainData(row.id);
//
const expandproDataList = await queryExpandproListByMainId(row['id']);
expandproTable.dataSource = [...expandproDataList];
}
async function queryMainData(id) {
const row = await queryDataById(id);
resetFields();
const tmpData = {};
Object.keys(formData).forEach((key) => {
if(row.hasOwnProperty(key)){
tmpData[key] = row[key]
}
})
//
Object.assign(formData,tmpData);
}
const {getSubFormAndTableData, transformData} = useValidateAntFormAndTable(activeKey, {
'expandpro': expandproTableRef,
});
async function getFormData() {
try {
//
await validate();
} catch ({ errorFields }) {
if (errorFields) {
const firstField = errorFields[0];
if (firstField) {
formRef.value.scrollToField(firstField.name, { behavior: 'smooth', block: 'center' });
}
}
return Promise.reject(errorFields);
}
return transformData(toRaw(formData))
}
async function submitForm() {
const mainData = await getFormData();
const subData = await getSubFormAndTableData();
const values = Object.assign({}, dbData, mainData, subData);
console.log('表单提交数据', values)
const isUpdate = values.id ? true : false
await saveOrUpdate(values, isUpdate);
//
emit('success');
}
function setFieldsValue(values) {
if(values){
Object.keys(values).map(k=>{
formData[k] = values[k];
});
}
}
/**
* 值改变事件触发-树控件回调
* @param key
* @param value
*/
function handleFormChange(key, value) {
formData[key] = value;
}
return {
expandproTableRef,
expandproTable,
validatorRules,
validateInfos,
activeKey,
loading,
formData,
setFieldsValue,
handleFormChange,
formItemLayout,
disabled,
getFormData,
submitForm,
add,
edit,
formRef,
}
}
});
</script>
<style lang="less" scoped></style>

@ -0,0 +1,67 @@
<template>
<BasicModal v-bind="$attrs" @register="registerModal" :title="title" :width="800" @ok="handleSubmit">
<expproject-form ref="formComponent" :formDisabled="formDisabled" :formBpm="false" @success="submitSuccess"></expproject-form>
</BasicModal>
</template>
<script lang="ts">
import { ref, unref } from 'vue';
import { BasicModal, useModalInner } from '/@/components/Modal';
import ExpprojectForm from './ExpprojectForm.vue';
export default {
name: "TestCgMainVxeModal",
components:{
BasicModal,
ExpprojectForm
},
emits:['register','success'],
setup(_p, {emit}){
const formComponent = ref()
const isUpdate = ref(true);
const formDisabled = ref(false);
const title = ref('')
//
const [registerModal, {setModalProps, closeModal}] = useModalInner(async (data) => {
setModalProps({confirmLoading: false,showCancelBtn:data?.showFooter,showOkBtn:data?.showFooter});
isUpdate.value = !!data?.isUpdate;
formDisabled.value = !data?.showFooter;
title.value = data?.isUpdate ? (unref(formDisabled) ? '详情' : '编辑') : '新增';
if (unref(isUpdate)) {
formComponent.value.edit(data.record)
}else{
formComponent.value.add()
}
});
function handleSubmit() {
formComponent.value.submitForm();
}
function submitSuccess(){
emit('success');
closeModal();
}
return {
registerModal,
title,
formComponent,
formDisabled,
handleSubmit,
submitSuccess
}
}
}
</script>
<style lang="less" scoped>
/** 时间和数字输入框样式 */
:deep(.ant-input-number) {
width: 100%;
}
:deep(.ant-calendar-picker) {
width: 100%;
}
</style>

@ -100,6 +100,7 @@
-->
<a class="aui-linek-code aui-flex-box" @click="registerRef4farenHandleClick">{{ t('sys.login.registerButton4faren') }}</a>
<a class="aui-linek-code aui-flex-box" @click="registerRef4shenbaorenHandleClick">{{ t('sys.login.registerButton4shenbaoren') }}</a>
<a class="aui-linek-code aui-flex-box" @click="registerRef4expleClick">{{ t('sys.login.registerButtonexp') }}</a>
</div>
</div>
</div>
@ -149,6 +150,10 @@
<div v-show="type === 'registerRef4faren'" :class="`${prefixCls}-form`">
<MiniRegister4faren ref="registerRef4faren" @go-back="goBack" @success="handleSuccess" />
</div>
<div v-show="type === 'registerRef4exp'" :class="`${prefixCls}-form`">
<MiniRegisterexp ref="registerRef4exp" @go-back="goBack" @success="handleSuccess" />
</div>
<div v-show="type === 'codeLogin'" :class="`${prefixCls}-form`">
<MiniCodelogin ref="codeRef" @go-back="goBack" @success="handleSuccess" />
</div>
@ -184,6 +189,7 @@
import { ExceptionEnum } from "@/enums/exceptionEnum";
import MiniRegister4shenbaoren from "@/views/system/loginmini/MiniRegister4shenbaoren.vue";
import MiniRegister4faren from "@/views/system/loginmini/MiniRegister4faren.vue";
import MiniRegisterexp from "@/views/system/loginmini/MiniRegisterexp.vue";
const IconFont = createFromIconfontCN({
scriptUrl: '//at.alicdn.com/t/font_2316098_umqusozousr.js',
@ -228,6 +234,7 @@
//
const forgotRef = ref();
//
const registerRef4exp = ref();
const registerRef = ref();
const registerRef4shenbaoren = ref();
const registerRef4faren = ref();
@ -450,6 +457,16 @@
}, 300);
}
/**
* 专家注册
*/
function registerRef4expleClick() {
type.value = 'registerRef4exp';
setTimeout(() => {
registerRef4exp.value.initForm();
}, 300);
}
/**
* 注册
*/

@ -0,0 +1,353 @@
<template>
<div class="aui-content">
<div class="aui-container">
<div class="aui-form">
<div class="aui-image">
<div class="aui-image-text">
<img :src="jeecgAdTextImg" alt="" />
</div>
</div>
<div class="aui-formBox">
<div class="aui-formWell">
<a-form ref="formRef" :model="formData">
<div class="aui-flex aui-form-nav aui-clear-left" style="padding-bottom: 21px">
<div class="aui-flex-box activeNav on">{{t('sys.login.registerButtonexp')}}</div>
</div>
<div class="aui-form-box">
<div class="aui-account aui-account-line">
<a-form-item>
<div class="aui-input-line">
<Icon class="aui-icon" icon="ant-design:user-outlined" />
<a-input class="fix-auto-fill" type="text" :placeholder="t('用户名')" v-model:value="formData.seusername" />
</div>
</a-form-item>
<a-form-item>
<div class="aui-input-line">
<Icon class="aui-icon" icon="ant-design:lock-outlined" />
<a-input
class="fix-auto-fill"
:type="pwdIndex === 'close' ? 'password' : 'text'"
:placeholder="t('sys.login.passwordPlaceholder')"
v-model:value="formData.psd"
/>
<div class="aui-eye">
<img :src="eyeKImg" alt="开启" v-if="pwdIndex === 'open'" @click="pwdClick('close')" />
<img :src="eyeGImg" alt="关闭" v-else-if="pwdIndex === 'close'" @click="pwdClick('open')" />
</div>
</div>
</a-form-item>
<a-form-item>
<div class="aui-input-line">
<Icon class="aui-icon" icon="ant-design:lock-outlined" />
<a-input
class="fix-auto-fill"
:type="confirmPwdIndex === 'close' ? 'password' : 'text'"
:placeholder="t('sys.login.confirmPassword')"
v-model:value="formData.sepsd"
/>
<div class="aui-eye">
<img :src="eyeKImg" alt="开启" v-if="confirmPwdIndex === 'open'" @click="confirmPwdClick('close')" />
<img :src="eyeGImg" alt="关闭" v-else-if="confirmPwdIndex === 'close'" @click="confirmPwdClick('open')" />
</div>
</div>
</a-form-item>
<a-form-item>
<div class="aui-input-line">
<Icon class="aui-icon" icon="ant-design:user-outlined" />
<a-input class="fix-auto-fill" type="text" :placeholder="t('真实姓名')" v-model:value="formData.realname" />
</div>
</a-form-item>
<a-form-item>
<div class="aui-input-line">
<Icon class="aui-icon" icon="ant-design:mobile-outlined" />
<a-input class="fix-auto-fill" type="text" :placeholder="t('工号')" v-model:value="formData.workon" />
</div>
</a-form-item>
<a-form-item>
<div class="aui-input-line">
<JSelectDept :placeholder="t('sys.login.selectorgPlaceholder')" v-model:value="formData.ssdep" :multiple="false" />
</div>
</a-form-item>
<a-form-item>
<div class="aui-input-line">
<Icon class="aui-icon" icon="ant-design:user-outlined"/>
<a-input class="fix-auto-fill" type="text" :placeholder="t('电话')" v-model:value="formData.phone" />
</div>
</a-form-item>
<a-form-item>
<div class="aui-input-line">
<Icon class="aui-icon" icon="ant-design:mobile-outlined" />
<a-input class="fix-auto-fill" type="text" :placeholder="t('邮箱')" v-model:value="formData.emails" />
</div>
</a-form-item>
<div class="aui-inputClear">
<i class="icon icon-code"></i>
<a-form-item>
<a-input class="fix-auto-fill" type="text" :placeholder="t('sys.login.smsPlaceholder')" v-model:value="formData.smscode" />
</a-form-item>
<div class="aui-code">
<img v-if="randCodeData.requestCodeSuccess" :src="randCodeData.randCodeImage" @click="handleChangeCheckCode" />
<img v-else style="margin-top: 2px; max-width: initial" :src="codeImg" @click="handleChangeCheckCode" />
</div>
</div>
</div>
</div>
<div class="aui-formButton">
<div class="aui-flex">
<a class="aui-link-login aui-flex-box" @click="registerHandleClick"> {{ t('sys.login.registerButton') }}</a>
</div>
<div class="aui-flex">
<a class="aui-linek-code aui-flex-box" @click="goBackHandleClick">{{ t('sys.login.backSignIn') }}</a>
</div>
</div>
</a-form>
</div>
</div>
</div>
</div>
</div>
</template>
<script lang="ts" setup name="mini-register">
import { ref, reactive, unref, toRaw,onMounted } from 'vue';
import { getCaptcha, registerFaren, getCodeInfo } from '/@/api/sys/user';
import { SmsEnum } from '/@/views/sys/login/useLogin';
import { useMessage } from '/@/hooks/web/useMessage';
import logoImg from '/@/assets/loginmini/icon/jeecg_logo.png';
import jeecgAdTextImg from '/@/assets/loginmini/icon/jeecg_ad_text.png';
import eyeKImg from '/@/assets/loginmini/icon/icon-eye-k.png';
import eyeGImg from '/@/assets/loginmini/icon/icon-eye-g.png';
import JSelectDept from '/@/components/Form/src/jeecg/components/JSelectDept.vue';
import { useI18n } from '/@/hooks/web/useI18n';
import codeImg from '/@/assets/images/checkcode.png';
const { t } = useI18n();
const { notification, createErrorModal, createMessage } = useMessage();
const emit = defineEmits(['go-back', 'success', 'register']);
const formRef = ref();
const formData = reactive<any>({
id: '',
seusername: '',
psd: '',
sepsd: '',
realname: '',
workon: '',
sex: '',
ssdep: '',
topPic: '',
phone: '',
emails: '',
colleges: '',
major: '',
directioncal: '',
research: '',
educationcal: '',
expinfo: '',
compopen: '',
adminopen: '',
});
//
//
const showInterval = ref<boolean>(true);
//60s
const timeRuning = ref<number>(60);
//
const timer = ref<any>(null);
//
const pwdIndex = ref<string>('close');
//
const confirmPwdIndex = ref<string>('close');
/**
* 返回
*/
function goBackHandleClick() {
emit('go-back');
initForm();
}
//
const randCodeData = reactive<any>({
randCodeImage: '',
requestCodeSuccess: false,
checkKey: null,
});
function handleChangeCheckCode() {
formData.inputCode = '';
randCodeData.checkKey = 1629428467008;
getCodeInfo(randCodeData.checkKey).then((res) => {
randCodeData.randCodeImage = res;
randCodeData.requestCodeSuccess = true;
});
}
/**
* 获取手机验证码
*/
async function getLoginCode() {
if (!formData.mobile) {
createMessage.warn(t('sys.login.mobilePlaceholder'));
return;
}
const result = await getCaptcha({ mobile: formData.mobile, smsmode: SmsEnum.REGISTER });
if (result) {
const TIME_COUNT = 60;
if (!unref(timer)) {
timeRuning.value = TIME_COUNT;
showInterval.value = false;
timer.value = setInterval(() => {
if (unref(timeRuning) > 0 && unref(timeRuning) <= TIME_COUNT) {
timeRuning.value = timeRuning.value - 1;
} else {
showInterval.value = true;
clearInterval(unref(timer));
timer.value = null;
}
}, 1000);
}
}
}
function registerHandleClick() {
if (!formData.seusername) {
createMessage.warn(t('请输入用户名'));
return;
}
if (!formData.realname) {
createMessage.warn(t('请输入真实姓名'));
return;
}
if (!formData.workon) {
createMessage.warn(t('请输入工号'));
return;
}
if (!formData.sex) {
createMessage.warn(t('请输入性别'));
return;
}
if (!formData.ssdep) {
createMessage.warn(t('sys.login.selectorgPlaceholder'));
return;
}
if (!formData.phone) {
createMessage.warn(t('请输入电话'));
return;
}
if (!formData.emails) {
createMessage.warn(t('请输入邮箱'));
return;
}
if (!formData.password) {
createMessage.warn(t('sys.login.passwordPlaceholder'));
return;
}
registerAccount();
}
/**
* 注册账号
*/
async function registerAccount() {
try {
const resultInfo = await registerFaren(
toRaw({
// workno: formData.workno,
username: formData.username,
departmentid: formData.department,
realname: formData.realname,
password: formData.password,
phone: formData.mobile,
smscode: formData.smscode,
checkKey: randCodeData.checkKey,
idNo: formData.idNo,
certificateCode: formData.certificateCode,
orgName: formData.orgName,
})
);
if (resultInfo && resultInfo.data.success) {
notification.success({
description: resultInfo.data.message || t('sys.api.registerMsg'),
duration: 3,
});
emit('success', { username: formData.username, password: formData.password });
initForm();
} else {
notification.warning({
message: t('sys.api.errorTip'),
description: resultInfo.data.message || t('sys.api.networkExceptionMsg'),
duration: 3,
});
}
} catch (error) {
notification.error({
message: t('sys.api.errorTip'),
description: error.message || t('sys.api.networkExceptionMsg'),
duration: 3,
});
}
}
/**
* 初始化表单
*/
function initForm() {
Object.assign(formData, { workno: '', username: '', mobile: '', realname: '', department: '', smscode: '', password: '',
confirmPassword: '',
idNo: '',
certificateCode: '',
orgName: '',
});
if (!unref(timer)) {
showInterval.value = true;
clearInterval(unref(timer));
timer.value = null;
}
formRef.value.resetFields();
}
/**
* 密码打开或关闭
* @param value
*/
function pwdClick(value) {
pwdIndex.value = value;
}
/**
* 确认密码打开或关闭
* @param value
*/
function confirmPwdClick(value) {
confirmPwdIndex.value = value;
}
onMounted(() => {
//
handleChangeCheckCode();
});
defineExpose({
initForm,
});
</script>
<style lang="less" scoped>
@import '/@/assets/loginmini/style/home.less';
@import '/@/assets/loginmini/style/base.less';
.aui-input-line .aui-icon {
position: absolute;
z-index: 2;
top: 10px;
left: 10px;
font-size: 20px !important;
}
</style>

@ -169,7 +169,7 @@ export const formSchema: FormSchema[] = [
dynamicRules: ({ values }) => rules.confirmPassword(values, true),
},
{
label: '用户姓名',
label: '用户姓名121',
field: 'realname',
required: true,
component: 'Input',

Loading…
Cancel
Save