Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
dataease
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
njgzx
dataease
Commits
edc98783
提交
edc98783
authored
5月 31, 2022
作者:
wangjiahao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refactor: 仪表板保存优化
上级
23acb3c9
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
55 行增加
和
37 行删除
+55
-37
PanelGroupController.java
...va/io/dataease/controller/panel/PanelGroupController.java
+7
-7
PanelGroupService.java
...ain/java/io/dataease/service/panel/PanelGroupService.java
+15
-13
panel.js
frontend/src/api/panel/panel.js
+4
-2
Toolbar.vue
frontend/src/components/canvas/components/Toolbar.vue
+2
-2
index.vue
frontend/src/views/panel/list/EditPanel/index.vue
+25
-11
PanelList.vue
frontend/src/views/panel/list/PanelList.vue
+2
-2
没有找到文件。
backend/src/main/java/io/dataease/controller/panel/PanelGroupController.java
浏览文件 @
edc98783
...
@@ -62,20 +62,20 @@ public class PanelGroupController {
...
@@ -62,20 +62,20 @@ 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
String
saveOrUpdate
(
@RequestBody
PanelGroupRequest
request
)
{
public
PanelGroup
save
(
@RequestBody
PanelGroupRequest
request
)
throws
Exception
{
return
panelGroupService
.
saveOrUpdate
(
request
);
String
panelId
=
panelGroupService
.
save
(
request
);
return
findOne
(
panelId
);
}
}
@ApiOperation
(
"
保存并返回数据
"
)
@ApiOperation
(
"
更新
"
)
@PostMapping
(
"/
saveWithData
"
)
@PostMapping
(
"/
update
"
)
@DePermissions
(
value
=
{
@DePermissions
(
value
=
{
@DePermission
(
type
=
DePermissionType
.
PANEL
,
value
=
"id"
),
@DePermission
(
type
=
DePermissionType
.
PANEL
,
value
=
"id"
),
@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
saveOrUpdateWithData
(
@RequestBody
PanelGroupRequest
request
)
throws
Exception
{
public
String
update
(
@RequestBody
PanelGroupRequest
request
)
{
String
panelId
=
panelGroupService
.
saveOrUpdate
(
request
);
return
panelGroupService
.
update
(
request
);
return
findOne
(
panelId
);
}
}
@ApiOperation
(
"删除"
)
@ApiOperation
(
"删除"
)
...
...
backend/src/main/java/io/dataease/service/panel/PanelGroupService.java
浏览文件 @
edc98783
...
@@ -121,20 +121,22 @@ public class PanelGroupService {
...
@@ -121,20 +121,22 @@ public class PanelGroupService {
}
}
@DeCleaner
(
value
=
DePermissionType
.
PANEL
,
key
=
"pid"
)
@DeCleaner
(
value
=
DePermissionType
.
PANEL
,
key
=
"pid"
)
public
String
saveOrUpdate
(
PanelGroupRequest
request
)
{
public
String
save
(
PanelGroupRequest
request
)
{
checkPanelName
(
request
.
getName
(),
request
.
getPid
(),
PanelConstants
.
OPT_TYPE_INSERT
,
null
,
request
.
getNodeType
());
String
panelId
=
newPanel
(
request
);
panelGroupMapper
.
insertSelective
(
request
);
// 清理权限缓存
clearPermissionCache
();
sysAuthService
.
copyAuth
(
panelId
,
SysAuthConstants
.
AUTH_SOURCE_TYPE_PANEL
);
DeLogUtils
.
save
(
SysLogConstants
.
OPERATE_TYPE
.
CREATE
,
sourceType
,
panelId
,
request
.
getPid
(),
null
,
null
);
return
panelId
;
}
public
String
update
(
PanelGroupRequest
request
)
{
String
panelId
=
request
.
getId
();
String
panelId
=
request
.
getId
();
if
(
StringUtils
.
isNotEmpty
(
panelId
))
{
panelViewService
.
syncPanelViews
(
request
);
panelViewService
.
syncPanelViews
(
request
);
if
(
"toDefaultPanel"
.
equals
(
request
.
getOptType
()))
{
// 转存为默认仪表板
}
if
(
StringUtils
.
isEmpty
(
panelId
))
{
// 新建
checkPanelName
(
request
.
getName
(),
request
.
getPid
(),
PanelConstants
.
OPT_TYPE_INSERT
,
null
,
request
.
getNodeType
());
panelId
=
newPanel
(
request
);
panelGroupMapper
.
insertSelective
(
request
);
// 清理权限缓存
clearPermissionCache
();
sysAuthService
.
copyAuth
(
panelId
,
SysAuthConstants
.
AUTH_SOURCE_TYPE_PANEL
);
DeLogUtils
.
save
(
SysLogConstants
.
OPERATE_TYPE
.
CREATE
,
sourceType
,
panelId
,
request
.
getPid
(),
null
,
null
);
}
else
if
(
"toDefaultPanel"
.
equals
(
request
.
getOptType
()))
{
// 转存为默认仪表板
panelId
=
UUID
.
randomUUID
().
toString
();
panelId
=
UUID
.
randomUUID
().
toString
();
PanelGroupWithBLOBs
newDefaultPanel
=
panelGroupMapper
.
selectByPrimaryKey
(
request
.
getId
());
PanelGroupWithBLOBs
newDefaultPanel
=
panelGroupMapper
.
selectByPrimaryKey
(
request
.
getId
());
newDefaultPanel
.
setPanelType
(
PanelConstants
.
PANEL_TYPE
.
SYSTEM
);
newDefaultPanel
.
setPanelType
(
PanelConstants
.
PANEL_TYPE
.
SYSTEM
);
...
...
frontend/src/api/panel/panel.js
浏览文件 @
edc98783
...
@@ -72,14 +72,16 @@ export function panelSave(data) {
...
@@ -72,14 +72,16 @@ export function panelSave(data) {
data
data
})
})
}
}
export
function
panelSaveWithData
(
data
)
{
export
function
panelUpdate
(
data
)
{
return
request
({
return
request
({
url
:
'panel/group/
saveWithData
'
,
url
:
'panel/group/
update
'
,
method
:
'post'
,
method
:
'post'
,
loading
:
true
,
loading
:
true
,
data
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/components/canvas/components/Toolbar.vue
浏览文件 @
edc98783
...
@@ -87,7 +87,7 @@ import { mapState } from 'vuex'
...
@@ -87,7 +87,7 @@ import { mapState } from 'vuex'
import
{
commonStyle
,
commonAttr
}
from
'@/components/canvas/custom-component/component-list'
import
{
commonStyle
,
commonAttr
}
from
'@/components/canvas/custom-component/component-list'
import
eventBus
from
'@/components/canvas/utils/eventBus'
import
eventBus
from
'@/components/canvas/utils/eventBus'
import
{
deepCopy
,
mobile2MainCanvas
}
from
'@/components/canvas/utils/utils'
import
{
deepCopy
,
mobile2MainCanvas
}
from
'@/components/canvas/utils/utils'
import
{
panel
Sav
e
}
from
'@/api/panel/panel'
import
{
panel
Updat
e
}
from
'@/api/panel/panel'
import
{
saveLinkage
,
getPanelAllLinkageInfo
}
from
'@/api/panel/linkage'
import
{
saveLinkage
,
getPanelAllLinkageInfo
}
from
'@/api/panel/linkage'
import
bus
from
'@/utils/bus'
import
bus
from
'@/utils/bus'
import
{
import
{
...
@@ -295,7 +295,7 @@ export default {
...
@@ -295,7 +295,7 @@ export default {
})
})
// 无需保存条件
// 无需保存条件
requestInfo
.
panelData
=
JSON
.
stringify
(
components
)
requestInfo
.
panelData
=
JSON
.
stringify
(
components
)
panel
Sav
e
(
requestInfo
).
then
(
response
=>
{
panel
Updat
e
(
requestInfo
).
then
(
response
=>
{
this
.
$store
.
commit
(
'refreshSaveStatus'
)
this
.
$store
.
commit
(
'refreshSaveStatus'
)
this
.
$message
({
this
.
$message
({
message
:
this
.
$t
(
'commons.save_success'
),
message
:
this
.
$t
(
'commons.save_success'
),
...
...
frontend/src/views/panel/list/EditPanel/index.vue
浏览文件 @
edc98783
...
@@ -32,7 +32,7 @@
...
@@ -32,7 +32,7 @@
</
template
>
</
template
>
<
script
>
<
script
>
import
{
panelSave
WithData
}
from
'@/api/panel/panel'
import
{
panelSave
,
panelUpdate
}
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,17 +147,31 @@ export default {
...
@@ -147,17 +147,31 @@ export default {
}
}
this
.
editPanel
.
panelInfo
[
'newFrom'
]
=
this
.
inputType
this
.
editPanel
.
panelInfo
[
'newFrom'
]
=
this
.
inputType
this
.
loading
=
true
this
.
loading
=
true
panelSaveWithData
(
this
.
editPanel
.
panelInfo
).
then
(
response
=>
{
if
(
this
.
editPanel
.
optType
===
'new'
)
{
this
.
$message
({
panelSave
(
this
.
editPanel
.
panelInfo
).
then
(
response
=>
{
message
:
this
.
$t
(
'commons.save_success'
),
this
.
$message
({
type
:
'success'
,
message
:
this
.
$t
(
'commons.save_success'
),
showClose
:
true
type
:
'success'
,
showClose
:
true
})
this
.
loading
=
false
this
.
$emit
(
'closeEditPanelDialog'
,
response
.
data
)
}).
catch
(()
=>
{
this
.
loading
=
false
})
})
this
.
loading
=
false
}
else
{
this
.
$emit
(
'closeEditPanelDialog'
,
response
.
data
)
panelUpdate
(
this
.
editPanel
.
panelInfo
).
then
(
response
=>
{
}).
catch
(()
=>
{
this
.
$message
({
this
.
loading
=
false
message
:
this
.
$t
(
'commons.save_success'
),
})
type
:
'success'
,
showClose
:
true
})
this
.
loading
=
false
this
.
$emit
(
'closeEditPanelDialog'
,
response
.
data
)
}).
catch
(()
=>
{
this
.
loading
=
false
})
}
},
},
handleFileChange
(
e
)
{
handleFileChange
(
e
)
{
const
file
=
e
.
target
.
files
[
0
]
const
file
=
e
.
target
.
files
[
0
]
...
...
frontend/src/views/panel/list/PanelList.vue
浏览文件 @
edc98783
...
@@ -228,7 +228,7 @@ import LinkGenerate from '@/views/link/generate'
...
@@ -228,7 +228,7 @@ import LinkGenerate from '@/views/link/generate'
import
{
uuid
}
from
'vue-uuid'
import
{
uuid
}
from
'vue-uuid'
import
bus
from
'@/utils/bus'
import
bus
from
'@/utils/bus'
import
EditPanel
from
'./EditPanel'
import
EditPanel
from
'./EditPanel'
import
{
addGroup
,
delGroup
,
groupTree
,
defaultTree
,
panelSave
,
initPanelData
}
from
'@/api/panel/panel'
import
{
addGroup
,
delGroup
,
groupTree
,
defaultTree
,
panelSave
,
initPanelData
,
panelUpdate
}
from
'@/api/panel/panel'
import
{
mapState
}
from
'vuex'
import
{
mapState
}
from
'vuex'
import
{
import
{
DEFAULT_COMMON_CANVAS_STYLE_STRING
DEFAULT_COMMON_CANVAS_STYLE_STRING
...
@@ -779,7 +779,7 @@ export default {
...
@@ -779,7 +779,7 @@ export default {
saveMoveGroup
()
{
saveMoveGroup
()
{
this
.
moveInfo
.
pid
=
this
.
tGroup
.
id
this
.
moveInfo
.
pid
=
this
.
tGroup
.
id
this
.
moveInfo
[
'optType'
]
=
'move'
this
.
moveInfo
[
'optType'
]
=
'move'
panel
Sav
e
(
this
.
moveInfo
).
then
(
response
=>
{
panel
Updat
e
(
this
.
moveInfo
).
then
(
response
=>
{
this
.
tree
()
this
.
tree
()
this
.
closeMoveGroup
()
this
.
closeMoveGroup
()
})
})
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论