Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
dataease
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
njgzx
dataease
Commits
0c0f6d2f
提交
0c0f6d2f
authored
3月 10, 2022
作者:
wangjiahao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refactor: 优化新建视图操作
上级
02df8cb9
显示空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
64 行增加
和
18 行删除
+64
-18
ChartViewController.java
...ava/io/dataease/controller/chart/ChartViewController.java
+10
-2
ChartViewCacheRequest.java
...aease/controller/request/chart/ChartViewCacheRequest.java
+15
-0
ChartViewService.java
...main/java/io/dataease/service/chart/ChartViewService.java
+18
-1
PanelGroupService.java
...ain/java/io/dataease/service/panel/PanelGroupService.java
+3
-1
Group.vue
frontend/src/views/chart/group/Group.vue
+1
-1
ChartEdit.vue
frontend/src/views/chart/view/ChartEdit.vue
+1
-1
index.vue
frontend/src/views/panel/edit/index.vue
+16
-12
没有找到文件。
backend/src/main/java/io/dataease/controller/chart/ChartViewController.java
浏览文件 @
0c0f6d2f
...
...
@@ -9,6 +9,7 @@ import io.dataease.commons.constants.DePermissionType;
import
io.dataease.commons.constants.ResourceAuthLevel
;
import
io.dataease.controller.request.chart.ChartCalRequest
;
import
io.dataease.controller.request.chart.ChartExtRequest
;
import
io.dataease.controller.request.chart.ChartViewCacheRequest
;
import
io.dataease.controller.request.chart.ChartViewRequest
;
import
io.dataease.controller.response.ChartDetail
;
import
io.dataease.dto.chart.ChartViewDTO
;
...
...
@@ -36,8 +37,15 @@ public class ChartViewController {
@DePermission
(
type
=
DePermissionType
.
PANEL
,
level
=
ResourceAuthLevel
.
PANNEL_LEVEL_MANAGE
)
@ApiOperation
(
"保存"
)
@PostMapping
(
"/save/{panelId}"
)
public
ChartViewDTO
save
(
@PathVariable
String
panelId
,
@RequestBody
ChartViewCacheWithBLOBs
chartViewWithBLOBs
)
{
return
chartViewService
.
save
(
chartViewWithBLOBs
);
public
ChartViewDTO
save
(
@PathVariable
String
panelId
,
@RequestBody
ChartViewCacheRequest
request
)
{
return
chartViewService
.
save
(
request
);
}
@DePermission
(
type
=
DePermissionType
.
PANEL
,
level
=
ResourceAuthLevel
.
PANNEL_LEVEL_MANAGE
)
@ApiOperation
(
"新建视图"
)
@PostMapping
(
"/newOne/{panelId}"
)
public
ChartViewWithBLOBs
save
(
@PathVariable
String
panelId
,
@RequestBody
ChartViewWithBLOBs
chartViewWithBLOBs
)
{
return
chartViewService
.
newOne
(
chartViewWithBLOBs
);
}
@DePermission
(
type
=
DePermissionType
.
PANEL
,
level
=
ResourceAuthLevel
.
PANNEL_LEVEL_MANAGE
)
...
...
backend/src/main/java/io/dataease/controller/request/chart/ChartViewCacheRequest.java
0 → 100644
浏览文件 @
0c0f6d2f
package
io
.
dataease
.
controller
.
request
.
chart
;
import
io.dataease.base.domain.ChartViewCacheWithBLOBs
;
import
lombok.Data
;
/**
* Author: wangjiahao
* Date: 2022/3/10
* Description:
*/
@Data
public
class
ChartViewCacheRequest
extends
ChartViewCacheWithBLOBs
{
private
String
savePosition
=
"cache"
;
}
backend/src/main/java/io/dataease/service/chart/ChartViewService.java
浏览文件 @
0c0f6d2f
...
...
@@ -79,7 +79,7 @@ public class ChartViewService {
private
ReentrantLock
lock
=
new
ReentrantLock
();
// 直接保存统一到缓存表
public
ChartViewDTO
save
(
ChartViewCache
WithBLOBs
chartView
)
{
public
ChartViewDTO
save
(
ChartViewCache
Request
chartView
)
{
long
timestamp
=
System
.
currentTimeMillis
();
chartView
.
setUpdateTime
(
timestamp
);
chartViewCacheMapper
.
updateByPrimaryKeySelective
(
chartView
);
...
...
@@ -90,6 +90,22 @@ public class ChartViewService {
}
public
ChartViewWithBLOBs
newOne
(
ChartViewWithBLOBs
chartView
)
{
long
timestamp
=
System
.
currentTimeMillis
();
chartView
.
setUpdateTime
(
timestamp
);
chartView
.
setId
(
UUID
.
randomUUID
().
toString
());
chartView
.
setCreateBy
(
AuthUtils
.
getUser
().
getUsername
());
chartView
.
setCreateTime
(
timestamp
);
chartView
.
setUpdateTime
(
timestamp
);
chartViewMapper
.
insertSelective
(
chartView
);
// 新建的视图也存入缓存表中
extChartViewMapper
.
copyToCache
(
chartView
.
getId
());
return
chartView
;
}
// 直接保存统一到缓存表
public
void
save2Cache
(
ChartViewCacheWithBLOBs
chartView
)
{
long
timestamp
=
System
.
currentTimeMillis
();
...
...
@@ -1761,6 +1777,7 @@ public class ChartViewService {
public
void
resetViewCache
(
String
viewId
){
extChartViewMapper
.
deleteViewCache
(
viewId
);
extChartViewMapper
.
copyToCache
(
viewId
);
}
}
backend/src/main/java/io/dataease/service/panel/PanelGroupService.java
浏览文件 @
0c0f6d2f
...
...
@@ -104,9 +104,11 @@ public class PanelGroupService {
@DeCleaner
(
DePermissionType
.
PANEL
)
// @Transactional
public
PanelGroup
saveOrUpdate
(
PanelGroupRequest
request
)
{
String
panelId
=
request
.
getId
();
if
(
StringUtils
.
isNotEmpty
(
panelId
)){
Boolean
mobileLayout
=
panelViewService
.
syncPanelViews
(
request
);
request
.
setMobileLayout
(
mobileLayout
);
String
panelId
=
request
.
getId
();
}
if
(
StringUtils
.
isEmpty
(
panelId
))
{
// 新建
checkPanelName
(
request
.
getName
(),
request
.
getPid
(),
PanelConstants
.
OPT_TYPE_INSERT
,
null
,
request
.
getNodeType
());
...
...
frontend/src/views/chart/group/Group.vue
浏览文件 @
0c0f6d2f
...
...
@@ -784,7 +784,7 @@ export default {
view
.
extBubble
=
JSON
.
stringify
([])
this
.
setChartDefaultOptions
(
view
)
const
_this
=
this
post
(
'/chart/view/
sav
e/'
+
this
.
panelInfo
.
id
,
view
).
then
(
response
=>
{
post
(
'/chart/view/
newOn
e/'
+
this
.
panelInfo
.
id
,
view
).
then
(
response
=>
{
this
.
closeCreateChart
()
this
.
$store
.
dispatch
(
'chart/setTableId'
,
null
)
this
.
$store
.
dispatch
(
'chart/setTableId'
,
this
.
table
.
id
)
...
...
frontend/src/views/chart/view/ChartEdit.vue
浏览文件 @
0c0f6d2f
<
template
>
<el-row
v-loading=
"loading"
style=
"height: 100%;overflow-y: hidden;width: 100%;"
>
<el-row
v-loading=
"loading"
style=
"height: 100%;overflow-y: hidden;width: 100%;
border-left: 1px solid #E6E6E6
"
>
<el-tooltip
:content=
"$t('chart.draw_back')"
>
<el-button
class=
"el-icon-d-arrow-right"
style=
"position:absolute;left: 4px;top: 5px;z-index: 1000"
size=
"mini"
circle
@
click=
"closePanelEdit"
/>
</el-tooltip>
...
...
frontend/src/views/panel/edit/index.vue
浏览文件 @
0c0f6d2f
...
...
@@ -237,7 +237,7 @@
</el-row>
<el-row>
<div
class=
"view-selected-message-class"
>
<span
style=
"font-size: 14px;margin-left: 10px;font-weight: bold;line-height: 20px"
>
{{
$t
(
'panel.select_view'
)
}}
</span>
<span
style=
"font-size: 14px;margin-left: 10px;font-weight: bold;line-height: 20px"
>
{{
$t
(
'panel.select_view'
)
}}
</span>
</div>
</el-row>
</div>
...
...
@@ -976,17 +976,21 @@ export default {
this
.
clearCurrentInfo
()
this
.
$store
.
commit
(
'setCurComponent'
,
{
component
:
component
,
index
:
this
.
componentData
.
length
-
1
})
// 编辑时临时保存 当前修改的画布
this
.
$store
.
dispatch
(
'panel/setComponentDataTemp'
,
JSON
.
stringify
(
this
.
componentData
))
this
.
$store
.
dispatch
(
'panel/setCanvasStyleDataTemp'
,
JSON
.
stringify
(
this
.
canvasStyleData
))
if
(
this
.
curComponent
.
type
===
'view'
)
{
this
.
$store
.
dispatch
(
'chart/setViewId'
,
null
)
this
.
$store
.
dispatch
(
'chart/setViewId'
,
this
.
curComponent
.
propValue
.
viewId
)
bus
.
$emit
(
'PanelSwitchComponent'
,
{
name
:
'ChartEdit'
,
param
:
{
'id'
:
this
.
curComponent
.
propValue
.
viewId
,
'optType'
:
'edit'
}
})
}
// 打开属性栏
bus
.
$emit
(
'change_panel_right_draw'
,
true
)
//
// // 编辑时临时保存 当前修改的画布
// this.$store.dispatch('panel/setComponentDataTemp', JSON.stringify(this.componentData))
// this.$store.dispatch('panel/setCanvasStyleDataTemp', JSON.stringify(this.canvasStyleData))
// if (this.curComponent.type === 'view') {
// this.$store.dispatch('chart/setViewId', null)
// this.$store.dispatch('chart/setViewId', this.curComponent.propValue.viewId)
// bus.$emit('PanelSwitchComponent', {
// name: 'ChartEdit',
// param: { 'id': this.curComponent.propValue.viewId, 'optType': 'edit' }
// })
// }
},
canvasScroll
(
event
)
{
this
.
scrollLeft
=
event
.
target
.
scrollLeft
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论