Skip to content

Commit 56517b6

Browse files
author
zhuoda
committed
v3.10.0【新增】全屏模式Modal等终极解决方案;【新增】生成环境去掉跨域;【优化】其他一些小细节
1 parent 472d059 commit 56517b6

File tree

25 files changed

+77
-148
lines changed

25 files changed

+77
-148
lines changed

smart-admin-api-java17-springboot3/sa-base/src/main/java/net/lab1024/sa/base/config/CorsFilterConfig.java

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import org.springframework.beans.factory.annotation.Value;
44
import org.springframework.context.annotation.Bean;
5+
import org.springframework.context.annotation.Conditional;
56
import org.springframework.context.annotation.Configuration;
67
import org.springframework.web.cors.CorsConfiguration;
78
import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
@@ -17,6 +18,7 @@
1718
* @Copyright <a href="https://1024lab.net">1024创新实验室</a>
1819
*/
1920
@Configuration
21+
@Conditional(SystemEnvironmentConfig.class)
2022
public class CorsFilterConfig {
2123

2224
@Value("${access-control-allow-origin}")

smart-admin-api-java17-springboot3/sa-base/src/main/java/net/lab1024/sa/base/module/support/codegenerator/service/variable/backend/domain/AddFormVariableService.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@ public ImmutablePair<List<String>, List<Map<String, Object>>> getPackageListAndF
9696
if (Boolean.TRUE.equals(field.getRequiredFlag())) {
9797
String notEmptyPrefix = "String".equals(codeField.getJavaType()) ? "@NotBlank" : "@NotNull";
9898
finalFieldMap.put("notEmpty", "\n " + notEmptyPrefix + "(message = \"" + codeField.getLabel() + " 不能为空\")");
99-
packageList.add("String".equals(codeField.getJavaType()) ? "import javax.validation.constraints.NotBlank;"
100-
: "import javax.validation.constraints.NotNull;");
99+
packageList.add("String".equals(codeField.getJavaType()) ? "import jakarta.validation.constraints.NotBlank;"
100+
: "import jakarta.validation.constraints.NotNull;");
101101
}
102102
}
103103

smart-admin-api-java17-springboot3/sa-base/src/main/java/net/lab1024/sa/base/module/support/codegenerator/service/variable/backend/domain/UpdateFormVariableService.java

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

smart-admin-api-java17-springboot3/sa-base/src/main/java/net/lab1024/sa/base/module/support/dict/service/DictService.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ public ResponseDTO<PageResult<DictKeyVO>> keyQuery(DictKeyQueryForm queryForm) {
172172
* @return
173173
*/
174174
public List<DictKeyVO> queryAllKey() {
175-
return SmartBeanUtil.copyList(dictKeyDao.selectList(null), DictKeyVO.class);
175+
return SmartBeanUtil.copyList(dictKeyDao.selectByDeletedFlag(false), DictKeyVO.class);
176176
}
177177

178178
/**

smart-admin-api-java17-springboot3/sa-base/src/main/resources/code-generator-template/java/dao/Dao.java.vm

+2-2
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,14 @@ public interface ${name.upperCamel}Dao extends BaseMapper<${name.upperCamel}Enti
3737
/**
3838
* 更新删除状态
3939
*/
40-
long updateDeleted(@Param("${primaryKeyFieldName}")${primaryKeyJavaType} ${primaryKeyFieldName},@Param("${deletedFlag}")boolean deletedFlag);
40+
long updateDeleted(@Param("${primaryKeyFieldName}")${primaryKeyJavaType} ${primaryKeyFieldName},@Param("deletedFlag")boolean deletedFlag);
4141

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

4949
#end
5050
#end

smart-admin-api-java17-springboot3/sa-base/src/main/resources/dev/sa-base.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ spring:
4040
host: smtp.163.com
4141
port: 465
4242
43-
password: LAB1024LAB
43+
password: ROIMSIQCEXHTQFTA
4444
properties:
4545
mail:
4646
smtp:

smart-admin-api-java17-springboot3/sa-base/src/main/resources/prod/sa-base.yaml

+13-18
Original file line numberDiff line numberDiff line change
@@ -21,26 +21,24 @@ spring:
2121
pointcut: net.lab1024.sa..*Service.*
2222

2323
# redis 连接池配置信息
24-
data:
25-
redis:
26-
database: 1
27-
host: 127.0.0.1
28-
port: 6379
29-
password:
30-
timeout: 10000ms
31-
lettuce:
32-
pool:
33-
max-active: 5
34-
min-idle: 1
35-
max-idle: 3
36-
max-wait: 30000ms
37-
24+
redis:
25+
database: 1
26+
host: 127.0.0.1
27+
port: 6379
28+
password:
29+
timeout: 10000ms
30+
lettuce:
31+
pool:
32+
max-active: 100
33+
min-idle: 10
34+
max-idle: 50
35+
max-wait: 30000ms
3836
# 邮件,置以SSL的方式发送, 这个需要使用这种方式并且端口是465
3937
mail:
4038
host: smtp.163.com
4139
port: 465
4240
43-
password: LAB1024LAB
41+
password: 1024lab
4442
properties:
4543
mail:
4644
smtp:
@@ -119,9 +117,6 @@ http:
119117
write-timeout: 50000
120118
keep-alive: 300000
121119

122-
# 跨域配置
123-
access-control-allow-origin: 'https://preview.smartadmin.vip'
124-
125120
# 心跳配置
126121
heart-beat:
127122
interval-seconds: 60

smart-admin-api-java8-springboot2/sa-base/src/main/java/net/lab1024/sa/base/config/CorsFilterConfig.java

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import org.springframework.beans.factory.annotation.Value;
44
import org.springframework.context.annotation.Bean;
5+
import org.springframework.context.annotation.Conditional;
56
import org.springframework.context.annotation.Configuration;
67
import org.springframework.web.cors.CorsConfiguration;
78
import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
@@ -17,6 +18,7 @@
1718
* @Copyright <a href="https://1024lab.net">1024创新实验室</a>
1819
*/
1920
@Configuration
21+
@Conditional(SystemEnvironmentConfig.class)
2022
public class CorsFilterConfig {
2123

2224
@Value("${access-control-allow-origin}")

smart-admin-api-java8-springboot2/sa-base/src/main/java/net/lab1024/sa/base/module/support/dict/service/DictService.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ public ResponseDTO<PageResult<DictKeyVO>> keyQuery(DictKeyQueryForm queryForm) {
172172
* @return
173173
*/
174174
public List<DictKeyVO> queryAllKey() {
175-
return SmartBeanUtil.copyList(dictKeyDao.selectList(null), DictKeyVO.class);
175+
return SmartBeanUtil.copyList(dictKeyDao.selectByDeletedFlag(false), DictKeyVO.class);
176176
}
177177

178178
/**

smart-admin-api-java8-springboot2/sa-base/src/main/resources/code-generator-template/java/dao/Dao.java.vm

+2-2
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,14 @@ public interface ${name.upperCamel}Dao extends BaseMapper<${name.upperCamel}Enti
3737
/**
3838
* 更新删除状态
3939
*/
40-
long updateDeleted(@Param("${primaryKeyFieldName}")${primaryKeyJavaType} ${primaryKeyFieldName},@Param("${deletedFlag}")boolean deletedFlag);
40+
long updateDeleted(@Param("${primaryKeyFieldName}")${primaryKeyJavaType} ${primaryKeyFieldName},@Param("deletedFlag")boolean deletedFlag);
4141

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

4949
#end
5050
#end

smart-admin-api-java8-springboot2/sa-base/src/main/resources/prod/sa-base.yaml

+1-4
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ spring:
3838
host: smtp.163.com
3939
port: 465
4040
41-
password: LAB1024LAB
41+
password: 1024lab
4242
properties:
4343
mail:
4444
smtp:
@@ -117,9 +117,6 @@ http:
117117
write-timeout: 50000
118118
keep-alive: 300000
119119

120-
# 跨域配置
121-
access-control-allow-origin: 'https://preview.smartadmin.vip'
122-
123120
# 心跳配置
124121
heart-beat:
125122
interval-seconds: 60

smart-admin-web-javascript/README.en.md

Whitespace-only changes.

smart-admin-web-javascript/README.md

Whitespace-only changes.

smart-admin-web-javascript/index.html

-14
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,6 @@
1919
</head>
2020
<body>
2121
<div id="app"></div>
22-
<script>
23-
let url = window.location.href;
24-
if(url.indexOf("1024lab") > -1){
25-
location.href = "https://preview.smartadmin.vip";
26-
}
27-
28-
var _hmt = _hmt || [];
29-
(function() {
30-
var hm = document.createElement("script");
31-
hm.src = "https://hm.baidu.com/hm.js?5e12fadc47eb3aac662d848fd39ec07a";
32-
var s = document.getElementsByTagName("script")[0];
33-
s.parentNode.insertBefore(hm, s);
34-
})();
35-
</script>
3622
<script type="module" src="/src/main.js"></script>
3723
</body>
3824
</html>

smart-admin-web-javascript/src/App.vue

-30
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
},
3333
},
3434
}"
35-
:getPopupContainer="getPopupContainer"
3635
>
3736
<!---全局loading--->
3837
<a-spin :spinning="spinning" tip="稍等片刻,我在拼命加载中..." size="large">
@@ -50,8 +49,6 @@
5049
import { useSpinStore } from '/@/store/modules/system/spin';
5150
import { theme } from 'ant-design-vue';
5251
import { themeColors } from '/@/theme/color.js';
53-
import { SmartLoading } from '/@/components/framework/smart-loading/index.js';
54-
import { LAYOUT_ELEMENT_IDS } from '/@/layout/layout-const.js';
5552

