Commit 2b442b6f authored by 郝聪敏's avatar 郝聪敏

feature: 修改保存未生效、引用赋值bug、编辑页布局异常

parent 3f163cd3
......@@ -38,7 +38,6 @@ export default class DynamicForm extends Vue {
}
handleSubmit(type) {
if (this.formCustom.isPublish) { return; }
this.$refs.formCustom.validate(async (valid) => {
if (valid) {
if (type === 'save') {
......
import { Component, Vue, Prop, Watch } from 'vue-property-decorator';
import FreedomContainer from '../../component/FreedomContainer/index.vue';
import { kebabCase, chunk, flatten } from 'lodash';
import { kebabCase, chunk, flatten, cloneDeep } from 'lodash';
import { State } from 'vuex-class';
import { v4 as uuid } from 'uuid';
......@@ -31,7 +31,6 @@ export default class DynamicComponent extends Vue {
dragstart(event, eleName) {
this.$emit('dragstart');
const id = uuid().slice(19);
const pointY = eleName === 'freedom-container' ? 360 : 126;
const { compontObj, page } = this.genrateCom(eleName);
if (eleName.includes('template')) {
event.dataTransfer.setData('text', JSON.stringify({
......@@ -54,14 +53,15 @@ export default class DynamicComponent extends Vue {
const bussinessEleConfig = Object.values(this.eleConfigMap).reduce((pre, cur) => pre.concat(cur.children), []);
const rawEleConfig = this.type === 'business' ? bussinessEleConfig : this.eleConfig;
const eleConfig = flatten(rawEleConfig).find(cfg => cfg.eleName === eleName);
const { title, config, value, commonStyle, page } = eleConfig;
const { title, config, value, commonStyle, page } = cloneDeep(eleConfig);
const id = uuid().slice(19);
const pointH = eleName === 'freedom-container' ? 360 : 105;
return {
compontObj: {
id,
name: eleName,
title,
point: {x: 0, y: 0, w: this.colNum, h: 105, i: id},
point: {x: 0, y: 0, w: this.colNum, h: pointH, i: id},
schame: config,
props: {...value},
commonStyle
......
......@@ -292,7 +292,7 @@ export default class DynamicForm extends Mixins(ContextMenuMixin, DynamicFormMix
case 'horizontal':
left = ceil(divide(subtract(containerW, eleW), 2), 2); break;
case 'full': case 'width': case 'height':
EventBus.$emit('resizedChildEvent', type);
EventBus.$emit('resizedChildEvent', type); break;
default: break;
}
this.updatePageInfo({ containerIndex: this.curEleIndex, childIndex: this.curChildIndex, data: { ...elements, commonStyle: { ...elements.commonStyle, left, top } } });
......
......@@ -52,6 +52,9 @@
}
&-container {
height: calc(100% - 48px);
&-left {
height: 100%;
}
&-middle {
height: 100%;
background: #f0f2f5;
......
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