Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
dataease
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
zhu
dataease
Commits
2ca71252
提交
2ca71252
authored
2月 23, 2022
作者:
wangjiahao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refactor: tab组件加入视图直接进行复制
上级
adc1bb92
隐藏空白字符变更
内嵌
并排
正在显示
8 个修改的文件
包含
151 行增加
和
29 行删除
+151
-29
PanelView.java
backend/src/main/java/io/dataease/base/domain/PanelView.java
+2
-0
PanelViewExample.java
...c/main/java/io/dataease/base/domain/PanelViewExample.java
+70
-0
PanelViewMapper.xml
...src/main/java/io/dataease/base/mapper/PanelViewMapper.xml
+25
-5
PanelViewInsertDTO.java
...ain/java/io/dataease/dto/panel/po/PanelViewInsertDTO.java
+7
-0
PanelViewService.java
...main/java/io/dataease/service/panel/PanelViewService.java
+31
-17
V32__1.8.sql
backend/src/main/resources/db/migration/V32__1.8.sql
+3
-0
generatorConfig.xml
backend/src/main/resources/generatorConfig.xml
+1
-1
DeTabs.vue
frontend/src/components/widget/DeWidget/DeTabs.vue
+12
-6
没有找到文件。
backend/src/main/java/io/dataease/base/domain/PanelView.java
浏览文件 @
2ca71252
...
...
@@ -19,6 +19,8 @@ public class PanelView implements Serializable {
private
Long
updateTime
;
private
String
position
;
private
byte
[]
content
;
private
static
final
long
serialVersionUID
=
1L
;
...
...
backend/src/main/java/io/dataease/base/domain/PanelViewExample.java
浏览文件 @
2ca71252
...
...
@@ -573,6 +573,76 @@ public class PanelViewExample {
addCriterion
(
"update_time not between"
,
value1
,
value2
,
"updateTime"
);
return
(
Criteria
)
this
;
}
public
Criteria
andPositionIsNull
()
{
addCriterion
(
"`position` is null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andPositionIsNotNull
()
{
addCriterion
(
"`position` is not null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andPositionEqualTo
(
String
value
)
{
addCriterion
(
"`position` ="
,
value
,
"position"
);
return
(
Criteria
)
this
;
}
public
Criteria
andPositionNotEqualTo
(
String
value
)
{
addCriterion
(
"`position` <>"
,
value
,
"position"
);
return
(
Criteria
)
this
;
}
public
Criteria
andPositionGreaterThan
(
String
value
)
{
addCriterion
(
"`position` >"
,
value
,
"position"
);
return
(
Criteria
)
this
;
}
public
Criteria
andPositionGreaterThanOrEqualTo
(
String
value
)
{
addCriterion
(
"`position` >="
,
value
,
"position"
);
return
(
Criteria
)
this
;
}
public
Criteria
andPositionLessThan
(
String
value
)
{
addCriterion
(
"`position` <"
,
value
,
"position"
);
return
(
Criteria
)
this
;
}
public
Criteria
andPositionLessThanOrEqualTo
(
String
value
)
{
addCriterion
(
"`position` <="
,
value
,
"position"
);
return
(
Criteria
)
this
;
}
public
Criteria
andPositionLike
(
String
value
)
{
addCriterion
(
"`position` like"
,
value
,
"position"
);
return
(
Criteria
)
this
;
}
public
Criteria
andPositionNotLike
(
String
value
)
{
addCriterion
(
"`position` not like"
,
value
,
"position"
);
return
(
Criteria
)
this
;
}
public
Criteria
andPositionIn
(
List
<
String
>
values
)
{
addCriterion
(
"`position` in"
,
values
,
"position"
);
return
(
Criteria
)
this
;
}
public
Criteria
andPositionNotIn
(
List
<
String
>
values
)
{
addCriterion
(
"`position` not in"
,
values
,
"position"
);
return
(
Criteria
)
this
;
}
public
Criteria
andPositionBetween
(
String
value1
,
String
value2
)
{
addCriterion
(
"`position` between"
,
value1
,
value2
,
"position"
);
return
(
Criteria
)
this
;
}
public
Criteria
andPositionNotBetween
(
String
value1
,
String
value2
)
{
addCriterion
(
"`position` not between"
,
value1
,
value2
,
"position"
);
return
(
Criteria
)
this
;
}
}
public
static
class
Criteria
extends
GeneratedCriteria
{
...
...
backend/src/main/java/io/dataease/base/mapper/PanelViewMapper.xml
浏览文件 @
2ca71252
...
...
@@ -9,6 +9,7 @@
<result
column=
"create_time"
jdbcType=
"BIGINT"
property=
"createTime"
/>
<result
column=
"update_by"
jdbcType=
"VARCHAR"
property=
"updateBy"
/>
<result
column=
"update_time"
jdbcType=
"BIGINT"
property=
"updateTime"
/>
<result
column=
"position"
jdbcType=
"VARCHAR"
property=
"position"
/>
</resultMap>
<resultMap
extends=
"BaseResultMap"
id=
"ResultMapWithBLOBs"
type=
"io.dataease.base.domain.PanelView"
>
<result
column=
"content"
jdbcType=
"LONGVARBINARY"
property=
"content"
/>
...
...
@@ -72,7 +73,7 @@
</where>
</sql>
<sql
id=
"Base_Column_List"
>
id, panel_id, chart_view_id, create_by, create_time, update_by, update_time
id, panel_id, chart_view_id, create_by, create_time, update_by, update_time
, `position`
</sql>
<sql
id=
"Blob_Column_List"
>
content
...
...
@@ -128,10 +129,12 @@
<insert
id=
"insert"
parameterType=
"io.dataease.base.domain.PanelView"
>
insert into panel_view (id, panel_id, chart_view_id,
create_by, create_time, update_by,
update_time, content)
update_time, `position`, content
)
values (#{id,jdbcType=VARCHAR}, #{panelId,jdbcType=VARCHAR}, #{chartViewId,jdbcType=VARCHAR},
#{createBy,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT}, #{updateBy,jdbcType=VARCHAR},
#{updateTime,jdbcType=BIGINT}, #{content,jdbcType=LONGVARBINARY})
#{updateTime,jdbcType=BIGINT}, #{position,jdbcType=VARCHAR}, #{content,jdbcType=LONGVARBINARY}
)
</insert>
<insert
id=
"insertSelective"
parameterType=
"io.dataease.base.domain.PanelView"
>
insert into panel_view
...
...
@@ -157,6 +160,9 @@
<if
test=
"updateTime != null"
>
update_time,
</if>
<if
test=
"position != null"
>
`position`,
</if>
<if
test=
"content != null"
>
content,
</if>
...
...
@@ -183,6 +189,9 @@
<if
test=
"updateTime != null"
>
#{updateTime,jdbcType=BIGINT},
</if>
<if
test=
"position != null"
>
#{position,jdbcType=VARCHAR},
</if>
<if
test=
"content != null"
>
#{content,jdbcType=LONGVARBINARY},
</if>
...
...
@@ -218,6 +227,9 @@
<if
test=
"record.updateTime != null"
>
update_time = #{record.updateTime,jdbcType=BIGINT},
</if>
<if
test=
"record.position != null"
>
`position` = #{record.position,jdbcType=VARCHAR},
</if>
<if
test=
"record.content != null"
>
content = #{record.content,jdbcType=LONGVARBINARY},
</if>
...
...
@@ -235,6 +247,7 @@
create_time = #{record.createTime,jdbcType=BIGINT},
update_by = #{record.updateBy,jdbcType=VARCHAR},
update_time = #{record.updateTime,jdbcType=BIGINT},
`position` = #{record.position,jdbcType=VARCHAR},
content = #{record.content,jdbcType=LONGVARBINARY}
<if
test=
"_parameter != null"
>
<include
refid=
"Update_By_Example_Where_Clause"
/>
...
...
@@ -248,7 +261,8 @@
create_by = #{record.createBy,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=BIGINT},
update_by = #{record.updateBy,jdbcType=VARCHAR},
update_time = #{record.updateTime,jdbcType=BIGINT}
update_time = #{record.updateTime,jdbcType=BIGINT},
`position` = #{record.position,jdbcType=VARCHAR}
<if
test=
"_parameter != null"
>
<include
refid=
"Update_By_Example_Where_Clause"
/>
</if>
...
...
@@ -274,6 +288,9 @@
<if
test=
"updateTime != null"
>
update_time = #{updateTime,jdbcType=BIGINT},
</if>
<if
test=
"position != null"
>
`position` = #{position,jdbcType=VARCHAR},
</if>
<if
test=
"content != null"
>
content = #{content,jdbcType=LONGVARBINARY},
</if>
...
...
@@ -288,6 +305,7 @@
create_time = #{createTime,jdbcType=BIGINT},
update_by = #{updateBy,jdbcType=VARCHAR},
update_time = #{updateTime,jdbcType=BIGINT},
`position` = #{position,jdbcType=VARCHAR},
content = #{content,jdbcType=LONGVARBINARY}
where id = #{id,jdbcType=VARCHAR}
</update>
...
...
@@ -298,7 +316,8 @@
create_by = #{createBy,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=BIGINT},
update_by = #{updateBy,jdbcType=VARCHAR},
update_time = #{updateTime,jdbcType=BIGINT}
update_time = #{updateTime,jdbcType=BIGINT},
`position` = #{position,jdbcType=VARCHAR}
where id = #{id,jdbcType=VARCHAR}
</update>
</mapper>
\ No newline at end of file
backend/src/main/java/io/dataease/dto/panel/po/PanelViewInsertDTO.java
浏览文件 @
2ca71252
...
...
@@ -16,6 +16,13 @@ public class PanelViewInsertDTO extends PanelView {
super
();
super
.
setChartViewId
(
chartViewId
);
super
.
setPanelId
(
panelGroupId
);
super
.
setPosition
(
"panel"
);
}
public
PanelViewInsertDTO
(
String
chartViewId
,
String
panelGroupId
,
String
position
)
{
super
();
super
.
setChartViewId
(
chartViewId
);
super
.
setPanelId
(
panelGroupId
);
super
.
setPosition
(
position
);
}
}
backend/src/main/java/io/dataease/service/panel/PanelViewService.java
浏览文件 @
2ca71252
...
...
@@ -34,27 +34,27 @@ public class PanelViewService {
private
final
static
String
SCENE_TYPE
=
"scene"
;
public
List
<
PanelViewDto
>
groups
(){
public
List
<
PanelViewDto
>
groups
()
{
return
extPanelViewMapper
.
groups
(
String
.
valueOf
(
AuthUtils
.
getUser
().
getUserId
()));
}
public
List
<
PanelViewDto
>
views
(){
public
List
<
PanelViewDto
>
views
()
{
return
extPanelViewMapper
.
views
(
String
.
valueOf
(
AuthUtils
.
getUser
().
getUserId
()));
}
public
List
<
PanelViewDto
>
buildTree
(
List
<
PanelViewPo
>
groups
,
List
<
PanelViewPo
>
views
){
public
List
<
PanelViewDto
>
buildTree
(
List
<
PanelViewPo
>
groups
,
List
<
PanelViewPo
>
views
)
{
if
(
CollectionUtils
.
isEmpty
(
groups
)
||
CollectionUtils
.
isEmpty
(
views
))
return
null
;
Map
<
String
,
List
<
PanelViewPo
>>
viewsMap
=
views
.
stream
().
collect
(
Collectors
.
groupingBy
(
PanelViewPo:
:
getPid
));
List
<
PanelViewDto
>
dtos
=
groups
.
stream
().
map
(
group
->
BeanUtils
.
copyBean
(
new
PanelViewDto
(),
group
)).
collect
(
Collectors
.
toList
());
List
<
PanelViewDto
>
roots
=
new
ArrayList
<>();
dtos
.
forEach
(
group
->
{
// 查找跟节点
if
(
ObjectUtils
.
isEmpty
(
group
.
getPid
())){
if
(
ObjectUtils
.
isEmpty
(
group
.
getPid
()))
{
roots
.
add
(
group
);
}
// 查找当前节点的子节点
// 当前group是场景
if
(
StringUtils
.
equals
(
group
.
getType
(),
SCENE_TYPE
)){
if
(
StringUtils
.
equals
(
group
.
getType
(),
SCENE_TYPE
))
{
Optional
.
ofNullable
(
viewsMap
.
get
(
group
.
getId
())).
ifPresent
(
lists
->
lists
.
forEach
(
view
->
{
PanelViewDto
dto
=
BeanUtils
.
copyBean
(
new
PanelViewDto
(),
view
);
group
.
addChild
(
dto
);
...
...
@@ -63,7 +63,7 @@ public class PanelViewService {
}
// 当前group是分组
dtos
.
forEach
(
item
->
{
if
(
StringUtils
.
equals
(
item
.
getPid
(),
group
.
getId
())){
if
(
StringUtils
.
equals
(
item
.
getPid
(),
group
.
getId
()))
{
group
.
addChild
(
item
);
}
});
...
...
@@ -72,34 +72,48 @@ public class PanelViewService {
return
roots
.
stream
().
filter
(
item
->
CollectionUtils
.
isNotEmpty
(
item
.
getChildren
())).
collect
(
Collectors
.
toList
());
}
@Transactional
(
propagation
=
Propagation
.
REQUIRES_NEW
)
public
Boolean
syncPanelViews
(
PanelGroupWithBLOBs
panelGroup
){
@Transactional
(
propagation
=
Propagation
.
REQUIRES_NEW
)
public
Boolean
syncPanelViews
(
PanelGroupWithBLOBs
panelGroup
)
{
Boolean
mobileLayout
=
null
;
String
panelId
=
panelGroup
.
getId
();
Assert
.
notNull
(
panelId
,
"panelId cannot be null"
);
String
panelData
=
panelGroup
.
getPanelData
();
if
(
StringUtils
.
isNotEmpty
(
panelData
))
{
if
(
StringUtils
.
isNotEmpty
(
panelData
))
{
mobileLayout
=
false
;
JSONArray
dataArray
=
JSON
.
parseArray
(
panelData
);
List
<
PanelViewInsertDTO
>
panelViewInsertDTOList
=
new
ArrayList
<>();
for
(
int
i
=
0
;
i
<
dataArray
.
size
();
i
++)
{
JSONObject
jsonObject
=
dataArray
.
getJSONObject
(
i
);
if
(
"view"
.
equals
(
jsonObject
.
getString
(
"type"
)))
{
panelViewInsertDTOList
.
add
(
new
PanelViewInsertDTO
(
jsonObject
.
getJSONObject
(
"propValue"
).
getString
(
"viewId"
),
panelId
));
for
(
int
i
=
0
;
i
<
dataArray
.
size
();
i
++)
{
JSONObject
jsonObject
=
dataArray
.
getJSONObject
(
i
);
if
(
"view"
.
equals
(
jsonObject
.
getString
(
"type"
)))
{
panelViewInsertDTOList
.
add
(
new
PanelViewInsertDTO
(
jsonObject
.
getJSONObject
(
"propValue"
).
getString
(
"viewId"
),
panelId
));
}
if
(
jsonObject
.
getBoolean
(
"mobileSelected"
)!=
null
&&
jsonObject
.
getBoolean
(
"mobileSelected"
)){
// 选项卡内部视图
if
(
"de-tabs"
.
equals
(
jsonObject
.
getString
(
"type"
)))
{
JSONObject
options
=
jsonObject
.
getJSONObject
(
"options"
);
if
(
options
!=
null
)
{
JSONArray
tabList
=
options
.
getJSONArray
(
"tabList"
);
if
(
CollectionUtils
.
isNotEmpty
(
tabList
))
{
for
(
int
y
=
0
;
y
<
tabList
.
size
();
y
++)
{
if
(
tabList
.
getJSONObject
(
y
).
getString
(
"content"
).
indexOf
(
"viewId"
)>-
1
){
panelViewInsertDTOList
.
add
(
new
PanelViewInsertDTO
(
tabList
.
getJSONObject
(
y
).
getJSONObject
(
"content"
).
getJSONObject
(
"propValue"
).
getString
(
"viewId"
),
panelId
,
"tab"
));
}
}
}
}
}
if
(
jsonObject
.
getBoolean
(
"mobileSelected"
)
!=
null
&&
jsonObject
.
getBoolean
(
"mobileSelected"
))
{
mobileLayout
=
true
;
}
}
extPanelViewMapper
.
deleteWithPanelId
(
panelId
);
if
(
CollectionUtils
.
isNotEmpty
(
panelViewInsertDTOList
))
{
if
(
CollectionUtils
.
isNotEmpty
(
panelViewInsertDTOList
))
{
extPanelViewMapper
.
savePanelView
(
panelViewInsertDTOList
);
}
}
return
mobileLayout
;
}
public
List
<
PanelViewTableDTO
>
detailList
(
String
panelId
){
return
extPanelViewMapper
.
getPanelViewDetails
(
panelId
);
public
List
<
PanelViewTableDTO
>
detailList
(
String
panelId
)
{
return
extPanelViewMapper
.
getPanelViewDetails
(
panelId
);
}
}
backend/src/main/resources/db/migration/V32__1.8.sql
浏览文件 @
2ca71252
...
...
@@ -350,3 +350,6 @@ INSERT INTO `sys_background_image` VALUES ('blue_5', '边框5', '蓝色调', NUL
COMMIT
;
SET
FOREIGN_KEY_CHECKS
=
1
;
ALTER
TABLE
`panel_view`
ADD
COLUMN
`position`
varchar
(
255
)
NULL
DEFAULT
'panel'
COMMENT
'视图位置 panel 仪表板中,tab Tab页中'
AFTER
`update_time`
;
backend/src/main/resources/generatorConfig.xml
浏览文件 @
2ca71252
...
...
@@ -60,6 +60,6 @@
</javaClientGenerator>
<!--要生成的数据库表 -->
<table
tableName=
"
sys_background_image
"
/>
<table
tableName=
"
panel_view
"
/>
</context>
</generatorConfiguration>
frontend/src/components/widget/DeWidget/DeTabs.vue
浏览文件 @
2ca71252
...
...
@@ -95,6 +95,7 @@ import { uuid } from 'vue-uuid'
import
bus
from
'@/utils/bus'
import
componentList
from
'@/components/canvas/custom-component/component-list'
import
{
mapState
}
from
'vuex'
import
{
chartCopy
}
from
'@/api/chart/chart'
export
default
{
name
:
'DeTabls'
,
...
...
@@ -138,7 +139,9 @@ export default {
dropdownShow
()
{
return
this
.
isEdit
&&
!
this
.
mobileLayoutStatus
},
panelInfo
()
{
return
this
.
$store
.
state
.
panel
.
panelInfo
},
...
mapState
([
'curComponent'
,
'mobileLayoutStatus'
...
...
@@ -211,11 +214,14 @@ export default {
component
.
id
=
newComponentId
component
.
style
.
width
=
'100%'
component
.
style
.
height
=
'100%'
this
.
curItem
.
content
=
component
this
.
curItem
.
name
=
newComponentId
this
.
viewDialogVisible
=
false
this
.
activeTabName
=
newComponentId
this
.
styleChange
()
chartCopy
(
node
.
innerId
,
this
.
panelInfo
.
id
).
then
(
res
=>
{
component
.
propValue
.
viewId
=
res
.
data
this
.
curItem
.
content
=
component
this
.
curItem
.
name
=
newComponentId
this
.
viewDialogVisible
=
false
this
.
activeTabName
=
newComponentId
this
.
styleChange
()
})
// this.setComponentInfo()
},
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论