Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
dataease
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
zhu
dataease
Commits
d11d8df2
提交
d11d8df2
authored
4月 02, 2022
作者:
taojinlong
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'dev' of github.com:dataease/dataease into dev
上级
822cdb2c
01e75668
隐藏空白字符变更
内嵌
并排
正在显示
11 个修改的文件
包含
114 行增加
和
61 行删除
+114
-61
ExtChartViewMapper.java
.../java/io/dataease/base/mapper/ext/ExtChartViewMapper.java
+3
-1
ExtChartViewMapper.xml
...n/java/io/dataease/base/mapper/ext/ExtChartViewMapper.xml
+64
-51
ChartViewController.java
...ava/io/dataease/controller/chart/ChartViewController.java
+6
-0
ChartViewService.java
...main/java/io/dataease/service/chart/ChartViewService.java
+12
-2
PanelViewService.java
...main/java/io/dataease/service/panel/PanelViewService.java
+2
-1
chart.js
frontend/src/api/chart/chart.js
+9
-0
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
TitleSelector.vue
.../views/chart/components/component-style/TitleSelector.vue
+13
-4
ChartEdit.vue
frontend/src/views/chart/view/ChartEdit.vue
+2
-2
没有找到文件。
backend/src/main/java/io/dataease/base/mapper/ext/ExtChartViewMapper.java
浏览文件 @
d11d8df2
...
@@ -39,7 +39,7 @@ public interface ExtChartViewMapper {
...
@@ -39,7 +39,7 @@ public interface ExtChartViewMapper {
void
copyToCache
(
@Param
(
"id"
)
String
id
);
void
copyToCache
(
@Param
(
"id"
)
String
id
);
void
deleteCacheWithPanel
(
@Param
(
"panelId"
)
String
panelId
);
void
deleteCacheWithPanel
(
@Param
(
"
viewIds"
)
List
<
String
>
viewIds
,
@Param
(
"
panelId"
)
String
panelId
);
void
deleteViewCache
(
@Param
(
"viewId"
)
String
viewId
);
void
deleteViewCache
(
@Param
(
"viewId"
)
String
viewId
);
...
@@ -48,4 +48,6 @@ public interface ExtChartViewMapper {
...
@@ -48,4 +48,6 @@ public interface ExtChartViewMapper {
int
updateToCache
(
@Param
(
"viewId"
)
String
viewId
);
int
updateToCache
(
@Param
(
"viewId"
)
String
viewId
);
void
copyCache
(
@Param
(
"sourceViewId"
)
String
sourceViewId
,
@Param
(
"newViewId"
)
String
newViewId
);
void
copyCache
(
@Param
(
"sourceViewId"
)
String
sourceViewId
,
@Param
(
"newViewId"
)
String
newViewId
);
void
deleteNoUseView
(
@Param
(
"viewIds"
)
List
<
String
>
viewIds
,
@Param
(
"panelId"
)
String
panelId
);
}
}
backend/src/main/java/io/dataease/base/mapper/ext/ExtChartViewMapper.xml
浏览文件 @
d11d8df2
...
@@ -152,23 +152,23 @@
...
@@ -152,23 +152,23 @@
chart_view_cache.id = #{sourceViewId}
chart_view_cache.id = #{sourceViewId}
</insert>
</insert>
<!-- <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,-->
<!-- 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-->
<!-- style_priority,x_axis, y_axis, custom_attr, custom_style, custom_filter, snapshot-->
<!-- from chart_view-->
<!-- from chart_view-->
<!-- <where>-->
<!-- <where>-->
<!-- <if test="sceneId != null">-->
<!-- <if test="sceneId != null">-->
<!-- and scene_id = #{sceneId,jdbcType=VARCHAR}-->
<!-- and scene_id = #{sceneId,jdbcType=VARCHAR}-->
<!-- </if>-->
<!-- </if>-->
<!-- <if test="id != null">-->
<!-- <if test="id != null">-->
<!-- and id = #{id,jdbcType=VARCHAR}-->
<!-- and id = #{id,jdbcType=VARCHAR}-->
<!-- </if>-->
<!-- </if>-->
<!-- </where>-->
<!-- </where>-->
<!-- <if test="sort != null">-->
<!-- <if test="sort != null">-->
<!-- order by ${sort}-->
<!-- order by ${sort}-->
<!-- </if>-->
<!-- </if>-->
<!-- </select>-->
<!-- </select>-->
<select
id=
"search"
resultMap=
"BaseResultMapDTO"
>
<select
id=
"search"
resultMap=
"BaseResultMapDTO"
>
select
select
...
@@ -407,7 +407,7 @@
...
@@ -407,7 +407,7 @@
</delete>
</delete>
<select
id=
"searchViewsWithPanelId"
resultMap=
"BaseResultMapDTO"
>
<select
id=
"searchViewsWithPanelId"
resultMap=
"BaseResultMapDTO"
>
SELECT * FROM chart_view
SELECT * FROM chart_view
WHERE
WHERE
id IN (
id IN (
...
@@ -421,12 +421,14 @@
...
@@ -421,12 +421,14 @@
</select>
</select>
<delete
id=
"deleteCacheWithPanel"
>
<delete
id=
"deleteCacheWithPanel"
>
DELETE cvc
delete from chart_view_cache
FROM
where scene_id = #{panelId}
chart_view_cache cvc
<if
test=
"viewIds != null and viewIds.size() > 0"
>
INNER JOIN panel_view pv ON cvc.id = pv.chart_view_id
and id not in
WHERE
<foreach
collection=
"viewIds"
item=
"viewId"
open=
'('
separator=
','
close=
')'
>
pv.panel_id = #{panelId}
#{viewId}
</foreach>
</if>
</delete>
</delete>
<delete
id=
"deleteViewCache"
>
<delete
id=
"deleteViewCache"
>
delete from chart_view_cache where id = #{viewId}
delete from chart_view_cache where id = #{viewId}
...
@@ -434,35 +436,35 @@
...
@@ -434,35 +436,35 @@
<update
id=
"copyCacheToView"
>
<update
id=
"copyCacheToView"
>
UPDATE chart_view cv,
UPDATE chart_view cv,
chart_view_cache cve
chart_view_cache cve
SET cv.`name` = cve.`name`,
SET cv.`name` = cve.`name`,
cv.title = cve.title,
cv.title = cve.title,
cv.scene_id = cve.scene_id,
cv.scene_id = cve.scene_id,
cv.table_id = cve.table_id,
cv.table_id = cve.table_id,
cv.`type` = cve.`type`,
cv.`type` = cve.`type`,
cv.render = cve.render,
cv.render = cve.render,
cv.result_count = cve.result_count,
cv.result_count = cve.result_count,
cv.result_mode = cve.result_mode,
cv.result_mode = cve.result_mode,
cv.create_by = cve.create_by,
cv.create_by = cve.create_by,
cv.create_time = cve.create_time,
cv.create_time = cve.create_time,
cv.update_time = cve.update_time,
cv.update_time = cve.update_time,
cv.style_priority = cve.style_priority,
cv.style_priority = cve.style_priority,
cv.chart_type = cve.chart_type,
cv.chart_type = cve.chart_type,
cv.is_plugin = cve.is_plugin,
cv.is_plugin = cve.is_plugin,
cv.x_axis = cve.x_axis,
cv.x_axis = cve.x_axis,
cv.x_axis_ext = cve.x_axis_ext,
cv.x_axis_ext = cve.x_axis_ext,
cv.y_axis = cve.y_axis,
cv.y_axis = cve.y_axis,
cv.y_axis_ext = cve.y_axis_ext,
cv.y_axis_ext = cve.y_axis_ext,
cv.ext_stack = cve.ext_stack,
cv.ext_stack = cve.ext_stack,
cv.ext_bubble = cve.ext_bubble,
cv.ext_bubble = cve.ext_bubble,
cv.custom_attr = cve.custom_attr,
cv.custom_attr = cve.custom_attr,
cv.custom_style = cve.custom_style,
cv.custom_style = cve.custom_style,
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,
cv.SNAPSHOT = cve.SNAPSHOT,
cv.data_from = cve.data_from
cv.data_from = cve.data_from
where cve.id = cv.id
and cv.id in
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>
...
@@ -500,4 +502,15 @@
...
@@ -500,4 +502,15 @@
cv.data_from = cve.data_from
cv.data_from = cve.data_from
where cve.id = cv.id and cv.id =#{viewId}
where cve.id = cv.id and cv.id =#{viewId}
</update>
</update>
<delete
id=
"deleteNoUseView"
>
delete from chart_view
where scene_id = #{panelId}
<if
test=
"viewIds != null and viewIds.size() > 0"
>
and id not in
<foreach
collection=
"viewIds"
item=
"viewId"
open=
'('
separator=
','
close=
')'
>
#{viewId}
</foreach>
</if>
</delete>
</mapper>
</mapper>
backend/src/main/java/io/dataease/controller/chart/ChartViewController.java
浏览文件 @
d11d8df2
...
@@ -155,4 +155,10 @@ public class ChartViewController {
...
@@ -155,4 +155,10 @@ public class ChartViewController {
chartViewCacheService
.
refreshCache
(
id
);
chartViewCacheService
.
refreshCache
(
id
);
}
}
@ApiOperation
(
"校验视图Title"
)
@PostMapping
(
"/checkTitle"
)
public
String
checkTitle
(
@RequestBody
ChartViewCacheRequest
request
)
{
return
chartViewService
.
checkTitle
(
request
);
}
}
}
backend/src/main/java/io/dataease/service/chart/ChartViewService.java
浏览文件 @
d11d8df2
...
@@ -115,6 +115,16 @@ public class ChartViewService {
...
@@ -115,6 +115,16 @@ public class ChartViewService {
return
getOne
(
chartView
.
getId
(),
"panel_edit"
);
return
getOne
(
chartView
.
getId
(),
"panel_edit"
);
}
}
public
String
checkTitle
(
ChartViewCacheRequest
chartView
){
ChartViewCacheExample
example
=
new
ChartViewCacheExample
();
example
.
createCriteria
().
andTitleEqualTo
(
chartView
.
getTitle
()).
andSceneIdEqualTo
(
chartView
.
getSceneId
()).
andIdNotEqualTo
(
chartView
.
getId
());
List
<
ChartViewCache
>
result
=
chartViewCacheMapper
.
selectByExample
(
example
);
if
(
CollectionUtils
.
isNotEmpty
(
result
)){
return
"fail"
;
}
else
{
return
"success"
;
}
}
public
ChartViewWithBLOBs
newOne
(
ChartViewWithBLOBs
chartView
)
{
public
ChartViewWithBLOBs
newOne
(
ChartViewWithBLOBs
chartView
)
{
long
timestamp
=
System
.
currentTimeMillis
();
long
timestamp
=
System
.
currentTimeMillis
();
...
@@ -1030,7 +1040,7 @@ public class ChartViewService {
...
@@ -1030,7 +1040,7 @@ public class ChartViewService {
extChartViewMapper
.
chartCopy
(
newChartId
,
id
,
panelId
);
extChartViewMapper
.
chartCopy
(
newChartId
,
id
,
panelId
);
extChartViewMapper
.
copyCache
(
id
,
newChartId
);
extChartViewMapper
.
copyCache
(
id
,
newChartId
);
extPanelGroupExtendDataMapper
.
copyExtendData
(
id
,
newChartId
,
panelId
);
extPanelGroupExtendDataMapper
.
copyExtendData
(
id
,
newChartId
,
panelId
);
chartViewCacheService
.
refreshCache
(
i
d
);
chartViewCacheService
.
refreshCache
(
newChartI
d
);
return
newChartId
;
return
newChartId
;
}
}
...
@@ -1061,7 +1071,7 @@ public class ChartViewService {
...
@@ -1061,7 +1071,7 @@ public class ChartViewService {
}
}
public
void
initViewCache
(
String
panelId
)
{
public
void
initViewCache
(
String
panelId
)
{
extChartViewMapper
.
deleteCacheWithPanel
(
panelId
);
extChartViewMapper
.
deleteCacheWithPanel
(
null
,
panelId
);
}
}
}
}
backend/src/main/java/io/dataease/service/panel/PanelViewService.java
浏览文件 @
d11d8df2
...
@@ -127,9 +127,10 @@ public class PanelViewService {
...
@@ -127,9 +127,10 @@ public class PanelViewService {
//将视图从cache表中更新到正式表中
//将视图从cache表中更新到正式表中
viewIds
=
panelViewInsertDTOList
.
stream
().
map
(
panelView
->
panelView
.
getChartViewId
()).
collect
(
Collectors
.
toList
());
viewIds
=
panelViewInsertDTOList
.
stream
().
map
(
panelView
->
panelView
.
getChartViewId
()).
collect
(
Collectors
.
toList
());
extChartViewMapper
.
copyCacheToView
(
viewIds
);
extChartViewMapper
.
copyCacheToView
(
viewIds
);
extChartViewMapper
.
deleteCacheWithPanel
(
panelId
);
}
}
}
}
extChartViewMapper
.
deleteCacheWithPanel
(
viewIds
,
panelId
);
extChartViewMapper
.
deleteNoUseView
(
viewIds
,
panelId
);
panelGroup
.
setMobileLayout
(
mobileLayout
);
panelGroup
.
setMobileLayout
(
mobileLayout
);
return
viewIds
;
return
viewIds
;
}
}
...
...
frontend/src/api/chart/chart.js
浏览文件 @
d11d8df2
...
@@ -108,3 +108,12 @@ export function resetViewCache(viewId, panelId) {
...
@@ -108,3 +108,12 @@ export function resetViewCache(viewId, panelId) {
loading
:
false
loading
:
false
})
})
}
}
export
function
checkTitle
(
data
)
{
return
request
({
url
:
'/chart/view/checkTitle'
,
method
:
'post'
,
data
:
data
,
loading
:
false
})
}
frontend/src/lang/en.js
浏览文件 @
d11d8df2
...
@@ -653,6 +653,7 @@ export default {
...
@@ -653,6 +653,7 @@ export default {
kettle_setting
:
'Kettle Setting'
kettle_setting
:
'Kettle Setting'
},
},
chart
:
{
chart
:
{
title_repeat
:
'The Title Already Exist'
,
save_snapshot
:
'Save Snapshot'
,
save_snapshot
:
'Save Snapshot'
,
datalist
:
'Chart'
,
datalist
:
'Chart'
,
add_group
:
'Add Group'
,
add_group
:
'Add Group'
,
...
...
frontend/src/lang/tw.js
浏览文件 @
d11d8df2
...
@@ -655,6 +655,7 @@ export default {
...
@@ -655,6 +655,7 @@ export default {
kettle_setting
:
'Kettle 設置'
kettle_setting
:
'Kettle 設置'
},
},
chart
:
{
chart
:
{
title_repeat
:
'当前标题已存在'
,
save_snapshot
:
'保存縮略圖'
,
save_snapshot
:
'保存縮略圖'
,
datalist
:
'視圖'
,
datalist
:
'視圖'
,
add_group
:
'添加分組'
,
add_group
:
'添加分組'
,
...
...
frontend/src/lang/zh.js
浏览文件 @
d11d8df2
...
@@ -656,6 +656,7 @@ export default {
...
@@ -656,6 +656,7 @@ export default {
kettle_setting
:
'Kettle 设置'
kettle_setting
:
'Kettle 设置'
},
},
chart
:
{
chart
:
{
title_repeat
:
'当前标题已存在'
,
save_snapshot
:
'保存缩略图'
,
save_snapshot
:
'保存缩略图'
,
datalist
:
'视图'
,
datalist
:
'视图'
,
add_group
:
'添加分组'
,
add_group
:
'添加分组'
,
...
...
frontend/src/views/chart/components/component-style/TitleSelector.vue
浏览文件 @
d11d8df2
...
@@ -50,6 +50,7 @@
...
@@ -50,6 +50,7 @@
<
script
>
<
script
>
import
{
COLOR_PANEL
,
DEFAULT_TITLE_STYLE
}
from
'../../chart/chart'
import
{
COLOR_PANEL
,
DEFAULT_TITLE_STYLE
}
from
'../../chart/chart'
import
{
checkTitle
}
from
'@/api/chart/chart'
export
default
{
export
default
{
name
:
'TitleSelector'
,
name
:
'TitleSelector'
,
...
@@ -114,10 +115,18 @@ export default {
...
@@ -114,10 +115,18 @@ export default {
this
.
titleForm
.
title
=
this
.
chart
.
title
this
.
titleForm
.
title
=
this
.
chart
.
title
return
return
}
}
if
(
!
this
.
titleForm
.
show
)
{
checkTitle
({
id
:
this
.
chart
.
id
,
title
:
this
.
titleForm
.
title
,
sceneId
:
this
.
chart
.
sceneId
}).
then
((
rsp
)
=>
{
this
.
isSetting
=
false
if
(
rsp
.
data
===
'success'
)
{
}
if
(
!
this
.
titleForm
.
show
)
{
this
.
$emit
(
'onTextChange'
,
this
.
titleForm
)
this
.
isSetting
=
false
}
this
.
$emit
(
'onTextChange'
,
this
.
titleForm
)
}
else
{
this
.
$error
(
this
.
$t
(
'chart.title_repeat'
))
this
.
titleForm
.
title
=
this
.
chart
.
title
return
}
})
},
},
inputOnInput
:
function
(
e
)
{
inputOnInput
:
function
(
e
)
{
this
.
$forceUpdate
()
this
.
$forceUpdate
()
...
...
frontend/src/views/chart/view/ChartEdit.vue
浏览文件 @
d11d8df2
...
@@ -657,7 +657,7 @@
...
@@ -657,7 +657,7 @@
/>
/>
<div
<div
v-else
v-else
style=
"overflow:auto;border-right: 1px solid #e6e6e6;height: 100%;width: 100%;"
style=
"overflow:auto;border-right: 1px solid #e6e6e6;height: 100%;width: 100%;
padding-right: 6px
"
class=
"attr-style theme-border-class"
class=
"attr-style theme-border-class"
>
>
<el-row
class=
"padding-lr"
>
<el-row
class=
"padding-lr"
>
...
@@ -877,7 +877,7 @@
...
@@ -877,7 +877,7 @@
@
onLegendChange=
"onLegendChange"
@
onLegendChange=
"onLegendChange"
/>
/>
</el-collapse-item>
</el-collapse-item>
<el-collapse-item
v-if=
"chart.customStyle &&
chart
.customStyle.background"
name=
"background"
:title=
"$t('chart.background')"
>
<el-collapse-item
v-if=
"chart.customStyle &&
view
.customStyle.background"
name=
"background"
:title=
"$t('chart.background')"
>
<background-color-selector
<background-color-selector
:param=
"param"
:param=
"param"
class=
"attr-selector"
class=
"attr-selector"
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论