Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
dataease
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
njgzx
dataease
Commits
3fd9defe
Unverified
提交
3fd9defe
authored
7月 06, 2021
作者:
王嘉豪
提交者:
GitHub
7月 06, 2021
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #166 from dataease/pr@dev@panel
Pr@dev@panel
上级
083435a8
c05e4b84
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
24 个修改的文件
包含
353 行增加
和
25 行删除
+353
-25
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
+0
-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
+0
-0
ExtChartViewMapper.java
.../java/io/dataease/base/mapper/ext/ExtChartViewMapper.java
+2
-0
ExtChartViewMapper.xml
...n/java/io/dataease/base/mapper/ext/ExtChartViewMapper.xml
+16
-1
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
浏览文件 @
3fd9defe
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
浏览文件 @
3fd9defe
差异被折叠。
点击展开。
backend/src/main/java/io/dataease/base/mapper/PanelViewMapper.java
0 → 100644
浏览文件 @
3fd9defe
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
浏览文件 @
3fd9defe
差异被折叠。
点击展开。
backend/src/main/java/io/dataease/base/mapper/ext/ExtChartViewMapper.java
浏览文件 @
3fd9defe
...
...
@@ -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
浏览文件 @
3fd9defe
...
...
@@ -52,7 +52,7 @@
`scene_id`,
`table_id`,
`type`,
`title`
,
GET_CHART_VIEW_COPY_NAME ( #{oldChartId} )
,
`x_axis`,
`y_axis`,
`custom_attr`,
...
...
@@ -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
浏览文件 @
3fd9defe
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
浏览文件 @
3fd9defe
...
...
@@ -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
浏览文件 @
3fd9defe
...
...
@@ -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
浏览文件 @
3fd9defe
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
浏览文件 @
3fd9defe
...
...
@@ -405,4 +405,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
浏览文件 @
3fd9defe
...
...
@@ -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
浏览文件 @
3fd9defe
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
浏览文件 @
3fd9defe
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
浏览文件 @
3fd9defe
...
...
@@ -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
浏览文件 @
3fd9defe
...
...
@@ -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
浏览文件 @
3fd9defe
...
...
@@ -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
浏览文件 @
3fd9defe
...
...
@@ -708,6 +708,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
浏览文件 @
3fd9defe
...
...
@@ -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
浏览文件 @
3fd9defe
...
...
@@ -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/views/chart/group/Group.vue
浏览文件 @
3fd9defe
...
...
@@ -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'
...
...
@@ -353,6 +365,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
()
{
...
...
@@ -416,7 +439,8 @@ export default {
groupMoveConfirmDisabled
:
true
,
dsMoveConfirmDisabled
:
true
,
moveDialogTitle
:
''
,
isTreeSearch
:
false
isTreeSearch
:
false
,
chartGroupTreeAvailable
:
[]
}
},
computed
:
{
...
...
@@ -444,12 +468,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
)
{
...
...
@@ -760,10 +791,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
)
}
})
},
...
...
@@ -953,6 +988,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
}
}
}
}
...
...
@@ -1047,4 +1094,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
浏览文件 @
3fd9defe
...
...
@@ -497,7 +497,11 @@ export default {
},
watch
:
{
'param'
:
function
()
{
this
.
getData
(
this
.
param
.
id
)
if
(
this
.
param
.
optType
===
'new'
){
}
else
{
this
.
getData
(
this
.
param
.
id
)
}
},
searchField
(
val
)
{
this
.
fieldFilter
(
val
)
...
...
frontend/src/views/panel/ViewSelect/index.vue
浏览文件 @
3fd9defe
...
...
@@ -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
浏览文件 @
3fd9defe
...
...
@@ -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
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论