修改bug

This commit is contained in:
yangjun 2024-10-10 13:44:54 +08:00
parent f1a49c5ea7
commit 951d8d318d
21 changed files with 2208 additions and 5 deletions

View File

@ -20,6 +20,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.system.base.controller.JeecgController;
import org.jeecg.modules.demo.lwKhclXz.entity.LwKhclXz;
import org.jeecg.modules.demo.zjSqxx.entity.ZjSqxx;
import org.jeecg.modules.demo.zjSqxx.service.IZjSqxxService;
import org.jeecgframework.poi.excel.ExcelExportUtil;
@ -393,4 +394,20 @@ public class LwKhclController extends JeecgController<LwKhcl, ILwKhclService> {
}
@ApiOperation(value="lw_khcl-分页列表查询", notes="lw_khcl-分页列表查询")
@GetMapping(value = "/getXkList")
public Result<IPage<LwKhcl>> getXkList(LwKhcl lwKhcl,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
lwKhcl.setCreateBy(sysUser.getUsername());
Page<LwKhcl> page = new Page<LwKhcl>(pageNo, pageSize);
IPage<LwKhcl> pageList = lwKhclService.getXkList(page, lwKhcl);
return Result.OK(pageList);
}
}

View File

@ -1,6 +1,7 @@
package org.jeecg.modules.demo.lwKhcl.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
@ -97,4 +98,17 @@ public class LwKhcl implements Serializable {
@ApiModelProperty(value = "入库日期")
private String createTime;
@ApiModelProperty(value = "终稿查重相似率")
private String ccjgxsl;
@ApiModelProperty(value = "终稿下载路径")
private String ccjgdown;
@ApiModelProperty(value = "知道记录单")
private String zdjld;
@TableField(exist = false)
private String sfxk;
@TableField(exist = false)
private String createBy;
}

View File

@ -3,6 +3,8 @@ package org.jeecg.modules.demo.lwKhcl.mapper;
import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;
import org.jeecg.modules.demo.lwKhcl.entity.LwKhcl;
@ -47,4 +49,5 @@ public interface LwKhclMapper extends BaseMapper<LwKhcl> {
@Param("inSsyxmc")String inSsyxmc,
@Param("inBylwLb")String inBylwLb);
IPage<LwKhcl> getXkList(Page<LwKhcl> page, @Param("lwKhcl") LwKhcl lwKhcl);
}

View File

@ -129,4 +129,35 @@
order by xsxh
</select>
<select id="getXkList" resultType="org.jeecg.modules.demo.lwKhcl.entity.LwKhcl">
select a.*,if(b.id is not null ,1,0) as sfxk from lw_khcl a
LEFT JOIN lw_khcl_xz b on a.id = b.main_id and b.create_by = #{lwKhcl.createBy}
<where>
<if test='lwKhcl.lwzg != null and lwKhcl.lwzg == 1'>
and a.lwzg is not null
</if>
<if test='lwKhcl.lwzg != null and lwKhcl.lwzg == 0'>
and a.lwzg is null
</if>
<if test='lwKhcl.zqjc != null and lwKhcl.zqjc == 1'>
and a.zqjc is not null
</if>
<if test='lwKhcl.zqjc != null and lwKhcl.zqjc == 0'>
and a.zqjc is null
</if>
<if test='lwKhcl.ktbg != null and lwKhcl.ktbg == 1'>
and a.ktbg is not null
</if>
<if test='lwKhcl.ktbg != null and lwKhcl.ktbg == 0'>
and a.ktbg is null
</if>
<if test="lwKhcl.ssxnzymc != null and lwKhcl.ssxnzymc != ''">
and a.ssxnzymc like concat('%',#{lwKhcl.ssxnzymc},'%')
</if>
<if test="lwKhcl.xsxm != null and lwKhcl.xsxm != ''">
and a.xsxm like concat('%',#{lwKhcl.xsxm},'%')
</if>
</where>
</select>
</mapper>

View File

@ -1,5 +1,7 @@
package org.jeecg.modules.demo.lwKhcl.service;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.jeecg.modules.demo.lwKhcl.entity.LwKhcl;
import com.baomidou.mybatisplus.extension.service.IService;
@ -24,4 +26,6 @@ public interface ILwKhclService extends IService<LwKhcl> {
Page<LwKhclXq> getXqPage(Page<LwKhclXq> page, String xsxh, String xsxm, String ssxnzymc, String ktbg, String zqjc, String lwzg, String inBynf, String inSsyxmc, String inBylwLb);
List<LwKhclXq> getXqList(String xsxh, String xsxm, String ssxnzymc, String ktbg, String zqjc, String lwzg, String inBynf, String inSsyxmc, String inBylwLb);
IPage<LwKhcl> getXkList(Page<LwKhcl> page, LwKhcl lwKhcl);
}

View File

@ -1,5 +1,7 @@
package org.jeecg.modules.demo.lwKhcl.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.jeecg.modules.demo.lwKhcl.entity.LwKhcl;
import org.jeecg.modules.demo.lwKhcl.entity.LwKhclCj;
@ -52,4 +54,9 @@ public class LwKhclServiceImpl extends ServiceImpl<LwKhclMapper, LwKhcl> impleme
return baseMapper.getXqPage(null, xsxh ,xsxm, ssxnzymc, ktbg, zqjc, lwzg, inBynf, inSsyxmc, inBylwLb);
}
@Override
public IPage<LwKhcl> getXkList(Page<LwKhcl> page, LwKhcl lwKhcl) {
return baseMapper.getXkList(page,lwKhcl);
}
}

View File

