update 优化 调整模块结构 细化core模块
parent
e377a8d1dd
commit
e0197638a4
|
|
@ -2,17 +2,14 @@ package org.dromara.system.api.domain.bo;
|
||||||
|
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
import org.dromara.common.core.annotation.Sensitive;
|
|
||||||
import org.dromara.common.core.constant.UserConstants;
|
import org.dromara.common.core.constant.UserConstants;
|
||||||
import org.dromara.common.core.enums.SensitiveStrategy;
|
|
||||||
import org.dromara.common.core.web.domain.BaseEntity;
|
|
||||||
import org.dromara.common.core.xss.Xss;
|
import org.dromara.common.core.xss.Xss;
|
||||||
|
|
||||||
import javax.validation.constraints.Email;
|
import javax.validation.constraints.Email;
|
||||||
import javax.validation.constraints.NotBlank;
|
import javax.validation.constraints.NotBlank;
|
||||||
import javax.validation.constraints.Size;
|
import javax.validation.constraints.Size;
|
||||||
|
import java.io.Serializable;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -23,8 +20,7 @@ import java.util.Date;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@EqualsAndHashCode(callSuper = true)
|
public class RemoteUserBo implements Serializable {
|
||||||
public class RemoteUserBo extends BaseEntity {
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户ID
|
* 用户ID
|
||||||
|
|
@ -64,7 +60,6 @@ public class RemoteUserBo extends BaseEntity {
|
||||||
/**
|
/**
|
||||||
* 用户邮箱
|
* 用户邮箱
|
||||||
*/
|
*/
|
||||||
@Sensitive(strategy = SensitiveStrategy.EMAIL)
|
|
||||||
@Email(message = "邮箱格式不正确")
|
@Email(message = "邮箱格式不正确")
|
||||||
@Size(min = 0, max = 50, message = "邮箱长度不能超过{max}个字符")
|
@Size(min = 0, max = 50, message = "邮箱长度不能超过{max}个字符")
|
||||||
private String email;
|
private String email;
|
||||||
|
|
@ -72,7 +67,6 @@ public class RemoteUserBo extends BaseEntity {
|
||||||
/**
|
/**
|
||||||
* 手机号码
|
* 手机号码
|
||||||
*/
|
*/
|
||||||
@Sensitive(strategy = SensitiveStrategy.PHONE)
|
|
||||||
private String phonenumber;
|
private String phonenumber;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -35,6 +35,8 @@
|
||||||
<module>ruoyi-common-skylog</module>
|
<module>ruoyi-common-skylog</module>
|
||||||
<module>ruoyi-common-prometheus</module>
|
<module>ruoyi-common-prometheus</module>
|
||||||
<module>ruoyi-common-translation</module>
|
<module>ruoyi-common-translation</module>
|
||||||
|
<module>ruoyi-common-sensitive</module>
|
||||||
|
<module>ruoyi-common-json</module>
|
||||||
<module>ruoyi-common-encrypt</module>
|
<module>ruoyi-common-encrypt</module>
|
||||||
<module>ruoyi-common-tenant</module>
|
<module>ruoyi-common-tenant</module>
|
||||||
</modules>
|
</modules>
|
||||||
|
|
|
||||||
|
|
@ -172,6 +172,20 @@
|
||||||
<version>${revision}</version>
|
<version>${revision}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<!-- 脱敏模块 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.dromara</groupId>
|
||||||
|
<artifactId>ruoyi-common-sensitive</artifactId>
|
||||||
|
<version>${revision}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- 序列化模块 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.dromara</groupId>
|
||||||
|
<artifactId>ruoyi-common-json</artifactId>
|
||||||
|
<version>${revision}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.dromara</groupId>
|
<groupId>org.dromara</groupId>
|
||||||
<artifactId>ruoyi-common-encrypt</artifactId>
|
<artifactId>ruoyi-common-encrypt</artifactId>
|
||||||
|
|
|
||||||
|
|
@ -45,16 +45,6 @@
|
||||||
<artifactId>spring-boot-starter-validation</artifactId>
|
<artifactId>spring-boot-starter-validation</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- Jackson -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.fasterxml.jackson.core</groupId>
|
|
||||||
<artifactId>jackson-databind</artifactId>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.fasterxml.jackson.datatype</groupId>
|
|
||||||
<artifactId>jackson-datatype-jsr310</artifactId>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- Jaxb -->
|
<!-- Jaxb -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>javax.xml.bind</groupId>
|
<groupId>javax.xml.bind</groupId>
|
||||||
|
|
|
||||||
|
|
@ -1,39 +0,0 @@
|
||||||
package org.dromara.common.core.web.domain;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.EqualsAndHashCode;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Tree基类
|
|
||||||
*
|
|
||||||
* @author Lion Li
|
|
||||||
*/
|
|
||||||
|
|
||||||
@Data
|
|
||||||
@EqualsAndHashCode(callSuper = true)
|
|
||||||
public class TreeEntity<T> extends BaseEntity {
|
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 父菜单名称
|
|
||||||
*/
|
|
||||||
@TableField(exist = false)
|
|
||||||
private String parentName;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 父菜单ID
|
|
||||||
*/
|
|
||||||
private Long parentId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 子部门
|
|
||||||
*/
|
|
||||||
@TableField(exist = false)
|
|
||||||
private List<T> children = new ArrayList<>();
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,5 +1,4 @@
|
||||||
org.dromara.common.core.utils.SpringUtils
|
org.dromara.common.core.utils.SpringUtils
|
||||||
org.dromara.common.core.config.ApplicationConfig
|
org.dromara.common.core.config.ApplicationConfig
|
||||||
org.dromara.common.core.config.JacksonConfig
|
|
||||||
org.dromara.common.core.config.ValidatorConfig
|
org.dromara.common.core.config.ValidatorConfig
|
||||||
org.dromara.common.core.config.AsyncConfig
|
org.dromara.common.core.config.AsyncConfig
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.dromara</groupId>
|
<groupId>org.dromara</groupId>
|
||||||
<artifactId>ruoyi-common-core</artifactId>
|
<artifactId>ruoyi-common-json</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
package org.dromara.common.dubbo.filter;
|
package org.dromara.common.dubbo.filter;
|
||||||
|
|
||||||
import org.dromara.common.core.utils.JsonUtils;
|
|
||||||
import org.dromara.common.core.utils.SpringUtils;
|
import org.dromara.common.core.utils.SpringUtils;
|
||||||
import org.dromara.common.dubbo.enumd.RequestLogEnum;
|
import org.dromara.common.dubbo.enumd.RequestLogEnum;
|
||||||
import org.dromara.common.dubbo.properties.DubboCustomProperties;
|
import org.dromara.common.dubbo.properties.DubboCustomProperties;
|
||||||
|
|
@ -9,6 +8,7 @@ import org.apache.dubbo.common.constants.CommonConstants;
|
||||||
import org.apache.dubbo.common.extension.Activate;
|
import org.apache.dubbo.common.extension.Activate;
|
||||||
import org.apache.dubbo.rpc.*;
|
import org.apache.dubbo.rpc.*;
|
||||||
import org.apache.dubbo.rpc.service.GenericService;
|
import org.apache.dubbo.rpc.service.GenericService;
|
||||||
|
import org.dromara.common.json.utils.JsonUtils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* dubbo日志过滤器
|
* dubbo日志过滤器
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.dromara</groupId>
|
<groupId>org.dromara</groupId>
|
||||||
<artifactId>ruoyi-common-core</artifactId>
|
<artifactId>ruoyi-common-json</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
|
|
|
||||||
|
|
@ -5,11 +5,11 @@ import com.alibaba.excel.context.AnalysisContext;
|
||||||
import com.alibaba.excel.event.AnalysisEventListener;
|
import com.alibaba.excel.event.AnalysisEventListener;
|
||||||
import com.alibaba.excel.exception.ExcelAnalysisException;
|
import com.alibaba.excel.exception.ExcelAnalysisException;
|
||||||
import com.alibaba.excel.exception.ExcelDataConvertException;
|
import com.alibaba.excel.exception.ExcelDataConvertException;
|
||||||
import org.dromara.common.core.utils.JsonUtils;
|
|
||||||
import org.dromara.common.core.utils.StreamUtils;
|
import org.dromara.common.core.utils.StreamUtils;
|
||||||
import org.dromara.common.core.utils.ValidatorUtils;
|
import org.dromara.common.core.utils.ValidatorUtils;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.dromara.common.json.utils.JsonUtils;
|
||||||
|
|
||||||
import javax.validation.ConstraintViolation;
|
import javax.validation.ConstraintViolation;
|
||||||
import javax.validation.ConstraintViolationException;
|
import javax.validation.ConstraintViolationException;
|
||||||
|
|
|
||||||
|
|
@ -17,10 +17,9 @@
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
|
||||||
<!-- SpringBoot core -->
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.dromara</groupId>
|
<groupId>org.dromara</groupId>
|
||||||
<artifactId>ruoyi-common-core</artifactId>
|
<artifactId>ruoyi-common-json</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
|
|
|
||||||
|
|
@ -11,11 +11,11 @@ import org.aspectj.lang.annotation.Before;
|
||||||
import org.dromara.common.core.constant.GlobalConstants;
|
import org.dromara.common.core.constant.GlobalConstants;
|
||||||
import org.dromara.common.core.domain.R;
|
import org.dromara.common.core.domain.R;
|
||||||
import org.dromara.common.core.exception.ServiceException;
|
import org.dromara.common.core.exception.ServiceException;
|
||||||
import org.dromara.common.core.utils.JsonUtils;
|
|
||||||
import org.dromara.common.core.utils.MessageUtils;
|
import org.dromara.common.core.utils.MessageUtils;
|
||||||
import org.dromara.common.core.utils.ServletUtils;
|
import org.dromara.common.core.utils.ServletUtils;
|
||||||
import org.dromara.common.core.utils.StringUtils;
|
import org.dromara.common.core.utils.StringUtils;
|
||||||
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
||||||
|
import org.dromara.common.json.utils.JsonUtils;
|
||||||
import org.dromara.common.redis.utils.RedisUtils;
|
import org.dromara.common.redis.utils.RedisUtils;
|
||||||
import org.springframework.validation.BindingResult;
|
import org.springframework.validation.BindingResult;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,37 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<parent>
|
||||||
|
<groupId>org.dromara</groupId>
|
||||||
|
<artifactId>ruoyi-common</artifactId>
|
||||||
|
<version>${revision}</version>
|
||||||
|
</parent>
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
<artifactId>ruoyi-common-json</artifactId>
|
||||||
|
|
||||||
|
<description>
|
||||||
|
ruoyi-common-json 序列化模块
|
||||||
|
</description>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.dromara</groupId>
|
||||||
|
<artifactId>ruoyi-common-core</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- JSON工具类 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.fasterxml.jackson.core</groupId>
|
||||||
|
<artifactId>jackson-databind</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.fasterxml.jackson.datatype</groupId>
|
||||||
|
<artifactId>jackson-datatype-jsr310</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
|
</project>
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
package org.dromara.common.core.config;
|
package org.dromara.common.json.config;
|
||||||
|
|
||||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||||
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
|
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
|
||||||
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
|
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
|
||||||
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
|
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
|
||||||
import org.dromara.common.core.jackson.BigNumberSerializer;
|
import org.dromara.common.json.handler.BigNumberSerializer;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||||
import org.springframework.boot.autoconfigure.jackson.Jackson2ObjectMapperBuilderCustomizer;
|
import org.springframework.boot.autoconfigure.jackson.Jackson2ObjectMapperBuilderCustomizer;
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
package org.dromara.common.core.jackson;
|
package org.dromara.common.json.handler;
|
||||||
|
|
||||||
import com.fasterxml.jackson.core.JsonGenerator;
|
import com.fasterxml.jackson.core.JsonGenerator;
|
||||||
import com.fasterxml.jackson.databind.SerializerProvider;
|
import com.fasterxml.jackson.databind.SerializerProvider;
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
package org.dromara.common.core.utils;
|
package org.dromara.common.json.utils;
|
||||||
|
|
||||||
import cn.hutool.core.lang.Dict;
|
import cn.hutool.core.lang.Dict;
|
||||||
import cn.hutool.core.util.ArrayUtil;
|
import cn.hutool.core.util.ArrayUtil;
|
||||||
|
|
@ -7,6 +7,8 @@ import com.fasterxml.jackson.core.JsonProcessingException;
|
||||||
import com.fasterxml.jackson.core.type.TypeReference;
|
import com.fasterxml.jackson.core.type.TypeReference;
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
import com.fasterxml.jackson.databind.exc.MismatchedInputException;
|
import com.fasterxml.jackson.databind.exc.MismatchedInputException;
|
||||||
|
import org.dromara.common.core.utils.SpringUtils;
|
||||||
|
import org.dromara.common.core.utils.StringUtils;
|
||||||
import lombok.AccessLevel;
|
import lombok.AccessLevel;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
|
@ -22,7 +24,7 @@ import java.util.List;
|
||||||
@NoArgsConstructor(access = AccessLevel.PRIVATE)
|
@NoArgsConstructor(access = AccessLevel.PRIVATE)
|
||||||
public class JsonUtils {
|
public class JsonUtils {
|
||||||
|
|
||||||
private static ObjectMapper OBJECT_MAPPER = SpringUtils.getBean(ObjectMapper.class);
|
private static final ObjectMapper OBJECT_MAPPER = SpringUtils.getBean(ObjectMapper.class);
|
||||||
|
|
||||||
public static ObjectMapper getObjectMapper() {
|
public static ObjectMapper getObjectMapper() {
|
||||||
return OBJECT_MAPPER;
|
return OBJECT_MAPPER;
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
org.dromara.common.json.config.JacksonConfig
|
||||||
|
|
@ -17,10 +17,14 @@
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
|
||||||
<!-- RuoYi Common Security -->
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.dromara</groupId>
|
<groupId>org.dromara</groupId>
|
||||||
<artifactId>ruoyi-common-security</artifactId>
|
<artifactId>ruoyi-common-satoken</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.dromara</groupId>
|
||||||
|
<artifactId>ruoyi-common-json</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
|
|
|
||||||
|
|
@ -3,11 +3,11 @@ package org.dromara.common.log.aspect;
|
||||||
import cn.hutool.core.lang.Dict;
|
import cn.hutool.core.lang.Dict;
|
||||||
import cn.hutool.core.map.MapUtil;
|
import cn.hutool.core.map.MapUtil;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import org.dromara.common.core.utils.JsonUtils;
|
|
||||||
import org.dromara.common.core.utils.ServletUtils;
|
import org.dromara.common.core.utils.ServletUtils;
|
||||||
import org.dromara.common.core.utils.SpringUtils;
|
import org.dromara.common.core.utils.SpringUtils;
|
||||||
import org.dromara.common.core.utils.StringUtils;
|
import org.dromara.common.core.utils.StringUtils;
|
||||||
import org.dromara.common.core.utils.ip.AddressUtils;
|
import org.dromara.common.core.utils.ip.AddressUtils;
|
||||||
|
import org.dromara.common.json.utils.JsonUtils;
|
||||||
import org.dromara.common.log.annotation.Log;
|
import org.dromara.common.log.annotation.Log;
|
||||||
import org.dromara.common.log.enums.BusinessStatus;
|
import org.dromara.common.log.enums.BusinessStatus;
|
||||||
import org.dromara.common.log.event.OperLogEvent;
|
import org.dromara.common.log.event.OperLogEvent;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
package org.dromara.common.core.web.domain;
|
package org.dromara.common.mybatis.core.domain;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
|
@ -6,7 +6,7 @@ import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.ibatis.reflection.MetaObject;
|
import org.apache.ibatis.reflection.MetaObject;
|
||||||
import org.dromara.common.core.exception.ServiceException;
|
import org.dromara.common.core.exception.ServiceException;
|
||||||
import org.dromara.common.core.web.domain.BaseEntity;
|
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||||
import org.dromara.common.satoken.utils.LoginHelper;
|
import org.dromara.common.satoken.utils.LoginHelper;
|
||||||
import org.dromara.system.api.model.LoginUser;
|
import org.dromara.system.api.model.LoginUser;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,11 @@
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.dromara</groupId>
|
||||||
|
<artifactId>ruoyi-common-json</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.dromara</groupId>
|
<groupId>org.dromara</groupId>
|
||||||
<artifactId>ruoyi-common-redis</artifactId>
|
<artifactId>ruoyi-common-redis</artifactId>
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
package org.dromara.common.oss.factory;
|
package org.dromara.common.oss.factory;
|
||||||
|
|
||||||
import org.dromara.common.core.constant.CacheNames;
|
import org.dromara.common.core.constant.CacheNames;
|
||||||
import org.dromara.common.core.utils.JsonUtils;
|
|
||||||
import org.dromara.common.core.utils.StringUtils;
|
import org.dromara.common.core.utils.StringUtils;
|
||||||
|
import org.dromara.common.json.utils.JsonUtils;
|
||||||
import org.dromara.common.oss.constant.OssConstant;
|
import org.dromara.common.oss.constant.OssConstant;
|
||||||
import org.dromara.common.oss.core.OssClient;
|
import org.dromara.common.oss.core.OssClient;
|
||||||
import org.dromara.common.oss.exception.OssException;
|
import org.dromara.common.oss.exception.OssException;
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,25 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<parent>
|
||||||
|
<groupId>org.dromara</groupId>
|
||||||
|
<artifactId>ruoyi-common</artifactId>
|
||||||
|
<version>${revision}</version>
|
||||||
|
</parent>
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
<artifactId>ruoyi-common-sensitive</artifactId>
|
||||||
|
|
||||||
|
<description>
|
||||||
|
ruoyi-common-sensitive 脱敏模块
|
||||||
|
</description>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.dromara</groupId>
|
||||||
|
<artifactId>ruoyi-common-json</artifactId>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
|
</project>
|
||||||
|
|
@ -1,9 +1,9 @@
|
||||||
package org.dromara.common.core.annotation;
|
package org.dromara.common.sensitive.annotation;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JacksonAnnotationsInside;
|
import com.fasterxml.jackson.annotation.JacksonAnnotationsInside;
|
||||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||||
import org.dromara.common.core.enums.SensitiveStrategy;
|
import org.dromara.common.sensitive.core.SensitiveStrategy;
|
||||||
import org.dromara.common.core.jackson.SensitiveJsonSerializer;
|
import org.dromara.common.sensitive.handler.SensitiveHandler;
|
||||||
|
|
||||||
import java.lang.annotation.ElementType;
|
import java.lang.annotation.ElementType;
|
||||||
import java.lang.annotation.Retention;
|
import java.lang.annotation.Retention;
|
||||||
|
|
@ -13,12 +13,12 @@ import java.lang.annotation.Target;
|
||||||
/**
|
/**
|
||||||
* 数据脱敏注解
|
* 数据脱敏注解
|
||||||
*
|
*
|
||||||
* @author Lion Li
|
* @author zhujie
|
||||||
*/
|
*/
|
||||||
@Retention(RetentionPolicy.RUNTIME)
|
@Retention(RetentionPolicy.RUNTIME)
|
||||||
@Target(ElementType.FIELD)
|
@Target(ElementType.FIELD)
|
||||||
@JacksonAnnotationsInside
|
@JacksonAnnotationsInside
|
||||||
@JsonSerialize(using = SensitiveJsonSerializer.class)
|
@JsonSerialize(using = SensitiveHandler.class)
|
||||||
public @interface Sensitive {
|
public @interface Sensitive {
|
||||||
SensitiveStrategy strategy();
|
SensitiveStrategy strategy();
|
||||||
}
|
}
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
package org.dromara.common.core.service;
|
package org.dromara.common.sensitive.core;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 脱敏服务
|
* 脱敏服务
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
package org.dromara.common.core.enums;
|
package org.dromara.common.sensitive.core;
|
||||||
|
|
||||||
import cn.hutool.core.util.DesensitizedUtil;
|
import cn.hutool.core.util.DesensitizedUtil;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
|
|
@ -9,6 +9,7 @@ import java.util.function.Function;
|
||||||
* 脱敏策略
|
* 脱敏策略
|
||||||
*
|
*
|
||||||
* @author Yjoioooo
|
* @author Yjoioooo
|
||||||
|
* @version 3.6.0
|
||||||
*/
|
*/
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public enum SensitiveStrategy {
|
public enum SensitiveStrategy {
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
package org.dromara.common.core.jackson;
|
package org.dromara.common.sensitive.handler;
|
||||||
|
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import com.fasterxml.jackson.core.JsonGenerator;
|
import com.fasterxml.jackson.core.JsonGenerator;
|
||||||
|
|
@ -7,10 +7,10 @@ import com.fasterxml.jackson.databind.JsonMappingException;
|
||||||
import com.fasterxml.jackson.databind.JsonSerializer;
|
import com.fasterxml.jackson.databind.JsonSerializer;
|
||||||
import com.fasterxml.jackson.databind.SerializerProvider;
|
import com.fasterxml.jackson.databind.SerializerProvider;
|
||||||
import com.fasterxml.jackson.databind.ser.ContextualSerializer;
|
import com.fasterxml.jackson.databind.ser.ContextualSerializer;
|
||||||
import org.dromara.common.core.annotation.Sensitive;
|
|
||||||
import org.dromara.common.core.enums.SensitiveStrategy;
|
|
||||||
import org.dromara.common.core.service.SensitiveService;
|
|
||||||
import org.dromara.common.core.utils.SpringUtils;
|
import org.dromara.common.core.utils.SpringUtils;
|
||||||
|
import org.dromara.common.sensitive.annotation.Sensitive;
|
||||||
|
import org.dromara.common.sensitive.core.SensitiveService;
|
||||||
|
import org.dromara.common.sensitive.core.SensitiveStrategy;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.BeansException;
|
import org.springframework.beans.BeansException;
|
||||||
|
|
||||||
|
|
@ -23,7 +23,7 @@ import java.util.Objects;
|
||||||
* @author Yjoioooo
|
* @author Yjoioooo
|
||||||
*/
|
*/
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class SensitiveJsonSerializer extends JsonSerializer<String> implements ContextualSerializer {
|
public class SensitiveHandler extends JsonSerializer<String> implements ContextualSerializer {
|
||||||
|
|
||||||
private SensitiveStrategy strategy;
|
private SensitiveStrategy strategy;
|
||||||
|
|
||||||
|
|
@ -19,7 +19,7 @@
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.dromara</groupId>
|
<groupId>org.dromara</groupId>
|
||||||
<artifactId>ruoyi-common-core</artifactId>
|
<artifactId>ruoyi-common-json</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
|
|
|
||||||
|
|
@ -4,8 +4,8 @@ import com.aliyun.dysmsapi20170525.Client;
|
||||||
import com.aliyun.dysmsapi20170525.models.SendSmsRequest;
|
import com.aliyun.dysmsapi20170525.models.SendSmsRequest;
|
||||||
import com.aliyun.dysmsapi20170525.models.SendSmsResponse;
|
import com.aliyun.dysmsapi20170525.models.SendSmsResponse;
|
||||||
import com.aliyun.teaopenapi.models.Config;
|
import com.aliyun.teaopenapi.models.Config;
|
||||||
import org.dromara.common.core.utils.JsonUtils;
|
|
||||||
import org.dromara.common.core.utils.StringUtils;
|
import org.dromara.common.core.utils.StringUtils;
|
||||||
|
import org.dromara.common.json.utils.JsonUtils;
|
||||||
import org.dromara.common.sms.config.properties.SmsProperties;
|
import org.dromara.common.sms.config.properties.SmsProperties;
|
||||||
import org.dromara.common.sms.entity.SmsResult;
|
import org.dromara.common.sms.entity.SmsResult;
|
||||||
import org.dromara.common.sms.exception.SmsException;
|
import org.dromara.common.sms.exception.SmsException;
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,8 @@ package org.dromara.common.sms.core;
|
||||||
|
|
||||||
import cn.hutool.core.collection.CollUtil;
|
import cn.hutool.core.collection.CollUtil;
|
||||||
import cn.hutool.core.util.ArrayUtil;
|
import cn.hutool.core.util.ArrayUtil;
|
||||||
import org.dromara.common.core.utils.JsonUtils;
|
|
||||||
import org.dromara.common.core.utils.StringUtils;
|
import org.dromara.common.core.utils.StringUtils;
|
||||||
|
import org.dromara.common.json.utils.JsonUtils;
|
||||||
import org.dromara.common.sms.config.properties.SmsProperties;
|
import org.dromara.common.sms.config.properties.SmsProperties;
|
||||||
import org.dromara.common.sms.entity.SmsResult;
|
import org.dromara.common.sms.entity.SmsResult;
|
||||||
import org.dromara.common.sms.exception.SmsException;
|
import org.dromara.common.sms.exception.SmsException;
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
package org.dromara.common.tenant.core;
|
package org.dromara.common.tenant.core;
|
||||||
|
|
||||||
import org.dromara.common.core.web.domain.BaseEntity;
|
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.dromara</groupId>
|
<groupId>org.dromara</groupId>
|
||||||
<artifactId>ruoyi-common-core</artifactId>
|
<artifactId>ruoyi-common-json</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,11 @@
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.dromara</groupId>
|
||||||
|
<artifactId>ruoyi-common-json</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<!-- SpringBoot Web容器 -->
|
<!-- SpringBoot Web容器 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
package org.dromara.common.core.web.controller;
|
package org.dromara.common.web.core;
|
||||||
|
|
||||||
import org.dromara.common.core.domain.R;
|
import org.dromara.common.core.domain.R;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
@ -100,6 +100,11 @@
|
||||||
<artifactId>ruoyi-common-elasticsearch</artifactId>
|
<artifactId>ruoyi-common-elasticsearch</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.dromara</groupId>
|
||||||
|
<artifactId>ruoyi-common-sensitive</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-starter-test</artifactId>
|
<artifactId>spring-boot-starter-test</artifactId>
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ package org.dromara.demo.controller;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import org.dromara.common.core.domain.R;
|
import org.dromara.common.core.domain.R;
|
||||||
import org.dromara.common.core.web.controller.BaseController;
|
import org.dromara.common.web.core.BaseController;
|
||||||
import org.dromara.demo.domain.TestDemo;
|
import org.dromara.demo.domain.TestDemo;
|
||||||
import org.dromara.demo.mapper.TestDemoMapper;
|
import org.dromara.demo.mapper.TestDemoMapper;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ import org.dromara.common.core.utils.ValidatorUtils;
|
||||||
import org.dromara.common.core.validate.AddGroup;
|
import org.dromara.common.core.validate.AddGroup;
|
||||||
import org.dromara.common.core.validate.EditGroup;
|
import org.dromara.common.core.validate.EditGroup;
|
||||||
import org.dromara.common.core.validate.QueryGroup;
|
import org.dromara.common.core.validate.QueryGroup;
|
||||||
import org.dromara.common.core.web.controller.BaseController;
|
import org.dromara.common.web.core.BaseController;
|
||||||
import org.dromara.common.excel.core.ExcelResult;
|
import org.dromara.common.excel.core.ExcelResult;
|
||||||
import org.dromara.common.excel.utils.ExcelUtil;
|
import org.dromara.common.excel.utils.ExcelUtil;
|
||||||
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,9 @@
|
||||||
package org.dromara.demo.controller;
|
package org.dromara.demo.controller;
|
||||||
|
|
||||||
import org.dromara.common.core.annotation.Sensitive;
|
|
||||||
import org.dromara.common.core.domain.R;
|
import org.dromara.common.core.domain.R;
|
||||||
import org.dromara.common.core.enums.SensitiveStrategy;
|
import org.dromara.common.sensitive.annotation.Sensitive;
|
||||||
import org.dromara.common.core.web.controller.BaseController;
|
import org.dromara.common.sensitive.core.SensitiveStrategy;
|
||||||
|
import org.dromara.common.web.core.BaseController;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
|
@ -17,7 +17,7 @@ import org.springframework.web.bind.annotation.RestController;
|
||||||
*
|
*
|
||||||
* @author Lion Li
|
* @author Lion Li
|
||||||
* @version 3.6.0
|
* @version 3.6.0
|
||||||
* @see org.dromara.common.core.service.SensitiveService
|
* @see org.dromara.common.sensitive.core.SensitiveService
|
||||||
*/
|
*/
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/demo/sensitive")
|
@RequestMapping("/demo/sensitive")
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||||
import org.dromara.common.core.domain.R;
|
import org.dromara.common.core.domain.R;
|
||||||
import org.dromara.common.core.validate.AddGroup;
|
import org.dromara.common.core.validate.AddGroup;
|
||||||
import org.dromara.common.core.validate.EditGroup;
|
import org.dromara.common.core.validate.EditGroup;
|
||||||
import org.dromara.common.core.web.controller.BaseController;
|
import org.dromara.common.web.core.BaseController;
|
||||||
import org.dromara.common.excel.utils.ExcelUtil;
|
import org.dromara.common.excel.utils.ExcelUtil;
|
||||||
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
||||||
import org.dromara.common.log.annotation.Log;
|
import org.dromara.common.log.annotation.Log;
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
package org.dromara.demo.domain;
|
package org.dromara.demo.domain;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.*;
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
import org.dromara.common.core.web.domain.BaseEntity;
|
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,9 +4,9 @@ import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import com.baomidou.mybatisplus.annotation.Version;
|
import com.baomidou.mybatisplus.annotation.Version;
|
||||||
import org.dromara.common.core.web.domain.TreeEntity;
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
|
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 测试树表对象 test_tree
|
* 测试树表对象 test_tree
|
||||||
|
|
@ -17,7 +17,7 @@ import lombok.EqualsAndHashCode;
|
||||||
@Data
|
@Data
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@TableName("test_tree")
|
@TableName("test_tree")
|
||||||
public class TestTree extends TreeEntity<TestTree> {
|
public class TestTree extends BaseEntity {
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
|
@ -28,6 +28,11 @@ public class TestTree extends TreeEntity<TestTree> {
|
||||||
@TableId(value = "id")
|
@TableId(value = "id")
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 父ID
|
||||||
|
*/
|
||||||
|
private Long parentId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 部门id
|
* 部门id
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ package org.dromara.demo.domain.bo;
|
||||||
|
|
||||||
import org.dromara.common.core.validate.AddGroup;
|
import org.dromara.common.core.validate.AddGroup;
|
||||||
import org.dromara.common.core.validate.EditGroup;
|
import org.dromara.common.core.validate.EditGroup;
|
||||||
import org.dromara.common.core.web.domain.BaseEntity;
|
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,9 +2,9 @@ package org.dromara.demo.domain.bo;
|
||||||
|
|
||||||
import org.dromara.common.core.validate.AddGroup;
|
import org.dromara.common.core.validate.AddGroup;
|
||||||
import org.dromara.common.core.validate.EditGroup;
|
import org.dromara.common.core.validate.EditGroup;
|
||||||
import org.dromara.common.core.web.domain.TreeEntity;
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
|
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||||
|
|
||||||
import javax.validation.constraints.NotBlank;
|
import javax.validation.constraints.NotBlank;
|
||||||
import javax.validation.constraints.NotNull;
|
import javax.validation.constraints.NotNull;
|
||||||
|
|
@ -18,7 +18,7 @@ import javax.validation.constraints.NotNull;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
public class TestTreeBo extends TreeEntity<TestTreeBo> {
|
public class TestTreeBo extends BaseEntity {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 主键
|
* 主键
|
||||||
|
|
@ -26,6 +26,11 @@ public class TestTreeBo extends TreeEntity<TestTreeBo> {
|
||||||
@NotNull(message = "主键不能为空", groups = {EditGroup.class})
|
@NotNull(message = "主键不能为空", groups = {EditGroup.class})
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 父ID
|
||||||
|
*/
|
||||||
|
private Long parentId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 部门id
|
* 部门id
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
package org.dromara.demo.service.impl;
|
package org.dromara.demo.service.impl;
|
||||||
|
|
||||||
import org.dromara.common.core.service.SensitiveService;
|
|
||||||
import org.dromara.common.satoken.utils.LoginHelper;
|
import org.dromara.common.satoken.utils.LoginHelper;
|
||||||
|
import org.dromara.common.sensitive.core.SensitiveService;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
package org.dromara.gateway.filter;
|
package org.dromara.gateway.filter;
|
||||||
|
|
||||||
import cn.hutool.core.map.MapUtil;
|
import cn.hutool.core.map.MapUtil;
|
||||||
import org.dromara.common.core.utils.JsonUtils;
|
import org.dromara.common.json.utils.JsonUtils;
|
||||||
import org.dromara.gateway.config.properties.CustomGatewayProperties;
|
import org.dromara.gateway.config.properties.CustomGatewayProperties;
|
||||||
import org.dromara.gateway.utils.WebFluxUtils;
|
import org.dromara.gateway.utils.WebFluxUtils;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
package org.dromara.gateway.filter;
|
package org.dromara.gateway.filter;
|
||||||
|
|
||||||
import cn.hutool.core.lang.Dict;
|
import cn.hutool.core.lang.Dict;
|
||||||
import org.dromara.common.core.utils.JsonUtils;
|
|
||||||
import org.dromara.common.core.utils.StringUtils;
|
import org.dromara.common.core.utils.StringUtils;
|
||||||
|
import org.dromara.common.json.utils.JsonUtils;
|
||||||
import org.dromara.gateway.config.properties.CaptchaProperties;
|
import org.dromara.gateway.config.properties.CaptchaProperties;
|
||||||
import org.dromara.gateway.service.ValidateCodeService;
|
import org.dromara.gateway.service.ValidateCodeService;
|
||||||
import org.dromara.gateway.utils.WebFluxUtils;
|
import org.dromara.gateway.utils.WebFluxUtils;
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,8 @@ package org.dromara.gateway.utils;
|
||||||
|
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import org.dromara.common.core.domain.R;
|
import org.dromara.common.core.domain.R;
|
||||||
import org.dromara.common.core.utils.JsonUtils;
|
|
||||||
import org.dromara.common.core.utils.StringUtils;
|
import org.dromara.common.core.utils.StringUtils;
|
||||||
|
import org.dromara.common.json.utils.JsonUtils;
|
||||||
import org.dromara.gateway.filter.GlobalCacheRequestFilter;
|
import org.dromara.gateway.filter.GlobalCacheRequestFilter;
|
||||||
import org.springframework.cloud.gateway.support.ServerWebExchangeUtils;
|
import org.springframework.cloud.gateway.support.ServerWebExchangeUtils;
|
||||||
import org.springframework.core.io.buffer.DataBuffer;
|
import org.springframework.core.io.buffer.DataBuffer;
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||||
import cn.hutool.core.convert.Convert;
|
import cn.hutool.core.convert.Convert;
|
||||||
import cn.hutool.core.io.IoUtil;
|
import cn.hutool.core.io.IoUtil;
|
||||||
import org.dromara.common.core.domain.R;
|
import org.dromara.common.core.domain.R;
|
||||||
import org.dromara.common.core.web.controller.BaseController;
|
import org.dromara.common.web.core.BaseController;
|
||||||
import org.dromara.common.log.annotation.Log;
|
import org.dromara.common.log.annotation.Log;
|
||||||
import org.dromara.common.log.enums.BusinessType;
|
import org.dromara.common.log.enums.BusinessType;
|
||||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
import org.apache.commons.lang3.ArrayUtils;
|
import org.apache.commons.lang3.ArrayUtils;
|
||||||
import org.dromara.common.core.utils.StringUtils;
|
import org.dromara.common.core.utils.StringUtils;
|
||||||
import org.dromara.common.core.web.domain.BaseEntity;
|
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||||
import org.dromara.gen.constant.GenConstants;
|
import org.dromara.gen.constant.GenConstants;
|
||||||
|
|
||||||
import javax.validation.Valid;
|
import javax.validation.Valid;
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import org.dromara.common.core.utils.StringUtils;
|
import org.dromara.common.core.utils.StringUtils;
|
||||||
import org.dromara.common.core.web.domain.BaseEntity;
|
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
import org.apache.ibatis.type.JdbcType;
|
import org.apache.ibatis.type.JdbcType;
|
||||||
|
|
|
||||||
|
|
@ -19,10 +19,10 @@ import org.apache.velocity.VelocityContext;
|
||||||
import org.apache.velocity.app.Velocity;
|
import org.apache.velocity.app.Velocity;
|
||||||
import org.dromara.common.core.constant.Constants;
|
import org.dromara.common.core.constant.Constants;
|
||||||
import org.dromara.common.core.exception.ServiceException;
|
import org.dromara.common.core.exception.ServiceException;
|
||||||
import org.dromara.common.core.utils.JsonUtils;
|
|
||||||
import org.dromara.common.core.utils.StreamUtils;
|
import org.dromara.common.core.utils.StreamUtils;
|
||||||
import org.dromara.common.core.utils.StringUtils;
|
import org.dromara.common.core.utils.StringUtils;
|
||||||
import org.dromara.common.core.utils.file.FileUtils;
|
import org.dromara.common.core.utils.file.FileUtils;
|
||||||
|
import org.dromara.common.json.utils.JsonUtils;
|
||||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||||
import org.dromara.common.satoken.utils.LoginHelper;
|
import org.dromara.common.satoken.utils.LoginHelper;
|
||||||
|
|
|
||||||
|
|
@ -8,8 +8,8 @@ import lombok.AccessLevel;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
import org.apache.velocity.VelocityContext;
|
import org.apache.velocity.VelocityContext;
|
||||||
import org.dromara.common.core.utils.DateUtils;
|
import org.dromara.common.core.utils.DateUtils;
|
||||||
import org.dromara.common.core.utils.JsonUtils;
|
|
||||||
import org.dromara.common.core.utils.StringUtils;
|
import org.dromara.common.core.utils.StringUtils;
|
||||||
|
import org.dromara.common.json.utils.JsonUtils;
|
||||||
import org.dromara.common.mybatis.helper.DataBaseHelper;
|
import org.dromara.common.mybatis.helper.DataBaseHelper;
|
||||||
import org.dromara.gen.constant.GenConstants;
|
import org.dromara.gen.constant.GenConstants;
|
||||||
import org.dromara.gen.domain.GenTable;
|
import org.dromara.gen.domain.GenTable;
|
||||||
|
|
|
||||||
|
|
@ -1,37 +1,27 @@
|
||||||
package ${packageName}.domain.bo;
|
package ${packageName}.domain.bo;
|
||||||
|
|
||||||
|
import ${packageName}.domain.${ClassName};
|
||||||
|
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||||
import org.dromara.common.core.validate.AddGroup;
|
import org.dromara.common.core.validate.AddGroup;
|
||||||
import org.dromara.common.core.validate.EditGroup;
|
import org.dromara.common.core.validate.EditGroup;
|
||||||
|
import io.github.linpeilie.annotations.AutoMapper;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
import javax.validation.constraints.*;
|
import jakarta.validation.constraints.*;
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
|
|
||||||
#foreach ($import in $importList)
|
#foreach ($import in $importList)
|
||||||
import ${import};
|
import ${import};
|
||||||
#end
|
#end
|
||||||
#if($table.crud || $table.sub)
|
|
||||||
import org.dromara.common.core.web.domain.BaseEntity;
|
|
||||||
#elseif($table.tree)
|
|
||||||
import org.dromara.common.core.web.domain.TreeEntity;
|
|
||||||
#end
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ${functionName}业务对象
|
* ${functionName}业务对象 ${tableName}
|
||||||
*
|
*
|
||||||
* @author ${author}
|
* @author ${author}
|
||||||
* @date ${datetime}
|
* @date ${datetime}
|
||||||
*/
|
*/
|
||||||
#if($table.crud || $table.sub)
|
|
||||||
#set($Entity="BaseEntity")
|
|
||||||
#elseif($table.tree)
|
|
||||||
#set($Entity="TreeEntity<${ClassName}Bo>")
|
|
||||||
#end
|
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
public class ${ClassName}Bo extends ${Entity} {
|
@AutoMapper(target = ${ClassName}.class, reverseConvertGenerate = false)
|
||||||
|
public class ${ClassName}Bo extends BaseEntity {
|
||||||
|
|
||||||
#foreach ($column in $columns)
|
#foreach ($column in $columns)
|
||||||
#if(!$table.isSuperColumn($column.javaField) && ($column.query || $column.insert || $column.edit))
|
#if(!$table.isSuperColumn($column.javaField) && ($column.query || $column.insert || $column.edit))
|
||||||
|
|
|
||||||
|
|
@ -1,19 +1,22 @@
|
||||||
package ${packageName}.controller;
|
package ${packageName}.controller;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
|
import jakarta.validation.constraints.*;
|
||||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
||||||
|
import org.dromara.common.log.annotation.Log;
|
||||||
|
import org.dromara.common.web.core.BaseController;
|
||||||
|
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||||
import org.dromara.common.core.domain.R;
|
import org.dromara.common.core.domain.R;
|
||||||
import org.dromara.common.core.validate.AddGroup;
|
import org.dromara.common.core.validate.AddGroup;
|
||||||
import org.dromara.common.core.validate.EditGroup;
|
import org.dromara.common.core.validate.EditGroup;
|
||||||
import org.dromara.common.core.validate.QueryGroup;
|
|
||||||
import org.dromara.common.core.web.controller.BaseController;
|
|
||||||
import org.dromara.common.excel.utils.ExcelUtil;
|
|
||||||
import org.dromara.common.log.annotation.Log;
|
|
||||||
import org.dromara.common.log.enums.BusinessType;
|
import org.dromara.common.log.enums.BusinessType;
|
||||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
import org.dromara.common.excel.utils.ExcelUtil;
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.validation.annotation.Validated;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
|
||||||
import ${packageName}.domain.vo.${ClassName}Vo;
|
import ${packageName}.domain.vo.${ClassName}Vo;
|
||||||
import ${packageName}.domain.bo.${ClassName}Bo;
|
import ${packageName}.domain.bo.${ClassName}Bo;
|
||||||
import ${packageName}.service.I${ClassName}Service;
|
import ${packageName}.service.I${ClassName}Service;
|
||||||
|
|
@ -22,15 +25,8 @@ import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||||
#elseif($table.tree)
|
#elseif($table.tree)
|
||||||
#end
|
#end
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Arrays;
|
|
||||||
import javax.validation.constraints.NotEmpty;
|
|
||||||
import javax.validation.constraints.NotNull;
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ${functionName}控制器
|
* ${functionName}
|
||||||
* 前端访问路由地址为:/${moduleName}/${businessName}
|
|
||||||
*
|
*
|
||||||
* @author ${author}
|
* @author ${author}
|
||||||
* @date ${datetime}
|
* @date ${datetime}
|
||||||
|
|
@ -38,10 +34,10 @@ import javax.servlet.http.HttpServletResponse;
|
||||||
@Validated
|
@Validated
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/${businessName}")
|
@RequestMapping("/${moduleName}/${businessName}")
|
||||||
public class ${ClassName}Controller extends BaseController {
|
public class ${ClassName}Controller extends BaseController {
|
||||||
|
|
||||||
private final I${ClassName}Service i${ClassName}Service;
|
private final I${ClassName}Service ${className}Service;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询${functionName}列表
|
* 查询${functionName}列表
|
||||||
|
|
@ -50,11 +46,11 @@ public class ${ClassName}Controller extends BaseController {
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
#if($table.crud || $table.sub)
|
#if($table.crud || $table.sub)
|
||||||
public TableDataInfo<${ClassName}Vo> list(${ClassName}Bo bo, PageQuery pageQuery) {
|
public TableDataInfo<${ClassName}Vo> list(${ClassName}Bo bo, PageQuery pageQuery) {
|
||||||
return i${ClassName}Service.queryPageList(bo, pageQuery);
|
return ${className}Service.queryPageList(bo, pageQuery);
|
||||||
}
|
}
|
||||||
#elseif($table.tree)
|
#elseif($table.tree)
|
||||||
public R<List<${ClassName}Vo>> list(${ClassName}Bo bo) {
|
public R<List<${ClassName}Vo>> list(${ClassName}Bo bo) {
|
||||||
List<${ClassName}Vo> list = i${ClassName}Service.queryList(bo);
|
List<${ClassName}Vo> list = ${className}Service.queryList(bo);
|
||||||
return R.ok(list);
|
return R.ok(list);
|
||||||
}
|
}
|
||||||
#end
|
#end
|
||||||
|
|
@ -66,7 +62,7 @@ public class ${ClassName}Controller extends BaseController {
|
||||||
@Log(title = "${functionName}", businessType = BusinessType.EXPORT)
|
@Log(title = "${functionName}", businessType = BusinessType.EXPORT)
|
||||||
@PostMapping("/export")
|
@PostMapping("/export")
|
||||||
public void export(${ClassName}Bo bo, HttpServletResponse response) {
|
public void export(${ClassName}Bo bo, HttpServletResponse response) {
|
||||||
List<${ClassName}Vo> list = i${ClassName}Service.queryList(bo);
|
List<${ClassName}Vo> list = ${className}Service.queryList(bo);
|
||||||
ExcelUtil.exportExcel(list, "${functionName}", ${ClassName}Vo.class, response);
|
ExcelUtil.exportExcel(list, "${functionName}", ${ClassName}Vo.class, response);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -77,8 +73,9 @@ public class ${ClassName}Controller extends BaseController {
|
||||||
*/
|
*/
|
||||||
@SaCheckPermission("${permissionPrefix}:query")
|
@SaCheckPermission("${permissionPrefix}:query")
|
||||||
@GetMapping("/{${pkColumn.javaField}}")
|
@GetMapping("/{${pkColumn.javaField}}")
|
||||||
public R<${ClassName}Vo> getInfo(@NotNull(message = "主键不能为空") @PathVariable ${pkColumn.javaType} ${pkColumn.javaField}) {
|
public R<${ClassName}Vo> getInfo(@NotNull(message = "主键不能为空")
|
||||||
return R.ok(i${ClassName}Service.queryById(${pkColumn.javaField}));
|
@PathVariable ${pkColumn.javaType} ${pkColumn.javaField}) {
|
||||||
|
return R.ok(${className}Service.queryById(${pkColumn.javaField}));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -86,9 +83,10 @@ public class ${ClassName}Controller extends BaseController {
|
||||||
*/
|
*/
|
||||||
@SaCheckPermission("${permissionPrefix}:add")
|
@SaCheckPermission("${permissionPrefix}:add")
|
||||||
@Log(title = "${functionName}", businessType = BusinessType.INSERT)
|
@Log(title = "${functionName}", businessType = BusinessType.INSERT)
|
||||||
|
@RepeatSubmit()
|
||||||
@PostMapping()
|
@PostMapping()
|
||||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody ${ClassName}Bo bo) {
|
public R<Void> add(@Validated(AddGroup.class) @RequestBody ${ClassName}Bo bo) {
|
||||||
return toAjax(i${ClassName}Service.insertByBo(bo));
|
return toAjax(${className}Service.insertByBo(bo));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -96,9 +94,10 @@ public class ${ClassName}Controller extends BaseController {
|
||||||
*/
|
*/
|
||||||
@SaCheckPermission("${permissionPrefix}:edit")
|
@SaCheckPermission("${permissionPrefix}:edit")
|
||||||
@Log(title = "${functionName}", businessType = BusinessType.UPDATE)
|
@Log(title = "${functionName}", businessType = BusinessType.UPDATE)
|
||||||
|
@RepeatSubmit()
|
||||||
@PutMapping()
|
@PutMapping()
|
||||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody ${ClassName}Bo bo) {
|
public R<Void> edit(@Validated(EditGroup.class) @RequestBody ${ClassName}Bo bo) {
|
||||||
return toAjax(i${ClassName}Service.updateByBo(bo));
|
return toAjax(${className}Service.updateByBo(bo));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -109,7 +108,8 @@ public class ${ClassName}Controller extends BaseController {
|
||||||
@SaCheckPermission("${permissionPrefix}:remove")
|
@SaCheckPermission("${permissionPrefix}:remove")
|
||||||
@Log(title = "${functionName}", businessType = BusinessType.DELETE)
|
@Log(title = "${functionName}", businessType = BusinessType.DELETE)
|
||||||
@DeleteMapping("/{${pkColumn.javaField}s}")
|
@DeleteMapping("/{${pkColumn.javaField}s}")
|
||||||
public R<Void> remove(@NotEmpty(message = "主键不能为空") @PathVariable ${pkColumn.javaType}[] ${pkColumn.javaField}s) {
|
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||||
return toAjax(i${ClassName}Service.deleteWithValidByIds(Arrays.asList(${pkColumn.javaField}s), true));
|
@PathVariable ${pkColumn.javaType}[] ${pkColumn.javaField}s) {
|
||||||
|
return toAjax(${className}Service.deleteWithValidByIds(List.of(${pkColumn.javaField}s), true));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,21 +1,23 @@
|
||||||
package ${packageName}.domain;
|
package ${packageName}.domain;
|
||||||
|
|
||||||
|
#foreach ($column in $columns)
|
||||||
|
#if($column.javaField=='tenantId')
|
||||||
|
#set($IsTenant=1)
|
||||||
|
#end
|
||||||
|
#end
|
||||||
|
#if($IsTenant==1)
|
||||||
|
import org.dromara.common.tenant.core.TenantEntity;
|
||||||
|
#else
|
||||||
|
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||||
|
#end
|
||||||
import com.baomidou.mybatisplus.annotation.*;
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
import java.io.Serializable;
|
|
||||||
import java.util.Date;
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
|
|
||||||
#foreach ($import in $importList)
|
#foreach ($import in $importList)
|
||||||
import ${import};
|
import ${import};
|
||||||
#end
|
#end
|
||||||
#if($table.crud || $table.sub)
|
|
||||||
import org.dromara.common.core.web.domain.BaseEntity;
|
import java.io.Serial;
|
||||||
#elseif($table.tree)
|
|
||||||
import org.dromara.common.core.web.domain.TreeEntity;
|
|
||||||
#end
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ${functionName}对象 ${tableName}
|
* ${functionName}对象 ${tableName}
|
||||||
|
|
@ -23,17 +25,18 @@ import org.dromara.common.core.web.domain.TreeEntity;
|
||||||
* @author ${author}
|
* @author ${author}
|
||||||
* @date ${datetime}
|
* @date ${datetime}
|
||||||
*/
|
*/
|
||||||
#if($table.crud || $table.sub)
|
#if($IsTenant==1)
|
||||||
|
#set($Entity="TenantEntity")
|
||||||
|
#else
|
||||||
#set($Entity="BaseEntity")
|
#set($Entity="BaseEntity")
|
||||||
#elseif($table.tree)
|
|
||||||
#set($Entity="TreeEntity<${ClassName}>")
|
|
||||||
#end
|
#end
|
||||||
@Data
|
@Data
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@TableName("${tableName}")
|
@TableName("${tableName}")
|
||||||
public class ${ClassName} extends ${Entity} {
|
public class ${ClassName} extends ${Entity} {
|
||||||
|
|
||||||
private static final long serialVersionUID=1L;
|
@Serial
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
#foreach ($column in $columns)
|
#foreach ($column in $columns)
|
||||||
#if(!$table.isSuperColumn($column.javaField))
|
#if(!$table.isSuperColumn($column.javaField))
|
||||||
|
|
@ -50,6 +53,7 @@ public class ${ClassName} extends ${Entity} {
|
||||||
@TableId(value = "$column.columnName")
|
@TableId(value = "$column.columnName")
|
||||||
#end
|
#end
|
||||||
private $column.javaType $column.javaField;
|
private $column.javaType $column.javaField;
|
||||||
|
|
||||||
#end
|
#end
|
||||||
#end
|
#end
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
package ${packageName}.mapper;
|
package ${packageName}.mapper;
|
||||||
|
|
||||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
|
||||||
import ${packageName}.domain.${ClassName};
|
import ${packageName}.domain.${ClassName};
|
||||||
import ${packageName}.domain.vo.${ClassName}Vo;
|
import ${packageName}.domain.vo.${ClassName}Vo;
|
||||||
|
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ${functionName}Mapper接口
|
* ${functionName}Mapper接口
|
||||||
|
|
@ -10,6 +10,6 @@ import ${packageName}.domain.vo.${ClassName}Vo;
|
||||||
* @author ${author}
|
* @author ${author}
|
||||||
* @date ${datetime}
|
* @date ${datetime}
|
||||||
*/
|
*/
|
||||||
public interface ${ClassName}Mapper extends BaseMapperPlus<${ClassName}Mapper, ${ClassName}, ${ClassName}Vo> {
|
public interface ${ClassName}Mapper extends BaseMapperPlus<${ClassName}, ${ClassName}Vo> {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,8 +4,8 @@ import ${packageName}.domain.${ClassName};
|
||||||
import ${packageName}.domain.vo.${ClassName}Vo;
|
import ${packageName}.domain.vo.${ClassName}Vo;
|
||||||
import ${packageName}.domain.bo.${ClassName}Bo;
|
import ${packageName}.domain.bo.${ClassName}Bo;
|
||||||
#if($table.crud || $table.sub)
|
#if($table.crud || $table.sub)
|
||||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
|
||||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||||
|
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||||
#end
|
#end
|
||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
|
@ -37,7 +37,7 @@ public interface I${ClassName}Service {
|
||||||
List<${ClassName}Vo> queryList(${ClassName}Bo bo);
|
List<${ClassName}Vo> queryList(${ClassName}Bo bo);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改${functionName}
|
* 新增${functionName}
|
||||||
*/
|
*/
|
||||||
Boolean insertByBo(${ClassName}Bo bo);
|
Boolean insertByBo(${ClassName}Bo bo);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
package ${packageName}.service.impl;
|
package ${packageName}.service.impl;
|
||||||
|
|
||||||
import cn.hutool.core.bean.BeanUtil;
|
import org.dromara.common.core.utils.MapstructUtils;
|
||||||
import org.dromara.common.core.utils.StringUtils;
|
import org.dromara.common.core.utils.StringUtils;
|
||||||
#if($table.crud || $table.sub)
|
#if($table.crud || $table.sub)
|
||||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
|
||||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||||
|
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
#end
|
#end
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
|
@ -94,7 +94,7 @@ public class ${ClassName}ServiceImpl implements I${ClassName}Service {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Boolean insertByBo(${ClassName}Bo bo) {
|
public Boolean insertByBo(${ClassName}Bo bo) {
|
||||||
${ClassName} add = BeanUtil.toBean(bo, ${ClassName}.class);
|
${ClassName} add = MapstructUtils.convert(bo, ${ClassName}.class);
|
||||||
validEntityBeforeSave(add);
|
validEntityBeforeSave(add);
|
||||||
boolean flag = baseMapper.insert(add) > 0;
|
boolean flag = baseMapper.insert(add) > 0;
|
||||||
#set($pk=$pkColumn.javaField.substring(0,1).toUpperCase() + ${pkColumn.javaField.substring(1)})
|
#set($pk=$pkColumn.javaField.substring(0,1).toUpperCase() + ${pkColumn.javaField.substring(1)})
|
||||||
|
|
@ -109,7 +109,7 @@ public class ${ClassName}ServiceImpl implements I${ClassName}Service {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Boolean updateByBo(${ClassName}Bo bo) {
|
public Boolean updateByBo(${ClassName}Bo bo) {
|
||||||
${ClassName} update = BeanUtil.toBean(bo, ${ClassName}.class);
|
${ClassName} update = MapstructUtils.convert(bo, ${ClassName}.class);
|
||||||
validEntityBeforeSave(update);
|
validEntityBeforeSave(update);
|
||||||
return baseMapper.updateById(update) > 0;
|
return baseMapper.updateById(update) > 0;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,75 +0,0 @@
|
||||||
package ${packageName}.domain;
|
|
||||||
|
|
||||||
#foreach ($import in $subImportList)
|
|
||||||
import ${import};
|
|
||||||
#end
|
|
||||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
|
||||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
|
||||||
import org.dromara.common.core.annotation.Excel;
|
|
||||||
import org.dromara.common.core.web.domain.BaseEntity;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* ${subTable.functionName}对象 ${subTableName}
|
|
||||||
*
|
|
||||||
* @author ${author}
|
|
||||||
* @date ${datetime}
|
|
||||||
*/
|
|
||||||
public class ${subClassName} extends BaseEntity
|
|
||||||
{
|
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
|
|
||||||
#foreach ($column in $subTable.columns)
|
|
||||||
#if(!$table.isSuperColumn($column.javaField))
|
|
||||||
/** $column.columnComment */
|
|
||||||
#if($column.list)
|
|
||||||
#set($parentheseIndex=$column.columnComment.indexOf("("))
|
|
||||||
#if($parentheseIndex != -1)
|
|
||||||
#set($comment=$column.columnComment.substring(0, $parentheseIndex))
|
|
||||||
#else
|
|
||||||
#set($comment=$column.columnComment)
|
|
||||||
#end
|
|
||||||
#if($parentheseIndex != -1)
|
|
||||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
|
||||||
#elseif($column.javaType == 'Date')
|
|
||||||
@Excel(name = "${comment}", width = 30, dateFormat = "yyyy-MM-dd")
|
|
||||||
#else
|
|
||||||
@Excel(name = "${comment}")
|
|
||||||
#end
|
|
||||||
#end
|
|
||||||
private $column.javaType $column.javaField;
|
|
||||||
|
|
||||||
#end
|
|
||||||
#end
|
|
||||||
#foreach ($column in $subTable.columns)
|
|
||||||
#if(!$table.isSuperColumn($column.javaField))
|
|
||||||
#if($column.javaField.length() > 2 && $column.javaField.substring(1,2).matches("[A-Z]"))
|
|
||||||
#set($AttrName=$column.javaField)
|
|
||||||
#else
|
|
||||||
#set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)})
|
|
||||||
#end
|
|
||||||
public void set${AttrName}($column.javaType $column.javaField)
|
|
||||||
{
|
|
||||||
this.$column.javaField = $column.javaField;
|
|
||||||
}
|
|
||||||
|
|
||||||
public $column.javaType get${AttrName}()
|
|
||||||
{
|
|
||||||
return $column.javaField;
|
|
||||||
}
|
|
||||||
#end
|
|
||||||
#end
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
|
||||||
#foreach ($column in $subTable.columns)
|
|
||||||
#if($column.javaField.length() > 2 && $column.javaField.substring(1,2).matches("[A-Z]"))
|
|
||||||
#set($AttrName=$column.javaField)
|
|
||||||
#else
|
|
||||||
#set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)})
|
|
||||||
#end
|
|
||||||
.append("${column.javaField}", get${AttrName}())
|
|
||||||
#end
|
|
||||||
.toString();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -3,25 +3,32 @@ package ${packageName}.domain.vo;
|
||||||
#foreach ($import in $importList)
|
#foreach ($import in $importList)
|
||||||
import ${import};
|
import ${import};
|
||||||
#end
|
#end
|
||||||
|
import ${packageName}.domain.${ClassName};
|
||||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||||
import com.alibaba.excel.annotation.ExcelProperty;
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
import org.dromara.common.excel.annotation.ExcelDictFormat;
|
import org.dromara.common.excel.annotation.ExcelDictFormat;
|
||||||
import org.dromara.common.excel.convert.ExcelDictConvert;
|
import org.dromara.common.excel.convert.ExcelDictConvert;
|
||||||
|
import io.github.linpeilie.annotations.AutoMapper;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.io.Serial;
|
||||||
|
import java.io.Serializable;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ${functionName}视图对象
|
* ${functionName}视图对象 ${tableName}
|
||||||
*
|
*
|
||||||
* @author ${author}
|
* @author ${author}
|
||||||
* @date ${datetime}
|
* @date ${datetime}
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@ExcelIgnoreUnannotated
|
@ExcelIgnoreUnannotated
|
||||||
public class ${ClassName}Vo {
|
@AutoMapper(target = ${ClassName}.class)
|
||||||
|
public class ${ClassName}Vo implements Serializable {
|
||||||
|
|
||||||
|
@Serial
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
#foreach ($column in $columns)
|
#foreach ($column in $columns)
|
||||||
|
|
|
||||||
|
|
@ -1,44 +0,0 @@
|
||||||
import request from '@/utils/request'
|
|
||||||
|
|
||||||
// 查询${functionName}列表
|
|
||||||
export function list${BusinessName}(query) {
|
|
||||||
return request({
|
|
||||||
url: '/${moduleName}/${businessName}/list',
|
|
||||||
method: 'get',
|
|
||||||
params: query
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 查询${functionName}详细
|
|
||||||
export function get${BusinessName}(${pkColumn.javaField}) {
|
|
||||||
return request({
|
|
||||||
url: '/${moduleName}/${businessName}/' + ${pkColumn.javaField},
|
|
||||||
method: 'get'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 新增${functionName}
|
|
||||||
export function add${BusinessName}(data) {
|
|
||||||
return request({
|
|
||||||
url: '/${moduleName}/${businessName}',
|
|
||||||
method: 'post',
|
|
||||||
data: data
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 修改${functionName}
|
|
||||||
export function update${BusinessName}(data) {
|
|
||||||
return request({
|
|
||||||
url: '/${moduleName}/${businessName}',
|
|
||||||
method: 'put',
|
|
||||||
data: data
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 删除${functionName}
|
|
||||||
export function del${BusinessName}(${pkColumn.javaField}) {
|
|
||||||
return request({
|
|
||||||
url: '/${moduleName}/${businessName}/' + ${pkColumn.javaField},
|
|
||||||
method: 'delete'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
@ -1,19 +1,19 @@
|
||||||
-- 菜单 SQL
|
-- 菜单 SQL
|
||||||
insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
|
insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark)
|
||||||
values(${table.menuIds[0]}, '${functionName}', '${parentMenuId}', '1', '${businessName}', '${moduleName}/${businessName}/index', 1, 0, 'C', '0', '0', '${permissionPrefix}:list', '#', 'admin', sysdate, '', null, '${functionName}菜单');
|
values(${table.menuIds[0]}, '${functionName}', '${parentMenuId}', '1', '${businessName}', '${moduleName}/${businessName}/index', 1, 0, 'C', '0', '0', '${permissionPrefix}:list', '#', 103, 1, sysdate, null, null, '${functionName}菜单');
|
||||||
|
|
||||||
-- 按钮 SQL
|
-- 按钮 SQL
|
||||||
insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
|
insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark)
|
||||||
values(${table.menuIds[1]}, '${functionName}查询', ${table.menuIds[0]}, '1', '#', '', 1, 0, 'F', '0', '0', '${permissionPrefix}:query', '#', 'admin', sysdate, '', null, '');
|
values(${table.menuIds[1]}, '${functionName}查询', ${table.menuIds[0]}, '1', '#', '', 1, 0, 'F', '0', '0', '${permissionPrefix}:query', '#', 103, 1, sysdate, null, null, '');
|
||||||
|
|
||||||
insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
|
insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark)
|
||||||
values(${table.menuIds[2]}, '${functionName}新增', ${table.menuIds[0]}, '2', '#', '', 1, 0, 'F', '0', '0', '${permissionPrefix}:add', '#', 'admin', sysdate, '', null, '');
|
values(${table.menuIds[2]}, '${functionName}新增', ${table.menuIds[0]}, '2', '#', '', 1, 0, 'F', '0', '0', '${permissionPrefix}:add', '#', 103, 1, sysdate, null, null, '');
|
||||||
|
|
||||||
insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
|
insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark)
|
||||||
values(${table.menuIds[3]}, '${functionName}修改', ${table.menuIds[0]}, '3', '#', '', 1, 0, 'F', '0', '0', '${permissionPrefix}:edit', '#', 'admin', sysdate, '', null, '');
|
values(${table.menuIds[3]}, '${functionName}修改', ${table.menuIds[0]}, '3', '#', '', 1, 0, 'F', '0', '0', '${permissionPrefix}:edit', '#', 103, 1, sysdate, null, null, '');
|
||||||
|
|
||||||
insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
|
insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark)
|
||||||
values(${table.menuIds[4]}, '${functionName}删除', ${table.menuIds[0]}, '4', '#', '', 1, 0, 'F', '0', '0', '${permissionPrefix}:remove', '#', 'admin', sysdate, '', null, '');
|
values(${table.menuIds[4]}, '${functionName}删除', ${table.menuIds[0]}, '4', '#', '', 1, 0, 'F', '0', '0', '${permissionPrefix}:remove', '#', 103, 1, sysdate, null, null, '');
|
||||||
|
|
||||||
insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
|
insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark)
|
||||||
values(${table.menuIds[5]}, '${functionName}导出', ${table.menuIds[0]}, '5', '#', '', 1, 0, 'F', '0', '0', '${permissionPrefix}:export', '#', 'admin', sysdate, '', null, '');
|
values(${table.menuIds[5]}, '${functionName}导出', ${table.menuIds[0]}, '5', '#', '', 1, 0, 'F', '0', '0', '${permissionPrefix}:export', '#', 103, 1, sysdate, null, null, '');
|
||||||
|
|
|
||||||
|
|
@ -1,20 +1,20 @@
|
||||||
-- 菜单 SQL
|
-- 菜单 SQL
|
||||||
insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
|
insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark)
|
||||||
values(${table.menuIds[0]}, '${functionName}', '${parentMenuId}', '1', '${businessName}', '${moduleName}/${businessName}/index', 1, 0, 'C', '0', '0', '${permissionPrefix}:list', '#', 'admin', now(), '', null, '${functionName}菜单');
|
values(${table.menuIds[0]}, '${functionName}', '${parentMenuId}', '1', '${businessName}', '${moduleName}/${businessName}/index', 1, 0, 'C', '0', '0', '${permissionPrefix}:list', '#', 103, 1, now(), null, null, '${functionName}菜单');
|
||||||
|
|
||||||
-- 按钮 SQL
|
-- 按钮 SQL
|
||||||
insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
|
insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark)
|
||||||
values(${table.menuIds[1]}, '${functionName}查询', ${table.menuIds[0]}, '1', '#', '', 1, 0, 'F', '0', '0', '${permissionPrefix}:query', '#', 'admin', now(), '', null, '');
|
values(${table.menuIds[1]}, '${functionName}查询', ${table.menuIds[0]}, '1', '#', '', 1, 0, 'F', '0', '0', '${permissionPrefix}:query', '#', 103, 1, now(), null, null, '');
|
||||||
|
|
||||||
insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
|
insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark)
|
||||||
values(${table.menuIds[2]}, '${functionName}新增', ${table.menuIds[0]}, '2', '#', '', 1, 0, 'F', '0', '0', '${permissionPrefix}:add', '#', 'admin', now(), '', null, '');
|
values(${table.menuIds[2]}, '${functionName}新增', ${table.menuIds[0]}, '2', '#', '', 1, 0, 'F', '0', '0', '${permissionPrefix}:add', '#', 103, 1, now(), null, null, '');
|
||||||
|
|
||||||
insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
|
insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark)
|
||||||
values(${table.menuIds[3]}, '${functionName}修改', ${table.menuIds[0]}, '3', '#', '', 1, 0, 'F', '0', '0', '${permissionPrefix}:edit', '#', 'admin', now(), '', null, '');
|
values(${table.menuIds[3]}, '${functionName}修改', ${table.menuIds[0]}, '3', '#', '', 1, 0, 'F', '0', '0', '${permissionPrefix}:edit', '#', 103, 1, now(), null, null, '');
|
||||||
|
|
||||||
insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
|
insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark)
|
||||||
values(${table.menuIds[4]}, '${functionName}删除', ${table.menuIds[0]}, '4', '#', '', 1, 0, 'F', '0', '0', '${permissionPrefix}:remove', '#', 'admin', now(), '', null, '');
|
values(${table.menuIds[4]}, '${functionName}删除', ${table.menuIds[0]}, '4', '#', '', 1, 0, 'F', '0', '0', '${permissionPrefix}:remove', '#', 103, 1, now(), null, null, '');
|
||||||
|
|
||||||
insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
|
insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark)
|
||||||
values(${table.menuIds[5]}, '${functionName}导出', ${table.menuIds[0]}, '5', '#', '', 1, 0, 'F', '0', '0', '${permissionPrefix}:export', '#', 'admin', now(), '', null, '');
|
values(${table.menuIds[5]}, '${functionName}导出', ${table.menuIds[0]}, '5', '#', '', 1, 0, 'F', '0', '0', '${permissionPrefix}:export', '#', 103, 1, now(), null, null, '');
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,19 +1,19 @@
|
||||||
-- 菜单 SQL
|
-- 菜单 SQL
|
||||||
insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
|
insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark)
|
||||||
values(${table.menuIds[0]}, '${functionName}', '${parentMenuId}', '1', '${businessName}', '${moduleName}/${businessName}/index', 1, 0, 'C', '0', '0', '${permissionPrefix}:list', '#', 'admin', sysdate(), '', null, '${functionName}菜单');
|
values(${table.menuIds[0]}, '${functionName}', '${parentMenuId}', '1', '${businessName}', '${moduleName}/${businessName}/index', 1, 0, 'C', '0', '0', '${permissionPrefix}:list', '#', 103, 1, sysdate(), null, null, '${functionName}菜单');
|
||||||
|
|
||||||
-- 按钮 SQL
|
-- 按钮 SQL
|
||||||
insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
|
insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark)
|
||||||
values(${table.menuIds[1]}, '${functionName}查询', ${table.menuIds[0]}, '1', '#', '', 1, 0, 'F', '0', '0', '${permissionPrefix}:query', '#', 'admin', sysdate(), '', null, '');
|
values(${table.menuIds[1]}, '${functionName}查询', ${table.menuIds[0]}, '1', '#', '', 1, 0, 'F', '0', '0', '${permissionPrefix}:query', '#', 103, 1, sysdate(), null, null, '');
|
||||||
|
|
||||||
insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
|
insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark)
|
||||||
values(${table.menuIds[2]}, '${functionName}新增', ${table.menuIds[0]}, '2', '#', '', 1, 0, 'F', '0', '0', '${permissionPrefix}:add', '#', 'admin', sysdate(), '', null, '');
|
values(${table.menuIds[2]}, '${functionName}新增', ${table.menuIds[0]}, '2', '#', '', 1, 0, 'F', '0', '0', '${permissionPrefix}:add', '#', 103, 1, sysdate(), null, null, '');
|
||||||
|
|
||||||
insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
|
insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark)
|
||||||
values(${table.menuIds[3]}, '${functionName}修改', ${table.menuIds[0]}, '3', '#', '', 1, 0, 'F', '0', '0', '${permissionPrefix}:edit', '#', 'admin', sysdate(), '', null, '');
|
values(${table.menuIds[3]}, '${functionName}修改', ${table.menuIds[0]}, '3', '#', '', 1, 0, 'F', '0', '0', '${permissionPrefix}:edit', '#', 103, 1, sysdate(), null, null, '');
|
||||||
|
|
||||||
insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
|
insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark)
|
||||||
values(${table.menuIds[4]}, '${functionName}删除', ${table.menuIds[0]}, '4', '#', '', 1, 0, 'F', '0', '0', '${permissionPrefix}:remove', '#', 'admin', sysdate(), '', null, '');
|
values(${table.menuIds[4]}, '${functionName}删除', ${table.menuIds[0]}, '4', '#', '', 1, 0, 'F', '0', '0', '${permissionPrefix}:remove', '#', 103, 1, sysdate(), null, null, '');
|
||||||
|
|
||||||
insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
|
insert into sys_menu (menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_dept, create_by, create_time, update_by, update_time, remark)
|
||||||
values(${table.menuIds[5]}, '${functionName}导出', ${table.menuIds[0]}, '5', '#', '', 1, 0, 'F', '0', '0', '${permissionPrefix}:export', '#', 'admin', sysdate(), '', null, '');
|
values(${table.menuIds[5]}, '${functionName}导出', ${table.menuIds[0]}, '5', '#', '', 1, 0, 'F', '0', '0', '${permissionPrefix}:export', '#', 103, 1, sysdate(), null, null, '');
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,63 @@
|
||||||
|
import request from '@/utils/request';
|
||||||
|
import { AxiosPromise } from 'axios';
|
||||||
|
import { ${BusinessName}VO, ${BusinessName}Form, ${BusinessName}Query } from '@/api/${moduleName}/${businessName}/types';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询${functionName}列表
|
||||||
|
* @param query
|
||||||
|
* @returns {*}
|
||||||
|
*/
|
||||||
|
|
||||||
|
export const list${BusinessName} = (query?: ${BusinessName}Query): AxiosPromise<${BusinessName}VO[]> => {
|
||||||
|
return request({
|
||||||
|
url: '/${moduleName}/${businessName}/list',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询${functionName}详细
|
||||||
|
* @param ${pkColumn.javaField}
|
||||||
|
*/
|
||||||
|
export const get${BusinessName} = (${pkColumn.javaField}: string | number): AxiosPromise<${BusinessName}VO> => {
|
||||||
|
return request({
|
||||||
|
url: '/${moduleName}/${businessName}/' + ${pkColumn.javaField},
|
||||||
|
method: 'get'
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增${functionName}
|
||||||
|
* @param data
|
||||||
|
*/
|
||||||
|
export const add${BusinessName} = (data: ${BusinessName}Form) => {
|
||||||
|
return request({
|
||||||
|
url: '/${moduleName}/${businessName}',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改${functionName}
|
||||||
|
* @param data
|
||||||
|
*/
|
||||||
|
export const update${BusinessName} = (data: ${BusinessName}Form) => {
|
||||||
|
return request({
|
||||||
|
url: '/${moduleName}/${businessName}',
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除${functionName}
|
||||||
|
* @param ${pkColumn.javaField}
|
||||||
|
*/
|
||||||
|
export const del${BusinessName} = (${pkColumn.javaField}: string | number | Array<string | number>) => {
|
||||||
|
return request({
|
||||||
|
url: '/${moduleName}/${businessName}/' + ${pkColumn.javaField},
|
||||||
|
method: 'delete'
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
@ -0,0 +1,44 @@
|
||||||
|
export interface ${BusinessName}VO {
|
||||||
|
#foreach ($column in $columns)
|
||||||
|
#if($column.insert || $column.edit)
|
||||||
|
/**
|
||||||
|
* $column.columnComment
|
||||||
|
*/
|
||||||
|
$column.javaField:#if($column.javaField.indexOf("id") != -1 || $column.javaField.indexOf("Id") != -1) string | number;
|
||||||
|
#elseif($column.javaType == 'Long' || $column.javaType == 'Integer' || $column.javaType == 'Double' || $column.javaType == 'Float' || $column.javaType == 'BigDecimal') number;
|
||||||
|
#elseif($column.javaType == 'Boolean') boolean;
|
||||||
|
#else string;
|
||||||
|
#end
|
||||||
|
#end
|
||||||
|
#end
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ${BusinessName}Form extends BaseEntity {
|
||||||
|
#foreach ($column in $columns)
|
||||||
|
#if($column.insert || $column.edit)
|
||||||
|
/**
|
||||||
|
* $column.columnComment
|
||||||
|
*/
|
||||||
|
$column.javaField?:#if($column.javaField.indexOf("id") != -1 || $column.javaField.indexOf("Id") != -1) string | number;
|
||||||
|
#elseif($column.javaType == 'Long' || $column.javaType == 'Integer' || $column.javaType == 'Double' || $column.javaType == 'Float' || $column.javaType == 'BigDecimal') number;
|
||||||
|
#elseif($column.javaType == 'Boolean') boolean;
|
||||||
|
#else string;
|
||||||
|
#end
|
||||||
|
#end
|
||||||
|
#end
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ${BusinessName}Query #if(!${treeCode})extends PageQuery #end{
|
||||||
|
#foreach ($column in $columns)
|
||||||
|
#if($column.query)
|
||||||
|
/**
|
||||||
|
* $column.columnComment
|
||||||
|
*/
|
||||||
|
$column.javaField?:#if($column.javaField.indexOf("id") != -1 || $column.javaField.indexOf("Id") != -1) string | number;
|
||||||
|
#elseif($column.javaType == 'Long' || $column.javaType == 'Integer' || $column.javaType == 'Double' || $column.javaType == 'Float' || $column.javaType == 'BigDecimal') number;
|
||||||
|
#elseif($column.javaType == 'Boolean') boolean;
|
||||||
|
#else string;
|
||||||
|
#end
|
||||||
|
#end
|
||||||
|
#end
|
||||||
|
}
|
||||||
|
|
@ -1,6 +1,8 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="p-2">
|
||||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
|
||||||
|
<div class="search" v-show="showSearch">
|
||||||
|
<el-form :model="queryParams" ref="queryFormRef" :inline="true" label-width="68px">
|
||||||
#foreach($column in $columns)
|
#foreach($column in $columns)
|
||||||
#if($column.query)
|
#if($column.query)
|
||||||
#set($dictType=$column.dictType)
|
#set($dictType=$column.dictType)
|
||||||
|
|
@ -13,18 +15,13 @@
|
||||||
#end
|
#end
|
||||||
#if($column.htmlType == "input" || $column.htmlType == "textarea")
|
#if($column.htmlType == "input" || $column.htmlType == "textarea")
|
||||||
<el-form-item label="${comment}" prop="${column.javaField}">
|
<el-form-item label="${comment}" prop="${column.javaField}">
|
||||||
<el-input
|
<el-input v-model="queryParams.${column.javaField}" placeholder="请输入${comment}" clearable @keyup.enter="handleQuery" />
|
||||||
v-model="queryParams.${column.javaField}"
|
|
||||||
placeholder="请输入${comment}"
|
|
||||||
clearable
|
|
||||||
@keyup.enter.native="handleQuery"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
#elseif(($column.htmlType == "select" || $column.htmlType == "radio") && "" != $dictType)
|
#elseif(($column.htmlType == "select" || $column.htmlType == "radio") && "" != $dictType)
|
||||||
<el-form-item label="${comment}" prop="${column.javaField}">
|
<el-form-item label="${comment}" prop="${column.javaField}">
|
||||||
<el-select v-model="queryParams.${column.javaField}" placeholder="请选择${comment}" clearable>
|
<el-select v-model="queryParams.${column.javaField}" placeholder="请选择${comment}" clearable>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="dict in dict.type.${dictType}"
|
v-for="dict in ${dictType}"
|
||||||
:key="dict.value"
|
:key="dict.value"
|
||||||
:label="dict.label"
|
:label="dict.label"
|
||||||
:value="dict.value"
|
:value="dict.value"
|
||||||
|
|
@ -42,62 +39,52 @@
|
||||||
<el-date-picker clearable
|
<el-date-picker clearable
|
||||||
v-model="queryParams.${column.javaField}"
|
v-model="queryParams.${column.javaField}"
|
||||||
type="date"
|
type="date"
|
||||||
value-format="yyyy-MM-dd"
|
value-format="YYYY-MM-DD"
|
||||||
placeholder="选择${comment}">
|
placeholder="选择${comment}"
|
||||||
</el-date-picker>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
#elseif($column.htmlType == "datetime" && $column.queryType == "BETWEEN")
|
#elseif($column.htmlType == "datetime" && $column.queryType == "BETWEEN")
|
||||||
<el-form-item label="${comment}">
|
<el-form-item label="${comment}" style="width: 308px">
|
||||||
<el-date-picker
|
<el-date-picker
|
||||||
v-model="daterange${AttrName}"
|
v-model="daterange${AttrName}"
|
||||||
style="width: 240px"
|
value-format="YYYY-MM-DD HH:mm:ss"
|
||||||
value-format="yyyy-MM-dd HH:mm:ss"
|
|
||||||
type="daterange"
|
type="daterange"
|
||||||
range-separator="-"
|
range-separator="-"
|
||||||
start-placeholder="开始日期"
|
start-placeholder="开始日期"
|
||||||
end-placeholder="结束日期"
|
end-placeholder="结束日期"
|
||||||
:default-time="['00:00:00', '23:59:59']"
|
:default-time="[new Date(2000, 1, 1, 0, 0, 0), new Date(2000, 1, 1, 23, 59, 59)]"
|
||||||
></el-date-picker>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
#end
|
#end
|
||||||
#end
|
#end
|
||||||
#end
|
#end
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
|
</div>
|
||||||
|
</transition>
|
||||||
|
|
||||||
|
<el-card shadow="never">
|
||||||
|
<template #header>
|
||||||
<el-row :gutter="10" class="mb8">
|
<el-row :gutter="10" class="mb8">
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button type="primary" plain icon="Plus" @click="handleAdd()" v-hasPermi="['${moduleName}:${businessName}:add']">新增</el-button>
|
||||||
type="primary"
|
|
||||||
plain
|
|
||||||
icon="el-icon-plus"
|
|
||||||
size="mini"
|
|
||||||
@click="handleAdd"
|
|
||||||
v-hasPermi="['${moduleName}:${businessName}:add']"
|
|
||||||
>新增</el-button>
|
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button type="info" plain icon="Sort" @click="handleToggleExpandAll">展开/折叠</el-button>
|
||||||
type="info"
|
|
||||||
plain
|
|
||||||
icon="el-icon-sort"
|
|
||||||
size="mini"
|
|
||||||
@click="toggleExpandAll"
|
|
||||||
>展开/折叠</el-button>
|
|
||||||
</el-col>
|
</el-col>
|
||||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
</template>
|
||||||
<el-table
|
<el-table
|
||||||
v-if="refreshTable"
|
|
||||||
v-loading="loading"
|
v-loading="loading"
|
||||||
:data="${businessName}List"
|
:data="${businessName}List"
|
||||||
row-key="${treeCode}"
|
row-key="${treeCode}"
|
||||||
:default-expand-all="isExpandAll"
|
:default-expand-all="isExpandAll"
|
||||||
:tree-props="{children: 'children', hasChildren: 'hasChildren'}"
|
:tree-props="{children: 'children', hasChildren: 'hasChildren'}"
|
||||||
|
ref="${businessName}TableRef"
|
||||||
>
|
>
|
||||||
#foreach($column in $columns)
|
#foreach($column in $columns)
|
||||||
#set($javaField=$column.javaField)
|
#set($javaField=$column.javaField)
|
||||||
|
|
@ -110,7 +97,7 @@
|
||||||
#if($column.pk)
|
#if($column.pk)
|
||||||
#elseif($column.list && $column.htmlType == "datetime")
|
#elseif($column.list && $column.htmlType == "datetime")
|
||||||
<el-table-column label="${comment}" align="center" prop="${javaField}" width="180">
|
<el-table-column label="${comment}" align="center" prop="${javaField}" width="180">
|
||||||
<template slot-scope="scope">
|
<template #default="scope">
|
||||||
<span>{{ parseTime(scope.row.${javaField}, '{y}-{m}-{d}') }}</span>
|
<span>{{ parseTime(scope.row.${javaField}, '{y}-{m}-{d}') }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
@ -122,11 +109,11 @@
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
#elseif($column.list && $column.dictType && "" != $column.dictType)
|
#elseif($column.list && $column.dictType && "" != $column.dictType)
|
||||||
<el-table-column label="${comment}" align="center" prop="${javaField}">
|
<el-table-column label="${comment}" align="center" prop="${javaField}">
|
||||||
<template slot-scope="scope">
|
<template #default="scope">
|
||||||
#if($column.htmlType == "checkbox")
|
#if($column.htmlType == "checkbox")
|
||||||
<dict-tag :options="dict.type.${column.dictType}" :value="scope.row.${javaField} ? scope.row.${javaField}.split(',') : []"/>
|
<dict-tag :options="${column.dictType}" :value="scope.row.${javaField} ? scope.row.${javaField}.split(',') : []"/>
|
||||||
#else
|
#else
|
||||||
<dict-tag :options="dict.type.${column.dictType}" :value="scope.row.${javaField}"/>
|
<dict-tag :options="${column.dictType}" :value="scope.row.${javaField}"/>
|
||||||
#end
|
#end
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
@ -139,35 +126,23 @@
|
||||||
#end
|
#end
|
||||||
#end
|
#end
|
||||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||||
<template slot-scope="scope">
|
<template #default="scope">
|
||||||
<el-button
|
<el-tooltip content="修改" placement="top">
|
||||||
size="mini"
|
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['${moduleName}:${businessName}:edit']" />
|
||||||
type="text"
|
</el-tooltip>
|
||||||
icon="el-icon-edit"
|
<el-tooltip content="新增" placement="top">
|
||||||
@click="handleUpdate(scope.row)"
|
<el-button link type="primary" icon="Plus" @click="handleAdd(scope.row)" v-hasPermi="['${moduleName}:${businessName}:add']" />
|
||||||
v-hasPermi="['${moduleName}:${businessName}:edit']"
|
</el-tooltip>
|
||||||
>修改</el-button>
|
<el-tooltip content="删除" placement="top">
|
||||||
<el-button
|
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['${moduleName}:${businessName}:remove']" />
|
||||||
size="mini"
|
</el-tooltip>
|
||||||
type="text"
|
|
||||||
icon="el-icon-plus"
|
|
||||||
@click="handleAdd(scope.row)"
|
|
||||||
v-hasPermi="['${moduleName}:${businessName}:add']"
|
|
||||||
>新增</el-button>
|
|
||||||
<el-button
|
|
||||||
size="mini"
|
|
||||||
type="text"
|
|
||||||
icon="el-icon-delete"
|
|
||||||
@click="handleDelete(scope.row)"
|
|
||||||
v-hasPermi="['${moduleName}:${businessName}:remove']"
|
|
||||||
>删除</el-button>
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
</el-card>
|
||||||
<!-- 添加或修改${functionName}对话框 -->
|
<!-- 添加或修改${functionName}对话框 -->
|
||||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
<el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body>
|
||||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
<el-form ref="${businessName}FormRef" :model="form" :rules="rules" label-width="80px">
|
||||||
#foreach($column in $columns)
|
#foreach($column in $columns)
|
||||||
#set($field=$column.javaField)
|
#set($field=$column.javaField)
|
||||||
#if($column.insert && !$column.pk)
|
#if($column.insert && !$column.pk)
|
||||||
|
|
@ -180,7 +155,14 @@
|
||||||
#set($dictType=$column.dictType)
|
#set($dictType=$column.dictType)
|
||||||
#if("" != $treeParentCode && $column.javaField == $treeParentCode)
|
#if("" != $treeParentCode && $column.javaField == $treeParentCode)
|
||||||
<el-form-item label="${comment}" prop="${treeParentCode}">
|
<el-form-item label="${comment}" prop="${treeParentCode}">
|
||||||
<treeselect v-model="form.${treeParentCode}" :options="${businessName}Options" :normalizer="normalizer" placeholder="请选择${comment}" />
|
<el-tree-select
|
||||||
|
v-model="form.${treeParentCode}"
|
||||||
|
:data="${businessName}Options"
|
||||||
|
:props="{ value: '${treeCode}', label: '${treeName}', children: 'children' }"
|
||||||
|
value-key="${treeCode}"
|
||||||
|
placeholder="请选择${comment}"
|
||||||
|
check-strictly
|
||||||
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
#elseif($column.htmlType == "input")
|
#elseif($column.htmlType == "input")
|
||||||
<el-form-item label="${comment}" prop="${field}">
|
<el-form-item label="${comment}" prop="${field}">
|
||||||
|
|
@ -202,7 +184,7 @@
|
||||||
<el-form-item label="${comment}" prop="${field}">
|
<el-form-item label="${comment}" prop="${field}">
|
||||||
<el-select v-model="form.${field}" placeholder="请选择${comment}">
|
<el-select v-model="form.${field}" placeholder="请选择${comment}">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="dict in dict.type.${dictType}"
|
v-for="dict in ${dictType}"
|
||||||
:key="dict.value"
|
:key="dict.value"
|
||||||
:label="dict.label"
|
:label="dict.label"
|
||||||
#if($column.javaType == "Integer" || $column.javaType == "Long")
|
#if($column.javaType == "Integer" || $column.javaType == "Long")
|
||||||
|
|
@ -223,7 +205,7 @@
|
||||||
<el-form-item label="${comment}" prop="${field}">
|
<el-form-item label="${comment}" prop="${field}">
|
||||||
<el-checkbox-group v-model="form.${field}">
|
<el-checkbox-group v-model="form.${field}">
|
||||||
<el-checkbox
|
<el-checkbox
|
||||||
v-for="dict in dict.type.${dictType}"
|
v-for="dict in ${dictType}"
|
||||||
:key="dict.value"
|
:key="dict.value"
|
||||||
:label="dict.value">
|
:label="dict.value">
|
||||||
{{dict.label}}
|
{{dict.label}}
|
||||||
|
|
@ -240,7 +222,7 @@
|
||||||
<el-form-item label="${comment}" prop="${field}">
|
<el-form-item label="${comment}" prop="${field}">
|
||||||
<el-radio-group v-model="form.${field}">
|
<el-radio-group v-model="form.${field}">
|
||||||
<el-radio
|
<el-radio
|
||||||
v-for="dict in dict.type.${dictType}"
|
v-for="dict in ${dictType}"
|
||||||
:key="dict.value"
|
:key="dict.value"
|
||||||
#if($column.javaType == "Integer" || $column.javaType == "Long")
|
#if($column.javaType == "Integer" || $column.javaType == "Long")
|
||||||
:label="parseInt(dict.value)"
|
:label="parseInt(dict.value)"
|
||||||
|
|
@ -261,9 +243,9 @@
|
||||||
<el-date-picker clearable
|
<el-date-picker clearable
|
||||||
v-model="form.${field}"
|
v-model="form.${field}"
|
||||||
type="datetime"
|
type="datetime"
|
||||||
value-format="yyyy-MM-dd HH:mm:ss"
|
value-format="YYYY-MM-DD HH:mm:ss"
|
||||||
placeholder="选择${comment}">
|
placeholder="选择${comment}"
|
||||||
</el-date-picker>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
#elseif($column.htmlType == "textarea")
|
#elseif($column.htmlType == "textarea")
|
||||||
<el-form-item label="${comment}" prop="${field}">
|
<el-form-item label="${comment}" prop="${field}">
|
||||||
|
|
@ -273,55 +255,73 @@
|
||||||
#end
|
#end
|
||||||
#end
|
#end
|
||||||
</el-form>
|
</el-form>
|
||||||
<div slot="footer" class="dialog-footer">
|
<template #footer>
|
||||||
|
<div class="dialog-footer">
|
||||||
<el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
|
<el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
|
||||||
<el-button @click="cancel">取 消</el-button>
|
<el-button @click="cancel">取 消</el-button>
|
||||||
</div>
|
</div>
|
||||||
|
</template>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script setup name="${BusinessName}" lang="ts">
|
||||||
import { list${BusinessName}, get${BusinessName}, del${BusinessName}, add${BusinessName}, update${BusinessName} } from "@/api/${moduleName}/${businessName}";
|
import { list${BusinessName}, get${BusinessName}, del${BusinessName}, add${BusinessName}, update${BusinessName} } from "@/api/${moduleName}/${businessName}";
|
||||||
import Treeselect from "@riophae/vue-treeselect";
|
import { ${BusinessName}VO, ${BusinessName}Query, ${BusinessName}Form } from '@/api/${moduleName}/${businessName}/types';
|
||||||
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
import { ComponentInternalInstance } from 'vue';
|
||||||
|
import { ElForm, ElTable } from 'element-plus';
|
||||||
|
|
||||||
|
|
||||||
|
type ${BusinessName}Option = {
|
||||||
|
${treeCode}: number;
|
||||||
|
${treeName}: string;
|
||||||
|
children?: ${BusinessName}Option[];
|
||||||
|
}
|
||||||
|
|
||||||
|
const { proxy } = getCurrentInstance() as ComponentInternalInstance;;
|
||||||
|
|
||||||
export default {
|
|
||||||
name: "${BusinessName}",
|
|
||||||
#if(${dicts} != '')
|
#if(${dicts} != '')
|
||||||
dicts: [${dicts}],
|
#set($dictsNoSymbol=$dicts.replace("'", ""))
|
||||||
|
const { ${dictsNoSymbol} } = toRefs<any>(proxy?.useDict(${dicts}));
|
||||||
#end
|
#end
|
||||||
components: {
|
|
||||||
Treeselect
|
const ${businessName}List = ref<${BusinessName}VO[]>([]);
|
||||||
},
|
const ${businessName}Options = ref<${BusinessName}Option[]>([]);
|
||||||
data() {
|
const buttonLoading = ref(false);
|
||||||
return {
|
const showSearch = ref(true);
|
||||||
// 按钮loading
|
const isExpandAll = ref(true);
|
||||||
buttonLoading: false,
|
const loading = ref(false);
|
||||||
// 遮罩层
|
|
||||||
loading: true,
|
const queryFormRef = ref(ElForm);
|
||||||
// 显示搜索条件
|
const ${businessName}FormRef = ref(ElForm);
|
||||||
showSearch: true,
|
const ${businessName}TableRef = ref(ElTable)
|
||||||
// ${functionName}表格数据
|
|
||||||
${businessName}List: [],
|
const dialog = reactive<DialogOption>({
|
||||||
// ${functionName}树选项
|
visible: false,
|
||||||
${businessName}Options: [],
|
title: ''
|
||||||
// 弹出层标题
|
});
|
||||||
title: "",
|
|
||||||
// 是否显示弹出层
|
|
||||||
open: false,
|
|
||||||
// 是否展开,默认全部展开
|
|
||||||
isExpandAll: true,
|
|
||||||
// 重新渲染表格状态
|
|
||||||
refreshTable: true,
|
|
||||||
#foreach ($column in $columns)
|
#foreach ($column in $columns)
|
||||||
#if($column.htmlType == "datetime" && $column.queryType == "BETWEEN")
|
#if($column.htmlType == "datetime" && $column.queryType == "BETWEEN")
|
||||||
#set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)})
|
#set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)})
|
||||||
// $comment时间范围
|
const daterange${AttrName} = ref([]);
|
||||||
daterange${AttrName}: [],
|
|
||||||
#end
|
#end
|
||||||
#end
|
#end
|
||||||
// 查询参数
|
|
||||||
|
const initFormData: ${BusinessName}Form = {
|
||||||
|
#foreach ($column in $columns)
|
||||||
|
#if($column.insert || $column.edit)
|
||||||
|
#if($column.htmlType == "checkbox")
|
||||||
|
$column.javaField: []#if($foreach.count != $columns.size()),#end
|
||||||
|
#else
|
||||||
|
$column.javaField: undefined#if($foreach.count != $columns.size()),#end
|
||||||
|
#end
|
||||||
|
#end
|
||||||
|
#end
|
||||||
|
}
|
||||||
|
|
||||||
|
const data = reactive<PageData<${BusinessName}Form, ${BusinessName}Query>>({
|
||||||
|
form: {...initFormData},
|
||||||
queryParams: {
|
queryParams: {
|
||||||
#foreach ($column in $columns)
|
#foreach ($column in $columns)
|
||||||
#if($column.query)
|
#if($column.query)
|
||||||
|
|
@ -329,11 +329,9 @@ export default {
|
||||||
#end
|
#end
|
||||||
#end
|
#end
|
||||||
},
|
},
|
||||||
// 表单参数
|
|
||||||
form: {},
|
|
||||||
// 表单校验
|
|
||||||
rules: {
|
rules: {
|
||||||
#foreach ($column in $columns)
|
#foreach ($column in $columns)
|
||||||
|
#if($column.insert || $column.edit)
|
||||||
#if($column.required)
|
#if($column.required)
|
||||||
#set($parentheseIndex=$column.columnComment.indexOf("("))
|
#set($parentheseIndex=$column.columnComment.indexOf("("))
|
||||||
#if($parentheseIndex != -1)
|
#if($parentheseIndex != -1)
|
||||||
|
|
@ -345,174 +343,160 @@ export default {
|
||||||
{ required: true, message: "$comment不能为空", trigger: #if($column.htmlType == "select" || $column.htmlType == "radio")"change"#else"blur"#end }
|
{ required: true, message: "$comment不能为空", trigger: #if($column.htmlType == "select" || $column.htmlType == "radio")"change"#else"blur"#end }
|
||||||
]#if($foreach.count != $columns.size()),#end
|
]#if($foreach.count != $columns.size()),#end
|
||||||
#end
|
#end
|
||||||
|
#end
|
||||||
#end
|
#end
|
||||||
}
|
}
|
||||||
};
|
});
|
||||||
},
|
|
||||||
created() {
|
const { queryParams, form, rules } = toRefs(data);
|
||||||
this.getList();
|
|
||||||
},
|
/** 查询${functionName}列表 */
|
||||||
methods: {
|
const getList = async () => {
|
||||||
/** 查询${functionName}列表 */
|
loading.value = true;
|
||||||
getList() {
|
|
||||||
this.loading = true;
|
|
||||||
#foreach ($column in $columns)
|
#foreach ($column in $columns)
|
||||||
#if($column.htmlType == "datetime" && $column.queryType == "BETWEEN")
|
#if($column.htmlType == "datetime" && $column.queryType == "BETWEEN")
|
||||||
this.queryParams.params = {};
|
queryParams.value.params = {};
|
||||||
#break
|
#break
|
||||||
#end
|
#end
|
||||||
#end
|
#end
|
||||||
#foreach ($column in $columns)
|
#foreach ($column in $columns)
|
||||||
#if($column.htmlType == "datetime" && $column.queryType == "BETWEEN")
|
#if($column.htmlType == "datetime" && $column.queryType == "BETWEEN")
|
||||||
#set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)})
|
#set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)})
|
||||||
if (null != this.daterange${AttrName} && '' != this.daterange${AttrName}) {
|
if (null != daterange${AttrName} && '' != daterange${AttrName}) {
|
||||||
this.queryParams.params["begin${AttrName}"] = this.daterange${AttrName}[0];
|
queryParams.value.params["begin${AttrName}"] = daterange${AttrName}.value[0];
|
||||||
this.queryParams.params["end${AttrName}"] = this.daterange${AttrName}[1];
|
queryParams.value.params["end${AttrName}"] = daterange${AttrName}.value[1];
|
||||||
}
|
}
|
||||||
#end
|
#end
|
||||||
#end
|
#end
|
||||||
list${BusinessName}(this.queryParams).then(response => {
|
const res = await list${BusinessName}(queryParams.value);
|
||||||
this.${businessName}List = this.handleTree(response.data, "${treeCode}", "${treeParentCode}");
|
const data = proxy?.handleTree<${BusinessName}VO>(res.data, "${treeCode}", "${treeParentCode}");
|
||||||
this.loading = false;
|
if (data) {
|
||||||
});
|
${businessName}List.value = data;
|
||||||
},
|
loading.value = false;
|
||||||
/** 转换${functionName}数据结构 */
|
|
||||||
normalizer(node) {
|
|
||||||
if (node.children && !node.children.length) {
|
|
||||||
delete node.children;
|
|
||||||
}
|
}
|
||||||
return {
|
}
|
||||||
id: node.${treeCode},
|
|
||||||
label: node.${treeName},
|
/** 查询${functionName}下拉树结构 */
|
||||||
children: node.children
|
const getTreeselect = async () => {
|
||||||
};
|
const res = await list${BusinessName}();
|
||||||
},
|
${businessName}Options.value = [];
|
||||||
/** 查询${functionName}下拉树结构 */
|
const data: ${BusinessName}Option = { ${treeCode}: 0, ${treeName}: '顶级节点', children: [] };
|
||||||
getTreeselect() {
|
data.children = proxy?.handleTree<${BusinessName}Option>(res.data, "${treeCode}", "${treeParentCode}");
|
||||||
list${BusinessName}().then(response => {
|
${businessName}Options.value.push(data);
|
||||||
this.${businessName}Options = [];
|
}
|
||||||
const data = { ${treeCode}: 0, ${treeName}: '顶级节点', children: [] };
|
|
||||||
data.children = this.handleTree(response.data, "${treeCode}", "${treeParentCode}");
|
// 取消按钮
|
||||||
this.${businessName}Options.push(data);
|
const cancel = () => {
|
||||||
});
|
reset();
|
||||||
},
|
dialog.visible = false;
|
||||||
// 取消按钮
|
}
|
||||||
cancel() {
|
|
||||||
this.open = false;
|
// 表单重置
|
||||||
this.reset();
|
const reset = () => {
|
||||||
},
|
form.value = {...initFormData}
|
||||||
// 表单重置
|
${businessName}FormRef.value.resetFields();
|
||||||
reset() {
|
}
|
||||||
this.form = {
|
|
||||||
#foreach ($column in $columns)
|
/** 搜索按钮操作 */
|
||||||
#if($column.htmlType == "checkbox")
|
const handleQuery = () => {
|
||||||
$column.javaField: []#if($foreach.count != $columns.size()),#end
|
getList();
|
||||||
#else
|
}
|
||||||
$column.javaField: null#if($foreach.count != $columns.size()),#end
|
|
||||||
#end
|
/** 重置按钮操作 */
|
||||||
#end
|
const resetQuery = () => {
|
||||||
};
|
|
||||||
this.resetForm("form");
|
|
||||||
},
|
|
||||||
/** 搜索按钮操作 */
|
|
||||||
handleQuery() {
|
|
||||||
this.getList();
|
|
||||||
},
|
|
||||||
/** 重置按钮操作 */
|
|
||||||
resetQuery() {
|
|
||||||
#foreach ($column in $columns)
|
#foreach ($column in $columns)
|
||||||
#if($column.htmlType == "datetime" && $column.queryType == "BETWEEN")
|
#if($column.htmlType == "datetime" && $column.queryType == "BETWEEN")
|
||||||
#set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)})
|
#set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)})
|
||||||
this.daterange${AttrName} = [];
|
daterange${AttrName}.value = [];
|
||||||
#end
|
#end
|
||||||
#end
|
#end
|
||||||
this.resetForm("queryForm");
|
queryFormRef.value.resetFields();
|
||||||
this.handleQuery();
|
handleQuery();
|
||||||
},
|
}
|
||||||
/** 新增按钮操作 */
|
|
||||||
handleAdd(row) {
|
/** 新增按钮操作 */
|
||||||
this.reset();
|
const handleAdd = (row?: ${BusinessName}VO) => {
|
||||||
this.getTreeselect();
|
dialog.visible = true;
|
||||||
|
dialog.title = "添加${functionName}";
|
||||||
|
nextTick(() => {
|
||||||
|
reset();
|
||||||
|
getTreeselect();
|
||||||
if (row != null && row.${treeCode}) {
|
if (row != null && row.${treeCode}) {
|
||||||
this.form.${treeParentCode} = row.${treeCode};
|
form.value.${treeParentCode} = row.${treeCode};
|
||||||
} else {
|
} else {
|
||||||
this.form.${treeParentCode} = 0;
|
form.value.${treeParentCode} = 0;
|
||||||
}
|
}
|
||||||
this.open = true;
|
|
||||||
this.title = "添加${functionName}";
|
|
||||||
},
|
|
||||||
/** 展开/折叠操作 */
|
|
||||||
toggleExpandAll() {
|
|
||||||
this.refreshTable = false;
|
|
||||||
this.isExpandAll = !this.isExpandAll;
|
|
||||||
this.$nextTick(() => {
|
|
||||||
this.refreshTable = true;
|
|
||||||
});
|
});
|
||||||
},
|
}
|
||||||
/** 修改按钮操作 */
|
|
||||||
handleUpdate(row) {
|
/** 展开/折叠操作 */
|
||||||
this.loading = true;
|
const handleToggleExpandAll = () => {
|
||||||
this.reset();
|
isExpandAll.value = !isExpandAll.value;
|
||||||
this.getTreeselect();
|
toggleExpandAll(${businessName}List.value, isExpandAll.value)
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 展开/折叠操作 */
|
||||||
|
const toggleExpandAll = (data: ${BusinessName}VO[], status: boolean) => {
|
||||||
|
data.forEach((item) => {
|
||||||
|
${businessName}TableRef.value.toggleRowExpansion(item, status)
|
||||||
|
if (item.children && item.children.length > 0) toggleExpandAll(item.children, status)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 修改按钮操作 */
|
||||||
|
const handleUpdate = (row: ${BusinessName}VO) => {
|
||||||
|
loading.value = true;
|
||||||
|
dialog.visible = true;
|
||||||
|
dialog.title = "修改${functionName}";
|
||||||
|
nextTick(async () => {
|
||||||
|
reset();
|
||||||
|
await getTreeselect();
|
||||||
if (row != null) {
|
if (row != null) {
|
||||||
this.form.${treeParentCode} = row.${treeCode};
|
form.value.${treeParentCode} = row.${treeCode};
|
||||||
}
|
}
|
||||||
get${BusinessName}(row.${pkColumn.javaField}).then(response => {
|
const res = await get${BusinessName}(row.${treeCode});
|
||||||
this.loading = false;
|
loading.value = false;
|
||||||
this.form = response.data;
|
Object.assign(form.value, res.data);
|
||||||
#foreach ($column in $columns)
|
#foreach ($column in $columns)
|
||||||
#if($column.htmlType == "checkbox")
|
#if($column.htmlType == "checkbox")
|
||||||
this.form.$column.javaField = this.form.${column.javaField}.split(",");
|
form.value.$column.javaField = form.value.${column.javaField}.split(",");
|
||||||
#end
|
#end
|
||||||
#end
|
#end
|
||||||
this.open = true;
|
|
||||||
this.title = "修改${functionName}";
|
|
||||||
});
|
});
|
||||||
},
|
}
|
||||||
/** 提交按钮 */
|
|
||||||
submitForm() {
|
/** 提交按钮 */
|
||||||
this.#[[$]]#refs["form"].validate(valid => {
|
const submitForm = () => {
|
||||||
|
${businessName}FormRef.value.validate(async (valid: boolean) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
this.buttonLoading = true;
|
buttonLoading.value = true;
|
||||||
#foreach ($column in $columns)
|
#foreach ($column in $columns)
|
||||||
#if($column.htmlType == "checkbox")
|
#if($column.htmlType == "checkbox")
|
||||||
this.form.$column.javaField = this.form.${column.javaField}.join(",");
|
form.value.$column.javaField = form.value.${column.javaField}.join(",");
|
||||||
#end
|
#end
|
||||||
#end
|
#end
|
||||||
if (this.form.${pkColumn.javaField} != null) {
|
if (form.value.${pkColumn.javaField}) {
|
||||||
update${BusinessName}(this.form).then(response => {
|
await update${BusinessName}(form.value).finally(() => buttonLoading.value = false);
|
||||||
this.#[[$modal]]#.msgSuccess("修改成功");
|
|
||||||
this.open = false;
|
|
||||||
this.getList();
|
|
||||||
}).finally(() => {
|
|
||||||
this.buttonLoading = false;
|
|
||||||
});
|
|
||||||
} else {
|
} else {
|
||||||
add${BusinessName}(this.form).then(response => {
|
await add${BusinessName}(form.value).finally(() => buttonLoading.value = false);
|
||||||
this.#[[$modal]]#.msgSuccess("新增成功");
|
|
||||||
this.open = false;
|
|
||||||
this.getList();
|
|
||||||
}).finally(() => {
|
|
||||||
this.buttonLoading = false;
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
proxy?.#[[$modal]]#.msgSuccess("操作成功");
|
||||||
|
dialog.visible = false;
|
||||||
|
getList();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
}
|
||||||
/** 删除按钮操作 */
|
|
||||||
handleDelete(row) {
|
/** 删除按钮操作 */
|
||||||
this.#[[$modal]]#.confirm('是否确认删除${functionName}编号为"' + row.${pkColumn.javaField} + '"的数据项?').then(() => {
|
const handleDelete = async (row: ${BusinessName}VO) => {
|
||||||
this.loading = true;
|
await proxy?.#[[$modal]]#.confirm('是否确认删除${functionName}编号为"' + row.${pkColumn.javaField} + '"的数据项?');
|
||||||
return del${BusinessName}(row.${pkColumn.javaField});
|
loading.value = true;
|
||||||
}).then(() => {
|
await del${BusinessName}(row.${pkColumn.javaField}).finally(() => loading.value = false);
|
||||||
this.loading = false;
|
await getList();
|
||||||
this.getList();
|
proxy?.#[[$modal]]#.msgSuccess("删除成功");
|
||||||
this.#[[$modal]]#.msgSuccess("删除成功");
|
}
|
||||||
}).catch(() => {
|
|
||||||
}).finally(() => {
|
onMounted(() => {
|
||||||
this.loading = false;
|
getList();
|
||||||
});
|
});
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,8 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="p-2">
|
||||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
|
||||||
|
<div class="search" v-show="showSearch">
|
||||||
|
<el-form :model="queryParams" ref="queryFormRef" :inline="true" label-width="68px">
|
||||||
#foreach($column in $columns)
|
#foreach($column in $columns)
|
||||||
#if($column.query)
|
#if($column.query)
|
||||||
#set($dictType=$column.dictType)
|
#set($dictType=$column.dictType)
|
||||||
|
|
@ -13,18 +15,13 @@
|
||||||
#end
|
#end
|
||||||
#if($column.htmlType == "input" || $column.htmlType == "textarea")
|
#if($column.htmlType == "input" || $column.htmlType == "textarea")
|
||||||
<el-form-item label="${comment}" prop="${column.javaField}">
|
<el-form-item label="${comment}" prop="${column.javaField}">
|
||||||
<el-input
|
<el-input v-model="queryParams.${column.javaField}" placeholder="请输入${comment}" clearable @keyup.enter="handleQuery" />
|
||||||
v-model="queryParams.${column.javaField}"
|
|
||||||
placeholder="请输入${comment}"
|
|
||||||
clearable
|
|
||||||
@keyup.enter.native="handleQuery"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
#elseif(($column.htmlType == "select" || $column.htmlType == "radio") && "" != $dictType)
|
#elseif(($column.htmlType == "select" || $column.htmlType == "radio") && "" != $dictType)
|
||||||
<el-form-item label="${comment}" prop="${column.javaField}">
|
<el-form-item label="${comment}" prop="${column.javaField}">
|
||||||
<el-select v-model="queryParams.${column.javaField}" placeholder="请选择${comment}" clearable>
|
<el-select v-model="queryParams.${column.javaField}" placeholder="请选择${comment}" clearable>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="dict in dict.type.${dictType}"
|
v-for="dict in ${dictType}"
|
||||||
:key="dict.value"
|
:key="dict.value"
|
||||||
:label="dict.label"
|
:label="dict.label"
|
||||||
:value="dict.value"
|
:value="dict.value"
|
||||||
|
|
@ -42,77 +39,51 @@
|
||||||
<el-date-picker clearable
|
<el-date-picker clearable
|
||||||
v-model="queryParams.${column.javaField}"
|
v-model="queryParams.${column.javaField}"
|
||||||
type="date"
|
type="date"
|
||||||
value-format="yyyy-MM-dd"
|
value-format="YYYY-MM-DD"
|
||||||
placeholder="请选择${comment}">
|
placeholder="请选择${comment}"
|
||||||
</el-date-picker>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
#elseif($column.htmlType == "datetime" && $column.queryType == "BETWEEN")
|
#elseif($column.htmlType == "datetime" && $column.queryType == "BETWEEN")
|
||||||
<el-form-item label="${comment}">
|
<el-form-item label="${comment}" style="width: 308px">
|
||||||
<el-date-picker
|
<el-date-picker
|
||||||
v-model="daterange${AttrName}"
|
v-model="daterange${AttrName}"
|
||||||
style="width: 240px"
|
value-format="YYYY-MM-DD HH:mm:ss"
|
||||||
value-format="yyyy-MM-dd HH:mm:ss"
|
|
||||||
type="daterange"
|
type="daterange"
|
||||||
range-separator="-"
|
range-separator="-"
|
||||||
start-placeholder="开始日期"
|
start-placeholder="开始日期"
|
||||||
end-placeholder="结束日期"
|
end-placeholder="结束日期"
|
||||||
:default-time="['00:00:00', '23:59:59']"
|
:default-time="[new Date(2000, 1, 1, 0, 0, 0), new Date(2000, 1, 1, 23, 59, 59)]"
|
||||||
></el-date-picker>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
#end
|
#end
|
||||||
#end
|
#end
|
||||||
#end
|
#end
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
|
</div>
|
||||||
|
</transition>
|
||||||
|
|
||||||
|
<el-card shadow="never">
|
||||||
|
<template #header>
|
||||||
<el-row :gutter="10" class="mb8">
|
<el-row :gutter="10" class="mb8">
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['${moduleName}:${businessName}:add']">新增</el-button>
|
||||||
type="primary"
|
|
||||||
plain
|
|
||||||
icon="el-icon-plus"
|
|
||||||
size="mini"
|
|
||||||
@click="handleAdd"
|
|
||||||
v-hasPermi="['${moduleName}:${businessName}:add']"
|
|
||||||
>新增</el-button>
|
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['${moduleName}:${businessName}:edit']">修改</el-button>
|
||||||
type="success"
|
|
||||||
plain
|
|
||||||
icon="el-icon-edit"
|
|
||||||
size="mini"
|
|
||||||
:disabled="single"
|
|
||||||
@click="handleUpdate"
|
|
||||||
v-hasPermi="['${moduleName}:${businessName}:edit']"
|
|
||||||
>修改</el-button>
|
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['${moduleName}:${businessName}:remove']">删除</el-button>
|
||||||
type="danger"
|
|
||||||
plain
|
|
||||||
icon="el-icon-delete"
|
|
||||||
size="mini"
|
|
||||||
:disabled="multiple"
|
|
||||||
@click="handleDelete"
|
|
||||||
v-hasPermi="['${moduleName}:${businessName}:remove']"
|
|
||||||
>删除</el-button>
|
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['${moduleName}:${businessName}:export']">导出</el-button>
|
||||||
type="warning"
|
|
||||||
plain
|
|
||||||
icon="el-icon-download"
|
|
||||||
size="mini"
|
|
||||||
@click="handleExport"
|
|
||||||
v-hasPermi="['${moduleName}:${businessName}:export']"
|
|
||||||
>导出</el-button>
|
|
||||||
</el-col>
|
</el-col>
|
||||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
</template>
|
||||||
|
|
||||||
<el-table v-loading="loading" :data="${businessName}List" @selection-change="handleSelectionChange">
|
<el-table v-loading="loading" :data="${businessName}List" @selection-change="handleSelectionChange">
|
||||||
<el-table-column type="selection" width="55" align="center" />
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
|
|
@ -125,26 +96,26 @@
|
||||||
#set($comment=$column.columnComment)
|
#set($comment=$column.columnComment)
|
||||||
#end
|
#end
|
||||||
#if($column.pk)
|
#if($column.pk)
|
||||||
<el-table-column label="${comment}" align="center" prop="${javaField}" v-if="${column.list}"/>
|
<el-table-column label="${comment}" align="center" prop="${javaField}" v-if="${column.list}" />
|
||||||
#elseif($column.list && $column.htmlType == "datetime")
|
#elseif($column.list && $column.htmlType == "datetime")
|
||||||
<el-table-column label="${comment}" align="center" prop="${javaField}" width="180">
|
<el-table-column label="${comment}" align="center" prop="${javaField}" width="180">
|
||||||
<template slot-scope="scope">
|
<template #default="scope">
|
||||||
<span>{{ parseTime(scope.row.${javaField}, '{y}-{m}-{d}') }}</span>
|
<span>{{ parseTime(scope.row.${javaField}, '{y}-{m}-{d}') }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
#elseif($column.list && $column.htmlType == "imageUpload")
|
#elseif($column.list && $column.htmlType == "imageUpload")
|
||||||
<el-table-column label="${comment}" align="center" prop="${javaField}" width="100">
|
<el-table-column label="${comment}" align="center" prop="${javaField}" width="100">
|
||||||
<template slot-scope="scope">
|
<template #default="scope">
|
||||||
<image-preview :src="scope.row.${javaField}" :width="50" :height="50"/>
|
<image-preview :src="scope.row.${javaField}" :width="50" :height="50"/>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
#elseif($column.list && $column.dictType && "" != $column.dictType)
|
#elseif($column.list && $column.dictType && "" != $column.dictType)
|
||||||
<el-table-column label="${comment}" align="center" prop="${javaField}">
|
<el-table-column label="${comment}" align="center" prop="${javaField}">
|
||||||
<template slot-scope="scope">
|
<template #default="scope">
|
||||||
#if($column.htmlType == "checkbox")
|
#if($column.htmlType == "checkbox")
|
||||||
<dict-tag :options="dict.type.${column.dictType}" :value="scope.row.${javaField} ? scope.row.${javaField}.split(',') : []"/>
|
<dict-tag :options="${column.dictType}" :value="scope.row.${javaField} ? scope.row.${javaField}.split(',') : []"/>
|
||||||
#else
|
#else
|
||||||
<dict-tag :options="dict.type.${column.dictType}" :value="scope.row.${javaField}"/>
|
<dict-tag :options="${column.dictType}" :value="scope.row.${javaField}"/>
|
||||||
#end
|
#end
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
@ -153,21 +124,13 @@
|
||||||
#end
|
#end
|
||||||
#end
|
#end
|
||||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||||
<template slot-scope="scope">
|
<template #default="scope">
|
||||||
<el-button
|
<el-tooltip content="修改" placement="top">
|
||||||
size="mini"
|
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['${moduleName}:${businessName}:edit']"></el-button>
|
||||||
type="text"
|
</el-tooltip>
|
||||||
icon="el-icon-edit"
|
<el-tooltip content="删除" placement="top">
|
||||||
@click="handleUpdate(scope.row)"
|
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['${moduleName}:${businessName}:remove']"></el-button>
|
||||||
v-hasPermi="['${moduleName}:${businessName}:edit']"
|
</el-tooltip>
|
||||||
>修改</el-button>
|
|
||||||
<el-button
|
|
||||||
size="mini"
|
|
||||||
type="text"
|
|
||||||
icon="el-icon-delete"
|
|
||||||
@click="handleDelete(scope.row)"
|
|
||||||
v-hasPermi="['${moduleName}:${businessName}:remove']"
|
|
||||||
>删除</el-button>
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|
@ -175,14 +138,14 @@
|
||||||
<pagination
|
<pagination
|
||||||
v-show="total>0"
|
v-show="total>0"
|
||||||
:total="total"
|
:total="total"
|
||||||
:page.sync="queryParams.pageNum"
|
v-model:page="queryParams.pageNum"
|
||||||
:limit.sync="queryParams.pageSize"
|
v-model:limit="queryParams.pageSize"
|
||||||
@pagination="getList"
|
@pagination="getList"
|
||||||
/>
|
/>
|
||||||
|
</el-card>
|
||||||
<!-- 添加或修改${functionName}对话框 -->
|
<!-- 添加或修改${functionName}对话框 -->
|
||||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
<el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body>
|
||||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
<el-form ref="${businessName}FormRef" :model="form" :rules="rules" label-width="80px">
|
||||||
#foreach($column in $columns)
|
#foreach($column in $columns)
|
||||||
#set($field=$column.javaField)
|
#set($field=$column.javaField)
|
||||||
#if($column.insert && !$column.pk)
|
#if($column.insert && !$column.pk)
|
||||||
|
|
@ -213,7 +176,7 @@
|
||||||
<el-form-item label="${comment}" prop="${field}">
|
<el-form-item label="${comment}" prop="${field}">
|
||||||
<el-select v-model="form.${field}" placeholder="请选择${comment}">
|
<el-select v-model="form.${field}" placeholder="请选择${comment}">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="dict in dict.type.${dictType}"
|
v-for="dict in ${dictType}"
|
||||||
:key="dict.value"
|
:key="dict.value"
|
||||||
:label="dict.label"
|
:label="dict.label"
|
||||||
#if($column.javaType == "Integer" || $column.javaType == "Long")
|
#if($column.javaType == "Integer" || $column.javaType == "Long")
|
||||||
|
|
@ -234,7 +197,7 @@
|
||||||
<el-form-item label="${comment}" prop="${field}">
|
<el-form-item label="${comment}" prop="${field}">
|
||||||
<el-checkbox-group v-model="form.${field}">
|
<el-checkbox-group v-model="form.${field}">
|
||||||
<el-checkbox
|
<el-checkbox
|
||||||
v-for="dict in dict.type.${dictType}"
|
v-for="dict in ${dictType}"
|
||||||
:key="dict.value"
|
:key="dict.value"
|
||||||
:label="dict.value">
|
:label="dict.value">
|
||||||
{{dict.label}}
|
{{dict.label}}
|
||||||
|
|
@ -251,7 +214,7 @@
|
||||||
<el-form-item label="${comment}" prop="${field}">
|
<el-form-item label="${comment}" prop="${field}">
|
||||||
<el-radio-group v-model="form.${field}">
|
<el-radio-group v-model="form.${field}">
|
||||||
<el-radio
|
<el-radio
|
||||||
v-for="dict in dict.type.${dictType}"
|
v-for="dict in ${dictType}"
|
||||||
:key="dict.value"
|
:key="dict.value"
|
||||||
#if($column.javaType == "Integer" || $column.javaType == "Long")
|
#if($column.javaType == "Integer" || $column.javaType == "Long")
|
||||||
:label="parseInt(dict.value)"
|
:label="parseInt(dict.value)"
|
||||||
|
|
@ -272,7 +235,7 @@
|
||||||
<el-date-picker clearable
|
<el-date-picker clearable
|
||||||
v-model="form.${field}"
|
v-model="form.${field}"
|
||||||
type="datetime"
|
type="datetime"
|
||||||
value-format="yyyy-MM-dd HH:mm:ss"
|
value-format="YYYY-MM-DD HH:mm:ss"
|
||||||
placeholder="请选择${comment}">
|
placeholder="请选择${comment}">
|
||||||
</el-date-picker>
|
</el-date-picker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
@ -282,121 +245,66 @@
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
#end
|
#end
|
||||||
#end
|
#end
|
||||||
#end
|
|
||||||
#if($table.sub)
|
|
||||||
<el-divider content-position="center">${subTable.functionName}信息</el-divider>
|
|
||||||
<el-row :gutter="10" class="mb8">
|
|
||||||
<el-col :span="1.5">
|
|
||||||
<el-button type="primary" icon="el-icon-plus" size="mini" @click="handleAdd${subClassName}">添加</el-button>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="1.5">
|
|
||||||
<el-button type="danger" icon="el-icon-delete" size="mini" @click="handleDelete${subClassName}">删除</el-button>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-table :data="${subclassName}List" :row-class-name="row${subClassName}Index" @selection-change="handle${subClassName}SelectionChange" ref="${subclassName}">
|
|
||||||
<el-table-column type="selection" width="50" align="center" />
|
|
||||||
<el-table-column label="序号" align="center" prop="index" width="50"/>
|
|
||||||
#foreach($column in $subTable.columns)
|
|
||||||
#set($javaField=$column.javaField)
|
|
||||||
#set($parentheseIndex=$column.columnComment.indexOf("("))
|
|
||||||
#if($parentheseIndex != -1)
|
|
||||||
#set($comment=$column.columnComment.substring(0, $parentheseIndex))
|
|
||||||
#else
|
|
||||||
#set($comment=$column.columnComment)
|
|
||||||
#end
|
|
||||||
#if($column.pk || $javaField == ${subTableFkclassName})
|
|
||||||
#elseif($column.list && $column.htmlType == "input")
|
|
||||||
<el-table-column label="$comment" prop="${javaField}" width="150">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<el-input v-model="scope.row.$javaField" placeholder="请输入$comment" />
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
#elseif($column.list && $column.htmlType == "datetime")
|
|
||||||
<el-table-column label="$comment" prop="${javaField}" width="240">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<el-date-picker clearable v-model="scope.row.$javaField" type="date" value-format="yyyy-MM-dd" placeholder="请选择$comment" />
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
#elseif($column.list && ($column.htmlType == "select" || $column.htmlType == "radio") && "" != $column.dictType)
|
|
||||||
<el-table-column label="$comment" prop="${javaField}" width="150">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<el-select v-model="scope.row.$javaField" placeholder="请选择$comment">
|
|
||||||
<el-option
|
|
||||||
v-for="dict in dict.type.$column.dictType"
|
|
||||||
:key="dict.value"
|
|
||||||
:label="dict.label"
|
|
||||||
:value="dict.value"
|
|
||||||
></el-option>
|
|
||||||
</el-select>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
#elseif($column.list && ($column.htmlType == "select" || $column.htmlType == "radio") && "" == $column.dictType)
|
|
||||||
<el-table-column label="$comment" prop="${javaField}" width="150">
|
|
||||||
<template slot-scope="scope">
|
|
||||||
<el-select v-model="scope.row.$javaField" placeholder="请选择$comment">
|
|
||||||
<el-option label="请选择字典生成" value="" />
|
|
||||||
</el-select>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
#end
|
|
||||||
#end
|
|
||||||
</el-table>
|
|
||||||
#end
|
#end
|
||||||
</el-form>
|
</el-form>
|
||||||
<div slot="footer" class="dialog-footer">
|
<template #footer>
|
||||||
|
<div class="dialog-footer">
|
||||||
<el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
|
<el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
|
||||||
<el-button @click="cancel">取 消</el-button>
|
<el-button @click="cancel">取 消</el-button>
|
||||||
</div>
|
</div>
|
||||||
|
</template>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script setup name="${BusinessName}" lang="ts">
|
||||||
import { list${BusinessName}, get${BusinessName}, del${BusinessName}, add${BusinessName}, update${BusinessName} } from "@/api/${moduleName}/${businessName}";
|
import { list${BusinessName}, get${BusinessName}, del${BusinessName}, add${BusinessName}, update${BusinessName} } from '@/api/${moduleName}/${businessName}';
|
||||||
|
import { ${BusinessName}VO, ${BusinessName}Query, ${BusinessName}Form } from '@/api/${moduleName}/${businessName}/types';
|
||||||
|
import { ComponentInternalInstance } from 'vue';
|
||||||
|
import { ElForm } from 'element-plus';
|
||||||
|
|
||||||
export default {
|
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||||
name: "${BusinessName}",
|
|
||||||
#if(${dicts} != '')
|
#if(${dicts} != '')
|
||||||
dicts: [${dicts}],
|
#set($dictsNoSymbol=$dicts.replace("'", ""))
|
||||||
|
const { ${dictsNoSymbol} } = toRefs<any>(proxy?.useDict(${dicts}));
|
||||||
#end
|
#end
|
||||||
data() {
|
|
||||||
return {
|
const ${businessName}List = ref<${BusinessName}VO[]>([]);
|
||||||
// 按钮loading
|
const buttonLoading = ref(false);
|
||||||
buttonLoading: false,
|
const loading = ref(true);
|
||||||
// 遮罩层
|
const showSearch = ref(true);
|
||||||
loading: true,
|
const ids = ref<Array<string | number>>([]);
|
||||||
// 选中数组
|
const single = ref(true);
|
||||||
ids: [],
|
const multiple = ref(true);
|
||||||
#if($table.sub)
|
const total = ref(0);
|
||||||
// 子表选中数据
|
|
||||||
checked${subClassName}: [],
|
|
||||||
#end
|
|
||||||
// 非单个禁用
|
|
||||||
single: true,
|
|
||||||
// 非多个禁用
|
|
||||||
multiple: true,
|
|
||||||
// 显示搜索条件
|
|
||||||
showSearch: true,
|
|
||||||
// 总条数
|
|
||||||
total: 0,
|
|
||||||
// ${functionName}表格数据
|
|
||||||
${businessName}List: [],
|
|
||||||
#if($table.sub)
|
|
||||||
// ${subTable.functionName}表格数据
|
|
||||||
${subclassName}List: [],
|
|
||||||
#end
|
|
||||||
// 弹出层标题
|
|
||||||
title: "",
|
|
||||||
// 是否显示弹出层
|
|
||||||
open: false,
|
|
||||||
#foreach ($column in $columns)
|
#foreach ($column in $columns)
|
||||||
#if($column.htmlType == "datetime" && $column.queryType == "BETWEEN")
|
#if($column.htmlType == "datetime" && $column.queryType == "BETWEEN")
|
||||||
#set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)})
|
#set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)})
|
||||||
// $comment时间范围
|
const daterange${AttrName} = ref([]);
|
||||||
daterange${AttrName}: [],
|
|
||||||
#end
|
#end
|
||||||
#end
|
#end
|
||||||
// 查询参数
|
|
||||||
|
const queryFormRef = ref(ElForm);
|
||||||
|
const ${businessName}FormRef = ref(ElForm);
|
||||||
|
|
||||||
|
const dialog = reactive<DialogOption>({
|
||||||
|
visible: false,
|
||||||
|
title: ''
|
||||||
|
});
|
||||||
|
|
||||||
|
const initFormData: ${BusinessName}Form = {
|
||||||
|
#foreach ($column in $columns)
|
||||||
|
#if($column.insert || $column.edit)
|
||||||
|
#if($column.htmlType == "checkbox")
|
||||||
|
$column.javaField: []#if($foreach.count != $columns.size()),#end
|
||||||
|
#else
|
||||||
|
$column.javaField: undefined#if($foreach.count != $columns.size()),#end
|
||||||
|
#end
|
||||||
|
#end
|
||||||
|
#end
|
||||||
|
}
|
||||||
|
const data = reactive<PageData<${BusinessName}Form, ${BusinessName}Query>>({
|
||||||
|
form: {...initFormData},
|
||||||
queryParams: {
|
queryParams: {
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
|
|
@ -406,11 +314,9 @@ export default {
|
||||||
#end
|
#end
|
||||||
#end
|
#end
|
||||||
},
|
},
|
||||||
// 表单参数
|
|
||||||
form: {},
|
|
||||||
// 表单校验
|
|
||||||
rules: {
|
rules: {
|
||||||
#foreach ($column in $columns)
|
#foreach ($column in $columns)
|
||||||
|
#if($column.insert || $column.edit)
|
||||||
#if($column.required)
|
#if($column.required)
|
||||||
#set($parentheseIndex=$column.columnComment.indexOf("("))
|
#set($parentheseIndex=$column.columnComment.indexOf("("))
|
||||||
#if($parentheseIndex != -1)
|
#if($parentheseIndex != -1)
|
||||||
|
|
@ -422,194 +328,141 @@ export default {
|
||||||
{ required: true, message: "$comment不能为空", trigger: #if($column.htmlType == "select" || $column.htmlType == "radio")"change"#else"blur"#end }
|
{ required: true, message: "$comment不能为空", trigger: #if($column.htmlType == "select" || $column.htmlType == "radio")"change"#else"blur"#end }
|
||||||
]#if($foreach.count != $columns.size()),#end
|
]#if($foreach.count != $columns.size()),#end
|
||||||
#end
|
#end
|
||||||
|
#end
|
||||||
#end
|
#end
|
||||||
}
|
}
|
||||||
};
|
});
|
||||||
},
|
|
||||||
created() {
|
const { queryParams, form, rules } = toRefs(data);
|
||||||
this.getList();
|
|
||||||
},
|
/** 查询${functionName}列表 */
|
||||||
methods: {
|
const getList = async () => {
|
||||||
/** 查询${functionName}列表 */
|
loading.value = true;
|
||||||
getList() {
|
|
||||||
this.loading = true;
|
|
||||||
#foreach ($column in $columns)
|
#foreach ($column in $columns)
|
||||||
#if($column.htmlType == "datetime" && $column.queryType == "BETWEEN")
|
#if($column.htmlType == "datetime" && $column.queryType == "BETWEEN")
|
||||||
this.queryParams.params = {};
|
queryParams.value.params = {};
|
||||||
#break
|
#break
|
||||||
#end
|
#end
|
||||||
#end
|
#end
|
||||||
#foreach ($column in $columns)
|
#foreach ($column in $columns)
|
||||||
#if($column.htmlType == "datetime" && $column.queryType == "BETWEEN")
|
#if($column.htmlType == "datetime" && $column.queryType == "BETWEEN")
|
||||||
#set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)})
|
#set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)})
|
||||||
if (null != this.daterange${AttrName} && '' != this.daterange${AttrName}) {
|
if (null != daterange${AttrName} && '' != daterange${AttrName}) {
|
||||||
this.queryParams.params["begin${AttrName}"] = this.daterange${AttrName}[0];
|
queryParams.value.params["begin${AttrName}"] = daterange${AttrName}.value[0];
|
||||||
this.queryParams.params["end${AttrName}"] = this.daterange${AttrName}[1];
|
queryParams.value.params["end${AttrName}"] = daterange${AttrName}.value[1];
|
||||||
}
|
}
|
||||||
#end
|
#end
|
||||||
#end
|
#end
|
||||||
list${BusinessName}(this.queryParams).then(response => {
|
const res = await list${BusinessName}(queryParams.value);
|
||||||
this.${businessName}List = response.rows;
|
${businessName}List.value = res.rows;
|
||||||
this.total = response.total;
|
total.value = res.total;
|
||||||
this.loading = false;
|
loading.value = false;
|
||||||
});
|
}
|
||||||
},
|
|
||||||
// 取消按钮
|
/** 取消按钮 */
|
||||||
cancel() {
|
const cancel = () => {
|
||||||
this.open = false;
|
reset();
|
||||||
this.reset();
|
dialog.visible = false;
|
||||||
},
|
}
|
||||||
// 表单重置
|
|
||||||
reset() {
|
/** 表单重置 */
|
||||||
this.form = {
|
const reset = () => {
|
||||||
#foreach ($column in $columns)
|
form.value = {...initFormData};
|
||||||
#if($column.htmlType == "checkbox")
|
${businessName}FormRef.value.resetFields();
|
||||||
$column.javaField: []#if($foreach.count != $columns.size()),#end
|
}
|
||||||
#else
|
|
||||||
$column.javaField: undefined#if($foreach.count != $columns.size()),#end
|
/** 搜索按钮操作 */
|
||||||
#end
|
const handleQuery = () => {
|
||||||
#end
|
queryParams.value.pageNum = 1;
|
||||||
};
|
getList();
|
||||||
#if($table.sub)
|
}
|
||||||
this.${subclassName}List = [];
|
|
||||||
#end
|
/** 重置按钮操作 */
|
||||||
this.resetForm("form");
|
const resetQuery = () => {
|
||||||
},
|
|
||||||
/** 搜索按钮操作 */
|
|
||||||
handleQuery() {
|
|
||||||
this.queryParams.pageNum = 1;
|
|
||||||
this.getList();
|
|
||||||
},
|
|
||||||
/** 重置按钮操作 */
|
|
||||||
resetQuery() {
|
|
||||||
#foreach ($column in $columns)
|
#foreach ($column in $columns)
|
||||||
#if($column.htmlType == "datetime" && $column.queryType == "BETWEEN")
|
#if($column.htmlType == "datetime" && $column.queryType == "BETWEEN")
|
||||||
#set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)})
|
#set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)})
|
||||||
this.daterange${AttrName} = [];
|
daterange${AttrName}.value = [];
|
||||||
#end
|
#end
|
||||||
#end
|
#end
|
||||||
this.resetForm("queryForm");
|
queryFormRef.value.resetFields();
|
||||||
this.handleQuery();
|
handleQuery();
|
||||||
},
|
}
|
||||||
// 多选框选中数据
|
|
||||||
handleSelectionChange(selection) {
|
/** 多选框选中数据 */
|
||||||
this.ids = selection.map(item => item.${pkColumn.javaField})
|
const handleSelectionChange = (selection: ${BusinessName}VO[]) => {
|
||||||
this.single = selection.length!==1
|
ids.value = selection.map(item => item.${pkColumn.javaField});
|
||||||
this.multiple = !selection.length
|
single.value = selection.length != 1;
|
||||||
},
|
multiple.value = !selection.length;
|
||||||
/** 新增按钮操作 */
|
}
|
||||||
handleAdd() {
|
|
||||||
this.reset();
|
/** 新增按钮操作 */
|
||||||
this.open = true;
|
const handleAdd = () => {
|
||||||
this.title = "添加${functionName}";
|
dialog.visible = true;
|
||||||
},
|
dialog.title = "添加${functionName}";
|
||||||
/** 修改按钮操作 */
|
nextTick(() => {
|
||||||
handleUpdate(row) {
|
reset();
|
||||||
this.loading = true;
|
});
|
||||||
this.reset();
|
}
|
||||||
const ${pkColumn.javaField} = row.${pkColumn.javaField} || this.ids
|
|
||||||
get${BusinessName}(${pkColumn.javaField}).then(response => {
|
/** 修改按钮操作 */
|
||||||
this.loading = false;
|
const handleUpdate = (row?: ${BusinessName}VO) => {
|
||||||
this.form = response.data;
|
loading.value = true
|
||||||
|
dialog.visible = true;
|
||||||
|
dialog.title = "修改${functionName}";
|
||||||
|
nextTick(async () => {
|
||||||
|
reset();
|
||||||
|
const _${pkColumn.javaField} = row?.${pkColumn.javaField} || ids.value[0]
|
||||||
|
const res = await get${BusinessName}(_${pkColumn.javaField});
|
||||||
|
loading.value = false;
|
||||||
|
Object.assign(form.value, res.data);
|
||||||
#foreach ($column in $columns)
|
#foreach ($column in $columns)
|
||||||
#if($column.htmlType == "checkbox")
|
#if($column.htmlType == "checkbox")
|
||||||
this.form.$column.javaField = this.form.${column.javaField}.split(",");
|
form.value.$column.javaField = form.value.${column.javaField}.split(",");
|
||||||
#end
|
#end
|
||||||
#end
|
#end
|
||||||
#if($table.sub)
|
|
||||||
this.${subclassName}List = response.data.${subclassName}List;
|
|
||||||
#end
|
|
||||||
this.open = true;
|
|
||||||
this.title = "修改${functionName}";
|
|
||||||
});
|
});
|
||||||
},
|
}
|
||||||
/** 提交按钮 */
|
|
||||||
submitForm() {
|
/** 提交按钮 */
|
||||||
this.#[[$]]#refs["form"].validate(valid => {
|
const submitForm = () => {
|
||||||
|
${businessName}FormRef.value.validate(async (valid: boolean) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
this.buttonLoading = true;
|
buttonLoading.value = true;
|
||||||
#foreach ($column in $columns)
|
#foreach ($column in $columns)
|
||||||
#if($column.htmlType == "checkbox")
|
#if($column.htmlType == "checkbox")
|
||||||
this.form.$column.javaField = this.form.${column.javaField}.join(",");
|
form.value.$column.javaField = form.value.${column.javaField}.join(",");
|
||||||
#end
|
#end
|
||||||
#end
|
#end
|
||||||
#if($table.sub)
|
if (form.value.${pkColumn.javaField}) {
|
||||||
this.form.${subclassName}List = this.${subclassName}List;
|
await update${BusinessName}(form.value).finally(() => buttonLoading.value = false);
|
||||||
#end
|
|
||||||
if (this.form.${pkColumn.javaField} != null) {
|
|
||||||
update${BusinessName}(this.form).then(response => {
|
|
||||||
this.#[[$modal]]#.msgSuccess("修改成功");
|
|
||||||
this.open = false;
|
|
||||||
this.getList();
|
|
||||||
}).finally(() => {
|
|
||||||
this.buttonLoading = false;
|
|
||||||
});
|
|
||||||
} else {
|
} else {
|
||||||
add${BusinessName}(this.form).then(response => {
|
await add${BusinessName}(form.value).finally(() => buttonLoading.value = false);
|
||||||
this.#[[$modal]]#.msgSuccess("新增成功");
|
|
||||||
this.open = false;
|
|
||||||
this.getList();
|
|
||||||
}).finally(() => {
|
|
||||||
this.buttonLoading = false;
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
proxy?.#[[$modal]]#.msgSuccess("修改成功");
|
||||||
|
dialog.visible = false;
|
||||||
|
await getList();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
}
|
||||||
/** 删除按钮操作 */
|
|
||||||
handleDelete(row) {
|
/** 删除按钮操作 */
|
||||||
const ${pkColumn.javaField}s = row.${pkColumn.javaField} || this.ids;
|
const handleDelete = async (row?: ${BusinessName}VO) => {
|
||||||
this.#[[$modal]]#.confirm('是否确认删除${functionName}编号为"' + ${pkColumn.javaField}s + '"的数据项?').then(() => {
|
const _${pkColumn.javaField}s = row?.${pkColumn.javaField} || ids.value;
|
||||||
this.loading = true;
|
await proxy?.#[[$modal]]#.confirm('是否确认删除${functionName}编号为"' + _${pkColumn.javaField}s + '"的数据项?').finally(() => loading.value = false);
|
||||||
return del${BusinessName}(${pkColumn.javaField}s);
|
await del${BusinessName}(_${pkColumn.javaField}s);
|
||||||
}).then(() => {
|
proxy?.#[[$modal]]#.msgSuccess("删除成功");
|
||||||
this.loading = false;
|
await getList();
|
||||||
this.getList();
|
}
|
||||||
this.#[[$modal]]#.msgSuccess("删除成功");
|
|
||||||
}).catch(() => {
|
/** 导出按钮操作 */
|
||||||
}).finally(() => {
|
const handleExport = () => {
|
||||||
this.loading = false;
|
proxy?.download('${moduleName}/${businessName}/export', {
|
||||||
});
|
...queryParams.value
|
||||||
},
|
|
||||||
#if($table.sub)
|
|
||||||
/** ${subTable.functionName}序号 */
|
|
||||||
row${subClassName}Index({ row, rowIndex }) {
|
|
||||||
row.index = rowIndex + 1;
|
|
||||||
},
|
|
||||||
/** ${subTable.functionName}添加按钮操作 */
|
|
||||||
handleAdd${subClassName}() {
|
|
||||||
let obj = {};
|
|
||||||
#foreach($column in $subTable.columns)
|
|
||||||
#if($column.pk || $column.javaField == ${subTableFkclassName})
|
|
||||||
#elseif($column.list && "" != $javaField)
|
|
||||||
obj.$column.javaField = "";
|
|
||||||
#end
|
|
||||||
#end
|
|
||||||
this.${subclassName}List.push(obj);
|
|
||||||
},
|
|
||||||
/** ${subTable.functionName}删除按钮操作 */
|
|
||||||
handleDelete${subClassName}() {
|
|
||||||
if (this.checked${subClassName}.length == 0) {
|
|
||||||
this.#[[$modal]]#.msgError("请先选择要删除的${subTable.functionName}数据");
|
|
||||||
} else {
|
|
||||||
const ${subclassName}List = this.${subclassName}List;
|
|
||||||
const checked${subClassName} = this.checked${subClassName};
|
|
||||||
this.${subclassName}List = ${subclassName}List.filter(function(item) {
|
|
||||||
return checked${subClassName}.indexOf(item.index) == -1
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
/** 复选框选中数据 */
|
|
||||||
handle${subClassName}SelectionChange(selection) {
|
|
||||||
this.checked${subClassName} = selection.map(item => item.index)
|
|
||||||
},
|
|
||||||
#end
|
|
||||||
/** 导出按钮操作 */
|
|
||||||
handleExport() {
|
|
||||||
this.download('${moduleName}/${businessName}/export', {
|
|
||||||
...this.queryParams
|
|
||||||
}, `${businessName}_#[[${new Date().getTime()}]]#.xlsx`)
|
}, `${businessName}_#[[${new Date().getTime()}]]#.xlsx`)
|
||||||
}
|
}
|
||||||
}
|
|
||||||
};
|
onMounted(() => {
|
||||||
|
getList();
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
|
|
@ -1,486 +0,0 @@
|
||||||
<template>
|
|
||||||
<div class="app-container">
|
|
||||||
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="68px">
|
|
||||||
#foreach($column in $columns)
|
|
||||||
#if($column.query)
|
|
||||||
#set($dictType=$column.dictType)
|
|
||||||
#set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)})
|
|
||||||
#set($parentheseIndex=$column.columnComment.indexOf("("))
|
|
||||||
#if($parentheseIndex != -1)
|
|
||||||
#set($comment=$column.columnComment.substring(0, $parentheseIndex))
|
|
||||||
#else
|
|
||||||
#set($comment=$column.columnComment)
|
|
||||||
#end
|
|
||||||
#if($column.htmlType == "input" || $column.htmlType == "textarea")
|
|
||||||
<el-form-item label="${comment}" prop="${column.javaField}">
|
|
||||||
<el-input
|
|
||||||
v-model="queryParams.${column.javaField}"
|
|
||||||
placeholder="请输入${comment}"
|
|
||||||
clearable
|
|
||||||
@keyup.enter="handleQuery"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
#elseif(($column.htmlType == "select" || $column.htmlType == "radio") && "" != $dictType)
|
|
||||||
<el-form-item label="${comment}" prop="${column.javaField}">
|
|
||||||
<el-select v-model="queryParams.${column.javaField}" placeholder="请选择${comment}" clearable>
|
|
||||||
<el-option
|
|
||||||
v-for="dict in ${dictType}"
|
|
||||||
:key="dict.value"
|
|
||||||
:label="dict.label"
|
|
||||||
:value="dict.value"
|
|
||||||
/>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
#elseif(($column.htmlType == "select" || $column.htmlType == "radio") && $dictType)
|
|
||||||
<el-form-item label="${comment}" prop="${column.javaField}">
|
|
||||||
<el-select v-model="queryParams.${column.javaField}" placeholder="请选择${comment}" clearable>
|
|
||||||
<el-option label="请选择字典生成" value="" />
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
#elseif($column.htmlType == "datetime" && $column.queryType != "BETWEEN")
|
|
||||||
<el-form-item label="${comment}" prop="${column.javaField}">
|
|
||||||
<el-date-picker clearable
|
|
||||||
v-model="queryParams.${column.javaField}"
|
|
||||||
type="date"
|
|
||||||
value-format="YYYY-MM-DD"
|
|
||||||
placeholder="选择${comment}">
|
|
||||||
</el-date-picker>
|
|
||||||
</el-form-item>
|
|
||||||
#elseif($column.htmlType == "datetime" && $column.queryType == "BETWEEN")
|
|
||||||
<el-form-item label="${comment}" style="width: 308px">
|
|
||||||
<el-date-picker
|
|
||||||
v-model="daterange${AttrName}"
|
|
||||||
value-format="YYYY-MM-DD HH:mm:ss"
|
|
||||||
type="daterange"
|
|
||||||
range-separator="-"
|
|
||||||
start-placeholder="开始日期"
|
|
||||||
end-placeholder="结束日期"
|
|
||||||
:default-time="[new Date(2000, 1, 1, 0, 0, 0), new Date(2000, 1, 1, 23, 59, 59)]"
|
|
||||||
></el-date-picker>
|
|
||||||
</el-form-item>
|
|
||||||
#end
|
|
||||||
#end
|
|
||||||
#end
|
|
||||||
<el-form-item>
|
|
||||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
|
||||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
|
|
||||||
<el-row :gutter="10" class="mb8">
|
|
||||||
<el-col :span="1.5">
|
|
||||||
<el-button
|
|
||||||
type="primary"
|
|
||||||
plain
|
|
||||||
icon="Plus"
|
|
||||||
@click="handleAdd"
|
|
||||||
v-hasPermi="['${moduleName}:${businessName}:add']"
|
|
||||||
>新增</el-button>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="1.5">
|
|
||||||
<el-button
|
|
||||||
type="info"
|
|
||||||
plain
|
|
||||||
icon="Sort"
|
|
||||||
@click="toggleExpandAll"
|
|
||||||
>展开/折叠</el-button>
|
|
||||||
</el-col>
|
|
||||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
|
||||||
</el-row>
|
|
||||||
|
|
||||||
<el-table
|
|
||||||
v-if="refreshTable"
|
|
||||||
v-loading="loading"
|
|
||||||
:data="${businessName}List"
|
|
||||||
row-key="${treeCode}"
|
|
||||||
:default-expand-all="isExpandAll"
|
|
||||||
:tree-props="{children: 'children', hasChildren: 'hasChildren'}"
|
|
||||||
>
|
|
||||||
#foreach($column in $columns)
|
|
||||||
#set($javaField=$column.javaField)
|
|
||||||
#set($parentheseIndex=$column.columnComment.indexOf("("))
|
|
||||||
#if($parentheseIndex != -1)
|
|
||||||
#set($comment=$column.columnComment.substring(0, $parentheseIndex))
|
|
||||||
#else
|
|
||||||
#set($comment=$column.columnComment)
|
|
||||||
#end
|
|
||||||
#if($column.pk)
|
|
||||||
#elseif($column.list && $column.htmlType == "datetime")
|
|
||||||
<el-table-column label="${comment}" align="center" prop="${javaField}" width="180">
|
|
||||||
<template #default="scope">
|
|
||||||
<span>{{ parseTime(scope.row.${javaField}, '{y}-{m}-{d}') }}</span>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
#elseif($column.list && $column.htmlType == "imageUpload")
|
|
||||||
<el-table-column label="${comment}" align="center" prop="${javaField}" width="100">
|
|
||||||
<template #default="scope">
|
|
||||||
<image-preview :src="scope.row.${javaField}" :width="50" :height="50"/>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
#elseif($column.list && $column.dictType && "" != $column.dictType)
|
|
||||||
<el-table-column label="${comment}" align="center" prop="${javaField}">
|
|
||||||
<template #default="scope">
|
|
||||||
#if($column.htmlType == "checkbox")
|
|
||||||
<dict-tag :options="${column.dictType}" :value="scope.row.${javaField} ? scope.row.${javaField}.split(',') : []"/>
|
|
||||||
#else
|
|
||||||
<dict-tag :options="${column.dictType}" :value="scope.row.${javaField}"/>
|
|
||||||
#end
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
#elseif($column.list && "" != $javaField)
|
|
||||||
#if(${foreach.index} == 1)
|
|
||||||
<el-table-column label="${comment}" prop="${javaField}" />
|
|
||||||
#else
|
|
||||||
<el-table-column label="${comment}" align="center" prop="${javaField}" />
|
|
||||||
#end
|
|
||||||
#end
|
|
||||||
#end
|
|
||||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
|
||||||
<template #default="scope">
|
|
||||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['${moduleName}:${businessName}:edit']">修改</el-button>
|
|
||||||
<el-button link type="primary" icon="Plus" @click="handleAdd(scope.row)" v-hasPermi="['${moduleName}:${businessName}:add']">新增</el-button>
|
|
||||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['${moduleName}:${businessName}:remove']">删除</el-button>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
</el-table>
|
|
||||||
|
|
||||||
<!-- 添加或修改${functionName}对话框 -->
|
|
||||||
<el-dialog :title="title" v-model="open" width="500px" append-to-body>
|
|
||||||
<el-form ref="${businessName}Ref" :model="form" :rules="rules" label-width="80px">
|
|
||||||
#foreach($column in $columns)
|
|
||||||
#set($field=$column.javaField)
|
|
||||||
#if($column.insert && !$column.pk)
|
|
||||||
#set($parentheseIndex=$column.columnComment.indexOf("("))
|
|
||||||
#if($parentheseIndex != -1)
|
|
||||||
#set($comment=$column.columnComment.substring(0, $parentheseIndex))
|
|
||||||
#else
|
|
||||||
#set($comment=$column.columnComment)
|
|
||||||
#end
|
|
||||||
#set($dictType=$column.dictType)
|
|
||||||
#if("" != $treeParentCode && $column.javaField == $treeParentCode)
|
|
||||||
<el-form-item label="${comment}" prop="${treeParentCode}">
|
|
||||||
<el-tree-select
|
|
||||||
v-model="form.${treeParentCode}"
|
|
||||||
:data="${businessName}Options"
|
|
||||||
:props="{ value: '${treeCode}', label: '${treeName}', children: 'children' }"
|
|
||||||
value-key="${treeCode}"
|
|
||||||
placeholder="请选择${comment}"
|
|
||||||
check-strictly
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
#elseif($column.htmlType == "input")
|
|
||||||
<el-form-item label="${comment}" prop="${field}">
|
|
||||||
<el-input v-model="form.${field}" placeholder="请输入${comment}" />
|
|
||||||
</el-form-item>
|
|
||||||
#elseif($column.htmlType == "imageUpload")
|
|
||||||
<el-form-item label="${comment}" prop="${field}">
|
|
||||||
<image-upload v-model="form.${field}"/>
|
|
||||||
</el-form-item>
|
|
||||||
#elseif($column.htmlType == "fileUpload")
|
|
||||||
<el-form-item label="${comment}" prop="${field}">
|
|
||||||
<file-upload v-model="form.${field}"/>
|
|
||||||
</el-form-item>
|
|
||||||
#elseif($column.htmlType == "editor")
|
|
||||||
<el-form-item label="${comment}">
|
|
||||||
<editor v-model="form.${field}" :min-height="192"/>
|
|
||||||
</el-form-item>
|
|
||||||
#elseif($column.htmlType == "select" && "" != $dictType)
|
|
||||||
<el-form-item label="${comment}" prop="${field}">
|
|
||||||
<el-select v-model="form.${field}" placeholder="请选择${comment}">
|
|
||||||
<el-option
|
|
||||||
v-for="dict in ${dictType}"
|
|
||||||
:key="dict.value"
|
|
||||||
:label="dict.label"
|
|
||||||
#if($column.javaType == "Integer" || $column.javaType == "Long")
|
|
||||||
:value="parseInt(dict.value)"
|
|
||||||
#else
|
|
||||||
:value="dict.value"
|
|
||||||
#end
|
|
||||||
></el-option>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
#elseif($column.htmlType == "select" && $dictType)
|
|
||||||
<el-form-item label="${comment}" prop="${field}">
|
|
||||||
<el-select v-model="form.${field}" placeholder="请选择${comment}">
|
|
||||||
<el-option label="请选择字典生成" value="" />
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
#elseif($column.htmlType == "checkbox" && "" != $dictType)
|
|
||||||
<el-form-item label="${comment}" prop="${field}">
|
|
||||||
<el-checkbox-group v-model="form.${field}">
|
|
||||||
<el-checkbox
|
|
||||||
v-for="dict in ${dictType}"
|
|
||||||
:key="dict.value"
|
|
||||||
:label="dict.value">
|
|
||||||
{{dict.label}}
|
|
||||||
</el-checkbox>
|
|
||||||
</el-checkbox-group>
|
|
||||||
</el-form-item>
|
|
||||||
#elseif($column.htmlType == "checkbox" && $dictType)
|
|
||||||
<el-form-item label="${comment}" prop="${field}">
|
|
||||||
<el-checkbox-group v-model="form.${field}">
|
|
||||||
<el-checkbox>请选择字典生成</el-checkbox>
|
|
||||||
</el-checkbox-group>
|
|
||||||
</el-form-item>
|
|
||||||
#elseif($column.htmlType == "radio" && "" != $dictType)
|
|
||||||
<el-form-item label="${comment}" prop="${field}">
|
|
||||||
<el-radio-group v-model="form.${field}">
|
|
||||||
<el-radio
|
|
||||||
v-for="dict in ${dictType}"
|
|
||||||
:key="dict.value"
|
|
||||||
#if($column.javaType == "Integer" || $column.javaType == "Long")
|
|
||||||
:label="parseInt(dict.value)"
|
|
||||||
#else
|
|
||||||
:label="dict.value"
|
|
||||||
#end
|
|
||||||
>{{dict.label}}</el-radio>
|
|
||||||
</el-radio-group>
|
|
||||||
</el-form-item>
|
|
||||||
#elseif($column.htmlType == "radio" && $dictType)
|
|
||||||
<el-form-item label="${comment}" prop="${field}">
|
|
||||||
<el-radio-group v-model="form.${field}">
|
|
||||||
<el-radio label="1">请选择字典生成</el-radio>
|
|
||||||
</el-radio-group>
|
|
||||||
</el-form-item>
|
|
||||||
#elseif($column.htmlType == "datetime")
|
|
||||||
<el-form-item label="${comment}" prop="${field}">
|
|
||||||
<el-date-picker clearable
|
|
||||||
v-model="form.${field}"
|
|
||||||
type="datetime"
|
|
||||||
value-format="YYYY-MM-DD HH:mm:ss"
|
|
||||||
placeholder="选择${comment}">
|
|
||||||
</el-date-picker>
|
|
||||||
</el-form-item>
|
|
||||||
#elseif($column.htmlType == "textarea")
|
|
||||||
<el-form-item label="${comment}" prop="${field}">
|
|
||||||
<el-input v-model="form.${field}" type="textarea" placeholder="请输入内容" />
|
|
||||||
</el-form-item>
|
|
||||||
#end
|
|
||||||
#end
|
|
||||||
#end
|
|
||||||
</el-form>
|
|
||||||
<template #footer>
|
|
||||||
<div class="dialog-footer">
|
|
||||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
|
||||||
<el-button @click="cancel">取 消</el-button>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
</el-dialog>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script setup name="${BusinessName}">
|
|
||||||
import { list${BusinessName}, get${BusinessName}, del${BusinessName}, add${BusinessName}, update${BusinessName} } from "@/api/${moduleName}/${businessName}";
|
|
||||||
|
|
||||||
const { proxy } = getCurrentInstance();
|
|
||||||
#if(${dicts} != '')
|
|
||||||
#set($dictsNoSymbol=$dicts.replace("'", ""))
|
|
||||||
const { ${dictsNoSymbol} } = proxy.useDict(${dicts});
|
|
||||||
#end
|
|
||||||
|
|
||||||
const ${businessName}List = ref([]);
|
|
||||||
const ${businessName}Options = ref([]);
|
|
||||||
const open = ref(false);
|
|
||||||
const buttonLoading = ref(false);
|
|
||||||
const loading = ref(true);
|
|
||||||
const showSearch = ref(true);
|
|
||||||
const title = ref("");
|
|
||||||
const isExpandAll = ref(true);
|
|
||||||
const refreshTable = ref(true);
|
|
||||||
#foreach ($column in $columns)
|
|
||||||
#if($column.htmlType == "datetime" && $column.queryType == "BETWEEN")
|
|
||||||
#set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)})
|
|
||||||
const daterange${AttrName} = ref([]);
|
|
||||||
#end
|
|
||||||
#end
|
|
||||||
|
|
||||||
const data = reactive({
|
|
||||||
form: {},
|
|
||||||
queryParams: {
|
|
||||||
#foreach ($column in $columns)
|
|
||||||
#if($column.query)
|
|
||||||
$column.javaField: undefined#if($foreach.count != $columns.size()),#end
|
|
||||||
#end
|
|
||||||
#end
|
|
||||||
},
|
|
||||||
rules: {
|
|
||||||
#foreach ($column in $columns)
|
|
||||||
#if($column.required)
|
|
||||||
#set($parentheseIndex=$column.columnComment.indexOf("("))
|
|
||||||
#if($parentheseIndex != -1)
|
|
||||||
#set($comment=$column.columnComment.substring(0, $parentheseIndex))
|
|
||||||
#else
|
|
||||||
#set($comment=$column.columnComment)
|
|
||||||
#end
|
|
||||||
$column.javaField: [
|
|
||||||
{ required: true, message: "$comment不能为空", trigger: #if($column.htmlType == "select" || $column.htmlType == "radio")"change"#else"blur"#end }
|
|
||||||
]#if($foreach.count != $columns.size()),#end
|
|
||||||
#end
|
|
||||||
#end
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
const { queryParams, form, rules } = toRefs(data);
|
|
||||||
|
|
||||||
/** 查询${functionName}列表 */
|
|
||||||
function getList() {
|
|
||||||
loading.value = true;
|
|
||||||
#foreach ($column in $columns)
|
|
||||||
#if($column.htmlType == "datetime" && $column.queryType == "BETWEEN")
|
|
||||||
queryParams.value.params = {};
|
|
||||||
#break
|
|
||||||
#end
|
|
||||||
#end
|
|
||||||
#foreach ($column in $columns)
|
|
||||||
#if($column.htmlType == "datetime" && $column.queryType == "BETWEEN")
|
|
||||||
#set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)})
|
|
||||||
if (null != daterange${AttrName} && '' != daterange${AttrName}) {
|
|
||||||
queryParams.value.params["begin${AttrName}"] = daterange${AttrName}.value[0];
|
|
||||||
queryParams.value.params["end${AttrName}"] = daterange${AttrName}.value[1];
|
|
||||||
}
|
|
||||||
#end
|
|
||||||
#end
|
|
||||||
list${BusinessName}(queryParams.value).then(response => {
|
|
||||||
${businessName}List.value = proxy.handleTree(response.data, "${treeCode}", "${treeParentCode}");
|
|
||||||
loading.value = false;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 查询${functionName}下拉树结构 */
|
|
||||||
function getTreeselect() {
|
|
||||||
list${BusinessName}().then(response => {
|
|
||||||
${businessName}Options.value = [];
|
|
||||||
const data = { ${treeCode}: 0, ${treeName}: '顶级节点', children: [] };
|
|
||||||
data.children = proxy.handleTree(response.data, "${treeCode}", "${treeParentCode}");
|
|
||||||
${businessName}Options.value.push(data);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
// 取消按钮
|
|
||||||
function cancel() {
|
|
||||||
open.value = false;
|
|
||||||
reset();
|
|
||||||
}
|
|
||||||
|
|
||||||
// 表单重置
|
|
||||||
function reset() {
|
|
||||||
form.value = {
|
|
||||||
#foreach ($column in $columns)
|
|
||||||
#if($column.htmlType == "checkbox")
|
|
||||||
$column.javaField: []#if($foreach.count != $columns.size()),#end
|
|
||||||
#else
|
|
||||||
$column.javaField: null#if($foreach.count != $columns.size()),#end
|
|
||||||
#end
|
|
||||||
#end
|
|
||||||
};
|
|
||||||
proxy.resetForm("${businessName}Ref");
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 搜索按钮操作 */
|
|
||||||
function handleQuery() {
|
|
||||||
getList();
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 重置按钮操作 */
|
|
||||||
function resetQuery() {
|
|
||||||
#foreach ($column in $columns)
|
|
||||||
#if($column.htmlType == "datetime" && $column.queryType == "BETWEEN")
|
|
||||||
#set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)})
|
|
||||||
daterange${AttrName}.value = [];
|
|
||||||
#end
|
|
||||||
#end
|
|
||||||
proxy.resetForm("queryRef");
|
|
||||||
handleQuery();
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 新增按钮操作 */
|
|
||||||
function handleAdd(row) {
|
|
||||||
reset();
|
|
||||||
getTreeselect();
|
|
||||||
if (row != null && row.${treeCode}) {
|
|
||||||
form.value.${treeParentCode} = row.${treeCode};
|
|
||||||
} else {
|
|
||||||
form.value.${treeParentCode} = 0;
|
|
||||||
}
|
|
||||||
open.value = true;
|
|
||||||
title.value = "添加${functionName}";
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 展开/折叠操作 */
|
|
||||||
function toggleExpandAll() {
|
|
||||||
refreshTable.value = false;
|
|
||||||
isExpandAll.value = !isExpandAll.value;
|
|
||||||
nextTick(() => {
|
|
||||||
refreshTable.value = true;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 修改按钮操作 */
|
|
||||||
async function handleUpdate(row) {
|
|
||||||
loading.value = true;
|
|
||||||
reset();
|
|
||||||
await getTreeselect();
|
|
||||||
if (row != null) {
|
|
||||||
form.value.${treeParentCode} = row.${treeCode};
|
|
||||||
}
|
|
||||||
get${BusinessName}(row.${pkColumn.javaField}).then(response => {
|
|
||||||
loading.value = false;
|
|
||||||
form.value = response.data;
|
|
||||||
#foreach ($column in $columns)
|
|
||||||
#if($column.htmlType == "checkbox")
|
|
||||||
form.value.$column.javaField = form.value.${column.javaField}.split(",");
|
|
||||||
#end
|
|
||||||
#end
|
|
||||||
open.value = true;
|
|
||||||
title.value = "修改${functionName}";
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 提交按钮 */
|
|
||||||
function submitForm() {
|
|
||||||
proxy.#[[$]]#refs["${businessName}Ref"].validate(valid => {
|
|
||||||
if (valid) {
|
|
||||||
buttonLoading.value = true;
|
|
||||||
#foreach ($column in $columns)
|
|
||||||
#if($column.htmlType == "checkbox")
|
|
||||||
form.value.$column.javaField = form.value.${column.javaField}.join(",");
|
|
||||||
#end
|
|
||||||
#end
|
|
||||||
if (form.value.${pkColumn.javaField} != null) {
|
|
||||||
update${BusinessName}(form.value).then(response => {
|
|
||||||
proxy.#[[$modal]]#.msgSuccess("修改成功");
|
|
||||||
open.value = false;
|
|
||||||
getList();
|
|
||||||
}).finally(() => {
|
|
||||||
buttonLoading.value = false;
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
add${BusinessName}(form.value).then(response => {
|
|
||||||
proxy.#[[$modal]]#.msgSuccess("新增成功");
|
|
||||||
open.value = false;
|
|
||||||
getList();
|
|
||||||
}).finally(() => {
|
|
||||||
buttonLoading.value = false;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 删除按钮操作 */
|
|
||||||
function handleDelete(row) {
|
|
||||||
proxy.#[[$modal]]#.confirm('是否确认删除${functionName}编号为"' + row.${pkColumn.javaField} + '"的数据项?').then(function() {
|
|
||||||
loading.value = true;
|
|
||||||
return del${BusinessName}(row.${pkColumn.javaField});
|
|
||||||
}).then(() => {
|
|
||||||
loading.value = false;
|
|
||||||
getList();
|
|
||||||
proxy.#[[$modal]]#.msgSuccess("删除成功");
|
|
||||||
}).catch(() => {
|
|
||||||
}).finally(() => {
|
|
||||||
loading.value = false;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
getList();
|
|
||||||
</script>
|
|
||||||
|
|
@ -1,602 +0,0 @@
|
||||||
<template>
|
|
||||||
<div class="app-container">
|
|
||||||
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="68px">
|
|
||||||
#foreach($column in $columns)
|
|
||||||
#if($column.query)
|
|
||||||
#set($dictType=$column.dictType)
|
|
||||||
#set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)})
|
|
||||||
#set($parentheseIndex=$column.columnComment.indexOf("("))
|
|
||||||
#if($parentheseIndex != -1)
|
|
||||||
#set($comment=$column.columnComment.substring(0, $parentheseIndex))
|
|
||||||
#else
|
|
||||||
#set($comment=$column.columnComment)
|
|
||||||
#end
|
|
||||||
#if($column.htmlType == "input" || $column.htmlType == "textarea")
|
|
||||||
<el-form-item label="${comment}" prop="${column.javaField}">
|
|
||||||
<el-input
|
|
||||||
v-model="queryParams.${column.javaField}"
|
|
||||||
placeholder="请输入${comment}"
|
|
||||||
clearable
|
|
||||||
@keyup.enter="handleQuery"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
#elseif(($column.htmlType == "select" || $column.htmlType == "radio") && "" != $dictType)
|
|
||||||
<el-form-item label="${comment}" prop="${column.javaField}">
|
|
||||||
<el-select v-model="queryParams.${column.javaField}" placeholder="请选择${comment}" clearable>
|
|
||||||
<el-option
|
|
||||||
v-for="dict in ${dictType}"
|
|
||||||
:key="dict.value"
|
|
||||||
:label="dict.label"
|
|
||||||
:value="dict.value"
|
|
||||||
/>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
#elseif(($column.htmlType == "select" || $column.htmlType == "radio") && $dictType)
|
|
||||||
<el-form-item label="${comment}" prop="${column.javaField}">
|
|
||||||
<el-select v-model="queryParams.${column.javaField}" placeholder="请选择${comment}" clearable>
|
|
||||||
<el-option label="请选择字典生成" value="" />
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
#elseif($column.htmlType == "datetime" && $column.queryType != "BETWEEN")
|
|
||||||
<el-form-item label="${comment}" prop="${column.javaField}">
|
|
||||||
<el-date-picker clearable
|
|
||||||
v-model="queryParams.${column.javaField}"
|
|
||||||
type="date"
|
|
||||||
value-format="YYYY-MM-DD"
|
|
||||||
placeholder="请选择${comment}">
|
|
||||||
</el-date-picker>
|
|
||||||
</el-form-item>
|
|
||||||
#elseif($column.htmlType == "datetime" && $column.queryType == "BETWEEN")
|
|
||||||
<el-form-item label="${comment}" style="width: 308px">
|
|
||||||
<el-date-picker
|
|
||||||
v-model="daterange${AttrName}"
|
|
||||||
value-format="YYYY-MM-DD HH:mm:ss"
|
|
||||||
type="daterange"
|
|
||||||
range-separator="-"
|
|
||||||
start-placeholder="开始日期"
|
|
||||||
end-placeholder="结束日期"
|
|
||||||
:default-time="[new Date(2000, 1, 1, 0, 0, 0), new Date(2000, 1, 1, 23, 59, 59)]"
|
|
||||||
></el-date-picker>
|
|
||||||
</el-form-item>
|
|
||||||
#end
|
|
||||||
#end
|
|
||||||
#end
|
|
||||||
<el-form-item>
|
|
||||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
|
||||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
|
|
||||||
<el-row :gutter="10" class="mb8">
|
|
||||||
<el-col :span="1.5">
|
|
||||||
<el-button
|
|
||||||
type="primary"
|
|
||||||
plain
|
|
||||||
icon="Plus"
|
|
||||||
@click="handleAdd"
|
|
||||||
v-hasPermi="['${moduleName}:${businessName}:add']"
|
|
||||||
>新增</el-button>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="1.5">
|
|
||||||
<el-button
|
|
||||||
type="success"
|
|
||||||
plain
|
|
||||||
icon="Edit"
|
|
||||||
:disabled="single"
|
|
||||||
@click="handleUpdate"
|
|
||||||
v-hasPermi="['${moduleName}:${businessName}:edit']"
|
|
||||||
>修改</el-button>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="1.5">
|
|
||||||
<el-button
|
|
||||||
type="danger"
|
|
||||||
plain
|
|
||||||
icon="Delete"
|
|
||||||
:disabled="multiple"
|
|
||||||
@click="handleDelete"
|
|
||||||
v-hasPermi="['${moduleName}:${businessName}:remove']"
|
|
||||||
>删除</el-button>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="1.5">
|
|
||||||
<el-button
|
|
||||||
type="warning"
|
|
||||||
plain
|
|
||||||
icon="Download"
|
|
||||||
@click="handleExport"
|
|
||||||
v-hasPermi="['${moduleName}:${businessName}:export']"
|
|
||||||
>导出</el-button>
|
|
||||||
</el-col>
|
|
||||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
|
||||||
</el-row>
|
|
||||||
|
|
||||||
<el-table v-loading="loading" :data="${businessName}List" @selection-change="handleSelectionChange">
|
|
||||||
<el-table-column type="selection" width="55" align="center" />
|
|
||||||
#foreach($column in $columns)
|
|
||||||
#set($javaField=$column.javaField)
|
|
||||||
#set($parentheseIndex=$column.columnComment.indexOf("("))
|
|
||||||
#if($parentheseIndex != -1)
|
|
||||||
#set($comment=$column.columnComment.substring(0, $parentheseIndex))
|
|
||||||
#else
|
|
||||||
#set($comment=$column.columnComment)
|
|
||||||
#end
|
|
||||||
#if($column.pk)
|
|
||||||
<el-table-column label="${comment}" align="center" prop="${javaField}" v-if="${column.list}"/>
|
|
||||||
#elseif($column.list && $column.htmlType == "datetime")
|
|
||||||
<el-table-column label="${comment}" align="center" prop="${javaField}" width="180">
|
|
||||||
<template #default="scope">
|
|
||||||
<span>{{ parseTime(scope.row.${javaField}, '{y}-{m}-{d}') }}</span>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
#elseif($column.list && $column.htmlType == "imageUpload")
|
|
||||||
<el-table-column label="${comment}" align="center" prop="${javaField}" width="100">
|
|
||||||
<template #default="scope">
|
|
||||||
<image-preview :src="scope.row.${javaField}" :width="50" :height="50"/>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
#elseif($column.list && $column.dictType && "" != $column.dictType)
|
|
||||||
<el-table-column label="${comment}" align="center" prop="${javaField}">
|
|
||||||
<template #default="scope">
|
|
||||||
#if($column.htmlType == "checkbox")
|
|
||||||
<dict-tag :options="${column.dictType}" :value="scope.row.${javaField} ? scope.row.${javaField}.split(',') : []"/>
|
|
||||||
#else
|
|
||||||
<dict-tag :options="${column.dictType}" :value="scope.row.${javaField}"/>
|
|
||||||
#end
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
#elseif($column.list && "" != $javaField)
|
|
||||||
<el-table-column label="${comment}" align="center" prop="${javaField}" />
|
|
||||||
#end
|
|
||||||
#end
|
|
||||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
|
||||||
<template #default="scope">
|
|
||||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['${moduleName}:${businessName}:edit']">修改</el-button>
|
|
||||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['${moduleName}:${businessName}:remove']">删除</el-button>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
</el-table>
|
|
||||||
|
|
||||||
<pagination
|
|
||||||
v-show="total>0"
|
|
||||||
:total="total"
|
|
||||||
v-model:page="queryParams.pageNum"
|
|
||||||
v-model:limit="queryParams.pageSize"
|
|
||||||
@pagination="getList"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<!-- 添加或修改${functionName}对话框 -->
|
|
||||||
<el-dialog :title="title" v-model="open" width="500px" append-to-body>
|
|
||||||
<el-form ref="${businessName}Ref" :model="form" :rules="rules" label-width="80px">
|
|
||||||
#foreach($column in $columns)
|
|
||||||
#set($field=$column.javaField)
|
|
||||||
#if($column.insert && !$column.pk)
|
|
||||||
#set($parentheseIndex=$column.columnComment.indexOf("("))
|
|
||||||
#if($parentheseIndex != -1)
|
|
||||||
#set($comment=$column.columnComment.substring(0, $parentheseIndex))
|
|
||||||
#else
|
|
||||||
#set($comment=$column.columnComment)
|
|
||||||
#end
|
|
||||||
#set($dictType=$column.dictType)
|
|
||||||
#if($column.htmlType == "input")
|
|
||||||
<el-form-item label="${comment}" prop="${field}">
|
|
||||||
<el-input v-model="form.${field}" placeholder="请输入${comment}" />
|
|
||||||
</el-form-item>
|
|
||||||
#elseif($column.htmlType == "imageUpload")
|
|
||||||
<el-form-item label="${comment}" prop="${field}">
|
|
||||||
<image-upload v-model="form.${field}"/>
|
|
||||||
</el-form-item>
|
|
||||||
#elseif($column.htmlType == "fileUpload")
|
|
||||||
<el-form-item label="${comment}" prop="${field}">
|
|
||||||
<file-upload v-model="form.${field}"/>
|
|
||||||
</el-form-item>
|
|
||||||
#elseif($column.htmlType == "editor")
|
|
||||||
<el-form-item label="${comment}">
|
|
||||||
<editor v-model="form.${field}" :min-height="192"/>
|
|
||||||
</el-form-item>
|
|
||||||
#elseif($column.htmlType == "select" && "" != $dictType)
|
|
||||||
<el-form-item label="${comment}" prop="${field}">
|
|
||||||
<el-select v-model="form.${field}" placeholder="请选择${comment}">
|
|
||||||
<el-option
|
|
||||||
v-for="dict in ${dictType}"
|
|
||||||
:key="dict.value"
|
|
||||||
:label="dict.label"
|
|
||||||
#if($column.javaType == "Integer" || $column.javaType == "Long")
|
|
||||||
:value="parseInt(dict.value)"
|
|
||||||
#else
|
|
||||||
:value="dict.value"
|
|
||||||
#end
|
|
||||||
></el-option>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
#elseif($column.htmlType == "select" && $dictType)
|
|
||||||
<el-form-item label="${comment}" prop="${field}">
|
|
||||||
<el-select v-model="form.${field}" placeholder="请选择${comment}">
|
|
||||||
<el-option label="请选择字典生成" value="" />
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
#elseif($column.htmlType == "checkbox" && "" != $dictType)
|
|
||||||
<el-form-item label="${comment}" prop="${field}">
|
|
||||||
<el-checkbox-group v-model="form.${field}">
|
|
||||||
<el-checkbox
|
|
||||||
v-for="dict in ${dictType}"
|
|
||||||
:key="dict.value"
|
|
||||||
:label="dict.value">
|
|
||||||
{{dict.label}}
|
|
||||||
</el-checkbox>
|
|
||||||
</el-checkbox-group>
|
|
||||||
</el-form-item>
|
|
||||||
#elseif($column.htmlType == "checkbox" && $dictType)
|
|
||||||
<el-form-item label="${comment}" prop="${field}">
|
|
||||||
<el-checkbox-group v-model="form.${field}">
|
|
||||||
<el-checkbox>请选择字典生成</el-checkbox>
|
|
||||||
</el-checkbox-group>
|
|
||||||
</el-form-item>
|
|
||||||
#elseif($column.htmlType == "radio" && "" != $dictType)
|
|
||||||
<el-form-item label="${comment}" prop="${field}">
|
|
||||||
<el-radio-group v-model="form.${field}">
|
|
||||||
<el-radio
|
|
||||||
v-for="dict in ${dictType}"
|
|
||||||
:key="dict.value"
|
|
||||||
#if($column.javaType == "Integer" || $column.javaType == "Long")
|
|
||||||
:label="parseInt(dict.value)"
|
|
||||||
#else
|
|
||||||
:label="dict.value"
|
|
||||||
#end
|
|
||||||
>{{dict.label}}</el-radio>
|
|
||||||
</el-radio-group>
|
|
||||||
</el-form-item>
|
|
||||||
#elseif($column.htmlType == "radio" && $dictType)
|
|
||||||
<el-form-item label="${comment}" prop="${field}">
|
|
||||||
<el-radio-group v-model="form.${field}">
|
|
||||||
<el-radio label="1">请选择字典生成</el-radio>
|
|
||||||
</el-radio-group>
|
|
||||||
</el-form-item>
|
|
||||||
#elseif($column.htmlType == "datetime")
|
|
||||||
<el-form-item label="${comment}" prop="${field}">
|
|
||||||
<el-date-picker clearable
|
|
||||||
v-model="form.${field}"
|
|
||||||
type="datetime"
|
|
||||||
value-format="YYYY-MM-DD HH:mm:ss"
|
|
||||||
placeholder="请选择${comment}">
|
|
||||||
</el-date-picker>
|
|
||||||
</el-form-item>
|
|
||||||
#elseif($column.htmlType == "textarea")
|
|
||||||
<el-form-item label="${comment}" prop="${field}">
|
|
||||||
<el-input v-model="form.${field}" type="textarea" placeholder="请输入内容" />
|
|
||||||
</el-form-item>
|
|
||||||
#end
|
|
||||||
#end
|
|
||||||
#end
|
|
||||||
#if($table.sub)
|
|
||||||
<el-divider content-position="center">${subTable.functionName}信息</el-divider>
|
|
||||||
<el-row :gutter="10" class="mb8">
|
|
||||||
<el-col :span="1.5">
|
|
||||||
<el-button type="primary" icon="Plus" @click="handleAdd${subClassName}">添加</el-button>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="1.5">
|
|
||||||
<el-button type="danger" icon="Delete" @click="handleDelete${subClassName}">删除</el-button>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-table :data="${subclassName}List" :row-class-name="row${subClassName}Index" @selection-change="handle${subClassName}SelectionChange" ref="${subclassName}">
|
|
||||||
<el-table-column type="selection" width="50" align="center" />
|
|
||||||
<el-table-column label="序号" align="center" prop="index" width="50"/>
|
|
||||||
#foreach($column in $subTable.columns)
|
|
||||||
#set($javaField=$column.javaField)
|
|
||||||
#set($parentheseIndex=$column.columnComment.indexOf("("))
|
|
||||||
#if($parentheseIndex != -1)
|
|
||||||
#set($comment=$column.columnComment.substring(0, $parentheseIndex))
|
|
||||||
#else
|
|
||||||
#set($comment=$column.columnComment)
|
|
||||||
#end
|
|
||||||
#if($column.pk || $javaField == ${subTableFkclassName})
|
|
||||||
#elseif($column.list && $column.htmlType == "input")
|
|
||||||
<el-table-column label="$comment" prop="${javaField}" width="150">
|
|
||||||
<template #default="scope">
|
|
||||||
<el-input v-model="scope.row.$javaField" placeholder="请输入$comment" />
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
#elseif($column.list && $column.htmlType == "datetime")
|
|
||||||
<el-table-column label="$comment" prop="${javaField}" width="240">
|
|
||||||
<template #default="scope">
|
|
||||||
<el-date-picker clearable
|
|
||||||
v-model="scope.row.$javaField"
|
|
||||||
type="date"
|
|
||||||
value-format="YYYY-MM-DD"
|
|
||||||
placeholder="请选择$comment">
|
|
||||||
</el-date-picker>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
#elseif($column.list && ($column.htmlType == "select" || $column.htmlType == "radio") && "" != $column.dictType)
|
|
||||||
<el-table-column label="$comment" prop="${javaField}" width="150">
|
|
||||||
<template #default="scope">
|
|
||||||
<el-select v-model="scope.row.$javaField" placeholder="请选择$comment">
|
|
||||||
<el-option
|
|
||||||
v-for="dict in $column.dictType"
|
|
||||||
:key="dict.value"
|
|
||||||
:label="dict.label"
|
|
||||||
:value="dict.value"
|
|
||||||
></el-option>
|
|
||||||
</el-select>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
#elseif($column.list && ($column.htmlType == "select" || $column.htmlType == "radio") && "" == $column.dictType)
|
|
||||||
<el-table-column label="$comment" prop="${javaField}" width="150">
|
|
||||||
<template #default="scope">
|
|
||||||
<el-select v-model="scope.row.$javaField" placeholder="请选择$comment">
|
|
||||||
<el-option label="请选择字典生成" value="" />
|
|
||||||
</el-select>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
#end
|
|
||||||
#end
|
|
||||||
</el-table>
|
|
||||||
#end
|
|
||||||
</el-form>
|
|
||||||
<template #footer>
|
|
||||||
<div class="dialog-footer">
|
|
||||||
<el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
|
|
||||||
<el-button @click="cancel">取 消</el-button>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
</el-dialog>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script setup name="${BusinessName}">
|
|
||||||
import { list${BusinessName}, get${BusinessName}, del${BusinessName}, add${BusinessName}, update${BusinessName} } from "@/api/${moduleName}/${businessName}";
|
|
||||||
|
|
||||||
const { proxy } = getCurrentInstance();
|
|
||||||
#if(${dicts} != '')
|
|
||||||
#set($dictsNoSymbol=$dicts.replace("'", ""))
|
|
||||||
const { ${dictsNoSymbol} } = proxy.useDict(${dicts});
|
|
||||||
#end
|
|
||||||
|
|
||||||
const ${businessName}List = ref([]);
|
|
||||||
#if($table.sub)
|
|
||||||
const ${subclassName}List = ref([]);
|
|
||||||
#end
|
|
||||||
const open = ref(false);
|
|
||||||
const buttonLoading = ref(false);
|
|
||||||
const loading = ref(true);
|
|
||||||
const showSearch = ref(true);
|
|
||||||
const ids = ref([]);
|
|
||||||
#if($table.sub)
|
|
||||||
const checked${subClassName} = ref([]);
|
|
||||||
#end
|
|
||||||
const single = ref(true);
|
|
||||||
const multiple = ref(true);
|
|
||||||
const total = ref(0);
|
|
||||||
const title = ref("");
|
|
||||||
#foreach ($column in $columns)
|
|
||||||
#if($column.htmlType == "datetime" && $column.queryType == "BETWEEN")
|
|
||||||
#set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)})
|
|
||||||
const daterange${AttrName} = ref([]);
|
|
||||||
#end
|
|
||||||
#end
|
|
||||||
|
|
||||||
const data = reactive({
|
|
||||||
form: {},
|
|
||||||
queryParams: {
|
|
||||||
pageNum: 1,
|
|
||||||
pageSize: 10,
|
|
||||||
#foreach ($column in $columns)
|
|
||||||
#if($column.query)
|
|
||||||
$column.javaField: undefined#if($foreach.count != $columns.size()),#end
|
|
||||||
#end
|
|
||||||
#end
|
|
||||||
},
|
|
||||||
rules: {
|
|
||||||
#foreach ($column in $columns)
|
|
||||||
#if($column.required)
|
|
||||||
#set($parentheseIndex=$column.columnComment.indexOf("("))
|
|
||||||
#if($parentheseIndex != -1)
|
|
||||||
#set($comment=$column.columnComment.substring(0, $parentheseIndex))
|
|
||||||
#else
|
|
||||||
#set($comment=$column.columnComment)
|
|
||||||
#end
|
|
||||||
$column.javaField: [
|
|
||||||
{ required: true, message: "$comment不能为空", trigger: #if($column.htmlType == "select" || $column.htmlType == "radio")"change"#else"blur"#end }
|
|
||||||
]#if($foreach.count != $columns.size()),#end
|
|
||||||
#end
|
|
||||||
#end
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
const { queryParams, form, rules } = toRefs(data);
|
|
||||||
|
|
||||||
/** 查询${functionName}列表 */
|
|
||||||
function getList() {
|
|
||||||
loading.value = true;
|
|
||||||
#foreach ($column in $columns)
|
|
||||||
#if($column.htmlType == "datetime" && $column.queryType == "BETWEEN")
|
|
||||||
queryParams.value.params = {};
|
|
||||||
#break
|
|
||||||
#end
|
|
||||||
#end
|
|
||||||
#foreach ($column in $columns)
|
|
||||||
#if($column.htmlType == "datetime" && $column.queryType == "BETWEEN")
|
|
||||||
#set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)})
|
|
||||||
if (null != daterange${AttrName} && '' != daterange${AttrName}) {
|
|
||||||
queryParams.value.params["begin${AttrName}"] = daterange${AttrName}.value[0];
|
|
||||||
queryParams.value.params["end${AttrName}"] = daterange${AttrName}.value[1];
|
|
||||||
}
|
|
||||||
#end
|
|
||||||
#end
|
|
||||||
list${BusinessName}(queryParams.value).then(response => {
|
|
||||||
${businessName}List.value = response.rows;
|
|
||||||
total.value = response.total;
|
|
||||||
loading.value = false;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
// 取消按钮
|
|
||||||
function cancel() {
|
|
||||||
open.value = false;
|
|
||||||
reset();
|
|
||||||
}
|
|
||||||
|
|
||||||
// 表单重置
|
|
||||||
function reset() {
|
|
||||||
form.value = {
|
|
||||||
#foreach ($column in $columns)
|
|
||||||
#if($column.htmlType == "checkbox")
|
|
||||||
$column.javaField: []#if($foreach.count != $columns.size()),#end
|
|
||||||
#else
|
|
||||||
$column.javaField: null#if($foreach.count != $columns.size()),#end
|
|
||||||
#end
|
|
||||||
#end
|
|
||||||
};
|
|
||||||
#if($table.sub)
|
|
||||||
${subclassName}List.value = [];
|
|
||||||
#end
|
|
||||||
proxy.resetForm("${businessName}Ref");
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 搜索按钮操作 */
|
|
||||||
function handleQuery() {
|
|
||||||
queryParams.value.pageNum = 1;
|
|
||||||
getList();
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 重置按钮操作 */
|
|
||||||
function resetQuery() {
|
|
||||||
#foreach ($column in $columns)
|
|
||||||
#if($column.htmlType == "datetime" && $column.queryType == "BETWEEN")
|
|
||||||
#set($AttrName=$column.javaField.substring(0,1).toUpperCase() + ${column.javaField.substring(1)})
|
|
||||||
daterange${AttrName}.value = [];
|
|
||||||
#end
|
|
||||||
#end
|
|
||||||
proxy.resetForm("queryRef");
|
|
||||||
handleQuery();
|
|
||||||
}
|
|
||||||
|
|
||||||
// 多选框选中数据
|
|
||||||
function handleSelectionChange(selection) {
|
|
||||||
ids.value = selection.map(item => item.${pkColumn.javaField});
|
|
||||||
single.value = selection.length != 1;
|
|
||||||
multiple.value = !selection.length;
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 新增按钮操作 */
|
|
||||||
function handleAdd() {
|
|
||||||
reset();
|
|
||||||
open.value = true;
|
|
||||||
title.value = "添加${functionName}";
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 修改按钮操作 */
|
|
||||||
function handleUpdate(row) {
|
|
||||||
loading.value = true
|
|
||||||
reset();
|
|
||||||
const _${pkColumn.javaField} = row.${pkColumn.javaField} || ids.value
|
|
||||||
get${BusinessName}(_${pkColumn.javaField}).then(response => {
|
|
||||||
loading.value = false;
|
|
||||||
form.value = response.data;
|
|
||||||
#foreach ($column in $columns)
|
|
||||||
#if($column.htmlType == "checkbox")
|
|
||||||
form.value.$column.javaField = form.value.${column.javaField}.split(",");
|
|
||||||
#end
|
|
||||||
#end
|
|
||||||
#if($table.sub)
|
|
||||||
${subclassName}List.value = response.data.${subclassName}List;
|
|
||||||
#end
|
|
||||||
open.value = true;
|
|
||||||
title.value = "修改${functionName}";
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 提交按钮 */
|
|
||||||
function submitForm() {
|
|
||||||
proxy.#[[$]]#refs["${businessName}Ref"].validate(valid => {
|
|
||||||
if (valid) {
|
|
||||||
buttonLoading.value = true;
|
|
||||||
#foreach ($column in $columns)
|
|
||||||
#if($column.htmlType == "checkbox")
|
|
||||||
form.value.$column.javaField = form.value.${column.javaField}.join(",");
|
|
||||||
#end
|
|
||||||
#end
|
|
||||||
#if($table.sub)
|
|
||||||
form.value.${subclassName}List = ${subclassName}List.value;
|
|
||||||
#end
|
|
||||||
if (form.value.${pkColumn.javaField} != null) {
|
|
||||||
update${BusinessName}(form.value).then(response => {
|
|
||||||
proxy.#[[$modal]]#.msgSuccess("修改成功");
|
|
||||||
open.value = false;
|
|
||||||
getList();
|
|
||||||
}).finally(() => {
|
|
||||||
buttonLoading.value = false;
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
add${BusinessName}(form.value).then(response => {
|
|
||||||
proxy.#[[$modal]]#.msgSuccess("新增成功");
|
|
||||||
open.value = false;
|
|
||||||
getList();
|
|
||||||
}).finally(() => {
|
|
||||||
buttonLoading.value = false;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 删除按钮操作 */
|
|
||||||
function handleDelete(row) {
|
|
||||||
const _${pkColumn.javaField}s = row.${pkColumn.javaField} || ids.value;
|
|
||||||
proxy.#[[$modal]]#.confirm('是否确认删除${functionName}编号为"' + _${pkColumn.javaField}s + '"的数据项?').then(function() {
|
|
||||||
loading.value = true;
|
|
||||||
return del${BusinessName}(_${pkColumn.javaField}s);
|
|
||||||
}).then(() => {
|
|
||||||
loading.value = true;
|
|
||||||
getList();
|
|
||||||
proxy.#[[$modal]]#.msgSuccess("删除成功");
|
|
||||||
}).catch(() => {
|
|
||||||
}).finally(() => {
|
|
||||||
loading.value = false;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
#if($table.sub)
|
|
||||||
/** ${subTable.functionName}序号 */
|
|
||||||
function row${subClassName}Index({ row, rowIndex }) {
|
|
||||||
row.index = rowIndex + 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
/** ${subTable.functionName}添加按钮操作 */
|
|
||||||
function handleAdd${subClassName}() {
|
|
||||||
let obj = {};
|
|
||||||
#foreach($column in $subTable.columns)
|
|
||||||
#if($column.pk || $column.javaField == ${subTableFkclassName})
|
|
||||||
#elseif($column.list && "" != $javaField)
|
|
||||||
obj.$column.javaField = "";
|
|
||||||
#end
|
|
||||||
#end
|
|
||||||
${subclassName}List.value.push(obj);
|
|
||||||
}
|
|
||||||
|
|
||||||
/** ${subTable.functionName}删除按钮操作 */
|
|
||||||
function handleDelete${subClassName}() {
|
|
||||||
if (checked${subClassName}.value.length == 0) {
|
|
||||||
proxy.#[[$modal]]#.msgError("请先选择要删除的${subTable.functionName}数据");
|
|
||||||
} else {
|
|
||||||
const ${subclassName}s = ${subclassName}List.value;
|
|
||||||
const checked${subClassName}s = checked${subClassName}.value;
|
|
||||||
${subclassName}List.value = ${subclassName}s.filter(function(item) {
|
|
||||||
return checked${subClassName}s.indexOf(item.index) == -1
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/** 复选框选中数据 */
|
|
||||||
function handle${subClassName}SelectionChange(selection) {
|
|
||||||
checked${subClassName}.value = selection.map(item => item.index)
|
|
||||||
}
|
|
||||||
|
|
||||||
#end
|
|
||||||
/** 导出按钮操作 */
|
|
||||||
function handleExport() {
|
|
||||||
proxy.download('${moduleName}/${businessName}/export', {
|
|
||||||
...queryParams.value
|
|
||||||
}, `${businessName}_#[[${new Date().getTime()}]]#.xlsx`)
|
|
||||||
}
|
|
||||||
|
|
||||||
getList();
|
|
||||||
</script>
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
如果使用的是Vue3前端,那么需要覆盖一下此目录的模板index.vue.vm、index-tree.vue.vm文件到上级vue目录。
|
|
||||||
|
|
@ -4,11 +4,4 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="${packageName}.mapper.${ClassName}Mapper">
|
<mapper namespace="${packageName}.mapper.${ClassName}Mapper">
|
||||||
|
|
||||||
<resultMap type="${packageName}.domain.${ClassName}" id="${ClassName}Result">
|
|
||||||
#foreach ($column in $columns)
|
|
||||||
<result property="${column.javaField}" column="${column.columnName}"/>
|
|
||||||
#end
|
|
||||||
</resultMap>
|
|
||||||
|
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ import lombok.extern.slf4j.Slf4j;
|
||||||
import org.dromara.common.core.constant.Constants;
|
import org.dromara.common.core.constant.Constants;
|
||||||
import org.dromara.common.core.constant.GlobalConstants;
|
import org.dromara.common.core.constant.GlobalConstants;
|
||||||
import org.dromara.common.core.domain.R;
|
import org.dromara.common.core.domain.R;
|
||||||
import org.dromara.common.core.web.controller.BaseController;
|
import org.dromara.common.web.core.BaseController;
|
||||||
import org.dromara.common.mail.config.properties.MailProperties;
|
import org.dromara.common.mail.config.properties.MailProperties;
|
||||||
import org.dromara.common.mail.utils.MailUtils;
|
import org.dromara.common.mail.utils.MailUtils;
|
||||||
import org.dromara.common.redis.utils.RedisUtils;
|
import org.dromara.common.redis.utils.RedisUtils;
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ import org.dromara.common.core.domain.R;
|
||||||
import org.dromara.common.core.validate.AddGroup;
|
import org.dromara.common.core.validate.AddGroup;
|
||||||
import org.dromara.common.core.validate.EditGroup;
|
import org.dromara.common.core.validate.EditGroup;
|
||||||
import org.dromara.common.core.validate.QueryGroup;
|
import org.dromara.common.core.validate.QueryGroup;
|
||||||
import org.dromara.common.core.web.controller.BaseController;
|
import org.dromara.common.web.core.BaseController;
|
||||||
import org.dromara.common.log.annotation.Log;
|
import org.dromara.common.log.annotation.Log;
|
||||||
import org.dromara.common.log.enums.BusinessType;
|
import org.dromara.common.log.enums.BusinessType;
|
||||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ import cn.hutool.core.util.ObjectUtil;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.dromara.common.core.domain.R;
|
import org.dromara.common.core.domain.R;
|
||||||
import org.dromara.common.core.validate.QueryGroup;
|
import org.dromara.common.core.validate.QueryGroup;
|
||||||
import org.dromara.common.core.web.controller.BaseController;
|
import org.dromara.common.web.core.BaseController;
|
||||||
import org.dromara.common.log.annotation.Log;
|
import org.dromara.common.log.annotation.Log;
|
||||||
import org.dromara.common.log.enums.BusinessType;
|
import org.dromara.common.log.enums.BusinessType;
|
||||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ import org.dromara.common.core.constant.Constants;
|
||||||
import org.dromara.common.core.constant.GlobalConstants;
|
import org.dromara.common.core.constant.GlobalConstants;
|
||||||
import org.dromara.common.core.domain.R;
|
import org.dromara.common.core.domain.R;
|
||||||
import org.dromara.common.core.utils.SpringUtils;
|
import org.dromara.common.core.utils.SpringUtils;
|
||||||
import org.dromara.common.core.web.controller.BaseController;
|
import org.dromara.common.web.core.BaseController;
|
||||||
import org.dromara.common.redis.utils.RedisUtils;
|
import org.dromara.common.redis.utils.RedisUtils;
|
||||||
import org.dromara.common.sms.config.properties.SmsProperties;
|
import org.dromara.common.sms.config.properties.SmsProperties;
|
||||||
import org.dromara.common.sms.core.SmsTemplate;
|
import org.dromara.common.sms.core.SmsTemplate;
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ package org.dromara.resource.domain.bo;
|
||||||
import io.github.linpeilie.annotations.AutoMapper;
|
import io.github.linpeilie.annotations.AutoMapper;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
import org.dromara.common.core.web.domain.BaseEntity;
|
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||||
import org.dromara.resource.domain.SysOss;
|
import org.dromara.resource.domain.SysOss;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
import org.dromara.common.core.validate.AddGroup;
|
import org.dromara.common.core.validate.AddGroup;
|
||||||
import org.dromara.common.core.validate.EditGroup;
|
import org.dromara.common.core.validate.EditGroup;
|
||||||
import org.dromara.common.core.web.domain.BaseEntity;
|
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||||
import org.dromara.resource.domain.SysOssConfig;
|
import org.dromara.resource.domain.SysOssConfig;
|
||||||
|
|
||||||
import javax.validation.constraints.NotBlank;
|
import javax.validation.constraints.NotBlank;
|
||||||
|
|
|
||||||
|
|
@ -11,9 +11,9 @@ import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.dromara.common.core.constant.CacheNames;
|
import org.dromara.common.core.constant.CacheNames;
|
||||||
import org.dromara.common.core.exception.ServiceException;
|
import org.dromara.common.core.exception.ServiceException;
|
||||||
import org.dromara.common.core.utils.JsonUtils;
|
|
||||||
import org.dromara.common.core.utils.StreamUtils;
|
import org.dromara.common.core.utils.StreamUtils;
|
||||||
import org.dromara.common.core.utils.StringUtils;
|
import org.dromara.common.core.utils.StringUtils;
|
||||||
|
import org.dromara.common.json.utils.JsonUtils;
|
||||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||||
import org.dromara.common.oss.constant.OssConstant;
|
import org.dromara.common.oss.constant.OssConstant;
|
||||||
|
|
|
||||||
|
|
@ -92,6 +92,10 @@
|
||||||
<groupId>org.dromara</groupId>
|
<groupId>org.dromara</groupId>
|
||||||
<artifactId>ruoyi-common-translation</artifactId>
|
<artifactId>ruoyi-common-translation</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.dromara</groupId>
|
||||||
|
<artifactId>ruoyi-common-sensitive</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.dromara.common.core.constant.GlobalConstants;
|
import org.dromara.common.core.constant.GlobalConstants;
|
||||||
import org.dromara.common.core.domain.R;
|
import org.dromara.common.core.domain.R;
|
||||||
import org.dromara.common.core.web.controller.BaseController;
|
import org.dromara.common.web.core.BaseController;
|
||||||
import org.dromara.common.excel.utils.ExcelUtil;
|
import org.dromara.common.excel.utils.ExcelUtil;
|
||||||
import org.dromara.common.log.annotation.Log;
|
import org.dromara.common.log.annotation.Log;
|
||||||
import org.dromara.common.log.enums.BusinessType;
|
import org.dromara.common.log.enums.BusinessType;
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ package org.dromara.system.controller.monitor;
|
||||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.dromara.common.core.domain.R;
|
import org.dromara.common.core.domain.R;
|
||||||
import org.dromara.common.core.web.controller.BaseController;
|
import org.dromara.common.web.core.BaseController;
|
||||||
import org.dromara.common.excel.utils.ExcelUtil;
|
import org.dromara.common.excel.utils.ExcelUtil;
|
||||||
import org.dromara.common.log.annotation.Log;
|
import org.dromara.common.log.annotation.Log;
|
||||||
import org.dromara.common.log.enums.BusinessType;
|
import org.dromara.common.log.enums.BusinessType;
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ import org.dromara.common.core.constant.CacheConstants;
|
||||||
import org.dromara.common.core.domain.R;
|
import org.dromara.common.core.domain.R;
|
||||||
import org.dromara.common.core.utils.StreamUtils;
|
import org.dromara.common.core.utils.StreamUtils;
|
||||||
import org.dromara.common.core.utils.StringUtils;
|
import org.dromara.common.core.utils.StringUtils;
|
||||||
import org.dromara.common.core.web.controller.BaseController;
|
import org.dromara.common.web.core.BaseController;
|
||||||
import org.dromara.common.log.annotation.Log;
|
import org.dromara.common.log.annotation.Log;
|
||||||
import org.dromara.common.log.enums.BusinessType;
|
import org.dromara.common.log.enums.BusinessType;
|
||||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ package org.dromara.system.controller.system;
|
||||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.dromara.common.core.domain.R;
|
import org.dromara.common.core.domain.R;
|
||||||
import org.dromara.common.core.web.controller.BaseController;
|
import org.dromara.common.web.core.BaseController;
|
||||||
import org.dromara.common.excel.utils.ExcelUtil;
|
import org.dromara.common.excel.utils.ExcelUtil;
|
||||||
import org.dromara.common.log.annotation.Log;
|
import org.dromara.common.log.annotation.Log;
|
||||||
import org.dromara.common.log.enums.BusinessType;
|
import org.dromara.common.log.enums.BusinessType;
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ import lombok.RequiredArgsConstructor;
|
||||||
import org.dromara.common.core.constant.UserConstants;
|
import org.dromara.common.core.constant.UserConstants;
|
||||||
import org.dromara.common.core.domain.R;
|
import org.dromara.common.core.domain.R;
|
||||||
import org.dromara.common.core.utils.StringUtils;
|
import org.dromara.common.core.utils.StringUtils;
|
||||||
import org.dromara.common.core.web.controller.BaseController;
|
import org.dromara.common.web.core.BaseController;
|
||||||
import org.dromara.common.log.annotation.Log;
|
import org.dromara.common.log.annotation.Log;
|
||||||
import org.dromara.common.log.enums.BusinessType;
|
import org.dromara.common.log.enums.BusinessType;
|
||||||
import org.dromara.system.domain.bo.SysDeptBo;
|
import org.dromara.system.domain.bo.SysDeptBo;
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.dromara.common.core.domain.R;
|
import org.dromara.common.core.domain.R;
|
||||||
import org.dromara.common.core.web.controller.BaseController;
|
import org.dromara.common.web.core.BaseController;
|
||||||
import org.dromara.common.excel.utils.ExcelUtil;
|
import org.dromara.common.excel.utils.ExcelUtil;
|
||||||
import org.dromara.common.log.annotation.Log;
|
import org.dromara.common.log.annotation.Log;
|
||||||
import org.dromara.common.log.enums.BusinessType;
|
import org.dromara.common.log.enums.BusinessType;
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ package org.dromara.system.controller.system;
|
||||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.dromara.common.core.domain.R;
|
import org.dromara.common.core.domain.R;
|
||||||
import org.dromara.common.core.web.controller.BaseController;
|
import org.dromara.common.web.core.BaseController;
|
||||||
import org.dromara.common.excel.utils.ExcelUtil;
|
import org.dromara.common.excel.utils.ExcelUtil;
|
||||||
import org.dromara.common.log.annotation.Log;
|
import org.dromara.common.log.annotation.Log;
|
||||||
import org.dromara.common.log.enums.BusinessType;
|
import org.dromara.common.log.enums.BusinessType;
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ import org.dromara.common.core.constant.TenantConstants;
|
||||||
import org.dromara.common.core.constant.UserConstants;
|
import org.dromara.common.core.constant.UserConstants;
|
||||||
import org.dromara.common.core.domain.R;
|
import org.dromara.common.core.domain.R;
|
||||||
import org.dromara.common.core.utils.StringUtils;
|
import org.dromara.common.core.utils.StringUtils;
|
||||||
import org.dromara.common.core.web.controller.BaseController;
|
import org.dromara.common.web.core.BaseController;
|
||||||
import org.dromara.common.log.annotation.Log;
|
import org.dromara.common.log.annotation.Log;
|
||||||
import org.dromara.common.log.enums.BusinessType;
|
import org.dromara.common.log.enums.BusinessType;
|
||||||
import org.dromara.common.satoken.utils.LoginHelper;
|
import org.dromara.common.satoken.utils.LoginHelper;
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ package org.dromara.system.controller.system;
|
||||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.dromara.common.core.domain.R;
|
import org.dromara.common.core.domain.R;
|
||||||
import org.dromara.common.core.web.controller.BaseController;
|
import org.dromara.common.web.core.BaseController;
|
||||||
import org.dromara.common.log.annotation.Log;
|
import org.dromara.common.log.annotation.Log;
|
||||||
import org.dromara.common.log.enums.BusinessType;
|
import org.dromara.common.log.enums.BusinessType;
|
||||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ package org.dromara.system.controller.system;
|
||||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.dromara.common.core.domain.R;
|
import org.dromara.common.core.domain.R;
|
||||||
import org.dromara.common.core.web.controller.BaseController;
|
import org.dromara.common.web.core.BaseController;
|
||||||
import org.dromara.common.excel.utils.ExcelUtil;
|
import org.dromara.common.excel.utils.ExcelUtil;
|
||||||
import org.dromara.common.log.annotation.Log;
|
import org.dromara.common.log.annotation.Log;
|
||||||
import org.dromara.common.log.enums.BusinessType;
|
import org.dromara.common.log.enums.BusinessType;
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ import org.apache.dubbo.config.annotation.DubboReference;
|
||||||
import org.dromara.common.core.domain.R;
|
import org.dromara.common.core.domain.R;
|
||||||
import org.dromara.common.core.utils.StringUtils;
|
import org.dromara.common.core.utils.StringUtils;
|
||||||
import org.dromara.common.core.utils.file.MimeTypeUtils;
|
import org.dromara.common.core.utils.file.MimeTypeUtils;
|
||||||
import org.dromara.common.core.web.controller.BaseController;
|
import org.dromara.common.web.core.BaseController;
|
||||||
import org.dromara.common.log.annotation.Log;
|
import org.dromara.common.log.annotation.Log;
|
||||||
import org.dromara.common.log.enums.BusinessType;
|
import org.dromara.common.log.enums.BusinessType;
|
||||||
import org.dromara.common.satoken.utils.LoginHelper;
|
import org.dromara.common.satoken.utils.LoginHelper;
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ package org.dromara.system.controller.system;
|
||||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.dromara.common.core.domain.R;
|
import org.dromara.common.core.domain.R;
|
||||||
import org.dromara.common.core.web.controller.BaseController;
|
import org.dromara.common.web.core.BaseController;
|
||||||
import org.dromara.common.excel.utils.ExcelUtil;
|
import org.dromara.common.excel.utils.ExcelUtil;
|
||||||
import org.dromara.common.log.annotation.Log;
|
import org.dromara.common.log.annotation.Log;
|
||||||
import org.dromara.common.log.enums.BusinessType;
|
import org.dromara.common.log.enums.BusinessType;
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ import org.dromara.common.core.constant.TenantConstants;
|
||||||
import org.dromara.common.core.domain.R;
|
import org.dromara.common.core.domain.R;
|
||||||
import org.dromara.common.core.validate.AddGroup;
|
import org.dromara.common.core.validate.AddGroup;
|
||||||
import org.dromara.common.core.validate.EditGroup;
|
import org.dromara.common.core.validate.EditGroup;
|
||||||
import org.dromara.common.core.web.controller.BaseController;
|
import org.dromara.common.web.core.BaseController;
|
||||||
import org.dromara.common.excel.utils.ExcelUtil;
|
import org.dromara.common.excel.utils.ExcelUtil;
|
||||||
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
||||||
import org.dromara.common.log.annotation.Log;
|
import org.dromara.common.log.annotation.Log;
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ import org.dromara.common.core.constant.TenantConstants;
|
||||||
import org.dromara.common.core.domain.R;
|
import org.dromara.common.core.domain.R;
|
||||||
import org.dromara.common.core.validate.AddGroup;
|
import org.dromara.common.core.validate.AddGroup;
|
||||||
import org.dromara.common.core.validate.EditGroup;
|
import org.dromara.common.core.validate.EditGroup;
|
||||||
import org.dromara.common.core.web.controller.BaseController;
|
import org.dromara.common.web.core.BaseController;
|
||||||
import org.dromara.common.excel.utils.ExcelUtil;
|
import org.dromara.common.excel.utils.ExcelUtil;
|
||||||
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
||||||
import org.dromara.common.log.annotation.Log;
|
import org.dromara.common.log.annotation.Log;
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ import org.dromara.common.core.domain.R;
|
||||||
import org.dromara.common.core.utils.MapstructUtils;
|
import org.dromara.common.core.utils.MapstructUtils;
|
||||||
import org.dromara.common.core.utils.StreamUtils;
|
import org.dromara.common.core.utils.StreamUtils;
|
||||||
import org.dromara.common.core.utils.StringUtils;
|
import org.dromara.common.core.utils.StringUtils;
|
||||||
import org.dromara.common.core.web.controller.BaseController;
|
import org.dromara.common.web.core.BaseController;
|
||||||
import org.dromara.common.excel.core.ExcelResult;
|
import org.dromara.common.excel.core.ExcelResult;
|
||||||
import org.dromara.common.excel.utils.ExcelUtil;
|
import org.dromara.common.excel.utils.ExcelUtil;
|
||||||
import org.dromara.common.log.annotation.Log;
|
import org.dromara.common.log.annotation.Log;
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ import lombok.EqualsAndHashCode;
|
||||||
import org.dromara.common.core.constant.Constants;
|
import org.dromara.common.core.constant.Constants;
|
||||||
import org.dromara.common.core.constant.UserConstants;
|
import org.dromara.common.core.constant.UserConstants;
|
||||||
import org.dromara.common.core.utils.StringUtils;
|
import org.dromara.common.core.utils.StringUtils;
|
||||||
import org.dromara.common.core.web.domain.BaseEntity;
|
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
import org.dromara.common.core.web.domain.BaseEntity;
|
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
import org.dromara.common.core.web.domain.BaseEntity;
|
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 租户套餐对象 sys_tenant_package
|
* 租户套餐对象 sys_tenant_package
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
import org.dromara.common.core.validate.AddGroup;
|
import org.dromara.common.core.validate.AddGroup;
|
||||||
import org.dromara.common.core.validate.EditGroup;
|
import org.dromara.common.core.validate.EditGroup;
|
||||||
import org.dromara.common.core.web.domain.BaseEntity;
|
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||||
import org.dromara.system.domain.SysConfig;
|
import org.dromara.system.domain.SysConfig;
|
||||||
|
|
||||||
import javax.validation.constraints.*;
|
import javax.validation.constraints.*;
|
||||||
|
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue