mirror of
https://gitee.com/lab1024/smart-admin.git
synced 2025-11-07 03:03:47 +08:00
v3.23.0 【新增】TS代码生成和优化;【优化】log日志格式;【优化】数据字典缓存;【优化】职位表结构
This commit is contained in:
@@ -29,7 +29,6 @@
|
||||
<druid.version>1.2.23</druid.version>
|
||||
<google-linkedhashmap.version>1.4.2</google-linkedhashmap.version>
|
||||
<google-guava.version>20.0</google-guava.version>
|
||||
<user-agent-utils.version>1.21</user-agent-utils.version>
|
||||
<reflections.version>0.9.11</reflections.version>
|
||||
<commons-io.version>2.15.0</commons-io.version>
|
||||
<commons-lang3.version>3.12.0</commons-lang3.version>
|
||||
@@ -127,12 +126,6 @@
|
||||
<version>${google-guava.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>eu.bitwalker</groupId>
|
||||
<artifactId>UserAgentUtils</artifactId>
|
||||
<version>${user-agent-utils.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.reflections</groupId>
|
||||
<artifactId>reflections</artifactId>
|
||||
@@ -198,7 +191,6 @@
|
||||
<artifactId>hutool-all</artifactId>
|
||||
<version>${hutool.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!--velocity begin-->
|
||||
<dependency>
|
||||
<groupId>org.apache.velocity</groupId>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package net.lab1024.sa.admin.module.business.oa.enterprise;
|
||||
package net.lab1024.sa.admin.module.business.oa.enterprise.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
@@ -8,6 +8,7 @@ import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.Valid;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import net.lab1024.sa.admin.constant.AdminSwaggerTagConst;
|
||||
import net.lab1024.sa.admin.module.business.oa.enterprise.service.EnterpriseService;
|
||||
import net.lab1024.sa.admin.module.business.oa.enterprise.domain.form.*;
|
||||
import net.lab1024.sa.admin.module.business.oa.enterprise.domain.vo.EnterpriseEmployeeVO;
|
||||
import net.lab1024.sa.admin.module.business.oa.enterprise.domain.vo.EnterpriseExcelVO;
|
||||
@@ -1,4 +1,4 @@
|
||||
package net.lab1024.sa.admin.module.business.oa.enterprise;
|
||||
package net.lab1024.sa.admin.module.business.oa.enterprise.manager;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import net.lab1024.sa.admin.module.business.oa.enterprise.dao.EnterpriseEmployeeDao;
|
||||
@@ -1,4 +1,4 @@
|
||||
package net.lab1024.sa.admin.module.business.oa.enterprise;
|
||||
package net.lab1024.sa.admin.module.business.oa.enterprise.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.google.common.collect.Lists;
|
||||
@@ -13,6 +13,7 @@ import net.lab1024.sa.admin.module.business.oa.enterprise.domain.vo.EnterpriseEm
|
||||
import net.lab1024.sa.admin.module.business.oa.enterprise.domain.vo.EnterpriseExcelVO;
|
||||
import net.lab1024.sa.admin.module.business.oa.enterprise.domain.vo.EnterpriseListVO;
|
||||
import net.lab1024.sa.admin.module.business.oa.enterprise.domain.vo.EnterpriseVO;
|
||||
import net.lab1024.sa.admin.module.business.oa.enterprise.manager.EnterpriseEmployeeManager;
|
||||
import net.lab1024.sa.admin.module.system.department.service.DepartmentService;
|
||||
import net.lab1024.sa.base.common.code.UserErrorCode;
|
||||
import net.lab1024.sa.base.common.domain.PageResult;
|
||||
@@ -3,7 +3,7 @@ package net.lab1024.sa.admin.module.business.oa.invoice.service;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import jakarta.annotation.Resource;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import net.lab1024.sa.admin.module.business.oa.enterprise.EnterpriseService;
|
||||
import net.lab1024.sa.admin.module.business.oa.enterprise.service.EnterpriseService;
|
||||
import net.lab1024.sa.admin.module.business.oa.enterprise.domain.vo.EnterpriseVO;
|
||||
import net.lab1024.sa.admin.module.business.oa.invoice.dao.InvoiceDao;
|
||||
import net.lab1024.sa.admin.module.business.oa.invoice.domain.*;
|
||||
|
||||
@@ -34,7 +34,7 @@ public class PositionEntity {
|
||||
/**
|
||||
* 职级
|
||||
*/
|
||||
private String level;
|
||||
private String positionLevel;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
|
||||
@@ -21,7 +21,7 @@ public class PositionAddForm {
|
||||
private String positionName;
|
||||
|
||||
@Schema(description = "职级")
|
||||
private String level;
|
||||
private String positionLevel;
|
||||
|
||||
@Schema(description = "排序")
|
||||
@NotNull(message = "排序不能为空")
|
||||
|
||||
@@ -23,7 +23,7 @@ public class PositionVO {
|
||||
private String positionName;
|
||||
|
||||
@Schema(description = "职级")
|
||||
private String level;
|
||||
private String positionLevel;
|
||||
|
||||
@Schema(description = "排序")
|
||||
private Integer sort;
|
||||
|
||||
@@ -5,15 +5,13 @@
|
||||
-->
|
||||
<Configuration status="INFO" monitorInterval="30">
|
||||
<Properties>
|
||||
<Property name="log-directory" value="${sys:project.log-directory}"/>
|
||||
<Property name="log-directory" value="${spring:project.log-directory}"/>
|
||||
</Properties>
|
||||
<Appenders>
|
||||
<Console name="Console" target="SYSTEM_OUT">
|
||||
<ThresholdFilter level="info" onMatch="ACCEPT" onMismatch="DENY"/>
|
||||
<!--设置日志格式及颜色-->
|
||||
<PatternLayout
|
||||
pattern="%blue{%d{yyyy-MM-dd HH:mm:ss.SSS}} [%highlight{%-5level} ][%t] [%cyan{%c{1.}}:%L] %m%n"
|
||||
disableAnsi="false" noConsoleNoAnsi="false"/>
|
||||
<PatternLayout pattern="[%blue{%d}][%highlight{%-5p}][%t][%cyan{%c{1.}:%L}] %m %n"
|
||||
disableAnsi="false" noConsoleNoAnsi="false"/>
|
||||
</Console>
|
||||
<RollingFile name="debug" fileName="${log-directory}/debug/debug.log"
|
||||
filePattern="${log-directory}/debug/debug-%d{yyyy-MM-dd}-%i.log">
|
||||
@@ -21,7 +19,7 @@
|
||||
<ThresholdFilter level="info" onMatch="DENY" onMismatch="NEUTRAL"/>
|
||||
<ThresholdFilter level="debug" onMatch="ACCEPT" onMismatch="DENY"/>
|
||||
</Filters>
|
||||
<PatternLayout pattern="[%d][%-5p][%t] %m (%F:%L)%n"/>
|
||||
<PatternLayout pattern="[%d][%-5p][%t][%c{1.}:%L] %m %n"/>
|
||||
<Policies>
|
||||
<TimeBasedTriggeringPolicy interval="1" modulate="true"/>
|
||||
<SizeBasedTriggeringPolicy size="50 MB"/>
|
||||
@@ -39,7 +37,7 @@
|
||||
<ThresholdFilter level="warn" onMatch="DENY" onMismatch="NEUTRAL"/>
|
||||
<ThresholdFilter level="info" onMatch="ACCEPT" onMismatch="DENY"/>
|
||||
</Filters>
|
||||
<PatternLayout pattern="[%d][%-5p][%t] %m (%F:%L)%n"/>
|
||||
<PatternLayout pattern="[%d][%-5p][%t][%c{1.}:%L] %m %n"/>
|
||||
<Policies>
|
||||
<TimeBasedTriggeringPolicy interval="1" modulate="true"/>
|
||||
<SizeBasedTriggeringPolicy size="50 MB"/>
|
||||
@@ -57,7 +55,7 @@
|
||||
<ThresholdFilter level="error" onMatch="DENY" onMismatch="NEUTRAL"/>
|
||||
<ThresholdFilter level="warn" onMatch="ACCEPT" onMismatch="DENY"/>
|
||||
</Filters>
|
||||
<PatternLayout pattern="[%d][%-5p][%t] %m (%F:%L)%n"/>
|
||||
<PatternLayout pattern="[%d][%-5p][%t][%c{1.}:%L] %m %n"/>
|
||||
<Policies>
|
||||
<TimeBasedTriggeringPolicy interval="1" modulate="true"/>
|
||||
<SizeBasedTriggeringPolicy size="50 MB"/>
|
||||
@@ -75,7 +73,7 @@
|
||||
<ThresholdFilter level="fatal" onMatch="DENY" onMismatch="NEUTRAL"/>
|
||||
<ThresholdFilter level="error" onMatch="ACCEPT" onMismatch="DENY"/>
|
||||
</Filters>
|
||||
<PatternLayout pattern="[%d][%-5p][%t] %m (%F:%L)%n"/>
|
||||
<PatternLayout pattern="[%d][%-5p][%t][%c{1.}:%L] %m %n"/>
|
||||
<Policies>
|
||||
<TimeBasedTriggeringPolicy interval="1" modulate="true"/>
|
||||
<SizeBasedTriggeringPolicy size="10 MB"/>
|
||||
@@ -89,7 +87,7 @@
|
||||
</RollingFile>
|
||||
<RollingFile name="druidSlowSqlLog" fileName="${log-directory}/slow-sql/slow-sql.log"
|
||||
filePattern="${log-directory}/slow-sql/slow-sql-%d{yyyy-MM-dd}-%i.log">
|
||||
<PatternLayout pattern="[%d][%-5p][%t] %m (%F:%L)%n"/>
|
||||
<PatternLayout pattern="[%d][%-5p][%t][%c{1.}:%L] %m %n"/>
|
||||
<Policies>
|
||||
<TimeBasedTriggeringPolicy interval="1" modulate="true"/>
|
||||
<SizeBasedTriggeringPolicy size="50 MB"/>
|
||||
@@ -104,11 +102,9 @@
|
||||
</Appenders>
|
||||
|
||||
<Loggers>
|
||||
|
||||
<logger name="com.alibaba.druid.filter.stat.StatFilter" level="ERROR" additivity="false">
|
||||
<AppenderRef ref="druidSlowSqlLog"/>
|
||||
</logger>
|
||||
|
||||
<Root level="debug">
|
||||
<AppenderRef ref="Console"/>
|
||||
<AppenderRef ref="debug"/>
|
||||
|
||||
@@ -5,12 +5,12 @@
|
||||
-->
|
||||
<Configuration status="INFO" monitorInterval="30">
|
||||
<Properties>
|
||||
<Property name="log-directory" value="${sys:project.log-directory}"/>
|
||||
<Property name="log-directory" value="${spring:project.log-directory}"/>
|
||||
</Properties>
|
||||
<Appenders>
|
||||
<Console name="Console" target="SYSTEM_OUT">
|
||||
<ThresholdFilter level="info" onMatch="ACCEPT" onMismatch="DENY"/>
|
||||
<PatternLayout pattern="[%d][%-5p][%t] %m (%F:%L)%n"/>
|
||||
<PatternLayout pattern="[%d][%-5p][%t][%c{1.}:%L] %m %n"/>
|
||||
</Console>
|
||||
<RollingFile name="debug" fileName="${log-directory}/debug/debug.log"
|
||||
filePattern="${log-directory}/debug/debug-%d{yyyy-MM-dd}-%i.log">
|
||||
@@ -18,7 +18,7 @@
|
||||
<ThresholdFilter level="info" onMatch="DENY" onMismatch="NEUTRAL"/>
|
||||
<ThresholdFilter level="debug" onMatch="ACCEPT" onMismatch="DENY"/>
|
||||
</Filters>
|
||||
<PatternLayout pattern="[%d][%-5p][%t] %m (%F:%L)%n"/>
|
||||
<PatternLayout pattern="[%d][%-5p][%t][%c{1.}:%L] %m %n"/>
|
||||
<Policies>
|
||||
<TimeBasedTriggeringPolicy interval="1" modulate="true"/>
|
||||
<SizeBasedTriggeringPolicy size="50 MB"/>
|
||||
@@ -36,7 +36,7 @@
|
||||
<ThresholdFilter level="warn" onMatch="DENY" onMismatch="NEUTRAL"/>
|
||||
<ThresholdFilter level="info" onMatch="ACCEPT" onMismatch="DENY"/>
|
||||
</Filters>
|
||||
<PatternLayout pattern="[%d][%-5p][%t] %m (%F:%L)%n"/>
|
||||
<PatternLayout pattern="[%d][%-5p][%t][%c{1.}:%L] %m %n"/>
|
||||
<Policies>
|
||||
<TimeBasedTriggeringPolicy interval="1" modulate="true"/>
|
||||
<SizeBasedTriggeringPolicy size="50 MB"/>
|
||||
@@ -54,7 +54,7 @@
|
||||
<ThresholdFilter level="error" onMatch="DENY" onMismatch="NEUTRAL"/>
|
||||
<ThresholdFilter level="warn" onMatch="ACCEPT" onMismatch="DENY"/>
|
||||
</Filters>
|
||||
<PatternLayout pattern="[%d][%-5p][%t] %m (%F:%L)%n"/>
|
||||
<PatternLayout pattern="[%d][%-5p][%t][%c{1.}:%L] %m %n"/>
|
||||
<Policies>
|
||||
<TimeBasedTriggeringPolicy interval="1" modulate="true"/>
|
||||
<SizeBasedTriggeringPolicy size="50 MB"/>
|
||||
@@ -72,7 +72,7 @@
|
||||
<ThresholdFilter level="fatal" onMatch="DENY" onMismatch="NEUTRAL"/>
|
||||
<ThresholdFilter level="error" onMatch="ACCEPT" onMismatch="DENY"/>
|
||||
</Filters>
|
||||
<PatternLayout pattern="[%d][%-5p][%t] %m (%F:%L)%n"/>
|
||||
<PatternLayout pattern="[%d][%-5p][%t][%c{1.}:%L] %m %n"/>
|
||||
<Policies>
|
||||
<TimeBasedTriggeringPolicy interval="1" modulate="true"/>
|
||||
<SizeBasedTriggeringPolicy size="10 MB"/>
|
||||
@@ -86,7 +86,7 @@
|
||||
</RollingFile>
|
||||
<RollingFile name="druidSlowSqlLog" fileName="${log-directory}/slow-sql/slow-sql.log"
|
||||
filePattern="${log-directory}/slow-sql/slow-sql-%d{yyyy-MM-dd}-%i.log">
|
||||
<PatternLayout pattern="[%d][%-5p][%t] %m (%F:%L)%n"/>
|
||||
<PatternLayout pattern="[%d][%-5p][%t][%c{1.}:%L] %m %n"/>
|
||||
<Policies>
|
||||
<TimeBasedTriggeringPolicy interval="1" modulate="true"/>
|
||||
<SizeBasedTriggeringPolicy size="50 MB"/>
|
||||
|
||||
@@ -5,12 +5,12 @@
|
||||
-->
|
||||
<Configuration status="INFO" monitorInterval="30">
|
||||
<Properties>
|
||||
<Property name="log-directory" value="${sys:project.log-directory}"/>
|
||||
<Property name="log-directory" value="${spring:project.log-directory}"/>
|
||||
</Properties>
|
||||
<Appenders>
|
||||
<Console name="Console" target="SYSTEM_OUT">
|
||||
<ThresholdFilter level="info" onMatch="ACCEPT" onMismatch="DENY"/>
|
||||
<PatternLayout pattern="[%d][%-5p][%t] %m (%F:%L)%n"/>
|
||||
<PatternLayout pattern="[%d][%-5p][%t][%c{1.}:%L] %m %n"/>
|
||||
</Console>
|
||||
<RollingFile name="debug" fileName="${log-directory}/debug/debug.log"
|
||||
filePattern="${log-directory}/debug/debug-%d{yyyy-MM-dd}-%i.log">
|
||||
@@ -18,7 +18,7 @@
|
||||
<ThresholdFilter level="info" onMatch="DENY" onMismatch="NEUTRAL"/>
|
||||
<ThresholdFilter level="debug" onMatch="ACCEPT" onMismatch="DENY"/>
|
||||
</Filters>
|
||||
<PatternLayout pattern="[%d][%-5p][%t] %m (%F:%L)%n"/>
|
||||
<PatternLayout pattern="[%d][%-5p][%t][%c{1.}:%L] %m %n"/>
|
||||
<Policies>
|
||||
<TimeBasedTriggeringPolicy interval="1" modulate="true"/>
|
||||
<SizeBasedTriggeringPolicy size="50 MB"/>
|
||||
@@ -36,7 +36,7 @@
|
||||
<ThresholdFilter level="warn" onMatch="DENY" onMismatch="NEUTRAL"/>
|
||||
<ThresholdFilter level="info" onMatch="ACCEPT" onMismatch="DENY"/>
|
||||
</Filters>
|
||||
<PatternLayout pattern="[%d][%-5p][%t] %m (%F:%L)%n"/>
|
||||
<PatternLayout pattern="[%d][%-5p][%t][%c{1.}:%L] %m %n"/>
|
||||
<Policies>
|
||||
<TimeBasedTriggeringPolicy interval="1" modulate="true"/>
|
||||
<SizeBasedTriggeringPolicy size="50 MB"/>
|
||||
@@ -54,7 +54,7 @@
|
||||
<ThresholdFilter level="error" onMatch="DENY" onMismatch="NEUTRAL"/>
|
||||
<ThresholdFilter level="warn" onMatch="ACCEPT" onMismatch="DENY"/>
|
||||
</Filters>
|
||||
<PatternLayout pattern="[%d][%-5p][%t] %m (%F:%L)%n"/>
|
||||
<PatternLayout pattern="[%d][%-5p][%t][%c{1.}:%L] %m %n"/>
|
||||
<Policies>
|
||||
<TimeBasedTriggeringPolicy interval="1" modulate="true"/>
|
||||
<SizeBasedTriggeringPolicy size="50 MB"/>
|
||||
@@ -72,7 +72,7 @@
|
||||
<ThresholdFilter level="fatal" onMatch="DENY" onMismatch="NEUTRAL"/>
|
||||
<ThresholdFilter level="error" onMatch="ACCEPT" onMismatch="DENY"/>
|
||||
</Filters>
|
||||
<PatternLayout pattern="[%d][%-5p][%t] %m (%F:%L)%n"/>
|
||||
<PatternLayout pattern="[%d][%-5p][%t][%c{1.}:%L] %m %n"/>
|
||||
<Policies>
|
||||
<TimeBasedTriggeringPolicy interval="1" modulate="true"/>
|
||||
<SizeBasedTriggeringPolicy size="10 MB"/>
|
||||
@@ -86,7 +86,7 @@
|
||||
</RollingFile>
|
||||
<RollingFile name="druidSlowSqlLog" fileName="${log-directory}/slow-sql/slow-sql.log"
|
||||
filePattern="${log-directory}/slow-sql/slow-sql-%d{yyyy-MM-dd}-%i.log">
|
||||
<PatternLayout pattern="[%d][%-5p][%t] %m (%F:%L)%n"/>
|
||||
<PatternLayout pattern="[%d][%-5p][%t][%c{1.}:%L] %m %n"/>
|
||||
<Policies>
|
||||
<TimeBasedTriggeringPolicy interval="1" modulate="true"/>
|
||||
<SizeBasedTriggeringPolicy size="50 MB"/>
|
||||
|
||||
@@ -5,12 +5,12 @@
|
||||
-->
|
||||
<Configuration status="INFO" monitorInterval="30">
|
||||
<Properties>
|
||||
<Property name="log-directory" value="${sys:project.log-directory}"/>
|
||||
<Property name="log-directory" value="${spring:project.log-directory}"/>
|
||||
</Properties>
|
||||
<Appenders>
|
||||
<Console name="Console" target="SYSTEM_OUT">
|
||||
<ThresholdFilter level="info" onMatch="ACCEPT" onMismatch="DENY"/>
|
||||
<PatternLayout pattern="[%d][%-5p][%t] %m (%F:%L)%n"/>
|
||||
<PatternLayout pattern="[%d][%-5p][%t][%c{1.}:%L] %m %n"/>
|
||||
</Console>
|
||||
<RollingFile name="debug" fileName="${log-directory}/debug/debug.log"
|
||||
filePattern="${log-directory}/debug/debug-%d{yyyy-MM-dd}-%i.log">
|
||||
@@ -18,7 +18,7 @@
|
||||
<ThresholdFilter level="info" onMatch="DENY" onMismatch="NEUTRAL"/>
|
||||
<ThresholdFilter level="debug" onMatch="ACCEPT" onMismatch="DENY"/>
|
||||
</Filters>
|
||||
<PatternLayout pattern="[%d][%-5p][%t] %m (%F:%L)%n"/>
|
||||
<PatternLayout pattern="[%d][%-5p][%t][%c{1.}:%L] %m %n"/>
|
||||
<Policies>
|
||||
<TimeBasedTriggeringPolicy interval="1" modulate="true"/>
|
||||
<SizeBasedTriggeringPolicy size="50 MB"/>
|
||||
@@ -36,7 +36,7 @@
|
||||
<ThresholdFilter level="warn" onMatch="DENY" onMismatch="NEUTRAL"/>
|
||||
<ThresholdFilter level="info" onMatch="ACCEPT" onMismatch="DENY"/>
|
||||
</Filters>
|
||||
<PatternLayout pattern="[%d][%-5p][%t] %m (%F:%L)%n"/>
|
||||
<PatternLayout pattern="[%d][%-5p][%t][%c{1.}:%L] %m %n"/>
|
||||
<Policies>
|
||||
<TimeBasedTriggeringPolicy interval="1" modulate="true"/>
|
||||
<SizeBasedTriggeringPolicy size="50 MB"/>
|
||||
@@ -54,7 +54,7 @@
|
||||
<ThresholdFilter level="error" onMatch="DENY" onMismatch="NEUTRAL"/>
|
||||
<ThresholdFilter level="warn" onMatch="ACCEPT" onMismatch="DENY"/>
|
||||
</Filters>
|
||||
<PatternLayout pattern="[%d][%-5p][%t] %m (%F:%L)%n"/>
|
||||
<PatternLayout pattern="[%d][%-5p][%t][%c{1.}:%L] %m %n"/>
|
||||
<Policies>
|
||||
<TimeBasedTriggeringPolicy interval="1" modulate="true"/>
|
||||
<SizeBasedTriggeringPolicy size="50 MB"/>
|
||||
@@ -72,7 +72,7 @@
|
||||
<ThresholdFilter level="fatal" onMatch="DENY" onMismatch="NEUTRAL"/>
|
||||
<ThresholdFilter level="error" onMatch="ACCEPT" onMismatch="DENY"/>
|
||||
</Filters>
|
||||
<PatternLayout pattern="[%d][%-5p][%t] %m (%F:%L)%n"/>
|
||||
<PatternLayout pattern="[%d][%-5p][%t][%c{1.}:%L] %m %n"/>
|
||||
<Policies>
|
||||
<TimeBasedTriggeringPolicy interval="1" modulate="true"/>
|
||||
<SizeBasedTriggeringPolicy size="10 MB"/>
|
||||
@@ -86,7 +86,7 @@
|
||||
</RollingFile>
|
||||
<RollingFile name="druidSlowSqlLog" fileName="${log-directory}/slow-sql/slow-sql.log"
|
||||
filePattern="${log-directory}/slow-sql/slow-sql-%d{yyyy-MM-dd}-%i.log">
|
||||
<PatternLayout pattern="[%d][%-5p][%t] %m (%F:%L)%n"/>
|
||||
<PatternLayout pattern="[%d][%-5p][%t][%c{1.}:%L] %m %n"/>
|
||||
<Policies>
|
||||
<TimeBasedTriggeringPolicy interval="1" modulate="true"/>
|
||||
<SizeBasedTriggeringPolicy size="50 MB"/>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package net.lab1024.sa.base.config;
|
||||
|
||||
import com.alibaba.fastjson.support.spring.GenericFastJsonRedisSerializer;
|
||||
import jakarta.annotation.Resource;
|
||||
import net.lab1024.sa.base.module.support.cache.CacheService;
|
||||
import net.lab1024.sa.base.module.support.cache.CaffeineCacheServiceImpl;
|
||||
import net.lab1024.sa.base.module.support.cache.RedisCacheServiceImpl;
|
||||
@@ -8,6 +9,7 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.data.redis.cache.RedisCacheConfiguration;
|
||||
import org.springframework.data.redis.connection.RedisConnectionFactory;
|
||||
import org.springframework.data.redis.serializer.RedisSerializationContext;
|
||||
|
||||
/**
|
||||
@@ -22,14 +24,17 @@ public class CacheConfig {
|
||||
private static final String REDIS_CACHE = "redis";
|
||||
private static final String CAFFEINE_CACHE = "caffeine";
|
||||
|
||||
|
||||
@Resource
|
||||
private RedisConnectionFactory factory;
|
||||
|
||||
@Bean
|
||||
@ConditionalOnProperty(prefix = "spring.cache", name = {"type"}, havingValue = REDIS_CACHE)
|
||||
public RedisCacheConfiguration redisCacheConfiguration() {
|
||||
return RedisCacheConfiguration.defaultCacheConfig()
|
||||
.disableCachingNullValues()
|
||||
.computePrefixWith(name -> "cache:" + name + ":")
|
||||
// .serializeValuesWith(RedisSerializationContext.SerializationPair.fromSerializer(new GenericFastJsonRedisSerializer()));
|
||||
;
|
||||
.serializeValuesWith(RedisSerializationContext.SerializationPair.fromSerializer(new GenericFastJsonRedisSerializer()));
|
||||
}
|
||||
|
||||
@Bean
|
||||
|
||||
@@ -25,12 +25,6 @@ public class TableVO {
|
||||
@Schema(description = "表备注")
|
||||
private String tableComment;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "更新时间")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
@Schema(description = "配置时间")
|
||||
private LocalDateTime configTime;
|
||||
|
||||
|
||||
@@ -156,7 +156,7 @@ public class CodeGeneratorService {
|
||||
List<TableColumnVO> tableColumns = getTableColumns(form.getTableName());
|
||||
if (null != form.getDeleteInfo() && form.getDeleteInfo().getIsSupportDelete() && !form.getDeleteInfo().getIsPhysicallyDeleted()) {
|
||||
Optional<TableColumnVO> any = tableColumns.stream().filter(e -> e.getColumnName().equals(CodeGeneratorConstant.DELETED_FLAG)).findAny();
|
||||
if (any.isEmpty()) {
|
||||
if (!any.isPresent()) {
|
||||
return ResponseDTO.userErrorParam("表结构中没有假删字段:" + CodeGeneratorConstant.DELETED_FLAG + ",请仔细排查");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,7 +33,6 @@ import org.springframework.stereotype.Service;
|
||||
import java.io.File;
|
||||
import java.io.OutputStream;
|
||||
import java.io.StringWriter;
|
||||
import java.nio.charset.Charset;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
@@ -75,6 +74,11 @@ public class CodeGeneratorTemplateService {
|
||||
map.put("js/const.js", new ConstVariableService());
|
||||
map.put("js/list.vue", new ListVariableService());
|
||||
map.put("js/form.vue", new FormVariableService());
|
||||
// ts前端
|
||||
map.put("ts/api.ts", new ApiVariableService());
|
||||
map.put("ts/const.ts", new ConstVariableService());
|
||||
map.put("ts/list.vue", new ListVariableService());
|
||||
map.put("ts/form.vue", new FormVariableService());
|
||||
}
|
||||
|
||||
public void zipGeneratedFiles(OutputStream outputStream, String tableName, CodeGeneratorConfigEntity codeGeneratorConfigEntity) {
|
||||
|
||||
@@ -103,9 +103,9 @@ public class AddFormVariableService extends CodeGenerateBaseVariableService {
|
||||
|
||||
//字典
|
||||
if (SmartStringUtil.isNotEmpty(codeField.getDict())) {
|
||||
finalFieldMap.put("dict", "\n @JsonDeserialize(using = DictValueVoDeserializer.class)");
|
||||
finalFieldMap.put("dict", "\n @JsonDeserialize(using = DictDataDeserializer.class)");
|
||||
packageList.add("import com.fasterxml.jackson.databind.annotation.JsonDeserialize;");
|
||||
packageList.add("import net.lab1024.sa.base.common.json.deserializer.DictValueVoDeserializer;");
|
||||
packageList.add("import net.lab1024.sa.base.common.json.deserializer.DictDataDeserializer;");
|
||||
}
|
||||
|
||||
//文件上传
|
||||
|
||||
@@ -106,9 +106,9 @@ public class QueryFormVariableService extends CodeGenerateBaseVariableService {
|
||||
case DICT:
|
||||
codeField = getCodeFieldByColumnName(field.getColumnNameList().get(0), form);
|
||||
if (SmartStringUtil.isNotEmpty(codeField.getDict())) {
|
||||
finalFieldMap.put("dict", "\n @JsonDeserialize(using = DictValueVoDeserializer.class)");
|
||||
finalFieldMap.put("dict", "\n @JsonDeserialize(using = DictDataDeserializer.class)");
|
||||
packageList.add("import com.fasterxml.jackson.databind.annotation.JsonDeserialize;");
|
||||
packageList.add("import net.lab1024.sa.base.common.json.deserializer.DictValueVoDeserializer;");
|
||||
packageList.add("import net.lab1024.sa.base.common.json.deserializer.DictDataDeserializer;");
|
||||
}
|
||||
finalFieldMap.put("javaType", "String");
|
||||
default:
|
||||
|
||||
@@ -118,9 +118,9 @@ public class UpdateFormVariableService extends CodeGenerateBaseVariableService {
|
||||
|
||||
//字典
|
||||
if (SmartStringUtil.isNotEmpty(codeField.getDict())) {
|
||||
finalFieldMap.put("dict", "\n @JsonDeserialize(using = DictValueVoDeserializer.class)");
|
||||
finalFieldMap.put("dict", "\n @JsonDeserialize(using = DictDataDeserializer.class)");
|
||||
packageList.add("import com.fasterxml.jackson.databind.annotation.JsonDeserialize;");
|
||||
packageList.add("import net.lab1024.sa.base.common.json.deserializer.DictValueVoDeserializer;");
|
||||
packageList.add("import net.lab1024.sa.base.common.json.deserializer.DictDataDeserializer;");
|
||||
}
|
||||
|
||||
//文件上传
|
||||
|
||||
@@ -46,7 +46,7 @@ public class ListVariableService extends CodeGenerateBaseVariableService {
|
||||
|
||||
CodeField codeField = getCodeFieldByColumnName(queryField.getColumnNameList().get(0), form);
|
||||
|
||||
if (CodeQueryFieldQueryTypeEnum.ENUM.equalsValue(queryField.getQueryTypeEnum())) {
|
||||
if (CodeQueryFieldQueryTypeEnum.ENUM.equalsValue(queryField.getQueryTypeEnum()) && SmartStringUtil.isNotBlank(codeField.getEnumName())) {
|
||||
String upperUnderscoreEnum = CaseFormat.UPPER_CAMEL.to(CaseFormat.UPPER_UNDERSCORE, codeField.getEnumName());
|
||||
objectMap.put("frontEnumName", upperUnderscoreEnum);
|
||||
frontImportSet.add("import SmartEnumSelect from '/@/components/framework/smart-enum-select/index.vue';");
|
||||
|
||||
@@ -3,6 +3,7 @@ package net.lab1024.sa.base.module.support.dict.domain.vo;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
@@ -25,6 +26,12 @@ public class DictDataVO implements Serializable {
|
||||
@Schema(description = "字典编码")
|
||||
private String dictCode;
|
||||
|
||||
@Schema(description = "字典名字")
|
||||
private String dictName;
|
||||
|
||||
@Schema(description = "字典禁用状态")
|
||||
private Integer dictDisabledFlag;
|
||||
|
||||
@Schema(description = "字典项值")
|
||||
private String dataValue;
|
||||
|
||||
|
||||
@@ -0,0 +1,78 @@
|
||||
/**
|
||||
* ${basic.description} api 封装
|
||||
*
|
||||
* @Author: ${basic.frontAuthor}
|
||||
* @Date: ${basic.frontDate}
|
||||
* @Copyright ${basic.copyright}
|
||||
*/
|
||||
import { postRequest, getRequest } from '/@/lib/axios';
|
||||
|
||||
export const ${name.lowerCamel}Api = {
|
||||
|
||||
/**
|
||||
* 分页查询 @author ${basic.frontAuthor}
|
||||
*/
|
||||
queryPage : (param) => {
|
||||
return postRequest('/${name.lowerCamel}/queryPage', param);
|
||||
},
|
||||
|
||||
/**
|
||||
* 增加 @author ${basic.frontAuthor}
|
||||
*/
|
||||
add: (param) => {
|
||||
return postRequest('/${name.lowerCamel}/add', param);
|
||||
},
|
||||
|
||||
/**
|
||||
* 修改 @author ${basic.frontAuthor}
|
||||
*/
|
||||
update: (param) => {
|
||||
return postRequest('/${name.lowerCamel}/update', param);
|
||||
},
|
||||
## ------------------ 详情 ------------------
|
||||
|
||||
#if($deleteInfo.isSupportDetail)
|
||||
/**
|
||||
* 获取详情 @author ${basic.frontAuthor}
|
||||
*/
|
||||
getDetail: (id) => {
|
||||
return getRequest(`/${name.lowerCamel}/getDetail/\${id}`);
|
||||
},
|
||||
#end
|
||||
|
||||
## ------------------ 删除 ------------------
|
||||
#if($deleteInfo.isSupportDelete)
|
||||
#if($deleteInfo.deleteEnum == 'Single')
|
||||
/**
|
||||
* 删除 @author ${basic.frontAuthor}
|
||||
*/
|
||||
delete: (id) => {
|
||||
return getRequest(`/${name.lowerCamel}/delete/${id}`);
|
||||
},
|
||||
#end
|
||||
#if($deleteInfo.deleteEnum == 'Batch')
|
||||
/**
|
||||
* 批量删除 @author ${basic.frontAuthor}
|
||||
*/
|
||||
batchDelete: (idList) => {
|
||||
return postRequest('/${name.lowerCamel}/batchDelete', idList);
|
||||
},
|
||||
#end
|
||||
#if($deleteInfo.deleteEnum == 'SingleAndBatch')
|
||||
/**
|
||||
* 删除 @author ${basic.frontAuthor}
|
||||
*/
|
||||
delete: (id) => {
|
||||
return getRequest(`/${name.lowerCamel}/delete/${id}`);
|
||||
},
|
||||
|
||||
/**
|
||||
* 批量删除 @author ${basic.frontAuthor}
|
||||
*/
|
||||
batchDelete: (idList) => {
|
||||
return postRequest('/${name.lowerCamel}/batchDelete', idList);
|
||||
},
|
||||
#end
|
||||
#end
|
||||
|
||||
};
|
||||
@@ -0,0 +1,23 @@
|
||||
/**
|
||||
* ${basic.description} 枚举
|
||||
*
|
||||
* @Author: ${basic.frontAuthor}
|
||||
* @Date: ${basic.frontDate}
|
||||
* @Copyright ${basic.copyright}
|
||||
*/
|
||||
|
||||
#foreach ($enum in $enumList)
|
||||
|
||||
/**
|
||||
* $enum.columnComment
|
||||
*/
|
||||
export const $enum.upperUnderscoreEnum = {
|
||||
|
||||
}
|
||||
#end
|
||||
|
||||
export default {
|
||||
#foreach ($enum in $enumList)
|
||||
$enum.upperUnderscoreEnum,
|
||||
#end
|
||||
};
|
||||
@@ -0,0 +1,239 @@
|
||||
<!--
|
||||
* ${basic.description}
|
||||
*
|
||||
* @Author: ${basic.frontAuthor}
|
||||
* @Date: ${basic.frontDate}
|
||||
* @Copyright ${basic.copyright}
|
||||
-->
|
||||
<template>
|
||||
<a-$!{insertAndUpdate.pageType}
|
||||
:title="form.$!{primaryKeyFieldName} ? '编辑' : '添加'"
|
||||
:width="$!{insertAndUpdate.width}"
|
||||
:open="visibleFlag"
|
||||
#if($!{insertAndUpdate.pageType} == 'drawer')
|
||||
@close="onClose"
|
||||
#else
|
||||
@cancel="onClose"
|
||||
#end
|
||||
:maskClosable="false"
|
||||
:destroyOnClose="true"
|
||||
>
|
||||
<a-form ref="formRef" :model="form" :rules="rules" :label-col="{ span: 5 }" >
|
||||
#if($insertAndUpdate.countPerLine == 1)
|
||||
#foreach ($field in $formFields)
|
||||
#if($field.frontComponent == "Input")
|
||||
<a-form-item label="$!{field.label}" name="${field.fieldName}">
|
||||
<a-input style="width: 100%" v-model:value="form.${field.fieldName}" placeholder="$!{field.label}" />
|
||||
</a-form-item>
|
||||
#end
|
||||
#if($field.frontComponent == "InputNumber")
|
||||
<a-form-item label="$!{field.label}" name="${field.fieldName}">
|
||||
<a-input-number style="width: 100%" v-model:value="form.${field.fieldName}" placeholder="$!{field.label}" />
|
||||
</a-form-item>
|
||||
#end
|
||||
#if($field.frontComponent == "Textarea")
|
||||
<a-form-item label="$!{field.label}" name="${field.fieldName}">
|
||||
<a-textarea style="width: 100%" v-model:value="form.${field.fieldName}" placeholder="$!{field.label}" />
|
||||
</a-form-item>
|
||||
#end
|
||||
#if($field.frontComponent == "BooleanSelect")
|
||||
<a-form-item label="$!{field.label}" name="${field.fieldName}">
|
||||
<BooleanSelect v-model:value="form.${field.fieldName}" style="width: 100%" />
|
||||
</a-form-item>
|
||||
#end
|
||||
#if($field.frontComponent == "SmartEnumSelect")
|
||||
<a-form-item label="$codeGeneratorTool.removeEnumDesc($!{field.label})" name="${field.fieldName}">
|
||||
<SmartEnumSelect width="100%" v-model:value="form.${field.fieldName}" enum-name="$!{field.upperUnderscoreEnum}" placeholder="$codeGeneratorTool.removeEnumDesc($!{field.label})"/>
|
||||
</a-form-item>
|
||||
#end
|
||||
#if($field.frontComponent == "DictSelect")
|
||||
<a-form-item label="$codeGeneratorTool.removeEnumDesc($!{field.label})" name="${field.fieldName}">
|
||||
<DictSelect width="100%" v-model:value="form.${field.fieldName}" dict-code="DICT_CODE_ENUM.$!{field.dict} || '$!{field.dict}'" placeholder="$!{field.label}"/>
|
||||
</a-form-item>
|
||||
#end
|
||||
#if($field.frontComponent == "Date")
|
||||
<a-form-item label="$!{field.label}" name="${field.fieldName}">
|
||||
<a-date-picker valueFormat="YYYY-MM-DD" v-model:value="form.$!{field.fieldName}" style="width: 100%" placeholder="$!{field.label}"/>
|
||||
</a-form-item>
|
||||
#end
|
||||
#if($field.frontComponent == "DateTime")
|
||||
<a-form-item label="$!{field.label}" name="${field.fieldName}">
|
||||
<a-date-picker show-time valueFormat="YYYY-MM-DD HH:mm:ss" v-model:value="form.$!{field.fieldName}" style="width: 100%" placeholder="$!{field.label}" />
|
||||
</a-form-item>
|
||||
#end
|
||||
#if($field.frontComponent == "FileUpload")
|
||||
<a-form-item label="$!{field.label}" name="${field.fieldName}">
|
||||
<FileUpload
|
||||
:defaultFileList="form.$!{field.fieldName}"
|
||||
:folder="FILE_FOLDER_TYPE_ENUM.COMMON.value"
|
||||
buttonText="上传 $!{field.label}"
|
||||
listType="text"
|
||||
@change="e => form.$!{field.fieldName} = e"
|
||||
/>
|
||||
</a-form-item>
|
||||
#end
|
||||
#end
|
||||
#end
|
||||
#if($insertAndUpdate.countPerLine > 1)
|
||||
<a-row>
|
||||
#set($span=24 / $!insertAndUpdate.countPerLine )
|
||||
#foreach ($field in $formFields)
|
||||
<a-col :span="$!{span}">
|
||||
#if($field.frontComponent == "Input")
|
||||
<a-form-item label="$!{field.label}" name="${field.fieldName}">
|
||||
<a-input style="width: 100%" v-model:value="form.${field.fieldName}" placeholder="$!{field.label}" />
|
||||
</a-form-item>
|
||||
#end
|
||||
#if($field.frontComponent == "InputNumber")
|
||||
<a-form-item label="$!{field.label}" name="${field.fieldName}">
|
||||
<a-input-number style="width: 100%" v-model:value="form.${field.fieldName}" placeholder="$!{field.label}" />
|
||||
</a-form-item>
|
||||
#end
|
||||
#if($field.frontComponent == "Textarea")
|
||||
<a-form-item label="$!{field.label}" name="${field.fieldName}">
|
||||
<a-textarea style="width: 100%" v-model:value="form.${field.fieldName}" placeholder="$!{field.label}" />
|
||||
</a-form-item>
|
||||
#end
|
||||
#if($field.frontComponent == "BooleanSelect")
|
||||
<a-form-item label="$!{field.label}" name="${field.fieldName}">
|
||||
<BooleanSelect v-model:value="form.${field.fieldName}" style="width: 100%" />
|
||||
</a-form-item>
|
||||
#end
|
||||
#if($field.frontComponent == "SmartEnumSelect")
|
||||
<a-form-item label="$codeGeneratorTool.removeEnumDesc($!{field.label})" name="${field.fieldName}">
|
||||
<SmartEnumSelect width="100%" v-model:value="form.${field.fieldName}" enum-name="$!{field.upperUnderscoreEnum}" placeholder="$codeGeneratorTool.removeEnumDesc($!{field.label})"/>
|
||||
</a-form-item>
|
||||
#end
|
||||
#if($field.frontComponent == "DictSelect")
|
||||
<a-form-item label="$codeGeneratorTool.removeEnumDesc($!{field.label})" name="${field.fieldName}">
|
||||
<DictSelect width="100%" v-model:value="form.${field.fieldName}" dict-code="DICT_CODE_ENUM.$!{field.dict} || '$!{field.dict}'" placeholder="$!{field.label}"/>
|
||||
</a-form-item>
|
||||
#end
|
||||
#if($field.frontComponent == "Date")
|
||||
<a-form-item label="$!{field.label}" name="${field.fieldName}">
|
||||
<a-date-picker valueFormat="YYYY-MM-DD" v-model:value="form.$!{field.fieldName}" style="width: 100%" placeholder="$!{field.label}"/>
|
||||
</a-form-item>
|
||||
#end
|
||||
#if($field.frontComponent == "DateTime")
|
||||
<a-form-item label="$!{field.label}" name="${field.fieldName}">
|
||||
<a-date-picker show-time valueFormat="YYYY-MM-DD HH:mm:ss" v-model:value="form.$!{field.fieldName}" style="width: 100%" placeholder="$!{field.label}" />
|
||||
</a-form-item>
|
||||
#end
|
||||
#if($field.frontComponent == "FileUpload")
|
||||
<a-form-item label="$!{field.label}" name="${field.fieldName}">
|
||||
<FileUpload
|
||||
:defaultFileList="form.$!{field.fieldName}"
|
||||
:folder="FILE_FOLDER_TYPE_ENUM.COMMON.value"
|
||||
buttonText="上传 $!{field.label}"
|
||||
listType="text"
|
||||
@change="e => form.$!{field.fieldName} = e"
|
||||
/>
|
||||
</a-form-item>
|
||||
#end
|
||||
</a-col>
|
||||
#end
|
||||
</a-row>
|
||||
#end
|
||||
</a-form>
|
||||
|
||||
<template #footer>
|
||||
<a-space>
|
||||
<a-button @click="onClose">取消</a-button>
|
||||
<a-button type="primary" @click="onSubmit">保存</a-button>
|
||||
</a-space>
|
||||
</template>
|
||||
</a-$!{insertAndUpdate.pageType}>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { reactive, ref, nextTick } from 'vue';
|
||||
import _ from 'lodash';
|
||||
import { message } from 'ant-design-vue';
|
||||
import { SmartLoading } from '/@/components/framework/smart-loading';
|
||||
import { $!{name.lowerCamel}Api } from '/@/api/business/$!{name.lowerHyphenCamel}/$!{name.lowerHyphenCamel}-api';
|
||||
import { smartSentry } from '/@/lib/smart-sentry';
|
||||
#foreach ($import in $frontImportList)
|
||||
$!{import}
|
||||
#end
|
||||
|
||||
// ------------------------ 事件 ------------------------
|
||||
|
||||
const emits = defineEmits(['reloadList']);
|
||||
|
||||
// ------------------------ 显示与隐藏 ------------------------
|
||||
// 是否显示
|
||||
const visibleFlag = ref(false);
|
||||
|
||||
function show(rowData) {
|
||||
Object.assign(form, formDefault);
|
||||
if (rowData && !_.isEmpty(rowData)) {
|
||||
Object.assign(form, rowData);
|
||||
}
|
||||
// 使用字典时把下面这注释修改成自己的字典字段 有多个字典字段就复制多份同理修改 不然打开表单时不显示字典初始值
|
||||
// if (form.status && form.status.length > 0) {
|
||||
// form.status = form.status.map((e) => e.valueCode);
|
||||
// }
|
||||
visibleFlag.value = true;
|
||||
nextTick(() => {
|
||||
formRef.value.clearValidate();
|
||||
});
|
||||
}
|
||||
|
||||
function onClose() {
|
||||
Object.assign(form, formDefault);
|
||||
visibleFlag.value = false;
|
||||
}
|
||||
|
||||
// ------------------------ 表单 ------------------------
|
||||
|
||||
// 组件ref
|
||||
const formRef = ref();
|
||||
|
||||
const formDefault = {
|
||||
#foreach ($field in $formFields)
|
||||
$!{field.fieldName}: undefined, //$!{field.label}
|
||||
#end
|
||||
};
|
||||
|
||||
let form = reactive({ ...formDefault });
|
||||
|
||||
const rules = {
|
||||
#foreach ($field in $formFields)
|
||||
#if($field.requiredFlag)
|
||||
$!{field.fieldName}: [{ required: true, message: '$!{field.label} 必填' }],
|
||||
#end
|
||||
#end
|
||||
};
|
||||
|
||||
// 点击确定,验证表单
|
||||
async function onSubmit() {
|
||||
try {
|
||||
await formRef.value.validateFields();
|
||||
save();
|
||||
} catch (err) {
|
||||
message.error('参数验证错误,请仔细填写表单数据!');
|
||||
}
|
||||
}
|
||||
|
||||
// 新建、编辑API
|
||||
async function save() {
|
||||
SmartLoading.show();
|
||||
try {
|
||||
if (form.$!{primaryKeyFieldName}) {
|
||||
await $!{name.lowerCamel}Api.update(form);
|
||||
} else {
|
||||
await $!{name.lowerCamel}Api.add(form);
|
||||
}
|
||||
message.success('操作成功');
|
||||
emits('reloadList');
|
||||
onClose();
|
||||
} catch (err) {
|
||||
smartSentry.captureError(err);
|
||||
} finally {
|
||||
SmartLoading.hide();
|
||||
}
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
show,
|
||||
});
|
||||
</script>
|
||||
@@ -0,0 +1,348 @@
|
||||
<!--
|
||||
* ${basic.description}
|
||||
*
|
||||
* @Author: ${basic.frontAuthor}
|
||||
* @Date: ${basic.frontDate}
|
||||
* @Copyright ${basic.copyright}
|
||||
-->
|
||||
<template>
|
||||
<!---------- 查询表单form begin ----------->
|
||||
<a-form class="smart-query-form">
|
||||
<a-row class="smart-query-form-row">
|
||||
#foreach ($field in $queryFields)
|
||||
#if($field.queryTypeEnum == "Like")
|
||||
<a-form-item label="${field.label}" class="smart-query-form-item">
|
||||
<a-input style="width: ${field.width}" v-model:value="queryForm.${field.fieldName}" placeholder="${field.label}" />
|
||||
</a-form-item>
|
||||
#end
|
||||
#if($field.queryTypeEnum == "Equal")
|
||||
<a-form-item label="${field.label}" class="smart-query-form-item">
|
||||
<a-input style="width: ${field.width}" v-model:value="queryForm.${field.fieldName}" placeholder="${field.label}" />
|
||||
</a-form-item>
|
||||
#end
|
||||
#if($field.queryTypeEnum == "Dict")
|
||||
<a-form-item label="${field.label}" class="smart-query-form-item">
|
||||
<DictSelect dict-code="DICT_CODE_ENUM.$!{field.dict} || '$!{field.dict}'" placeholder="${field.label}" v-model:value="queryForm.${field.fieldName}" width="${field.width}" />
|
||||
</a-form-item>
|
||||
#end
|
||||
#if($field.queryTypeEnum == "Enum")
|
||||
<a-form-item label="$codeGeneratorTool.removeEnumDesc(${field.label})" class="smart-query-form-item">
|
||||
<SmartEnumSelect width="${field.width}" v-model:value="queryForm.${field.fieldName}" enum-name="$!{field.frontEnumName}" placeholder="$codeGeneratorTool.removeEnumDesc(${field.label})"/>
|
||||
</a-form-item>
|
||||
#end
|
||||
#if($field.queryTypeEnum == "Date")
|
||||
<a-form-item label="${field.label}" class="smart-query-form-item">
|
||||
<a-date-picker valueFormat="YYYY-MM-DD" v-model:value="queryForm.$!{field.fieldName}" style="width: ${field.width}" />
|
||||
</a-form-item>
|
||||
#end
|
||||
#if($field.queryTypeEnum == "DateRange")
|
||||
<a-form-item label="${field.label}" class="smart-query-form-item">
|
||||
<a-range-picker v-model:value="queryForm.$!{field.fieldName}" :presets="defaultTimeRanges" style="width: ${field.width}" @change="onChange$codeGeneratorTool.lowerCamel2UpperCamel(${field.fieldName})" />
|
||||
</a-form-item>
|
||||
#end
|
||||
#end
|
||||
<a-form-item class="smart-query-form-item">
|
||||
<a-button type="primary" @click="onSearch">
|
||||
<template #icon>
|
||||
<SearchOutlined />
|
||||
</template>
|
||||
查询
|
||||
</a-button>
|
||||
<a-button @click="resetQuery" class="smart-margin-left10">
|
||||
<template #icon>
|
||||
<ReloadOutlined />
|
||||
</template>
|
||||
重置
|
||||
</a-button>
|
||||
</a-form-item>
|
||||
</a-row>
|
||||
</a-form>
|
||||
<!---------- 查询表单form end ----------->
|
||||
|
||||
<a-card size="small" :bordered="false" :hoverable="true">
|
||||
<!---------- 表格操作行 begin ----------->
|
||||
<a-row class="smart-table-btn-block">
|
||||
<div class="smart-table-operate-block">
|
||||
#if($insertAndUpdate.isSupportInsertAndUpdate)
|
||||
<a-button @click="showForm" type="primary" size="small">
|
||||
<template #icon>
|
||||
<PlusOutlined />
|
||||
</template>
|
||||
新建
|
||||
</a-button>
|
||||
#end
|
||||
#if($deleteInfo.isSupportDelete && ($deleteInfo.deleteEnum == "Batch"||$deleteInfo.deleteEnum == "SingleAndBatch"))
|
||||
<a-button @click="confirmBatchDelete" type="primary" danger size="small" :disabled="selectedRowKeyList.length == 0">
|
||||
<template #icon>
|
||||
<DeleteOutlined />
|
||||
</template>
|
||||
批量删除
|
||||
</a-button>
|
||||
#end
|
||||
</div>
|
||||
<div class="smart-table-setting-block">
|
||||
<TableOperator v-model="columns" :tableId="null" :refresh="queryData" />
|
||||
</div>
|
||||
</a-row>
|
||||
<!---------- 表格操作行 end ----------->
|
||||
|
||||
<!---------- 表格 begin ----------->
|
||||
<a-table
|
||||
size="small"
|
||||
:scroll="{ y: 800 }"
|
||||
:dataSource="tableData"
|
||||
:columns="columns"
|
||||
rowKey="$!{primaryKeyFieldName}"
|
||||
bordered
|
||||
:loading="tableLoading"
|
||||
:pagination="false"
|
||||
#if($deleteInfo.isSupportDelete && ($deleteInfo.deleteEnum == "Batch"||$deleteInfo.deleteEnum == "SingleAndBatch"))
|
||||
:row-selection="{ selectedRowKeys: selectedRowKeyList, onChange: onSelectChange }"
|
||||
#end
|
||||
>
|
||||
<template #bodyCell="{ text, record, column }">
|
||||
|
||||
#foreach ($field in $listFields)
|
||||
#if($field.frontComponent == "FileUpload")
|
||||
<template v-if="column.dataIndex === '$field.fieldName'">
|
||||
<FilePreview :file-list="text" type="picture" />
|
||||
</template>
|
||||
#end
|
||||
#end
|
||||
#foreach ($field in $listFields)
|
||||
#if($field.frontEnumPlugin)
|
||||
<template v-if="column.dataIndex === '$!{field.fieldName}'">
|
||||
<span>{{ $!{field.frontEnumPlugin} }}</span>
|
||||
</template>
|
||||
#end
|
||||
#end
|
||||
#foreach ($field in $listFields)
|
||||
#if($field.dict)
|
||||
<template v-if="column.dataIndex === '$!{field.fieldName}'">
|
||||
<DictLabel :dict-code="DICT_CODE_ENUM.$!{field.dict} || '$!{field.dict}'" :data-value="text" />
|
||||
</template>
|
||||
#end
|
||||
#end
|
||||
|
||||
<template v-if="column.dataIndex === 'action'">
|
||||
<div class="smart-table-operate">
|
||||
#if($insertAndUpdate.isSupportInsertAndUpdate)
|
||||
<a-button @click="showForm(record)" type="link">编辑</a-button>
|
||||
#end
|
||||
#if($deleteInfo.isSupportDelete && ($deleteInfo.deleteEnum == "Single"||$deleteInfo.deleteEnum == "SingleAndBatch"))
|
||||
<a-button @click="onDelete(record)" danger type="link">删除</a-button>
|
||||
#end
|
||||
</div>
|
||||
</template>
|
||||
</template>
|
||||
</a-table>
|
||||
<!---------- 表格 end ----------->
|
||||
|
||||
<div class="smart-query-table-page">
|
||||
<a-pagination
|
||||
showSizeChanger
|
||||
showQuickJumper
|
||||
show-less-items
|
||||
:pageSizeOptions="PAGE_SIZE_OPTIONS"
|
||||
:defaultPageSize="queryForm.pageSize"
|
||||
v-model:current="queryForm.pageNum"
|
||||
v-model:pageSize="queryForm.pageSize"
|
||||
:total="total"
|
||||
@change="queryData"
|
||||
@showSizeChange="queryData"
|
||||
:show-total="(total) => `共${total}条`"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<$!{name.upperCamel}Form ref="formRef" @reloadList="queryData"/>
|
||||
|
||||
</a-card>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { reactive, ref, onMounted } from 'vue';
|
||||
import { message, Modal } from 'ant-design-vue';
|
||||
import { SmartLoading } from '/@/components/framework/smart-loading';
|
||||
import { $!{name.lowerCamel}Api } from '/@/api/business/$!{name.lowerHyphenCamel}/$!{name.lowerHyphenCamel}-api';
|
||||
import { PAGE_SIZE_OPTIONS } from '/@/constants/common-const';
|
||||
import { smartSentry } from '/@/lib/smart-sentry';
|
||||
import TableOperator from '/@/components/support/table-operator/index.vue';
|
||||
#foreach ($import in $frontImportList)
|
||||
$!{import}
|
||||
#end
|
||||
|
||||
// ---------------------------- 表格列 ----------------------------
|
||||
|
||||
const columns = ref([
|
||||
#foreach ($field in $tableFields)
|
||||
#if($field.showFlag)
|
||||
{
|
||||
title: '$!{field.label}',
|
||||
dataIndex: '$!{field.fieldName}',
|
||||
ellipsis: $!{field.ellipsisFlag},
|
||||
#if(${field.width} > 0)
|
||||
width: $!{field.width},
|
||||
#end
|
||||
},
|
||||
#end
|
||||
#end
|
||||
#if($insertAndUpdate.isSupportInsertAndUpdate || $insertAndUpdate.isSupportInsertAndUpdate)
|
||||
{
|
||||
title: '操作',
|
||||
dataIndex: 'action',
|
||||
fixed: 'right',
|
||||
width: 90,
|
||||
},
|
||||
#end
|
||||
]);
|
||||
|
||||
// ---------------------------- 查询数据表单和方法 ----------------------------
|
||||
|
||||
const queryFormState = {
|
||||
#foreach ($field in $queryFields)
|
||||
#if($field.queryTypeEnum == "DateRange")
|
||||
$!{field.fieldName}: [], //$!{field.label}
|
||||
$!{field.fieldName}Begin: undefined, //$!{field.label} 开始
|
||||
$!{field.fieldName}End: undefined, //$!{field.label} 结束
|
||||
#end
|
||||
#if($field.queryTypeEnum != "DateRange")
|
||||
$!{field.fieldName}: undefined, //$!{field.label}
|
||||
#end
|
||||
#end
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
};
|
||||
// 查询表单form
|
||||
const queryForm = reactive({ ...queryFormState });
|
||||
// 表格加载loading
|
||||
const tableLoading = ref(false);
|
||||
// 表格数据
|
||||
const tableData = ref([]);
|
||||
// 总数
|
||||
const total = ref(0);
|
||||
|
||||
// 重置查询条件
|
||||
function resetQuery() {
|
||||
let pageSize = queryForm.pageSize;
|
||||
Object.assign(queryForm, queryFormState);
|
||||
queryForm.pageSize = pageSize;
|
||||
queryData();
|
||||
}
|
||||
|
||||
// 搜索
|
||||
function onSearch(){
|
||||
queryForm.pageNum = 1;
|
||||
queryData();
|
||||
}
|
||||
|
||||
// 查询数据
|
||||
async function queryData() {
|
||||
tableLoading.value = true;
|
||||
try {
|
||||
let queryResult = await $!{name.lowerCamel}Api.queryPage(queryForm);
|
||||
tableData.value = queryResult.data.list;
|
||||
total.value = queryResult.data.total;
|
||||
} catch (e) {
|
||||
smartSentry.captureError(e);
|
||||
} finally {
|
||||
tableLoading.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
#foreach ($field in $queryFields)
|
||||
#if($field.queryTypeEnum == "DateRange")
|
||||
function onChange$codeGeneratorTool.lowerCamel2UpperCamel(${field.fieldName})(dates, dateStrings){
|
||||
queryForm.$!{field.fieldName}Begin = dateStrings[0];
|
||||
queryForm.$!{field.fieldName}End = dateStrings[1];
|
||||
}
|
||||
|
||||
#end
|
||||
#end
|
||||
|
||||
onMounted(queryData);
|
||||
|
||||
#if($insertAndUpdate.isSupportInsertAndUpdate)
|
||||
// ---------------------------- 添加/修改 ----------------------------
|
||||
const formRef = ref();
|
||||
|
||||
function showForm(data) {
|
||||
formRef.value.show(data);
|
||||
}
|
||||
#end
|
||||
|
||||
#if($deleteInfo.isSupportDelete)
|
||||
#if($deleteInfo.deleteEnum == "Batch" || $deleteInfo.deleteEnum == "SingleAndBatch")
|
||||
// ---------------------------- 单个删除 ----------------------------
|
||||
//确认删除
|
||||
function onDelete(data){
|
||||
Modal.confirm({
|
||||
title: '提示',
|
||||
content: '确定要删除选吗?',
|
||||
okText: '删除',
|
||||
okType: 'danger',
|
||||
onOk() {
|
||||
requestDelete(data);
|
||||
},
|
||||
cancelText: '取消',
|
||||
onCancel() {},
|
||||
});
|
||||
}
|
||||
|
||||
//请求删除
|
||||
async function requestDelete(data){
|
||||
SmartLoading.show();
|
||||
try {
|
||||
let deleteForm = {
|
||||
goodsIdList: selectedRowKeyList.value,
|
||||
};
|
||||
await $!{name.lowerCamel}Api.delete(data.$!{primaryKeyFieldName});
|
||||
message.success('删除成功');
|
||||
queryData();
|
||||
} catch (e) {
|
||||
smartSentry.captureError(e);
|
||||
} finally {
|
||||
SmartLoading.hide();
|
||||
}
|
||||
}
|
||||
#end
|
||||
|
||||
#if($deleteInfo.deleteEnum == "Single" || $deleteInfo.deleteEnum == "SingleAndBatch")
|
||||
// ---------------------------- 批量删除 ----------------------------
|
||||
|
||||
// 选择表格行
|
||||
const selectedRowKeyList = ref([]);
|
||||
|
||||
function onSelectChange(selectedRowKeys) {
|
||||
selectedRowKeyList.value = selectedRowKeys;
|
||||
}
|
||||
|
||||
// 批量删除
|
||||
function confirmBatchDelete() {
|
||||
Modal.confirm({
|
||||
title: '提示',
|
||||
content: '确定要批量删除这些数据吗?',
|
||||
okText: '删除',
|
||||
okType: 'danger',
|
||||
onOk() {
|
||||
requestBatchDelete();
|
||||
},
|
||||
cancelText: '取消',
|
||||
onCancel() {},
|
||||
});
|
||||
}
|
||||
|
||||
//请求批量删除
|
||||
async function requestBatchDelete() {
|
||||
try {
|
||||
SmartLoading.show();
|
||||
await $!{name.lowerCamel}Api.batchDelete(selectedRowKeyList.value);
|
||||
message.success('删除成功');
|
||||
queryData();
|
||||
} catch (e) {
|
||||
smartSentry.captureError(e);
|
||||
} finally {
|
||||
SmartLoading.hide();
|
||||
}
|
||||
}
|
||||
#end
|
||||
#end
|
||||
</script>
|
||||
@@ -21,8 +21,6 @@
|
||||
select
|
||||
`tables`.table_name,
|
||||
`tables`.table_comment,
|
||||
`tables`.create_time,
|
||||
`tables`.update_time,
|
||||
t_code_generator_config.update_time configTime
|
||||
from information_schema.tables `tables`
|
||||
left join t_code_generator_config on `tables`.table_name = t_code_generator_config.table_name
|
||||
|
||||
@@ -12,7 +12,9 @@
|
||||
|
||||
<select id="getAll" resultType="net.lab1024.sa.base.module.support.dict.domain.vo.DictDataVO">
|
||||
select t_dict_data.*,
|
||||
t_dict.dict_code
|
||||
t_dict.dict_code,
|
||||
t_dict.dict_name,
|
||||
t_dict.disabled_flag dictDisabledFlag
|
||||
from t_dict_data
|
||||
left join t_dict on t_dict_data.dict_id = t_dict.dict_id
|
||||
order by t_dict_data.sort_order desc
|
||||
|
||||
@@ -134,7 +134,7 @@ reload:
|
||||
sa-token:
|
||||
# token 名称(同时也是 cookie 名称)
|
||||
token-name: Authorization
|
||||
# token 前缀 例如:Bearer
|
||||
# token 前缀 例如:Bear
|
||||
token-prefix: Bearer
|
||||
# token 有效期(单位:秒) 默认30天(2592000秒),-1 代表永久有效
|
||||
timeout: 2592000
|
||||
|
||||
@@ -102,6 +102,7 @@ springdoc:
|
||||
enabled: true # 开关
|
||||
doc-expansion: none #关闭展开
|
||||
tags-sorter: alpha
|
||||
server-base-url: https://preview.smartadmin.vip/smart-admin-api
|
||||
api-docs:
|
||||
enabled: true # 开关
|
||||
knife4j:
|
||||
@@ -132,7 +133,7 @@ reload:
|
||||
sa-token:
|
||||
# token 名称(同时也是 cookie 名称)
|
||||
token-name: Authorization
|
||||
# token 前缀 例如:Bearer
|
||||
# token 前缀 例如:Bear
|
||||
token-prefix: Bearer
|
||||
# token 有效期(单位:秒) 默认30天(2592000秒),-1 代表永久有效
|
||||
timeout: 2592000
|
||||
|
||||
@@ -134,7 +134,7 @@ reload:
|
||||
sa-token:
|
||||
# token 名称(同时也是 cookie 名称)
|
||||
token-name: Authorization
|
||||
# token 前缀 例如:Bearer
|
||||
# token 前缀 例如:Bear
|
||||
token-prefix: Bearer
|
||||
# token 有效期(单位:秒) 默认30天(2592000秒),-1 代表永久有效
|
||||
timeout: 2592000
|
||||
|
||||
Reference in New Issue
Block a user