@ -0,0 +1,224 @@
package org.jeecg.modules.demo.lwKhclXz.controller;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.lang.StringUtils;
import org.apache.shiro.SecurityUtils;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.common.system.vo.LoginUser;
import org.jeecg.common.util.oConvertUtils;
import org.jeecg.modules.demo.lwKhclXz.entity.LwKhclXz;
import org.jeecg.modules.demo.lwKhclXz.service.ILwKhclXzService;
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 org.jeecg.modules.demo.xxhbjwxtxsmd.entity.Xxhbjwxtxsmd;
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.base.controller.JeecgController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import org.springframework.web.servlet.ModelAndView;
import com.alibaba.fastjson.JSON;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.apache.shiro.authz.annotation.RequiresPermissions;
/**
* @Description: lw_khcl_xz
* @Author: jeecg-boot
* @Date: 2024-10-09
* @Version: V1.0
*/
@Api(tags="lw_khcl_xz")
@RestController
@RequestMapping("/lwKhclXz/lwKhclXz")
@Slf4j
public class LwKhclXzController extends JeecgController<LwKhclXz, ILwKhclXzService> {
@Autowired
private ILwKhclXzService lwKhclXzService;
/**
* 分页列表查询
*
* @param lwKhclXz
* @param pageNo
* @param pageSize
* @param req
* @return
*/
//@AutoLog(value = "lw_khcl_xz-分页列表查询")
@ApiOperation(value="lw_khcl_xz-分页列表查询", notes="lw_khcl_xz-分页列表查询")
@GetMapping(value = "/list")
public Result<IPage<LwKhclXz>> queryPageList(LwKhclXz lwKhclXz,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
String ktbg = lwKhclXz.getKtbg();
String zqjc = lwKhclXz.getZqjc();
String lwzg = lwKhclXz.getLwzg();
lwKhclXz.setKtbg(null);
lwKhclXz.setZqjc(null);
lwKhclXz.setLwzg(null);
QueryWrapper<LwKhclXz> queryWrapper = QueryGenerator.initQueryWrapper(lwKhclXz, req.getParameterMap());
//获取当前用户
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
queryWrapper.eq("create_by",sysUser.getUsername());
if(StringUtils.isNotBlank(ktbg)){
if(StringUtils.equals(ktbg,"1")){
queryWrapper.isNotNull("ktbg");
}else{
queryWrapper.isNull("ktbg");
}
}
if(StringUtils.isNotBlank(zqjc)){
if(StringUtils.equals(zqjc,"1")){
queryWrapper.isNotNull("zqjc");
}else{
queryWrapper.isNull("zqjc");
}
}
if(StringUtils.isNotBlank(lwzg)){
if(StringUtils.equals(lwzg,"1")){
queryWrapper.isNotNull("lwzg");
}else{
queryWrapper.isNull("lwzg");
}
}
Page<LwKhclXz> page = new Page<LwKhclXz>(pageNo, pageSize);
IPage<LwKhclXz> pageList = lwKhclXzService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 添加
*
* @param lwKhclXz
* @return
*/
@AutoLog(value = "lw_khcl_xz-添加")
@ApiOperation(value="lw_khcl_xz-添加", notes="lw_khcl_xz-添加")
@PostMapping(value = "/add")
public Result<String> add(@RequestBody LwKhclXz lwKhclXz) {
lwKhclXz.setCreateTime(new Date());
lwKhclXzService.save(lwKhclXz);
return Result.OK("添加成功!");
}
/**
* 编辑
*
* @param lwKhclXz
* @return
*/
@AutoLog(value = "lw_khcl_xz-编辑")
@ApiOperation(value="lw_khcl_xz-编辑", notes="lw_khcl_xz-编辑")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
public Result<String> edit(@RequestBody LwKhclXz lwKhclXz) {
lwKhclXzService.updateById(lwKhclXz);
return Result.OK("编辑成功!");
}
/**
* 通过id删除
*
* @param id
* @return
*/
@AutoLog(value = "lw_khcl_xz-通过id删除")
@ApiOperation(value="lw_khcl_xz-通过id删除", notes="lw_khcl_xz-通过id删除")
@DeleteMapping(value = "/delete")
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
lwKhclXzService.removeById(id);
return Result.OK("删除成功!");
}
/**
* 批量删除
*
* @param ids
* @return
*/
@AutoLog(value = "lw_khcl_xz-批量删除")
@ApiOperation(value="lw_khcl_xz-批量删除", notes="lw_khcl_xz-批量删除")
@DeleteMapping(value = "/deleteBatch")
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
this.lwKhclXzService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
}
/**
* 通过id查询
*
* @param id
* @return
*/
//@AutoLog(value = "lw_khcl_xz-通过id查询")
@ApiOperation(value="lw_khcl_xz-通过id查询", notes="lw_khcl_xz-通过id查询")
@GetMapping(value = "/queryById")
public Result<LwKhclXz> queryById(@RequestParam(name="id",required=true) String id) {
LwKhclXz lwKhclXz = lwKhclXzService.getById(id);
if(lwKhclXz==null) {
return Result.error("未找到对应数据");
}
return Result.OK(lwKhclXz);
}
/**
* 导出excel
*
* @param request
* @param lwKhclXz
*/
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, LwKhclXz lwKhclXz) {
return super.exportXls(request, lwKhclXz, LwKhclXz.class, "lw_khcl_xz");
}
/**
* 通过excel导入数据
*
* @param request
* @param response
* @return
*/
@RequiresPermissions("lwKhclXz:lw_khcl_xz:importExcel")
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
return super.importExcel(request, response, LwKhclXz.class);
}
@PostMapping(value = "/getLwBatchDown")
public Result<?> getLwBatchDown(@RequestBody LwKhclXz lwKhclXz, HttpServletResponse response) {
lwKhclXz = lwKhclXzService.getLwBatchDown(lwKhclXz,response);
return Result.ok(lwKhclXz);
}
}

View File

@ -0,0 +1,140 @@
package org.jeecg.modules.demo.lwKhclXz.entity;
import java.io.Serializable;
import java.io.UnsupportedEncodingException;
import java.util.Date;
import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.*;
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;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* @Description: lw_khcl_xz
* @Author: jeecg-boot
* @Date: 2024-10-09
* @Version: V1.0
*/
@Data
@TableName("lw_khcl_xz")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="lw_khcl_xz对象", description="lw_khcl_xz")
public class LwKhclXz implements Serializable {
private static final long serialVersionUID = 1L;
/**主键*/
@TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value = "主键")
private java.lang.String id;
/**学生学号*/
@Excel(name = "学生学号", width = 15)
@ApiModelProperty(value = "学生学号")
private java.lang.String xsxh;
/**学生姓名*/
@Excel(name = "学生姓名", width = 15)
@ApiModelProperty(value = "学生姓名")
private java.lang.String xsxm;
/**毕业年份*/
@Excel(name = "毕业年份", width = 15)
@ApiModelProperty(value = "毕业年份")
private java.lang.String bynf;
/**班级*/
@Excel(name = "班级", width = 15)
@ApiModelProperty(value = "班级")
private java.lang.String bj;
/**毕业论文(设计)题目*/
@Excel(name = "毕业论文(设计)题目", width = 15)
@ApiModelProperty(value = "毕业论文(设计)题目")
private java.lang.String bylwTm;
/**毕业论文(设计)类别*/
@Excel(name = "毕业论文(设计)类别", width = 15)
@ApiModelProperty(value = "毕业论文(设计)类别")
private java.lang.String bylwLb;
/**毕业论文(设计)成绩*/
@Excel(name = "毕业论文(设计)成绩", width = 15)
@ApiModelProperty(value = "毕业论文(设计)成绩")
private java.lang.String bylwCj;
/**指导教师姓名*/
@Excel(name = "指导教师姓名", width = 15)
@ApiModelProperty(value = "指导教师姓名")
private java.lang.String zdjsxm;
/**指导教师职称*/
@Excel(name = "指导教师职称", width = 15)
@ApiModelProperty(value = "指导教师职称")
private java.lang.String zdjszc;
/**所属院系名称*/
@Excel(name = "所属院系名称", width = 15)
@ApiModelProperty(value = "所属院系名称")
private java.lang.String ssyxmc;
/**所属校内专业(大类)名称*/
@Excel(name = "所属校内专业(大类)名称", width = 15)
@ApiModelProperty(value = "所属校内专业(大类)名称")
private java.lang.String ssxnzymc;
/**是否实现电子化管理*/
@Excel(name = "是否实现电子化管理", width = 15)
@ApiModelProperty(value = "是否实现电子化管理")
private java.lang.String sfsxdzhgl;
/**关键词*/
@Excel(name = "关键词", width = 15)
@ApiModelProperty(value = "关键词")
private java.lang.String gjc;
/**查重结果*/
@Excel(name = "查重结果", width = 15)
@ApiModelProperty(value = "查重结果")
private java.lang.String ccjg;
/**开题报告*/
@Excel(name = "开题报告", width = 15)
@ApiModelProperty(value = "开题报告")
private java.lang.String ktbg;
/**开题报告审核意见*/
@Excel(name = "开题报告审核意见", width = 15)
@ApiModelProperty(value = "开题报告审核意见")
private java.lang.String ktbgshyj;
/**中期检查*/
@Excel(name = "中期检查", width = 15)
@ApiModelProperty(value = "中期检查")
private java.lang.String zqjc;
/**论文终稿*/
@Excel(name = "论文终稿", width = 15)
@ApiModelProperty(value = "论文终稿")
private java.lang.String lwzg;
/**论文终稿PDF*/
@Excel(name = "论文终稿PDF", width = 15)
@ApiModelProperty(value = "论文终稿PDF")
private java.lang.String lwzgPdf;
/**检测报告等材料*/
@Excel(name = "检测报告等材料", width = 15)
@ApiModelProperty(value = "检测报告等材料")
private java.lang.String jcbgdcl;
/**入库日期*/
@ApiModelProperty(value = "入库日期")
private Date createTime;
/**论文考核材料id*/
@Excel(name = "论文考核材料id", width = 15)
@ApiModelProperty(value = "论文考核材料id")
private java.lang.String mainId;
@ApiModelProperty(value = "终稿查重相似率")
private String ccjgxsl;
@ApiModelProperty(value = "终稿下载路径")
private String ccjgdown;
@ApiModelProperty(value = "知道记录单")
private String zdjld;
private String createBy;
private String updateBy;
private Date updateTime;
@TableField(exist = false)
private String downLoadPath;
@TableField(exist = false)
private String downName;
}

View File

@ -0,0 +1,17 @@
package org.jeecg.modules.demo.lwKhclXz.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.jeecg.modules.demo.lwKhclXz.entity.LwKhclXz;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @Description: lw_khcl_xz
* @Author: jeecg-boot
* @Date: 2024-10-09
* @Version: V1.0
*/
public interface LwKhclXzMapper extends BaseMapper<LwKhclXz> {
}

View File

@ -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.lwKhclXz.mapper.LwKhclXzMapper">
</mapper>

View File

