forked from github/dataease
feat:增加仪表盘设计组件及设计 增加面板中 view 删除功能
This commit is contained in:
parent
7f4a9d6bd2
commit
1f6f8503b4
@ -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 }
|
||||
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
}
|
||||
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user