forked from github/dataease
fix(仪表板): 修复矩形组件复用部分样式丢失问题
This commit is contained in:
parent
ae5cc25d8a
commit
53313b5ddd
@ -5,7 +5,7 @@
|
||||
@click="handleClick"
|
||||
@mousedown="elementMouseDown"
|
||||
>
|
||||
<edit-bar v-if="componentActiveFlag" :element="config" :show-position="showPosition" @showViewDetails="showViewDetails" />
|
||||
<edit-bar v-if="componentActiveFlag" :source-element="sourceConfig" :element="config" :show-position="showPosition" @showViewDetails="showViewDetails" />
|
||||
<div :id="componentCanvasId" :style="commonStyle" class="main_view">
|
||||
<close-bar v-if="previewVisible" @closePreview="closePreview" />
|
||||
<de-out-widget
|
||||
@ -62,6 +62,11 @@ export default {
|
||||
components: { CloseBar, MobileCheckBar, DeOutWidget, EditBar },
|
||||
mixins: [mixins],
|
||||
props: {
|
||||
sourceConfig: {
|
||||
type: Object,
|
||||
require: true,
|
||||
default: null
|
||||
},
|
||||
config: {
|
||||
type: Object,
|
||||
require: true,
|
||||
|
@ -58,6 +58,10 @@ export default {
|
||||
components: { SettingMenu, LinkageField },
|
||||
|
||||
props: {
|
||||
sourceElement: {
|
||||
type: Object,
|
||||
required: true
|
||||
},
|
||||
element: {
|
||||
type: Object,
|
||||
required: true
|
||||
@ -180,7 +184,7 @@ export default {
|
||||
multiplexingCheck(val) {
|
||||
if (val) {
|
||||
// push
|
||||
this.$store.commit('addCurMultiplexingComponent', { 'component': this.element, 'componentId': this.element.id })
|
||||
this.$store.commit('addCurMultiplexingComponent', { 'component': this.sourceElement, 'componentId': this.element.id })
|
||||
} else {
|
||||
// remove
|
||||
this.$store.commit('removeCurMultiplexingComponentWithId', this.element.id)
|
||||
|
@ -26,6 +26,7 @@
|
||||
:key="index"
|
||||
ref="viewWrapperChild"
|
||||
:config="item"
|
||||
:source-config="componentData[index]"
|
||||
:search-count="searchCount"
|
||||
:in-screen="inScreen"
|
||||
:terminal="terminal"
|
||||
|
@ -9,13 +9,13 @@ export default {
|
||||
state: {
|
||||
copyData: null, // 复制粘贴剪切
|
||||
isCut: false,
|
||||
baseStyle: {
|
||||
width: 300,
|
||||
height: 200,
|
||||
top: 0,
|
||||
left: 0
|
||||
},
|
||||
viewBase: {
|
||||
style: {
|
||||
width: 300,
|
||||
height: 200,
|
||||
top: 0,
|
||||
left: 0
|
||||
},
|
||||
x: 1,
|
||||
y: 216,
|
||||
sizex: 48,
|
||||
@ -39,10 +39,15 @@ export default {
|
||||
const component =
|
||||
{
|
||||
...deepCopy(state.curMultiplexingComponents[componentId]),
|
||||
...deepCopy(deepCopy(state.viewBase)),
|
||||
...deepCopy(state.viewBase),
|
||||
'auxiliaryMatrix': canvasStyleData.auxiliaryMatrix
|
||||
}
|
||||
|
||||
component.style = {
|
||||
...component.style,
|
||||
...deepCopy(state.baseStyle)
|
||||
}
|
||||
|
||||
const tilePosition = index % 3
|
||||
const divisiblePosition = parseInt(index / 3)
|
||||
if (canvasStyleData.auxiliaryMatrix) {
|
||||
|
Loading…
Reference in New Issue
Block a user