@ -0,0 +1,17 @@
package org.jeecg.modules.demo.lwKhclXz.service;
import org.jeecg.modules.demo.lwKhclXz.entity.LwKhclXz;
import com.baomidou.mybatisplus.extension.service.IService;
import javax.servlet.http.HttpServletResponse;
/**
* @Description: lw_khcl_xz
* @Author: jeecg-boot
* @Date: 2024-10-09
* @Version: V1.0
*/
public interface ILwKhclXzService extends IService<LwKhclXz> {
LwKhclXz getLwBatchDown(LwKhclXz lwKhclXz, HttpServletResponse response);
}

View File

@ -0,0 +1,254 @@
package org.jeecg.modules.demo.lwKhclXz.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.commons.lang.StringUtils;
import org.jeecg.common.util.DateUtils;
import org.jeecg.modules.demo.lwKhclXz.entity.LwKhclXz;
import org.jeecg.modules.demo.lwKhclXz.mapper.LwKhclXzMapper;
import org.jeecg.modules.demo.lwKhclXz.service.ILwKhclXzService;
import org.jeecg.modules.demo.xxhbjwxtxsmd.entity.Xxhbjwxtxsmd;
import org.jeecg.modules.utils.SFTPUtil;
import org.jeecg.modules.utils.SftpConfig;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import javax.servlet.http.HttpServletResponse;
import java.io.*;
import java.net.HttpURLConnection;
import java.net.URLConnection;
import java.util.Map;
import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream;
import java.io.BufferedInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import javax.net.ssl.HttpsURLConnection;
/**
* @Description: lw_khcl_xz
* @Author: jeecg-boot
* @Date: 2024-10-09
* @Version: V1.0
*/
@Service
public class LwKhclXzServiceImpl extends ServiceImpl<LwKhclXzMapper, LwKhclXz> implements ILwKhclXzService {
@Value(value = "${jeecg.path.webapp}")
private String downloadpath;
@Autowired
SftpConfig sftpConfig;
@Override
public LwKhclXz getLwBatchDown(LwKhclXz lwKhclXz, HttpServletResponse response) {
String downPath[] = new String[6];
LwKhclXz lwKhclXzInfo = baseMapper.selectById(lwKhclXz.getId());
// 其余处理略
InputStream inputStream = null;
OutputStream outputStream = null;
try{
String ktbg = lwKhclXzInfo.getKtbg();
String ktbgshyj = lwKhclXzInfo.getKtbgshyj();
String zqjc = lwKhclXzInfo.getZqjc();
String lwzg = lwKhclXzInfo.getLwzg();
String zdjld = lwKhclXzInfo.getZdjld();
String ccjgdown = lwKhclXzInfo.getCcjgdown();
// downPath[0] =ktbg;
// downPath[1] =ktbgshyj;
// downPath[2] =zqjc;
// downPath[3] =lwzg;
// downPath[4] =zdjld;
// downPath[5] =ccjgdown;
if(StringUtils.isNotBlank(ktbg)){
String imgPath = ktbg;
int index = imgPath.lastIndexOf("/");
String path = "temp";
if(index != -1){
path = imgPath.substring(0,index);
}
Map<String,String> map = SFTPUtil.download(sftpConfig,imgPath,getDownloadPath(path));
String localFilePath = map.get("fileName");
System.out.println(localFilePath);
downPath[0] =localFilePath.replace("/opt/webapp/","");
}
if(StringUtils.isNotBlank(ktbgshyj)){
String imgPath = ktbgshyj;
int index = imgPath.lastIndexOf("/");
String path = "temp";
if(index != -1){
path = imgPath.substring(0,index);
}
Map<String,String> map = SFTPUtil.download(sftpConfig,imgPath,getDownloadPath(path));
String localFilePath = map.get("fileName");
downPath[1] =localFilePath.replace("/opt/webapp/","");
}
if(StringUtils.isNotBlank(zqjc)){
String imgPath = zqjc;
int index = imgPath.lastIndexOf("/");
String path = "temp";
if(index != -1){
path = imgPath.substring(0,index);
}
Map<String,String> map = SFTPUtil.download(sftpConfig,imgPath,getDownloadPath(path));
String localFilePath = map.get("fileName");
downPath[2] =localFilePath.replace("/opt/webapp/","");
}
if(StringUtils.isNotBlank(lwzg)){
String imgPath = lwzg;
int index = imgPath.lastIndexOf("/");
String path = "temp";
if(index != -1){
path = imgPath.substring(0,index);
}
Map<String,String> map = SFTPUtil.download(sftpConfig,imgPath,getDownloadPath(path));
String localFilePath = map.get("fileName");
downPath[3] =localFilePath.replace("/opt/webapp/","");
}
if(StringUtils.isNotBlank(zdjld)){
String imgPath = zdjld;
int index = imgPath.lastIndexOf("/");
String path = "temp";
if(index != -1){
path = imgPath.substring(0,index);
}
Map<String,String> map = SFTPUtil.download(sftpConfig,imgPath,getDownloadPath(path));
String localFilePath = map.get("fileName");
downPath[4] =localFilePath.replace("/opt/webapp/","");
}
if(StringUtils.isNotBlank(ccjgdown)){
String savePath = downloadpath+"/bylw/"+lwKhclXzInfo.getXsxm()+ DateUtils.getCurrentTimestamp()+ "论文材料.zip";
downloadWangluoFile(ccjgdown,savePath);
downPath[5] =savePath.replace("/opt/webapp/","");
}
}catch (Exception e){
}finally {
SFTPUtil.disChannel();
SFTPUtil.disSession();
}
if (inputStream != null) {
try {
inputStream.close();
} catch (IOException e) {
log.error(e.getMessage(), e);
}
}
if (outputStream != null) {
try {
outputStream.close();
} catch (IOException e) {
log.error(e.getMessage(), e);
}
}
String files[] = new String[downPath.length];
String name = "/"+lwKhclXz.getDownName()+".zip";
String zipFileName = downloadpath+name;
for(int i=0;i<downPath.length;i++) {
String imgPath = downPath[i];
if(StringUtils.isNotBlank(imgPath)){
String downImgPath = downloadpath + imgPath;
files[i] = downImgPath;
}
}
try {
zipFiles(zipFileName, files);
System.out.println("Files zipped successfully!");
} catch (IOException e) {
e.printStackTrace();
}
LwKhclXz par2 = new LwKhclXz();
par2.setDownLoadPath(name);
return par2;
}
private String getDownloadPath(String path){
String filePath = "";
// if(StringUtils.isNotBlank(path)){
// return "";
// }
int idx = path.indexOf(downloadpath);
if(idx==-1){
filePath = downloadpath + File.separator + path;
}else{
filePath = path;
}
return filePath;
}
public static void zipFiles(String zipFileName, String... files) throws IOException {
FileOutputStream fos = new FileOutputStream(zipFileName);
ZipOutputStream zos = new ZipOutputStream(fos);
for (String file : files) {
try {
File srcFile = new File(file);
FileInputStream fis = new FileInputStream(srcFile);
ZipEntry zipEntry = new ZipEntry(srcFile.getName());
zos.putNextEntry(zipEntry);
byte[] buffer = new byte[1024];
int length;
while ((length = fis.read(buffer)) > 0) {
zos.write(buffer, 0, length);
}
fis.close();
zos.closeEntry();
}catch (Exception e){
e.printStackTrace();
}
}
zos.close();
}
public static void downloadWangluoFile(String fileURL, String savePath) throws IOException {
// String fileURL = "https://vims.fanyu.com/toole/jianceorgan/getDownloadUrl?guid=ff9040ddamrg9k46"; // 要下载的文件URL
// String savePath = "D://a.zip"; // 下载后保存的文件路径
try {
URL url = new URL(fileURL);
HttpsURLConnection connection = (HttpsURLConnection) url.openConnection();
connection.connect();
int responseCode = connection.getResponseCode();
if (responseCode == HttpsURLConnection.HTTP_OK) {
InputStream inputStream = new BufferedInputStream(connection.getInputStream());
FileOutputStream outputStream = new FileOutputStream(savePath);
byte[] buffer = new byte[1024];
int bytesRead;
while ((bytesRead = inputStream.read(buffer)) != -1) {
outputStream.write(buffer, 0, bytesRead);
}
outputStream.close();
inputStream.close();
System.out.println("文件下载完成!");
} else {
System.out.println("无法连接到文件URL。响应代码" + responseCode);
}
} catch (IOException e) {
e.printStackTrace();
}
}
}

