提交 1f6f8503 authored 作者: wangjiahao's avatar wangjiahao

feat:增加仪表盘设计组件及设计 增加面板中 view 删除功能

上级 7f4a9d6b
......@@ -69,6 +69,10 @@ export default {
replace: true,
name: 'VueDragResizeRotate',
props: {
viewId: {
type: String,
default: ''
},
className: {
type: String,
default: 'vdr'
......@@ -596,6 +600,11 @@ export default {
},
methods: {
removeView(){
debugger
console.log(this.viewId);
this.$emit('removeView',this.viewId)
},
// 重置边界和鼠标状态
resetBoundsAndMouseState() {
this.mouseClickPosition = { mouseX: 0, mouseY: 0, x: 0, y: 0, w: 0, h: 0 }
......
const getDefaultState = () => {
return {
panelName: ''
panelName: '',
panelInfo:{
name:''
}
}
}
......@@ -10,12 +13,20 @@ const state = getDefaultState()
const mutations = {
setPanelName: (state, panelName) => {
state.panelName = panelName
},
setPanelInfo: (state, panelInfo) => {
debugger
state.panelInfo = panelInfo
}
}
const actions = {
setPanelName({ commit }, panelName) {
commit('setPanelName', panelName)
},
setPanelInfo({ commit }, panelInfo) {
debugger
commit('setPanelInfo', panelInfo)
}
}
......
......@@ -389,12 +389,9 @@ export default {
},
nodeClick(data, node) {
// console.log(data);
// console.log(node);
if (data.nodeType === 'panel') {
this.sceneMode = true
this.currGroup = data
this.$store.dispatch('dataset/setSceneData', this.currGroup.id)
this.$store.dispatch('panel/setPanelInfo', data)
}
if (node.expanded) {
this.expandedArray.push(data.id)
......@@ -477,7 +474,7 @@ export default {
panelDefaultClick(data, node) {
console.log(data)
console.log(node)
this.$store.dispatch('panel/setPanelName', data.name)
this.$store.dispatch('panel/setPanelInfo', data)
// 切换view
this.$emit('switchComponent', { name: 'PanelView' })
},
......
......@@ -34,6 +34,7 @@
<el-col class="panel-design">
<!--TODO 仪表盘设计公共设置区域-->
<el-row class="panel-design-head">
<span style="float: left;line-height: 40px; color: gray">名称:{{panelInfo.name}}</span>
<span style="float: right;line-height: 40px;">
<el-button size="mini">
背景图
......@@ -126,19 +127,8 @@ export default {
}
},
computed: {
tableId() {
// console.log(this.$store.state.chart.tableId);
this.initTableData(this.$store.state.chart.tableId)
return this.$store.state.chart.tableId
},
sceneId() {
// console.log(this.$store.state.chart.sceneId);
return this.$store.state.chart.sceneId
},
vId() {
// console.log(this.$store.state.chart.viewId);
this.getData(this.$store.state.chart.viewId)
return this.$store.state.chart.viewId
panelInfo() {
return this.$store.state.panel.panelInfo
}
},
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论