Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
dataease
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
zhu
dataease
Commits
1e21d681
提交
1e21d681
authored
3月 23, 2021
作者:
fit2cloud-chenyw
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat: 仪表板编辑
上级
1c6b6336
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
60 行增加
和
137 行删除
+60
-137
bus.js
frontend/src/utils/bus.js
+3
-0
index.vue
frontend/src/views/panel/DrawingBoard/index.vue
+23
-21
index.vue
frontend/src/views/panel/ViewSelect/index.vue
+10
-1
index.vue
frontend/src/views/panel/edit/index.vue
+8
-0
PanelList.vue
frontend/src/views/panel/list/PanelList.vue
+1
-0
PanelViewShow.vue
frontend/src/views/panel/list/PanelViewShow.vue
+15
-115
没有找到文件。
frontend/src/utils/bus.js
0 → 100644
浏览文件 @
1e21d681
import
Vue
from
'vue'
const
bus
=
new
Vue
()
export
default
bus
frontend/src/views/panel/DrawingBoard/index.vue
浏览文件 @
1e21d681
...
@@ -2,15 +2,15 @@
...
@@ -2,15 +2,15 @@
<el-row
class=
"panel-design-show"
>
<el-row
class=
"panel-design-show"
>
<div
class=
"container"
:style=
"panelDetails.gridStyle"
>
<div
class=
"container"
:style=
"panelDetails.gridStyle"
>
<vue-drag-resize-rotate
<vue-drag-resize-rotate
v-for=
"
panelDesign
in panelDetails.panelDesigns"
v-for=
"
item
in panelDetails.panelDesigns"
v-show=
"
panelDesign
.keepFlag"
v-show=
"
item
.keepFlag"
:key=
"
panelDesign
.id"
:key=
"
item
.id"
:panel-design=
"
panelDesign
"
:panel-design=
"
item
"
:parent=
"true"
:parent=
"true"
@
newStyle=
"newStyle"
@
newStyle=
"newStyle"
>
>
<!--视图显示 panelDesign.componentType==='view'-->
<!--视图显示 panelDesign.componentType==='view'-->
<chart-component
v-if=
"
panelDesign.componentType==='view'"
:ref=
"panelDesign.id"
:chart-id=
"panelDesign.id"
:chart=
"panelDesign
.chartView"
/>
<chart-component
v-if=
"
item.componentType==='view'"
:ref=
"item.id"
:chart-id=
"item.id"
:chart=
"item
.chartView"
/>
<!--组件显示(待开发)-->
<!--组件显示(待开发)-->
...
@@ -24,9 +24,9 @@ import { post, get } from '@/api/panel/panel'
...
@@ -24,9 +24,9 @@ import { post, get } from '@/api/panel/panel'
import
ChartComponent
from
'@/views/chart/components/ChartComponent'
import
ChartComponent
from
'@/views/chart/components/ChartComponent'
import
VueDragResizeRotate
from
'@/components/vue-drag-resize-rotate'
import
VueDragResizeRotate
from
'@/components/vue-drag-resize-rotate'
import
{
uuid
}
from
'vue-uuid'
import
{
uuid
}
from
'vue-uuid'
import
bus
from
'@/utils/bus'
export
default
{
export
default
{
name
:
'
PanelViewShow
'
,
name
:
'
DrawingBoard
'
,
components
:
{
ChartComponent
,
VueDragResizeRotate
},
components
:
{
ChartComponent
,
VueDragResizeRotate
},
data
()
{
data
()
{
return
{
return
{
...
@@ -56,17 +56,27 @@ export default {
...
@@ -56,17 +56,27 @@ export default {
this
.
panelDesign
(
newVal
.
id
)
this
.
panelDesign
(
newVal
.
id
)
}
}
},
},
created
()
{
// this.get(this.$store.state.chart.viewId);
},
mounted
()
{
mounted
()
{
const
panelId
=
this
.
$store
.
state
.
panel
.
panelInfo
.
id
const
panelId
=
this
.
$store
.
state
.
panel
.
panelInfo
.
id
if
(
panelId
)
{
if
(
panelId
)
{
this
.
panelDesign
(
panelId
)
this
.
panelDesign
(
panelId
)
}
}
bus
.
$on
(
'panel-drawing-load'
,
(
panelId
)
=>
{
panelId
&&
this
.
panelDesign
(
panelId
)
})
bus
.
$on
(
'panel-view-add'
,
(
view
)
=>
{
view
&&
this
.
panelViewAdd
(
view
)
})
bus
.
$on
(
'panel-drawing-save'
,
()
=>
{
this
.
savePanel
()
})
bus
.
$on
(
'panel-drawing-preview'
,
()
=>
{
this
.
preViewShow
()
})
},
},
activated
()
{
},
methods
:
{
methods
:
{
// 加载公共组件
// 加载公共组件
...
@@ -97,20 +107,12 @@ export default {
...
@@ -97,20 +107,12 @@ export default {
}
}
})
})
},
},
// removeView(panelDesignId) {
// this.panelDetails.panelDesigns.forEach(function(panelDesign, index) {
// if (panelDesign.id === panelDesignId) {
// panelDesign.keepFlag = false
// }
// })
// },
newStyle
(
viewId
,
newStyleInfo
)
{
newStyle
(
viewId
,
newStyleInfo
)
{
this
.
$nextTick
(()
=>
{
this
.
$nextTick
(()
=>
{
this
.
$refs
[
viewId
][
0
].
chartResize
()
this
.
$refs
[
viewId
][
0
].
chartResize
()
})
})
this
.
panelInfo
.
preStyle
=
JSON
.
stringify
(
newStyleInfo
)
this
.
panelInfo
.
preStyle
=
JSON
.
stringify
(
newStyleInfo
)
console
.
log
(
viewId
)
console
.
log
(
JSON
.
stringify
(
newStyleInfo
))
},
},
// 左边往右边拖动时的事件
// 左边往右边拖动时的事件
...
...
frontend/src/views/panel/ViewSelect/index.vue
浏览文件 @
1e21d681
...
@@ -33,6 +33,7 @@
...
@@ -33,6 +33,7 @@
<
script
>
<
script
>
import
{
tree
}
from
'@/api/panel/view'
import
{
tree
}
from
'@/api/panel/view'
import
{
addClass
,
removeClass
}
from
'@/utils'
import
{
addClass
,
removeClass
}
from
'@/utils'
import
bus
from
'@/utils/bus'
export
default
{
export
default
{
name
:
'ViewSelect'
,
name
:
'ViewSelect'
,
data
()
{
data
()
{
...
@@ -81,7 +82,7 @@ export default {
...
@@ -81,7 +82,7 @@ export default {
},
},
renderNode
(
h
,
{
node
,
data
,
store
})
{
renderNode
(
h
,
{
node
,
data
,
store
})
{
return
(
return
(
<
div
class
=
'custom-tree-node'
on
-
click
=
{()
=>
this
.
detail
(
data
)}
>
<
div
class
=
'custom-tree-node'
on
-
click
=
{()
=>
this
.
detail
(
data
)}
on
-
dblclick
=
{()
=>
this
.
addView2Drawing
(
data
.
id
)}
>
<
span
class
=
'label-span'
>
{
node
.
label
}
<
/span
>
<
span
class
=
'label-span'
>
{
node
.
label
}
<
/span
>
{
data
.
type
!==
'group'
&&
data
.
type
!==
'scene'
?
(
{
data
.
type
!==
'group'
&&
data
.
type
!==
'scene'
?
(
...
@@ -99,6 +100,14 @@ export default {
...
@@ -99,6 +100,14 @@ export default {
closeDetail
()
{
closeDetail
()
{
this
.
showdetail
=
false
this
.
showdetail
=
false
this
.
detailItem
=
null
this
.
detailItem
=
null
},
addView2Drawing
(
viewId
)
{
// viewInfo(viewId).then(res => {
// const info = res.data
// this.$emit('panel-view-add', info)
// })
bus
.
$emit
(
'panel-view-add'
,
{
id
:
viewId
})
// this.$emit('panel-view-add', viewId)
}
}
}
}
}
}
...
...
frontend/src/views/panel/edit/index.vue
浏览文件 @
1e21d681
...
@@ -18,6 +18,10 @@
...
@@ -18,6 +18,10 @@
<el-button
class=
"el-icon-full-screen"
size=
"mini"
circle
/>
<el-button
class=
"el-icon-full-screen"
size=
"mini"
circle
/>
</el-tooltip>
</el-tooltip>
<el-tooltip
content=
"保存"
>
<el-button
class=
"el-icon-circle-check"
size=
"mini"
circle
@
click=
"saveDrawing"
/>
</el-tooltip>
<el-tooltip
content=
"预览"
>
<el-tooltip
content=
"预览"
>
<el-button
class=
"el-icon-view"
size=
"mini"
circle
@
click=
"save"
/>
<el-button
class=
"el-icon-view"
size=
"mini"
circle
@
click=
"save"
/>
</el-tooltip>
</el-tooltip>
...
@@ -95,6 +99,7 @@ import { addClass, removeClass } from '@/utils'
...
@@ -95,6 +99,7 @@ import { addClass, removeClass } from '@/utils'
import
FilterGroup
from
'../filter'
import
FilterGroup
from
'../filter'
import
ViewSelect
from
'../ViewSelect'
import
ViewSelect
from
'../ViewSelect'
import
DrawingBoard
from
'../DrawingBoard'
import
DrawingBoard
from
'../DrawingBoard'
import
bus
from
'@/utils/bus'
export
default
{
export
default
{
components
:
{
components
:
{
DeMainContainer
,
DeMainContainer
,
...
@@ -160,6 +165,9 @@ export default {
...
@@ -160,6 +165,9 @@ export default {
const
body
=
document
.
querySelector
(
'body'
)
const
body
=
document
.
querySelector
(
'body'
)
body
.
insertBefore
(
elx
,
body
.
firstChild
)
body
.
insertBefore
(
elx
,
body
.
firstChild
)
})
})
},
saveDrawing
()
{
bus
.
$emit
(
'panel-drawing-save'
)
}
}
}
}
...
...
frontend/src/views/panel/list/PanelList.vue
浏览文件 @
1e21d681
...
@@ -495,6 +495,7 @@ export default {
...
@@ -495,6 +495,7 @@ export default {
this
.
authVisible
=
false
this
.
authVisible
=
false
},
},
edit
(
data
)
{
edit
(
data
)
{
this
.
$store
.
dispatch
(
'panel/setPanelInfo'
,
data
)
this
.
$router
.
replace
(
'/panelEdit'
)
this
.
$router
.
replace
(
'/panelEdit'
)
}
}
}
}
...
...
frontend/src/views/panel/list/PanelViewShow.vue
浏览文件 @
1e21d681
...
@@ -12,21 +12,22 @@
...
@@ -12,21 +12,22 @@
</span>
</span>
<span
style=
"float: right;line-height: 40px;"
>
<span
style=
"float: right;line-height: 40px;"
>
<el-tooltip
content=
"返回目录"
>
<el-button
class=
"el-icon-refresh-left"
size=
"mini"
circle
/>
</el-tooltip>
<el-tooltip
content=
"背景图"
>
<el-tooltip
content=
"背景图"
>
<el-button
class=
"el-icon-full-screen"
size=
"mini"
circle
/>
<el-button
class=
"el-icon-full-screen"
size=
"mini"
circle
/>
</el-tooltip>
</el-tooltip>
<!--
<el-tooltip
content=
"保存"
>
<el-button
class=
"el-icon-success"
size=
"mini"
circle
@
click=
"savePanel"
/>
</el-tooltip>
-->
<el-tooltip
content=
"预览"
>
<el-tooltip
content=
"预览"
>
<el-button
class=
"el-icon-view"
size=
"mini"
circle
@
click=
"
save
"
/>
<el-button
class=
"el-icon-view"
size=
"mini"
circle
@
click=
"
preViewShow
"
/>
</el-tooltip>
</el-tooltip>
</span>
</span>
</el-row>
</el-row>
<el-row
class=
"panel-design-show"
>
<drawing-board
/>
<!--
<el-row
class=
"panel-design-show"
>
<div
class=
"container"
:style=
"panelDetails.gridStyle"
>
<div
class=
"container"
:style=
"panelDetails.gridStyle"
>
<vue-drag-resize-rotate
<vue-drag-resize-rotate
v-for=
"panelDesign in panelDetails.panelDesigns"
v-for=
"panelDesign in panelDetails.panelDesigns"
...
@@ -36,43 +37,26 @@
...
@@ -36,43 +37,26 @@
:parent=
"true"
:parent=
"true"
@
newStyle=
"newStyle"
@
newStyle=
"newStyle"
>
>
<!--视图显示 panelDesign.componentType==='view'-->
<chart-component
v-if=
"panelDesign.componentType==='view'"
:ref=
"panelDesign.id"
:chart-id=
"panelDesign.id"
:chart=
"panelDesign.chartView"
/>
<chart-component
v-if=
"panelDesign.componentType==='view'"
:ref=
"panelDesign.id"
:chart-id=
"panelDesign.id"
:chart=
"panelDesign.chartView"
/>
<!--组件显示(待开发)-->
</vue-drag-resize-rotate>
</vue-drag-resize-rotate>
</div>
</div>
</el-row></el-col>
</el-row>
-->
</el-col>
</el-row>
</el-row>
</el-row>
</el-row>
</
template
>
</
template
>
<
script
>
<
script
>
import
{
post
,
get
}
from
'@/api/panel/panel'
import
DrawingBoard
from
'../DrawingBoard'
import
ChartComponent
from
'../../chart/components/ChartComponent'
import
bus
from
'@/utils/bus'
import
VueDragResizeRotate
from
'@/components/vue-drag-resize-rotate'
import
{
uuid
}
from
'vue-uuid'
export
default
{
export
default
{
name
:
'PanelViewShow'
,
name
:
'PanelViewShow'
,
components
:
{
ChartComponent
,
VueDragResizeRotate
},
components
:
{
DrawingBoard
},
data
()
{
data
()
{
return
{
return
{
panelDetails
:
{
viewsUsable
:
[],
panelDesigns
:
[],
gridStyle
:
null
},
gridStyleDefault
:
{
position
:
'relative'
,
height
:
'100%'
,
width
:
'100%'
,
backgroundColor
:
'#f2f2f2'
,
// background: 'linear-gradient(-90deg, rgba(0, 0, 0, .1) 1px, transparent 1px), linear-gradient(rgba(0, 0, 0, .1) 1px, transparent 1px)',
backgroundSize
:
'20px 20px, 20px 20px'
},
ViewActiveName
:
'Views'
}
}
},
},
computed
:
{
computed
:
{
...
@@ -80,97 +64,13 @@ export default {
...
@@ -80,97 +64,13 @@ export default {
return
this
.
$store
.
state
.
panel
.
panelInfo
return
this
.
$store
.
state
.
panel
.
panelInfo
}
}
},
},
watch
:
{
panelInfo
(
newVal
,
oldVal
)
{
this
.
panelDesign
(
newVal
.
id
)
}
},
created
()
{
// this.get(this.$store.state.chart.viewId);
},
mounted
()
{
const
panelId
=
this
.
$store
.
state
.
panel
.
panelInfo
.
id
if
(
panelId
)
{
this
.
panelDesign
(
panelId
)
}
},
activated
()
{
},
methods
:
{
methods
:
{
// 加载公共组件
// 加载panel design
panelDesign
(
panelId
)
{
get
(
'panel/group/findOne/'
+
panelId
).
then
(
res
=>
{
const
panelDetailsInfo
=
res
.
data
if
(
panelDetailsInfo
)
{
this
.
panelDetails
=
panelDetailsInfo
}
if
(
!
panelDetailsInfo
.
gridStyle
)
{
this
.
panelDetails
.
gridStyle
=
this
.
gridStyleDefault
}
})
},
panelViewAdd
(
view
)
{
const
panelDesigns
=
this
.
panelDetails
.
panelDesigns
this
.
panelDetails
.
viewsUsable
.
forEach
(
function
(
item
,
index
)
{
if
(
item
.
id
===
view
.
id
)
{
const
newComponent
=
{
id
:
uuid
.
v1
(),
keepFlag
:
true
,
chartView
:
item
,
componentType
:
'view'
,
styleInit
:
false
}
panelDesigns
.
push
(
newComponent
)
}
})
},
// removeView(panelDesignId) {
// this.panelDetails.panelDesigns.forEach(function(panelDesign, index) {
// if (panelDesign.id === panelDesignId) {
// panelDesign.keepFlag = false
// }
// })
// },
newStyle
(
viewId
,
newStyleInfo
)
{
this
.
$nextTick
(()
=>
{
this
.
$refs
[
viewId
][
0
].
chartResize
()
})
this
.
panelInfo
.
preStyle
=
JSON
.
stringify
(
newStyleInfo
)
console
.
log
(
viewId
)
console
.
log
(
JSON
.
stringify
(
newStyleInfo
))
},
// 左边往右边拖动时的事件
start1
(
e
)
{
console
.
log
(
e
)
},
end1
(
e
)
{
console
.
log
(
e
)
},
// 右边往左边拖动时的事件
start2
(
e
)
{
console
.
log
(
e
)
},
end2
(
e
)
{
console
.
log
(
e
)
},
// move回调方法
onMove
(
e
,
originalEvent
)
{
console
.
log
(
e
)
return
true
},
preViewShow
()
{
preViewShow
()
{
bus
.
$emit
(
'panel-drawing-preview'
)
},
},
savePanel
()
{
savePanel
()
{
post
(
'panel/group/saveGroupWithDesign'
,
this
.
panelDetails
,
()
=>
{
bus
.
$emit
(
'panel-drawing-save'
)
})
this
.
$success
(
this
.
$t
(
'commons.save_success'
))
},
save
()
{
}
}
}
}
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论