diff --git a/src/components/modules/content.vue b/src/components/modules/content.vue index 09695bd..87010cd 100644 --- a/src/components/modules/content.vue +++ b/src/components/modules/content.vue @@ -28,7 +28,7 @@ api-key='rnk6zw9v267xqz7pf98twt1vmrvltmd436je7a642pckltda' v-model="data.form[item.prop]" :init="editorConfig" /> - 只支持.jpg,.png格式

- @@ -144,7 +146,9 @@ export default { file: {}, // 当前被选择的图片文件 curForm: {}, fixed: false, - fixedNumber: [0.88, 1] + fixedNumber: [0.88, 1], + autoCropWidth: 480, + autoCropHeight: 124, }; }, watch: { @@ -160,16 +164,15 @@ export default { // 处理form表单参数 handleForm () { const { forms, type } = this.data + this.fixed = false // 这两张类型的模块才需要处理参数 - if (type === 'form' || type === 'introduce') { + if (forms) { forms.map(e => { - if (e.type === 'upload') { - if (e.fixedNumber) { - this.fixed = true - this.fixedNumber = e.fixedNumber - } else { - this.fixed = false - } + if (e.type === 'upload' && e.width) { + this.autoCropWidth = e.width + this.autoCropHeight = e.height + this.fixed = true + this.fixedNumber = [e.width / e.height, 1] } if (e.required) { this.rules[e.prop] = [ diff --git a/src/components/modules/history.vue b/src/components/modules/history.vue index 9bd9a00..9f2c7bd 100644 --- a/src/components/modules/history.vue +++ b/src/components/modules/history.vue @@ -38,11 +38,6 @@ @@ -122,6 +117,7 @@ export default { // 编辑内容 editHistory (row, i = 0) { this.data.form = JSON.parse(JSON.stringify(row)) + if (!this.data.labelWidth) this.data.labelWidth = '60px' this.curModule = i this.contentVisible = true }, diff --git a/src/components/modules/module.vue b/src/components/modules/module.vue index 117ea87..17f53fd 100644 --- a/src/components/modules/module.vue +++ b/src/components/modules/module.vue @@ -1,50 +1,16 @@