mirror of
https://github.com/dataease/dataease.git
synced 2026-05-24 06:18:10 +08:00
feat: 视图所有操作移到仪表板
This commit is contained in:
@@ -531,7 +531,7 @@ export default {
|
||||
width: this.computedMainSlotWidth,
|
||||
height: this.computedMainSlotHeight
|
||||
}
|
||||
if (this.element.commonBackground && this.element.commonBackground.enable) {
|
||||
if (this.element.commonBackground&&this.element.commonBackground.enable) {
|
||||
if (this.element.commonBackground.backgroundType === 'innerImage') {
|
||||
style['background'] = `url(${this.element.commonBackground.innerImage}) no-repeat`
|
||||
} else if (this.element.commonBackground.backgroundType === 'outerImage') {
|
||||
|
||||
@@ -184,22 +184,25 @@ export default {
|
||||
// resize
|
||||
this.$emit('resizeView')
|
||||
},
|
||||
// edit() {
|
||||
// // 编辑时临时保存 当前修改的画布
|
||||
// this.$store.dispatch('panel/setComponentDataTemp', JSON.stringify(this.componentData))
|
||||
// this.$store.dispatch('panel/setCanvasStyleDataTemp', JSON.stringify(this.canvasStyleData))
|
||||
// if (this.curComponent.type === 'view') {
|
||||
// this.$store.dispatch('chart/setViewId', null)
|
||||
// this.$store.dispatch('chart/setViewId', this.curComponent.propValue.viewId)
|
||||
// bus.$emit('PanelSwitchComponent', { name: 'ChartEdit', param: { 'id': this.curComponent.propValue.viewId, 'optType': 'edit' }})
|
||||
// }
|
||||
// if (this.curComponent.type === 'custom') {
|
||||
// bus.$emit('component-dialog-edit')
|
||||
// }
|
||||
// // 编辑样式组件
|
||||
// if (this.curComponent.type === 'v-text' || this.curComponent.type === 'rect-shape') {
|
||||
// bus.$emit('component-dialog-style')
|
||||
// }
|
||||
// },
|
||||
edit() {
|
||||
// 编辑时临时保存 当前修改的画布
|
||||
this.$store.dispatch('panel/setComponentDataTemp', JSON.stringify(this.componentData))
|
||||
this.$store.dispatch('panel/setCanvasStyleDataTemp', JSON.stringify(this.canvasStyleData))
|
||||
if (this.curComponent.type === 'view') {
|
||||
this.$store.dispatch('chart/setViewId', null)
|
||||
this.$store.dispatch('chart/setViewId', this.curComponent.propValue.viewId)
|
||||
bus.$emit('PanelSwitchComponent', { name: 'ChartEdit', param: { 'id': this.curComponent.propValue.viewId, 'optType': 'edit' }})
|
||||
}
|
||||
if (this.curComponent.type === 'custom') {
|
||||
bus.$emit('component-dialog-edit')
|
||||
}
|
||||
// 编辑样式组件
|
||||
if (this.curComponent.type === 'v-text' || this.curComponent.type === 'rect-shape') {
|
||||
bus.$emit('component-dialog-style')
|
||||
}
|
||||
bus.$emit('change_panel_right_draw', true)
|
||||
},
|
||||
linkageEdit() {
|
||||
|
||||
|
||||
@@ -46,23 +46,24 @@ export default {
|
||||
]),
|
||||
methods: {
|
||||
edit() {
|
||||
// 编辑时临时保存 当前修改的画布
|
||||
this.$store.dispatch('panel/setComponentDataTemp', JSON.stringify(this.componentData))
|
||||
this.$store.dispatch('panel/setCanvasStyleDataTemp', JSON.stringify(this.canvasStyleData))
|
||||
if (this.curComponent.type === 'view') {
|
||||
this.$store.dispatch('chart/setViewId', null)
|
||||
this.$store.dispatch('chart/setViewId', this.curComponent.propValue.viewId)
|
||||
bus.$emit('PanelSwitchComponent', { name: 'ChartEdit', param: { 'id': this.curComponent.propValue.viewId, 'optType': 'edit' }})
|
||||
}
|
||||
if (this.curComponent.type === 'custom') {
|
||||
bus.$emit('component-dialog-edit')
|
||||
}
|
||||
|
||||
// 编辑样式组件
|
||||
|
||||
if (this.curComponent.type === 'v-text' || this.curComponent.type === 'rect-shape') {
|
||||
bus.$emit('component-dialog-style')
|
||||
}
|
||||
bus.$emit('change_panel_right_draw', true)
|
||||
// // 编辑时临时保存 当前修改的画布
|
||||
// this.$store.dispatch('panel/setComponentDataTemp', JSON.stringify(this.componentData))
|
||||
// this.$store.dispatch('panel/setCanvasStyleDataTemp', JSON.stringify(this.canvasStyleData))
|
||||
// if (this.curComponent.type === 'view') {
|
||||
// this.$store.dispatch('chart/setViewId', null)
|
||||
// this.$store.dispatch('chart/setViewId', this.curComponent.propValue.viewId)
|
||||
// bus.$emit('PanelSwitchComponent', { name: 'ChartEdit', param: { 'id': this.curComponent.propValue.viewId, 'optType': 'edit' }})
|
||||
// }
|
||||
// if (this.curComponent.type === 'custom') {
|
||||
// bus.$emit('component-dialog-edit')
|
||||
// }
|
||||
//
|
||||
// // 编辑样式组件
|
||||
//
|
||||
// if (this.curComponent.type === 'v-text' || this.curComponent.type === 'rect-shape') {
|
||||
// bus.$emit('component-dialog-style')
|
||||
// }
|
||||
},
|
||||
lock() {
|
||||
this.$store.commit('lock')
|
||||
|
||||
@@ -57,6 +57,7 @@
|
||||
@linkJumpSet="linkJumpSet(item)"
|
||||
@boardSet="boardSet(item)"
|
||||
@canvasDragging="canvasDragging"
|
||||
@editComponent="editComponent(index,item)"
|
||||
>
|
||||
<component
|
||||
:is="item.component"
|
||||
@@ -1286,6 +1287,11 @@ export default {
|
||||
this.$refs.wrapperChild[index].chartResize()
|
||||
}
|
||||
},
|
||||
editComponent(index, item) {
|
||||
if (item.type === 'view') {
|
||||
this.$refs.wrapperChild[index].editChart()
|
||||
}
|
||||
},
|
||||
handleDragOver(e) {
|
||||
this.dragComponentInfo.shadowStyle.x = e.pageX - 220
|
||||
this.dragComponentInfo.shadowStyle.y = e.pageY - 90 + this.scrollTop
|
||||
|
||||
@@ -372,6 +372,9 @@ export default {
|
||||
bus.$on('plugin-add-view-track-filter', param => {
|
||||
param.viewId && param.viewId === this.element.propValue.viewId && this.addViewTrackFilter(param)
|
||||
})
|
||||
bus.$on('view-in-cache', param => {
|
||||
param.viewId && param.viewId === this.element.propValue.viewId && this.getDataEdit(param)
|
||||
})
|
||||
},
|
||||
|
||||
addViewTrackFilter(linkageParam) {
|
||||
@@ -431,7 +434,8 @@ export default {
|
||||
}
|
||||
const requestInfo = {
|
||||
...this.filter,
|
||||
cache: cache
|
||||
cache: cache,
|
||||
queryFrom: this.isEdit ? 'panel_edit' : 'panel'
|
||||
}
|
||||
if (this.panelInfo.proxy) {
|
||||
// method = viewInfo
|
||||
@@ -711,6 +715,18 @@ export default {
|
||||
|
||||
renderComponent() {
|
||||
return this.chart.render
|
||||
},
|
||||
getDataEdit(param) {
|
||||
this.$store.state.styleChangeTimes++
|
||||
if (param.type === 'propChange') {
|
||||
this.getData(param.viewId, false)
|
||||
} else if (param.type === 'styleChange') {
|
||||
this.chart.customAttr = param.viewInfo.customAttr
|
||||
this.chart.customStyle = param.viewInfo.customStyle
|
||||
this.sourceCustomAttrStr = this.chart.customAttr
|
||||
this.sourceCustomStyleStr = this.chart.customStyle
|
||||
this.mergeScale()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user