Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
dataease
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
zhu
dataease
Commits
343a3869
提交
343a3869
authored
3月 16, 2022
作者:
wangjiahao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat: 模板新建仪表板可以更换数据集,未更换显示模板视图数据,并提示
上级
ca6ad712
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
26 个修改的文件
包含
268 行增加
和
230 行删除
+268
-230
ChartView.java
backend/src/main/java/io/dataease/base/domain/ChartView.java
+20
-20
ChartViewCache.java
...src/main/java/io/dataease/base/domain/ChartViewCache.java
+3
-0
ChartViewCacheExample.java
...n/java/io/dataease/base/domain/ChartViewCacheExample.java
+70
-0
ChartViewExample.java
...c/main/java/io/dataease/base/domain/ChartViewExample.java
+0
-0
ChartViewWithBLOBs.java
...main/java/io/dataease/base/domain/ChartViewWithBLOBs.java
+13
-15
PanelView.java
backend/src/main/java/io/dataease/base/domain/PanelView.java
+0
-2
PanelViewExample.java
...c/main/java/io/dataease/base/domain/PanelViewExample.java
+0
-70
ChartViewCacheMapper.xml
...ain/java/io/dataease/base/mapper/ChartViewCacheMapper.xml
+31
-13
ChartViewMapper.xml
...src/main/java/io/dataease/base/mapper/ChartViewMapper.xml
+0
-0
PanelViewMapper.xml
...src/main/java/io/dataease/base/mapper/PanelViewMapper.xml
+6
-22
ExtChartViewMapper.xml
...n/java/io/dataease/base/mapper/ext/ExtChartViewMapper.xml
+15
-7
ExtPanelViewMapper.xml
...n/java/io/dataease/base/mapper/ext/ExtPanelViewMapper.xml
+2
-2
CommonConstants.java
...n/java/io/dataease/commons/constants/CommonConstants.java
+2
-2
ChartViewController.java
...ava/io/dataease/controller/chart/ChartViewController.java
+2
-2
ChartViewDTO.java
...end/src/main/java/io/dataease/dto/chart/ChartViewDTO.java
+2
-2
PanelViewInsertDTO.java
...ain/java/io/dataease/dto/panel/po/PanelViewInsertDTO.java
+0
-7
ChartViewService.java
...main/java/io/dataease/service/chart/ChartViewService.java
+33
-38
PanelGroupExtendDataService.java
...o/dataease/service/panel/PanelGroupExtendDataService.java
+4
-5
PanelGroupService.java
...ain/java/io/dataease/service/panel/PanelGroupService.java
+9
-6
PanelViewService.java
...main/java/io/dataease/service/panel/PanelViewService.java
+0
-11
V33__1.9.sql
backend/src/main/resources/db/migration/V33__1.9.sql
+5
-2
generatorConfig.xml
backend/src/main/resources/generatorConfig.xml
+5
-3
en.js
frontend/src/lang/en.js
+1
-0
tw.js
frontend/src/lang/tw.js
+1
-0
zh.js
frontend/src/lang/zh.js
+1
-0
ChartEdit.vue
frontend/src/views/chart/view/ChartEdit.vue
+43
-1
没有找到文件。
backend/src/main/java/io/dataease/base/domain/ChartView.java
浏览文件 @
343a3869
package
io
.
dataease
.
base
.
domain
;
package
io
.
dataease
.
base
.
domain
;
import
java.io.Serializable
;
import
java.io.Serializable
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.Data
;
@Data
@Data
public
class
ChartView
implements
Serializable
{
public
class
ChartView
implements
Serializable
{
@ApiModelProperty
(
"ID"
)
private
String
id
;
private
String
id
;
@ApiModelProperty
(
"名称"
)
private
String
name
;
private
String
name
;
@ApiModelProperty
(
"数据集ID"
)
private
String
title
;
private
String
sceneId
;
private
String
tableId
;
private
String
tableId
;
@ApiModelProperty
(
"图表类型"
)
private
String
type
;
private
String
type
;
@ApiModelProperty
(
"渲染方式"
)
private
String
render
;
private
String
render
;
@ApiModelProperty
(
"展示结果数量"
)
private
Integer
resultCount
;
private
Integer
resultCount
;
@ApiModelProperty
(
"展示结果"
)
private
String
resultMode
;
private
String
resultMode
;
@ApiModelProperty
(
"标题"
)
private
String
title
;
@ApiModelProperty
(
"场景ID"
)
private
String
sceneId
;
@ApiModelProperty
(
"创建人"
)
private
String
createBy
;
private
String
createBy
;
@ApiModelProperty
(
"创建时间"
)
private
Long
createTime
;
private
Long
createTime
;
@ApiModelProperty
(
"更新时间"
)
private
Long
updateTime
;
private
Long
updateTime
;
@ApiModelProperty
(
"样式优先级"
)
private
String
stylePriority
;
private
String
stylePriority
;
@ApiModelProperty
(
"public or private"
)
private
String
chartType
;
private
String
chartType
;
@ApiModelProperty
(
"是否插件"
)
private
Boolean
isPlugin
;
private
Boolean
isPlugin
;
private
String
dataFrom
;
private
static
final
long
serialVersionUID
=
1L
;
private
static
final
long
serialVersionUID
=
1L
;
}
}
\ No newline at end of file
backend/src/main/java/io/dataease/base/domain/ChartViewCache.java
浏览文件 @
343a3869
...
@@ -35,5 +35,7 @@ public class ChartViewCache implements Serializable {
...
@@ -35,5 +35,7 @@ public class ChartViewCache implements Serializable {
private
Boolean
isPlugin
;
private
Boolean
isPlugin
;
private
String
dataFrom
;
private
static
final
long
serialVersionUID
=
1L
;
private
static
final
long
serialVersionUID
=
1L
;
}
}
\ No newline at end of file
backend/src/main/java/io/dataease/base/domain/ChartViewCacheExample.java
浏览文件 @
343a3869
...
@@ -1113,6 +1113,76 @@ public class ChartViewCacheExample {
...
@@ -1113,6 +1113,76 @@ public class ChartViewCacheExample {
addCriterion
(
"is_plugin not between"
,
value1
,
value2
,
"isPlugin"
);
addCriterion
(
"is_plugin not between"
,
value1
,
value2
,
"isPlugin"
);
return
(
Criteria
)
this
;
return
(
Criteria
)
this
;
}
}
public
Criteria
andDataFromIsNull
()
{
addCriterion
(
"data_from is null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andDataFromIsNotNull
()
{
addCriterion
(
"data_from is not null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andDataFromEqualTo
(
String
value
)
{
addCriterion
(
"data_from ="
,
value
,
"dataFrom"
);
return
(
Criteria
)
this
;
}
public
Criteria
andDataFromNotEqualTo
(
String
value
)
{
addCriterion
(
"data_from <>"
,
value
,
"dataFrom"
);
return
(
Criteria
)
this
;
}
public
Criteria
andDataFromGreaterThan
(
String
value
)
{
addCriterion
(
"data_from >"
,
value
,
"dataFrom"
);
return
(
Criteria
)
this
;
}
public
Criteria
andDataFromGreaterThanOrEqualTo
(
String
value
)
{
addCriterion
(
"data_from >="
,
value
,
"dataFrom"
);
return
(
Criteria
)
this
;
}
public
Criteria
andDataFromLessThan
(
String
value
)
{
addCriterion
(
"data_from <"
,
value
,
"dataFrom"
);
return
(
Criteria
)
this
;
}
public
Criteria
andDataFromLessThanOrEqualTo
(
String
value
)
{
addCriterion
(
"data_from <="
,
value
,
"dataFrom"
);
return
(
Criteria
)
this
;
}
public
Criteria
andDataFromLike
(
String
value
)
{
addCriterion
(
"data_from like"
,
value
,
"dataFrom"
);
return
(
Criteria
)
this
;
}
public
Criteria
andDataFromNotLike
(
String
value
)
{
addCriterion
(
"data_from not like"
,
value
,
"dataFrom"
);
return
(
Criteria
)
this
;
}
public
Criteria
andDataFromIn
(
List
<
String
>
values
)
{
addCriterion
(
"data_from in"
,
values
,
"dataFrom"
);
return
(
Criteria
)
this
;
}
public
Criteria
andDataFromNotIn
(
List
<
String
>
values
)
{
addCriterion
(
"data_from not in"
,
values
,
"dataFrom"
);
return
(
Criteria
)
this
;
}
public
Criteria
andDataFromBetween
(
String
value1
,
String
value2
)
{
addCriterion
(
"data_from between"
,
value1
,
value2
,
"dataFrom"
);
return
(
Criteria
)
this
;
}
public
Criteria
andDataFromNotBetween
(
String
value1
,
String
value2
)
{
addCriterion
(
"data_from not between"
,
value1
,
value2
,
"dataFrom"
);
return
(
Criteria
)
this
;
}
}
}
public
static
class
Criteria
extends
GeneratedCriteria
{
public
static
class
Criteria
extends
GeneratedCriteria
{
...
...
backend/src/main/java/io/dataease/base/domain/ChartViewExample.java
浏览文件 @
343a3869
差异被折叠。
点击展开。
backend/src/main/java/io/dataease/base/domain/ChartViewWithBLOBs.java
浏览文件 @
343a3869
package
io
.
dataease
.
base
.
domain
;
package
io
.
dataease
.
base
.
domain
;
import
java.io.Serializable
;
import
java.io.Serializable
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.EqualsAndHashCode
;
import
lombok.ToString
;
import
lombok.ToString
;
...
@@ -11,30 +9,29 @@ import lombok.ToString;
...
@@ -11,30 +9,29 @@ import lombok.ToString;
@EqualsAndHashCode
(
callSuper
=
true
)
@EqualsAndHashCode
(
callSuper
=
true
)
@ToString
(
callSuper
=
true
)
@ToString
(
callSuper
=
true
)
public
class
ChartViewWithBLOBs
extends
ChartView
implements
Serializable
{
public
class
ChartViewWithBLOBs
extends
ChartView
implements
Serializable
{
@ApiModelProperty
(
"x轴"
)
private
String
xAxis
;
private
String
xAxis
;
@ApiModelProperty
(
"x副轴"
)
private
String
xAxisExt
;
private
String
xAxisExt
;
@ApiModelProperty
(
"y轴"
)
private
String
yAxis
;
private
String
yAxis
;
@ApiModelProperty
(
"y副轴"
)
private
String
yAxisExt
;
private
String
yAxisExt
;
@ApiModelProperty
(
"堆叠字段"
)
private
String
extStack
;
private
String
extStack
;
@ApiModelProperty
(
"气泡大小字段"
)
private
String
extBubble
;
private
String
extBubble
;
@ApiModelProperty
(
"图形属性"
)
private
String
customAttr
;
private
String
customAttr
;
@ApiModelProperty
(
"组件样式"
)
private
String
customStyle
;
private
String
customStyle
;
@ApiModelProperty
(
"过滤器字段"
)
private
String
customFilter
;
private
String
customFilter
;
@ApiModelProperty
(
"下钻字段"
)
private
String
drillFields
;
private
String
drillFields
;
@ApiModelProperty
(
"高级设置"
)
private
String
senior
;
private
String
senior
;
@ApiModelProperty
(
"视图截图快照"
)
private
String
snapshot
;
private
String
snapshot
;
private
static
final
long
serialVersionUID
=
1L
;
private
static
final
long
serialVersionUID
=
1L
;
}
}
\ No newline at end of file
backend/src/main/java/io/dataease/base/domain/PanelView.java
浏览文件 @
343a3869
...
@@ -29,8 +29,6 @@ public class PanelView implements Serializable {
...
@@ -29,8 +29,6 @@ public class PanelView implements Serializable {
private
String
copyId
;
private
String
copyId
;
private
String
dataFrom
;
private
byte
[]
content
;
private
byte
[]
content
;
private
static
final
long
serialVersionUID
=
1L
;
private
static
final
long
serialVersionUID
=
1L
;
...
...
backend/src/main/java/io/dataease/base/domain/PanelViewExample.java
浏览文件 @
343a3869
...
@@ -923,76 +923,6 @@ public class PanelViewExample {
...
@@ -923,76 +923,6 @@ public class PanelViewExample {
addCriterion
(
"copy_id not between"
,
value1
,
value2
,
"copyId"
);
addCriterion
(
"copy_id not between"
,
value1
,
value2
,
"copyId"
);
return
(
Criteria
)
this
;
return
(
Criteria
)
this
;
}
}
public
Criteria
andDataFromIsNull
()
{
addCriterion
(
"data_from is null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andDataFromIsNotNull
()
{
addCriterion
(
"data_from is not null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andDataFromEqualTo
(
String
value
)
{
addCriterion
(
"data_from ="
,
value
,
"dataFrom"
);
return
(
Criteria
)
this
;
}
public
Criteria
andDataFromNotEqualTo
(
String
value
)
{
addCriterion
(
"data_from <>"
,
value
,
"dataFrom"
);
return
(
Criteria
)
this
;
}
public
Criteria
andDataFromGreaterThan
(
String
value
)
{
addCriterion
(
"data_from >"
,
value
,
"dataFrom"
);
return
(
Criteria
)
this
;
}
public
Criteria
andDataFromGreaterThanOrEqualTo
(
String
value
)
{
addCriterion
(
"data_from >="
,
value
,
"dataFrom"
);
return
(
Criteria
)
this
;
}
public
Criteria
andDataFromLessThan
(
String
value
)
{
addCriterion
(
"data_from <"
,
value
,
"dataFrom"
);
return
(
Criteria
)
this
;
}
public
Criteria
andDataFromLessThanOrEqualTo
(
String
value
)
{
addCriterion
(
"data_from <="
,
value
,
"dataFrom"
);
return
(
Criteria
)
this
;
}
public
Criteria
andDataFromLike
(
String
value
)
{
addCriterion
(
"data_from like"
,
value
,
"dataFrom"
);
return
(
Criteria
)
this
;
}
public
Criteria
andDataFromNotLike
(
String
value
)
{
addCriterion
(
"data_from not like"
,
value
,
"dataFrom"
);
return
(
Criteria
)
this
;
}
public
Criteria
andDataFromIn
(
List
<
String
>
values
)
{
addCriterion
(
"data_from in"
,
values
,
"dataFrom"
);
return
(
Criteria
)
this
;
}
public
Criteria
andDataFromNotIn
(
List
<
String
>
values
)
{
addCriterion
(
"data_from not in"
,
values
,
"dataFrom"
);
return
(
Criteria
)
this
;
}
public
Criteria
andDataFromBetween
(
String
value1
,
String
value2
)
{
addCriterion
(
"data_from between"
,
value1
,
value2
,
"dataFrom"
);
return
(
Criteria
)
this
;
}
public
Criteria
andDataFromNotBetween
(
String
value1
,
String
value2
)
{
addCriterion
(
"data_from not between"
,
value1
,
value2
,
"dataFrom"
);
return
(
Criteria
)
this
;
}
}
}
public
static
class
Criteria
extends
GeneratedCriteria
{
public
static
class
Criteria
extends
GeneratedCriteria
{
...
...
backend/src/main/java/io/dataease/base/mapper/ChartViewCacheMapper.xml
浏览文件 @
343a3869
...
@@ -17,6 +17,7 @@
...
@@ -17,6 +17,7 @@
<result
column=
"style_priority"
jdbcType=
"VARCHAR"
property=
"stylePriority"
/>
<result
column=
"style_priority"
jdbcType=
"VARCHAR"
property=
"stylePriority"
/>
<result
column=
"chart_type"
jdbcType=
"VARCHAR"
property=
"chartType"
/>
<result
column=
"chart_type"
jdbcType=
"VARCHAR"
property=
"chartType"
/>
<result
column=
"is_plugin"
jdbcType=
"BIT"
property=
"isPlugin"
/>
<result
column=
"is_plugin"
jdbcType=
"BIT"
property=
"isPlugin"
/>
<result
column=
"data_from"
jdbcType=
"VARCHAR"
property=
"dataFrom"
/>
</resultMap>
</resultMap>
<resultMap
extends=
"BaseResultMap"
id=
"ResultMapWithBLOBs"
type=
"io.dataease.base.domain.ChartViewCacheWithBLOBs"
>
<resultMap
extends=
"BaseResultMap"
id=
"ResultMapWithBLOBs"
type=
"io.dataease.base.domain.ChartViewCacheWithBLOBs"
>
<result
column=
"x_axis"
jdbcType=
"LONGVARCHAR"
property=
"xAxis"
/>
<result
column=
"x_axis"
jdbcType=
"LONGVARCHAR"
property=
"xAxis"
/>
...
@@ -92,7 +93,7 @@
...
@@ -92,7 +93,7 @@
</sql>
</sql>
<sql
id=
"Base_Column_List"
>
<sql
id=
"Base_Column_List"
>
id, `name`, title, scene_id, table_id, `type`, render, result_count, result_mode,
id, `name`, title, scene_id, table_id, `type`, render, result_count, result_mode,
create_by, create_time, update_time, style_priority, chart_type, is_plugin
create_by, create_time, update_time, style_priority, chart_type, is_plugin
, data_from
</sql>
</sql>
<sql
id=
"Blob_Column_List"
>
<sql
id=
"Blob_Column_List"
>
x_axis, x_axis_ext, y_axis, y_axis_ext, ext_stack, ext_bubble, custom_attr, custom_style,
x_axis, x_axis_ext, y_axis, y_axis_ext, ext_stack, ext_bubble, custom_attr, custom_style,
...
@@ -152,21 +153,21 @@
...
@@ -152,21 +153,21 @@
render, result_count, result_mode,
render, result_count, result_mode,
create_by, create_time, update_time,
create_by, create_time, update_time,
style_priority, chart_type, is_plugin,
style_priority, chart_type, is_plugin,
x_axis, x_axis_ext, y_axis
,
data_from, x_axis, x_axis_ext
,
y_axis
_ext, ext_stack, ext_bubble
,
y_axis
, y_axis_ext, ext_stack
,
custom_attr, custom_style, custom_filter
,
ext_bubble, custom_attr, custom_style
,
drill_fields, senior, snapshot
custom_filter, drill_fields, senior,
)
snapshot
)
values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{title,jdbcType=VARCHAR},
values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{title,jdbcType=VARCHAR},
#{sceneId,jdbcType=VARCHAR}, #{tableId,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR},
#{sceneId,jdbcType=VARCHAR}, #{tableId,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR},
#{render,jdbcType=VARCHAR}, #{resultCount,jdbcType=INTEGER}, #{resultMode,jdbcType=VARCHAR},
#{render,jdbcType=VARCHAR}, #{resultCount,jdbcType=INTEGER}, #{resultMode,jdbcType=VARCHAR},
#{createBy,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT}, #{updateTime,jdbcType=BIGINT},
#{createBy,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT}, #{updateTime,jdbcType=BIGINT},
#{stylePriority,jdbcType=VARCHAR}, #{chartType,jdbcType=VARCHAR}, #{isPlugin,jdbcType=BIT},
#{stylePriority,jdbcType=VARCHAR}, #{chartType,jdbcType=VARCHAR}, #{isPlugin,jdbcType=BIT},
#{
xAxis,jdbcType=LONGVARCHAR}, #{xAxisExt,jdbcType=LONGVARCHAR}, #{yAxis
,jdbcType=LONGVARCHAR},
#{
dataFrom,jdbcType=VARCHAR}, #{xAxis,jdbcType=LONGVARCHAR}, #{xAxisExt
,jdbcType=LONGVARCHAR},
#{yAxis
Ext,jdbcType=LONGVARCHAR}, #{extStack,jdbcType=LONGVARCHAR}, #{extBubble
,jdbcType=LONGVARCHAR},
#{yAxis
,jdbcType=LONGVARCHAR}, #{yAxisExt,jdbcType=LONGVARCHAR}, #{extStack
,jdbcType=LONGVARCHAR},
#{
customAttr,jdbcType=LONGVARCHAR}, #{customStyle,jdbcType=LONGVARCHAR}, #{customFilter
,jdbcType=LONGVARCHAR},
#{
extBubble,jdbcType=LONGVARCHAR}, #{customAttr,jdbcType=LONGVARCHAR}, #{customStyle
,jdbcType=LONGVARCHAR},
#{
drillFields,jdbcType=LONGVARCHAR}, #{senior,jdbcType=LONGVARCHAR}, #{snapshot,jdbcType=LONGVARCHAR}
#{
customFilter,jdbcType=LONGVARCHAR}, #{drillFields,jdbcType=LONGVARCHAR}, #{senior,jdbcType=LONGVARCHAR},
)
#{snapshot,jdbcType=LONGVARCHAR}
)
</insert>
</insert>
<insert
id=
"insertSelective"
parameterType=
"io.dataease.base.domain.ChartViewCacheWithBLOBs"
>
<insert
id=
"insertSelective"
parameterType=
"io.dataease.base.domain.ChartViewCacheWithBLOBs"
>
insert into chart_view_cache
insert into chart_view_cache
...
@@ -216,6 +217,9 @@
...
@@ -216,6 +217,9 @@
<if
test=
"isPlugin != null"
>
<if
test=
"isPlugin != null"
>
is_plugin,
is_plugin,
</if>
</if>
<if
test=
"dataFrom != null"
>
data_from,
</if>
<if
test=
"xAxis != null"
>
<if
test=
"xAxis != null"
>
x_axis,
x_axis,
</if>
</if>
...
@@ -299,6 +303,9 @@
...
@@ -299,6 +303,9 @@
<if
test=
"isPlugin != null"
>
<if
test=
"isPlugin != null"
>
#{isPlugin,jdbcType=BIT},
#{isPlugin,jdbcType=BIT},
</if>
</if>
<if
test=
"dataFrom != null"
>
#{dataFrom,jdbcType=VARCHAR},
</if>
<if
test=
"xAxis != null"
>
<if
test=
"xAxis != null"
>
#{xAxis,jdbcType=LONGVARCHAR},
#{xAxis,jdbcType=LONGVARCHAR},
</if>
</if>
...
@@ -391,6 +398,9 @@
...
@@ -391,6 +398,9 @@
<if
test=
"record.isPlugin != null"
>
<if
test=
"record.isPlugin != null"
>
is_plugin = #{record.isPlugin,jdbcType=BIT},
is_plugin = #{record.isPlugin,jdbcType=BIT},
</if>
</if>
<if
test=
"record.dataFrom != null"
>
data_from = #{record.dataFrom,jdbcType=VARCHAR},
</if>
<if
test=
"record.xAxis != null"
>
<if
test=
"record.xAxis != null"
>
x_axis = #{record.xAxis,jdbcType=LONGVARCHAR},
x_axis = #{record.xAxis,jdbcType=LONGVARCHAR},
</if>
</if>
...
@@ -449,6 +459,7 @@
...
@@ -449,6 +459,7 @@
style_priority = #{record.stylePriority,jdbcType=VARCHAR},
style_priority = #{record.stylePriority,jdbcType=VARCHAR},
chart_type = #{record.chartType,jdbcType=VARCHAR},
chart_type = #{record.chartType,jdbcType=VARCHAR},
is_plugin = #{record.isPlugin,jdbcType=BIT},
is_plugin = #{record.isPlugin,jdbcType=BIT},
data_from = #{record.dataFrom,jdbcType=VARCHAR},
x_axis = #{record.xAxis,jdbcType=LONGVARCHAR},
x_axis = #{record.xAxis,jdbcType=LONGVARCHAR},
x_axis_ext = #{record.xAxisExt,jdbcType=LONGVARCHAR},
x_axis_ext = #{record.xAxisExt,jdbcType=LONGVARCHAR},
y_axis = #{record.yAxis,jdbcType=LONGVARCHAR},
y_axis = #{record.yAxis,jdbcType=LONGVARCHAR},
...
@@ -481,7 +492,8 @@
...
@@ -481,7 +492,8 @@
update_time = #{record.updateTime,jdbcType=BIGINT},
update_time = #{record.updateTime,jdbcType=BIGINT},
style_priority = #{record.stylePriority,jdbcType=VARCHAR},
style_priority = #{record.stylePriority,jdbcType=VARCHAR},
chart_type = #{record.chartType,jdbcType=VARCHAR},
chart_type = #{record.chartType,jdbcType=VARCHAR},
is_plugin = #{record.isPlugin,jdbcType=BIT}
is_plugin = #{record.isPlugin,jdbcType=BIT},
data_from = #{record.dataFrom,jdbcType=VARCHAR}
<if
test=
"_parameter != null"
>
<if
test=
"_parameter != null"
>
<include
refid=
"Update_By_Example_Where_Clause"
/>
<include
refid=
"Update_By_Example_Where_Clause"
/>
</if>
</if>
...
@@ -531,6 +543,9 @@
...
@@ -531,6 +543,9 @@
<if
test=
"isPlugin != null"
>
<if
test=
"isPlugin != null"
>
is_plugin = #{isPlugin,jdbcType=BIT},
is_plugin = #{isPlugin,jdbcType=BIT},
</if>
</if>
<if
test=
"dataFrom != null"
>
data_from = #{dataFrom,jdbcType=VARCHAR},
</if>
<if
test=
"xAxis != null"
>
<if
test=
"xAxis != null"
>
x_axis = #{xAxis,jdbcType=LONGVARCHAR},
x_axis = #{xAxis,jdbcType=LONGVARCHAR},
</if>
</if>
...
@@ -586,6 +601,7 @@
...
@@ -586,6 +601,7 @@
style_priority = #{stylePriority,jdbcType=VARCHAR},
style_priority = #{stylePriority,jdbcType=VARCHAR},
chart_type = #{chartType,jdbcType=VARCHAR},
chart_type = #{chartType,jdbcType=VARCHAR},
is_plugin = #{isPlugin,jdbcType=BIT},
is_plugin = #{isPlugin,jdbcType=BIT},
data_from = #{dataFrom,jdbcType=VARCHAR},
x_axis = #{xAxis,jdbcType=LONGVARCHAR},
x_axis = #{xAxis,jdbcType=LONGVARCHAR},
x_axis_ext = #{xAxisExt,jdbcType=LONGVARCHAR},
x_axis_ext = #{xAxisExt,jdbcType=LONGVARCHAR},
y_axis = #{yAxis,jdbcType=LONGVARCHAR},
y_axis = #{yAxis,jdbcType=LONGVARCHAR},
...
@@ -615,7 +631,8 @@
...
@@ -615,7 +631,8 @@
update_time = #{updateTime,jdbcType=BIGINT},
update_time = #{updateTime,jdbcType=BIGINT},
style_priority = #{stylePriority,jdbcType=VARCHAR},
style_priority = #{stylePriority,jdbcType=VARCHAR},
chart_type = #{chartType,jdbcType=VARCHAR},
chart_type = #{chartType,jdbcType=VARCHAR},
is_plugin = #{isPlugin,jdbcType=BIT}
is_plugin = #{isPlugin,jdbcType=BIT},
data_from = #{dataFrom,jdbcType=VARCHAR}
where id = #{id,jdbcType=VARCHAR}
where id = #{id,jdbcType=VARCHAR}
</update>
</update>
</mapper>
</mapper>
\ No newline at end of file
backend/src/main/java/io/dataease/base/mapper/ChartViewMapper.xml
浏览文件 @
343a3869
差异被折叠。
点击展开。
backend/src/main/java/io/dataease/base/mapper/PanelViewMapper.xml
浏览文件 @
343a3869
...
@@ -14,7 +14,6 @@
...
@@ -14,7 +14,6 @@
<result
column=
"copy_from_view"
jdbcType=
"VARCHAR"
property=
"copyFromView"
/>
<result
column=
"copy_from_view"
jdbcType=
"VARCHAR"
property=
"copyFromView"
/>
<result
column=
"copy_from"
jdbcType=
"VARCHAR"
property=
"copyFrom"
/>
<result
column=
"copy_from"
jdbcType=
"VARCHAR"
property=
"copyFrom"
/>
<result
column=
"copy_id"
jdbcType=
"VARCHAR"
property=
"copyId"
/>
<result
column=
"copy_id"
jdbcType=
"VARCHAR"
property=
"copyId"
/>
<result
column=
"data_from"
jdbcType=
"VARCHAR"
property=
"dataFrom"
/>
</resultMap>
</resultMap>
<resultMap
extends=
"BaseResultMap"
id=
"ResultMapWithBLOBs"
type=
"io.dataease.base.domain.PanelView"
>
<resultMap
extends=
"BaseResultMap"
id=
"ResultMapWithBLOBs"
type=
"io.dataease.base.domain.PanelView"
>
<result
column=
"content"
jdbcType=
"LONGVARBINARY"
property=
"content"
/>
<result
column=
"content"
jdbcType=
"LONGVARBINARY"
property=
"content"
/>
...
@@ -79,7 +78,7 @@
...
@@ -79,7 +78,7 @@
</sql>
</sql>
<sql
id=
"Base_Column_List"
>
<sql
id=
"Base_Column_List"
>
id, panel_id, chart_view_id, create_by, create_time, update_by, update_time, `position`,
id, panel_id, chart_view_id, create_by, create_time, update_by, update_time, `position`,
copy_from_panel, copy_from_view, copy_from, copy_id
, data_from
copy_from_panel, copy_from_view, copy_from, copy_id
</sql>
</sql>
<sql
id=
"Blob_Column_List"
>
<sql
id=
"Blob_Column_List"
>
content
content
...
@@ -137,12 +136,12 @@
...
@@ -137,12 +136,12 @@
create_by, create_time, update_by,
create_by, create_time, update_by,
update_time, `position`, copy_from_panel,
update_time, `position`, copy_from_panel,
copy_from_view, copy_from, copy_id,
copy_from_view, copy_from, copy_id,
data_from,
content)
content)
values (#{id,jdbcType=VARCHAR}, #{panelId,jdbcType=VARCHAR}, #{chartViewId,jdbcType=VARCHAR},
values (#{id,jdbcType=VARCHAR}, #{panelId,jdbcType=VARCHAR}, #{chartViewId,jdbcType=VARCHAR},
#{createBy,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT}, #{updateBy,jdbcType=VARCHAR},
#{createBy,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT}, #{updateBy,jdbcType=VARCHAR},
#{updateTime,jdbcType=BIGINT}, #{position,jdbcType=VARCHAR}, #{copyFromPanel,jdbcType=VARCHAR},
#{updateTime,jdbcType=BIGINT}, #{position,jdbcType=VARCHAR}, #{copyFromPanel,jdbcType=VARCHAR},
#{copyFromView,jdbcType=VARCHAR}, #{copyFrom,jdbcType=VARCHAR}, #{copyId,jdbcType=VARCHAR},
#{copyFromView,jdbcType=VARCHAR}, #{copyFrom,jdbcType=VARCHAR}, #{copyId,jdbcType=VARCHAR},
#{
dataFrom,jdbcType=VARCHAR}, #{
content,jdbcType=LONGVARBINARY})
#{content,jdbcType=LONGVARBINARY})
</insert>
</insert>
<insert
id=
"insertSelective"
parameterType=
"io.dataease.base.domain.PanelView"
>
<insert
id=
"insertSelective"
parameterType=
"io.dataease.base.domain.PanelView"
>
insert into panel_view
insert into panel_view
...
@@ -183,9 +182,6 @@
...
@@ -183,9 +182,6 @@
<if
test=
"copyId != null"
>
<if
test=
"copyId != null"
>
copy_id,
copy_id,
</if>
</if>
<if
test=
"dataFrom != null"
>
data_from,
</if>
<if
test=
"content != null"
>
<if
test=
"content != null"
>
content,
content,
</if>
</if>
...
@@ -227,9 +223,6 @@
...
@@ -227,9 +223,6 @@
<if
test=
"copyId != null"
>
<if
test=
"copyId != null"
>
#{copyId,jdbcType=VARCHAR},
#{copyId,jdbcType=VARCHAR},
</if>
</if>
<if
test=
"dataFrom != null"
>
#{dataFrom,jdbcType=VARCHAR},
</if>
<if
test=
"content != null"
>
<if
test=
"content != null"
>
#{content,jdbcType=LONGVARBINARY},
#{content,jdbcType=LONGVARBINARY},
</if>
</if>
...
@@ -280,9 +273,6 @@
...
@@ -280,9 +273,6 @@
<if
test=
"record.copyId != null"
>
<if
test=
"record.copyId != null"
>
copy_id = #{record.copyId,jdbcType=VARCHAR},
copy_id = #{record.copyId,jdbcType=VARCHAR},
</if>
</if>
<if
test=
"record.dataFrom != null"
>
data_from = #{record.dataFrom,jdbcType=VARCHAR},
</if>
<if
test=
"record.content != null"
>
<if
test=
"record.content != null"
>
content = #{record.content,jdbcType=LONGVARBINARY},
content = #{record.content,jdbcType=LONGVARBINARY},
</if>
</if>
...
@@ -305,7 +295,6 @@
...
@@ -305,7 +295,6 @@
copy_from_view = #{record.copyFromView,jdbcType=VARCHAR},
copy_from_view = #{record.copyFromView,jdbcType=VARCHAR},
copy_from = #{record.copyFrom,jdbcType=VARCHAR},
copy_from = #{record.copyFrom,jdbcType=VARCHAR},
copy_id = #{record.copyId,jdbcType=VARCHAR},
copy_id = #{record.copyId,jdbcType=VARCHAR},
data_from = #{record.dataFrom,jdbcType=VARCHAR},
content = #{record.content,jdbcType=LONGVARBINARY}
content = #{record.content,jdbcType=LONGVARBINARY}
<if
test=
"_parameter != null"
>
<if
test=
"_parameter != null"
>
<include
refid=
"Update_By_Example_Where_Clause"
/>
<include
refid=
"Update_By_Example_Where_Clause"
/>
...
@@ -324,8 +313,7 @@
...
@@ -324,8 +313,7 @@
copy_from_panel = #{record.copyFromPanel,jdbcType=VARCHAR},
copy_from_panel = #{record.copyFromPanel,jdbcType=VARCHAR},
copy_from_view = #{record.copyFromView,jdbcType=VARCHAR},
copy_from_view = #{record.copyFromView,jdbcType=VARCHAR},
copy_from = #{record.copyFrom,jdbcType=VARCHAR},
copy_from = #{record.copyFrom,jdbcType=VARCHAR},
copy_id = #{record.copyId,jdbcType=VARCHAR},
copy_id = #{record.copyId,jdbcType=VARCHAR}
data_from = #{record.dataFrom,jdbcType=VARCHAR}
<if
test=
"_parameter != null"
>
<if
test=
"_parameter != null"
>
<include
refid=
"Update_By_Example_Where_Clause"
/>
<include
refid=
"Update_By_Example_Where_Clause"
/>
</if>
</if>
...
@@ -366,9 +354,6 @@
...
@@ -366,9 +354,6 @@
<if
test=
"copyId != null"
>
<if
test=
"copyId != null"
>
copy_id = #{copyId,jdbcType=VARCHAR},
copy_id = #{copyId,jdbcType=VARCHAR},
</if>
</if>
<if
test=
"dataFrom != null"
>
data_from = #{dataFrom,jdbcType=VARCHAR},
</if>
<if
test=
"content != null"
>
<if
test=
"content != null"
>
content = #{content,jdbcType=LONGVARBINARY},
content = #{content,jdbcType=LONGVARBINARY},
</if>
</if>
...
@@ -388,7 +373,6 @@
...
@@ -388,7 +373,6 @@
copy_from_view = #{copyFromView,jdbcType=VARCHAR},
copy_from_view = #{copyFromView,jdbcType=VARCHAR},
copy_from = #{copyFrom,jdbcType=VARCHAR},
copy_from = #{copyFrom,jdbcType=VARCHAR},
copy_id = #{copyId,jdbcType=VARCHAR},
copy_id = #{copyId,jdbcType=VARCHAR},
data_from = #{dataFrom,jdbcType=VARCHAR},
content = #{content,jdbcType=LONGVARBINARY}
content = #{content,jdbcType=LONGVARBINARY}
where id = #{id,jdbcType=VARCHAR}
where id = #{id,jdbcType=VARCHAR}
</update>
</update>
...
@@ -404,8 +388,7 @@
...
@@ -404,8 +388,7 @@
copy_from_panel = #{copyFromPanel,jdbcType=VARCHAR},
copy_from_panel = #{copyFromPanel,jdbcType=VARCHAR},
copy_from_view = #{copyFromView,jdbcType=VARCHAR},
copy_from_view = #{copyFromView,jdbcType=VARCHAR},
copy_from = #{copyFrom,jdbcType=VARCHAR},
copy_from = #{copyFrom,jdbcType=VARCHAR},
copy_id = #{copyId,jdbcType=VARCHAR},
copy_id = #{copyId,jdbcType=VARCHAR}
data_from = #{dataFrom,jdbcType=VARCHAR}
where id = #{id,jdbcType=VARCHAR}
where id = #{id,jdbcType=VARCHAR}
</update>
</update>
</mapper>
</mapper>
\ No newline at end of file
backend/src/main/java/io/dataease/base/mapper/ext/ExtChartViewMapper.xml
浏览文件 @
343a3869
...
@@ -54,7 +54,8 @@
...
@@ -54,7 +54,8 @@
custom_filter,
custom_filter,
drill_fields,
drill_fields,
senior,
senior,
SNAPSHOT
SNAPSHOT,
data_from
) SELECT
) SELECT
id,
id,
`name`,
`name`,
...
@@ -82,7 +83,8 @@
...
@@ -82,7 +83,8 @@
custom_filter,
custom_filter,
drill_fields,
drill_fields,
senior,
senior,
SNAPSHOT from chart_view
SNAPSHOT,
data_from from chart_view
WHERE
WHERE
chart_view.id = #{id}
chart_view.id = #{id}
</insert>
</insert>
...
@@ -181,7 +183,8 @@
...
@@ -181,7 +183,8 @@
`result_count`,
`result_count`,
`result_mode`,
`result_mode`,
`chart_type`,
`chart_type`,
`senior`)
`senior`,
`data_from`)
SELECT #{newChartId},
SELECT #{newChartId},
`name`,
`name`,
#{panelId},
#{panelId},
...
@@ -207,7 +210,8 @@
...
@@ -207,7 +210,8 @@
`result_count`,
`result_count`,
`result_mode`,
`result_mode`,
'private',
'private',
`senior`
`senior`,
`data_from`
FROM chart_view_cache
FROM chart_view_cache
WHERE id = #{oldChartId}
WHERE id = #{oldChartId}
</insert>
</insert>
...
@@ -256,7 +260,8 @@
...
@@ -256,7 +260,8 @@
custom_style,
custom_style,
custom_filter,
custom_filter,
drill_fields,
drill_fields,
SNAPSHOT)
SNAPSHOT,
data_from)
SELECT pv_copy.chart_view_id AS id,
SELECT pv_copy.chart_view_id AS id,
`name`,
`name`,
title,
title,
...
@@ -282,7 +287,8 @@
...
@@ -282,7 +287,8 @@
custom_style,
custom_style,
custom_filter,
custom_filter,
drill_fields,
drill_fields,
SNAPSHOT
SNAPSHOT,
data_from
FROM (
FROM (
SELECT panel_id,
SELECT panel_id,
copy_from_view,
copy_from_view,
...
@@ -389,7 +395,9 @@
...
@@ -389,7 +395,9 @@
cv.custom_filter = cve.custom_filter,
cv.custom_filter = cve.custom_filter,
cv.drill_fields = cve.drill_fields,
cv.drill_fields = cve.drill_fields,
cv.senior = cve.senior,
cv.senior = cve.senior,
cv.SNAPSHOT = cve.SNAPSHOT where cve.id = cv.id and cv.id in
cv.SNAPSHOT = cve.SNAPSHOT,
cv.data_from = cve.data_from
where cve.id = cv.id and cv.id in
<foreach
collection=
"viewIds"
item=
"viewId"
open=
'('
separator=
','
close=
')'
>
<foreach
collection=
"viewIds"
item=
"viewId"
open=
'('
separator=
','
close=
')'
>
#{viewId}
#{viewId}
</foreach>
</foreach>
...
...
backend/src/main/java/io/dataease/base/mapper/ext/ExtPanelViewMapper.xml
浏览文件 @
343a3869
...
@@ -71,9 +71,9 @@
...
@@ -71,9 +71,9 @@
</delete>
</delete>
<insert
id=
"savePanelView"
>
<insert
id=
"savePanelView"
>
INSERT INTO `panel_view` (id,chart_view_id, panel_id
,data_from
) VALUES
INSERT INTO `panel_view` (id,chart_view_id, panel_id) VALUES
<foreach
collection=
"panelViews"
item=
"panelView"
index=
"index"
separator=
","
>
<foreach
collection=
"panelViews"
item=
"panelView"
index=
"index"
separator=
","
>
(uuid(),#{panelView.chartViewId},#{panelView.panelId}
,#{panelView.dataFrom}
)
(uuid(),#{panelView.chartViewId},#{panelView.panelId})
</foreach>
</foreach>
</insert>
</insert>
...
...
backend/src/main/java/io/dataease/commons/constants/CommonConstants.java
浏览文件 @
343a3869
...
@@ -76,8 +76,8 @@ public class CommonConstants {
...
@@ -76,8 +76,8 @@ public class CommonConstants {
// 模板数据
// 模板数据
public
static
final
String
TEMPLATE
=
"template"
;
public
static
final
String
TEMPLATE
=
"template"
;
//
视图
数据
//
数据集
数据
public
static
final
String
CHART
=
"
char
t"
;
public
static
final
String
CHART
=
"
datase
t"
;
}
}
}
}
backend/src/main/java/io/dataease/controller/chart/ChartViewController.java
浏览文件 @
343a3869
...
@@ -76,8 +76,8 @@ public class ChartViewController {
...
@@ -76,8 +76,8 @@ public class ChartViewController {
@ApiOperation
(
"详细信息"
)
@ApiOperation
(
"详细信息"
)
@PostMapping
(
"/get/{id}/{panelId}"
)
@PostMapping
(
"/get/{id}/{panelId}"
)
public
ChartViewDTO
get
(
@PathVariable
String
id
,
@PathVariable
String
panelId
,
@RequestBody
ChartViewRequest
viewRequest
)
{
public
ChartViewDTO
get
(
@PathVariable
String
id
,
@PathVariable
String
panelId
,
@RequestBody
ChartViewRequest
viewRequest
)
{
String
dataFrom
=
panelViewService
.
findViewDataFrom
(
id
);
ChartViewDTO
result
=
chartViewService
.
getOne
(
id
,
viewRequest
.
getQueryFrom
()
);
return
chartViewService
.
getOne
(
id
,
viewRequest
.
getQueryFrom
(),
dataFrom
)
;
return
result
;
}
}
@ApiIgnore
@ApiIgnore
...
...
backend/src/main/java/io/dataease/dto/chart/ChartViewDTO.java
浏览文件 @
343a3869
...
@@ -30,6 +30,6 @@ public class ChartViewDTO extends ChartViewWithBLOBs {
...
@@ -30,6 +30,6 @@ public class ChartViewDTO extends ChartViewWithBLOBs {
private
boolean
drill
;
private
boolean
drill
;
@ApiModelProperty
(
"下钻条件集合"
)
@ApiModelProperty
(
"下钻条件集合"
)
private
List
<
ChartExtFilterRequest
>
drillFilters
;
private
List
<
ChartExtFilterRequest
>
drillFilters
;
@ApiModelProperty
(
"
当前数据来源
"
)
@ApiModelProperty
(
"
视图存放位置
"
)
private
String
dataFrom
;
private
String
position
;
}
}
backend/src/main/java/io/dataease/dto/panel/po/PanelViewInsertDTO.java
浏览文件 @
343a3869
...
@@ -24,12 +24,5 @@ public class PanelViewInsertDTO extends PanelView {
...
@@ -24,12 +24,5 @@ public class PanelViewInsertDTO extends PanelView {
super
.
setPanelId
(
panelGroupId
);
super
.
setPanelId
(
panelGroupId
);
super
.
setPosition
(
position
);
super
.
setPosition
(
position
);
}
}
public
PanelViewInsertDTO
(
String
chartViewId
,
String
panelGroupId
,
String
position
,
String
dataFrom
)
{
super
();
super
.
setChartViewId
(
chartViewId
);
super
.
setPanelId
(
panelGroupId
);
super
.
setPosition
(
position
);
super
.
setDataFrom
(
dataFrom
);
}
}
}
backend/src/main/java/io/dataease/service/chart/ChartViewService.java
浏览文件 @
343a3869
...
@@ -87,7 +87,6 @@ public class ChartViewService {
...
@@ -87,7 +87,6 @@ public class ChartViewService {
private
PanelGroupExtendDataService
extendDataService
;
private
PanelGroupExtendDataService
extendDataService
;
//默认使用非公平
//默认使用非公平
private
ReentrantLock
lock
=
new
ReentrantLock
();
private
ReentrantLock
lock
=
new
ReentrantLock
();
...
@@ -234,33 +233,30 @@ public class ChartViewService {
...
@@ -234,33 +233,30 @@ public class ChartViewService {
}
}
public
ChartViewDTO
getOne
(
String
id
,
String
queryFrom
)
{
return
getOne
(
id
,
queryFrom
,
CommonConstants
.
VIEW_DATA_FROM
.
CHART
);
}
@Transactional
@Transactional
public
ChartViewDTO
getOne
(
String
id
,
String
queryFrom
,
String
dataFrom
)
{
public
ChartViewDTO
getOne
(
String
id
,
String
queryFrom
)
{
ChartViewDTO
result
;
try
{
//从模板中去数据
ChartViewDTO
result
;
if
(
CommonConstants
.
VIEW_DATA_FROM
.
TEMPLATE
.
equals
(
dataFrom
)){
if
(
CommonConstants
.
VIEW_QUERY_FROM
.
PANEL_EDIT
.
equals
(
queryFrom
))
{
result
=
extendDataService
.
getChartInfo
(
id
);
//仪表板编辑页面 从缓存表中取数据 缓存表中没有数据则进行插入
if
(
result
!=
null
){
result
.
setData
(
null
);
}
}
else
if
(
CommonConstants
.
VIEW_QUERY_FROM
.
PANEL_EDIT
.
equals
(
queryFrom
))
{
//仪表板编辑页面 从缓存表中取数据 缓存表中没有数据则进行插入
result
=
extChartViewMapper
.
searchOneFromCache
(
id
);
if
(
result
==
null
)
{
extChartViewMapper
.
copyToCache
(
id
);
result
=
extChartViewMapper
.
searchOneFromCache
(
id
);
result
=
extChartViewMapper
.
searchOneFromCache
(
id
);
if
(
result
==
null
)
{
extChartViewMapper
.
copyToCache
(
id
);
result
=
extChartViewMapper
.
searchOneFromCache
(
id
);
}
}
else
{
result
=
extChartViewMapper
.
searchOne
(
id
);
}
}
result
.
setDataFrom
(
CommonConstants
.
VIEW_DATA_FROM
.
CHART
);
if
(
result
==
null
){
}
else
{
DataEaseException
.
throwException
(
Translator
.
get
(
"i18n_chart_delete"
));
result
=
extChartViewMapper
.
searchOne
(
id
);
}
result
.
setDataFrom
(
CommonConstants
.
VIEW_DATA_FROM
.
CHART
);
return
result
;
}
catch
(
Exception
e
){
e
.
printStackTrace
();
DataEaseException
.
throwException
(
e
);
}
}
return
result
;
return
null
;
}
}
public
void
delete
(
String
id
)
{
public
void
delete
(
String
id
)
{
...
@@ -274,22 +270,21 @@ public class ChartViewService {
...
@@ -274,22 +270,21 @@ public class ChartViewService {
}
}
public
ChartViewDTO
getData
(
String
id
,
ChartExtRequest
request
)
throws
Exception
{
public
ChartViewDTO
getData
(
String
id
,
ChartExtRequest
request
)
throws
Exception
{
try
{
try
{
String
dataFrom
=
panelViewService
.
findViewDataFrom
(
id
);
ChartViewDTO
view
=
this
.
getOne
(
id
,
request
.
getQueryFrom
());
// 如果是从仪表板获取视图数据,则仪表板的查询模式,查询结果的数量,覆盖视图对应的属性
if
(
CommonConstants
.
VIEW_DATA_FROM
.
TEMPLATE
.
equals
(
dataFrom
)){
if
(
CommonConstants
.
VIEW_QUERY_FROM
.
PANEL
.
equals
(
request
.
getQueryFrom
())
&&
CommonConstants
.
VIEW_RESULT_MODE
.
CUSTOM
.
equals
(
request
.
getResultMode
()))
{
return
extendDataService
.
getChartInfo
(
id
);
view
.
setResultMode
(
request
.
getResultMode
());
}
else
{
// 从视图读取数据
view
.
setResultCount
(
request
.
getResultCount
());
ChartViewDTO
view
=
this
.
getOne
(
id
,
request
.
getQueryFrom
());
}
view
.
setDataFrom
(
dataFrom
);
// 数据来源在模板中直接从模板取数据
// 如果是从仪表板获取视图数据,则仪表板的查询模式,查询结果的数量,覆盖视图对应的属性
if
(
CommonConstants
.
VIEW_DATA_FROM
.
TEMPLATE
.
equals
(
view
.
getDataFrom
()))
{
if
(
CommonConstants
.
VIEW_QUERY_FROM
.
PANEL
.
equals
(
request
.
getQueryFrom
())
&&
CommonConstants
.
VIEW_RESULT_MODE
.
CUSTOM
.
equals
(
request
.
getResultMode
()))
{
return
extendDataService
.
getChartDataInfo
(
id
,
view
);
view
.
setResultMode
(
request
.
getResultMode
());
}
else
{
view
.
setResultCount
(
request
.
getResultCount
());
}
return
calcData
(
view
,
request
,
request
.
isCache
());
return
calcData
(
view
,
request
,
request
.
isCache
());
}
}
}
catch
(
Exception
e
){
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
DataEaseException
.
throwException
(
e
);
DataEaseException
.
throwException
(
e
);
}
}
...
...
backend/src/main/java/io/dataease/service/panel/PanelGroupExtendDataService.java
浏览文件 @
343a3869
...
@@ -24,18 +24,17 @@ public class PanelGroupExtendDataService {
...
@@ -24,18 +24,17 @@ public class PanelGroupExtendDataService {
@Resource
@Resource
private
PanelGroupExtendDataMapper
panelGroupExtendDataMapper
;
private
PanelGroupExtendDataMapper
panelGroupExtendDataMapper
;
public
ChartViewDTO
getChart
Info
(
String
viewId
){
public
ChartViewDTO
getChart
DataInfo
(
String
viewId
,
ChartViewDTO
view
){
PanelGroupExtendDataExample
extendDataExample
=
new
PanelGroupExtendDataExample
();
PanelGroupExtendDataExample
extendDataExample
=
new
PanelGroupExtendDataExample
();
extendDataExample
.
createCriteria
().
andViewIdEqualTo
(
viewId
);
extendDataExample
.
createCriteria
().
andViewIdEqualTo
(
viewId
);
List
<
PanelGroupExtendData
>
extendDataList
=
panelGroupExtendDataMapper
.
selectByExampleWithBLOBs
(
extendDataExample
);
List
<
PanelGroupExtendData
>
extendDataList
=
panelGroupExtendDataMapper
.
selectByExampleWithBLOBs
(
extendDataExample
);
if
(
CollectionUtils
.
isNotEmpty
(
extendDataList
)){
if
(
CollectionUtils
.
isNotEmpty
(
extendDataList
)){
ChartViewDTO
chartView
=
JSONObject
.
parseObject
(
extendDataList
.
get
(
0
).
getViewDetails
(),
ChartViewDTO
.
class
);
ChartViewDTO
chartViewTemplate
=
JSONObject
.
parseObject
(
extendDataList
.
get
(
0
).
getViewDetails
(),
ChartViewDTO
.
class
);
chartView
.
setDataFrom
(
CommonConstants
.
VIEW_DATA_FROM
.
TEMPLATE
);
view
.
setData
(
chartViewTemplate
.
getData
());
return
chartView
;
}
else
{
}
else
{
DataEaseException
.
throwException
(
"模板缓存数据中未获取指定视图数据:"
+
viewId
);
DataEaseException
.
throwException
(
"模板缓存数据中未获取指定视图数据:"
+
viewId
);
}
}
return
null
;
return
view
;
}
}
...
...
backend/src/main/java/io/dataease/service/panel/PanelGroupService.java
浏览文件 @
343a3869
...
@@ -6,6 +6,7 @@ import io.dataease.auth.annotation.DeCleaner;
...
@@ -6,6 +6,7 @@ import io.dataease.auth.annotation.DeCleaner;
import
io.dataease.base.domain.*
;
import
io.dataease.base.domain.*
;
import
io.dataease.base.mapper.*
;
import
io.dataease.base.mapper.*
;
import
io.dataease.base.mapper.ext.*
;
import
io.dataease.base.mapper.ext.*
;
import
io.dataease.commons.constants.CommonConstants
;
import
io.dataease.commons.constants.DePermissionType
;
import
io.dataease.commons.constants.DePermissionType
;
import
io.dataease.commons.constants.PanelConstants
;
import
io.dataease.commons.constants.PanelConstants
;
import
io.dataease.commons.utils.AuthUtils
;
import
io.dataease.commons.utils.AuthUtils
;
...
@@ -324,22 +325,24 @@ public class PanelGroupService {
...
@@ -324,22 +325,24 @@ public class PanelGroupService {
Map
<
String
,
String
>
dynamicDataMap
=
JSON
.
parseObject
(
dynamicData
,
Map
.
class
);
Map
<
String
,
String
>
dynamicDataMap
=
JSON
.
parseObject
(
dynamicData
,
Map
.
class
);
List
<
PanelViewInsertDTO
>
panelViews
=
new
ArrayList
<>();
List
<
PanelViewInsertDTO
>
panelViews
=
new
ArrayList
<>();
List
<
PanelGroupExtendDataDTO
>
viewsData
=
new
ArrayList
<>();
List
<
PanelGroupExtendDataDTO
>
viewsData
=
new
ArrayList
<>();
List
<
ChartViewWithBLOBs
>
chartViews
=
new
ArrayList
<>();
for
(
Map
.
Entry
<
String
,
String
>
entry
:
dynamicDataMap
.
entrySet
()){
for
(
Map
.
Entry
<
String
,
String
>
entry
:
dynamicDataMap
.
entrySet
()){
String
originViewId
=
entry
.
getKey
();
String
originViewId
=
entry
.
getKey
();
String
originViewData
=
entry
.
getValue
();
String
originViewData
=
entry
.
getValue
();
JSONObject
chartViewJson
=
JSON
.
parseObject
(
originViewData
);
ChartViewDTO
chartView
=
JSON
.
parseObject
(
originViewData
,
ChartViewDTO
.
class
);
String
position
=
chartView
Json
.
getString
(
"position"
);
String
position
=
chartView
.
getPosition
(
);
String
newViewId
=
UUIDUtil
.
getUUIDAsString
();
String
newViewId
=
UUIDUtil
.
getUUIDAsString
();
chartView
.
setId
(
newViewId
);
chartView
.
setSceneId
(
newPanelId
);
chartView
.
setDataFrom
(
CommonConstants
.
VIEW_DATA_FROM
.
TEMPLATE
);
//TODO 数据处理 1.替换viewId 2.加入panelView 数据(数据来源为template) 3.加入模板view data数据
//TODO 数据处理 1.替换viewId 2.加入panelView 数据(数据来源为template) 3.加入模板view data数据
templateData
=
templateData
.
replaceAll
(
originViewId
,
newViewId
);
templateData
=
templateData
.
replaceAll
(
originViewId
,
newViewId
);
panelViews
.
add
(
new
PanelViewInsertDTO
(
newViewId
,
newPanelId
,
position
,
"template"
));
panelViews
.
add
(
new
PanelViewInsertDTO
(
newViewId
,
newPanelId
,
position
));
viewsData
.
add
(
new
PanelGroupExtendDataDTO
(
newPanelId
,
newViewId
,
originViewData
));
viewsData
.
add
(
new
PanelGroupExtendDataDTO
(
newPanelId
,
newViewId
,
originViewData
));
chartViewMapper
.
insertSelective
(
chartView
);
extChartViewMapper
.
copyToCache
(
newViewId
);
}
}
if
(
CollectionUtils
.
isNotEmpty
(
panelViews
)){
if
(
CollectionUtils
.
isNotEmpty
(
panelViews
)){
extPanelViewMapper
.
savePanelView
(
panelViews
);
extPanelViewMapper
.
savePanelView
(
panelViews
);
}
if
(
CollectionUtils
.
isNotEmpty
(
viewsData
)){
extPanelGroupExtendDataMapper
.
savePanelExtendData
(
viewsData
);
extPanelGroupExtendDataMapper
.
savePanelExtendData
(
viewsData
);
}
}
request
.
setPanelData
(
templateData
);
request
.
setPanelData
(
templateData
);
...
...
backend/src/main/java/io/dataease/service/panel/PanelViewService.java
浏览文件 @
343a3869
...
@@ -154,15 +154,4 @@ public class PanelViewService {
...
@@ -154,15 +154,4 @@ public class PanelViewService {
return
null
;
return
null
;
}
}
}
}
public
String
findViewDataFrom
(
String
viewId
){
PanelViewExample
panelViewExample
=
new
PanelViewExample
();
panelViewExample
.
createCriteria
().
andChartViewIdEqualTo
(
viewId
);
List
<
PanelView
>
result
=
panelViewMapper
.
selectByExample
(
panelViewExample
);
if
(
CollectionUtils
.
isNotEmpty
(
result
)&&
CommonConstants
.
VIEW_DATA_FROM
.
TEMPLATE
.
equals
(
result
.
get
(
0
).
getDataFrom
())){
return
"template"
;
}
else
{
return
"chart"
;
}
}
}
}
backend/src/main/resources/db/migration/V33__1.9.sql
浏览文件 @
343a3869
...
@@ -34,8 +34,11 @@ CREATE TABLE `chart_view_cache` (
...
@@ -34,8 +34,11 @@ CREATE TABLE `chart_view_cache` (
SET
FOREIGN_KEY_CHECKS
=
1
;
SET
FOREIGN_KEY_CHECKS
=
1
;
ALTER
TABLE
`panel_view`
ALTER
TABLE
`chart_view`
ADD
COLUMN
`data_from`
varchar
(
255
)
NULL
DEFAULT
'chart'
COMMENT
'当前数据来源 chart 视图 template 模板'
AFTER
`copy_id`
;
ADD
COLUMN
`data_from`
varchar
(
255
)
NULL
DEFAULT
'dataset'
COMMENT
'数据来源 template 模板数据 dataset 数据集数据'
AFTER
`is_plugin`
;
ALTER
TABLE
`chart_view_cache`
ADD
COLUMN
`data_from`
varchar
(
255
)
NULL
DEFAULT
'dataset'
COMMENT
'数据来源 template 模板数据 dataset 数据集数据'
AFTER
`is_plugin`
;
SET
NAMES
utf8mb4
;
SET
NAMES
utf8mb4
;
...
...
backend/src/main/resources/generatorConfig.xml
浏览文件 @
343a3869
...
@@ -60,9 +60,11 @@
...
@@ -60,9 +60,11 @@
</javaClientGenerator>
</javaClientGenerator>
<!--要生成的数据库表 -->
<!--要生成的数据库表 -->
<table
tableName=
"de_engine"
>
<!-- <table tableName="de_engine">-->
<columnOverride
column=
"configuration"
property=
"configuration"
javaType=
"java.lang.String"
/>
<!-- <columnOverride column="configuration" property="configuration" javaType="java.lang.String"/>-->
</table>
<!-- </table>-->
<table
tableName=
"panel_view"
/>
<table
tableName=
"chart_view"
/>
<table
tableName=
"chart_view_cache"
/>
<table
tableName=
"chart_view_cache"
/>
</context>
</context>
</generatorConfiguration>
</generatorConfiguration>
frontend/src/lang/en.js
浏览文件 @
343a3869
...
@@ -1381,6 +1381,7 @@ export default {
...
@@ -1381,6 +1381,7 @@ export default {
sure_bt
:
'Confirm'
sure_bt
:
'Confirm'
},
},
panel
:
{
panel
:
{
template_view_tips
:
"Template's Views. Please Change"
,
no_auth_role
:
'Unshared roles'
,
no_auth_role
:
'Unshared roles'
,
auth_role
:
'Shared roles'
,
auth_role
:
'Shared roles'
,
picture_limit
:
'Only pictures can be inserted'
,
picture_limit
:
'Only pictures can be inserted'
,
...
...
frontend/src/lang/tw.js
浏览文件 @
343a3869
...
@@ -1382,6 +1382,7 @@ export default {
...
@@ -1382,6 +1382,7 @@ export default {
sure_bt
:
'確定'
sure_bt
:
'確定'
},
},
panel
:
{
panel
:
{
template_view_tips
:
'当前是模板视图,请点击更换数据集'
,
no_auth_role
:
'未分享角色'
,
no_auth_role
:
'未分享角色'
,
auth_role
:
'已分享角色'
,
auth_role
:
'已分享角色'
,
picture_limit
:
'只能插入圖片'
,
picture_limit
:
'只能插入圖片'
,
...
...
frontend/src/lang/zh.js
浏览文件 @
343a3869
...
@@ -1390,6 +1390,7 @@ export default {
...
@@ -1390,6 +1390,7 @@ export default {
sure_bt
:
'确定'
sure_bt
:
'确定'
},
},
panel
:
{
panel
:
{
template_view_tips
:
'当前是模板视图,请点击更换数据集'
,
no_auth_role
:
'未分享角色'
,
no_auth_role
:
'未分享角色'
,
auth_role
:
'已分享角色'
,
auth_role
:
'已分享角色'
,
picture_limit
:
'只能插入图片'
,
picture_limit
:
'只能插入图片'
,
...
...
frontend/src/views/chart/view/ChartEdit.vue
浏览文件 @
343a3869
...
@@ -41,6 +41,20 @@
...
@@ -41,6 +41,20 @@
<el-row
class=
"view-panel-row"
>
<el-row
class=
"view-panel-row"
>
<el-tabs
:stretch=
"true"
class=
"tab-header"
>
<el-tabs
:stretch=
"true"
class=
"tab-header"
>
<el-tab-pane
:label=
"$t('chart.chart_data')"
class=
"padding-tab"
style=
"width: 300px"
>
<el-tab-pane
:label=
"$t('chart.chart_data')"
class=
"padding-tab"
style=
"width: 300px"
>
<div
v-if=
"view.dataFrom==='template'"
class=
"view-panel-Mask"
>
<span
style=
"opacity: 1;"
>
<el-button
style=
"opacity: 1!important;"
type=
"warning"
:title=
"$t('chart.change_ds')"
size=
"mini"
round
@
click=
"changeDs"
>
<span
style=
"font-weight: bold"
>
{{
$t
(
'panel.template_view_tips'
)
}}
<i
class=
"el-icon-refresh el-icon--right"
/></span>
</el-button>
</span>
</div>
<el-row
class=
"view-panel"
>
<el-row
class=
"view-panel"
>
<el-col
class=
"theme-border-class"
:span=
"12"
style=
"border-right: 1px solid #E6E6E6;"
>
<el-col
class=
"theme-border-class"
:span=
"12"
style=
"border-right: 1px solid #E6E6E6;"
>
<div
style=
"display: flex;align-items: center;justify-content: center;padding: 6px;"
>
<div
style=
"display: flex;align-items: center;justify-content: center;padding: 6px;"
>
...
@@ -1403,6 +1417,13 @@ export default {
...
@@ -1403,6 +1417,13 @@ export default {
},
},
methods
:
{
methods
:
{
emptyTableData
()
{
this
.
table
=
{}
this
.
dimension
=
[]
this
.
quota
=
[]
this
.
dimensionData
=
[]
this
.
quotaData
=
[]
},
initFromPanel
()
{
initFromPanel
()
{
this
.
hasEdit
=
(
this
.
panelViewEditInfo
[
this
.
param
.
id
]
||
false
)
this
.
hasEdit
=
(
this
.
panelViewEditInfo
[
this
.
param
.
id
]
||
false
)
},
},
...
@@ -1790,7 +1811,11 @@ export default {
...
@@ -1790,7 +1811,11 @@ export default {
getChart
(
id
,
queryFrom
=
'panel_edit'
)
{
getChart
(
id
,
queryFrom
=
'panel_edit'
)
{
if
(
id
)
{
if
(
id
)
{
getChartDetails
(
id
,
this
.
panelInfo
.
id
,
{
queryFrom
:
queryFrom
}).
then
(
response
=>
{
getChartDetails
(
id
,
this
.
panelInfo
.
id
,
{
queryFrom
:
queryFrom
}).
then
(
response
=>
{
response
.
data
.
dataFrom
!==
'template'
&&
this
.
initTableData
(
response
.
data
.
tableId
)
if
(
response
.
data
.
dataFrom
===
'template'
)
{
this
.
emptyTableData
()
}
else
{
this
.
initTableData
(
response
.
data
.
tableId
)
}
this
.
view
=
JSON
.
parse
(
JSON
.
stringify
(
response
.
data
))
this
.
view
=
JSON
.
parse
(
JSON
.
stringify
(
response
.
data
))
this
.
view
.
xaxis
=
this
.
view
.
xaxis
?
JSON
.
parse
(
this
.
view
.
xaxis
)
:
[]
this
.
view
.
xaxis
=
this
.
view
.
xaxis
?
JSON
.
parse
(
this
.
view
.
xaxis
)
:
[]
this
.
view
.
xaxisExt
=
this
.
view
.
xaxisExt
?
JSON
.
parse
(
this
.
view
.
xaxisExt
)
:
[]
this
.
view
.
xaxisExt
=
this
.
view
.
xaxisExt
?
JSON
.
parse
(
this
.
view
.
xaxisExt
)
:
[]
...
@@ -2148,6 +2173,7 @@ export default {
...
@@ -2148,6 +2173,7 @@ export default {
this
.
view
.
extStack
=
[]
this
.
view
.
extStack
=
[]
this
.
view
.
extBubble
=
[]
this
.
view
.
extBubble
=
[]
this
.
view
.
drillFields
=
[]
this
.
view
.
drillFields
=
[]
this
.
view
.
dataFrom
=
'dataset'
}
}
// this.save(true, 'chart', false)
// this.save(true, 'chart', false)
this
.
calcData
(
true
,
'chart'
,
false
)
this
.
calcData
(
true
,
'chart'
,
false
)
...
@@ -2520,6 +2546,22 @@ export default {
...
@@ -2520,6 +2546,22 @@ export default {
height
:
calc
(
100vh
-
75px
);
height
:
calc
(
100vh
-
75px
);
}
}
.view-panel-Mask
{
display
:
flex
;
height
:
calc
(
100vh
-
60px
);
background-color
:
#5c5e61
;
opacity
:
0
.7
;
position
:absolute
;
top
:
0px
;
left
:
0px
;
width
:
300px
;
z-index
:
2
;
cursor
:not-allowed
;
display
:
flex
;
align-items
:
center
;
justify-content
:
center
;
}
.view-panel
{
.view-panel
{
display
:
flex
;
display
:
flex
;
height
:
calc
(
100%
-
80px
);
height
:
calc
(
100%
-
80px
);
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论