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