Merge pull request #832 from dataease/pr@dev@refactor_panel-text

feat:仪表板视图拖拽阴影跟随
This commit is contained in:
王嘉豪 2021-09-17 10:52:09 +08:00 committed by GitHub
commit f2cca78199
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 24 additions and 12 deletions

View File

@ -510,11 +510,13 @@ export default {
width: this.computedMainSlotWidth, width: this.computedMainSlotWidth,
height: this.computedMainSlotHeight height: this.computedMainSlotHeight
} }
console.log('style=>' + JSON.stringify(style)) // console.log('style=>' + JSON.stringify(style))
return style return style
}, },
curComponent() {
return this.$store.state.curComponent
},
...mapState([ ...mapState([
'curComponent',
'editor', 'editor',
'curCanvasScale', 'curCanvasScale',
'canvasStyleData', 'canvasStyleData',
@ -614,6 +616,18 @@ export default {
this.beforeDestroyFunction() this.beforeDestroyFunction()
this.createdFunction() this.createdFunction()
this.mountedFunction() this.mountedFunction()
},
// private dragging resizing
dragging(val) {
if (this.enabled) {
this.curComponent.optStatus.dragging = val
}
},
// private dragging resizing
resizing(val) {
if (this.enabled) {
this.curComponent.optStatus.resizing = val
}
} }
}, },
created: function() { created: function() {
@ -1572,10 +1586,6 @@ export default {
addEvent(document.documentElement, 'touchend touchcancel', this.deselect) addEvent(document.documentElement, 'touchend touchcancel', this.deselect)
// //
addEvent(window, 'resize', this.checkParentSize) addEvent(window, 'resize', this.checkParentSize)
// private
this.curComponent.optStatus.resizing = this.resizing
this.curComponent.optStatus.dragging = this.dragging
}, },
createdFunction() { createdFunction() {
// minWidthmaxWidth // minWidthmaxWidth

View File

@ -28,7 +28,7 @@ export default {
background: 'gray', background: 'gray',
position: 'absolute' position: 'absolute'
} }
console.log('style=>' + JSON.stringify(style)) // console.log('style=>' + JSON.stringify(style))
return style return style
}, },
...mapState([ ...mapState([

View File

@ -12,7 +12,7 @@
@mousedown="handleMouseDown" @mousedown="handleMouseDown"
> >
<!-- 网格线 --> <!-- 网格线 -->
<Grid v-if="canvasStyleData.auxiliaryMatrix&&!linkageSettingStatus" :matrix-style="matrixStyle" /> <!-- <Grid v-if="canvasStyleData.auxiliaryMatrix&&!linkageSettingStatus" :matrix-style="matrixStyle" />-->
<!-- 仪表板联动清除按钮--> <!-- 仪表板联动清除按钮-->
<canvas-opt-bar /> <canvas-opt-bar />
@ -636,7 +636,7 @@ export default {
}, },
resizeView(index, item) { resizeView(index, item) {
if (item.type === 'view') { if (item.type === 'view') {
console.log('view:resizeView') // console.log('view:resizeView')
this.$refs.wrapperChild[index].chartResize() this.$refs.wrapperChild[index].chartResize()
} }
} }

View File

@ -87,9 +87,11 @@ const data = {
setCurComponent(state, { component, index }) { setCurComponent(state, { component, index }) {
// 当前视图操作状态置空 // 当前视图操作状态置空
component['optStatus'] = { if (component) {
dragging: false, component['optStatus'] = {
resizing: false dragging: false,
resizing: false
}
} }
state.styleChangeTimes = 0 state.styleChangeTimes = 0
state.curComponent = component state.curComponent = component