新增基本制度建设功能
This commit is contained in:
parent
ef4757cb68
commit
516c5b9753
|
@ -0,0 +1,209 @@
|
|||
package org.jeecg.modules.demo.blJbzdjs.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.blJbzdjs.entity.BlJbzdjs;
|
||||
import org.jeecg.modules.demo.blJbzdjs.service.IBlJbzdjsService;
|
||||
|
||||
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.zjSqxx.entity.ZjSqxx;
|
||||
import org.jeecg.modules.demo.zjSqxx.service.IZjSqxxService;
|
||||
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: bl_jbzdjs
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2024-12-10
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/blJbzdjs/blJbzdjs")
|
||||
@Slf4j
|
||||
public class BlJbzdjsController extends JeecgController<BlJbzdjs, IBlJbzdjsService> {
|
||||
@Autowired
|
||||
private IBlJbzdjsService blJbzdjsService;
|
||||
@Autowired
|
||||
private IZjSqxxService zjSqxxService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @param blJbzdjs
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/list")
|
||||
public Result<IPage<BlJbzdjs>> queryPageList(BlJbzdjs blJbzdjs,
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
|
||||
|
||||
LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
blJbzdjs.setDwmc(loginUser.getDepartIds());
|
||||
|
||||
QueryWrapper<BlJbzdjs> queryWrapper = QueryGenerator.initQueryWrapper(blJbzdjs, req.getParameterMap());
|
||||
Page<BlJbzdjs> page = new Page<BlJbzdjs>(pageNo, pageSize);
|
||||
IPage<BlJbzdjs> pageList = blJbzdjsService.page(page, queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 专家分页列表查询
|
||||
*
|
||||
* @param blJbzdjs
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/zjList")
|
||||
public Result<IPage<BlJbzdjs>> zjList(BlJbzdjs blJbzdjs,
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
|
||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
QueryWrapper<ZjSqxx> zjSqxxQueryWrapper = new QueryWrapper<>();
|
||||
zjSqxxQueryWrapper.eq("user_id",sysUser.getId());
|
||||
zjSqxxQueryWrapper.eq("sqfw","4");
|
||||
ZjSqxx zjSqxx = zjSqxxService.getOne(zjSqxxQueryWrapper);
|
||||
if(zjSqxx!=null){
|
||||
blJbzdjs.setDwmc(zjSqxx.getKkdw());
|
||||
}
|
||||
QueryWrapper<BlJbzdjs> queryWrapper = QueryGenerator.initQueryWrapper(blJbzdjs, req.getParameterMap());
|
||||
Page<BlJbzdjs> page = new Page<BlJbzdjs>(pageNo, pageSize);
|
||||
IPage<BlJbzdjs> pageList = blJbzdjsService.page(page, queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param blJbzdjs
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/add")
|
||||
public Result<String> add(@RequestBody BlJbzdjs blJbzdjs) {
|
||||
LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
blJbzdjs.setDwmc(loginUser.getDepartIds());
|
||||
blJbzdjsService.save(blJbzdjs);
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param blJbzdjs
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
|
||||
public Result<String> edit(@RequestBody BlJbzdjs blJbzdjs) {
|
||||
LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
blJbzdjs.setDwmc(loginUser.getDepartIds());
|
||||
blJbzdjsService.updateById(blJbzdjs);
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@DeleteMapping(value = "/delete")
|
||||
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
|
||||
blJbzdjsService.removeById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||
this.blJbzdjsService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
//@AutoLog(value = "bl_jbzdjs-通过id查询")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<BlJbzdjs> queryById(@RequestParam(name="id",required=true) String id) {
|
||||
BlJbzdjs blJbzdjs = blJbzdjsService.getById(id);
|
||||
if(blJbzdjs==null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
return Result.OK(blJbzdjs);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel
|
||||
*
|
||||
* @param request
|
||||
* @param blJbzdjs
|
||||
*/
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, BlJbzdjs blJbzdjs) {
|
||||
return super.exportXls(request, blJbzdjs, BlJbzdjs.class, "bl_jbzdjs");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过excel导入数据
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("blJbzdjs:bl_jbzdjs:importExcel")
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
return super.importExcel(request, response, BlJbzdjs.class);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,96 @@
|
|||
package org.jeecg.modules.demo.blJbzdjs.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.util.Date;
|
||||
import java.math.BigDecimal;
|
||||
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 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: bl_jbzdjs
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2024-12-10
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("bl_jbzdjs")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value="bl_jbzdjs对象", description="bl_jbzdjs")
|
||||
public class BlJbzdjs implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**id*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty(value = "id")
|
||||
private java.lang.String id;
|
||||
/**createBy*/
|
||||
@ApiModelProperty(value = "createBy")
|
||||
private java.lang.String createBy;
|
||||
/**createTime*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "createTime")
|
||||
private java.util.Date createTime;
|
||||
/**updateBy*/
|
||||
@ApiModelProperty(value = "updateBy")
|
||||
private java.lang.String updateBy;
|
||||
/**updateTime*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "updateTime")
|
||||
private java.util.Date updateTime;
|
||||
/**学院*/
|
||||
@Excel(name = "学院", width = 15)
|
||||
@ApiModelProperty(value = "学院")
|
||||
private java.lang.String dwmc;
|
||||
/**制度名称*/
|
||||
@Excel(name = "制度名称", width = 15)
|
||||
@ApiModelProperty(value = "制度名称")
|
||||
private java.lang.String zdmc;
|
||||
/**执行时间*/
|
||||
@Excel(name = "执行时间", width = 15, format = "yyyy-MM-dd")
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd")
|
||||
@ApiModelProperty(value = "执行时间")
|
||||
private java.util.Date zxsj;
|
||||
/**与教学管理文件汇编不一致说明*/
|
||||
@Excel(name = "与教学管理文件汇编不一致说明", width = 15, dicCode = "yn")
|
||||
@Dict(dicCode = "yn")
|
||||
@ApiModelProperty(value = "与教学管理文件汇编不一致说明")
|
||||
private java.lang.String sfyz;
|
||||
/**状态*/
|
||||
@Excel(name = "状态", width = 15, dicCode = "zd_status")
|
||||
@Dict(dicCode = "zd_status")
|
||||
@ApiModelProperty(value = "状态")
|
||||
private java.lang.String status;
|
||||
/**年度*/
|
||||
@Excel(name = "年度", width = 15)
|
||||
@ApiModelProperty(value = "年度")
|
||||
private java.lang.String years;
|
||||
/**修订情况*/
|
||||
@Excel(name = "修订情况", width = 15, dicCode = "zd_xdqk")
|
||||
@Dict(dicCode = "zd_xdqk")
|
||||
@ApiModelProperty(value = "修订情况")
|
||||
private java.lang.String yearsType;
|
||||
/**附件*/
|
||||
@Excel(name = "附件", width = 15)
|
||||
@ApiModelProperty(value = "附件")
|
||||
private java.lang.String filePath;
|
||||
/**文件服务器*/
|
||||
@Excel(name = "文件服务器", width = 15)
|
||||
@ApiModelProperty(value = "文件服务器")
|
||||
private java.lang.String ftpPath;
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
package org.jeecg.modules.demo.blJbzdjs.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.jeecg.modules.demo.blJbzdjs.entity.BlJbzdjs;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @Description: bl_jbzdjs
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2024-12-10
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface BlJbzdjsMapper extends BaseMapper<BlJbzdjs> {
|
||||
|
||||
}
|
|
@ -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.blJbzdjs.mapper.BlJbzdjsMapper">
|
||||
|
||||
</mapper>
|
|
@ -0,0 +1,14 @@
|
|||
package org.jeecg.modules.demo.blJbzdjs.service;
|
||||
|
||||
import org.jeecg.modules.demo.blJbzdjs.entity.BlJbzdjs;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* @Description: bl_jbzdjs
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2024-12-10
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface IBlJbzdjsService extends IService<BlJbzdjs> {
|
||||
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
package org.jeecg.modules.demo.blJbzdjs.service.impl;
|
||||
|
||||
import org.jeecg.modules.demo.blJbzdjs.entity.BlJbzdjs;
|
||||
import org.jeecg.modules.demo.blJbzdjs.mapper.BlJbzdjsMapper;
|
||||
import org.jeecg.modules.demo.blJbzdjs.service.IBlJbzdjsService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
||||
/**
|
||||
* @Description: bl_jbzdjs
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2024-12-10
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
public class BlJbzdjsServiceImpl extends ServiceImpl<BlJbzdjsMapper, BlJbzdjs> implements IBlJbzdjsService {
|
||||
|
||||
}
|
|
@ -104,27 +104,17 @@ public class CommonController {
|
|||
bizPath = "";
|
||||
}
|
||||
}
|
||||
//update-begin-author:liusq date:20221102 for: 过滤上传文件类型
|
||||
SsrfFileTypeFilter.checkUploadFileType(file);
|
||||
//update-end-author:liusq date:20221102 for: 过滤上传文件类型
|
||||
if(CommonConstant.UPLOAD_TYPE_LOCAL.equals(uploadType)){
|
||||
//update-begin-author:liusq date:20221102 for: 过滤上传文件类型
|
||||
SsrfFileTypeFilter.checkUploadFileType(file);
|
||||
//update-end-author:liusq date:20221102 for: 过滤上传文件类型
|
||||
//update-begin-author:lvdandan date:20200928 for:修改JEditor编辑器本地上传
|
||||
savePath = this.uploadLocal(file,bizPath);
|
||||
//update-begin-author:lvdandan date:20200928 for:修改JEditor编辑器本地上传
|
||||
/** 富文本编辑器及markdown本地上传时,采用返回链接方式
|
||||
//针对jeditor编辑器如何使 lcaol模式,采用 base64格式存储
|
||||
String jeditor = request.getParameter("jeditor");
|
||||
if(oConvertUtils.isNotEmpty(jeditor)){
|
||||
result.setMessage(CommonConstant.UPLOAD_TYPE_LOCAL);
|
||||
result.setSuccess(true);
|
||||
return result;
|
||||
}else{
|
||||
savePath = this.uploadLocal(file,bizPath);
|
||||
}
|
||||
*/
|
||||
}else{
|
||||
//update-begin-author:taoyan date:20200814 for:文件上传改造
|
||||
savePath = CommonUtils.upload(file, bizPath, uploadType);
|
||||
// savePath = this.uploadLocal(file,bizPath);
|
||||
savePath = uploadSftp(file, bizPath);
|
||||
//update-end-author:taoyan date:20200814 for:文件上传改造
|
||||
}
|
||||
if(oConvertUtils.isNotEmpty(savePath)){
|
||||
|
@ -137,6 +127,24 @@ public class CommonController {
|
|||
return result;
|
||||
}
|
||||
|
||||
|
||||
private String uploadSftp(MultipartFile mf,String bizPath){
|
||||
try {
|
||||
Map<String,String> uploadMap = SFTPUtil.upload(sftpConfig,mf,bizPath);
|
||||
SFTPUtil.disChannel();
|
||||
SFTPUtil.disSession();
|
||||
if(uploadMap.get("code").equals("0")){
|
||||
return uploadMap.get("data");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(), e);
|
||||
}finally {
|
||||
SFTPUtil.disChannel();
|
||||
SFTPUtil.disSession();
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
/**
|
||||
* 本地文件上传
|
||||
* @param mf 文件
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#code_generate_project_path
|
||||
project_path=E:\\workspace\\jeecg-boot
|
||||
project_path=D:\\javacode
|
||||
#bussi_package[User defined]
|
||||
bussi_package=org.jeecg.modules.tjbb
|
||||
bussi_package=org.jeecg.modules.demo
|
||||
|
||||
|
||||
#default code path
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,74 @@
|
|||
import { defHttp } from '/@/utils/http/axios';
|
||||
import { useMessage } from "/@/hooks/web/useMessage";
|
||||
|
||||
const { createConfirm } = useMessage();
|
||||
|
||||
enum Api {
|
||||
list = '/blJbzdjs/blJbzdjs/list',
|
||||
zjList = '/blJbzdjs/blJbzdjs/zjList',
|
||||
save='/blJbzdjs/blJbzdjs/add',
|
||||
edit='/blJbzdjs/blJbzdjs/edit',
|
||||
deleteOne = '/blJbzdjs/blJbzdjs/delete',
|
||||
deleteBatch = '/blJbzdjs/blJbzdjs/deleteBatch',
|
||||
importExcel = '/blJbzdjs/blJbzdjs/importExcel',
|
||||
exportXls = '/blJbzdjs/blJbzdjs/exportXls',
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出api
|
||||
* @param params
|
||||
*/
|
||||
export const getExportUrl = Api.exportXls;
|
||||
|
||||
/**
|
||||
* 导入api
|
||||
*/
|
||||
export const getImportUrl = Api.importExcel;
|
||||
|
||||
/**
|
||||
* 列表接口
|
||||
* @param params
|
||||
*/
|
||||
export const list = (params) => defHttp.get({ url: Api.list, params });
|
||||
export const zjList = (params) => defHttp.get({ url: Api.zjList, params });
|
||||
|
||||
/**
|
||||
* 删除单个
|
||||
* @param params
|
||||
* @param handleSuccess
|
||||
*/
|
||||
export const deleteOne = (params,handleSuccess) => {
|
||||
return defHttp.delete({url: Api.deleteOne, params}, {joinParamsToUrl: true}).then(() => {
|
||||
handleSuccess();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
* @param params
|
||||
* @param handleSuccess
|
||||
*/
|
||||
export const batchDelete = (params, handleSuccess) => {
|
||||
createConfirm({
|
||||
iconType: 'warning',
|
||||
title: '确认删除',
|
||||
content: '是否删除选中数据',
|
||||
okText: '确认',
|
||||
cancelText: '取消',
|
||||
onOk: () => {
|
||||
return defHttp.delete({url: Api.deleteBatch, data: params}, {joinParamsToUrl: true}).then(() => {
|
||||
handleSuccess();
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存或者更新
|
||||
* @param params
|
||||
* @param isUpdate
|
||||
*/
|
||||
export const saveOrUpdate = (params, isUpdate) => {
|
||||
let url = isUpdate ? Api.edit : Api.save;
|
||||
return defHttp.post({ url: url, params }, { isTransformResponse: false });
|
||||
}
|
|
@ -0,0 +1,74 @@
|
|||
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: 'dwmc'
|
||||
},
|
||||
{
|
||||
title: '制度名称',
|
||||
align: "center",
|
||||
dataIndex: 'zdmc'
|
||||
},
|
||||
{
|
||||
title: '执行时间',
|
||||
align: "center",
|
||||
dataIndex: 'zxsj',
|
||||
customRender:({text}) =>{
|
||||
text = !text ? "" : (text.length > 10 ? text.substr(0,10) : text);
|
||||
return text;
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '与教学管理文件汇编不一致说明',
|
||||
align: "center",
|
||||
dataIndex: 'sfyz_dictText'
|
||||
},
|
||||
{
|
||||
title: '状态',
|
||||
align: "center",
|
||||
dataIndex: 'status_dictText'
|
||||
},
|
||||
{
|
||||
title: '当年度修订情况',
|
||||
align: "center",
|
||||
dataIndex: 'years',
|
||||
customRender:({text,record}) =>{
|
||||
text = text+"年"+record.yearsType_dictText;
|
||||
return text;
|
||||
},
|
||||
},
|
||||
// {
|
||||
// title: '修订情况',
|
||||
// align: "center",
|
||||
// dataIndex: 'yearsType_dictText'
|
||||
// },
|
||||
// {
|
||||
// title: '附件',
|
||||
// align: "center",
|
||||
// dataIndex: 'filePath',
|
||||
// },
|
||||
// {
|
||||
// title: '文件服务器',
|
||||
// align: "center",
|
||||
// dataIndex: 'ftpPath',
|
||||
// },
|
||||
];
|
||||
|
||||
// 高级查询数据
|
||||
export const superQuerySchema = {
|
||||
dwmc: {title: '学院',order: 0,view: 'list', type: 'string',dictCode: '',},
|
||||
zdmc: {title: '制度名称',order: 1,view: 'text', type: 'string',},
|
||||
zxsj: {title: '执行时间',order: 2,view: 'date', type: 'string',},
|
||||
sfyz: {title: '与教学管理文件汇编不一致说明',order: 3,view: 'list', type: 'string',dictCode: 'yn',},
|
||||
status: {title: '状态',order: 4,view: 'list', type: 'string',dictCode: 'zd_status',},
|
||||
years: {title: '年度',order: 5,view: 'text', type: 'string',},
|
||||
yearsType: {title: '修订情况',order: 6,view: 'list', type: 'string',dictCode: 'zd_xdqk',},
|
||||
filePath: {title: '附件',order: 7,view: 'file', type: 'string',},
|
||||
ftpPath: {title: '文件服务器',order: 8,view: 'file', type: 'string',},
|
||||
};
|
|
@ -0,0 +1,289 @@
|
|||
<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-col :lg="6">
|
||||
<a-form-item name="dwmc">
|
||||
<template #label><span title="学院">学院</span></template>
|
||||
<j-dict-select-tag placeholder="请选择状态" v-model:value="queryParam.dwmc" dictCode="bl_kkdw,kkdw,kkdw" allow-clear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="6">
|
||||
<a-form-item name="zdmc">
|
||||
<template #label><span title="制度名称">制度名称</span></template>
|
||||
<j-input placeholder="请输入制度名称" v-model:value="queryParam.zdmc" allow-clear ></j-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="6">
|
||||
<a-form-item name="zxsj">
|
||||
<template #label><span title="执行时间">执行时间</span></template>
|
||||
<a-date-picker valueFormat="YYYY-MM-DD" placeholder="请选择执行时间" v-model:value="queryParam.zxsj" allow-clear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="6">
|
||||
<a-form-item name="status">
|
||||
<template #label><span title="状态">状态</span></template>
|
||||
<j-dict-select-tag placeholder="请选择状态" v-model:value="queryParam.status" dictCode="zd_status" allow-clear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="6">
|
||||
<a-form-item name="years">
|
||||
<template #label><span title="年度">年度</span></template>
|
||||
<a-date-picker placeholder="请选择执行时间" v-model:value="queryParam.years" value-format="YYYY" picker="year" style="width: 100%" allow-clear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="6">
|
||||
<a-form-item name="yearsType">
|
||||
<template #label><span title="修订情况">修订情况</span></template>
|
||||
<j-dict-select-tag placeholder="请选择修订情况" v-model:value="queryParam.yearsType" dictCode="zd_xdqk" 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="searchQuery">查询</a-button>
|
||||
<a-button type="primary" preIcon="ant-design:reload-outlined" @click="searchReset" style="margin-left: 8px">重置</a-button>
|
||||
</a-col>
|
||||
</span>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-form>
|
||||
</div>
|
||||
<!--引用表格-->
|
||||
<BasicTable @register="registerTable" >
|
||||
<!--插槽:table标题-->
|
||||
<template #tableTitle>
|
||||
<a-button type="primary" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button>
|
||||
</template>
|
||||
<!--操作栏-->
|
||||
<template #action="{ record }">
|
||||
<TableAction :actions="getTableAction(record)" />
|
||||
</template>
|
||||
<template v-slot:bodyCell="{ column, record, index, text }">
|
||||
<template v-if="column.dataIndex==='filePath'">
|
||||
<!--文件字段回显插槽-->
|
||||
<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>
|
||||
<a-button :ghost="true" type="primary" preIcon="ant-design:download-outlined" size="small" @click="handleYulan(text)">预览</a-button>
|
||||
</template>
|
||||
<template v-if="column.dataIndex==='ftpPath'">
|
||||
<!--文件字段回显插槽-->
|
||||
<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>
|
||||
<!-- 表单区域 -->
|
||||
<BlJbzdjsModal ref="registerModal" @success="handleSuccess"></BlJbzdjsModal>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" name="blJbzdjs-blJbzdjs" setup>
|
||||
import { ref, reactive } from 'vue';
|
||||
import { BasicTable, useTable, TableAction } from '/@/components/Table';
|
||||
import { useListPage } from '/@/hooks/system/useListPage';
|
||||
import { columns, superQuerySchema } from './BlJbzdjs.data';
|
||||
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './BlJbzdjs.api';
|
||||
import { downloadFile } from '/@/utils/common/renderUtils';
|
||||
import BlJbzdjsModal from './components/BlJbzdjsModal.vue'
|
||||
import { useUserStore } from '/@/store/modules/user';
|
||||
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
|
||||
import { getFileAccessHttpUrl } from '@/utils/common/compUtils';
|
||||
import { encryptByBase64 } from '@/utils/cipher';
|
||||
import JInput from '/@/components/Form/src/jeecg/components/JInput.vue';
|
||||
|
||||
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: 'bl_jbzdjs',
|
||||
api: list,
|
||||
columns,
|
||||
canResize:false,
|
||||
useSearchForm: false,
|
||||
actionColumn: {
|
||||
width: 220,
|
||||
},
|
||||
beforeFetch: async (params) => {
|
||||
return Object.assign(params, queryParam);
|
||||
},
|
||||
},
|
||||
exportConfig: {
|
||||
name: "bl_jbzdjs",
|
||||
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 handleYulan(record){
|
||||
var file = record.filePath;
|
||||
console.log("🚀 ~ handleChakan ~ record.ktbg:", file)
|
||||
var file1 = getFileAccessHttpUrl(file);
|
||||
var url = 'https://jxdd.nenu.edu.cn/onlinePreview/onlinePreview?url=' + encodeURIComponent(encryptByBase64(file1));
|
||||
window.open(url,"_blank");
|
||||
}
|
||||
|
||||
function handleXiazai(record){
|
||||
var file = record.filePath;
|
||||
downloadFile(file);
|
||||
}
|
||||
|
||||
/**
|
||||
* 操作栏
|
||||
*/
|
||||
function getTableAction(record) {
|
||||
return [
|
||||
{
|
||||
label: '编辑',
|
||||
onClick: handleEdit.bind(null, record),
|
||||
},{
|
||||
label: '删除',
|
||||
popConfirm: {
|
||||
title: '是否确认删除',
|
||||
confirm: handleDelete.bind(null, record),
|
||||
placement: 'topLeft',
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '下载',
|
||||
onClick: handleXiazai.bind(null, record),
|
||||
ifShow: () => {
|
||||
return record.filePath; // 根据业务控制是否显示: enable状态的显示禁用按钮
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '预览',
|
||||
onClick: handleYulan.bind(null, record),
|
||||
ifShow: () => {
|
||||
return record.filePath; // 根据业务控制是否显示: enable状态的显示禁用按钮
|
||||
},
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询
|
||||
*/
|
||||
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>
|
|
@ -0,0 +1,261 @@
|
|||
<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-col :lg="6">
|
||||
<a-form-item name="dwmc">
|
||||
<template #label><span title="学院">学院</span></template>
|
||||
<j-dict-select-tag placeholder="请选择状态" v-model:value="queryParam.dwmc" dictCode="bl_kkdw,kkdw,kkdw" allow-clear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="6">
|
||||
<a-form-item name="zdmc">
|
||||
<template #label><span title="制度名称">制度名称</span></template>
|
||||
<j-input placeholder="请输入制度名称" v-model:value="queryParam.zdmc" allow-clear ></j-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="6">
|
||||
<a-form-item name="zxsj">
|
||||
<template #label><span title="执行时间">执行时间</span></template>
|
||||
<a-date-picker valueFormat="YYYY-MM-DD" placeholder="请选择执行时间" v-model:value="queryParam.zxsj" allow-clear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="6">
|
||||
<a-form-item name="status">
|
||||
<template #label><span title="状态">状态</span></template>
|
||||
<j-dict-select-tag placeholder="请选择状态" v-model:value="queryParam.status" dictCode="zd_status" allow-clear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="6">
|
||||
<a-form-item name="years">
|
||||
<template #label><span title="年度">年度</span></template>
|
||||
<a-date-picker placeholder="请选择执行时间" v-model:value="queryParam.years" value-format="YYYY" picker="year" style="width: 100%" allow-clear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="6">
|
||||
<a-form-item name="yearsType">
|
||||
<template #label><span title="修订情况">修订情况</span></template>
|
||||
<j-dict-select-tag placeholder="请选择修订情况" v-model:value="queryParam.yearsType" dictCode="zd_xdqk" 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="searchQuery">查询</a-button>
|
||||
<a-button type="primary" preIcon="ant-design:reload-outlined" @click="searchReset" style="margin-left: 8px">重置</a-button>
|
||||
</a-col>
|
||||
</span>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-form>
|
||||
</div>
|
||||
<!--引用表格-->
|
||||
<BasicTable @register="registerTable" >
|
||||
<!--插槽:table标题-->
|
||||
<!--操作栏-->
|
||||
<template #action="{ record }">
|
||||
<TableAction :actions="getTableAction(record)" />
|
||||
</template>
|
||||
</BasicTable>
|
||||
<!-- 表单区域 -->
|
||||
<BlJbzdjsModal ref="registerModal" @success="handleSuccess"></BlJbzdjsModal>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" name="blJbzdjs-blJbzdjs" setup>
|
||||
import { ref, reactive } from 'vue';
|
||||
import { BasicTable, useTable, TableAction } from '/@/components/Table';
|
||||
import { useListPage } from '/@/hooks/system/useListPage';
|
||||
import { columns, superQuerySchema } from './BlJbzdjs.data';
|
||||
import { zjList, deleteOne, batchDelete, getImportUrl, getExportUrl } from './BlJbzdjs.api';
|
||||
import { downloadFile } from '/@/utils/common/renderUtils';
|
||||
import BlJbzdjsModal from './components/BlJbzdjsModal.vue'
|
||||
import { useUserStore } from '/@/store/modules/user';
|
||||
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
|
||||
import { getFileAccessHttpUrl } from '@/utils/common/compUtils';
|
||||
import { encryptByBase64 } from '@/utils/cipher';
|
||||
import JInput from '/@/components/Form/src/jeecg/components/JInput.vue';
|
||||
|
||||
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: {
|
||||
api: zjList,
|
||||
columns,
|
||||
canResize:false,
|
||||
useSearchForm: false,
|
||||
actionColumn: {
|
||||
width: 220,
|
||||
},
|
||||
beforeFetch: async (params) => {
|
||||
return Object.assign(params, queryParam);
|
||||
},
|
||||
},
|
||||
exportConfig: {
|
||||
name: "bl_jbzdjs",
|
||||
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 handleYulan(record){
|
||||
var file = record.filePath;
|
||||
console.log("🚀 ~ handleChakan ~ record.ktbg:", file)
|
||||
var file1 = getFileAccessHttpUrl(file);
|
||||
var url = 'https://jxdd.nenu.edu.cn/onlinePreview/onlinePreview?url=' + encodeURIComponent(encryptByBase64(file1));
|
||||
window.open(url,"_blank");
|
||||
}
|
||||
|
||||
function handleXiazai(record){
|
||||
var file = record.filePath;
|
||||
downloadFile(file);
|
||||
}
|
||||
|
||||
/**
|
||||
* 操作栏
|
||||
*/
|
||||
function getTableAction(record) {
|
||||
return [
|
||||
{
|
||||
label: '下载',
|
||||
onClick: handleXiazai.bind(null, record),
|
||||
ifShow: () => {
|
||||
return record.filePath; // 根据业务控制是否显示: enable状态的显示禁用按钮
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '预览',
|
||||
onClick: handleYulan.bind(null, record),
|
||||
ifShow: () => {
|
||||
return record.filePath; // 根据业务控制是否显示: enable状态的显示禁用按钮
|
||||
},
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询
|
||||
*/
|
||||
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>
|
|
@ -0,0 +1,200 @@
|
|||
<template>
|
||||
<a-spin :spinning="confirmLoading">
|
||||
<JFormContainer :disabled="disabled">
|
||||
<template #detail>
|
||||
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol" name="BlJbzdjsForm">
|
||||
<a-row>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="制度名称" v-bind="validateInfos.zdmc" id="BlJbzdjsForm-zdmc" name="zdmc">
|
||||
<a-input v-model:value="formData.zdmc" placeholder="请输入制度名称" allow-clear ></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="执行时间" v-bind="validateInfos.zxsj" id="BlJbzdjsForm-zxsj" name="zxsj">
|
||||
<a-date-picker placeholder="请选择执行时间" v-model:value="formData.zxsj" value-format="YYYY-MM-DD" style="width: 100%" allow-clear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="与教学管理文件汇编不一致说明" v-bind="validateInfos.sfyz" id="BlJbzdjsForm-sfyz" name="sfyz">
|
||||
<j-dict-select-tag v-model:value="formData.sfyz" dictCode="yn" placeholder="请选择与教学管理文件汇编不一致说明" allow-clear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="状态" v-bind="validateInfos.status" id="BlJbzdjsForm-status" name="status">
|
||||
<j-dict-select-tag v-model:value="formData.status" dictCode="zd_status" placeholder="请选择状态" allow-clear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="年度" v-bind="validateInfos.years" id="BlJbzdjsForm-years" name="years">
|
||||
<!-- <a-input v-model:value="formData.years" placeholder="请输入年度" allow-clear ></a-input> -->
|
||||
<a-date-picker placeholder="请选择执行时间" v-model:value="formData.years" value-format="YYYY" picker="year" style="width: 100%" allow-clear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="修订情况" v-bind="validateInfos.yearsType" id="BlJbzdjsForm-yearsType" name="yearsType">
|
||||
<j-dict-select-tag v-model:value="formData.yearsType" dictCode="zd_xdqk" placeholder="请选择修订情况" allow-clear />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="附件" v-bind="validateInfos.filePath" id="BlJbzdjsForm-filePath" name="filePath">
|
||||
<j-upload v-model:value="formData.filePath" :bizPath="dqnd" :max-count="1" ></j-upload>
|
||||
</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 JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
|
||||
import JUpload from '/@/components/Form/src/jeecg/components/JUpload/JUpload.vue';
|
||||
import { getValueType } from '/@/utils';
|
||||
import { saveOrUpdate } from '../BlJbzdjs.api';
|
||||
import { Form } from 'ant-design-vue';
|
||||
import JFormContainer from '/@/components/Form/src/container/JFormContainer.vue';
|
||||
import dayjs from 'dayjs';
|
||||
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: '',
|
||||
zdmc: '',
|
||||
zxsj: '',
|
||||
sfyz: '',
|
||||
status: '',
|
||||
years: '',
|
||||
yearsType: '',
|
||||
filePath: '',
|
||||
});
|
||||
const { createMessage } = useMessage();
|
||||
const labelCol = ref<any>({ xs: { span: 24 }, sm: { span: 8 } });
|
||||
const wrapperCol = ref<any>({ xs: { span: 24 }, sm: { span: 14 } });
|
||||
const confirmLoading = ref<boolean>(false);
|
||||
const dqnd = ref<string>('');
|
||||
//表单验证
|
||||
const validatorRules = reactive({
|
||||
zdmc: [{ required: true, message: '请输入制度名称!' }],
|
||||
zxsj: [{ required: true, message: '请选择执行时间!' }],
|
||||
sfyz: [{ required: true, message: '请选择与教学管理文件汇编不一致说明!' }],
|
||||
status: [{ required: true, message: '请选择状态!' }],
|
||||
years: [{ required: true, message: '请选择年度!' }],
|
||||
yearsType: [{ required: true, message: '请选择修订情况!' }],
|
||||
filePath: [{ required: true, message: '请选择附件!' }],
|
||||
});
|
||||
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;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
// 自动请求并暴露内部方法
|
||||
onMounted(() => {
|
||||
const temp = dayjs().format('YYYYMM');
|
||||
dqnd.value = "/jxdd/"+temp
|
||||
});
|
||||
|
||||
|
||||
defineExpose({
|
||||
add,
|
||||
edit,
|
||||
submitForm,
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.antd-modal-form {
|
||||
padding: 14px;
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,77 @@
|
|||
<template>
|
||||
<j-modal :title="title" :width="width" :visible="visible" @ok="handleOk" :okButtonProps="{ class: { 'jee-hidden': disableSubmit } }" @cancel="handleCancel" cancelText="关闭">
|
||||
<BlJbzdjsForm ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false"></BlJbzdjsForm>
|
||||
</j-modal>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, nextTick, defineExpose } from 'vue';
|
||||
import BlJbzdjsForm from './BlJbzdjsForm.vue'
|
||||
import JModal from '/@/components/Modal/src/JModal/JModal.vue';
|
||||
|
||||
const title = ref<string>('');
|
||||
const width = ref<number>(800);
|
||||
const visible = ref<boolean>(false);
|
||||
const disableSubmit = ref<boolean>(false);
|
||||
const registerForm = ref();
|
||||
const emit = defineEmits(['register', 'success']);
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
function add() {
|
||||
title.value = '新增';
|
||||
visible.value = true;
|
||||
nextTick(() => {
|
||||
registerForm.value.add();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
* @param record
|
||||
*/
|
||||
function edit(record) {
|
||||
title.value = disableSubmit.value ? '详情' : '编辑';
|
||||
visible.value = true;
|
||||
nextTick(() => {
|
||||
registerForm.value.edit(record);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 确定按钮点击事件
|
||||
*/
|
||||
function handleOk() {
|
||||
registerForm.value.submitForm();
|
||||
}
|
||||
|
||||
/**
|
||||
* form保存回调事件
|
||||
*/
|
||||
function submitCallback() {
|
||||
handleCancel();
|
||||
emit('success');
|
||||
}
|
||||
|
||||
/**
|
||||
* 取消按钮回调事件
|
||||
*/
|
||||
function handleCancel() {
|
||||
visible.value = false;
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
add,
|
||||
edit,
|
||||
disableSubmit,
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="less">
|
||||
/**隐藏样式-modal确定按钮 */
|
||||
.jee-hidden {
|
||||
display: none !important;
|
||||
}
|
||||
</style>
|
||||
<style lang="less" scoped></style>
|
|
@ -7,12 +7,12 @@
|
|||
<a-col :span="24" class="mdule-box" style="margin-bottom:10px;">
|
||||
<a-col :span="24">
|
||||
<a-form-item label="教工号" v-bind="validateInfos.zjNo" id="ZjSqxxForm-zjNo" name="zjNo">
|
||||
<a-input v-model:value="formData.zjNo" placeholder="请输入教工号" allow-clear ></a-input>
|
||||
<a-input v-model:value="formData.zjNo" placeholder="请输入教工号" readonly ></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="专家姓名" v-bind="validateInfos.zjName" id="ZjSqxxForm-zjName" name="zjName">
|
||||
<a-input v-model:value="formData.zjName" placeholder="请输入专家姓名" allow-clear ></a-input>
|
||||
<a-input v-model:value="formData.zjName" placeholder="请输入专家姓名" readonly></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-col>
|
||||
|
@ -218,6 +218,38 @@
|
|||
</a-col>
|
||||
</a-row>
|
||||
</a-col>
|
||||
<!-- 基本建设制度 -->
|
||||
<a-col :span="24" v-if="formData.sqfw == '4'" class="mdule-box">
|
||||
<a-row>
|
||||
<!-- <a-col :span="24">
|
||||
<a-form-item label="授权开始时间" id="ZjSqxxForm-sqStartTime" name="sqStartTime">
|
||||
<a-date-picker
|
||||
placeholder="请选择授权开始时间"
|
||||
v-model:value="formData.sqStartTime"
|
||||
value-format="YYYY-MM-DD"
|
||||
style="width: 100%"
|
||||
allow-clear
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="授权结束时间" id="ZjSqxxForm-sqEndTime" name="sqEndTime">
|
||||
<a-date-picker
|
||||
placeholder="请选择授权结束时间"
|
||||
v-model:value="formData.sqEndTime"
|
||||
value-format="YYYY-MM-DD"
|
||||
style="width: 100%"
|
||||
allow-clear
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-col> -->
|
||||
<a-col :span="24">
|
||||
<a-form-item label="开课单位" id="ZjSqxxForm-kkdw" name="kkdw">
|
||||
<JSelectMultiple v-model:value="formData.kkdw" placeholder="请选择开课单位,如果不选,默认全部" :dictCode="`bl_kkdw,kkdw,kkdw`"></JSelectMultiple>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-form>
|
||||
</template>
|
||||
|
|
|
@ -223,6 +223,43 @@
|
|||
</a-col>
|
||||
</a-row>
|
||||
</a-col>
|
||||
<!-- 基本制度建设 -->
|
||||
<a-col :span="24" v-if="item.sqfw == '4'">
|
||||
<a-row>
|
||||
<!-- <a-col :span="24">
|
||||
<a-form-item label="授权开始时间" id="ZjSqxxForm-sqStartTime" name="sqStartTime">
|
||||
<a-date-picker
|
||||
placeholder="请选择授权开始时间"
|
||||
v-model:value="item.sqStartTime"
|
||||
value-format="YYYY-MM-DD"
|
||||
style="width: 100%"
|
||||
allow-clear
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="授权结束时间" id="ZjSqxxForm-sqEndTime" name="sqEndTime">
|
||||
<a-date-picker
|
||||
placeholder="请选择授权结束时间"
|
||||
v-model:value="item.sqEndTime"
|
||||
value-format="YYYY-MM-DD"
|
||||
style="width: 100%"
|
||||
allow-clear
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-col> -->
|
||||
<!-- <a-col :span="24">
|
||||
<a-form-item label="学年学期" id="ZjSqxxForm-xnxq" name="xnxq">
|
||||
<JSelectMultiple v-model:value="item.xnxq" placeholder="请选择学年学期,如果不选,默认全部" :dictCode="`v_xqxn,xqxn,xqxn`"></JSelectMultiple>
|
||||
</a-form-item>
|
||||
</a-col> -->
|
||||
<a-col :span="24">
|
||||
<a-form-item label="开课单位" id="ZjSqxxForm-kkdw" name="kkdw">
|
||||
<JSelectMultiple v-model:value="item.kkdw" placeholder="请选择开课单位,如果不选,默认全部" :dictCode="`bl_kkdw,kkdw,kkdw`"></JSelectMultiple>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-form>
|
||||
</template>
|
||||
|
|
|
@ -54,6 +54,11 @@ export const columns: BasicColumn[] = [
|
|||
dataIndex: 'status_dictText',
|
||||
width: 80,
|
||||
},
|
||||
{
|
||||
title: '所属院校',
|
||||
dataIndex: 'departIds',
|
||||
width: 80,
|
||||
},
|
||||
];
|
||||
|
||||
export const recycleColumns: BasicColumn[] = [
|
||||
|
@ -209,36 +214,13 @@ export const formSchema: FormSchema[] = [
|
|||
]
|
||||
},
|
||||
{
|
||||
label: '所属部门',
|
||||
field: 'selecteddeparts',
|
||||
component: 'JSelectDept',
|
||||
componentProps: ({ formActionType, formModel }) => {
|
||||
return {
|
||||
sync: false,
|
||||
checkStrictly: true,
|
||||
defaultExpandLevel: 2,
|
||||
|
||||
onSelect: (options, values) => {
|
||||
const { updateSchema } = formActionType;
|
||||
//所属部门修改后更新负责部门下拉框数据
|
||||
updateSchema([
|
||||
{
|
||||
field: 'departIds',
|
||||
componentProps: { options },
|
||||
},
|
||||
]);
|
||||
//update-begin---author:wangshuai---date:2024-05-11---for:【issues/1222】用户编辑界面“所属部门”与“负责部门”联动出错整---
|
||||
if(!values){
|
||||
formModel.departIds = [];
|
||||
return;
|
||||
}
|
||||
//update-end---author:wangshuai---date:2024-05-11---for:【issues/1222】用户编辑界面“所属部门”与“负责部门”联动出错整---
|
||||
//所属部门修改后更新负责部门数据
|
||||
formModel.departIds && (formModel.departIds = formModel.departIds.filter((item) => values.value.indexOf(item) > -1));
|
||||
},
|
||||
};
|
||||
label: '所属院校',
|
||||
field: 'departIds',
|
||||
component: 'JDictSelectTag',
|
||||
componentProps: {
|
||||
dictCode: 'bl_kkdw,kkdw,kkdw',
|
||||
placeholder: '请选择所属院校',
|
||||
},
|
||||
ifShow: false,
|
||||
},
|
||||
{
|
||||
label: '租户',
|
||||
|
|
Loading…
Reference in New Issue