View File

@ -390,9 +390,9 @@ public class CommonController {
// if(StringUtils.isNotBlank(path)){
// return "";
// }
int idx = path.indexOf(downloadpath);
int idx = path.indexOf(uploadpath);
if(idx==-1){
filePath = downloadpath + File.separator + path;
filePath = uploadpath + File.separator + path;
}else{
filePath = path;
}

View File

@ -32,7 +32,7 @@
<java.version>1.8</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<tomcat.version>9.0.89</tomcat.version>
<tomcat.version>9.0.90</tomcat.version>
<!-- 微服务 -->
<spring-cloud.version>2021.0.3</spring-cloud.version>

View File

@ -0,0 +1,25 @@
u哦考试杜绝阿帆垃圾啊双打卡拉法基
u哦考试杜绝阿帆垃圾啊双打卡拉法基
u哦考试杜绝阿帆垃圾啊双打卡拉法基
u哦考试杜绝阿帆垃圾啊双打卡拉法基
u哦考试杜绝阿帆垃圾啊双打卡拉法基
u哦考试杜绝阿帆垃圾啊双打卡拉法基
u哦考试杜绝阿帆垃圾啊双打卡拉法基
u哦考试杜绝阿帆垃圾啊双打卡拉法基
u哦考试杜绝阿帆垃圾啊双打卡拉法基
u哦考试杜绝阿帆垃圾啊双打卡拉法基
u哦考试杜绝阿帆垃圾啊双打卡拉法基
u哦考试杜绝阿帆垃圾啊双打卡拉法基
u哦考试杜绝阿帆垃圾啊双打卡拉法基
u哦考试杜绝阿帆垃圾啊双打卡拉法基
u哦考试杜绝阿帆垃圾啊双打卡拉法基
u哦考试杜绝阿帆垃圾啊双打卡拉法基
u哦考试杜绝阿帆垃圾啊双打卡拉法基
u哦考试杜绝阿帆垃圾啊双打卡拉法基
u哦考试杜绝阿帆垃圾啊双打卡拉法基
u哦考试杜绝阿帆垃圾啊双打卡拉法基
u哦考试杜绝阿帆垃圾啊双打卡拉法基
u哦考试杜绝阿帆垃圾啊双打卡拉法基
u哦考试杜绝阿帆垃圾啊双打卡拉法基
u哦考试杜绝阿帆垃圾啊双打卡拉法基

View File

@ -1,6 +1,6 @@
import { h } from 'vue';
import { Avatar, Tag, Tooltip, Image } from 'ant-design-vue';
import { getFileAccessHttpUrl,getFileAccessHttpUrlLocal } from '/@/utils/common/compUtils';
import { getFileAccessHttpUrl, getFileAccessHttpUrlLocal } from '/@/utils/common/compUtils';
import { Tinymce } from '/@/components/Tinymce';
import Icon from '/@/components/Icon';
import { getDictItemsByCode } from '/@/utils/dict/index';
@ -170,6 +170,7 @@ function downloadFile(url) {
url = url.substring(0, url.indexOf(','));
}
url = getFileAccessHttpUrl(url.split(',')[0]);
console.log('👗downloadFile1111111111111111', url)
if (url) {
window.open(url);
}
@ -192,4 +193,4 @@ function downloadFileLoacl(url) {
}
}
export { render, downloadFile,downloadFileLoacl };
export { render, downloadFile, downloadFileLoacl };

View File

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

View File

@ -0,0 +1,275 @@
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';
//列表数据
export const columns: BasicColumn[] = [
{
title: '学生学号',
align: "center",
dataIndex: 'xsxh'
},
{
title: '学生姓名',
align: "center",
dataIndex: 'xsxm'
},
{
title: '毕业年份',
align: "center",
dataIndex: 'bynf'
},
{
title: '班级',
align: "center",
dataIndex: 'bj'
},
{
title: '毕业论文(设计)题目',
align: "center",
dataIndex: 'bylwTm'
},
{
title: '毕业论文(设计)类别',
align: "center",
dataIndex: 'bylwLb'
},
{
title: '毕业论文(设计)成绩',
align: "center",
dataIndex: 'bylwCj'
},
{
title: '指导教师姓名',
align: "center",
dataIndex: 'zdjsxm'
},
{
title: '指导教师职称',
align: "center",
dataIndex: 'zdjszc'
},
{
title: '所属院系名称',
align: "center",
dataIndex: 'ssyxmc'
},
{
title: '所属校内专业(大类)名称',
align: "center",
dataIndex: 'ssxnzymc'
},
{
title: '是否实现电子化管理',
align: "center",
dataIndex: 'sfsxdzhgl'
},
{
title: '关键词',
align: "center",
dataIndex: 'gjc'
},
{
title: '查重结果',
align: "center",
dataIndex: 'ccjg'
},
{
title: '开题报告',
align: "center",
dataIndex: 'ktbg'
},
{
title: '开题报告审核意见',
align: "center",
dataIndex: 'ktbgshyj'
},
{
title: '中期检查',
align: "center",
dataIndex: 'zqjc'
},
{
title: '论文终稿',
align: "center",
dataIndex: 'lwzg'
},
{
title: '论文终稿PDF',
align: "center",
dataIndex: 'lwzgPdf'
},
{
title: '检测报告等材料',
align: "center",
dataIndex: 'jcbgdcl'
},
{
title: '论文考核材料id',
align: "center",
dataIndex: 'mainId'
},
];
export const columns2: BasicColumn[] = [
{
title: '院系名称',
align: "center",
dataIndex: 'ssyxmc',
ellipsis: true,
},
{
title: '校内专业',
align: "center",
dataIndex: 'ssxnzymc',
ellipsis: true,
},
{
title: '指导教师姓名',
align: "center",
dataIndex: 'zdjsxm',
ellipsis: true,
},
{
title: '学生学号',
align: "center",
dataIndex: 'xsxh',
ellipsis: true,
},
{
title: '学生姓名',
align: "center",
dataIndex: 'xsxm',
ellipsis: true,
},
{
title: '论文题目',
align: "center",
dataIndex: 'bylwTm',
ellipsis: true,
},
{
title: '毕业年份',
align: "center",
dataIndex: 'bynf',
ellipsis: true,
},
// {
// title: '班级',
// align: "center",
// dataIndex: 'bj',
// ellipsis: true,
// },
{
title: '论文类别',
align: "center",
dataIndex: 'bylwLb',
ellipsis: true,
},
{
title: '论文成绩',
align: "center",
dataIndex: 'bylwCj',
ellipsis: true,
},
{
title: '操作',
dataIndex: 'action',
align: 'center',
width:100
},
];
export const columns3: BasicColumn[] = [
{
title: '院系名称',
align: "center",
dataIndex: 'ssyxmc',
ellipsis: true,
},
{
title: '校内专业',
align: "center",
dataIndex: 'ssxnzymc',
ellipsis: true,
},
{
title: '指导教师姓名',
align: "center",
dataIndex: 'zdjsxm',
ellipsis: true,
},
{
title: '学生学号',
align: "center",
dataIndex: 'xsxh',
ellipsis: true,
},
{
title: '学生姓名',
align: "center",
dataIndex: 'xsxm',
ellipsis: true,
},
{
title: '论文题目',
align: "center",
dataIndex: 'bylwTm',
ellipsis: true,
},
{
title: '毕业年份',
align: "center",
dataIndex: 'bynf',
ellipsis: true,
},
// {
// title: '班级',
// align: "center",
// dataIndex: 'bj',
// ellipsis: true,
// },
{
title: '论文类别',
align: "center",
dataIndex: 'bylwLb',
ellipsis: true,
},
{
title: '论文成绩',
align: "center",
dataIndex: 'bylwCj',
ellipsis: true,
},
// {
// title: '终稿查重相似率',
// align: "center",
// dataIndex: 'ccjgxsl',
// ellipsis: true,
// },
];
// 高级查询数据
export const superQuerySchema = {
xsxh: {title: '学生学号',order: 0,view: 'text', type: 'string',},
xsxm: {title: '学生姓名',order: 1,view: 'text', type: 'string',},
bynf: {title: '毕业年份',order: 2,view: 'text', type: 'string',},
bj: {title: '班级',order: 3,view: 'text', type: 'string',},
bylwTm: {title: '毕业论文(设计)题目',order: 4,view: 'text', type: 'string',},
bylwLb: {title: '毕业论文(设计)类别',order: 5,view: 'text', type: 'string',},
bylwCj: {title: '毕业论文(设计)成绩',order: 6,view: 'text', type: 'string',},
zdjsxm: {title: '指导教师姓名',order: 7,view: 'text', type: 'string',},
zdjszc: {title: '指导教师职称',order: 8,view: 'text', type: 'string',},
ssyxmc: {title: '所属院系名称',order: 9,view: 'text', type: 'string',},
ssxnzymc: {title: '所属校内专业(大类)名称',order: 10,view: 'text', type: 'string',},
sfsxdzhgl: {title: '是否实现电子化管理',order: 11,view: 'text', type: 'string',},
gjc: {title: '关键词',order: 12,view: 'text', type: 'string',},
ccjg: {title: '查重结果',order: 13,view: 'text', type: 'string',},
ktbg: {title: '开题报告',order: 14,view: 'text', type: 'string',},
ktbgshyj: {title: '开题报告审核意见',order: 15,view: 'text', type: 'string',},
zqjc: {title: '中期检查',order: 16,view: 'text', type: 'string',},
lwzg: {title: '论文终稿',order: 17,view: 'text', type: 'string',},
lwzgPdf: {title: '论文终稿PDF',order: 18,view: 'text', type: 'string',},
jcbgdcl: {title: '检测报告等材料',order: 19,view: 'text', type: 'string',},
mainId: {title: '论文考核材料id',order: 20,view: 'text', type: 'string',},
};

