forked from github/dataease
feat:增加仪表盘设计组件及设计 增加面板中 view 删除功能
This commit is contained in:
parent
7f4a9d6bd2
commit
1f6f8503b4
@ -69,6 +69,10 @@ export default {
|
|||||||
replace: true,
|
replace: true,
|
||||||
name: 'VueDragResizeRotate',
|
name: 'VueDragResizeRotate',
|
||||||
props: {
|
props: {
|
||||||
|
viewId: {
|
||||||
|
type: String,
|
||||||
|
default: ''
|
||||||
|
},
|
||||||
className: {
|
className: {
|
||||||
type: String,
|
type: String,
|
||||||
default: 'vdr'
|
default: 'vdr'
|
||||||
@ -596,6 +600,11 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
|
removeView(){
|
||||||
|
debugger
|
||||||
|
console.log(this.viewId);
|
||||||
|
this.$emit('removeView',this.viewId)
|
||||||
|
},
|
||||||
// 重置边界和鼠标状态
|
// 重置边界和鼠标状态
|
||||||
resetBoundsAndMouseState() {
|
resetBoundsAndMouseState() {
|
||||||
this.mouseClickPosition = { mouseX: 0, mouseY: 0, x: 0, y: 0, w: 0, h: 0 }
|
this.mouseClickPosition = { mouseX: 0, mouseY: 0, x: 0, y: 0, w: 0, h: 0 }
|
||||||
|
@ -1,7 +1,10 @@
|
|||||||
|
|
||||||
const getDefaultState = () => {
|
const getDefaultState = () => {
|
||||||
return {
|
return {
|
||||||
panelName: ''
|
panelName: '',
|
||||||
|
panelInfo:{
|
||||||
|
name:''
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -10,12 +13,20 @@ const state = getDefaultState()
|
|||||||
const mutations = {
|
const mutations = {
|
||||||
setPanelName: (state, panelName) => {
|
setPanelName: (state, panelName) => {
|
||||||
state.panelName = panelName
|
state.panelName = panelName
|
||||||
|
},
|
||||||
|
setPanelInfo: (state, panelInfo) => {
|
||||||
|
debugger
|
||||||
|
state.panelInfo = panelInfo
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const actions = {
|
const actions = {
|
||||||
setPanelName({ commit }, panelName) {
|
setPanelName({ commit }, panelName) {
|
||||||
commit('setPanelName', panelName)
|
commit('setPanelName', panelName)
|
||||||
|
},
|
||||||
|
setPanelInfo({ commit }, panelInfo) {
|
||||||
|
debugger
|
||||||
|
commit('setPanelInfo', panelInfo)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -389,12 +389,9 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
nodeClick(data, node) {
|
nodeClick(data, node) {
|
||||||
// console.log(data);
|
|
||||||
// console.log(node);
|
|
||||||
if (data.nodeType === 'panel') {
|
if (data.nodeType === 'panel') {
|
||||||
this.sceneMode = true
|
|
||||||
this.currGroup = data
|
this.currGroup = data
|
||||||
this.$store.dispatch('dataset/setSceneData', this.currGroup.id)
|
this.$store.dispatch('panel/setPanelInfo', data)
|
||||||
}
|
}
|
||||||
if (node.expanded) {
|
if (node.expanded) {
|
||||||
this.expandedArray.push(data.id)
|
this.expandedArray.push(data.id)
|
||||||
@ -477,7 +474,7 @@ export default {
|
|||||||
panelDefaultClick(data, node) {
|
panelDefaultClick(data, node) {
|
||||||
console.log(data)
|
console.log(data)
|
||||||
console.log(node)
|
console.log(node)
|
||||||
this.$store.dispatch('panel/setPanelName', data.name)
|
this.$store.dispatch('panel/setPanelInfo', data)
|
||||||
// 切换view
|
// 切换view
|
||||||
this.$emit('switchComponent', { name: 'PanelView' })
|
this.$emit('switchComponent', { name: 'PanelView' })
|
||||||
},
|
},
|
||||||
|
@ -34,6 +34,7 @@
|
|||||||
<el-col class="panel-design">
|
<el-col class="panel-design">
|
||||||
<!--TODO 仪表盘设计公共设置区域-->
|
<!--TODO 仪表盘设计公共设置区域-->
|
||||||
<el-row class="panel-design-head">
|
<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;">
|
<span style="float: right;line-height: 40px;">
|
||||||
<el-button size="mini">
|
<el-button size="mini">
|
||||||
背景图
|
背景图
|
||||||
@ -126,19 +127,8 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
tableId() {
|
panelInfo() {
|
||||||
// console.log(this.$store.state.chart.tableId);
|
return this.$store.state.panel.panelInfo
|
||||||
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
|
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user