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

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

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