View File

@ -0,0 +1,235 @@
<template>
<div class="p-2">
<!--查询区域-->
<div class="jeecg-basic-table-form-container">
<a-form ref="formRef" @keyup.enter.native="searchQuery" :model="queryParam" :label-col="labelCol" :wrapper-col="wrapperCol">
<a-row :gutter="24">
</a-row>
</a-form>
</div>
<!--引用表格-->
<BasicTable @register="registerTable" :rowSelection="rowSelection">
<!--插槽:table标题-->
<template #tableTitle>
<a-button type="primary" v-auth="'lwKhclXz:lw_khcl_xz:add'" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button>
<a-button type="primary" v-auth="'lwKhclXz:lw_khcl_xz:exportXls'" preIcon="ant-design:export-outlined" @click="onExportXls"> 导出</a-button>
<j-upload-button type="primary" v-auth="'lwKhclXz:lw_khcl_xz: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 v-auth="'lwKhclXz:lw_khcl_xz:deleteBatch'">批量操作
<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>
</BasicTable>
<!-- 表单区域 -->
<LwKhclXzModal ref="registerModal" @success="handleSuccess"></LwKhclXzModal>
</div>
</template>
<script lang="ts" name="lwKhclXz-lwKhclXz" setup>
import { ref, reactive } from 'vue';
import { BasicTable, useTable, TableAction } from '/@/components/Table';
import { useListPage } from '/@/hooks/system/useListPage';
import { columns, superQuerySchema } from './LwKhclXz.data';
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './LwKhclXz.api';
import { downloadFile } from '/@/utils/common/renderUtils';
import LwKhclXzModal from './components/LwKhclXzModal.vue'
import { useUserStore } from '/@/store/modules/user';
const formRef = ref();
const queryParam = reactive<any>({});
const toggleSearchStatus = ref<boolean>(false);
const registerModal = ref();
const userStore = useUserStore();
//table
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
tableProps: {
title: 'lw_khcl_xz',
api: list,
columns,
canResize:false,
useSearchForm: false,
actionColumn: {
width: 120,
fixed: 'right',
},
beforeFetch: async (params) => {
return Object.assign(params, queryParam);
},
},
exportConfig: {
name: "lw_khcl_xz",
url: getExportUrl,
params: queryParam,
},
importConfig: {
url: getImportUrl,
success: handleSuccess
},
});
const [registerTable, { reload, collapseAll, updateTableDataRecord, findTableDataRecord, getDataSource }, { rowSelection, selectedRowKeys }] = tableContext;
const labelCol = reactive({
xs:24,
sm:4,
xl:6,
xxl:4
});
const wrapperCol = reactive({
xs: 24,
sm: 20,
});
//
const superQueryConfig = reactive(superQuerySchema);
/**
* 高级查询事件
*/
function handleSuperQuery(params) {
Object.keys(params).map((k) => {
queryParam[k] = params[k];
});
searchQuery();
}
/**
* 新增事件
*/
function handleAdd() {
registerModal.value.disableSubmit = false;
registerModal.value.add();
}
/**
* 编辑事件
*/
function handleEdit(record: Recordable) {
registerModal.value.disableSubmit = false;
registerModal.value.edit(record);
}
/**
* 详情
*/
function handleDetail(record: Recordable) {
registerModal.value.disableSubmit = true;
registerModal.value.edit(record);
}
/**
* 删除事件
*/
async function handleDelete(record) {
await deleteOne({ id: record.id }, handleSuccess);
}
/**
* 批量删除事件
*/
async function batchHandleDelete() {
await batchDelete({ ids: selectedRowKeys.value }, handleSuccess);
}
/**
* 成功回调
*/
function handleSuccess() {
(selectedRowKeys.value = []) && reload();
}
/**
* 操作栏
*/
function getTableAction(record) {
return [
{
label: '编辑',
onClick: handleEdit.bind(null, record),
auth: 'lwKhclXz:lw_khcl_xz:edit'
},
];
}
/**
* 下拉操作栏
*/
function getDropDownAction(record) {
return [
{
label: '详情',
onClick: handleDetail.bind(null, record),
}, {
label: '删除',
popConfirm: {
title: '是否确认删除',
confirm: handleDelete.bind(null, record),
placement: 'topLeft',
},
auth: 'lwKhclXz:lw_khcl_xz:delete'
}
]
}
/**
* 查询
*/
function searchQuery() {
reload();
}
/**
* 重置
*/
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>

View File

