Commit 2e23dcc4 authored by 郭志伟's avatar 郭志伟

fix(state.ts): 修复复制组件时grid不准确问题

parents 7fcc396b 32a0d570
......@@ -94,6 +94,13 @@ export default class OperationPanel extends Mixins(TransformStyleMixin) {
//
}
fixGridKey(item) {
if (typeof item.point?.i === 'number' && !isNaN(item.point?.i)) {
return item.id;
}
return item.point?.i || '';
}
layoutUpdatedEvent() {
this.$nextTick(() => {
let layoutSorted = JSON.parse(JSON.stringify(this.layout));
......
......@@ -23,13 +23,13 @@
:w="item.point.w"
:h="item.point.h"
:i="item.point.i"
:key="item.point.i + index"
:key="fixGridKey(item) + index"
@contextmenu.native.prevent="show($event, index)"
@resized="resizedEvent"
@moved="movedEvent"
:style="transformStyle(item.commonStyle, item.name)"
:class="{'Dcmcp-item_selected': curEleIndex === index && curChildIndex === null, 'Dcmcp-item_is-freecontainer': item.name === 'freedom-container'}">
<component ref="container" :id="item.id" class="Dcmcp-item-com" @handleElementClick="handleElementClick" :containerIndex="index" :childItem="item" :is="item.name" :key="item.point.i + index" v-bind="item.props"></component>
<component ref="container" :id="item.id" class="Dcmcp-item-com" @handleElementClick="handleElementClick" :containerIndex="index" :childItem="item" :is="item.name" :key="fixGridKey(item) + index" v-bind="item.props"></component>
</grid-item>
<grid-item
v-if="pageData.props.showPageBottomTip"
......
......@@ -150,7 +150,7 @@ export default class EditorModule implements Module<EditorState, RootState> {
eleCopyed = cloneDeep(page[containerIndex] || {});
eleCopyed.id = newId;
eleCopyed.point.i = newId;
page.push({ ...eleCopyed, point: { ...eleCopyed.point, i: page.length }});
page.push({ ...eleCopyed, point: { ...eleCopyed.point }});
}
}
},
......
......@@ -26,8 +26,8 @@ export default (appInfo: EggAppConfig) => {
dialect: 'mysql',
username: 'qa',
password: 'qatest',
host: '172.17.5.17',
port: 31548,
host: '172.17.5.46',
port: 30198,
database: 'low_code',
};
......@@ -36,8 +36,8 @@ export default (appInfo: EggAppConfig) => {
keyPrefix: appInfo.name + ':',
},
client: {
port: 32625, // Redis port
host: '172.17.5.2', // Redis host
port: 31226, // Redis port
host: '172.17.5.14', // Redis host
password: '',
db: 0
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment