diff --git a/frontend/src/components/vue-drag-resize-rotate/index.vue b/frontend/src/components/vue-drag-resize-rotate/index.vue index c019654d98..16686fc84e 100644 --- a/frontend/src/components/vue-drag-resize-rotate/index.vue +++ b/frontend/src/components/vue-drag-resize-rotate/index.vue @@ -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 } diff --git a/frontend/src/store/modules/panel.js b/frontend/src/store/modules/panel.js index a3c5d064e7..d90be32b5a 100644 --- a/frontend/src/store/modules/panel.js +++ b/frontend/src/store/modules/panel.js @@ -1,7 +1,10 @@ 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) } } diff --git a/frontend/src/views/panel/list/PanelList.vue b/frontend/src/views/panel/list/PanelList.vue index 3de67d91e2..97b7b0e1e0 100644 --- a/frontend/src/views/panel/list/PanelList.vue +++ b/frontend/src/views/panel/list/PanelList.vue @@ -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' }) }, diff --git a/frontend/src/views/panel/list/PanelViewShow.vue b/frontend/src/views/panel/list/PanelViewShow.vue index c8dd93f61a..8295a524de 100644 --- a/frontend/src/views/panel/list/PanelViewShow.vue +++ b/frontend/src/views/panel/list/PanelViewShow.vue @@ -34,6 +34,7 @@ + 名称:{{panelInfo.name}} 背景图 @@ -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 } },