Skip to content

Commit

Permalink
v3.10.0【新增】全屏模式Modal等终极解决方案;【新增】生成环境去掉跨域;【优化】其他一些小细节
Browse files Browse the repository at this point in the history
  • Loading branch information
zhuoda committed Nov 18, 2024
1 parent 472d059 commit 56517b6
Show file tree
Hide file tree
Showing 25 changed files with 77 additions and 148 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Conditional;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.cors.CorsConfiguration;
import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
Expand All @@ -17,6 +18,7 @@
* @Copyright <a href="https://1024lab.net">1024创新实验室</a>
*/
@Configuration
@Conditional(SystemEnvironmentConfig.class)
public class CorsFilterConfig {

@Value("${access-control-allow-origin}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ public ImmutablePair<List<String>, List<Map<String, Object>>> getPackageListAndF
if (Boolean.TRUE.equals(field.getRequiredFlag())) {
String notEmptyPrefix = "String".equals(codeField.getJavaType()) ? "@NotBlank" : "@NotNull";
finalFieldMap.put("notEmpty", "\n " + notEmptyPrefix + "(message = \"" + codeField.getLabel() + " 不能为空\")");
packageList.add("String".equals(codeField.getJavaType()) ? "import javax.validation.constraints.NotBlank;"
: "import javax.validation.constraints.NotNull;");
packageList.add("String".equals(codeField.getJavaType()) ? "import jakarta.validation.constraints.NotBlank;"
: "import jakarta.validation.constraints.NotNull;");
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ public ImmutablePair<List<String>, List<Map<String, Object>>> getPackageListAndF
if (Boolean.TRUE.equals(field.getRequiredFlag())) {
String notEmptyPrefix = "String".equals(codeField.getJavaType()) ? "@NotBlank" : "@NotNull";
finalFieldMap.put("notEmpty", "\n " + notEmptyPrefix + "(message = \"" + codeField.getLabel() + " 不能为空\")");
packageList.add("String".equals(codeField.getJavaType()) ? "import javax.validation.constraints.NotBlank;" : "import javax.validation.constraints.NotNull;");
packageList.add("String".equals(codeField.getJavaType()) ? "import jakarta.validation.constraints.NotBlank;" : "import jakarta.validation.constraints.NotNull;");
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ public ResponseDTO<PageResult<DictKeyVO>> keyQuery(DictKeyQueryForm queryForm) {
* @return
*/
public List<DictKeyVO> queryAllKey() {
return SmartBeanUtil.copyList(dictKeyDao.selectList(null), DictKeyVO.class);
return SmartBeanUtil.copyList(dictKeyDao.selectByDeletedFlag(false), DictKeyVO.class);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,14 @@ public interface ${name.upperCamel}Dao extends BaseMapper<${name.upperCamel}Enti
/**
* 更新删除状态
*/
long updateDeleted(@Param("${primaryKeyFieldName}")${primaryKeyJavaType} ${primaryKeyFieldName},@Param("${deletedFlag}")boolean deletedFlag);
long updateDeleted(@Param("${primaryKeyFieldName}")${primaryKeyJavaType} ${primaryKeyFieldName},@Param("deletedFlag")boolean deletedFlag);

#end
#if($deleteInfo.deleteEnum == "Batch" || $deleteInfo.deleteEnum == "SingleAndBatch")
/**
* 批量更新删除状态
*/
void batchUpdateDeleted(@Param("idList")List<${primaryKeyJavaType}> idList,@Param("${deletedFlag}")boolean deletedFlag);
void batchUpdateDeleted(@Param("idList")List<${primaryKeyJavaType}> idList,@Param("deletedFlag")boolean deletedFlag);

#end
#end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ spring:
host: smtp.163.com
port: 465
username: [email protected]
password: LAB1024LAB
password: ROIMSIQCEXHTQFTA
properties:
mail:
smtp:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,26 +21,24 @@ spring:
pointcut: net.lab1024.sa..*Service.*

# redis 连接池配置信息
data:
redis:
database: 1
host: 127.0.0.1
port: 6379
password:
timeout: 10000ms
lettuce:
pool:
max-active: 5
min-idle: 1
max-idle: 3
max-wait: 30000ms

redis:
database: 1
host: 127.0.0.1
port: 6379
password:
timeout: 10000ms
lettuce:
pool:
max-active: 100
min-idle: 10
max-idle: 50
max-wait: 30000ms
# 邮件,置以SSL的方式发送, 这个需要使用这种方式并且端口是465
mail:
host: smtp.163.com
port: 465
username: [email protected]
password: LAB1024LAB
password: 1024lab
properties:
mail:
smtp:
Expand Down Expand Up @@ -119,9 +117,6 @@ http:
write-timeout: 50000
keep-alive: 300000

# 跨域配置
access-control-allow-origin: 'https://preview.smartadmin.vip'

# 心跳配置
heart-beat:
interval-seconds: 60
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Conditional;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.cors.CorsConfiguration;
import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
Expand All @@ -17,6 +18,7 @@
* @Copyright <a href="https://1024lab.net">1024创新实验室</a>
*/
@Configuration
@Conditional(SystemEnvironmentConfig.class)
public class CorsFilterConfig {

@Value("${access-control-allow-origin}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ public ResponseDTO<PageResult<DictKeyVO>> keyQuery(DictKeyQueryForm queryForm) {
* @return
*/
public List<DictKeyVO> queryAllKey() {
return SmartBeanUtil.copyList(dictKeyDao.selectList(null), DictKeyVO.class);
return SmartBeanUtil.copyList(dictKeyDao.selectByDeletedFlag(false), DictKeyVO.class);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,14 @@ public interface ${name.upperCamel}Dao extends BaseMapper<${name.upperCamel}Enti
/**
* 更新删除状态
*/
long updateDeleted(@Param("${primaryKeyFieldName}")${primaryKeyJavaType} ${primaryKeyFieldName},@Param("${deletedFlag}")boolean deletedFlag);
long updateDeleted(@Param("${primaryKeyFieldName}")${primaryKeyJavaType} ${primaryKeyFieldName},@Param("deletedFlag")boolean deletedFlag);

#end
#if($deleteInfo.deleteEnum == "Batch" || $deleteInfo.deleteEnum == "SingleAndBatch")
/**
* 批量更新删除状态
*/
void batchUpdateDeleted(@Param("idList")List<${primaryKeyJavaType}> idList,@Param("${deletedFlag}")boolean deletedFlag);
void batchUpdateDeleted(@Param("idList")List<${primaryKeyJavaType}> idList,@Param("deletedFlag")boolean deletedFlag);

#end
#end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ spring:
host: smtp.163.com
port: 465
username: [email protected]
password: LAB1024LAB
password: 1024lab
properties:
mail:
smtp:
Expand Down Expand Up @@ -117,9 +117,6 @@ http:
write-timeout: 50000
keep-alive: 300000

# 跨域配置
access-control-allow-origin: 'https://preview.smartadmin.vip'

# 心跳配置
heart-beat:
interval-seconds: 60
Expand Down
Empty file.
Empty file.
14 changes: 0 additions & 14 deletions smart-admin-web-javascript/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,6 @@
</head>
<body>
<div id="app"></div>
<script>
let url = window.location.href;
if(url.indexOf("1024lab") > -1){
location.href = "https://preview.smartadmin.vip";
}

var _hmt = _hmt || [];
(function() {
var hm = document.createElement("script");
hm.src = "https://hm.baidu.com/hm.js?5e12fadc47eb3aac662d848fd39ec07a";
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
})();
</script>
<script type="module" src="/src/main.js"></script>
</body>
</html>
30 changes: 0 additions & 30 deletions smart-admin-web-javascript/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
},
},
}"
:getPopupContainer="getPopupContainer"
>
<!---全局loading--->
<a-spin :spinning="spinning" tip="稍等片刻,我在拼命加载中..." size="large">
Expand All @@ -50,8 +49,6 @@
import { useSpinStore } from '/@/store/modules/system/spin';
import { theme } from 'ant-design-vue';
import { themeColors } from '/@/theme/color.js';
import { SmartLoading } from '/@/components/framework/smart-loading/index.js';
import { LAYOUT_ELEMENT_IDS } from '/@/layout/layout-const.js';

const antdLocale = computed(() => messages[useAppConfigStore().language].antdLocale);
const dayjsLocale = computed(() => messages[useAppConfigStore().language].dayjsLocale);
Expand All @@ -70,31 +67,4 @@
const borderRadius = computed(() => {
return useAppConfigStore().borderRadius;
});

function getPopupContainer(node, dialogContext) {
let fullScreenFlag = useAppConfigStore().$state.fullScreenFlag;
if(fullScreenFlag){
return getFullScreenContainer(node, dialogContext);
}else{
return getNotFullScreenContainer(node, dialogContext);
}
}

function getFullScreenContainer(node, dialogContext) {
if (node === document.body) {
return document.getElementById(LAYOUT_ELEMENT_IDS.content);
}else if (node) {
return node.parentNode;
} else {
return document.getElementById(LAYOUT_ELEMENT_IDS.content);
}
}

function getNotFullScreenContainer(node, dialogContext) {
if (node) {
return node.parentNode;
} else {
return document.body;
}
}
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@
<script setup>
import _ from 'lodash';
import { tableColumnApi } from '/@/api/support/table-column-api';
import { onMounted, reactive, ref, watch } from 'vue';
import { onMounted, ref, watch } from 'vue';
import SmartTableColumnModal from './smart-table-column-modal.vue';
import { message } from 'ant-design-vue';
import { mergeColumn } from './smart-table-column-merge';
import { smartSentry } from '/@/lib/smart-sentry';
import { LAYOUT_ELEMENT_IDS } from '/@/layout/layout-const.js';
import { useAppConfigStore } from '/@/store/modules/system/app-config.js';

const props = defineProps({
// 表格列数组
modelValue: {
Expand Down Expand Up @@ -89,7 +89,6 @@
} catch (e) {
smartSentry.captureError(e);
}

updateColumn(userTableColumnArray);
}

Expand All @@ -100,24 +99,16 @@
if (fullScreenFlag.value) {
// 退出全屏
handleExitFullScreen();
exitElementFullscreen(document.getElementById(LAYOUT_ELEMENT_IDS.content));
exitElementFullscreen(document.body);
} else {
//全屏
message.config({
getContainer: () => document.getElementById(LAYOUT_ELEMENT_IDS.content),
});
fullScreenFlag.value = true;
useAppConfigStore().startFullScreen();
launchElementFullScreen(document.getElementById(LAYOUT_ELEMENT_IDS.content));
launchElementFullScreen(document.body);
}
}

// 处理退出全屏
function handleExitFullScreen(){
//取消全屏
message.config({
getContainer: () => document.body,
});
function handleExitFullScreen() {
fullScreenFlag.value = false;
useAppConfigStore().exitFullScreen();
document.removeEventListener('fullscreenchange', handleFullscreenChange);
Expand Down
7 changes: 4 additions & 3 deletions smart-admin-web-javascript/src/layout/side-expand-layout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@
<template>
<a-layout class="admin-layout" style="min-height: 100%">
<!-- 侧边菜单 side-menu -->
<a-layout-sider :id="LAYOUT_ELEMENT_IDS.menu" :theme="theme" class="side-menu" :collapsed="collapsed" :trigger="null">
<a-layout-sider :id="LAYOUT_ELEMENT_IDS.menu" :theme="theme" class="side-menu" :collapsed="collapsed" :trigger="null" v-show="!fullScreenFlag">
<!-- 左侧菜单 -->
<SideExpandMenu :collapsed="collapsed" />
</a-layout-sider>

<!--中间内容,一共三部分:1、顶部;2、中间内容区域;3、底部(一般是公司版权信息);-->
<a-layout class="admin-layout-main" :style="`height: ${windowHeight}px`" :id="LAYOUT_ELEMENT_IDS.main">
<!-- 顶部头部信息 -->
<a-layout-header class="smart-layout-header" :id="LAYOUT_ELEMENT_IDS.header">
<a-layout-header class="smart-layout-header" :id="LAYOUT_ELEMENT_IDS.header" v-show="!fullScreenFlag">
<a-row justify="space-between" class="smart-layout-header-user">
<a-col class="smart-layout-header-left">
<span class="collapsed-button">
Expand Down Expand Up @@ -101,7 +101,8 @@
import { LAYOUT_ELEMENT_IDS } from '/@/layout/layout-const.js';

const windowHeight = ref(window.innerHeight);

//是否全屏
const fullScreenFlag = computed(() => useAppConfigStore().$state.fullScreenFlag);
//主题颜色
const theme = computed(() => useAppConfigStore().$state.sideMenuTheme);
//是否显示标签页
Expand Down
6 changes: 4 additions & 2 deletions smart-admin-web-javascript/src/layout/side-layout.vue
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<template>
<a-layout class="admin-layout" style="min-height: 100%">
<!-- 侧边菜单 side-menu -->
<a-layout-sider :id="LAYOUT_ELEMENT_IDS.menu" class="side-menu" :width="sideMenuWidth" :collapsed="collapsed" :theme="theme">
<a-layout-sider :id="LAYOUT_ELEMENT_IDS.menu" class="side-menu" :width="sideMenuWidth" :collapsed="collapsed" :theme="theme" v-show="!fullScreenFlag">
<!-- 左侧菜单 -->
<SideMenu :collapsed="collapsed" />
</a-layout-sider>

<!--中间内容,一共三部分:1、顶部;2、中间内容区域;3、底部(一般是公司版权信息);-->
<a-layout :id="LAYOUT_ELEMENT_IDS.main" :style="`height: ${windowHeight}px`" class="admin-layout-main">
<!-- 顶部头部信息 -->
<a-layout-header class="layout-header" :id="LAYOUT_ELEMENT_IDS.header">
<a-layout-header class="layout-header" :id="LAYOUT_ELEMENT_IDS.header" v-show="!fullScreenFlag">
<a-row class="layout-header-user" justify="space-between">
<a-col class="layout-header-left">
<span class="collapsed-button">
Expand Down Expand Up @@ -96,6 +96,8 @@
import { LAYOUT_ELEMENT_IDS } from '/@/layout/layout-const.js';
const windowHeight = ref(window.innerHeight);
//是否全屏
const fullScreenFlag = computed(() => useAppConfigStore().$state.fullScreenFlag);
//菜单宽度
const sideMenuWidth = computed(() => useAppConfigStore().$state.sideMenuWidth);
//主题颜色
Expand Down
10 changes: 8 additions & 2 deletions smart-admin-web-javascript/src/layout/top-layout.vue
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<template>
<a-layout class="admin-layout">
<!-- 顶部菜单 -->
<a-layout-header class="top-menu" :theme="theme" :id="LAYOUT_ELEMENT_IDS.menu">
<a-layout-header class="top-menu" :theme="theme" :id="LAYOUT_ELEMENT_IDS.menu" v-if="!fullScreenFlag">
<TopMenu />
</a-layout-header>

<!--中间内容-->
<a-layout-content :id="LAYOUT_ELEMENT_IDS.content" class="admin-layout-content">
<!---标签页-->
<div class="page-tag-div" v-show="pageTagFlag" :id="LAYOUT_ELEMENT_IDS.header">
<div class="page-tag-div" v-show="pageTagFlag && !fullScreenFlag" :id="LAYOUT_ELEMENT_IDS.header">
<PageTag />
</div>

Expand Down Expand Up @@ -68,6 +68,8 @@
};
});
//是否全屏
const fullScreenFlag = computed(() => useAppConfigStore().$state.fullScreenFlag);
//是否显示标签页
const pageTagFlag = computed(() => useAppConfigStore().$state.pageTagFlag);
// 是否显示页脚
Expand All @@ -78,6 +80,10 @@
const pageWidth = computed(() => useAppConfigStore().$state.pageWidth);
// 多余高度
const dueHeight = computed(() => {
if (fullScreenFlag.value) {
return '0';
}
let due = '45px';
if (useAppConfigStore().$state.pageTagFlag) {
due = '85px';
Expand Down
Empty file.
Loading

0 comments on commit 56517b6

Please sign in to comment.