5653
const antdLocale = computed(() => messages[useAppConfigStore().language].antdLocale);
5754
const dayjsLocale = computed(() => messages[useAppConfigStore().language].dayjsLocale);
@@ -70,31 +67,4 @@
7067
const borderRadius = computed(() => {
7168
return useAppConfigStore().borderRadius;
7269
});
73-
74-
function getPopupContainer(node, dialogContext) {
75-
let fullScreenFlag = useAppConfigStore().$state.fullScreenFlag;
76-
if(fullScreenFlag){
77-
return getFullScreenContainer(node, dialogContext);
78-
}else{
79-
return getNotFullScreenContainer(node, dialogContext);
80-
}
81-
}
82-
83-
function getFullScreenContainer(node, dialogContext) {
84-
if (node === document.body) {
85-
return document.getElementById(LAYOUT_ELEMENT_IDS.content);
86-
}else if (node) {
87-
return node.parentNode;
88-
} else {
89-
return document.getElementById(LAYOUT_ELEMENT_IDS.content);
90-
}
91-
}
92-
93-
function getNotFullScreenContainer(node, dialogContext) {
94-
if (node) {
95-
return node.parentNode;
96-
} else {
97-
return document.body;
98-
}
99-
}
10070
</script>

smart-admin-web-javascript/src/components/support/table-operator/index.vue

+5-14
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,13 @@
3838
<script setup>
3939
import _ from 'lodash';
4040
import { tableColumnApi } from '/@/api/support/table-column-api';
41-
import { onMounted, reactive, ref, watch } from 'vue';
41+
import { onMounted, ref, watch } from 'vue';
4242
import SmartTableColumnModal from './smart-table-column-modal.vue';
4343
import { message } from 'ant-design-vue';
4444
import { mergeColumn } from './smart-table-column-merge';
4545
import { smartSentry } from '/@/lib/smart-sentry';
46-
import { LAYOUT_ELEMENT_IDS } from '/@/layout/layout-const.js';
4746
import { useAppConfigStore } from '/@/store/modules/system/app-config.js';
47+
4848
const props = defineProps({
4949
// 表格列数组
5050
modelValue: {
@@ -89,7 +89,6 @@
8989
} catch (e) {
9090
smartSentry.captureError(e);
9191
}
92-
9392
updateColumn(userTableColumnArray);
9493
}
9594

@@ -100,24 +99,16 @@
10099
if (fullScreenFlag.value) {
101100
// 退出全屏
102101
handleExitFullScreen();
103-
exitElementFullscreen(document.getElementById(LAYOUT_ELEMENT_IDS.content));
102+
exitElementFullscreen(document.body);
104103
} else {
105-
//全屏
106-
message.config({
107-
getContainer: () => document.getElementById(LAYOUT_ELEMENT_IDS.content),
108-
});
109104
fullScreenFlag.value = true;
110105
useAppConfigStore().startFullScreen();
111-
launchElementFullScreen(document.getElementById(LAYOUT_ELEMENT_IDS.content));
106+
launchElementFullScreen(document.body);
112107
}
113108
}
114109

