Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
dataease
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
zhu
dataease
Commits
cf557782
提交
cf557782
authored
3月 10, 2022
作者:
wangjiahao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat: 视图所有操作移到仪表板
上级
0a6e5524
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
34 个修改的文件
包含
581 行增加
和
95 行删除
+581
-95
ChartViewCache.java
...src/main/java/io/dataease/base/domain/ChartViewCache.java
+40
-0
ChartViewCacheExample.java
...n/java/io/dataease/base/domain/ChartViewCacheExample.java
+0
-0
ChartViewCacheWithBLOBs.java
...java/io/dataease/base/domain/ChartViewCacheWithBLOBs.java
+36
-0
ChartViewCacheMapper.java
...in/java/io/dataease/base/mapper/ChartViewCacheMapper.java
+38
-0
ChartViewCacheMapper.xml
...ain/java/io/dataease/base/mapper/ChartViewCacheMapper.xml
+0
-0
ExtChartViewMapper.java
.../java/io/dataease/base/mapper/ext/ExtChartViewMapper.java
+16
-1
ExtChartViewMapper.xml
...n/java/io/dataease/base/mapper/ext/ExtChartViewMapper.xml
+90
-14
ExtDataSetTableMapper.java
...va/io/dataease/base/mapper/ext/ExtDataSetTableMapper.java
+3
-0
ExtDataSetTableMapper.xml
...ava/io/dataease/base/mapper/ext/ExtDataSetTableMapper.xml
+23
-0
CommonConstants.java
...n/java/io/dataease/commons/constants/CommonConstants.java
+15
-0
ChartViewController.java
...ava/io/dataease/controller/chart/ChartViewController.java
+27
-3
PanelGroupController.java
...va/io/dataease/controller/panel/PanelGroupController.java
+8
-0
ChartExtRequest.java
...io/dataease/controller/request/chart/ChartExtRequest.java
+1
-0
ChartViewRequest.java
...o/dataease/controller/request/chart/ChartViewRequest.java
+4
-0
PanelGroupDTO.java
...nd/src/main/java/io/dataease/dto/panel/PanelGroupDTO.java
+4
-1
ChartViewService.java
...main/java/io/dataease/service/chart/ChartViewService.java
+64
-13
PanelGroupService.java
...ain/java/io/dataease/service/panel/PanelGroupService.java
+49
-11
PanelViewService.java
...main/java/io/dataease/service/panel/PanelViewService.java
+8
-0
generatorConfig.xml
backend/src/main/resources/generatorConfig.xml
+1
-1
chart.js
frontend/src/api/chart/chart.js
+37
-4
panel.js
frontend/src/api/panel/panel.js
+25
-0
index.vue
frontend/src/components/DeDrag/index.vue
+1
-1
EditBar.vue
frontend/src/components/canvas/components/Editor/EditBar.vue
+18
-15
SettingMenu.vue
...d/src/components/canvas/components/Editor/SettingMenu.vue
+18
-17
index.vue
frontend/src/components/canvas/components/Editor/index.vue
+6
-0
UserView.vue
frontend/src/components/canvas/custom-component/UserView.vue
+17
-1
en.js
frontend/src/lang/en.js
+4
-2
tw.js
frontend/src/lang/tw.js
+4
-2
zh.js
frontend/src/lang/zh.js
+4
-2
index.js
frontend/src/store/index.js
+14
-1
ChartEdit.vue
frontend/src/views/chart/view/ChartEdit.vue
+0
-0
DatasetChartDetail.vue
frontend/src/views/dataset/common/DatasetChartDetail.vue
+2
-2
index.vue
frontend/src/views/panel/ViewSelect/index.vue
+4
-4
index.vue
frontend/src/views/panel/edit/index.vue
+0
-0
没有找到文件。
backend/src/main/java/io/dataease/base/domain/ChartViewCache.java
0 → 100644
浏览文件 @
cf557782
package
io
.
dataease
.
base
.
domain
;
import
java.io.Serializable
;
import
lombok.Data
;
@Data
public
class
ChartViewCache
implements
Serializable
{
private
String
id
;
private
String
name
;
private
String
title
;
private
String
sceneId
;
private
String
tableId
;
private
String
type
;
private
String
render
;
private
Integer
resultCount
;
private
String
resultMode
;
private
String
createBy
;
private
Long
createTime
;
private
Long
updateTime
;
private
String
stylePriority
;
private
String
chartType
;
private
Boolean
isPlugin
;
private
static
final
long
serialVersionUID
=
1L
;
}
\ No newline at end of file
backend/src/main/java/io/dataease/base/domain/ChartViewCacheExample.java
0 → 100644
浏览文件 @
cf557782
差异被折叠。
点击展开。
backend/src/main/java/io/dataease/base/domain/ChartViewCacheWithBLOBs.java
0 → 100644
浏览文件 @
cf557782
package
io
.
dataease
.
base
.
domain
;
import
java.io.Serializable
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.ToString
;
@Data
@EqualsAndHashCode
(
callSuper
=
true
)
@ToString
(
callSuper
=
true
)
public
class
ChartViewCacheWithBLOBs
extends
ChartViewCache
implements
Serializable
{
private
String
xAxis
;
private
String
xAxisExt
;
private
String
yAxis
;
private
String
yAxisExt
;
private
String
extStack
;
private
String
extBubble
;
private
String
customAttr
;
private
String
customStyle
;
private
String
customFilter
;
private
String
drillFields
;
private
String
snapshot
;
private
static
final
long
serialVersionUID
=
1L
;
}
\ No newline at end of file
backend/src/main/java/io/dataease/base/mapper/ChartViewCacheMapper.java
0 → 100644
浏览文件 @
cf557782
package
io
.
dataease
.
base
.
mapper
;
import
io.dataease.base.domain.ChartViewCache
;
import
io.dataease.base.domain.ChartViewCacheExample
;
import
io.dataease.base.domain.ChartViewCacheWithBLOBs
;
import
java.util.List
;
import
org.apache.ibatis.annotations.Param
;
public
interface
ChartViewCacheMapper
{
long
countByExample
(
ChartViewCacheExample
example
);
int
deleteByExample
(
ChartViewCacheExample
example
);
int
deleteByPrimaryKey
(
String
id
);
int
insert
(
ChartViewCacheWithBLOBs
record
);
int
insertSelective
(
ChartViewCacheWithBLOBs
record
);
List
<
ChartViewCacheWithBLOBs
>
selectByExampleWithBLOBs
(
ChartViewCacheExample
example
);
List
<
ChartViewCache
>
selectByExample
(
ChartViewCacheExample
example
);
ChartViewCacheWithBLOBs
selectByPrimaryKey
(
String
id
);
int
updateByExampleSelective
(
@Param
(
"record"
)
ChartViewCacheWithBLOBs
record
,
@Param
(
"example"
)
ChartViewCacheExample
example
);
int
updateByExampleWithBLOBs
(
@Param
(
"record"
)
ChartViewCacheWithBLOBs
record
,
@Param
(
"example"
)
ChartViewCacheExample
example
);
int
updateByExample
(
@Param
(
"record"
)
ChartViewCache
record
,
@Param
(
"example"
)
ChartViewCacheExample
example
);
int
updateByPrimaryKeySelective
(
ChartViewCacheWithBLOBs
record
);
int
updateByPrimaryKeyWithBLOBs
(
ChartViewCacheWithBLOBs
record
);
int
updateByPrimaryKey
(
ChartViewCache
record
);
}
\ No newline at end of file
backend/src/main/java/io/dataease/base/mapper/ChartViewCacheMapper.xml
0 → 100644
浏览文件 @
cf557782
差异被折叠。
点击展开。
backend/src/main/java/io/dataease/base/mapper/ext/ExtChartViewMapper.java
浏览文件 @
cf557782
...
@@ -12,7 +12,7 @@ import java.util.List;
...
@@ -12,7 +12,7 @@ import java.util.List;
public
interface
ExtChartViewMapper
{
public
interface
ExtChartViewMapper
{
List
<
ChartViewDTO
>
search
(
ChartViewRequest
request
);
List
<
ChartViewDTO
>
search
(
ChartViewRequest
request
);
ChartViewDTO
searchOne
(
ChartViewRequest
request
);
//
ChartViewDTO searchOne(ChartViewRequest request);
void
chartCopy
(
@Param
(
"newChartId"
)
String
newChartId
,
@Param
(
"oldChartId"
)
String
oldChartId
,
@Param
(
"panelId"
)
String
panelId
);
void
chartCopy
(
@Param
(
"newChartId"
)
String
newChartId
,
@Param
(
"oldChartId"
)
String
oldChartId
,
@Param
(
"panelId"
)
String
panelId
);
...
@@ -25,9 +25,24 @@ public interface ExtChartViewMapper {
...
@@ -25,9 +25,24 @@ public interface ExtChartViewMapper {
ChartViewDTO
searchOneWithPrivileges
(
@Param
(
"userId"
)
String
userId
,
@Param
(
"id"
)
String
id
);
ChartViewDTO
searchOneWithPrivileges
(
@Param
(
"userId"
)
String
userId
,
@Param
(
"id"
)
String
id
);
ChartViewDTO
searchOne
(
@Param
(
"id"
)
String
id
);
void
chartCopyWithPanel
(
@Param
(
"copyId"
)
String
copyId
);
void
chartCopyWithPanel
(
@Param
(
"copyId"
)
String
copyId
);
void
deleteCircleView
(
@Param
(
"pid"
)
String
pid
);
void
deleteCircleView
(
@Param
(
"pid"
)
String
pid
);
void
deleteCircleGroup
(
@Param
(
"pid"
)
String
pid
);
void
deleteCircleGroup
(
@Param
(
"pid"
)
String
pid
);
List
<
ChartViewDTO
>
searchViewsWithPanelId
(
@Param
(
"panelId"
)
String
panelId
);
ChartViewDTO
searchOneFromCache
(
@Param
(
"id"
)
String
id
);
void
copyToCache
(
@Param
(
"id"
)
String
id
);
void
deleteCacheWithPanel
(
@Param
(
"panelId"
)
String
panelId
);
void
deleteViewCache
(
@Param
(
"viewId"
)
String
viewId
);
void
copyCacheToView
(
@Param
(
"viewIds"
)
List
<
String
>
viewIds
);
}
}
backend/src/main/java/io/dataease/base/mapper/ext/ExtChartViewMapper.xml
浏览文件 @
cf557782
...
@@ -16,22 +16,38 @@
...
@@ -16,22 +16,38 @@
<select
id=
"searchOne"
resultMap=
"BaseResultMapDTO"
>
<select
id=
"searchOne"
resultMap=
"BaseResultMapDTO"
>
select
select
id, `name`, scene_id, table_id, `type`, title, create_by, create_time, update_time,
chart_view.*
style_priority,x_axis, y_axis, custom_attr, custom_style, custom_filter, snapshot
from chart_view where id = #{id}
from chart_view
</select>
<where>
<if
test=
"sceneId != null"
>
<select
id=
"searchOneFromCache"
resultMap=
"BaseResultMapDTO"
>
and scene_id = #{sceneId,jdbcType=VARCHAR}
select
</if>
chart_view_cache.*
<if
test=
"id != null"
>
from chart_view_cache where id = #{id}
and id = #{id,jdbcType=VARCHAR}
</if>
</where>
<if
test=
"sort != null"
>
order by ${sort}
</if>
</select>
</select>
<insert
id=
"copyToCache"
>
Insert into chart_view_cache select * from chart_view where chart_view.id = #{id}
</insert>
<!-- <select id="searchOne" resultMap="BaseResultMapDTO">-->
<!-- select-->
<!-- id, `name`, scene_id, table_id, `type`, title, create_by, create_time, update_time,-->
<!-- style_priority,x_axis, y_axis, custom_attr, custom_style, custom_filter, snapshot-->
<!-- from chart_view-->
<!-- <where>-->
<!-- <if test="sceneId != null">-->
<!-- and scene_id = #{sceneId,jdbcType=VARCHAR}-->
<!-- </if>-->
<!-- <if test="id != null">-->
<!-- and id = #{id,jdbcType=VARCHAR}-->
<!-- </if>-->
<!-- </where>-->
<!-- <if test="sort != null">-->
<!-- order by ${sort}-->
<!-- </if>-->
<!-- </select>-->
<select
id=
"search"
resultMap=
"BaseResultMapDTO"
>
<select
id=
"search"
resultMap=
"BaseResultMapDTO"
>
select
select
id, `name`, scene_id, table_id, `type`, title, create_by, create_time, update_time,
id, `name`, scene_id, table_id, `type`, title, create_by, create_time, update_time,
...
@@ -236,4 +252,64 @@
...
@@ -236,4 +252,64 @@
<delete
id=
"deleteCircleGroup"
>
<delete
id=
"deleteCircleGroup"
>
delete chart_group from (select GET_CHART_GROUP_WITH_CHILDREN(#{pid}) cids) t,chart_group where FIND_IN_SET(chart_group.id,cids)
delete chart_group from (select GET_CHART_GROUP_WITH_CHILDREN(#{pid}) cids) t,chart_group where FIND_IN_SET(chart_group.id,cids)
</delete>
</delete>
<select
id=
"searchViewsWithPanelId"
resultMap=
"BaseResultMapDTO"
>
SELECT * FROM chart_view
WHERE
id IN (
SELECT
chart_view_id
FROM
panel_view
WHERE
panel_id = #{panelId}
)
</select>
<delete
id=
"deleteCacheWithPanel"
>
DELETE cvc,
pv
FROM
chart_view_cache cvc
INNER JOIN panel_view pv ON cvc.id = pv.chart_view_id
WHERE
pv.panel_id = #{panelId}
</delete>
<delete
id=
"deleteViewCache"
>
delete from chart_view_cache where id = #{viewId}
</delete>
<update
id=
"copyCacheToView"
>
UPDATE chart_view cv,
chart_view_cache cve
SET cv.`name` = cve.`name`,
cv.title = cve.title,
cv.scene_id = cve.scene_id,
cv.table_id = cve.table_id,
cv.`type` = cve.`type`,
cv.render = cve.render,
cv.result_count = cve.result_count,
cv.result_mode = cve.result_mode,
cv.create_by = cve.create_by,
cv.create_time = cve.create_time,
cv.update_time = cve.update_time,
cv.style_priority = cve.style_priority,
cv.chart_type = cve.chart_type,
cv.is_plugin = cve.is_plugin,
cv.x_axis = cve.x_axis,
cv.x_axis_ext = cve.x_axis_ext,
cv.y_axis = cve.y_axis,
cv.y_axis_ext = cve.y_axis_ext,
cv.ext_stack = cve.ext_stack,
cv.ext_bubble = cve.ext_bubble,
cv.custom_attr = cve.custom_attr,
cv.custom_style = cve.custom_style,
cv.custom_filter = cve.custom_filter,
cv.drill_fields = cve.drill_fields,
cv.SNAPSHOT = cve.SNAPSHOT where cve.id = cv.id and cv.id in
<foreach
collection=
"viewIds"
item=
"viewId"
open=
'('
separator=
','
close=
')'
>
#{viewId}
</foreach>
</update>
</mapper>
</mapper>
backend/src/main/java/io/dataease/base/mapper/ext/ExtDataSetTableMapper.java
浏览文件 @
cf557782
...
@@ -2,6 +2,7 @@ package io.dataease.base.mapper.ext;
...
@@ -2,6 +2,7 @@ package io.dataease.base.mapper.ext;
import
io.dataease.controller.request.dataset.DataSetTableRequest
;
import
io.dataease.controller.request.dataset.DataSetTableRequest
;
import
io.dataease.dto.dataset.DataSetTableDTO
;
import
io.dataease.dto.dataset.DataSetTableDTO
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
import
java.util.List
;
...
@@ -10,4 +11,6 @@ public interface ExtDataSetTableMapper {
...
@@ -10,4 +11,6 @@ public interface ExtDataSetTableMapper {
DataSetTableDTO
searchOne
(
DataSetTableRequest
request
);
DataSetTableDTO
searchOne
(
DataSetTableRequest
request
);
List
<
DataSetTableDTO
>
searchDataSetTableWithPanelId
(
@Param
(
"panelId"
)
String
panelId
,
@Param
(
"userId"
)
String
userId
);
}
}
backend/src/main/java/io/dataease/base/mapper/ext/ExtDataSetTableMapper.xml
浏览文件 @
cf557782
...
@@ -100,4 +100,27 @@
...
@@ -100,4 +100,27 @@
ORDER BY CONVERT(`name` using gbk)
ORDER BY CONVERT(`name` using gbk)
</select>
</select>
<select
id=
"searchDataSetTableWithPanelId"
resultMap=
"BaseResultMapDTO"
>
select
id, `name`, scene_id, data_source_id, `type`, `mode`,`info`, create_by, create_time,
get_auths(id,'dataset',#{userId}) as `privileges`
from dataset_table
where id in (
SELECT
table_id
FROM
chart_view
WHERE
id IN (
SELECT
chart_view_id
FROM
panel_view
WHERE
panel_id = #{panelId}
)
)
</select>
</mapper>
</mapper>
backend/src/main/java/io/dataease/commons/constants/CommonConstants.java
浏览文件 @
cf557782
...
@@ -43,6 +43,10 @@ public class CommonConstants {
...
@@ -43,6 +43,10 @@ public class CommonConstants {
// 仪表板
// 仪表板
public
static
final
String
PANEL
=
"panel"
;
public
static
final
String
PANEL
=
"panel"
;
// 仪表板编辑
public
static
final
String
PANEL_EDIT
=
"panel_edit"
;
}
}
//视图数据查询模式
//视图数据查询模式
...
@@ -54,4 +58,15 @@ public class CommonConstants {
...
@@ -54,4 +58,15 @@ public class CommonConstants {
// 自定义
// 自定义
public
static
final
String
CUSTOM
=
"custom"
;
public
static
final
String
CUSTOM
=
"custom"
;
}
}
//视图数据查询来源
public
static
final
class
VIEW_EDIT_FROM
{
// 仪表板
public
static
final
String
PANEL
=
"panel"
;
// 仪表板编辑
public
static
final
String
CACHE
=
"cache"
;
}
}
}
backend/src/main/java/io/dataease/controller/chart/ChartViewController.java
浏览文件 @
cf557782
...
@@ -3,6 +3,7 @@ package io.dataease.controller.chart;
...
@@ -3,6 +3,7 @@ package io.dataease.controller.chart;
import
com.github.xiaoymin.knife4j.annotations.ApiSupport
;
import
com.github.xiaoymin.knife4j.annotations.ApiSupport
;
import
io.dataease.auth.annotation.DePermission
;
import
io.dataease.auth.annotation.DePermission
;
import
io.dataease.auth.annotation.DePermissionProxy
;
import
io.dataease.auth.annotation.DePermissionProxy
;
import
io.dataease.base.domain.ChartViewCacheWithBLOBs
;
import
io.dataease.base.domain.ChartViewWithBLOBs
;
import
io.dataease.base.domain.ChartViewWithBLOBs
;
import
io.dataease.commons.constants.DePermissionType
;
import
io.dataease.commons.constants.DePermissionType
;
import
io.dataease.commons.constants.ResourceAuthLevel
;
import
io.dataease.commons.constants.ResourceAuthLevel
;
...
@@ -35,10 +36,17 @@ public class ChartViewController {
...
@@ -35,10 +36,17 @@ public class ChartViewController {
@DePermission
(
type
=
DePermissionType
.
PANEL
,
level
=
ResourceAuthLevel
.
PANNEL_LEVEL_MANAGE
)
@DePermission
(
type
=
DePermissionType
.
PANEL
,
level
=
ResourceAuthLevel
.
PANNEL_LEVEL_MANAGE
)
@ApiOperation
(
"保存"
)
@ApiOperation
(
"保存"
)
@PostMapping
(
"/save/{panelId}"
)
@PostMapping
(
"/save/{panelId}"
)
public
ChartView
WithBLOBs
save
(
@PathVariable
String
panelId
,
@RequestBody
ChartView
WithBLOBs
chartViewWithBLOBs
)
{
public
ChartView
DTO
save
(
@PathVariable
String
panelId
,
@RequestBody
ChartViewCache
WithBLOBs
chartViewWithBLOBs
)
{
return
chartViewService
.
save
(
chartViewWithBLOBs
);
return
chartViewService
.
save
(
chartViewWithBLOBs
);
}
}
@DePermission
(
type
=
DePermissionType
.
PANEL
,
level
=
ResourceAuthLevel
.
PANNEL_LEVEL_MANAGE
)
@ApiOperation
(
"保存到缓存表"
)
@PostMapping
(
"/save2Cache/{panelId}"
)
public
void
save2Cache
(
@PathVariable
String
panelId
,
@RequestBody
ChartViewCacheWithBLOBs
chartViewWithBLOBs
)
{
chartViewService
.
save2Cache
(
chartViewWithBLOBs
);
}
@ApiIgnore
@ApiIgnore
@ApiOperation
(
"查询"
)
@ApiOperation
(
"查询"
)
@PostMapping
(
"/list"
)
@PostMapping
(
"/list"
)
...
@@ -56,8 +64,8 @@ public class ChartViewController {
...
@@ -56,8 +64,8 @@ public class ChartViewController {
@DePermission
(
type
=
DePermissionType
.
PANEL
,
level
=
ResourceAuthLevel
.
PANNEL_LEVEL_VIEW
,
paramIndex
=
1
)
@DePermission
(
type
=
DePermissionType
.
PANEL
,
level
=
ResourceAuthLevel
.
PANNEL_LEVEL_VIEW
,
paramIndex
=
1
)
@ApiOperation
(
"详细信息"
)
@ApiOperation
(
"详细信息"
)
@PostMapping
(
"/get/{id}/{panelId}"
)
@PostMapping
(
"/get/{id}/{panelId}"
)
public
ChartView
WithBLOBs
get
(
@PathVariable
String
id
,
@PathVariable
String
panelId
)
{
public
ChartView
DTO
get
(
@PathVariable
String
id
,
@PathVariable
String
panelId
,
@RequestBody
ChartViewRequest
viewRequest
)
{
return
chartViewService
.
get
(
id
);
return
chartViewService
.
get
One
(
id
,
viewRequest
.
getQueryFrom
()
);
}
}
@ApiIgnore
@ApiIgnore
...
@@ -117,4 +125,20 @@ public class ChartViewController {
...
@@ -117,4 +125,20 @@ public class ChartViewController {
throws
Exception
{
throws
Exception
{
return
chartViewService
.
checkSameDataSet
(
viewIdSource
,
viewIdTarget
);
return
chartViewService
.
checkSameDataSet
(
viewIdSource
,
viewIdTarget
);
}
}
@DePermission
(
type
=
DePermissionType
.
PANEL
,
level
=
ResourceAuthLevel
.
PANNEL_LEVEL_VIEW
)
@ApiOperation
(
"初始化仪表板视图缓存"
)
@PostMapping
(
"/initViewCache/{panelId}"
)
public
void
initViewCache
(
@PathVariable
String
panelId
)
{
chartViewService
.
initViewCache
(
panelId
);
}
@DePermission
(
type
=
DePermissionType
.
PANEL
,
level
=
ResourceAuthLevel
.
PANNEL_LEVEL_VIEW
,
paramIndex
=
1
)
@ApiOperation
(
"重置视图缓存"
)
@PostMapping
(
"/resetViewCache/{id}/{panelId}"
)
public
void
resetViewCache
(
@PathVariable
String
id
,
@PathVariable
String
panelId
)
{
chartViewService
.
resetViewCache
(
id
);
}
}
}
backend/src/main/java/io/dataease/controller/panel/PanelGroupController.java
浏览文件 @
cf557782
...
@@ -23,6 +23,7 @@ import org.springframework.web.bind.annotation.*;
...
@@ -23,6 +23,7 @@ import org.springframework.web.bind.annotation.*;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
/**
/**
* Author: wangjiahao
* Author: wangjiahao
...
@@ -92,4 +93,11 @@ public class PanelGroupController {
...
@@ -92,4 +93,11 @@ public class PanelGroupController {
return
panelGroupService
.
queryPanelViewTree
();
return
panelGroupService
.
queryPanelViewTree
();
}
}
@ApiOperation
(
"仪表板组件信息"
)
@GetMapping
(
"/queryPanelComponents/{id}"
)
@I18n
public
Map
queryPanelComponents
(
@PathVariable
String
id
){
return
panelGroupService
.
queryPanelComponents
(
id
);
}
}
}
backend/src/main/java/io/dataease/controller/request/chart/ChartExtRequest.java
浏览文件 @
cf557782
...
@@ -42,4 +42,5 @@ public class ChartExtRequest {
...
@@ -42,4 +42,5 @@ public class ChartExtRequest {
@ApiModelProperty
(
hidden
=
true
)
@ApiModelProperty
(
hidden
=
true
)
private
PermissionProxy
proxy
;
private
PermissionProxy
proxy
;
}
}
backend/src/main/java/io/dataease/controller/request/chart/ChartViewRequest.java
浏览文件 @
cf557782
...
@@ -16,4 +16,8 @@ public class ChartViewRequest extends ChartViewWithBLOBs {
...
@@ -16,4 +16,8 @@ public class ChartViewRequest extends ChartViewWithBLOBs {
private
String
sort
;
private
String
sort
;
@ApiModelProperty
(
"当前登陆用户ID"
)
@ApiModelProperty
(
"当前登陆用户ID"
)
private
String
userId
;
private
String
userId
;
@ApiModelProperty
(
"编辑来源"
)
private
String
editFrom
;
@ApiModelProperty
(
"查询来源"
)
private
String
queryFrom
;
}
}
backend/src/main/java/io/dataease/dto/panel/PanelGroupDTO.java
浏览文件 @
cf557782
...
@@ -2,11 +2,13 @@ package io.dataease.dto.panel;
...
@@ -2,11 +2,13 @@ package io.dataease.dto.panel;
import
io.dataease.base.domain.PanelGroupWithBLOBs
;
import
io.dataease.base.domain.PanelGroupWithBLOBs
;
import
io.dataease.commons.model.ITreeBase
;
import
io.dataease.commons.model.ITreeBase
;
import
io.dataease.dto.chart.ChartViewDTO
;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.Data
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
/**
/**
* Author: wangjiahao
* Author: wangjiahao
...
@@ -31,6 +33,7 @@ public class PanelGroupDTO extends PanelGroupWithBLOBs implements ITreeBase<Pane
...
@@ -31,6 +33,7 @@ public class PanelGroupDTO extends PanelGroupWithBLOBs implements ITreeBase<Pane
private
String
sourcePanelName
;
private
String
sourcePanelName
;
@ApiModelProperty
(
"子节点"
)
@ApiModelProperty
(
"子节点"
)
private
List
<
PanelGroupDTO
>
children
;
private
List
<
PanelGroupDTO
>
children
;
@ApiModelProperty
(
"视图信息"
)
private
List
<
Map
<
String
,
ChartViewDTO
>>
viewsInfo
;
}
}
backend/src/main/java/io/dataease/service/chart/ChartViewService.java
浏览文件 @
cf557782
...
@@ -6,6 +6,7 @@ import io.dataease.auth.api.dto.CurrentUserDto;
...
@@ -6,6 +6,7 @@ import io.dataease.auth.api.dto.CurrentUserDto;
import
io.dataease.auth.entity.SysUserEntity
;
import
io.dataease.auth.entity.SysUserEntity
;
import
io.dataease.auth.service.AuthUserService
;
import
io.dataease.auth.service.AuthUserService
;
import
io.dataease.base.domain.*
;
import
io.dataease.base.domain.*
;
import
io.dataease.base.mapper.ChartViewCacheMapper
;
import
io.dataease.base.mapper.ChartViewMapper
;
import
io.dataease.base.mapper.ChartViewMapper
;
import
io.dataease.base.mapper.ext.ExtChartGroupMapper
;
import
io.dataease.base.mapper.ext.ExtChartGroupMapper
;
import
io.dataease.base.mapper.ext.ExtChartViewMapper
;
import
io.dataease.base.mapper.ext.ExtChartViewMapper
;
...
@@ -71,29 +72,55 @@ public class ChartViewService {
...
@@ -71,29 +72,55 @@ public class ChartViewService {
private
PermissionService
permissionService
;
private
PermissionService
permissionService
;
@Resource
@Resource
private
AuthUserService
authUserService
;
private
AuthUserService
authUserService
;
@Resource
private
ChartViewCacheMapper
chartViewCacheMapper
;
//默认使用非公平
//默认使用非公平
private
ReentrantLock
lock
=
new
ReentrantLock
();
private
ReentrantLock
lock
=
new
ReentrantLock
();
public
ChartViewWithBLOBs
save
(
ChartViewWithBLOBs
chartView
)
{
// 直接保存统一到缓存表
checkName
(
chartView
);
public
ChartViewDTO
save
(
ChartViewCacheWithBLOBs
chartView
)
{
long
timestamp
=
System
.
currentTimeMillis
();
long
timestamp
=
System
.
currentTimeMillis
();
chartView
.
setUpdateTime
(
timestamp
);
chartView
.
setUpdateTime
(
timestamp
);
if
(
ObjectUtils
.
isEmpty
(
chartView
.
getId
()))
{
chartViewCacheMapper
.
updateByPrimaryKeySelective
(
chartView
);
chartView
.
setId
(
UUID
.
randomUUID
().
toString
());
Optional
.
ofNullable
(
chartView
.
getId
()).
ifPresent
(
id
->
{
chartView
.
setCreateBy
(
AuthUtils
.
getUser
().
getUsername
());
CacheUtils
.
remove
(
JdbcConstants
.
VIEW_CACHE_KEY
,
id
);
chartView
.
setCreateTime
(
timestamp
);
});
chartView
.
setUpdateTime
(
timestamp
);
return
getOne
(
chartView
.
getId
(),
"panel_edit"
);
chartViewMapper
.
insertSelective
(
chartView
);
}
}
else
{
chartViewMapper
.
updateByPrimaryKeySelective
(
chartView
);
}
// 直接保存统一到缓存表
public
void
save2Cache
(
ChartViewCacheWithBLOBs
chartView
)
{
long
timestamp
=
System
.
currentTimeMillis
();
chartView
.
setUpdateTime
(
timestamp
);
chartViewCacheMapper
.
updateByPrimaryKeySelective
(
chartView
);
Optional
.
ofNullable
(
chartView
.
getId
()).
ifPresent
(
id
->
{
Optional
.
ofNullable
(
chartView
.
getId
()).
ifPresent
(
id
->
{
CacheUtils
.
remove
(
JdbcConstants
.
VIEW_CACHE_KEY
,
id
);
CacheUtils
.
remove
(
JdbcConstants
.
VIEW_CACHE_KEY
,
id
);
});
});
return
getOneWithPermission
(
chartView
.
getId
());
}
}
// // 直接保存统一到缓存表
// public ChartViewWithBLOBs save(ChartViewRequest chartView) {
// checkName(chartView);
// long timestamp = System.currentTimeMillis();
// chartView.setUpdateTime(timestamp);
// if (ObjectUtils.isEmpty(chartView.getId())) {
// chartView.setId(UUID.randomUUID().toString());
// chartView.setCreateBy(AuthUtils.getUser().getUsername());
// chartView.setCreateTime(timestamp);
// chartView.setUpdateTime(timestamp);
// chartViewMapper.insertSelective(chartView);
// } else {
// chartViewMapper.updateByPrimaryKeySelective(chartView);
// }
// Optional.ofNullable(chartView.getId()).ifPresent(id -> {
// CacheUtils.remove(JdbcConstants.VIEW_CACHE_KEY, id);
// });
// return getOneWithPermission(chartView.getId());
// }
public
List
<
ChartViewDTO
>
list
(
ChartViewRequest
chartViewRequest
)
{
public
List
<
ChartViewDTO
>
list
(
ChartViewRequest
chartViewRequest
)
{
chartViewRequest
.
setUserId
(
String
.
valueOf
(
AuthUtils
.
getUser
().
getUserId
()));
chartViewRequest
.
setUserId
(
String
.
valueOf
(
AuthUtils
.
getUser
().
getUserId
()));
return
extChartViewMapper
.
search
(
chartViewRequest
);
return
extChartViewMapper
.
search
(
chartViewRequest
);
...
@@ -178,6 +205,21 @@ public class ChartViewService {
...
@@ -178,6 +205,21 @@ public class ChartViewService {
return
extChartViewMapper
.
searchOneWithPrivileges
(
userId
,
id
);
return
extChartViewMapper
.
searchOneWithPrivileges
(
userId
,
id
);
}
}
public
ChartViewDTO
getOne
(
String
id
,
String
queryFrom
){
ChartViewDTO
result
;
//仪表板编辑页面 从缓存表中取数据 缓存表中没有数据则进行插入
if
(
CommonConstants
.
VIEW_QUERY_FROM
.
PANEL_EDIT
.
equals
(
queryFrom
)){
result
=
extChartViewMapper
.
searchOneFromCache
(
id
);
if
(
result
==
null
){
extChartViewMapper
.
copyToCache
(
id
);
result
=
extChartViewMapper
.
searchOneFromCache
(
id
);
}
}
else
{
result
=
extChartViewMapper
.
searchOne
(
id
);
}
return
result
;
}
public
void
delete
(
String
id
)
{
public
void
delete
(
String
id
)
{
chartViewMapper
.
deleteByPrimaryKey
(
id
);
chartViewMapper
.
deleteByPrimaryKey
(
id
);
}
}
...
@@ -189,7 +231,7 @@ public class ChartViewService {
...
@@ -189,7 +231,7 @@ public class ChartViewService {
}
}
public
ChartViewDTO
getData
(
String
id
,
ChartExtRequest
request
)
throws
Exception
{
public
ChartViewDTO
getData
(
String
id
,
ChartExtRequest
request
)
throws
Exception
{
ChartViewDTO
view
=
this
.
getOne
WithPermission
(
id
);
ChartViewDTO
view
=
this
.
getOne
(
id
,
request
.
getQueryFrom
()
);
// 如果是从仪表板获取视图数据,则仪表板的查询模式,查询结果的数量,覆盖视图对应的属性
// 如果是从仪表板获取视图数据,则仪表板的查询模式,查询结果的数量,覆盖视图对应的属性
if
(
CommonConstants
.
VIEW_QUERY_FROM
.
PANEL
.
equals
(
request
.
getQueryFrom
())
&&
CommonConstants
.
VIEW_RESULT_MODE
.
CUSTOM
.
equals
(
request
.
getResultMode
()))
{
if
(
CommonConstants
.
VIEW_QUERY_FROM
.
PANEL
.
equals
(
request
.
getQueryFrom
())
&&
CommonConstants
.
VIEW_RESULT_MODE
.
CUSTOM
.
equals
(
request
.
getResultMode
()))
{
view
.
setResultMode
(
request
.
getResultMode
());
view
.
setResultMode
(
request
.
getResultMode
());
...
@@ -1712,4 +1754,13 @@ public class ChartViewService {
...
@@ -1712,4 +1754,13 @@ public class ChartViewService {
}
}
}
}
}
}
public
void
initViewCache
(
String
panelId
){
extChartViewMapper
.
deleteCacheWithPanel
(
panelId
);
}
public
void
resetViewCache
(
String
viewId
){
extChartViewMapper
.
deleteViewCache
(
viewId
);
extChartViewMapper
.
copyToCache
(
viewId
);
}
}
}
backend/src/main/java/io/dataease/service/panel/PanelGroupService.java
浏览文件 @
cf557782
...
@@ -14,14 +14,17 @@ import io.dataease.commons.utils.AuthUtils;
...
@@ -14,14 +14,17 @@ import io.dataease.commons.utils.AuthUtils;
import
io.dataease.commons.utils.LogUtil
;
import
io.dataease.commons.utils.LogUtil
;
import
io.dataease.commons.utils.TreeUtils
;
import
io.dataease.commons.utils.TreeUtils
;
import
io.dataease.controller.request.authModel.VAuthModelRequest
;
import
io.dataease.controller.request.authModel.VAuthModelRequest
;
import
io.dataease.controller.request.dataset.DataSetTableRequest
;
import
io.dataease.controller.request.panel.PanelGroupRequest
;
import
io.dataease.controller.request.panel.PanelGroupRequest
;
import
io.dataease.dto.authModel.VAuthModelDTO
;
import
io.dataease.dto.authModel.VAuthModelDTO
;
import
io.dataease.dto.chart.ChartViewDTO
;
import
io.dataease.dto.chart.ChartViewDTO
;
import
io.dataease.dto.dataset.DataSetTableDTO
;
import
io.dataease.dto.panel.PanelGroupDTO
;
import
io.dataease.dto.panel.PanelGroupDTO
;
import
io.dataease.dto.panel.linkJump.PanelLinkJumpBaseRequest
;
import
io.dataease.dto.panel.linkJump.PanelLinkJumpBaseRequest
;
import
io.dataease.exception.DataEaseException
;
import
io.dataease.exception.DataEaseException
;
import
io.dataease.i18n.Translator
;
import
io.dataease.i18n.Translator
;
import
io.dataease.service.chart.ChartViewService
;
import
io.dataease.service.chart.ChartViewService
;
import
io.dataease.service.dataset.DataSetTableService
;
import
io.dataease.service.sys.SysAuthService
;
import
io.dataease.service.sys.SysAuthService
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
...
@@ -33,10 +36,7 @@ import org.springframework.transaction.annotation.Transactional;
...
@@ -33,10 +36,7 @@ import org.springframework.transaction.annotation.Transactional;
import
org.springframework.util.Assert
;
import
org.springframework.util.Assert
;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
import
java.util.ArrayList
;
import
java.util.*
;
import
java.util.List
;
import
java.util.Optional
;
import
java.util.UUID
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
/**
/**
...
@@ -81,6 +81,11 @@ public class PanelGroupService {
...
@@ -81,6 +81,11 @@ public class PanelGroupService {
private
ExtPanelViewLinkageMapper
extPanelViewLinkageMapper
;
private
ExtPanelViewLinkageMapper
extPanelViewLinkageMapper
;
@Resource
@Resource
private
ExtChartViewMapper
extChartViewMapper
;
private
ExtChartViewMapper
extChartViewMapper
;
@Resource
private
ExtDataSetTableMapper
extDataSetTableMapper
;
@Resource
private
DataSetTableService
dataSetTableService
;
public
List
<
PanelGroupDTO
>
tree
(
PanelGroupRequest
panelGroupRequest
)
{
public
List
<
PanelGroupDTO
>
tree
(
PanelGroupRequest
panelGroupRequest
)
{
String
userId
=
String
.
valueOf
(
AuthUtils
.
getUser
().
getUserId
());
String
userId
=
String
.
valueOf
(
AuthUtils
.
getUser
().
getUserId
());
...
@@ -99,13 +104,8 @@ public class PanelGroupService {
...
@@ -99,13 +104,8 @@ public class PanelGroupService {
@DeCleaner
(
DePermissionType
.
PANEL
)
@DeCleaner
(
DePermissionType
.
PANEL
)
// @Transactional
// @Transactional
public
PanelGroup
saveOrUpdate
(
PanelGroupRequest
request
)
{
public
PanelGroup
saveOrUpdate
(
PanelGroupRequest
request
)
{
try
{
Boolean
mobileLayout
=
panelViewService
.
syncPanelViews
(
request
);
Boolean
mobileLayout
=
panelViewService
.
syncPanelViews
(
request
);
request
.
setMobileLayout
(
mobileLayout
);
request
.
setMobileLayout
(
mobileLayout
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
LOGGER
.
error
(
"更新panelView出错panelId:{}"
,
request
.
getId
());
}
String
panelId
=
request
.
getId
();
String
panelId
=
request
.
getId
();
if
(
StringUtils
.
isEmpty
(
panelId
))
{
if
(
StringUtils
.
isEmpty
(
panelId
))
{
// 新建
// 新建
...
@@ -341,4 +341,42 @@ public class PanelGroupService {
...
@@ -341,4 +341,42 @@ public class PanelGroupService {
LogUtil
.
info
(
"=====v1.8版本 仪表板私有化【结束】====="
);
LogUtil
.
info
(
"=====v1.8版本 仪表板私有化【结束】====="
);
}
}
// 获取仪表板的视图信息
public
Map
queryPanelComponents
(
String
panelId
)
{
try
{
Map
result
,
tableWithFields
,
viewWithViewInfo
,
tableWithTableInfo
;
//查找所有view
List
<
ChartViewDTO
>
views
=
extChartViewMapper
.
searchViewsWithPanelId
(
panelId
);
viewWithViewInfo
=
views
.
stream
().
collect
(
Collectors
.
toMap
(
ChartViewDTO:
:
getId
,
ChartViewDTO
->
ChartViewDTO
));
//查找所有dataset
List
<
DataSetTableDTO
>
tables
=
extDataSetTableMapper
.
searchDataSetTableWithPanelId
(
panelId
,
String
.
valueOf
(
AuthUtils
.
getUser
().
getUserId
()));
tableWithTableInfo
=
tables
.
stream
().
collect
(
Collectors
.
toMap
(
DataSetTableDTO:
:
getId
,
DataSetTableDTO
->
DataSetTableDTO
));
//查找所有datasetFields
tableWithFields
=
new
HashMap
();
if
(
CollectionUtils
.
isNotEmpty
(
tables
))
{
for
(
DataSetTableDTO
table
:
tables
)
{
DataSetTableRequest
dataSetTableRequest
=
new
DataSetTableRequest
();
dataSetTableRequest
.
setId
(
table
.
getId
());
Map
<
String
,
List
<
DatasetTableField
>>
tableDataSetFields
=
dataSetTableService
.
getFieldsFromDE
(
dataSetTableRequest
);
tableWithFields
.
put
(
table
.
getId
(),
tableDataSetFields
);
}
}
result
=
new
HashMap
();
result
.
put
(
"tableWithFields"
,
tableWithFields
);
result
.
put
(
"viewWithViewInfo"
,
viewWithViewInfo
);
result
.
put
(
"tableWithTableInfo"
,
tableWithTableInfo
);
return
result
;
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
LogUtil
.
error
(
e
);
}
return
null
;
}
public
void
findPanelAttachInfo
(
String
panelId
)
{
}
}
}
backend/src/main/java/io/dataease/service/panel/PanelViewService.java
浏览文件 @
cf557782
...
@@ -7,6 +7,7 @@ import io.dataease.base.domain.PanelGroupWithBLOBs;
...
@@ -7,6 +7,7 @@ import io.dataease.base.domain.PanelGroupWithBLOBs;
import
io.dataease.base.domain.PanelView
;
import
io.dataease.base.domain.PanelView
;
import
io.dataease.base.domain.PanelViewExample
;
import
io.dataease.base.domain.PanelViewExample
;
import
io.dataease.base.mapper.PanelViewMapper
;
import
io.dataease.base.mapper.PanelViewMapper
;
import
io.dataease.base.mapper.ext.ExtChartViewMapper
;
import
io.dataease.base.mapper.ext.ExtPanelViewMapper
;
import
io.dataease.base.mapper.ext.ExtPanelViewMapper
;
import
io.dataease.commons.utils.AuthUtils
;
import
io.dataease.commons.utils.AuthUtils
;
import
io.dataease.commons.utils.BeanUtils
;
import
io.dataease.commons.utils.BeanUtils
;
...
@@ -39,6 +40,9 @@ public class PanelViewService {
...
@@ -39,6 +40,9 @@ public class PanelViewService {
@Resource
@Resource
private
PanelViewMapper
panelViewMapper
;
private
PanelViewMapper
panelViewMapper
;
@Resource
private
ExtChartViewMapper
extChartViewMapper
;
private
final
static
String
SCENE_TYPE
=
"scene"
;
private
final
static
String
SCENE_TYPE
=
"scene"
;
public
List
<
PanelViewDto
>
groups
()
{
public
List
<
PanelViewDto
>
groups
()
{
...
@@ -115,6 +119,10 @@ public class PanelViewService {
...
@@ -115,6 +119,10 @@ public class PanelViewService {
extPanelViewMapper
.
deleteWithPanelId
(
panelId
);
extPanelViewMapper
.
deleteWithPanelId
(
panelId
);
if
(
CollectionUtils
.
isNotEmpty
(
panelViewInsertDTOList
))
{
if
(
CollectionUtils
.
isNotEmpty
(
panelViewInsertDTOList
))
{
extPanelViewMapper
.
savePanelView
(
panelViewInsertDTOList
);
extPanelViewMapper
.
savePanelView
(
panelViewInsertDTOList
);
//将视图从cache表中更新到正式表中
List
<
String
>
viewIds
=
panelViewInsertDTOList
.
stream
().
map
(
panelView
->
panelView
.
getChartViewId
()).
collect
(
Collectors
.
toList
());
extChartViewMapper
.
copyCacheToView
(
viewIds
);
extChartViewMapper
.
deleteCacheWithPanel
(
panelId
);
}
}
}
}
return
mobileLayout
;
return
mobileLayout
;
...
...
backend/src/main/resources/generatorConfig.xml
浏览文件 @
cf557782
...
@@ -60,7 +60,7 @@
...
@@ -60,7 +60,7 @@
</javaClientGenerator>
</javaClientGenerator>
<!--要生成的数据库表 -->
<!--要生成的数据库表 -->
<table
tableName=
"
dataease_code_version
"
/>
<table
tableName=
"
chart_view_cache
"
/>
<!-- <table tableName="chart_view"/>-->
<!-- <table tableName="chart_view"/>-->
<!-- <table tableName="panel_view"/>-->
<!-- <table tableName="panel_view"/>-->
<!-- <table tableName="panel_link_jump"/>-->
<!-- <table tableName="panel_link_jump"/>-->
...
...
frontend/src/api/chart/chart.js
浏览文件 @
cf557782
import
request
from
'@/utils/request'
import
request
from
'@/utils/request'
import
store
from
'@/store'
import
{
queryPanelComponents
}
from
'@/api/panel/panel'
export
function
post
(
url
,
data
)
{
export
function
post
(
url
,
data
)
{
return
request
({
return
request
({
url
:
url
,
url
:
url
,
method
:
'post'
,
method
:
'post'
,
loading
:
tru
e
,
loading
:
fals
e
,
data
data
})
})
}
}
...
@@ -13,7 +15,7 @@ export function getChartTree(data) {
...
@@ -13,7 +15,7 @@ export function getChartTree(data) {
return
request
({
return
request
({
url
:
'api'
,
url
:
'api'
,
method
:
'post'
,
method
:
'post'
,
loading
:
tru
e
,
loading
:
fals
e
,
data
data
})
})
}
}
...
@@ -38,7 +40,7 @@ export function searchAdviceSceneId(panelId) {
...
@@ -38,7 +40,7 @@ export function searchAdviceSceneId(panelId) {
return
request
({
return
request
({
url
:
'/chart/view/searchAdviceSceneId/'
+
panelId
,
url
:
'/chart/view/searchAdviceSceneId/'
+
panelId
,
method
:
'get'
,
method
:
'get'
,
loading
:
tru
e
loading
:
fals
e
})
})
}
}
...
@@ -54,7 +56,7 @@ export function ajaxGetDataOnly(id, panelId, data) {
...
@@ -54,7 +56,7 @@ export function ajaxGetDataOnly(id, panelId, data) {
return
request
({
return
request
({
url
:
'/chart/view/getData/'
+
id
+
'/'
+
panelId
,
url
:
'/chart/view/getData/'
+
id
+
'/'
+
panelId
,
method
:
'post'
,
method
:
'post'
,
loading
:
tru
e
,
loading
:
fals
e
,
hideMsg
:
true
,
hideMsg
:
true
,
data
data
})
})
...
@@ -75,3 +77,34 @@ export function deleteCircle(id) {
...
@@ -75,3 +77,34 @@ export function deleteCircle(id) {
})
})
}
}
export
function
getChartDetails
(
id
,
panelId
,
data
)
{
return
request
({
url
:
'/chart/view/get/'
+
id
+
'/'
+
panelId
,
method
:
'post'
,
loading
:
false
,
data
})
}
export
function
save2Cache
(
panelId
,
data
)
{
return
request
({
url
:
'/chart/view/save2Cache/'
+
panelId
,
method
:
'post'
,
loading
:
false
,
data
})
}
export
function
resetViewCacheCallBack
(
viewId
,
panelId
,
callback
)
{
// 加载仪表板组件视图数据
resetViewCache
(
viewId
,
panelId
).
then
(
rep
=>
{
callback
(
rep
)
})
}
export
function
resetViewCache
(
viewId
,
panelId
)
{
return
request
({
url
:
'/chart/view/resetViewCache/'
+
viewId
+
'/'
+
panelId
,
method
:
'post'
,
loading
:
false
})
}
frontend/src/api/panel/panel.js
浏览文件 @
cf557782
...
@@ -164,3 +164,28 @@ export function queryPanelViewTree() {
...
@@ -164,3 +164,28 @@ export function queryPanelViewTree() {
})
})
}
}
export
function
initPanelComponentsData
(
panelId
,
callback
)
{
// 加载仪表板组件视图数据
queryPanelComponents
(
panelId
).
then
(
rep
=>
{
store
.
commit
(
'initPanelComponents'
,
rep
.
data
)
callback
(
rep
)
})
}
export
function
queryPanelComponents
(
id
)
{
return
request
({
url
:
'panel/group/queryPanelComponents/'
+
id
,
method
:
'get'
,
loading
:
false
})
}
export
function
initViewCache
(
panelId
)
{
// 初始化仪表板视图缓存
return
request
({
url
:
'chart/view/initViewCache/'
+
panelId
,
method
:
'post'
,
loading
:
false
})
}
frontend/src/components/DeDrag/index.vue
浏览文件 @
cf557782
...
@@ -531,7 +531,7 @@ export default {
...
@@ -531,7 +531,7 @@ export default {
width
:
this
.
computedMainSlotWidth
,
width
:
this
.
computedMainSlotWidth
,
height
:
this
.
computedMainSlotHeight
height
:
this
.
computedMainSlotHeight
}
}
if
(
this
.
element
.
commonBackground
&&
this
.
element
.
commonBackground
.
enable
)
{
if
(
this
.
element
.
commonBackground
&&
this
.
element
.
commonBackground
.
enable
)
{
if
(
this
.
element
.
commonBackground
.
backgroundType
===
'innerImage'
)
{
if
(
this
.
element
.
commonBackground
.
backgroundType
===
'innerImage'
)
{
style
[
'background'
]
=
`url(
${
this
.
element
.
commonBackground
.
innerImage
}
) no-repeat`
style
[
'background'
]
=
`url(
${
this
.
element
.
commonBackground
.
innerImage
}
) no-repeat`
}
else
if
(
this
.
element
.
commonBackground
.
backgroundType
===
'outerImage'
)
{
}
else
if
(
this
.
element
.
commonBackground
.
backgroundType
===
'outerImage'
)
{
...
...
frontend/src/components/canvas/components/Editor/EditBar.vue
浏览文件 @
cf557782
...
@@ -184,22 +184,25 @@ export default {
...
@@ -184,22 +184,25 @@ export default {
// resize
// resize
this
.
$emit
(
'resizeView'
)
this
.
$emit
(
'resizeView'
)
},
},
// edit() {
// // 编辑时临时保存 当前修改的画布
// 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' }})
// }
// if (this.curComponent.type === 'custom') {
// bus.$emit('component-dialog-edit')
// }
// // 编辑样式组件
// if (this.curComponent.type === 'v-text' || this.curComponent.type === 'rect-shape') {
// bus.$emit('component-dialog-style')
// }
// },
edit
()
{
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'
}})
}
if
(
this
.
curComponent
.
type
===
'custom'
)
{
bus
.
$emit
(
'component-dialog-edit'
)
}
// 编辑样式组件
if
(
this
.
curComponent
.
type
===
'v-text'
||
this
.
curComponent
.
type
===
'rect-shape'
)
{
bus
.
$emit
(
'component-dialog-style'
)
}
},
},
linkageEdit
()
{
linkageEdit
()
{
...
...
frontend/src/components/canvas/components/Editor/SettingMenu.vue
浏览文件 @
cf557782
...
@@ -46,23 +46,24 @@ export default {
...
@@ -46,23 +46,24 @@ export default {
]),
]),
methods
:
{
methods
:
{
edit
()
{
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
))
// this.$store.dispatch('panel/setComponentDataTemp', JSON.stringify(this.componentData))
if
(
this
.
curComponent
.
type
===
'view'
)
{
// this.$store.dispatch('panel/setCanvasStyleDataTemp', JSON.stringify(this.canvasStyleData))
this
.
$store
.
dispatch
(
'chart/setViewId'
,
null
)
// if (this.curComponent.type === 'view') {
this
.
$store
.
dispatch
(
'chart/setViewId'
,
this
.
curComponent
.
propValue
.
viewId
)
// this.$store.dispatch('chart/setViewId', null)
bus
.
$emit
(
'PanelSwitchComponent'
,
{
name
:
'ChartEdit'
,
param
:
{
'id'
:
this
.
curComponent
.
propValue
.
viewId
,
'optType'
:
'edit'
}})
// this.$store.dispatch('chart/setViewId', this.curComponent.propValue.viewId)
}
// bus.$emit('PanelSwitchComponent', { name: 'ChartEdit', param: { 'id': this.curComponent.propValue.viewId, 'optType': 'edit' }})
if
(
this
.
curComponent
.
type
===
'custom'
)
{
// }
bus
.
$emit
(
'component-dialog-edit'
)
// if (this.curComponent.type === 'custom') {
}
// bus.$emit('component-dialog-edit')
// }
// 编辑样式组件
//
// // 编辑样式组件
if
(
this
.
curComponent
.
type
===
'v-text'
||
this
.
curComponent
.
type
===
'rect-shape'
)
{
//
bus
.
$emit
(
'component-dialog-style'
)
// if (this.curComponent.type === 'v-text' || this.curComponent.type === 'rect-shape') {
}
// bus.$emit('component-dialog-style')
// }
},
},
lock
()
{
lock
()
{
this
.
$store
.
commit
(
'lock'
)
this
.
$store
.
commit
(
'lock'
)
...
...
frontend/src/components/canvas/components/Editor/index.vue
浏览文件 @
cf557782
...
@@ -57,6 +57,7 @@
...
@@ -57,6 +57,7 @@
@linkJumpSet="linkJumpSet(item)"
@linkJumpSet="linkJumpSet(item)"
@boardSet="boardSet(item)"
@boardSet="boardSet(item)"
@canvasDragging="canvasDragging"
@canvasDragging="canvasDragging"
@editComponent="editComponent(index,item)"
>
>
<component
<component
:is=
"item.component"
:is=
"item.component"
...
@@ -1286,6 +1287,11 @@ export default {
...
@@ -1286,6 +1287,11 @@ export default {
this
.
$refs
.
wrapperChild
[
index
].
chartResize
()
this
.
$refs
.
wrapperChild
[
index
].
chartResize
()
}
}
},
},
editComponent
(
index
,
item
)
{
if
(
item
.
type
===
'view'
)
{
this
.
$refs
.
wrapperChild
[
index
].
editChart
()
}
},
handleDragOver
(
e
)
{
handleDragOver
(
e
)
{
this
.
dragComponentInfo
.
shadowStyle
.
x
=
e
.
pageX
-
220
this
.
dragComponentInfo
.
shadowStyle
.
x
=
e
.
pageX
-
220
this
.
dragComponentInfo
.
shadowStyle
.
y
=
e
.
pageY
-
90
+
this
.
scrollTop
this
.
dragComponentInfo
.
shadowStyle
.
y
=
e
.
pageY
-
90
+
this
.
scrollTop
...
...
frontend/src/components/canvas/custom-component/UserView.vue
浏览文件 @
cf557782
...
@@ -372,6 +372,9 @@ export default {
...
@@ -372,6 +372,9 @@ export default {
bus
.
$on
(
'plugin-add-view-track-filter'
,
param
=>
{
bus
.
$on
(
'plugin-add-view-track-filter'
,
param
=>
{
param
.
viewId
&&
param
.
viewId
===
this
.
element
.
propValue
.
viewId
&&
this
.
addViewTrackFilter
(
param
)
param
.
viewId
&&
param
.
viewId
===
this
.
element
.
propValue
.
viewId
&&
this
.
addViewTrackFilter
(
param
)
})
})
bus
.
$on
(
'view-in-cache'
,
param
=>
{
param
.
viewId
&&
param
.
viewId
===
this
.
element
.
propValue
.
viewId
&&
this
.
getDataEdit
(
param
)
})
},
},
addViewTrackFilter
(
linkageParam
)
{
addViewTrackFilter
(
linkageParam
)
{
...
@@ -431,7 +434,8 @@ export default {
...
@@ -431,7 +434,8 @@ export default {
}
}
const
requestInfo
=
{
const
requestInfo
=
{
...
this
.
filter
,
...
this
.
filter
,
cache
:
cache
cache
:
cache
,
queryFrom
:
this
.
isEdit
?
'panel_edit'
:
'panel'
}
}
if
(
this
.
panelInfo
.
proxy
)
{
if
(
this
.
panelInfo
.
proxy
)
{
// method = viewInfo
// method = viewInfo
...
@@ -711,6 +715,18 @@ export default {
...
@@ -711,6 +715,18 @@ export default {
renderComponent
()
{
renderComponent
()
{
return
this
.
chart
.
render
return
this
.
chart
.
render
},
getDataEdit
(
param
)
{
this
.
$store
.
state
.
styleChangeTimes
++
if
(
param
.
type
===
'propChange'
)
{
this
.
getData
(
param
.
viewId
,
false
)
}
else
if
(
param
.
type
===
'styleChange'
)
{
this
.
chart
.
customAttr
=
param
.
viewInfo
.
customAttr
this
.
chart
.
customStyle
=
param
.
viewInfo
.
customStyle
this
.
sourceCustomAttrStr
=
this
.
chart
.
customAttr
this
.
sourceCustomStyleStr
=
this
.
chart
.
customStyle
this
.
mergeScale
()
}
}
}
}
}
}
}
...
...
frontend/src/lang/en.js
浏览文件 @
cf557782
...
@@ -1029,7 +1029,8 @@ export default {
...
@@ -1029,7 +1029,8 @@ export default {
table_item_align
:
'Body Align'
,
table_item_align
:
'Body Align'
,
table_align_left
:
'Left'
,
table_align_left
:
'Left'
,
table_align_center
:
'Center'
,
table_align_center
:
'Center'
,
table_align_right
:
'Right'
table_align_right
:
'Right'
,
draw_back
:
'Draw Back'
},
},
dataset
:
{
dataset
:
{
sheet_warn
:
'There are multiple sheet pages, and the first one is extracted by default'
,
sheet_warn
:
'There are multiple sheet pages, and the first one is extracted by default'
,
...
@@ -1578,7 +1579,8 @@ export default {
...
@@ -1578,7 +1579,8 @@ export default {
uninstall_confirm
:
'Comfirm to uninstall the plugin?'
,
uninstall_confirm
:
'Comfirm to uninstall the plugin?'
,
uninstall_cancel
:
'Cancel uninstall plugin'
,
uninstall_cancel
:
'Cancel uninstall plugin'
,
setting_background
:
'BackGround'
,
setting_background
:
'BackGround'
,
setting_jump
:
'Jump Setting'
setting_jump
:
'Jump Setting'
,
select_view
:
'Select View'
},
},
display
:
{
display
:
{
logo
:
'Head system logo'
,
logo
:
'Head system logo'
,
...
...
frontend/src/lang/tw.js
浏览文件 @
cf557782
...
@@ -1029,7 +1029,8 @@ export default {
...
@@ -1029,7 +1029,8 @@ export default {
table_item_align
:
'表格對齊方式'
,
table_item_align
:
'表格對齊方式'
,
table_align_left
:
'左對齊'
,
table_align_left
:
'左對齊'
,
table_align_center
:
'居中'
,
table_align_center
:
'居中'
,
table_align_right
:
'右對齊'
table_align_right
:
'右對齊'
,
draw_back
:
'收回'
},
},
dataset
:
{
dataset
:
{
sheet_warn
:
'有多個 Sheet 頁,默認抽取第一個'
,
sheet_warn
:
'有多個 Sheet 頁,默認抽取第一個'
,
...
@@ -1564,7 +1565,8 @@ export default {
...
@@ -1564,7 +1565,8 @@ export default {
choose_background
:
'选择组件背景'
,
choose_background
:
'选择组件背景'
,
choose_background_tips
:
'组件自有的背景设置会覆盖当前设置'
,
choose_background_tips
:
'组件自有的背景设置会覆盖当前设置'
,
setting_background
:
'设置背景'
,
setting_background
:
'设置背景'
,
setting_jump
:
'跳转设置'
setting_jump
:
'跳转设置'
,
select_view
:
'请选择视图...'
},
},
plugin
:
{
plugin
:
{
local_install
:
'本地安裝'
,
local_install
:
'本地安裝'
,
...
...
frontend/src/lang/zh.js
浏览文件 @
cf557782
...
@@ -1032,7 +1032,8 @@ export default {
...
@@ -1032,7 +1032,8 @@ export default {
table_item_align
:
'表格对齐方式'
,
table_item_align
:
'表格对齐方式'
,
table_align_left
:
'左对齐'
,
table_align_left
:
'左对齐'
,
table_align_center
:
'居中'
,
table_align_center
:
'居中'
,
table_align_right
:
'右对齐'
table_align_right
:
'右对齐'
,
draw_back
:
'收回'
},
},
dataset
:
{
dataset
:
{
sheet_warn
:
'有多个 Sheet 页,默认抽取第一个'
,
sheet_warn
:
'有多个 Sheet 页,默认抽取第一个'
,
...
@@ -1573,7 +1574,8 @@ export default {
...
@@ -1573,7 +1574,8 @@ export default {
choose_background
:
'选择组件背景'
,
choose_background
:
'选择组件背景'
,
choose_background_tips
:
'组件自有的背景设置会覆盖当前设置'
,
choose_background_tips
:
'组件自有的背景设置会覆盖当前设置'
,
setting_background
:
'设置背景'
,
setting_background
:
'设置背景'
,
setting_jump
:
'跳转设置'
setting_jump
:
'跳转设置'
,
select_view
:
'请选择视图...'
},
},
plugin
:
{
plugin
:
{
local_install
:
'本地安装'
,
local_install
:
'本地安装'
,
...
...
frontend/src/store/index.js
浏览文件 @
cf557782
...
@@ -99,7 +99,9 @@ const data = {
...
@@ -99,7 +99,9 @@ const data = {
x
:
300
,
x
:
300
,
y
:
600
y
:
600
},
},
scrollAutoMove
:
0
scrollAutoMove
:
0
,
// 视图是否编辑记录
panelViewEditInfo
:
{}
},
},
mutations
:
{
mutations
:
{
...
animation
.
mutations
,
...
animation
.
mutations
,
...
@@ -392,6 +394,17 @@ const data = {
...
@@ -392,6 +394,17 @@ const data = {
},
},
setScrollAutoMove
(
state
,
offset
)
{
setScrollAutoMove
(
state
,
offset
)
{
state
.
scrollAutoMove
=
offset
state
.
scrollAutoMove
=
offset
},
initPanelComponents
(
state
,
panelComponents
)
{
if
(
panelComponents
)
{
state
.
canvasStyleData
[
'panelComponents'
]
=
panelComponents
}
},
recordViewEdit
(
state
,
viewInfo
)
{
state
.
panelViewEditInfo
[
viewInfo
.
viewId
]
=
viewInfo
.
hasEdit
},
resetViewEditInfo
(
state
)
{
state
.
panelViewEditInfo
=
{}
}
}
},
},
modules
:
{
modules
:
{
...
...
frontend/src/views/chart/view/ChartEdit.vue
浏览文件 @
cf557782
差异被折叠。
点击展开。
frontend/src/views/dataset/common/DatasetChartDetail.vue
浏览文件 @
cf557782
...
@@ -145,12 +145,12 @@ export default {
...
@@ -145,12 +145,12 @@ export default {
init
()
{
init
()
{
if
(
this
.
data
.
id
)
{
if
(
this
.
data
.
id
)
{
if
(
this
.
type
===
'dataset'
)
{
if
(
this
.
type
===
'dataset'
)
{
post
(
'/dataset/table/datasetDetail/'
+
this
.
data
.
id
,
null
).
then
(
res
=>
{
post
(
'/dataset/table/datasetDetail/'
+
this
.
data
.
id
,
null
,
false
).
then
(
res
=>
{
this
.
detail
=
res
.
data
this
.
detail
=
res
.
data
this
.
info
=
JSON
.
parse
(
res
.
data
.
table
.
info
)
this
.
info
=
JSON
.
parse
(
res
.
data
.
table
.
info
)
})
})
}
else
if
(
this
.
type
===
'chart'
)
{
}
else
if
(
this
.
type
===
'chart'
)
{
post
(
'/chart/view/chartDetail/'
+
this
.
data
.
id
+
'/'
+
this
.
panelInfo
.
id
,
null
).
then
(
res
=>
{
post
(
'/chart/view/chartDetail/'
+
this
.
data
.
id
+
'/'
+
this
.
panelInfo
.
id
,
null
,
false
).
then
(
res
=>
{
this
.
detail
=
res
.
data
this
.
detail
=
res
.
data
this
.
info
=
JSON
.
parse
(
res
.
data
.
table
.
info
)
this
.
info
=
JSON
.
parse
(
res
.
data
.
table
.
info
)
})
})
...
...
frontend/src/views/panel/ViewSelect/index.vue
浏览文件 @
cf557782
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
<el-col
v-loading=
"loading"
>
<el-col
v-loading=
"loading"
>
<el-row
style=
"margin-top: 5px"
>
<el-row
style=
"margin-top: 5px"
>
<el-row
style=
"margin-left: 5px;margin-right: 5px"
>
<el-row
style=
"margin-left: 5px;margin-right: 5px"
>
<el-col
:span=
"
23
"
>
<el-col
:span=
"
17
"
>
<el-input
<el-input
v-model=
"templateFilterText"
v-model=
"templateFilterText"
:placeholder=
"$t('panel.filter_keywords')"
:placeholder=
"$t('panel.filter_keywords')"
...
@@ -11,9 +11,9 @@
...
@@ -11,9 +11,9 @@
prefix-icon=
"el-icon-search"
prefix-icon=
"el-icon-search"
/>
/>
</el-col>
</el-col>
<
!--
<el-col
v-if=
"!selectModel"
:span=
"7"
>
--
>
<
el-col
v-if=
"!selectModel"
:span=
"7"
>
<!--
<el-button
type=
"primary"
size=
"mini"
style=
"float: right"
@
click=
"newChart"
>
新建
</el-button>
--
>
<el-button
type=
"primary"
size=
"mini"
style=
"float: right"
@
click=
"newChart"
>
新建
</el-button
>
<
!--
</el-col>
--
>
<
/el-col
>
</el-row>
</el-row>
<el-row
style=
"margin-top: 5px"
>
<el-row
style=
"margin-top: 5px"
>
...
...
frontend/src/views/panel/edit/index.vue
浏览文件 @
cf557782
差异被折叠。
点击展开。
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论