@ -0,0 +1,615 @@
<template>
<div class="p-2">
<!-- 未选课页面 -->
<div v-if="sfxk == 0">
<div style="text-align: center">
<img src="../../../assets/images/Course-selection.png" style="margin-top: 100px; width: 600px" />
<div style="color: #606266; font-weight: 700; font-size: 20px; margin-top: 20px">您还没有考核论文请先选择考核论文</div>
<a-button type="primary" style="margin-left: 10px; margin-top: 10px" @click="handleXuanke">选考核论文</a-button>
</div>
</div>
<!-- 选课页面 -->
<div v-if="sfxk == 1">
<div class="jeecg-basic-table-form-container">
<a-form class="query-criteria">
<a-button type="primary" style="margin-left: 10px; margin-bottom: 15px" @click="handleFanhui">查看材料</a-button>
</a-form>
</div>
<a-table :columns="columns2" :data-source="checkData" :pagination="false">
<template #title><span class="seleciton-line">1</span> <span class="selection-title">已选论文</span></template>
<template #bodyCell="{ column, record }">
<template v-if="column.dataIndex === 'action'">
<a @click="handleDel(record)">移除</a>
</template>
</template>
</a-table>
<div class="jeecg-basic-table-form-container" style="margin-top: 10px">
<a-form
ref="formRef"
@keyup.enter.native="searchQuery2"
:model="queryParam"
:label-col="labelCol"
:wrapper-col="wrapperCol"
class="query-criteria"
>
<a-row :gutter="24">
<a-col :lg="6">
<a-form-item name="ssxnzymc">
<template #label><span title="专业">专业</span></template>
<a-input placeholder="请输入专业" v-model:value="queryParam2.ssxnzymc" allow-clear></a-input>
</a-form-item>
</a-col>
<a-col :lg="6">
<a-form-item name="xsxm">
<template #label><span title="学生姓名">学生姓名</span></template>
<a-input placeholder="请输入学生姓名" v-model:value="queryParam2.xsxm" allow-clear></a-input>
</a-form-item>
</a-col>
<a-col :lg="6">
<a-form-item name="ktbg">
<template #label><span title="开题报告">开题报告</span></template>
<a-select placeholder="请选择开题报告" v-model:value="queryParam2.ktbg">
<a-select-option value="">全部</a-select-option>
<a-select-option :value="1"></a-select-option>
<a-select-option :value="0"></a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :lg="6">
<a-form-item name="zqjc">
<template #label><span title="中期检查">中期检查</span></template>
<a-select placeholder="请选择中期检查" v-model:value="queryParam2.zqjc">
<a-select-option value="">全部</a-select-option>
<a-select-option :value="1"></a-select-option>
<a-select-option :value="0"></a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :lg="6">
<a-form-item name="lwzg">
<template #label><span title="论文终稿">论文终稿</span></template>
<a-select placeholder="请选择论文终稿" v-model:value="queryParam2.lwzg">
<a-select-option value="">全部</a-select-option>
<a-select-option :value="1"></a-select-option>
<a-select-option :value="0"></a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :span="18" style="text-align: right">
<a-button type="primary" preIcon="ant-design:search-outlined" @click="searchQuery2">查询</a-button>
</a-col>
</a-row>
</a-form>
</div>
<a-table
:columns="columns2"
:data-source="dataList"
v-model:current="paginationProp.current"
:total="paginationProp.total"
:pagination="paginationProp"
@change="onPageChange"
>
<template #title><span class="seleciton-line">1</span> <span class="selection-title">可选论文</span></template>
<template #bodyCell="{ column, record }">
<template v-if="column.dataIndex === 'action'">
<a @click="handleXUanze(record)" v-if="record.sfxk == '0'">选择</a>
<a disabled v-if="record.sfxk == '1'">已选择</a>
</template>
</template>
</a-table>
</div>
<!-- 查看论文材料 -->
<div v-if="sfxk == 2">
<div class="jeecg-basic-table-form-container">
<a-form class="query-criteria">
<a-button type="primary" style="margin-left: 10px; margin-bottom: 15px" @click="handleFanhui">查看材料</a-button>
</a-form>
</div>
<div class="jeecg-basic-table-form-container">
<a-form class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol">
<span class="seleciton-line">1</span> <span class="selection-title">基础信息</span>
<a-row>
<a-col :span="8">
<a-form-item label="院系名称">
{{ lwinfo.value.ssyxmc }}
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="校内专业">
{{ lwinfo.value.ssxnzymc }}
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="指导教师姓名">
{{ lwinfo.value.zdjsxm }}
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="学生学号">
{{ lwinfo.value.xsxh }}
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="学生姓名">
{{ lwinfo.value.xsxm }}
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="论文题目">
{{ lwinfo.value.bylwTm }}
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="毕业年份">
{{ lwinfo.value.bynf }}
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="论文类别">
{{ lwinfo.value.bylwLb }}
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="论文成绩">
{{ lwinfo.value.bylwCj }}
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="终稿查重相似率">
{{ lwinfo.value.ccjgxsl }}
</a-form-item>
</a-col>
</a-row>
<span class="seleciton-line">1</span> <span class="selection-title">材料信息</span>
<div style="width: 100; text-align: right"><a-button type="primary" @click="batchHandleDown(lwinfo)">下载全部材料</a-button></div>
<a-tabs v-model:activeKey="activeKey" type="card">
<a-tab-pane key="1" tab="开题报告">
<div v-if="lwinfo.value.ktbg">
<div style="width: 100; text-align: right"
><a-button type="primary" @click="handleDownload(lwinfo.value.ktbg)">下载开题报告</a-button></div
>
<iframe :src="ktbgUrl" width="100%" height="600px"></iframe>
</div>
<div v-else style="height: 300px; line-height: 300px; text-align: center">暂无文件</div>
</a-tab-pane>
<a-tab-pane key="2" tab="开题报告审核意见">
<div v-if="lwinfo.value.ktbgshyj">
<div style="width: 100; text-align: right; padding: 10px"
><a-button type="primary" @click="handleDownload(lwinfo.value.ktbgshyj)">下载开题报告审核意见</a-button></div
>
<iframe :src="ktbgshyjUrl" width="100%" height="600px"></iframe>
</div>
<div v-else style="height: 300px; line-height: 300px; text-align: center">暂无文件</div>
</a-tab-pane>
<a-tab-pane key="3" tab="中期检查">
<div v-if="lwinfo.value.zqjc">
<div style="width: 100; text-align: right; padding: 10px"
><a-button type="primary" @click="handleDownload(lwinfo.value.zqjc)">下载中期检查</a-button></div
>
<iframe :src="zqjcUrl" width="100%" height="600px"></iframe>
</div>
<div v-else style="height: 300px; line-height: 300px; text-align: center">暂无文件</div>
</a-tab-pane>
<a-tab-pane key="4" tab="论文终稿">
<div v-if="lwinfo.value.lwzg">
<div style="width: 100; text-align: right; padding: 10px"
><a-button type="primary" @click="handleDownload(lwinfo.value.lwzg)">下载论文终稿</a-button></div
>
<iframe :src="lwzgUrl" width="100%" height="600px"></iframe>
</div>
<div v-else style="height: 300px; line-height: 300px; text-align: center">暂无文件</div>
</a-tab-pane>
<a-tab-pane key="5" tab="指导记录单">
<div v-if="lwinfo.value.zdjld">
<div style="width: 100; text-align: right; padding: 10px"
><a-button type="primary" @click="handleDownload(lwinfo.value.zdjld)">下载指导记录单</a-button></div
>
<iframe :src="zdjldUrl" width="100%" height="600px"></iframe>
</div>
<div v-else style="height: 300px; line-height: 300px; text-align: center">暂无文件</div>
</a-tab-pane>
<a-tab-pane key="6" tab="检测报告等材料">
<div v-if="lwinfo.value.jcbgdcl">
<!-- <div><a @click="handleDownload(lwinfo.value.jcbgdcl)">下载</a></div> -->
<iframe :src="jcbgUrl" width="100%" height="600px"></iframe>
</div>
<div v-else style="height: 300px; line-height: 300px; text-align: center">暂无文件</div>
</a-tab-pane>
</a-tabs>
</a-form>
</div>
</div>
<!-- 选课后的列表 -->
<div v-if="sfxk == 999">
<div class="jeecg-basic-table-form-container">
<a-form class="query-criteria">
<a-button type="primary" preIcon="ant-design:copy-outlined" @click="handleXuanke" style="margin-left: 8px; margin-bottom: 15px">
返回选择论文</a-button
>
</a-form>
</div>
<!--查询区域-->
<div class="jeecg-basic-table-form-container">
<a-form
ref="formRef3"
@keyup.enter.native="searchQuery"
:model="queryParam"
:label-col="labelCol"
:wrapper-col="wrapperCol"
class="query-criteria"
>
<a-row :gutter="24">
<a-col :lg="6">
<a-form-item name="ssxnzymc">
<template #label><span title="专业">专业</span></template>
<j-input placeholder="请输入专业" v-model:value="queryParam.ssxnzymc" allow-clear></j-input>
</a-form-item>
</a-col>
<a-col :lg="6">
<a-form-item name="xsxm">
<template #label><span title="学生姓名">学生姓名</span></template>
<j-input placeholder="请输入学生姓名" v-model:value="queryParam.xsxm" allow-clear></j-input>
</a-form-item>
</a-col>
<a-col :lg="6">
<a-form-item name="ktbg">
<template #label><span title="开题报告">开题报告</span></template>
<a-select placeholder="请选择开题报告" v-model:value="queryParam.ktbg">
<a-select-option value="">全部</a-select-option>
<a-select-option :value="1"></a-select-option>
<a-select-option :value="0"></a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :lg="6">
<a-form-item name="zqjc">
<template #label><span title="中期检查">中期检查</span></template>
<a-select placeholder="请选择中期检查" v-model:value="queryParam.zqjc">
<a-select-option value="">全部</a-select-option>
<a-select-option :value="1"></a-select-option>
<a-select-option :value="0"></a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :lg="6">
<a-form-item name="lwzg">
<template #label><span title="论文终稿">论文终稿</span></template>
<a-select placeholder="请选择论文终稿" v-model:value="queryParam.lwzg">
<a-select-option value="">全部</a-select-option>
<a-select-option :value="1"></a-select-option>
<a-select-option :value="0"></a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :span="18" style="text-align: right">
<a-button type="primary" preIcon="ant-design:search-outlined" @click="searchQuery">查询</a-button>
<!-- <a-button type="primary" preIcon="ant-design:export-outlined" @click="onExportXls" style="margin-left: 8px"> 导出</a-button> -->
</a-col>
</a-row>
</a-form>
</div>
<!--引用表格-->
<BasicTable @register="registerTable" class="table-style">
<template #tableTitle> <span class="seleciton-line">1</span> <span class="selection-title">已选论文</span> </template>
<!--操作栏-->
<template #action="{ record }">
<TableAction :actions="getTableAction(record)" />
</template>
</BasicTable>
</div>
</div>
</template>
<script lang="ts" name="lwKhclXz-lwKhclXz" setup>
import { ref, reactive, onMounted } from 'vue';
import { useListPage } from '/@/hooks/system/useListPage';
import { BasicTable, useTable, TableAction } from '/@/components/Table';
import { columns, columns2, columns3, superQuerySchema } from './LwKhclXz.data';
import { list, deleteOne, deleteXkxxOne, batchDelete, getImportUrl, getExportUrl } from './LwKhclXz.api';
import { useUserStore } from '/@/store/modules/user';
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
import { downloadFile, downloadFileLoacl } from '/@/utils/common/renderUtils';
import { getFileAccessHttpUrl } from '@/utils/common/compUtils';
import { encryptByBase64 } from '@/utils/cipher';
import JInput from '/@/components/Form/src/jeecg/components/JInput.vue';
import dayjs from 'dayjs';
import { defHttp } from '/@/utils/http/axios';
const formRef = ref();
const queryParam = reactive<any>({});
const toggleSearchStatus = ref<boolean>(false);
const registerModal = ref();
const userStore = useUserStore();
const queryParam2 = ref<any>({});
const emit = defineEmits(['callback']);
const checkData = ref<any>([]);
const dataList = ref<any>([]);
const sfxk = ref<number>(0);
const lwinfo = reactive<any>({});
const docUrl = ref<string>('');
const activeKey = ref('1');
const ktbgUrl = ref<string>('');
const ktbgshyjUrl = ref<string>('');
const zqjcUrl = ref<string>('');
const lwzgUrl = ref<string>('');
const zdjldUrl = ref<string>('');
const jcbgUrl = ref<string>('');
//table
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
tableProps: {
api: list,
columns: columns3,
canResize: false,
useSearchForm: false,
actionColumn: {
width: 120,
fixed: 'right',
},
beforeFetch: async (params) => {
return Object.assign(params, queryParam);
},
},
exportConfig: {
name: '教务系统教学任务',
url: getExportUrl,
params: queryParam,
},
});
const [registerTable, { reload, collapseAll, updateTableDataRecord, findTableDataRecord, getDataSource }] = tableContext;
//
async function batchHandleDown(record) {
console.log('🙍‍♂️', record);
var downName = '学生论文材料' + dayjs().format('YYYYMMDDHHmmss') + '';
var params = { id: record.value.id, downName };
console.log('🕵', params);
defHttp.post({ url: '/lwKhclXz/lwKhclXz/getLwBatchDown', params: { id: record.value.id, downName } }).then((res) => {
console.log('---------',res);
downloadFileLoacl(res.downLoadPath);
});
}
//
function handleDownload(record) {
downloadFile(record);
}
//
function handleYulan(record) {
console.log('😶', record);
var file = getFileAccessHttpUrl(record);
window.open('https://fileview.jeecg.com/onlinePreview?url=' + encodeURIComponent(encryptByBase64(file)));
}
//
function handleChakan(record) {
lwinfo.value = record;
sfxk.value = 2;
if (lwinfo.value.ktbg) {
var file1 = getFileAccessHttpUrl(record.ktbg);
ktbgUrl.value = 'https://fileview.jeecg.com/onlinePreview?url=' + encodeURIComponent(encryptByBase64(file1));
} else {
ktbgUrl.value = '';
}
if (lwinfo.value.ktbgshyj) {
var file1 = getFileAccessHttpUrl(record.ktbgshyj);
ktbgshyjUrl.value = 'https://fileview.jeecg.com/onlinePreview?url=' + encodeURIComponent(encryptByBase64(file1));
} else {
ktbgshyjUrl.value = '';
}
if (lwinfo.value.zqjc) {
var file1 = getFileAccessHttpUrl(record.zqjc);
zqjcUrl.value = 'https://fileview.jeecg.com/onlinePreview?url=' + encodeURIComponent(encryptByBase64(file1));
} else {
zqjcUrl.value = '';
}
if (lwinfo.value.lwzg) {
var file1 = getFileAccessHttpUrl(record.lwzg);
lwzgUrl.value = 'https://fileview.jeecg.com/onlinePreview?url=' + encodeURIComponent(encryptByBase64(file1));
} else {
lwzgUrl.value = '';
}
if (lwinfo.value.zdjld) {
var file1 = getFileAccessHttpUrl(record.zdjld);
zdjldUrl.value = 'https://fileview.jeecg.com/onlinePreview?url=' + encodeURIComponent(encryptByBase64(file1));
} else {
zdjldUrl.value = '';
}
if (lwinfo.value.ccjg) {
jcbgUrl.value = record.ccjg;
} else {
jcbgUrl.value = '';
}
}
/**
* 操作栏
*/
function getTableAction(record) {
return [
{
label: '查看论文材料',
onClick: handleChakan.bind(null, record),
},
// {
// label: '',
// onClick: handleKhpjcl.bind(null, record),
// },
// {
// label: '',
// onClick: handleXsyscl.bind(null, record),
// },
];
}
//table
const labelCol = reactive({
xs: 24,
sm: 8,
xl: 8,
xxl: 8,
});
const wrapperCol = reactive({
xs: 24,
sm: 14,
});
const paginationProp = ref<any>({
total: 1,
current: 1,
pageSize: 10,
pageNo: 1,
});
/**
* 查询
*/
function searchQuery() {
reload();
}
//
function handleXuanke() {
sfxk.value = 1;
searchQuery2();
}
//
function handleXUanze(record) {
record.mainId = record.id;
record.id = null;
console.log('😰record----------', record);
defHttp
.post({
url: '/lwKhclXz/lwKhclXz/add',
params: record,
})
.then((res) => {
console.log('🤛', res);
});
xtsuccess();
}
//
async function handleDel(record) {
await deleteXkxxOne({ id: record.id }, xtsuccess);
}
function xtsuccess() {
//
defHttp.get({ url: '/lwKhclXz/lwKhclXz/list', params: { pageSize: -1 } }).then((res) => {
console.log('🧛', res);
checkData.value = res.records;
});
searchQuery2();
}
/**
* 查询
*/
function searchQuery2() {
queryParam2.value.pageNo = paginationProp.value.current;
defHttp.get({ url: '/lwKhcl/lwKhcl/getXkList', params: { pageNo: paginationProp.value.current, ...queryParam2.value } }).then((res) => {
dataList.value = res.records;
paginationProp.value.total = res.total;
paginationProp.value.current = res.pageNo;
});
}
//
async function onPageChange(record) {
console.log('👬', record);
paginationProp.value.current = record.current;
await searchQuery2();
}
//
function handleFanhui() {
init();
}
function init() {
//
defHttp.get({ url: '/lwKhclXz/lwKhclXz/list', params: { pageSize: -1 } }).then((res) => {
console.log('🧛', res);
if (res.records.length == 0) {
sfxk.value = 0;
checkData.value = [];
} else {
sfxk.value = 999;
checkData.value = res.records;
paginationProp.value.total = res.records.total;
paginationProp.value.current = res.records.pages;
}
});
}
//
onMounted(() => {
init();
});
</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%;
}
}
.query-criteria {
padding-top: 22px;
border: 1px solid #eaeef6;
border-radius: 4px;
}
.query-criteria:hover {
border: 1px solid #c5d8ff;
box-shadow: 2px 2px 10px 2px #e8ecf4;
border-radius: 4px;
}
.table-style {
padding: 10px;
background: #fff;
border: 1px solid #eaeef6;
border-radius: 4px;
}
.table-style:hover {
border: 1px solid #e8ecf4;
box-shadow: 2px 2px 10px 2px #e8ecf4;
border-radius: 4px;
}
.xn-title {
font-size: 16px;
font-weight: 700;
}
.selection-title {
font-size: 18px;
font-weight: 700;
padding-left: 10px;
}
.seleciton-line {
background: #1890ff;
border-radius: 10px;
color: #1890ff;
}
</style>

