提交 6ceddf85 authored 作者: wangjiahao's avatar wangjiahao

refactor: 增加视图的分布方式初始化数据

上级 009aebde
...@@ -15,10 +15,10 @@ ...@@ -15,10 +15,10 @@
<i v-if="activeModel==='edit'&&curComponent&&editFilter.includes(curComponent.type)" class="icon iconfont icon-edit" @click.stop="edit" /> <i v-if="activeModel==='edit'&&curComponent&&editFilter.includes(curComponent.type)" class="icon iconfont icon-edit" @click.stop="edit" />
</span> </span>
<span :title="$t('panel.matrix')"> <span :title="$t('panel.matrix')">
<i v-if="activeModel==='edit'&&curComponent.auxiliaryMatrix" class="icon iconfont icon-shujujuzhen" @click.stop="auxiliaryMatrixChange" /> <i v-if="activeModel==='edit'&&auxiliaryMatrix" class="icon iconfont icon-shujujuzhen" @click.stop="auxiliaryMatrixChange" />
</span> </span>
<span :title="$t('panel.suspension')"> <span :title="$t('panel.suspension')">
<i v-if="activeModel==='edit'&&!curComponent.auxiliaryMatrix" class="icon iconfont icon-xuanfuanniu" @click.stop="auxiliaryMatrixChange" /> <i v-if="activeModel==='edit'&&!auxiliaryMatrix" class="icon iconfont icon-xuanfuanniu" @click.stop="auxiliaryMatrixChange" />
</span> </span>
<span :title="$t('panel.details')"> <span :title="$t('panel.details')">
<i v-if="curComponent.type==='view'" class="icon iconfont icon-fangda" @click.stop="showViewDetails" /> <i v-if="curComponent.type==='view'" class="icon iconfont icon-fangda" @click.stop="showViewDetails" />
...@@ -61,6 +61,7 @@ export default { ...@@ -61,6 +61,7 @@ export default {
return { return {
componentType: null, componentType: null,
linkageActiveStatus: false, linkageActiveStatus: false,
auxiliaryMatrix: false,
editFilter: [ editFilter: [
'view', 'view',
'custom' 'custom'
...@@ -84,6 +85,9 @@ export default { ...@@ -84,6 +85,9 @@ export default {
linkageInfo() { linkageInfo() {
return this.targetLinkageInfo[this.element.propValue.viewId] return this.targetLinkageInfo[this.element.propValue.viewId]
}, },
mounted() {
this.auxiliaryMatrix = this.$store.state.curComponent.auxiliaryMatrix
},
...mapState([ ...mapState([
'menuTop', 'menuTop',
'menuLeft', 'menuLeft',
...@@ -108,12 +112,14 @@ export default { ...@@ -108,12 +112,14 @@ export default {
this.curComponent.style.width = this.curComponent.sizex * this.curCanvasScale.matrixStyleOriginWidth this.curComponent.style.width = this.curComponent.sizex * this.curCanvasScale.matrixStyleOriginWidth
this.curComponent.style.height = this.curComponent.sizey * this.curCanvasScale.matrixStyleOriginHeight this.curComponent.style.height = this.curComponent.sizey * this.curCanvasScale.matrixStyleOriginHeight
this.curComponent.auxiliaryMatrix = false this.curComponent.auxiliaryMatrix = false
this.auxiliaryMatrix = false
} else { } else {
this.curComponent.x = Math.round(this.curComponent.style.left / this.curCanvasScale.matrixStyleOriginWidth) + 1 this.curComponent.x = Math.round(this.curComponent.style.left / this.curCanvasScale.matrixStyleOriginWidth) + 1
this.curComponent.y = Math.round(this.curComponent.style.top / this.curCanvasScale.matrixStyleOriginHeight) + 1 this.curComponent.y = Math.round(this.curComponent.style.top / this.curCanvasScale.matrixStyleOriginHeight) + 1
this.curComponent.sizex = Math.round(this.curComponent.style.width / this.curCanvasScale.matrixStyleOriginWidth) this.curComponent.sizex = Math.round(this.curComponent.style.width / this.curCanvasScale.matrixStyleOriginWidth)
this.curComponent.sizey = Math.round(this.curComponent.style.height / this.curCanvasScale.matrixStyleOriginHeight) this.curComponent.sizey = Math.round(this.curComponent.style.height / this.curCanvasScale.matrixStyleOriginHeight)
this.curComponent.auxiliaryMatrix = true this.curComponent.auxiliaryMatrix = true
this.auxiliaryMatrix = true
} }
this.$store.state.styleChangeTimes++ this.$store.state.styleChangeTimes++
bus.$emit('auxiliaryMatrixChange') bus.$emit('auxiliaryMatrixChange')
......
...@@ -94,6 +94,9 @@ const data = { ...@@ -94,6 +94,9 @@ const data = {
dragging: false, dragging: false,
resizing: false resizing: false
} }
if (!component.auxiliaryMatrix) {
component['auxiliaryMatrix'] = false
}
} }
state.styleChangeTimes = 0 state.styleChangeTimes = 0
state.curComponent = component state.curComponent = component
......
...@@ -13,7 +13,7 @@ export default { ...@@ -13,7 +13,7 @@ export default {
props: { props: {
drillFilters: { drillFilters: {
type: Array, type: Array,
required: true default: () => []
} }
}, },
data() { data() {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论