Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
dataease
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
zhu
dataease
Commits
c87a6f13
提交
c87a6f13
authored
4月 01, 2021
作者:
wangjiahao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat:仪表盘预览
上级
79d37827
隐藏空白字符变更
内嵌
并排
正在显示
8 个修改的文件
包含
45 行增加
和
62 行删除
+45
-62
Preview.vue
frontend/src/components/canvas/components/Editor/Preview.vue
+4
-24
Toolbar.vue
frontend/src/components/canvas/components/Toolbar.vue
+1
-1
UserView.vue
frontend/src/components/canvas/custom-component/UserView.vue
+3
-7
ChartComponent.vue
frontend/src/views/chart/components/ChartComponent.vue
+12
-7
index.vue
frontend/src/views/panel/edit/index.vue
+0
-7
index.vue
frontend/src/views/panel/index.vue
+0
-1
PanelList.vue
frontend/src/views/panel/list/PanelList.vue
+18
-6
PanelViewShow.vue
frontend/src/views/panel/list/PanelViewShow.vue
+7
-9
没有找到文件。
frontend/src/components/canvas/components/Editor/Preview.vue
浏览文件 @
c87a6f13
<
template
>
<div
v-if=
"show"
class=
"bg"
>
<el-button
class=
"close"
@
click=
"close"
>
关闭
</el-button>
<div
class=
"bg"
>
<div
class=
"canvas-container"
>
<div
class=
"canvas"
...
...
@@ -57,33 +56,14 @@ export default {
.bg
{
width
:
100%
;
height
:
100%
;
top
:
0
;
left
:
0
;
position
:
fixed
;
background
:
rgb
(
0
,
0
,
0
,
.5
);
z-index
:
10
;
display
:
flex
;
align-items
:
center
;
justify-content
:
center
;
overflow
:
auto
;
padding
:
20px
;
.canvas-container
{
width
:
calc
(
100%
-
40px
)
;
height
:
calc
(
100%
-
120px
)
;
width
:
100%
;
height
:
100%
;
overflow
:
auto
;
.canvas
{
background
:
#fff
;
.canvas
{
position
:
relative
;
margin
:
auto
;
}
}
.close
{
position
:
absolute
;
right
:
20px
;
top
:
100px
;
}
}
</
style
>
frontend/src/components/canvas/components/Toolbar.vue
浏览文件 @
c87a6f13
...
...
@@ -34,7 +34,7 @@
</div>
<!-- 预览 -->
<Preview
v-model=
"isShowPreview"
@
change=
"handlePreviewChange"
/
>
<!--
<Preview
v-model=
"isShowPreview"
@
change=
"handlePreviewChange"
/>
--
>
</div>
</
template
>
...
...
frontend/src/components/canvas/custom-component/UserView.vue
浏览文件 @
c87a6f13
<
template
>
<div
class=
"rect-shape"
>
<chart-component
:ref=
"element.propValue.id"
class=
"chart-class"
:chart
-id=
"element.propValue.id"
:chart
=
"chart"
/>
<chart-component
:ref=
"element.propValue.id"
class=
"chart-class"
:chart=
"chart"
/>
</div>
</
template
>
...
...
@@ -8,6 +8,7 @@
import
{
post
}
from
'@/api/panel/panel'
import
ChartComponent
from
'@/views/chart/components/ChartComponent.vue'
export
default
{
name
:
'UserView'
,
components
:
{
ChartComponent
},
...
...
@@ -22,12 +23,7 @@ export default {
}
},
created
()
{
const
id
=
this
.
element
.
propValue
.
viewId
debugger
this
.
$nextTick
(()
=>
{
// 获取eChar数据
this
.
getData
(
id
)
})
this
.
getData
(
this
.
element
.
propValue
.
viewId
)
},
mounted
()
{
...
...
frontend/src/views/chart/components/ChartComponent.vue
浏览文件 @
c87a6f13
...
...
@@ -12,6 +12,7 @@ import { basePieOption } from '../chart/pie/pie'
import
{
baseFunnelOption
}
from
'../chart/funnel/funnel'
import
{
baseRadarOption
}
from
'../chart/radar/radar'
import
eventBus
from
'@/components/canvas/utils/eventBus'
import
{
uuid
}
from
'vue-uuid'
export
default
{
name
:
'ChartComponent'
,
...
...
@@ -19,15 +20,12 @@ export default {
chart
:
{
type
:
Object
,
required
:
true
},
chartId
:
{
type
:
String
,
required
:
false
}
},
data
()
{
return
{
myChart
:
{}
myChart
:
{},
chartId
:
uuid
.
v1
()
}
},
watch
:
{
...
...
@@ -41,8 +39,15 @@ export default {
mounted
()
{
// 基于准备好的dom,初始化echarts实例
console
.
log
(
'chartId:'
+
this
.
chartId
)
this
.
myChart
=
this
.
$echarts
.
init
(
document
.
getElementById
(
this
.
chartId
))
this
.
drawEcharts
()
// 渲染echart等待dom加载完毕,渲染之前先尝试销毁具有相同id的echart 放置多次切换仪表盘有重复id情况
new
Promise
((
resolve
)
=>
{
resolve
()
}).
then
(()
=>
{
// 此dom为echarts图标展示dom
this
.
myChart
=
this
.
$echarts
.
getInstanceByDom
(
document
.
getElementById
(
this
.
chartId
))
if
(
!
this
.
myChart
)
{
this
.
myChart
=
this
.
$echarts
.
init
(
document
.
getElementById
(
this
.
chartId
))
}
this
.
drawEcharts
()
})
// 监听元素变动事件
eventBus
.
$on
(
'resizing'
,
(
componentId
)
=>
{
...
...
frontend/src/views/panel/edit/index.vue
浏览文件 @
c87a6f13
...
...
@@ -199,12 +199,6 @@ export default {
body
.
insertBefore
(
elx
,
body
.
firstChild
)
})
},
saveDrawing
()
{
bus
.
$emit
(
'panel-drawing-save'
)
},
preViewShow
()
{
bus
.
$emit
(
'panel-drawing-preview'
)
},
// 画布
restore
()
{
...
...
@@ -230,7 +224,6 @@ export default {
e
.
stopPropagation
()
let
component
const
newComponentId
=
uuid
.
v1
()
console
.
log
(
'handleDrop123'
)
const
componentInfo
=
JSON
.
parse
(
e
.
dataTransfer
.
getData
(
'componentInfo'
))
// 用户视图设置 复制一个模板
...
...
frontend/src/views/panel/index.vue
浏览文件 @
c87a6f13
...
...
@@ -21,7 +21,6 @@
</de-aside-container>
<de-main-container>
<!--
<router-view/>
-->
<component
:is=
"component"
:param=
"param"
/>
</de-main-container>
</de-container>
...
...
frontend/src/views/panel/list/PanelList.vue
浏览文件 @
c87a6f13
...
...
@@ -123,10 +123,6 @@
custom-class=
"de-dialog"
>
<grant-auth
v-if=
"authVisible"
:resource-id=
"authResourceId"
@
close-grant=
"closeGrant"
/>
<!--
<span
slot=
"footer"
class=
"dialog-footer"
>
<el-button
@
click=
"authVisible = false"
>
取 消
</el-button>
<el-button
type=
"primary"
@
click=
"authVisible = false"
>
确 定
</el-button>
</span>
-->
</el-dialog>
<el-dialog
...
...
@@ -147,6 +143,8 @@
<
script
>
import
GrantAuth
from
'../GrantAuth'
import
LinkGenerate
from
'@/views/link/generate'
import
{
uuid
}
from
'vue-uuid'
import
bus
from
'@/utils/bus'
import
{
loadTable
,
getScene
,
addGroup
,
delGroup
,
addTable
,
delTable
,
groupTree
,
defaultTree
,
get
}
from
'@/api/panel/panel'
export
default
{
...
...
@@ -236,7 +234,6 @@ export default {
this
.
groupForm
=
JSON
.
parse
(
JSON
.
stringify
(
param
.
data
))
break
case
'move'
:
break
case
'delete'
:
this
.
delete
(
param
.
data
)
...
...
@@ -421,7 +418,15 @@ export default {
nodeClick
(
data
,
node
)
{
if
(
data
.
nodeType
===
'panel'
)
{
this
.
currGroup
=
data
// this.$store.dispatch('panel/setPanelInfo', data)
// 加载视图数据
this
.
$nextTick
(()
=>
{
localStorage
.
setItem
(
'canvasData'
,
null
)
localStorage
.
setItem
(
'canvasStyle'
,
null
)
get
(
'panel/group/findOne/'
+
data
.
id
).
then
(
response
=>
{
this
.
$store
.
commit
(
'setComponentData'
,
this
.
resetID
(
JSON
.
parse
(
response
.
data
.
panelData
)))
this
.
$store
.
commit
(
'setCanvasStyle'
,
JSON
.
parse
(
response
.
data
.
panelStyle
))
})
})
}
if
(
node
.
expanded
)
{
this
.
expandedArray
.
push
(
data
.
id
)
...
...
@@ -523,6 +528,13 @@ export default {
removeLink
()
{
this
.
linkVisible
=
false
this
.
linkResourceId
=
null
},
resetID
(
data
)
{
data
.
forEach
(
item
=>
{
item
.
id
=
uuid
.
v1
()
})
return
data
}
}
}
...
...
frontend/src/views/panel/list/PanelViewShow.vue
浏览文件 @
c87a6f13
...
...
@@ -10,18 +10,19 @@
</span>
<span
style=
"float: right;line-height: 40px;"
>
<el-tooltip
content=
"预览"
>
<el-button
class=
"el-icon-view"
size=
"mini"
circle
@
click=
"preViewShow"
/>
<el-button
class=
"el-icon-view"
size=
"mini"
circle
/>
</el-tooltip>
</span>
</el-row>
<!--TODO 仪表盘预览区域-->
<!--
<Preview
/>
-->
<section>
<Preview
/>
</section>
</el-col>
</el-row>
</el-row>
</
template
>
<
script
>
import
bus
from
'@/utils/bus'
import
Preview
from
'@/components/canvas/components/Editor/Preview'
export
default
{
...
...
@@ -36,15 +37,12 @@ export default {
panelInfo
()
{
return
this
.
$store
.
state
.
panel
.
panelInfo
}
},
mounted
()
{
},
methods
:
{
preViewShow
()
{
bus
.
$emit
(
'panel-drawing-preview'
)
},
savePanel
()
{
bus
.
$emit
(
'panel-drawing-save'
)
}
}
}
</
script
>
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论