View File

@ -0,0 +1,265 @@
<template>
<a-spin :spinning="confirmLoading">
<JFormContainer :disabled="disabled">
<template #detail>
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol" name="LwKhclXzForm">
<a-row>
<a-col :span="24">
<a-form-item label="学生学号" v-bind="validateInfos.xsxh" id="LwKhclXzForm-xsxh" name="xsxh">
<a-input v-model:value="formData.xsxh" placeholder="请输入学生学号" allow-clear ></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="学生姓名" v-bind="validateInfos.xsxm" id="LwKhclXzForm-xsxm" name="xsxm">
<a-input v-model:value="formData.xsxm" placeholder="请输入学生姓名" allow-clear ></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="毕业年份" v-bind="validateInfos.bynf" id="LwKhclXzForm-bynf" name="bynf">
<a-input v-model:value="formData.bynf" placeholder="请输入毕业年份" allow-clear ></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="班级" v-bind="validateInfos.bj" id="LwKhclXzForm-bj" name="bj">
<a-input v-model:value="formData.bj" placeholder="请输入班级" allow-clear ></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="毕业论文(设计)题目" v-bind="validateInfos.bylwTm" id="LwKhclXzForm-bylwTm" name="bylwTm">
<a-input v-model:value="formData.bylwTm" placeholder="请输入毕业论文(设计)题目" allow-clear ></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="毕业论文(设计)类别" v-bind="validateInfos.bylwLb" id="LwKhclXzForm-bylwLb" name="bylwLb">
<a-input v-model:value="formData.bylwLb" placeholder="请输入毕业论文(设计)类别" allow-clear ></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="毕业论文(设计)成绩" v-bind="validateInfos.bylwCj" id="LwKhclXzForm-bylwCj" name="bylwCj">
<a-input v-model:value="formData.bylwCj" placeholder="请输入毕业论文(设计)成绩" allow-clear ></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="指导教师姓名" v-bind="validateInfos.zdjsxm" id="LwKhclXzForm-zdjsxm" name="zdjsxm">
<a-input v-model:value="formData.zdjsxm" placeholder="请输入指导教师姓名" allow-clear ></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="指导教师职称" v-bind="validateInfos.zdjszc" id="LwKhclXzForm-zdjszc" name="zdjszc">
<a-input v-model:value="formData.zdjszc" placeholder="请输入指导教师职称" allow-clear ></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="所属院系名称" v-bind="validateInfos.ssyxmc" id="LwKhclXzForm-ssyxmc" name="ssyxmc">
<a-input v-model:value="formData.ssyxmc" placeholder="请输入所属院系名称" allow-clear ></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="所属校内专业(大类)名称" v-bind="validateInfos.ssxnzymc" id="LwKhclXzForm-ssxnzymc" name="ssxnzymc">
<a-input v-model:value="formData.ssxnzymc" placeholder="请输入所属校内专业(大类)名称" allow-clear ></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="是否实现电子化管理" v-bind="validateInfos.sfsxdzhgl" id="LwKhclXzForm-sfsxdzhgl" name="sfsxdzhgl">
<a-input v-model:value="formData.sfsxdzhgl" placeholder="请输入是否实现电子化管理" allow-clear ></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="关键词" v-bind="validateInfos.gjc" id="LwKhclXzForm-gjc" name="gjc">
<a-input v-model:value="formData.gjc" placeholder="请输入关键词" allow-clear ></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="查重结果" v-bind="validateInfos.ccjg" id="LwKhclXzForm-ccjg" name="ccjg">
<a-input v-model:value="formData.ccjg" placeholder="请输入查重结果" allow-clear ></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="开题报告" v-bind="validateInfos.ktbg" id="LwKhclXzForm-ktbg" name="ktbg">
<a-input v-model:value="formData.ktbg" placeholder="请输入开题报告" allow-clear ></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="开题报告审核意见" v-bind="validateInfos.ktbgshyj" id="LwKhclXzForm-ktbgshyj" name="ktbgshyj">
<a-input v-model:value="formData.ktbgshyj" placeholder="请输入开题报告审核意见" allow-clear ></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="中期检查" v-bind="validateInfos.zqjc" id="LwKhclXzForm-zqjc" name="zqjc">
<a-input v-model:value="formData.zqjc" placeholder="请输入中期检查" allow-clear ></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="论文终稿" v-bind="validateInfos.lwzg" id="LwKhclXzForm-lwzg" name="lwzg">
<a-input v-model:value="formData.lwzg" placeholder="请输入论文终稿" allow-clear ></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="论文终稿PDF" v-bind="validateInfos.lwzgPdf" id="LwKhclXzForm-lwzgPdf" name="lwzgPdf">
<a-input v-model:value="formData.lwzgPdf" placeholder="请输入论文终稿PDF" allow-clear ></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="检测报告等材料" v-bind="validateInfos.jcbgdcl" id="LwKhclXzForm-jcbgdcl" name="jcbgdcl">
<a-input v-model:value="formData.jcbgdcl" placeholder="请输入检测报告等材料" allow-clear ></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="论文考核材料id" v-bind="validateInfos.mainId" id="LwKhclXzForm-mainId" name="mainId">
<a-input v-model:value="formData.mainId" placeholder="请输入论文考核材料id" allow-clear ></a-input>
</a-form-item>
</a-col>
</a-row>
</a-form>
</template>
</JFormContainer>
</a-spin>
</template>
<script lang="ts" setup>
import { ref, reactive, defineExpose, nextTick, defineProps, computed, onMounted } from 'vue';
import { defHttp } from '/@/utils/http/axios';
import { useMessage } from '/@/hooks/web/useMessage';
import { getValueType } from '/@/utils';
import { saveOrUpdate } from '../LwKhclXz.api';
import { Form } from 'ant-design-vue';
import JFormContainer from '/@/components/Form/src/container/JFormContainer.vue';
const props = defineProps({
formDisabled: { type: Boolean, default: false },
formData: { type: Object, default: () => ({})},
formBpm: { type: Boolean, default: true }
});
const formRef = ref();
const useForm = Form.useForm;
const emit = defineEmits(['register', 'ok']);
const formData = reactive<Record<string, any>>({
id: '',
xsxh: '',
xsxm: '',
bynf: '',
bj: '',
bylwTm: '',
bylwLb: '',
bylwCj: '',
zdjsxm: '',
zdjszc: '',
ssyxmc: '',
ssxnzymc: '',
sfsxdzhgl: '',
gjc: '',
ccjg: '',
ktbg: '',
ktbgshyj: '',
zqjc: '',
lwzg: '',
lwzgPdf: '',
jcbgdcl: '',
mainId: '',
});
const { createMessage } = useMessage();
const labelCol = ref<any>({ xs: { span: 24 }, sm: { span: 5 } });
const wrapperCol = ref<any>({ xs: { span: 24 }, sm: { span: 16 } });
const confirmLoading = ref<boolean>(false);
//
const validatorRules = reactive({
});
const { resetFields, validate, validateInfos } = useForm(formData, validatorRules, { immediate: false });
//
const disabled = computed(()=>{
if(props.formBpm === true){
if(props.formData.disabled === false){
return false;
}else{
return true;
}
}
return props.formDisabled;
});
/**
* 新增
*/
function add() {
edit({});
}
/**
* 编辑
*/
function edit(record) {
nextTick(() => {
resetFields();
const tmpData = {};
Object.keys(formData).forEach((key) => {
if(record.hasOwnProperty(key)){
tmpData[key] = record[key]
}
})
//
Object.assign(formData, tmpData);
});
}
/**
* 提交数据
*/
async function submitForm() {
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);
}
confirmLoading.value = true;
const isUpdate = ref<boolean>(false);
//
let model = formData;
if (model.id) {
isUpdate.value = true;
}
//
for (let data in model) {
//
if (model[data] instanceof Array) {
let valueType = getValueType(formRef.value.getProps, data);
//
if (valueType === 'string') {
model[data] = model[data].join(',');
}
}
}
await saveOrUpdate(model, isUpdate.value)
.then((res) => {
if (res.success) {
createMessage.success(res.message);
emit('ok');
} else {
createMessage.warning(res.message);
}
})
.finally(() => {
confirmLoading.value = false;
});
}
defineExpose({
add,
edit,
submitForm,
});
</script>
<style lang="less" scoped>
.antd-modal-form {
padding: 14px;
}
</style>