Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
dataease
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
zhu
dataease
Commits
23acb3c9
Unverified
提交
23acb3c9
authored
5月 31, 2022
作者:
王嘉豪
提交者:
GitHub
5月 31, 2022
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #2360 from dataease/pr@dev@refactor_panel-save
refactor: 优化仪表板保存返回信息
上级
feabca53
38ad5a19
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
30 行增加
和
20 行删除
+30
-20
PanelGroupController.java
...va/io/dataease/controller/panel/PanelGroupController.java
+17
-5
PanelGroupService.java
...ain/java/io/dataease/service/panel/PanelGroupService.java
+2
-12
panel.js
frontend/src/api/panel/panel.js
+8
-0
index.vue
frontend/src/views/panel/list/EditPanel/index.vue
+3
-3
没有找到文件。
backend/src/main/java/io/dataease/controller/panel/PanelGroupController.java
浏览文件 @
23acb3c9
...
...
@@ -62,10 +62,22 @@ public class PanelGroupController {
@DePermission
(
type
=
DePermissionType
.
PANEL
,
value
=
"pid"
,
level
=
ResourceAuthLevel
.
PANNEL_LEVEL_MANAGE
)
},
logical
=
Logical
.
AND
)
@I18n
public
PanelGroup
saveOrUpdate
(
@RequestBody
PanelGroupRequest
request
)
{
public
String
saveOrUpdate
(
@RequestBody
PanelGroupRequest
request
)
{
return
panelGroupService
.
saveOrUpdate
(
request
);
}
@ApiOperation
(
"保存并返回数据"
)
@PostMapping
(
"/saveWithData"
)
@DePermissions
(
value
=
{
@DePermission
(
type
=
DePermissionType
.
PANEL
,
value
=
"id"
),
@DePermission
(
type
=
DePermissionType
.
PANEL
,
value
=
"pid"
,
level
=
ResourceAuthLevel
.
PANNEL_LEVEL_MANAGE
)
},
logical
=
Logical
.
AND
)
@I18n
public
PanelGroup
saveOrUpdateWithData
(
@RequestBody
PanelGroupRequest
request
)
throws
Exception
{
String
panelId
=
panelGroupService
.
saveOrUpdate
(
request
);
return
findOne
(
panelId
);
}
@ApiOperation
(
"删除"
)
@DePermission
(
type
=
DePermissionType
.
PANEL
,
level
=
ResourceAuthLevel
.
PANNEL_LEVEL_MANAGE
)
@PostMapping
(
"/deleteCircle/{id}"
)
...
...
@@ -107,7 +119,7 @@ public class PanelGroupController {
@ApiOperation
(
"仪表板组件信息"
)
@GetMapping
(
"/queryPanelComponents/{id}"
)
@I18n
public
Map
queryPanelComponents
(
@PathVariable
String
id
){
public
Map
queryPanelComponents
(
@PathVariable
String
id
)
{
return
panelGroupService
.
queryPanelComponents
(
id
);
}
...
...
@@ -115,15 +127,15 @@ public class PanelGroupController {
@PostMapping
(
"/exportDetails"
)
@I18n
public
void
exportDetails
(
@RequestBody
PanelViewDetailsRequest
request
,
HttpServletResponse
response
)
throws
IOException
{
panelGroupService
.
exportPanelViewDetails
(
request
,
response
);
panelGroupService
.
exportPanelViewDetails
(
request
,
response
);
}
@ApiOperation
(
"更新仪表板状态"
)
@PostMapping
(
"/updatePanelStatus/{panelId}"
)
@I18n
@DePermission
(
type
=
DePermissionType
.
PANEL
,
level
=
ResourceAuthLevel
.
PANNEL_LEVEL_MANAGE
)
public
void
updatePanelStatus
(
@PathVariable
String
panelId
,
@RequestBody
PanelGroupBaseInfoRequest
request
)
{
panelGroupService
.
updatePanelStatus
(
panelId
,
request
);
public
void
updatePanelStatus
(
@PathVariable
String
panelId
,
@RequestBody
PanelGroupBaseInfoRequest
request
)
{
panelGroupService
.
updatePanelStatus
(
panelId
,
request
);
}
}
backend/src/main/java/io/dataease/service/panel/PanelGroupService.java
浏览文件 @
23acb3c9
...
...
@@ -121,7 +121,7 @@ public class PanelGroupService {
}
@DeCleaner
(
value
=
DePermissionType
.
PANEL
,
key
=
"pid"
)
public
PanelGroup
saveOrUpdate
(
PanelGroupRequest
request
)
{
public
String
saveOrUpdate
(
PanelGroupRequest
request
)
{
String
panelId
=
request
.
getId
();
if
(
StringUtils
.
isNotEmpty
(
panelId
))
{
panelViewService
.
syncPanelViews
(
request
);
...
...
@@ -191,19 +191,9 @@ public class PanelGroupService {
request
.
setPid
(
panel
.
getPid
());
}
}
DeLogUtils
.
save
(
SysLogConstants
.
OPERATE_TYPE
.
MODIFY
,
sourceType
,
request
.
getId
(),
request
.
getPid
(),
null
,
sourceType
);
}
//带有权限的返回
PanelGroupRequest
authRequest
=
new
PanelGroupRequest
();
authRequest
.
setId
(
panelId
);
authRequest
.
setUserId
(
String
.
valueOf
(
AuthUtils
.
getUser
().
getUserId
()));
List
<
PanelGroupDTO
>
panelGroupDTOList
=
extPanelGroupMapper
.
panelGroupList
(
authRequest
);
if
(!
CollectionUtils
.
isNotEmpty
(
panelGroupDTOList
))
{
DataEaseException
.
throwException
(
"未查询到用户对应的资源权限,请尝试刷新重新保存"
);
}
return
panelGroupDTOList
.
get
(
0
);
return
panelId
;
}
...
...
frontend/src/api/panel/panel.js
浏览文件 @
23acb3c9
...
...
@@ -72,6 +72,14 @@ export function panelSave(data) {
data
})
}
export
function
panelSaveWithData
(
data
)
{
return
request
({
url
:
'panel/group/saveWithData'
,
method
:
'post'
,
loading
:
true
,
data
})
}
export
function
findOne
(
id
)
{
return
request
({
url
:
'panel/group/findOne/'
+
id
,
...
...
frontend/src/views/panel/list/EditPanel/index.vue
浏览文件 @
23acb3c9
...
...
@@ -23,7 +23,7 @@
</el-col>
<el-col
:span=
"16"
:style=
"classBackground"
class=
"preview-show"
/>
</el-row>
<el-row
v-if=
"inputType==='new_outer_template'"
class=
"preview"
:style=
"classBackground"
/>
<el-row
v-if=
"inputType==='new_outer_template'"
class=
"preview"
:style=
"classBackground"
/>
<el-row
class=
"root-class"
>
<el-button
size=
"mini"
@
click=
"cancel()"
>
{{
$t
(
'commons.cancel'
)
}}
</el-button>
<el-button
type=
"primary"
size=
"mini"
@
click=
"save()"
>
{{
$t
(
'commons.confirm'
)
}}
</el-button>
...
...
@@ -32,7 +32,7 @@
</
template
>
<
script
>
import
{
panelSave
}
from
'@/api/panel/panel'
import
{
panelSave
WithData
}
from
'@/api/panel/panel'
import
{
showTemplateList
}
from
'@/api/system/template'
import
TemplateAllList
from
'./TemplateAllList'
import
{
deepCopy
}
from
'@/components/canvas/utils/utils'
...
...
@@ -147,7 +147,7 @@ export default {
}
this
.
editPanel
.
panelInfo
[
'newFrom'
]
=
this
.
inputType
this
.
loading
=
true
panelSave
(
this
.
editPanel
.
panelInfo
).
then
(
response
=>
{
panelSave
WithData
(
this
.
editPanel
.
panelInfo
).
then
(
response
=>
{
this
.
$message
({
message
:
this
.
$t
(
'commons.save_success'
),
type
:
'success'
,
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论