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

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

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