115110
// 处理退出全屏
116-
function handleExitFullScreen(){
117-
//取消全屏
118-
message.config({
119-
getContainer: () => document.body,
120-
});
111+
function handleExitFullScreen() {
121112
fullScreenFlag.value = false;
122113
useAppConfigStore().exitFullScreen();
123114
document.removeEventListener('fullscreenchange', handleFullscreenChange);

smart-admin-web-javascript/src/layout/side-expand-layout.vue

+4-3
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@
1010
<template>
1111
<a-layout class="admin-layout" style="min-height: 100%">
1212
<!-- 侧边菜单 side-menu -->
13-
<a-layout-sider :id="LAYOUT_ELEMENT_IDS.menu" :theme="theme" class="side-menu" :collapsed="collapsed" :trigger="null">
13+
<a-layout-sider :id="LAYOUT_ELEMENT_IDS.menu" :theme="theme" class="side-menu" :collapsed="collapsed" :trigger="null" v-show="!fullScreenFlag">
1414
<!-- 左侧菜单 -->
1515
<SideExpandMenu :collapsed="collapsed" />
1616
</a-layout-sider>
1717

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

103103
const windowHeight = ref(window.innerHeight);
104-
104+
//是否全屏
105+
const fullScreenFlag = computed(() => useAppConfigStore().$state.fullScreenFlag);
105106
//主题颜色
106107
const theme = computed(() => useAppConfigStore().$state.sideMenuTheme);
107108
//是否显示标签页

smart-admin-web-javascript/src/layout/side-layout.vue

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
<template>
22
<a-layout class="admin-layout" style="min-height: 100%">
33
<!-- 侧边菜单 side-menu -->
4-
<a-layout-sider :id="LAYOUT_ELEMENT_IDS.menu" class="side-menu" :width="sideMenuWidth" :collapsed="collapsed" :theme="theme">
4+
<a-layout-sider :id="LAYOUT_ELEMENT_IDS.menu" class="side-menu" :width="sideMenuWidth" :collapsed="collapsed" :theme="theme" v-show="!fullScreenFlag">
55
<!-- 左侧菜单 -->
66
<SideMenu :collapsed="collapsed" />
77
</a-layout-sider>
88

99
<!--中间内容,一共三部分:1、顶部;2、中间内容区域;3、底部(一般是公司版权信息);-->
1010
<a-layout :id="LAYOUT_ELEMENT_IDS.main" :style="`height: ${windowHeight}px`" class="admin-layout-main">
1111
<!-- 顶部头部信息 -->
12-
<a-layout-header class="layout-header" :id="LAYOUT_ELEMENT_IDS.header">
12+
<a-layout-header class="layout-header" :id="LAYOUT_ELEMENT_IDS.header" v-show="!fullScreenFlag">
1313
<a-row class="layout-header-user" justify="space-between">
1414
<a-col class="layout-header-left">
1515
<span class="collapsed-button">
@@ -96,6 +96,8 @@
9696
import { LAYOUT_ELEMENT_IDS } from '/@/layout/layout-const.js';
9797
9898
const windowHeight = ref(window.innerHeight);
99+
//是否全屏
100+
const fullScreenFlag = computed(() => useAppConfigStore().$state.fullScreenFlag);
99101
//菜单宽度
100102
const sideMenuWidth = computed(() => useAppConfigStore().$state.sideMenuWidth);
101103
//主题颜色

smart-admin-web-javascript/src/layout/top-layout.vue

+8-2
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
<template>
22
<a-layout class="admin-layout">
33
<!-- 顶部菜单 -->
4-
<a-layout-header class="top-menu" :theme="theme" :id="LAYOUT_ELEMENT_IDS.menu">
4+
<a-layout-header class="top-menu" :theme="theme" :id="LAYOUT_ELEMENT_IDS.menu" v-if="!fullScreenFlag">
55
<TopMenu />
66
</a-layout-header>
77

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

@@ -68,6 +68,8 @@
6868
};
6969
});
7070
71+
//是否全屏
72+
const fullScreenFlag = computed(() => useAppConfigStore().$state.fullScreenFlag);
7173
//是否显示标签页
7274
const pageTagFlag = computed(() => useAppConfigStore().$state.pageTagFlag);
7375
// 是否显示页脚
@@ -78,6 +80,10 @@
7880
const pageWidth = computed(() => useAppConfigStore().$state.pageWidth);
7981
// 多余高度
8082
const dueHeight = computed(() => {
83+
if (fullScreenFlag.value) {
84+
return '0';
85+
}
86+
8187
let due = '45px';
8288
if (useAppConfigStore().$state.pageTagFlag) {
8389
due = '85px';

smart-admin-web-typescript/README.md

Whitespace-only changes.

0 commit comments

Comments
 (0)