mirror of
https://gitee.com/lab1024/smart-admin.git
synced 2026-01-26 00:26:21 +08:00
v3.29 【优化】优化代码生成;【优化】优化redis缓存key;【优化】员工禁用强制下线bug;【优化】本地文件使用File.separator
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
|
||||
**<font color="#DC143C">国内首个满足《网络安全-三级等保》、《数据安全》</font>** 功能要求,支持登录限制、接口国产加解密、数据脱敏等一系列安全要求。
|
||||
|
||||
**<font color="#DC143C">支持国产数据库:【达梦、金仓、南大通用、海量数据、神州通用、OceanBase、GaussDB 高斯、阿里PolarDB、GoldenDB】等,主流数据库:【Mysql、PostgreSQL、SqlServer】等</font>**
|
||||
**<font color="#DC143C">支持国产数据库:【达梦、金仓、南大通用、海量数据、神州通用、OceanBase、GaussDB 高斯、阿里PolarDB、GoldenDB】等,主流数据库:【Mysql、PostgreSQL、SqlServer、Oracle】等</font>**
|
||||
|
||||
**<font color="#DC143C">前端提供JavaScript和TypeScript双版本,后端提供Java8+SpringBoot2.X和Java17+SpringBoot3.X 双版本</font>**。
|
||||
|
||||
|
||||
@@ -36,7 +36,6 @@ public class DepartmentEntity {
|
||||
/**
|
||||
* 负责人员工 id
|
||||
*/
|
||||
@TableField(updateStrategy = FieldStrategy.NEVER)
|
||||
private Long managerId;
|
||||
|
||||
/**
|
||||
|
||||
@@ -274,12 +274,12 @@ public class EmployeeService {
|
||||
if (null == employeeEntity) {
|
||||
return ResponseDTO.error(UserErrorCode.DATA_NOT_EXIST);
|
||||
}
|
||||
|
||||
// 更新禁用状态
|
||||
employeeDao.updateDisableFlag(employeeId, !employeeEntity.getDisabledFlag());
|
||||
|
||||
if (employeeEntity.getDisabledFlag()) {
|
||||
// 强制退出登录
|
||||
StpUtil.logout(UserTypeEnum.ADMIN_EMPLOYEE.getValue() + StringConst.COLON + employeeId);
|
||||
}
|
||||
// 强制退出登录
|
||||
StpUtil.logout(UserTypeEnum.ADMIN_EMPLOYEE.getValue() + StringConst.COLON + employeeId);
|
||||
|
||||
return ResponseDTO.ok();
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
SELECT * FROM t_goods
|
||||
<where>
|
||||
<if test="query.searchWord != null and query.searchWord !=''">
|
||||
INSTR(goods_name,#{query.searchWord})
|
||||
AND INSTR(goods_name,#{query.searchWord})
|
||||
</if>
|
||||
<if test="query.place != null">
|
||||
AND INSTR(place,#{query.place})
|
||||
|
||||
@@ -23,8 +23,11 @@ import org.springframework.data.redis.serializer.RedisSerializationContext;
|
||||
public class CacheConfig {
|
||||
|
||||
private static final String REDIS_CACHE = "redis";
|
||||
|
||||
private static final String CAFFEINE_CACHE = "caffeine";
|
||||
|
||||
public static final String REDIS_CACHE_PREFIX = "cache";
|
||||
|
||||
|
||||
@Resource
|
||||
private RedisConnectionFactory redisConnectionFactory;
|
||||
@@ -45,7 +48,7 @@ public class CacheConfig {
|
||||
RedisCacheConfiguration defaultCacheConfig = RedisCacheConfiguration.defaultCacheConfig()
|
||||
// 禁止缓存 null 值,避免缓存穿透
|
||||
.disableCachingNullValues()
|
||||
.computePrefixWith(name -> "cache:" + name + ":")
|
||||
.computePrefixWith(name -> REDIS_CACHE_PREFIX + name + ":")
|
||||
// 使用 FastJSON 序列化缓存值,支持复杂对象
|
||||
.serializeValuesWith(RedisSerializationContext.SerializationPair
|
||||
.fromSerializer(new GenericFastJsonRedisSerializer()));
|
||||
|
||||
@@ -81,7 +81,7 @@ public class FileConfig implements WebMvcConfigurer {
|
||||
StaticCredentialsProvider.create(
|
||||
AwsBasicCredentials.create(accessKey, secretKey)))
|
||||
.serviceConfiguration(S3Configuration.builder()
|
||||
.pathStyleAccessEnabled(true)
|
||||
.pathStyleAccessEnabled(false)
|
||||
.chunkedEncodingEnabled(false)
|
||||
.build())
|
||||
.build();
|
||||
|
||||
@@ -3,6 +3,7 @@ package net.lab1024.sa.base.module.support.cache;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.google.common.collect.Lists;
|
||||
import jakarta.annotation.Resource;
|
||||
import net.lab1024.sa.base.config.CacheConfig;
|
||||
import net.lab1024.sa.base.constant.ReloadConst;
|
||||
import net.lab1024.sa.base.module.support.reload.core.annoation.SmartReload;
|
||||
import org.springframework.data.redis.cache.RedisCache;
|
||||
@@ -49,7 +50,7 @@ public class RedisCacheServiceImpl implements CacheService {
|
||||
// 获取 Redis 连接
|
||||
RedisConnection connection = redisConnectionFactory.getConnection();
|
||||
// 根据指定的 key 模式获取所有匹配的键
|
||||
Set<byte[]> keys = connection.keyCommands().keys((cacheName + ":*").getBytes());
|
||||
Set<byte[]> keys = connection.keyCommands().keys((CacheConfig.REDIS_CACHE_PREFIX + ":" + cacheName + "*").getBytes());
|
||||
|
||||
if (keys != null) {
|
||||
return keys.stream().map(key -> {
|
||||
|
||||
@@ -78,8 +78,8 @@ public class FileStorageLocalServiceImpl implements IFileStorageService {
|
||||
// 目录不存在,新建
|
||||
directory.mkdirs();
|
||||
}
|
||||
if (!path.endsWith("/")) {
|
||||
path = path + "/";
|
||||
if (!path.endsWith(File.separator)) {
|
||||
path = path + File.separator;
|
||||
}
|
||||
FileUploadVO fileUploadVO = new FileUploadVO();
|
||||
//原文件名
|
||||
|
||||
@@ -3,8 +3,10 @@ package net.lab1024.sa.base.module.support.loginlog.domain;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@@ -20,6 +22,8 @@ import java.time.LocalDateTime;
|
||||
@TableName("t_login_log")
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class LoginLogEntity {
|
||||
|
||||
@TableId(type = IdType.AUTO)
|
||||
|
||||
@@ -3,8 +3,10 @@ package net.lab1024.sa.base.module.support.securityprotect.domain;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@@ -21,6 +23,8 @@ import java.time.LocalDateTime;
|
||||
@Data
|
||||
@Builder
|
||||
@TableName("t_login_fail")
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class LoginFailEntity {
|
||||
|
||||
|
||||
|
||||
@@ -36,7 +36,6 @@ public class DepartmentEntity {
|
||||
/**
|
||||
* 负责人员工 id
|
||||
*/
|
||||
@TableField(updateStrategy = FieldStrategy.NEVER)
|
||||
private Long managerId;
|
||||
|
||||
/**
|
||||
|
||||
@@ -275,12 +275,12 @@ public class EmployeeService {
|
||||
if (null == employeeEntity) {
|
||||
return ResponseDTO.error(UserErrorCode.DATA_NOT_EXIST);
|
||||
}
|
||||
|
||||
// 更新禁用状态
|
||||
employeeDao.updateDisableFlag(employeeId, !employeeEntity.getDisabledFlag());
|
||||
|
||||
if (employeeEntity.getDisabledFlag()) {
|
||||
// 强制退出登录
|
||||
StpUtil.logout(UserTypeEnum.ADMIN_EMPLOYEE.getValue() + StringConst.COLON + employeeId);
|
||||
}
|
||||
// 强制退出登录
|
||||
StpUtil.logout(UserTypeEnum.ADMIN_EMPLOYEE.getValue() + StringConst.COLON + employeeId);
|
||||
|
||||
return ResponseDTO.ok();
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
SELECT * FROM t_goods
|
||||
<where>
|
||||
<if test="query.searchWord != null and query.searchWord !=''">
|
||||
INSTR(goods_name,#{query.searchWord})
|
||||
AND INSTR(goods_name,#{query.searchWord})
|
||||
</if>
|
||||
<if test="query.place != null">
|
||||
AND INSTR(place,#{query.place})
|
||||
|
||||
@@ -24,8 +24,11 @@ import javax.annotation.Resource;
|
||||
public class CacheConfig {
|
||||
|
||||
private static final String REDIS_CACHE = "redis";
|
||||
|
||||
private static final String CAFFEINE_CACHE = "caffeine";
|
||||
|
||||
public static final String REDIS_CACHE_PREFIX = "cache";
|
||||
|
||||
|
||||
@Resource
|
||||
private RedisConnectionFactory redisConnectionFactory;
|
||||
@@ -46,7 +49,7 @@ public class CacheConfig {
|
||||
RedisCacheConfiguration defaultCacheConfig = RedisCacheConfiguration.defaultCacheConfig()
|
||||
// 禁止缓存 null 值,避免缓存穿透
|
||||
.disableCachingNullValues()
|
||||
.computePrefixWith(name -> "cache:" + name + ":")
|
||||
.computePrefixWith(name -> REDIS_CACHE_PREFIX + name + ":")
|
||||
// 使用 FastJSON 序列化缓存值,支持复杂对象
|
||||
.serializeValuesWith(RedisSerializationContext.SerializationPair
|
||||
.fromSerializer(new GenericFastJsonRedisSerializer()));
|
||||
@@ -56,16 +59,16 @@ public class CacheConfig {
|
||||
}
|
||||
|
||||
|
||||
@Bean
|
||||
@ConditionalOnProperty(prefix = "spring.cache", name = {"type"}, havingValue = REDIS_CACHE)
|
||||
public CacheService redisCacheService() {
|
||||
return new RedisCacheServiceImpl();
|
||||
}
|
||||
@Bean
|
||||
@ConditionalOnProperty(prefix = "spring.cache", name = {"type"}, havingValue = REDIS_CACHE)
|
||||
public CacheService redisCacheService() {
|
||||
return new RedisCacheServiceImpl();
|
||||
}
|
||||
|
||||
@Bean
|
||||
@ConditionalOnProperty(prefix = "spring.cache", name = {"type"}, havingValue = CAFFEINE_CACHE)
|
||||
public CacheService caffeineCacheService() {
|
||||
return new CaffeineCacheServiceImpl();
|
||||
}
|
||||
@Bean
|
||||
@ConditionalOnProperty(prefix = "spring.cache", name = {"type"}, havingValue = CAFFEINE_CACHE)
|
||||
public CacheService caffeineCacheService() {
|
||||
return new CaffeineCacheServiceImpl();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -81,7 +81,7 @@ public class FileConfig implements WebMvcConfigurer {
|
||||
StaticCredentialsProvider.create(
|
||||
AwsBasicCredentials.create(accessKey, secretKey)))
|
||||
.serviceConfiguration(S3Configuration.builder()
|
||||
.pathStyleAccessEnabled(true)
|
||||
.pathStyleAccessEnabled(false)
|
||||
.chunkedEncodingEnabled(false)
|
||||
.build())
|
||||
.build();
|
||||
|
||||
@@ -2,6 +2,7 @@ package net.lab1024.sa.base.module.support.cache;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.google.common.collect.Lists;
|
||||
import net.lab1024.sa.base.config.CacheConfig;
|
||||
import net.lab1024.sa.base.constant.ReloadConst;
|
||||
import net.lab1024.sa.base.module.support.reload.core.annoation.SmartReload;
|
||||
import org.springframework.data.redis.cache.RedisCache;
|
||||
@@ -49,7 +50,7 @@ public class RedisCacheServiceImpl implements CacheService {
|
||||
// 获取 Redis 连接
|
||||
RedisConnection connection = redisConnectionFactory.getConnection();
|
||||
// 根据指定的 key 模式获取所有匹配的键
|
||||
Set<byte[]> keys = connection.keyCommands().keys((cacheName + ":*").getBytes());
|
||||
Set<byte[]> keys = connection.keyCommands().keys((CacheConfig.REDIS_CACHE_PREFIX + ":" + cacheName + "*").getBytes());
|
||||
|
||||
if (keys != null) {
|
||||
return keys.stream().map(key -> {
|
||||
|
||||
@@ -78,8 +78,8 @@ public class FileStorageLocalServiceImpl implements IFileStorageService {
|
||||
// 目录不存在,新建
|
||||
directory.mkdirs();
|
||||
}
|
||||
if (!path.endsWith("/")) {
|
||||
path = path + "/";
|
||||
if (!path.endsWith(File.separator)) {
|
||||
path = path + File.separator;
|
||||
}
|
||||
FileUploadVO fileUploadVO = new FileUploadVO();
|
||||
//原文件名
|
||||
|
||||
@@ -3,8 +3,10 @@ package net.lab1024.sa.base.module.support.loginlog.domain;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@@ -20,6 +22,8 @@ import java.time.LocalDateTime;
|
||||
@TableName("t_login_log")
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class LoginLogEntity {
|
||||
|
||||
@TableId(type = IdType.AUTO)
|
||||
|
||||
@@ -3,8 +3,10 @@ package net.lab1024.sa.base.module.support.securityprotect.domain;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@@ -21,6 +23,8 @@ import java.time.LocalDateTime;
|
||||
@Data
|
||||
@Builder
|
||||
@TableName("t_login_fail")
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class LoginFailEntity {
|
||||
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
<a-form-item label="创建时间" class="smart-query-form-item">
|
||||
<a-space direction="vertical" :size="12">
|
||||
<a-range-picker v-model:value="searchDate" @change="dateChange" />
|
||||
<a-range-picker v-model:value="searchDate" :presets="defaultTimeRanges" @change="dateChange" />
|
||||
</a-space>
|
||||
</a-form-item>
|
||||
|
||||
@@ -93,6 +93,7 @@
|
||||
import { SmartLoading } from '/@/components/framework/smart-loading';
|
||||
import { message, Modal } from 'ant-design-vue';
|
||||
import { smartSentry } from '/@/lib/smart-sentry';
|
||||
import { defaultTimeRanges } from '/@/lib/default-time-ranges';
|
||||
import TableOperator from '/@/components/support/table-operator/index.vue';
|
||||
import { TABLE_ID_CONST } from '/@/constants/support/table-id-const';
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
<a-form-item label="创建时间" class="smart-query-form-item">
|
||||
<a-space direction="vertical" :size="12">
|
||||
<a-range-picker v-model:value="searchDate" @change="dateChange" />
|
||||
<a-range-picker v-model:value="searchDate" :presets="defaultTimeRanges" @change="dateChange" />
|
||||
</a-space>
|
||||
</a-form-item>
|
||||
|
||||
@@ -92,6 +92,7 @@
|
||||
import { smartSentry } from '/@/lib/smart-sentry';
|
||||
import TableOperator from '/@/components/support/table-operator/index.vue';
|
||||
import { TABLE_ID_CONST } from '/@/constants/support/table-id-const';
|
||||
import { defaultTimeRanges } from '/@/lib/default-time-ranges.js';
|
||||
|
||||
const props = defineProps({
|
||||
enterpriseId: {
|
||||
|
||||
@@ -13,16 +13,20 @@ JavaTypeMap.set('integer', 'Integer');
|
||||
JavaTypeMap.set('year', 'Integer');
|
||||
JavaTypeMap.set('bigint', 'Long');
|
||||
JavaTypeMap.set('int8', 'Long');
|
||||
JavaTypeMap.set('number', 'Long');
|
||||
JavaTypeMap.set('float', 'BigDecimal');
|
||||
JavaTypeMap.set('double', 'BigDecimal');
|
||||
JavaTypeMap.set('decimal', 'BigDecimal');
|
||||
JavaTypeMap.set('char', 'String');
|
||||
JavaTypeMap.set('varchar', 'String');
|
||||
JavaTypeMap.set('varchar2', 'String');
|
||||
JavaTypeMap.set('nvarchar', 'String');
|
||||
JavaTypeMap.set('nvarchar2', 'String');
|
||||
JavaTypeMap.set('tinytext', 'String');
|
||||
JavaTypeMap.set('text', 'String');
|
||||
JavaTypeMap.set('longtext', 'String');
|
||||
JavaTypeMap.set('blob', 'String');
|
||||
JavaTypeMap.set('clob', 'String');
|
||||
JavaTypeMap.set('date', 'LocalDate');
|
||||
JavaTypeMap.set('datetime', 'LocalDateTime');
|
||||
JavaTypeMap.set('datetime2', 'LocalDateTime');
|
||||
@@ -52,6 +56,7 @@ JsTypeMap.set('int', 'Number');
|
||||
JsTypeMap.set('int2', 'Number');
|
||||
JsTypeMap.set('int4', 'Number');
|
||||
JsTypeMap.set('int8', 'Number');
|
||||
JsTypeMap.set('number', 'Number');
|
||||
JsTypeMap.set('tinyint', 'Number');
|
||||
JsTypeMap.set('smallint', 'Number');
|
||||
JsTypeMap.set('integer', 'Number');
|
||||
@@ -62,12 +67,15 @@ JsTypeMap.set('double', 'Number');
|
||||
JsTypeMap.set('decimal', 'Number');
|
||||
JsTypeMap.set('char', 'String');
|
||||
JsTypeMap.set('varchar', 'String');
|
||||
JsTypeMap.set('varchar2', 'String');
|
||||
JsTypeMap.set('nvarchar', 'String');
|
||||
JsTypeMap.set('nvarchar2', 'String');
|
||||
JsTypeMap.set('character', 'String');
|
||||
JsTypeMap.set('tinytext', 'String');
|
||||
JsTypeMap.set('text', 'String');
|
||||
JsTypeMap.set('longtext', 'String');
|
||||
JsTypeMap.set('blob', 'String');
|
||||
JsTypeMap.set('clob', 'String');
|
||||
JsTypeMap.set('date', 'Date');
|
||||
JsTypeMap.set('datetime', 'Date');
|
||||
JsTypeMap.set('datetime2', 'Date');
|
||||
@@ -94,6 +102,7 @@ FrontComponentMap.set('int', 'InputNumber');
|
||||
FrontComponentMap.set('int2', 'InputNumber');
|
||||
FrontComponentMap.set('int4', 'InputNumber');
|
||||
FrontComponentMap.set('int8', 'InputNumber');
|
||||
FrontComponentMap.set('number', 'InputNumber');
|
||||
FrontComponentMap.set('tinyint', 'InputNumber');
|
||||
FrontComponentMap.set('smallint', 'InputNumber');
|
||||
FrontComponentMap.set('integer', 'InputNumber');
|
||||
@@ -105,12 +114,15 @@ FrontComponentMap.set('double', 'InputNumber');
|
||||
FrontComponentMap.set('decimal', 'InputNumber');
|
||||
FrontComponentMap.set('char', 'Input');
|
||||
FrontComponentMap.set('varchar', 'Input');
|
||||
FrontComponentMap.set('varchar2', 'Input');
|
||||
FrontComponentMap.set('nvarchar', 'Input');
|
||||
FrontComponentMap.set('nvarchar2', 'Input');
|
||||
FrontComponentMap.set('character', 'Input');
|
||||
FrontComponentMap.set('tinytext', 'Input');
|
||||
FrontComponentMap.set('text', 'Textarea');
|
||||
FrontComponentMap.set('longtext', 'Textarea');
|
||||
FrontComponentMap.set('blob', 'FileUpload');
|
||||
FrontComponentMap.set('clob', 'FileUpload');
|
||||
FrontComponentMap.set('date', 'Date');
|
||||
FrontComponentMap.set('datetime', 'DateTime');
|
||||
FrontComponentMap.set('datetime2', 'DateTime');
|
||||
|
||||
@@ -102,6 +102,7 @@
|
||||
const visibleFlag = ref(false);
|
||||
function showModal(table) {
|
||||
Object.assign(tableInfo, table);
|
||||
tableInfo.tableName = tableInfo.tableName.toLowerCase();
|
||||
tableInfo.createTime = table.createTime ? table.createTime : new Date();
|
||||
activeKey.value = '1';
|
||||
visibleFlag.value = true;
|
||||
|
||||
@@ -168,9 +168,9 @@
|
||||
let keywordsFilterFlag = true;
|
||||
if (keywords.value) {
|
||||
keywordsFilterFlag =
|
||||
_.includes(item.dataValue.toLowerCase(), keywords.value.toLowerCase()) ||
|
||||
_.includes(item.dataLabel.toLowerCase(), keywords.value.toLowerCase()) ||
|
||||
_.includes(item.remark.toLowerCase(), keywords.value.toLowerCase());
|
||||
(item.dataValue &&_.includes(item.dataValue.toLowerCase(), keywords.value.toLowerCase())) ||
|
||||
(item.dataLabel && _.includes(item.dataLabel.toLowerCase(), keywords.value.toLowerCase())) ||
|
||||
(item.remark && _.includes(item.remark.toLowerCase(), keywords.value.toLowerCase()));
|
||||
}
|
||||
let disabledFilterFlag = _.isNull(disabledFlag.value) ? true : item.disabledFlag === disabledFlag.value;
|
||||
return disabledFilterFlag && keywordsFilterFlag;
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* @Date: 2024/06/25
|
||||
-->
|
||||
<template>
|
||||
<a-drawer v-model:open="showFlag" :width="1000" :title="title" placement="right" :destroyOnClose="true">
|
||||
<a-drawer v-model:open="showFlag" :width="1100" :title="title" placement="right" :destroyOnClose="true">
|
||||
<a-form class="smart-query-form">
|
||||
<a-row class="smart-query-form-row">
|
||||
<a-form-item label="关键字" class="smart-query-form-item">
|
||||
@@ -12,13 +12,13 @@
|
||||
</a-form-item>
|
||||
<a-form-item label="执行结果" class="smart-query-form-item">
|
||||
<a-select style="width: 100px" v-model:value="queryForm.successFlag" placeholder="请选择" allowClear>
|
||||
<a-select-option :key="1"> 成功 </a-select-option>
|
||||
<a-select-option :key="0"> 失败 </a-select-option>
|
||||
<a-select-option :key="1"> 成功</a-select-option>
|
||||
<a-select-option :key="0"> 失败</a-select-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
<a-form-item label="执行时间" class="smart-query-form-item">
|
||||
<a-space direction="vertical" :size="12">
|
||||
<a-range-picker v-model:value="searchDate" style="width: 220px" @change="dateChange" />
|
||||
<a-range-picker v-model:value="searchDate" style="width: 220px" :presets="defaultTimeRanges" @change="dateChange" />
|
||||
</a-space>
|
||||
</a-form-item>
|
||||
|
||||
@@ -41,7 +41,6 @@
|
||||
</a-row>
|
||||
</a-form>
|
||||
|
||||
<a-card size="small" :bordered="false" :hoverable="true">
|
||||
<a-row justify="end">
|
||||
<TableOperator class="smart-margin-bottom5" v-model="columns" :tableId="TABLE_ID_CONST.SUPPORT.JOB_LOG" :refresh="queryLogList" />
|
||||
</a-row>
|
||||
@@ -49,13 +48,25 @@
|
||||
<a-table size="small" :loading="tableLoading" bordered :dataSource="tableData" :columns="columns" rowKey="jobLogId" :pagination="false">
|
||||
<template #bodyCell="{ record, column }">
|
||||
<template v-if="column.dataIndex === 'executeStartTime'">
|
||||
<div><a-tag color="green">始</a-tag>{{ record.executeStartTime }}</div>
|
||||
<div style="margin-top: 5px"><a-tag color="blue">终</a-tag>{{ record.executeEndTime }}</div>
|
||||
<div>
|
||||
<a-tag color="green">始</a-tag>
|
||||
{{ record.executeStartTime }}
|
||||
</div>
|
||||
<div style="margin-top: 5px">
|
||||
<a-tag color="blue">终</a-tag>
|
||||
{{ record.executeEndTime }}
|
||||
</div>
|
||||
</template>
|
||||
<template v-if="column.dataIndex === 'executeTimeMillis'"> {{ record.executeTimeMillis }} ms </template>
|
||||
<template v-if="column.dataIndex === 'executeTimeMillis'"> {{ record.executeTimeMillis }} ms</template>
|
||||
<template v-if="column.dataIndex === 'successFlag'">
|
||||
<div v-if="record.successFlag" style="color: #39c710"><CheckOutlined />成功</div>
|
||||
<div v-else style="color: #f50"><WarningOutlined />失败</div>
|
||||
<div v-if="record.successFlag" style="color: #39c710">
|
||||
<CheckOutlined />
|
||||
成功
|
||||
</div>
|
||||
<div v-else style="color: #f50">
|
||||
<WarningOutlined />
|
||||
失败
|
||||
</div>
|
||||
</template>
|
||||
</template>
|
||||
</a-table>
|
||||
@@ -74,7 +85,6 @@
|
||||
:show-total="(total) => `共${total}条`"
|
||||
/>
|
||||
</div>
|
||||
</a-card>
|
||||
</a-drawer>
|
||||
</template>
|
||||
<script setup>
|
||||
@@ -84,6 +94,7 @@
|
||||
import { smartSentry } from '/@/lib/smart-sentry';
|
||||
import TableOperator from '/@/components/support/table-operator/index.vue';
|
||||
import { TABLE_ID_CONST } from '/@/constants/support/table-id-const';
|
||||
import { defaultTimeRanges } from '/@/lib/default-time-ranges.js';
|
||||
|
||||
const showFlag = ref(false);
|
||||
const title = ref('');
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
<SmartEnumSelect width="120px" enum-name="FLAG_NUMBER_ENUM" v-model:value="queryForm.readFlag" />
|
||||
</a-form-item>
|
||||
<a-form-item label="创建时间" class="smart-query-form-item">
|
||||
<a-range-picker v-model:value="queryForm.createTime" style="width: 200px" @change="onChangeCreateTime" />
|
||||
<a-range-picker v-model:value="queryForm.createTime" :presets="defaultTimeRanges" style="width: 200px" @change="onChangeCreateTime" />
|
||||
</a-form-item>
|
||||
<a-form-item class="smart-query-form-item">
|
||||
<a-button type="primary" @click="searchQuery">
|
||||
@@ -96,6 +96,7 @@
|
||||
import TableOperator from '/@/components/support/table-operator/index.vue';
|
||||
import MessageSendForm from './components/message-send-form.vue';
|
||||
import { TABLE_ID_CONST } from '/@/constants/support/table-id-const';
|
||||
import { defaultTimeRanges } from '/@/lib/default-time-ranges.js';
|
||||
// ---------------------------- 表格列 ----------------------------
|
||||
|
||||
const columns = ref([
|
||||
|
||||
@@ -8,9 +8,10 @@
|
||||
* @Copyright 1024创新实验室 ( https://1024lab.net ),Since 2012
|
||||
-->
|
||||
<template>
|
||||
<a-modal :open="visible" width="600px" :bodyStyle="{height:'360px'}" title="" :closable="false" :maskClosable="true">
|
||||
<a-modal :open="visible" width="600px" :bodyStyle="{height:'400px'}" title="" :closable="false" :maskClosable="true">
|
||||
<a-row><div style="font-weight:bolder;margin: 0 auto;font-size: 16px;color: red;">重磅更新:国产数据库支持🎉🎉</div> </a-row>
|
||||
<a-row><div style="font-weight:bolder;margin: 10px auto;font-size: 16px;color: red;">支持:达梦、人大金仓、华为高斯GaussDB 等🎉🎉</div> </a-row>
|
||||
<a-row><div style="font-weight:bolder;margin: 10px auto;font-size: 16px;color: red;">国产数据库:达梦、人大金仓、华为高斯GaussDB 等🎉🎉</div> </a-row>
|
||||
<a-row><div style="font-weight:bolder;margin: 0 auto;font-size: 16px;color: red;">主流数据库:Mysql、PostgreSQL 等🎉🎉</div> </a-row>
|
||||
<br />
|
||||
<div class="app-qr-box">
|
||||
<div class="app-qr">
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
* @Copyright 1024创新实验室 ( https://1024lab.net ),Since 2012
|
||||
*/
|
||||
import { defineStore } from 'pinia';
|
||||
import { smartSentry } from '/@/lib/smart-sentry.js';
|
||||
|
||||
export const useSpinStore = defineStore({
|
||||
id: 'spin',
|
||||
@@ -19,27 +18,13 @@ export const useSpinStore = defineStore({
|
||||
actions: {
|
||||
hide() {
|
||||
this.loading = false;
|
||||
// 安全的DOM操作,避免null引用错误
|
||||
try {
|
||||
const spins = document.querySelector('.ant-spin-nested-loading');
|
||||
if (spins) {
|
||||
spins.style.zIndex = '999';
|
||||
}
|
||||
} catch (error) {
|
||||
smartSentry.captureError('Spin hide操作失败:', error);
|
||||
}
|
||||
let spins = document.querySelector('.ant-spin-nested-loading');
|
||||
spins.style.zIndex = 999;
|
||||
},
|
||||
show() {
|
||||
this.loading = true;
|
||||
// 安全的DOM操作,避免null引用错误
|
||||
try {
|
||||
const spins = document.querySelector('.ant-spin-nested-loading');
|
||||
if (spins) {
|
||||
spins.style.zIndex = '1001';
|
||||
}
|
||||
} catch (error) {
|
||||
smartSentry.captureError('Spin hide操作失败:', error);
|
||||
}
|
||||
let spins = document.querySelector('.ant-spin-nested-loading');
|
||||
spins.style.zIndex = 1001;
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
@@ -13,16 +13,20 @@ JavaTypeMap.set('integer', 'Integer');
|
||||
JavaTypeMap.set('year', 'Integer');
|
||||
JavaTypeMap.set('bigint', 'Long');
|
||||
JavaTypeMap.set('int8', 'Long');
|
||||
JavaTypeMap.set('number', 'Long');
|
||||
JavaTypeMap.set('float', 'BigDecimal');
|
||||
JavaTypeMap.set('double', 'BigDecimal');
|
||||
JavaTypeMap.set('decimal', 'BigDecimal');
|
||||
JavaTypeMap.set('char', 'String');
|
||||
JavaTypeMap.set('varchar', 'String');
|
||||
JavaTypeMap.set('varchar2', 'String');
|
||||
JavaTypeMap.set('nvarchar', 'String');
|
||||
JavaTypeMap.set('nvarchar2', 'String');
|
||||
JavaTypeMap.set('tinytext', 'String');
|
||||
JavaTypeMap.set('text', 'String');
|
||||
JavaTypeMap.set('longtext', 'String');
|
||||
JavaTypeMap.set('blob', 'String');
|
||||
JavaTypeMap.set('clob', 'String');
|
||||
JavaTypeMap.set('date', 'LocalDate');
|
||||
JavaTypeMap.set('datetime', 'LocalDateTime');
|
||||
JavaTypeMap.set('datetime2', 'LocalDateTime');
|
||||
@@ -52,6 +56,7 @@ JsTypeMap.set('int', 'Number');
|
||||
JsTypeMap.set('int2', 'Number');
|
||||
JsTypeMap.set('int4', 'Number');
|
||||
JsTypeMap.set('int8', 'Number');
|
||||
JsTypeMap.set('number', 'Number');
|
||||
JsTypeMap.set('tinyint', 'Number');
|
||||
JsTypeMap.set('smallint', 'Number');
|
||||
JsTypeMap.set('integer', 'Number');
|
||||
@@ -62,12 +67,15 @@ JsTypeMap.set('double', 'Number');
|
||||
JsTypeMap.set('decimal', 'Number');
|
||||
JsTypeMap.set('char', 'String');
|
||||
JsTypeMap.set('varchar', 'String');
|
||||
JsTypeMap.set('varchar2', 'String');
|
||||
JsTypeMap.set('nvarchar', 'String');
|
||||
JsTypeMap.set('nvarchar2', 'String');
|
||||
JsTypeMap.set('character', 'String');
|
||||
JsTypeMap.set('tinytext', 'String');
|
||||
JsTypeMap.set('text', 'String');
|
||||
JsTypeMap.set('longtext', 'String');
|
||||
JsTypeMap.set('blob', 'String');
|
||||
JsTypeMap.set('clob', 'String');
|
||||
JsTypeMap.set('date', 'Date');
|
||||
JsTypeMap.set('datetime', 'Date');
|
||||
JsTypeMap.set('datetime2', 'Date');
|
||||
@@ -94,6 +102,7 @@ FrontComponentMap.set('int', 'InputNumber');
|
||||
FrontComponentMap.set('int2', 'InputNumber');
|
||||
FrontComponentMap.set('int4', 'InputNumber');
|
||||
FrontComponentMap.set('int8', 'InputNumber');
|
||||
FrontComponentMap.set('number', 'InputNumber');
|
||||
FrontComponentMap.set('tinyint', 'InputNumber');
|
||||
FrontComponentMap.set('smallint', 'InputNumber');
|
||||
FrontComponentMap.set('integer', 'InputNumber');
|
||||
@@ -105,12 +114,15 @@ FrontComponentMap.set('double', 'InputNumber');
|
||||
FrontComponentMap.set('decimal', 'InputNumber');
|
||||
FrontComponentMap.set('char', 'Input');
|
||||
FrontComponentMap.set('varchar', 'Input');
|
||||
FrontComponentMap.set('varchar2', 'Input');
|
||||
FrontComponentMap.set('nvarchar', 'Input');
|
||||
FrontComponentMap.set('nvarchar2', 'Input');
|
||||
FrontComponentMap.set('character', 'Input');
|
||||
FrontComponentMap.set('tinytext', 'Input');
|
||||
FrontComponentMap.set('text', 'Textarea');
|
||||
FrontComponentMap.set('longtext', 'Textarea');
|
||||
FrontComponentMap.set('blob', 'FileUpload');
|
||||
FrontComponentMap.set('clob', 'FileUpload');
|
||||
FrontComponentMap.set('date', 'Date');
|
||||
FrontComponentMap.set('datetime', 'DateTime');
|
||||
FrontComponentMap.set('datetime2', 'DateTime');
|
||||
|
||||
@@ -102,6 +102,7 @@
|
||||
const visibleFlag = ref(false);
|
||||
function showModal(table) {
|
||||
Object.assign(tableInfo, table);
|
||||
tableInfo.tableName = tableInfo.tableName.toLowerCase();
|
||||
tableInfo.createTime = table.createTime ? table.createTime : new Date();
|
||||
activeKey.value = '1';
|
||||
visibleFlag.value = true;
|
||||
|
||||
@@ -168,9 +168,9 @@
|
||||
let keywordsFilterFlag = true;
|
||||
if (keywords.value) {
|
||||
keywordsFilterFlag =
|
||||
_.includes(item.dataValue.toLowerCase(), keywords.value.toLowerCase()) ||
|
||||
_.includes(item.dataLabel.toLowerCase(), keywords.value.toLowerCase()) ||
|
||||
_.includes(item.remark.toLowerCase(), keywords.value.toLowerCase());
|
||||
(item.dataValue &&_.includes(item.dataValue.toLowerCase(), keywords.value.toLowerCase())) ||
|
||||
(item.dataLabel && _.includes(item.dataLabel.toLowerCase(), keywords.value.toLowerCase())) ||
|
||||
(item.remark && _.includes(item.remark.toLowerCase(), keywords.value.toLowerCase()));
|
||||
}
|
||||
let disabledFilterFlag = _.isNull(disabledFlag.value) ? true : item.disabledFlag === disabledFlag.value;
|
||||
return disabledFilterFlag && keywordsFilterFlag;
|
||||
|
||||
@@ -234,21 +234,12 @@
|
||||
</script>
|
||||
<style lang="less" scoped>
|
||||
.center-container {
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
.header-title {
|
||||
font-size: 20px;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.center-form-area {
|
||||
margin-top: 20px;
|
||||
flex: 1;
|
||||
overflow-y: auto;
|
||||
min-height: 0;
|
||||
|
||||
|
||||
.avatar-container {
|
||||
position: relative;
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
|
||||
|
||||
序号| 数据库 | 类型 | 支持 | 下载
|
||||
-------- |-------------------------------------------------------------------|--------------------| ----- | ----
|
||||
1| [Mysql](https://www.mysql.com) | 国外 | Java8+Java17 都支持 ✔️ | [下载代码和SQL](https://gitee.com/lab1024/smart-admin/tree/master/%E6%95%B0%E6%8D%AE%E5%BA%93SQL%E8%84%9A%E6%9C%AC/mysql)
|
||||
2| [PostgreSQL](https://www.postgresql.org/) | 国外 | Java8+Java17都支持 ✔️ | [下载代码和SQL](https://smartadmin.vip/views/other/china-db/)
|
||||
3| [SqlServer](https://www.microsoft.com/en-us/sql-server/) | 国外 | Java8+Java17都支持 ✔️ | [下载代码和SQL](https://smartadmin.vip/views/other/china-db/)
|
||||
4| [达梦数据库 DM8](https://www.dameng.com/DM8.html) | 国产 | Java8+Java17 都支持 ✔️ | [下载代码和SQL](https://smartadmin.vip/views/other/china-db/)
|
||||
5| [电科(人大)金仓 KingBaseES](https://www.kingbase.com.cn) | 国产 | Java8+Java17都支持 ✔️ | [下载代码和SQL](https://smartadmin.vip/views/other/china-db/)
|
||||
6| [华为高斯 GaussDB](https://www.huaweicloud.com/product/gaussdb.html) | 国产 | Java8+Java17都支持 ✔️ | [下载代码和SQL](https://smartadmin.vip/views/other/china-db/)
|
||||
7| [OpenGaussDB](https://opengauss.org/zh/) | 国产 | Java8+Java17都支持 ✔️ | [下载代码和SQL](https://smartadmin.vip/views/other/china-db/)
|
||||
8| [神通数据库 ShenTong](http://www.shentongdata.com.cn/) | 国产 | Java8+Java17都支持 ✔️ | [下载代码和SQL](https://smartadmin.vip/views/other/china-db/)
|
||||
9| [海量数据库 VastData](https://www.vastdata.com.cn) | 国产 | Java8+Java17都支持 ✔️ | [下载代码和SQL](https://smartadmin.vip/views/other/china-db/)
|
||||
10| [海扬数据库 OceanBase](https://www.oceanbase.com/) | 国产 | Java8+Java17都支持 ✔️ | [下载代码和SQL](https://smartadmin.vip/views/other/china-db/)
|
||||
11| [阿里云 PolarDB](https://www.polardbx.com/) | 国产 | Java8+Java17都支持 ✔️ | [下载代码和SQL](https://smartadmin.vip/views/other/china-db/)
|
||||
|
||||
序号| 数据库 | 类型 | 免费 | 支持 | 下载
|
||||
-------- |------------------------------------------------------------------|--------------------| ----- |-------------------------| ----
|
||||
1| [Mysql](https://www.mysql.com) | 国外🌈 | 免费🍉 | Java8+Java17 ✔️ | [Gitee](https://gitee.com/lab1024/smart-admin/tree/master/%E6%95%B0%E6%8D%AE%E5%BA%93SQL%E8%84%9A%E6%9C%AC/mysql)
|
||||
2| [PostgreSQL](https://www.postgresql.org/) | 国外🌈 | 收费🎉️ | Java8+Java17 ✔️ | [购买](../buy.md)
|
||||
3| [SqlServer](https://www.microsoft.com/en-us/sql-server/) | 国外🌈 | 收费🎉️ | Java8+Java17 ✔️ | [购买](../buy.md)
|
||||
4| [Oracle](https://www.oracle.com/) | 国外🌈 | 收费🎉️ | Java8+Java17 ✔️ | [购买](../buy.md)
|
||||
5| [达梦 DM8](https://www.dameng.com/DM8.html) | 国产🔥 | 收费🎉️ | Java8+Java17 ✔️ | [购买](../buy.md)
|
||||
6| [电科(人大)金仓 KingBaseES](https://www.kingbase.com.cn) | 国产🔥 | 收费🎉️ | Java8+Java17 ✔️ | [购买](../buy.md)
|
||||
7| [华为高斯 GaussDB](https://www.huaweicloud.com/product/gaussdb.html) | 国产🔥 | 收费🎉️ | Java8+Java17 ✔️ | [购买](../buy.md)
|
||||
8| [OpenGaussDB](https://opengauss.org/zh/) | 国产🔥 | 收费🎉️ | Java8+Java17 ✔️ | [购买](../buy.md)
|
||||
9| [神通 ShenTong](http://www.shentongdata.com.cn/) | 国产🔥 | 收费🎉️ | Java8+Java17 ✔️ | [购买](../buy.md)
|
||||
10| [海量 VastData](https://www.vastdata.com.cn) | 国产🔥 | 收费🎉️ | Java8+Java17 ✔️ | [购买](../buy.md)
|
||||
11| [海扬 OceanBase](https://www.oceanbase.com/) | 国产🔥 | 收费🎉️ | Java8+Java17 ✔️ | [购买](../buy.md)
|
||||
12| [阿里云 PolarDB](https://www.polardbx.com/) | 国产🔥 | 收费🎉️ | Java8+Java17 ✔️ | [购买](../buy.md)
|
||||
|
||||
Reference in New Issue
Block a user