Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
dataease
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
njgzx
dataease
Commits
4b11bfeb
提交
4b11bfeb
authored
7月 06, 2021
作者:
wangjiahao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat: 仪表板编辑增加新建视图功能,可以直接在仪表板新建视图
上级
a8e09740
隐藏空白字符变更
内嵌
并排
正在显示
24 个修改的文件
包含
1328 行增加
和
24 行删除
+1328
-24
PanelView.java
backend/src/main/java/io/dataease/base/domain/PanelView.java
+26
-0
PanelViewExample.java
...c/main/java/io/dataease/base/domain/PanelViewExample.java
+671
-0
PanelViewMapper.java
...rc/main/java/io/dataease/base/mapper/PanelViewMapper.java
+37
-0
PanelViewMapper.xml
...src/main/java/io/dataease/base/mapper/PanelViewMapper.xml
+305
-0
ExtChartViewMapper.java
.../java/io/dataease/base/mapper/ext/ExtChartViewMapper.java
+2
-0
ExtChartViewMapper.xml
...n/java/io/dataease/base/mapper/ext/ExtChartViewMapper.xml
+15
-0
ExtPanelViewMapper.java
.../java/io/dataease/base/mapper/ext/ExtPanelViewMapper.java
+7
-0
ExtPanelViewMapper.xml
...n/java/io/dataease/base/mapper/ext/ExtPanelViewMapper.xml
+10
-0
ChartViewController.java
...ava/io/dataease/controller/chart/ChartViewController.java
+5
-0
PanelViewInsertDTO.java
...ain/java/io/dataease/dto/panel/po/PanelViewInsertDTO.java
+21
-0
ChartViewService.java
...main/java/io/dataease/service/chart/ChartViewService.java
+4
-0
PanelGroupService.java
...ain/java/io/dataease/service/panel/PanelGroupService.java
+9
-0
PanelViewService.java
...main/java/io/dataease/service/panel/PanelViewService.java
+34
-0
V11__panel_view.sql
backend/src/main/resources/db/migration/V11__panel_view.sql
+12
-0
generatorConfig.xml
backend/src/main/resources/generatorConfig.xml
+1
-1
chart.js
frontend/src/api/chart/chart.js
+16
-0
ContextMenu.vue
...d/src/components/canvas/components/Editor/ContextMenu.vue
+1
-1
en.js
frontend/src/lang/en.js
+2
-0
tw.js
frontend/src/lang/tw.js
+2
-0
zh.js
frontend/src/lang/zh.js
+2
-0
Group.vue
frontend/src/views/chart/group/Group.vue
+65
-11
ChartEdit.vue
frontend/src/views/chart/view/ChartEdit.vue
+5
-1
index.vue
frontend/src/views/panel/ViewSelect/index.vue
+16
-7
index.vue
frontend/src/views/panel/edit/index.vue
+60
-3
没有找到文件。
backend/src/main/java/io/dataease/base/domain/PanelView.java
0 → 100644
浏览文件 @
4b11bfeb
package
io
.
dataease
.
base
.
domain
;
import
java.io.Serializable
;
import
lombok.Data
;
@Data
public
class
PanelView
implements
Serializable
{
private
String
id
;
private
String
panelId
;
private
String
chartViewId
;
private
String
createBy
;
private
Long
createTime
;
private
String
updateBy
;
private
Long
updateTime
;
private
byte
[]
content
;
private
static
final
long
serialVersionUID
=
1L
;
}
\ No newline at end of file
backend/src/main/java/io/dataease/base/domain/PanelViewExample.java
0 → 100644
浏览文件 @
4b11bfeb
package
io
.
dataease
.
base
.
domain
;
import
java.util.ArrayList
;
import
java.util.List
;
public
class
PanelViewExample
{
protected
String
orderByClause
;
protected
boolean
distinct
;
protected
List
<
Criteria
>
oredCriteria
;
public
PanelViewExample
()
{
oredCriteria
=
new
ArrayList
<
Criteria
>();
}
public
void
setOrderByClause
(
String
orderByClause
)
{
this
.
orderByClause
=
orderByClause
;
}
public
String
getOrderByClause
()
{
return
orderByClause
;
}
public
void
setDistinct
(
boolean
distinct
)
{
this
.
distinct
=
distinct
;
}
public
boolean
isDistinct
()
{
return
distinct
;
}
public
List
<
Criteria
>
getOredCriteria
()
{
return
oredCriteria
;
}
public
void
or
(
Criteria
criteria
)
{
oredCriteria
.
add
(
criteria
);
}
public
Criteria
or
()
{
Criteria
criteria
=
createCriteriaInternal
();
oredCriteria
.
add
(
criteria
);
return
criteria
;
}
public
Criteria
createCriteria
()
{
Criteria
criteria
=
createCriteriaInternal
();
if
(
oredCriteria
.
size
()
==
0
)
{
oredCriteria
.
add
(
criteria
);
}
return
criteria
;
}
protected
Criteria
createCriteriaInternal
()
{
Criteria
criteria
=
new
Criteria
();
return
criteria
;
}
public
void
clear
()
{
oredCriteria
.
clear
();
orderByClause
=
null
;
distinct
=
false
;
}
protected
abstract
static
class
GeneratedCriteria
{
protected
List
<
Criterion
>
criteria
;
protected
GeneratedCriteria
()
{
super
();
criteria
=
new
ArrayList
<
Criterion
>();
}
public
boolean
isValid
()
{
return
criteria
.
size
()
>
0
;
}
public
List
<
Criterion
>
getAllCriteria
()
{
return
criteria
;
}
public
List
<
Criterion
>
getCriteria
()
{
return
criteria
;
}
protected
void
addCriterion
(
String
condition
)
{
if
(
condition
==
null
)
{
throw
new
RuntimeException
(
"Value for condition cannot be null"
);
}
criteria
.
add
(
new
Criterion
(
condition
));
}
protected
void
addCriterion
(
String
condition
,
Object
value
,
String
property
)
{
if
(
value
==
null
)
{
throw
new
RuntimeException
(
"Value for "
+
property
+
" cannot be null"
);
}
criteria
.
add
(
new
Criterion
(
condition
,
value
));
}
protected
void
addCriterion
(
String
condition
,
Object
value1
,
Object
value2
,
String
property
)
{
if
(
value1
==
null
||
value2
==
null
)
{
throw
new
RuntimeException
(
"Between values for "
+
property
+
" cannot be null"
);
}
criteria
.
add
(
new
Criterion
(
condition
,
value1
,
value2
));
}
public
Criteria
andIdIsNull
()
{
addCriterion
(
"id is null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIdIsNotNull
()
{
addCriterion
(
"id is not null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIdEqualTo
(
String
value
)
{
addCriterion
(
"id ="
,
value
,
"id"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIdNotEqualTo
(
String
value
)
{
addCriterion
(
"id <>"
,
value
,
"id"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIdGreaterThan
(
String
value
)
{
addCriterion
(
"id >"
,
value
,
"id"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIdGreaterThanOrEqualTo
(
String
value
)
{
addCriterion
(
"id >="
,
value
,
"id"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIdLessThan
(
String
value
)
{
addCriterion
(
"id <"
,
value
,
"id"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIdLessThanOrEqualTo
(
String
value
)
{
addCriterion
(
"id <="
,
value
,
"id"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIdLike
(
String
value
)
{
addCriterion
(
"id like"
,
value
,
"id"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIdNotLike
(
String
value
)
{
addCriterion
(
"id not like"
,
value
,
"id"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIdIn
(
List
<
String
>
values
)
{
addCriterion
(
"id in"
,
values
,
"id"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIdNotIn
(
List
<
String
>
values
)
{
addCriterion
(
"id not in"
,
values
,
"id"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIdBetween
(
String
value1
,
String
value2
)
{
addCriterion
(
"id between"
,
value1
,
value2
,
"id"
);
return
(
Criteria
)
this
;
}
public
Criteria
andIdNotBetween
(
String
value1
,
String
value2
)
{
addCriterion
(
"id not between"
,
value1
,
value2
,
"id"
);
return
(
Criteria
)
this
;
}
public
Criteria
andPanelIdIsNull
()
{
addCriterion
(
"panel_id is null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andPanelIdIsNotNull
()
{
addCriterion
(
"panel_id is not null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andPanelIdEqualTo
(
String
value
)
{
addCriterion
(
"panel_id ="
,
value
,
"panelId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andPanelIdNotEqualTo
(
String
value
)
{
addCriterion
(
"panel_id <>"
,
value
,
"panelId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andPanelIdGreaterThan
(
String
value
)
{
addCriterion
(
"panel_id >"
,
value
,
"panelId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andPanelIdGreaterThanOrEqualTo
(
String
value
)
{
addCriterion
(
"panel_id >="
,
value
,
"panelId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andPanelIdLessThan
(
String
value
)
{
addCriterion
(
"panel_id <"
,
value
,
"panelId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andPanelIdLessThanOrEqualTo
(
String
value
)
{
addCriterion
(
"panel_id <="
,
value
,
"panelId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andPanelIdLike
(
String
value
)
{
addCriterion
(
"panel_id like"
,
value
,
"panelId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andPanelIdNotLike
(
String
value
)
{
addCriterion
(
"panel_id not like"
,
value
,
"panelId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andPanelIdIn
(
List
<
String
>
values
)
{
addCriterion
(
"panel_id in"
,
values
,
"panelId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andPanelIdNotIn
(
List
<
String
>
values
)
{
addCriterion
(
"panel_id not in"
,
values
,
"panelId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andPanelIdBetween
(
String
value1
,
String
value2
)
{
addCriterion
(
"panel_id between"
,
value1
,
value2
,
"panelId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andPanelIdNotBetween
(
String
value1
,
String
value2
)
{
addCriterion
(
"panel_id not between"
,
value1
,
value2
,
"panelId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andChartViewIdIsNull
()
{
addCriterion
(
"chart_view_id is null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andChartViewIdIsNotNull
()
{
addCriterion
(
"chart_view_id is not null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andChartViewIdEqualTo
(
String
value
)
{
addCriterion
(
"chart_view_id ="
,
value
,
"chartViewId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andChartViewIdNotEqualTo
(
String
value
)
{
addCriterion
(
"chart_view_id <>"
,
value
,
"chartViewId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andChartViewIdGreaterThan
(
String
value
)
{
addCriterion
(
"chart_view_id >"
,
value
,
"chartViewId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andChartViewIdGreaterThanOrEqualTo
(
String
value
)
{
addCriterion
(
"chart_view_id >="
,
value
,
"chartViewId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andChartViewIdLessThan
(
String
value
)
{
addCriterion
(
"chart_view_id <"
,
value
,
"chartViewId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andChartViewIdLessThanOrEqualTo
(
String
value
)
{
addCriterion
(
"chart_view_id <="
,
value
,
"chartViewId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andChartViewIdLike
(
String
value
)
{
addCriterion
(
"chart_view_id like"
,
value
,
"chartViewId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andChartViewIdNotLike
(
String
value
)
{
addCriterion
(
"chart_view_id not like"
,
value
,
"chartViewId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andChartViewIdIn
(
List
<
String
>
values
)
{
addCriterion
(
"chart_view_id in"
,
values
,
"chartViewId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andChartViewIdNotIn
(
List
<
String
>
values
)
{
addCriterion
(
"chart_view_id not in"
,
values
,
"chartViewId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andChartViewIdBetween
(
String
value1
,
String
value2
)
{
addCriterion
(
"chart_view_id between"
,
value1
,
value2
,
"chartViewId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andChartViewIdNotBetween
(
String
value1
,
String
value2
)
{
addCriterion
(
"chart_view_id not between"
,
value1
,
value2
,
"chartViewId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCreateByIsNull
()
{
addCriterion
(
"create_by is null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCreateByIsNotNull
()
{
addCriterion
(
"create_by is not null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCreateByEqualTo
(
String
value
)
{
addCriterion
(
"create_by ="
,
value
,
"createBy"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCreateByNotEqualTo
(
String
value
)
{
addCriterion
(
"create_by <>"
,
value
,
"createBy"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCreateByGreaterThan
(
String
value
)
{
addCriterion
(
"create_by >"
,
value
,
"createBy"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCreateByGreaterThanOrEqualTo
(
String
value
)
{
addCriterion
(
"create_by >="
,
value
,
"createBy"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCreateByLessThan
(
String
value
)
{
addCriterion
(
"create_by <"
,
value
,
"createBy"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCreateByLessThanOrEqualTo
(
String
value
)
{
addCriterion
(
"create_by <="
,
value
,
"createBy"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCreateByLike
(
String
value
)
{
addCriterion
(
"create_by like"
,
value
,
"createBy"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCreateByNotLike
(
String
value
)
{
addCriterion
(
"create_by not like"
,
value
,
"createBy"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCreateByIn
(
List
<
String
>
values
)
{
addCriterion
(
"create_by in"
,
values
,
"createBy"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCreateByNotIn
(
List
<
String
>
values
)
{
addCriterion
(
"create_by not in"
,
values
,
"createBy"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCreateByBetween
(
String
value1
,
String
value2
)
{
addCriterion
(
"create_by between"
,
value1
,
value2
,
"createBy"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCreateByNotBetween
(
String
value1
,
String
value2
)
{
addCriterion
(
"create_by not between"
,
value1
,
value2
,
"createBy"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCreateTimeIsNull
()
{
addCriterion
(
"create_time is null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCreateTimeIsNotNull
()
{
addCriterion
(
"create_time is not null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCreateTimeEqualTo
(
Long
value
)
{
addCriterion
(
"create_time ="
,
value
,
"createTime"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCreateTimeNotEqualTo
(
Long
value
)
{
addCriterion
(
"create_time <>"
,
value
,
"createTime"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCreateTimeGreaterThan
(
Long
value
)
{
addCriterion
(
"create_time >"
,
value
,
"createTime"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCreateTimeGreaterThanOrEqualTo
(
Long
value
)
{
addCriterion
(
"create_time >="
,
value
,
"createTime"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCreateTimeLessThan
(
Long
value
)
{
addCriterion
(
"create_time <"
,
value
,
"createTime"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCreateTimeLessThanOrEqualTo
(
Long
value
)
{
addCriterion
(
"create_time <="
,
value
,
"createTime"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCreateTimeIn
(
List
<
Long
>
values
)
{
addCriterion
(
"create_time in"
,
values
,
"createTime"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCreateTimeNotIn
(
List
<
Long
>
values
)
{
addCriterion
(
"create_time not in"
,
values
,
"createTime"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCreateTimeBetween
(
Long
value1
,
Long
value2
)
{
addCriterion
(
"create_time between"
,
value1
,
value2
,
"createTime"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCreateTimeNotBetween
(
Long
value1
,
Long
value2
)
{
addCriterion
(
"create_time not between"
,
value1
,
value2
,
"createTime"
);
return
(
Criteria
)
this
;
}
public
Criteria
andUpdateByIsNull
()
{
addCriterion
(
"update_by is null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andUpdateByIsNotNull
()
{
addCriterion
(
"update_by is not null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andUpdateByEqualTo
(
String
value
)
{
addCriterion
(
"update_by ="
,
value
,
"updateBy"
);
return
(
Criteria
)
this
;
}
public
Criteria
andUpdateByNotEqualTo
(
String
value
)
{
addCriterion
(
"update_by <>"
,
value
,
"updateBy"
);
return
(
Criteria
)
this
;
}
public
Criteria
andUpdateByGreaterThan
(
String
value
)
{
addCriterion
(
"update_by >"
,
value
,
"updateBy"
);
return
(
Criteria
)
this
;
}
public
Criteria
andUpdateByGreaterThanOrEqualTo
(
String
value
)
{
addCriterion
(
"update_by >="
,
value
,
"updateBy"
);
return
(
Criteria
)
this
;
}
public
Criteria
andUpdateByLessThan
(
String
value
)
{
addCriterion
(
"update_by <"
,
value
,
"updateBy"
);
return
(
Criteria
)
this
;
}
public
Criteria
andUpdateByLessThanOrEqualTo
(
String
value
)
{
addCriterion
(
"update_by <="
,
value
,
"updateBy"
);
return
(
Criteria
)
this
;
}
public
Criteria
andUpdateByLike
(
String
value
)
{
addCriterion
(
"update_by like"
,
value
,
"updateBy"
);
return
(
Criteria
)
this
;
}
public
Criteria
andUpdateByNotLike
(
String
value
)
{
addCriterion
(
"update_by not like"
,
value
,
"updateBy"
);
return
(
Criteria
)
this
;
}
public
Criteria
andUpdateByIn
(
List
<
String
>
values
)
{
addCriterion
(
"update_by in"
,
values
,
"updateBy"
);
return
(
Criteria
)
this
;
}
public
Criteria
andUpdateByNotIn
(
List
<
String
>
values
)
{
addCriterion
(
"update_by not in"
,
values
,
"updateBy"
);
return
(
Criteria
)
this
;
}
public
Criteria
andUpdateByBetween
(
String
value1
,
String
value2
)
{
addCriterion
(
"update_by between"
,
value1
,
value2
,
"updateBy"
);
return
(
Criteria
)
this
;
}
public
Criteria
andUpdateByNotBetween
(
String
value1
,
String
value2
)
{
addCriterion
(
"update_by not between"
,
value1
,
value2
,
"updateBy"
);
return
(
Criteria
)
this
;
}
public
Criteria
andUpdateTimeIsNull
()
{
addCriterion
(
"update_time is null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andUpdateTimeIsNotNull
()
{
addCriterion
(
"update_time is not null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andUpdateTimeEqualTo
(
Long
value
)
{
addCriterion
(
"update_time ="
,
value
,
"updateTime"
);
return
(
Criteria
)
this
;
}
public
Criteria
andUpdateTimeNotEqualTo
(
Long
value
)
{
addCriterion
(
"update_time <>"
,
value
,
"updateTime"
);
return
(
Criteria
)
this
;
}
public
Criteria
andUpdateTimeGreaterThan
(
Long
value
)
{
addCriterion
(
"update_time >"
,
value
,
"updateTime"
);
return
(
Criteria
)
this
;
}
public
Criteria
andUpdateTimeGreaterThanOrEqualTo
(
Long
value
)
{
addCriterion
(
"update_time >="
,
value
,
"updateTime"
);
return
(
Criteria
)
this
;
}
public
Criteria
andUpdateTimeLessThan
(
Long
value
)
{
addCriterion
(
"update_time <"
,
value
,
"updateTime"
);
return
(
Criteria
)
this
;
}
public
Criteria
andUpdateTimeLessThanOrEqualTo
(
Long
value
)
{
addCriterion
(
"update_time <="
,
value
,
"updateTime"
);
return
(
Criteria
)
this
;
}
public
Criteria
andUpdateTimeIn
(
List
<
Long
>
values
)
{
addCriterion
(
"update_time in"
,
values
,
"updateTime"
);
return
(
Criteria
)
this
;
}
public
Criteria
andUpdateTimeNotIn
(
List
<
Long
>
values
)
{
addCriterion
(
"update_time not in"
,
values
,
"updateTime"
);
return
(
Criteria
)
this
;
}
public
Criteria
andUpdateTimeBetween
(
Long
value1
,
Long
value2
)
{
addCriterion
(
"update_time between"
,
value1
,
value2
,
"updateTime"
);
return
(
Criteria
)
this
;
}
public
Criteria
andUpdateTimeNotBetween
(
Long
value1
,
Long
value2
)
{
addCriterion
(
"update_time not between"
,
value1
,
value2
,
"updateTime"
);
return
(
Criteria
)
this
;
}
}
public
static
class
Criteria
extends
GeneratedCriteria
{
protected
Criteria
()
{
super
();
}
}
public
static
class
Criterion
{
private
String
condition
;
private
Object
value
;
private
Object
secondValue
;
private
boolean
noValue
;
private
boolean
singleValue
;
private
boolean
betweenValue
;
private
boolean
listValue
;
private
String
typeHandler
;
public
String
getCondition
()
{
return
condition
;
}
public
Object
getValue
()
{
return
value
;
}
public
Object
getSecondValue
()
{
return
secondValue
;
}
public
boolean
isNoValue
()
{
return
noValue
;
}
public
boolean
isSingleValue
()
{
return
singleValue
;
}
public
boolean
isBetweenValue
()
{
return
betweenValue
;
}
public
boolean
isListValue
()
{
return
listValue
;
}
public
String
getTypeHandler
()
{
return
typeHandler
;
}
protected
Criterion
(
String
condition
)
{
super
();
this
.
condition
=
condition
;
this
.
typeHandler
=
null
;
this
.
noValue
=
true
;
}
protected
Criterion
(
String
condition
,
Object
value
,
String
typeHandler
)
{
super
();
this
.
condition
=
condition
;
this
.
value
=
value
;
this
.
typeHandler
=
typeHandler
;
if
(
value
instanceof
List
<?>)
{
this
.
listValue
=
true
;
}
else
{
this
.
singleValue
=
true
;
}
}
protected
Criterion
(
String
condition
,
Object
value
)
{
this
(
condition
,
value
,
null
);
}
protected
Criterion
(
String
condition
,
Object
value
,
Object
secondValue
,
String
typeHandler
)
{
super
();
this
.
condition
=
condition
;
this
.
value
=
value
;
this
.
secondValue
=
secondValue
;
this
.
typeHandler
=
typeHandler
;
this
.
betweenValue
=
true
;
}
protected
Criterion
(
String
condition
,
Object
value
,
Object
secondValue
)
{
this
(
condition
,
value
,
secondValue
,
null
);
}
}
}
\ No newline at end of file
backend/src/main/java/io/dataease/base/mapper/PanelViewMapper.java
0 → 100644
浏览文件 @
4b11bfeb
package
io
.
dataease
.
base
.
mapper
;
import
io.dataease.base.domain.PanelView
;
import
io.dataease.base.domain.PanelViewExample
;
import
java.util.List
;
import
org.apache.ibatis.annotations.Param
;
public
interface
PanelViewMapper
{
long
countByExample
(
PanelViewExample
example
);
int
deleteByExample
(
PanelViewExample
example
);
int
deleteByPrimaryKey
(
String
id
);
int
insert
(
PanelView
record
);
int
insertSelective
(
PanelView
record
);
List
<
PanelView
>
selectByExampleWithBLOBs
(
PanelViewExample
example
);
List
<
PanelView
>
selectByExample
(
PanelViewExample
example
);
PanelView
selectByPrimaryKey
(
String
id
);
int
updateByExampleSelective
(
@Param
(
"record"
)
PanelView
record
,
@Param
(
"example"
)
PanelViewExample
example
);
int
updateByExampleWithBLOBs
(
@Param
(
"record"
)
PanelView
record
,
@Param
(
"example"
)
PanelViewExample
example
);
int
updateByExample
(
@Param
(
"record"
)
PanelView
record
,
@Param
(
"example"
)
PanelViewExample
example
);
int
updateByPrimaryKeySelective
(
PanelView
record
);
int
updateByPrimaryKeyWithBLOBs
(
PanelView
record
);
int
updateByPrimaryKey
(
PanelView
record
);
}
\ No newline at end of file
backend/src/main/java/io/dataease/base/mapper/PanelViewMapper.xml
0 → 100644
浏览文件 @
4b11bfeb
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"io.dataease.base.mapper.PanelViewMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"io.dataease.base.domain.PanelView"
>
<id
column=
"id"
jdbcType=
"VARCHAR"
property=
"id"
/>
<result
column=
"panel_id"
jdbcType=
"VARCHAR"
property=
"panelId"
/>
<result
column=
"chart_view_id"
jdbcType=
"VARCHAR"
property=
"chartViewId"
/>
<result
column=
"create_by"
jdbcType=
"VARCHAR"
property=
"createBy"
/>
<result
column=
"create_time"
jdbcType=
"BIGINT"
property=
"createTime"
/>
<result
column=
"update_by"
jdbcType=
"VARCHAR"
property=
"updateBy"
/>
<result
column=
"update_time"
jdbcType=
"BIGINT"
property=
"updateTime"
/>
</resultMap>
<resultMap
extends=
"BaseResultMap"
id=
"ResultMapWithBLOBs"
type=
"io.dataease.base.domain.PanelView"
>
<result
column=
"content"
jdbcType=
"LONGVARBINARY"
property=
"content"
/>
</resultMap>
<sql
id=
"Example_Where_Clause"
>
<where>
<foreach
collection=
"oredCriteria"
item=
"criteria"
separator=
"or"
>
<if
test=
"criteria.valid"
>
<trim
prefix=
"("
prefixOverrides=
"and"
suffix=
")"
>
<foreach
collection=
"criteria.criteria"
item=
"criterion"
>
<choose>
<when
test=
"criterion.noValue"
>
and ${criterion.condition}
</when>
<when
test=
"criterion.singleValue"
>
and ${criterion.condition} #{criterion.value}
</when>
<when
test=
"criterion.betweenValue"
>
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when
test=
"criterion.listValue"
>
and ${criterion.condition}
<foreach
close=
")"
collection=
"criterion.value"
item=
"listItem"
open=
"("
separator=
","
>
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql
id=
"Update_By_Example_Where_Clause"
>
<where>
<foreach
collection=
"example.oredCriteria"
item=
"criteria"
separator=
"or"
>
<if
test=
"criteria.valid"
>
<trim
prefix=
"("
prefixOverrides=
"and"
suffix=
")"
>
<foreach
collection=
"criteria.criteria"
item=
"criterion"
>
<choose>
<when
test=
"criterion.noValue"
>
and ${criterion.condition}
</when>
<when
test=
"criterion.singleValue"
>
and ${criterion.condition} #{criterion.value}
</when>
<when
test=
"criterion.betweenValue"
>
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when
test=
"criterion.listValue"
>
and ${criterion.condition}
<foreach
close=
")"
collection=
"criterion.value"
item=
"listItem"
open=
"("
separator=
","
>
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql
id=
"Base_Column_List"
>
id, panel_id, chart_view_id, create_by, create_time, update_by, update_time
</sql>
<sql
id=
"Blob_Column_List"
>
content
</sql>
<select
id=
"selectByExampleWithBLOBs"
parameterType=
"io.dataease.base.domain.PanelViewExample"
resultMap=
"ResultMapWithBLOBs"
>
select
<if
test=
"distinct"
>
distinct
</if>
<include
refid=
"Base_Column_List"
/>
,
<include
refid=
"Blob_Column_List"
/>
from panel_view
<if
test=
"_parameter != null"
>
<include
refid=
"Example_Where_Clause"
/>
</if>
<if
test=
"orderByClause != null"
>
order by ${orderByClause}
</if>
</select>
<select
id=
"selectByExample"
parameterType=
"io.dataease.base.domain.PanelViewExample"
resultMap=
"BaseResultMap"
>
select
<if
test=
"distinct"
>
distinct
</if>
<include
refid=
"Base_Column_List"
/>
from panel_view
<if
test=
"_parameter != null"
>
<include
refid=
"Example_Where_Clause"
/>
</if>
<if
test=
"orderByClause != null"
>
order by ${orderByClause}
</if>
</select>
<select
id=
"selectByPrimaryKey"
parameterType=
"java.lang.String"
resultMap=
"ResultMapWithBLOBs"
>
select
<include
refid=
"Base_Column_List"
/>
,
<include
refid=
"Blob_Column_List"
/>
from panel_view
where id = #{id,jdbcType=VARCHAR}
</select>
<delete
id=
"deleteByPrimaryKey"
parameterType=
"java.lang.String"
>
delete from panel_view
where id = #{id,jdbcType=VARCHAR}
</delete>
<delete
id=
"deleteByExample"
parameterType=
"io.dataease.base.domain.PanelViewExample"
>
delete from panel_view
<if
test=
"_parameter != null"
>
<include
refid=
"Example_Where_Clause"
/>
</if>
</delete>
<insert
id=
"insert"
parameterType=
"io.dataease.base.domain.PanelView"
>
insert into panel_view (id, panel_id, chart_view_id,
create_by, create_time, update_by,
update_time, content)
values (#{id,jdbcType=VARCHAR}, #{panelId,jdbcType=VARCHAR}, #{chartViewId,jdbcType=VARCHAR},
#{createBy,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT}, #{updateBy,jdbcType=VARCHAR},
#{updateTime,jdbcType=BIGINT}, #{content,jdbcType=LONGVARBINARY})
</insert>
<insert
id=
"insertSelective"
parameterType=
"io.dataease.base.domain.PanelView"
>
insert into panel_view
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"id != null"
>
id,
</if>
<if
test=
"panelId != null"
>
panel_id,
</if>
<if
test=
"chartViewId != null"
>
chart_view_id,
</if>
<if
test=
"createBy != null"
>
create_by,
</if>
<if
test=
"createTime != null"
>
create_time,
</if>
<if
test=
"updateBy != null"
>
update_by,
</if>
<if
test=
"updateTime != null"
>
update_time,
</if>
<if
test=
"content != null"
>
content,
</if>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"id != null"
>
#{id,jdbcType=VARCHAR},
</if>
<if
test=
"panelId != null"
>
#{panelId,jdbcType=VARCHAR},
</if>
<if
test=
"chartViewId != null"
>
#{chartViewId,jdbcType=VARCHAR},
</if>
<if
test=
"createBy != null"
>
#{createBy,jdbcType=VARCHAR},
</if>
<if
test=
"createTime != null"
>
#{createTime,jdbcType=BIGINT},
</if>
<if
test=
"updateBy != null"
>
#{updateBy,jdbcType=VARCHAR},
</if>
<if
test=
"updateTime != null"
>
#{updateTime,jdbcType=BIGINT},
</if>
<if
test=
"content != null"
>
#{content,jdbcType=LONGVARBINARY},
</if>
</trim>
</insert>
<select
id=
"countByExample"
parameterType=
"io.dataease.base.domain.PanelViewExample"
resultType=
"java.lang.Long"
>
select count(*) from panel_view
<if
test=
"_parameter != null"
>
<include
refid=
"Example_Where_Clause"
/>
</if>
</select>
<update
id=
"updateByExampleSelective"
parameterType=
"map"
>
update panel_view
<set>
<if
test=
"record.id != null"
>
id = #{record.id,jdbcType=VARCHAR},
</if>
<if
test=
"record.panelId != null"
>
panel_id = #{record.panelId,jdbcType=VARCHAR},
</if>
<if
test=
"record.chartViewId != null"
>
chart_view_id = #{record.chartViewId,jdbcType=VARCHAR},
</if>
<if
test=
"record.createBy != null"
>
create_by = #{record.createBy,jdbcType=VARCHAR},
</if>
<if
test=
"record.createTime != null"
>
create_time = #{record.createTime,jdbcType=BIGINT},
</if>
<if
test=
"record.updateBy != null"
>
update_by = #{record.updateBy,jdbcType=VARCHAR},
</if>
<if
test=
"record.updateTime != null"
>
update_time = #{record.updateTime,jdbcType=BIGINT},
</if>
<if
test=
"record.content != null"
>
content = #{record.content,jdbcType=LONGVARBINARY},
</if>
</set>
<if
test=
"_parameter != null"
>
<include
refid=
"Update_By_Example_Where_Clause"
/>
</if>
</update>
<update
id=
"updateByExampleWithBLOBs"
parameterType=
"map"
>
update panel_view
set id = #{record.id,jdbcType=VARCHAR},
panel_id = #{record.panelId,jdbcType=VARCHAR},
chart_view_id = #{record.chartViewId,jdbcType=VARCHAR},
create_by = #{record.createBy,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=BIGINT},
update_by = #{record.updateBy,jdbcType=VARCHAR},
update_time = #{record.updateTime,jdbcType=BIGINT},
content = #{record.content,jdbcType=LONGVARBINARY}
<if
test=
"_parameter != null"
>
<include
refid=
"Update_By_Example_Where_Clause"
/>
</if>
</update>
<update
id=
"updateByExample"
parameterType=
"map"
>
update panel_view
set id = #{record.id,jdbcType=VARCHAR},
panel_id = #{record.panelId,jdbcType=VARCHAR},
chart_view_id = #{record.chartViewId,jdbcType=VARCHAR},
create_by = #{record.createBy,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=BIGINT},
update_by = #{record.updateBy,jdbcType=VARCHAR},
update_time = #{record.updateTime,jdbcType=BIGINT}
<if
test=
"_parameter != null"
>
<include
refid=
"Update_By_Example_Where_Clause"
/>
</if>
</update>
<update
id=
"updateByPrimaryKeySelective"
parameterType=
"io.dataease.base.domain.PanelView"
>
update panel_view
<set>
<if
test=
"panelId != null"
>
panel_id = #{panelId,jdbcType=VARCHAR},
</if>
<if
test=
"chartViewId != null"
>
chart_view_id = #{chartViewId,jdbcType=VARCHAR},
</if>
<if
test=
"createBy != null"
>
create_by = #{createBy,jdbcType=VARCHAR},
</if>
<if
test=
"createTime != null"
>
create_time = #{createTime,jdbcType=BIGINT},
</if>
<if
test=
"updateBy != null"
>
update_by = #{updateBy,jdbcType=VARCHAR},
</if>
<if
test=
"updateTime != null"
>
update_time = #{updateTime,jdbcType=BIGINT},
</if>
<if
test=
"content != null"
>
content = #{content,jdbcType=LONGVARBINARY},
</if>
</set>
where id = #{id,jdbcType=VARCHAR}
</update>
<update
id=
"updateByPrimaryKeyWithBLOBs"
parameterType=
"io.dataease.base.domain.PanelView"
>
update panel_view
set panel_id = #{panelId,jdbcType=VARCHAR},
chart_view_id = #{chartViewId,jdbcType=VARCHAR},
create_by = #{createBy,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=BIGINT},
update_by = #{updateBy,jdbcType=VARCHAR},
update_time = #{updateTime,jdbcType=BIGINT},
content = #{content,jdbcType=LONGVARBINARY}
where id = #{id,jdbcType=VARCHAR}
</update>
<update
id=
"updateByPrimaryKey"
parameterType=
"io.dataease.base.domain.PanelView"
>
update panel_view
set panel_id = #{panelId,jdbcType=VARCHAR},
chart_view_id = #{chartViewId,jdbcType=VARCHAR},
create_by = #{createBy,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=BIGINT},
update_by = #{updateBy,jdbcType=VARCHAR},
update_time = #{updateTime,jdbcType=BIGINT}
where id = #{id,jdbcType=VARCHAR}
</update>
</mapper>
\ No newline at end of file
backend/src/main/java/io/dataease/base/mapper/ext/ExtChartViewMapper.java
浏览文件 @
4b11bfeb
...
...
@@ -16,4 +16,6 @@ public interface ExtChartViewMapper {
@Select
(
"select id from chart_view where table_id = #{tableId}"
)
List
<
String
>
allViewIds
(
@Param
(
"tableId"
)
String
tableId
);
String
searchAdviceSceneId
(
@Param
(
"userId"
)
String
userId
,
@Param
(
"panelId"
)
String
panelId
);
}
backend/src/main/java/io/dataease/base/mapper/ext/ExtChartViewMapper.xml
浏览文件 @
4b11bfeb
...
...
@@ -68,4 +68,19 @@
WHERE
id = #{oldChartId}
</insert>
<select
id=
"searchAdviceSceneId"
resultType=
"String"
>
SELECT DISTINCT
( scene_id )
FROM
( SELECT GET_V_AUTH_MODEL_ID_P_USE ( #{userId}, 'chart' ) cids ) t,
panel_view
LEFT JOIN chart_view ON panel_view.chart_view_id = chart_view.id
LEFT JOIN chart_group ON chart_view.scene_id = chart_group.id
WHERE
FIND_IN_SET( chart_view.scene_id, cids ) and panel_view.panel_id =#{panelId}
ORDER BY
chart_group.create_time DESC
LIMIT 1
</select>
</mapper>
backend/src/main/java/io/dataease/base/mapper/ext/ExtPanelViewMapper.java
浏览文件 @
4b11bfeb
package
io
.
dataease
.
base
.
mapper
.
ext
;
import
io.dataease.base.domain.PanelView
;
import
io.dataease.dto.panel.PanelViewDto
;
import
io.dataease.dto.panel.po.PanelViewInsertDTO
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
...
...
@@ -9,4 +12,8 @@ public interface ExtPanelViewMapper {
List
<
PanelViewDto
>
groups
(
String
userId
);
List
<
PanelViewDto
>
views
(
String
userId
);
void
deleteWithPanelId
(
String
panelId
);
void
savePanelView
(
@Param
(
"panelViews"
)
List
<
PanelViewInsertDTO
>
panelViews
);
}
backend/src/main/java/io/dataease/base/mapper/ext/ExtPanelViewMapper.xml
浏览文件 @
4b11bfeb
...
...
@@ -31,6 +31,16 @@
</select>
<delete
id=
"deleteWithPanelId"
>
delete from panel_view where panel_id =#{panelId}
</delete>
<insert
id=
"savePanelView"
>
INSERT INTO `panel_view` (id,chart_view_id, panel_id) VALUES
<foreach
collection=
"panelViews"
item=
"panelView"
index=
"index"
separator=
","
>
(uuid(),#{panelView.chartViewId},#{panelView.panelId})
</foreach>
</insert>
...
...
backend/src/main/java/io/dataease/controller/chart/ChartViewController.java
浏览文件 @
4b11bfeb
...
...
@@ -60,4 +60,9 @@ public class ChartViewController {
public
String
chartCopy
(
@PathVariable
String
id
)
{
return
chartViewService
.
chartCopy
(
id
);
}
@GetMapping
(
"searchAdviceSceneId/{panelId}"
)
public
String
searchAdviceSceneId
(
@PathVariable
String
panelId
){
return
chartViewService
.
searchAdviceSceneId
(
panelId
);
}
}
backend/src/main/java/io/dataease/dto/panel/po/PanelViewInsertDTO.java
0 → 100644
浏览文件 @
4b11bfeb
package
io
.
dataease
.
dto
.
panel
.
po
;
import
io.dataease.base.domain.PanelView
;
/**
* Author: wangjiahao
* Date: 2021-07-06
* Description:
*/
public
class
PanelViewInsertDTO
extends
PanelView
{
public
PanelViewInsertDTO
()
{
}
public
PanelViewInsertDTO
(
String
chartViewId
,
String
panelGroupId
)
{
super
();
super
.
setChartViewId
(
chartViewId
);
super
.
setPanelId
(
panelGroupId
);
}
}
backend/src/main/java/io/dataease/service/chart/ChartViewService.java
浏览文件 @
4b11bfeb
...
...
@@ -382,4 +382,8 @@ public class ChartViewService {
extChartViewMapper
.
chartCopy
(
newChartId
,
id
);
return
newChartId
;
}
public
String
searchAdviceSceneId
(
String
panelId
){
return
extChartViewMapper
.
searchAdviceSceneId
(
AuthUtils
.
getUser
().
getUserId
().
toString
(),
panelId
);
}
}
backend/src/main/java/io/dataease/service/panel/PanelGroupService.java
浏览文件 @
4b11bfeb
...
...
@@ -53,6 +53,8 @@ public class PanelGroupService {
private
PanelLinkService
panelLinkService
;
@Resource
private
SysAuthService
sysAuthService
;
@Resource
private
PanelViewService
panelViewService
;
public
List
<
PanelGroupDTO
>
tree
(
PanelGroupRequest
panelGroupRequest
)
{
String
userId
=
String
.
valueOf
(
AuthUtils
.
getUser
().
getUserId
());
...
...
@@ -72,6 +74,12 @@ public class PanelGroupService {
@Transactional
public
PanelGroup
saveOrUpdate
(
PanelGroupRequest
request
)
{
try
{
panelViewService
.
syncPanelViews
(
request
);
}
catch
(
Exception
e
){
e
.
printStackTrace
();
LOGGER
.
error
(
"更新panelView出错panelId:{}"
,
request
.
getId
());
}
String
panelId
=
request
.
getId
();
if
(
StringUtils
.
isEmpty
(
panelId
))
{
// 新建
...
...
@@ -163,4 +171,5 @@ public class PanelGroupService {
});
return
chartViewDTOList
;
}
}
backend/src/main/java/io/dataease/service/panel/PanelViewService.java
浏览文件 @
4b11bfeb
package
io
.
dataease
.
service
.
panel
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
io.dataease.base.domain.PanelGroup
;
import
io.dataease.base.domain.PanelGroupWithBLOBs
;
import
io.dataease.base.mapper.PanelViewMapper
;
import
io.dataease.base.mapper.ext.ExtPanelViewMapper
;
import
io.dataease.commons.utils.AuthUtils
;
import
io.dataease.commons.utils.BeanUtils
;
import
io.dataease.dto.panel.PanelViewDto
;
import
io.dataease.dto.panel.po.PanelViewInsertDTO
;
import
io.dataease.dto.panel.po.PanelViewPo
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang3.ObjectUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Propagation
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.util.Assert
;
import
javax.annotation.Resource
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -22,6 +34,7 @@ public class PanelViewService {
@Autowired
(
required
=
false
)
private
ExtPanelViewMapper
extPanelViewMapper
;
private
final
static
String
SCENE_TYPE
=
"scene"
;
public
List
<
PanelViewDto
>
groups
(){
...
...
@@ -63,4 +76,25 @@ public class PanelViewService {
// 最后 没有孩子的老东西淘汰
return
roots
.
stream
().
filter
(
item
->
CollectionUtils
.
isNotEmpty
(
item
.
getChildren
())).
collect
(
Collectors
.
toList
());
}
@Transactional
(
propagation
=
Propagation
.
REQUIRES_NEW
)
public
void
syncPanelViews
(
PanelGroupWithBLOBs
panelGroup
){
String
panelId
=
panelGroup
.
getId
();
Assert
.
notNull
(
panelId
,
"panelId cannot be null"
);
String
panelData
=
panelGroup
.
getPanelData
();
if
(
StringUtils
.
isNotEmpty
(
panelData
)){
JSONArray
dataArray
=
JSON
.
parseArray
(
panelData
);
List
<
PanelViewInsertDTO
>
panelViewInsertDTOList
=
new
ArrayList
<>();
for
(
int
i
=
0
;
i
<
dataArray
.
size
();
i
++){
JSONObject
jsonObject
=
dataArray
.
getJSONObject
(
i
);
if
(
"view"
.
equals
(
jsonObject
.
getString
(
"type"
))){
panelViewInsertDTOList
.
add
(
new
PanelViewInsertDTO
(
jsonObject
.
getJSONObject
(
"propValue"
).
getString
(
"viewId"
),
panelId
));
}
}
extPanelViewMapper
.
deleteWithPanelId
(
panelId
);
if
(
CollectionUtils
.
isNotEmpty
(
panelViewInsertDTOList
)){
extPanelViewMapper
.
savePanelView
(
panelViewInsertDTOList
);
}
}
}
}
backend/src/main/resources/db/migration/V11__panel_view.sql
0 → 100644
浏览文件 @
4b11bfeb
DROP
TABLE
IF
EXISTS
`panel_view`
;
CREATE
TABLE
`panel_view`
(
`id`
varchar
(
50
)
NOT
NULL
,
`panel_id`
varchar
(
50
)
DEFAULT
NULL
COMMENT
'panel_id'
,
`chart_view_id`
varchar
(
50
)
DEFAULT
NULL
COMMENT
'chart_view_id'
,
`content`
blob
COMMENT
'内容'
,
`create_by`
varchar
(
255
)
DEFAULT
NULL
COMMENT
'创建人'
,
`create_time`
bigint
(
13
)
DEFAULT
NULL
COMMENT
'创建时间'
,
`update_by`
varchar
(
255
)
DEFAULT
NULL
COMMENT
'更新人'
,
`update_time`
bigint
(
13
)
DEFAULT
NULL
COMMENT
'更新时间'
,
PRIMARY
KEY
(
`id`
)
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8
;
backend/src/main/resources/generatorConfig.xml
浏览文件 @
4b11bfeb
...
...
@@ -74,7 +74,7 @@
<!-- </table>-->
<!-- <table tableName="v_dataset"/>-->
<!-- <table tableName="sys_auth_detail"/>-->
<table
tableName=
"
dataset_table
"
/>
<table
tableName=
"
panel_view
"
/>
</context>
...
...
frontend/src/api/chart/chart.js
浏览文件 @
4b11bfeb
...
...
@@ -35,3 +35,19 @@ export function chartCopy(id) {
loading
:
true
})
}
export
function
chartGroupTree
(
data
)
{
return
request
({
url
:
'/chart/group/tree'
,
method
:
'post'
,
loading
:
true
,
data
})
}
export
function
searchAdviceSceneId
(
panelId
)
{
return
request
({
url
:
'/chart/view/searchAdviceSceneId/'
+
panelId
,
method
:
'get'
,
loading
:
true
})
}
frontend/src/components/canvas/components/Editor/ContextMenu.vue
浏览文件 @
4b11bfeb
...
...
@@ -51,7 +51,7 @@ export default {
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
}})
bus
.
$emit
(
'PanelSwitchComponent'
,
{
name
:
'ChartEdit'
,
param
:
{
'id'
:
this
.
curComponent
.
propValue
.
viewId
,
'optType'
:
'edit'
}})
}
if
(
this
.
curComponent
.
type
===
'custom'
)
{
bus
.
$emit
(
'component-dialog-edit'
)
...
...
frontend/src/lang/en.js
浏览文件 @
4b11bfeb
...
...
@@ -666,6 +666,8 @@ export default {
area_mode
:
'Area'
,
rose_radius
:
'Fillet'
,
view_name
:
'Chart Title'
,
belong_group
:
'Belong Group'
,
select_group
:
'Select Group'
,
name_can_not_empty
:
'Name cannot be empty'
,
template_can_not_empty
:
'Please check a Template'
,
custom_count
:
'Number of records'
,
...
...
frontend/src/lang/tw.js
浏览文件 @
4b11bfeb
...
...
@@ -708,6 +708,8 @@ export default {
area_mode
:
'面積'
,
rose_radius
:
'園角'
,
view_name
:
'視圖標題'
,
belong_group
:
'所属分组'
,
select_group
:
'选择分组'
,
name_can_not_empty
:
'名稱不能為空'
,
template_can_not_empty
:
'請選擇儀表板'
,
custom_count
:
'記錄數'
,
...
...
frontend/src/lang/zh.js
浏览文件 @
4b11bfeb
...
...
@@ -666,6 +666,8 @@ export default {
area_mode
:
'面积'
,
rose_radius
:
'圆角'
,
view_name
:
'视图标题'
,
belong_group
:
'所属分组'
,
select_group
:
'选择分组'
,
name_can_not_empty
:
'名称不能为空'
,
template_can_not_empty
:
'请选择仪表版'
,
custom_count
:
'记录数'
,
...
...
frontend/src/views/chart/group/Group.vue
浏览文件 @
4b11bfeb
...
...
@@ -290,17 +290,29 @@
class=
"dialog-css"
:destroy-on-close=
"true"
>
<el-row
style=
"width:
4
00px;"
>
<el-row
style=
"width:
8
00px;"
>
<el-form
ref=
"form"
:model=
"table"
label-width=
"80px"
size=
"mini"
class=
"form-item"
>
<el-form-item
:label=
"$t('chart.view_name')"
>
<el-input
v-model=
"chartName"
size=
"mini"
/>
</el-form-item>
<el-col
:span=
"12"
>
<el-form-item
:label=
"$t('chart.view_name')"
>
<el-input
v-model=
"chartName"
style=
"height: 34px"
size=
"mini"
/>
</el-form-item>
</el-col>
<el-col
:span=
"12"
v-if=
"optFrom==='panel'"
>
<el-form-item
:label=
"$t('chart.belong_group')"
>
<treeselect
v-model=
"currGroup.id"
:options=
"chartGroupTreeAvailable"
:normalizer=
"normalizer"
:placeholder=
"$t('chart.select_group')"
/>
</el-form-item>
</el-col>
</el-form>
</el-row>
<table-selector
@
getTable=
"getTable"
/>
<div
slot=
"footer"
class=
"dialog-footer"
>
<el-button
size=
"mini"
@
click=
"closeCreateChart"
>
{{
$t
(
'chart.cancel'
)
}}
</el-button>
<el-button
type=
"primary"
size=
"mini"
:disabled=
"!table.id"
@
click=
"createChart"
>
{{
$t
(
'chart.confirm'
)
}}
</el-button>
<el-button
type=
"primary"
size=
"mini"
:disabled=
"!table.id
|| !currGroup.id
"
@
click=
"createChart"
>
{{
$t
(
'chart.confirm'
)
}}
</el-button>
</div>
</el-dialog>
...
...
@@ -327,7 +339,7 @@
</
template
>
<
script
>
import
{
post
}
from
'@/api/chart/chart'
import
{
post
,
chartGroupTree
}
from
'@/api/chart/chart'
import
{
authModel
}
from
'@/api/system/sysAuth'
import
TableSelector
from
'../view/TableSelector'
import
GroupMoveSelector
from
'../components/TreeSelector/GroupMoveSelector'
...
...
@@ -352,6 +364,17 @@ export default {
type
:
Object
,
required
:
false
,
default
:
null
},
// 操作来源 'panel' 为仪表板
optFrom
:
{
type
:
String
,
required
:
false
,
default
:
null
},
adviceGroupId
:
{
type
:
String
,
required
:
false
,
default
:
null
}
},
data
()
{
...
...
@@ -415,7 +438,8 @@ export default {
groupMoveConfirmDisabled
:
true
,
dsMoveConfirmDisabled
:
true
,
moveDialogTitle
:
''
,
isTreeSearch
:
false
isTreeSearch
:
false
,
chartGroupTreeAvailable
:
[]
}
},
computed
:
{
...
...
@@ -443,12 +467,19 @@ export default {
},
saveStatus
()
{
this
.
refreshNodeBy
(
this
.
saveStatus
.
sceneId
)
},
adviceGroupId
()
{
// 仪表板新建视图建议的存放路径
if
(
this
.
optFrom
===
'panel'
)
{
this
.
currGroup
[
'id'
]
=
this
.
adviceGroupId
}
}
},
mounted
()
{
this
.
treeNode
(
this
.
groupForm
)
this
.
refresh
()
// this.chartTree()
this
.
getChartGroupTree
()
},
methods
:
{
clickAdd
(
param
)
{
...
...
@@ -758,10 +789,14 @@ export default {
this
.
$store
.
dispatch
(
'chart/setTableId'
,
null
)
this
.
$store
.
dispatch
(
'chart/setTableId'
,
this
.
table
.
id
)
// this.$router.push('/chart/chart-edit')
this
.
$emit
(
'switchComponent'
,
{
name
:
'ChartEdit'
,
param
:
{
'id'
:
response
.
data
.
id
}})
// this.$store.dispatch('chart/setViewId', response.data.id)
// this.chartTree()
this
.
refreshNodeBy
(
view
.
sceneId
)
if
(
this
.
optFrom
===
'panel'
)
{
this
.
$emit
(
'newViewInfo'
,
{
'id'
:
response
.
data
.
id
})
}
else
{
this
.
$emit
(
'switchComponent'
,
{
name
:
'ChartEdit'
,
param
:
{
'id'
:
response
.
data
.
id
}})
// this.$store.dispatch('chart/setViewId', response.data.id)
// this.chartTree()
this
.
refreshNodeBy
(
view
.
sceneId
)
}
})
},
...
...
@@ -951,6 +986,18 @@ export default {
this
.
isTreeSearch
=
false
this
.
treeNode
(
this
.
groupForm
)
}
},
getChartGroupTree
()
{
chartGroupTree
({}).
then
(
res
=>
{
this
.
chartGroupTreeAvailable
=
res
.
data
})
},
normalizer
(
node
)
{
// 去掉children=null的属性
if
(
node
.
children
===
null
||
node
.
children
===
'null'
)
{
delete
node
.
children
}
}
}
}
...
...
@@ -1045,4 +1092,11 @@ export default {
height
:
100%
;
overflow-y
:
auto
;
}
/
deep
/
.vue-treeselect__control
{
height
:
28px
;
}
/
deep
/
.vue-treeselect__single-value
{
color
:
#606266
;
line-height
:
28px
!important
;
}
</
style
>
frontend/src/views/chart/view/ChartEdit.vue
浏览文件 @
4b11bfeb
...
...
@@ -467,7 +467,11 @@ export default {
},
watch
:
{
'param'
:
function
()
{
this
.
getData
(
this
.
param
.
id
)
if
(
this
.
param
.
optType
===
'new'
){
}
else
{
this
.
getData
(
this
.
param
.
id
)
}
}
},
created
()
{
...
...
frontend/src/views/panel/ViewSelect/index.vue
浏览文件 @
4b11bfeb
...
...
@@ -2,13 +2,19 @@
<el-col
v-loading=
"loading"
>
<el-row
style=
"margin-top: 5px"
>
<el-row
style=
"margin-left: 5px;margin-right: 5px"
>
<el-input
v-model=
"templateFilterText"
:placeholder=
"$t('panel.filter_keywords')"
size=
"mini"
clearable
prefix-icon=
"el-icon-search"
/>
<el-col
:span=
"16"
>
<el-input
v-model=
"templateFilterText"
:placeholder=
"$t('panel.filter_keywords')"
size=
"mini"
clearable
prefix-icon=
"el-icon-search"
/>
</el-col>
<el-col
:span=
"7"
>
<el-button
type=
"primary"
size=
"mini"
style=
"float: right"
@
click=
"newChart"
>
新建
</el-button>
</el-col>
</el-row>
<el-row
style=
"margin-top: 5px"
>
<el-tree
...
...
@@ -117,6 +123,9 @@ export default {
},
allowDrop
(
draggingNode
,
dropNode
,
type
)
{
return
false
},
newChart
()
{
this
.
$emit
(
'newChart'
)
}
}
...
...
frontend/src/views/panel/edit/index.vue
浏览文件 @
4b11bfeb
...
...
@@ -9,6 +9,7 @@
<!--横向工具栏-->
<el-col
:span=
"16"
>
<Toolbar
ref=
"toolbar"
:style-button-active=
"show&&showIndex===2"
:aided-button-active=
"aidedButtonActive"
@
showPanel=
"showPanel"
...
...
@@ -87,7 +88,7 @@
:close-on-press-escape=
"false"
:modal-append-to-body=
"true"
>
<view-select
v-show=
" show && showIndex===0"
/>
<view-select
v-show=
" show && showIndex===0"
@
newChart=
"newChart"
/>
<filter-group
v-show=
" show &&showIndex===1"
/>
<subject-setting
v-show=
" show &&showIndex===2"
/>
<assist-component
v-show=
" show &&showIndex===3"
/>
...
...
@@ -160,6 +161,15 @@
<RectangleAttr
v-if=
"curComponent&&curComponent.type==='rect-shape'"
/>
<TextAttr
v-if=
"curComponent&&curComponent.type==='v-text'"
/>
<!--复用ChartGroup组件 不做显示-->
<ChartGroup
ref=
"chartGroup"
:opt-from=
"'panel'"
:advice-group-id=
"adviceGroupId"
style=
"height: 0px;width:0px;overflow: hidden"
@
newViewInfo=
"newViewInfo"
/>
</el-row>
</
template
>
...
...
@@ -187,6 +197,8 @@ import AttrListExtend from '@/components/canvas/components/AttrListExtend'
import
elementResizeDetectorMaker
from
'element-resize-detector'
import
AssistComponent
from
'@/views/panel/AssistComponent'
import
PanelTextEditor
from
'@/components/canvas/custom-component/PanelTextEditor'
import
ChartGroup
from
'@/views/chart/group/Group'
import
{
searchAdviceSceneId
}
from
'@/api/chart/chart'
// 引入样式
import
'@/components/canvas/assets/iconfont/iconfont.css'
...
...
@@ -220,7 +232,8 @@ export default {
AssistComponent
,
PanelTextEditor
,
RectangleAttr
,
TextAttr
TextAttr
,
ChartGroup
},
data
()
{
return
{
...
...
@@ -255,7 +268,8 @@ export default {
},
beforeDialogValue
:
[],
styleDialogVisible
:
false
,
currentDropElement
:
null
currentDropElement
:
null
,
adviceGroupId
:
null
}
},
...
...
@@ -605,6 +619,49 @@ export default {
}
else
{
return
y
}
},
newChart
()
{
this
.
adviceGroupId
=
null
this
.
show
=
false
searchAdviceSceneId
(
this
.
panelInfo
.
id
).
then
(
res
=>
{
this
.
adviceGroupId
=
res
.
data
this
.
$refs
[
'chartGroup'
].
selectTable
()
})
},
newViewInfo
(
newViewInfo
)
{
debugger
let
component
const
newComponentId
=
uuid
.
v1
()
// 用户视图设置 复制一个模板
componentList
.
forEach
(
componentTemp
=>
{
if
(
componentTemp
.
type
===
'view'
)
{
component
=
deepCopy
(
componentTemp
)
const
propValue
=
{
id
:
newComponentId
,
viewId
:
newViewInfo
.
id
}
component
.
propValue
=
propValue
component
.
filters
=
[]
}
})
// position = absolution 或导致有偏移 这里中和一下偏移量
component
.
style
.
top
=
0
component
.
style
.
left
=
600
component
.
id
=
newComponentId
this
.
$store
.
commit
(
'addComponent'
,
{
component
})
this
.
$store
.
commit
(
'recordSnapshot'
)
this
.
clearCurrentInfo
()
this
.
$store
.
commit
(
'setCurComponent'
,
{
component
:
component
,
index
:
this
.
componentData
.
length
-
1
})
// 编辑时临时保存 当前修改的画布
this
.
$store
.
dispatch
(
'panel/setComponentDataTemp'
,
JSON
.
stringify
(
this
.
componentData
))
this
.
$store
.
dispatch
(
'panel/setCanvasStyleDataTemp'
,
JSON
.
stringify
(
this
.
canvasStyleData
))
if
(
this
.
curComponent
.
type
===
'view'
)
{
this
.
$store
.
dispatch
(
'chart/setViewId'
,
null
)
this
.
$store
.
dispatch
(
'chart/setViewId'
,
this
.
curComponent
.
propValue
.
viewId
)
bus
.
$emit
(
'PanelSwitchComponent'
,
{
name
:
'ChartEdit'
,
param
:
{
'id'
:
this
.
curComponent
.
propValue
.
viewId
,
'optType'
:
'edit'
}})
}
}
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论