Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
dataease
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
zhu
dataease
Commits
0a3580dd
提交
0a3580dd
authored
1月 12, 2022
作者:
fit2cloud-chenyw
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refactor: 优化主题切换
上级
b571ef24
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
29 行增加
和
11 行删除
+29
-11
ThemeServer.java
...src/main/java/io/dataease/plugins/server/ThemeServer.java
+14
-8
en.js
frontend/src/lang/en.js
+5
-1
tw.js
frontend/src/lang/tw.js
+5
-1
zh.js
frontend/src/lang/zh.js
+5
-1
没有找到文件。
backend/src/main/java/io/dataease/plugins/server/ThemeServer.java
浏览文件 @
0a3580dd
...
@@ -4,12 +4,13 @@ import java.util.List;
...
@@ -4,12 +4,13 @@ import java.util.List;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestPart
;
import
org.springframework.web.bind.annotation.RequestPart
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.multipart.MultipartFile
;
import
org.springframework.web.multipart.MultipartFile
;
import
io.dataease.commons.exception.DEException
;
import
io.dataease.commons.utils.LogUtil
;
import
io.dataease.plugins.config.SpringContextUtil
;
import
io.dataease.plugins.config.SpringContextUtil
;
import
io.dataease.plugins.xpack.theme.dto.ThemeDto
;
import
io.dataease.plugins.xpack.theme.dto.ThemeDto
;
import
io.dataease.plugins.xpack.theme.dto.ThemeItem
;
import
io.dataease.plugins.xpack.theme.dto.ThemeItem
;
...
@@ -20,10 +21,8 @@ import io.dataease.plugins.xpack.theme.service.ThemeXpackService;
...
@@ -20,10 +21,8 @@ import io.dataease.plugins.xpack.theme.service.ThemeXpackService;
@RestController
@RestController
public
class
ThemeServer
{
public
class
ThemeServer
{
@PostMapping
(
"/themes"
)
@PostMapping
(
"/themes"
)
public
List
<
ThemeDto
>
themes
(){
public
List
<
ThemeDto
>
themes
()
{
ThemeXpackService
themeXpackService
=
SpringContextUtil
.
getBean
(
ThemeXpackService
.
class
);
ThemeXpackService
themeXpackService
=
SpringContextUtil
.
getBean
(
ThemeXpackService
.
class
);
return
themeXpackService
.
themes
();
return
themeXpackService
.
themes
();
...
@@ -36,15 +35,22 @@ public class ThemeServer {
...
@@ -36,15 +35,22 @@ public class ThemeServer {
}
}
@PostMapping
(
"/save"
)
@PostMapping
(
"/save"
)
public
void
save
(
@RequestPart
(
"request"
)
ThemeRequest
request
,
@RequestPart
(
value
=
"file"
,
required
=
false
)
MultipartFile
bodyFile
)
{
public
void
save
(
@RequestPart
(
"request"
)
ThemeRequest
request
,
@RequestPart
(
value
=
"file"
,
required
=
false
)
MultipartFile
bodyFile
)
{
ThemeXpackService
themeXpackService
=
SpringContextUtil
.
getBean
(
ThemeXpackService
.
class
);
ThemeXpackService
themeXpackService
=
SpringContextUtil
.
getBean
(
ThemeXpackService
.
class
);
themeXpackService
.
save
(
request
,
bodyFile
);
try
{
themeXpackService
.
save
(
request
,
bodyFile
);
}
catch
(
Exception
e
)
{
LogUtil
.
error
(
e
.
getMessage
(),
e
);
DEException
.
throwException
(
e
);
}
}
}
@PostMapping
(
"/delete/{themeId}"
)
@PostMapping
(
"/delete/{themeId}"
)
public
void
sav
e
(
@PathVariable
(
"themeId"
)
int
themeId
)
{
public
void
delet
e
(
@PathVariable
(
"themeId"
)
int
themeId
)
{
ThemeXpackService
themeXpackService
=
SpringContextUtil
.
getBean
(
ThemeXpackService
.
class
);
ThemeXpackService
themeXpackService
=
SpringContextUtil
.
getBean
(
ThemeXpackService
.
class
);
themeXpackService
.
deleteTheme
(
themeId
);
themeXpackService
.
deleteTheme
(
themeId
);
}
}
}
}
frontend/src/lang/en.js
浏览文件 @
0a3580dd
...
@@ -131,6 +131,7 @@ export default {
...
@@ -131,6 +131,7 @@ export default {
default_login
:
'Normal'
default_login
:
'Normal'
},
},
commons
:
{
commons
:
{
apply
:
'Apply'
,
search
:
'Search'
,
search
:
'Search'
,
folder
:
'Folder'
,
folder
:
'Folder'
,
no_target_permission
:
'No permission'
,
no_target_permission
:
'No permission'
,
...
@@ -437,7 +438,10 @@ export default {
...
@@ -437,7 +438,10 @@ export default {
background
:
'Background color'
,
background
:
'Background color'
,
custom
:
'Custom color'
,
custom
:
'Custom color'
,
otherSave
:
'Theme Save as'
,
otherSave
:
'Theme Save as'
,
info
:
'Theme info'
info
:
'Theme info'
,
add
:
'Add Theme'
,
please_input_name
:
'Please enter a name'
,
name_repeat
:
'Name already exists'
},
},
tagsView
:
{
tagsView
:
{
refresh
:
'Refresh'
,
refresh
:
'Refresh'
,
...
...
frontend/src/lang/tw.js
浏览文件 @
0a3580dd
...
@@ -131,6 +131,7 @@ export default {
...
@@ -131,6 +131,7 @@ export default {
default_login
:
'普通登錄'
default_login
:
'普通登錄'
},
},
commons
:
{
commons
:
{
apply
:
'應用'
,
search
:
'搜索'
,
search
:
'搜索'
,
folder
:
'目錄'
,
folder
:
'目錄'
,
no_target_permission
:
'沒有權限'
,
no_target_permission
:
'沒有權限'
,
...
@@ -437,7 +438,10 @@ export default {
...
@@ -437,7 +438,10 @@ export default {
background
:
'背景顏色'
,
background
:
'背景顏色'
,
custom
:
'自定義顏色'
,
custom
:
'自定義顏色'
,
otherSave
:
'主題另存為'
,
otherSave
:
'主題另存為'
,
info
:
'主題信息'
info
:
'主題信息'
,
add
:
'新增主題'
,
please_input_name
:
'請輸入名稱'
,
name_repeat
:
'名稱已存在'
},
},
tagsView
:
{
tagsView
:
{
refresh
:
'刷新'
,
refresh
:
'刷新'
,
...
...
frontend/src/lang/zh.js
浏览文件 @
0a3580dd
...
@@ -131,6 +131,7 @@ export default {
...
@@ -131,6 +131,7 @@ export default {
default_login
:
'普通登录'
default_login
:
'普通登录'
},
},
commons
:
{
commons
:
{
apply
:
'应用'
,
search
:
'搜索'
,
search
:
'搜索'
,
folder
:
'目录'
,
folder
:
'目录'
,
no_target_permission
:
'没有权限'
,
no_target_permission
:
'没有权限'
,
...
@@ -438,7 +439,10 @@ export default {
...
@@ -438,7 +439,10 @@ export default {
background
:
'背景颜色'
,
background
:
'背景颜色'
,
custom
:
'自定义颜色'
,
custom
:
'自定义颜色'
,
otherSave
:
'主题另存为'
,
otherSave
:
'主题另存为'
,
info
:
'主题信息'
info
:
'主题信息'
,
add
:
'新增主题'
,
please_input_name
:
'请输入名称'
,
name_repeat
:
'名称已存在'
},
},
tagsView
:
{
tagsView
:
{
refresh
:
'刷新'
,
refresh
:
'刷新'
,
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论