diff --git a/src/components/generator/config.js b/src/components/generator/config.js index cacc975..d27f206 100644 --- a/src/components/generator/config.js +++ b/src/components/generator/config.js @@ -521,7 +521,7 @@ export const imageComponents = [ typeId: 'IMAGE_CAROUSEL', __config__: { label: '图片轮播', - showLabel: true, + showLabel: false, labelWidth: null, defaultValue: null, showDefaultValue: false, @@ -539,7 +539,7 @@ export const imageComponents = [ __slot__: { options: [{ label: '文字', - image: 'https://qiniu.smileyi.top/757b505cfd34c64c85ca5b5690ee5293/b128cf03901945d6b6df46cf6acbfa01.jpg' + image: '' }] }, style: {width: '100%'} diff --git a/src/components/parser/Parser.vue b/src/components/parser/Parser.vue index 682b247..32f2bf4 100644 --- a/src/components/parser/Parser.vue +++ b/src/components/parser/Parser.vue @@ -231,7 +231,6 @@ function setOtherValueLabel(event, config) { let value = this[this.formConf.formModel][config.__vModel__] // 临时保存其他的选项值 this.$nextTick(() => { - console.log(this[this.formConf.labelFormModel]) this.$set(this[this.formConf.labelFormModel], `${config.__vModel__}other`, event) console.log(this[this.formConf.labelFormModel]) setValueLabel.call(this, value, config.__config__, config) @@ -251,8 +250,6 @@ function setValueLabel(event, config, scheme) { // 需要处理的类型 如果是input等则不需要处理 let tagOptionKey = processType[config.tag] if (tagOptionKey) { - // eslint-disable-next-line no-debugger - // debugger if (event instanceof Array) { let labelArr = new Array() event.forEach(item => { diff --git a/src/utils/convert.js b/src/utils/convert.js index f1971d1..c28d0e4 100644 --- a/src/utils/convert.js +++ b/src/utils/convert.js @@ -130,8 +130,11 @@ const dataParams = { }, // 单选框组 'RADIO': { + 'optionType': '__config__.optionType', + 'border': '__config__.border', 'options': '__slot__.options', 'filterable': 'filterable', + 'size': 'size', 'multiple': 'props.props.multiple' }, // 多选框组 diff --git a/src/views/form/RightPanel.vue b/src/views/form/RightPanel.vue index 1b106a6..c0bb7ea 100644 --- a/src/views/form/RightPanel.vue +++ b/src/views/form/RightPanel.vue @@ -6,12 +6,12 @@
- - + + @@ -50,7 +50,7 @@ - @@ -68,7 +68,7 @@ - + @@ -214,8 +214,8 @@ > @@ -319,8 +319,8 @@ > 选项 @@ -344,8 +344,8 @@
@@ -353,8 +353,8 @@ @@ -369,8 +369,8 @@ > 选项 @@ -391,18 +391,18 @@ -
+ :show-file-list="false" + accept=".jpg,.jpeg,.png,.gif,.bmp,.JPG,.JPEG,.PBG,.GIF,.BMP" + style="text-align: center;"> +
@@ -412,8 +412,8 @@
@@ -427,8 +427,8 @@ > 选项 @@ -449,18 +449,18 @@ -
+ :show-file-list="false" + accept=".jpg,.jpeg,.png,.gif,.bmp,.JPG,.JPEG,.PBG,.GIF,.BMP" + style="text-align: center;"> +
@@ -470,8 +470,8 @@
@@ -530,16 +530,16 @@
@@ -589,18 +589,12 @@ - - - 点击上传图片 * @@ -722,9 +716,9 @@ @@ -762,7 +756,7 @@
- + @@ -799,7 +793,7 @@ - + @@ -818,7 +812,7 @@
- +
@@ -827,14 +821,11 @@ import {isArray} from 'util' import TreeNodeDialog from '@/views/form/TreeNodeDialog' import {isNumberStr} from '@/utils/index' import IconsDialog from './IconsDialog' -import { - imageComponents, - inputComponents, selectComponents -} from '@/components/generator/config' -import DraggableItem from './DraggableItem' +import {imageComponents, inputComponents, selectComponents} from '@/components/generator/config' import {saveFormConf} from '@/utils/db' import {debounce} from 'throttle-debounce' import draggable from 'vuedraggable' +import _ from 'lodash' const dateTimeFormat = { date: 'yyyy-MM-dd', @@ -859,7 +850,7 @@ export default { props: ['showField', 'activeData', 'formConf'], data() { return { - loading:null, + loading: null, currentTab: 'field', currentNode: null, dialogVisible: false, @@ -1030,23 +1021,26 @@ export default { }) }, addSelectItem() { + let lastItem = _.last(this.activeData.__slot__.options) this.activeData.__slot__.options.push({ label: '', - value: this.activeData.__slot__.options.length + 1 + value: lastItem ? lastItem.value + 1 : 1 }) }, addImageSelectItem() { + let lastItem = _.last(this.activeData.__slot__.options) this.activeData.options.push({ label: '', image: '', - value: this.activeData.options.length + 1 + value: lastItem ? lastItem.value + 1 : 1 }) }, addImageCarouselItem() { + let lastItem = _.last(this.activeData.__slot__.options) this.activeData.__slot__.options.push({ label: '', image: '', - value: this.activeData.__slot__.options.length + 1 + value: lastItem ? lastItem.value + 1 : 1 }) }, addSelectOtherItem() { @@ -1069,10 +1063,10 @@ export default { background: 'rgba(0, 0, 0, 0.7)' }) }, - closeUploadProgressHandle(){ + closeUploadProgressHandle() { setTimeout(() => { - this.loading.close(); - }, 100); + this.loading.close() + }, 100) }, addTreeItem() { ++this.idGlobal diff --git a/src/views/form/editor.vue b/src/views/form/editor.vue index ba08fb5..e32bcbb 100644 --- a/src/views/form/editor.vue +++ b/src/views/form/editor.vue @@ -115,7 +115,8 @@ import { assistComponents, formConf, imageComponents, - inputComponents, personalInfoComponents, + inputComponents, + personalInfoComponents, selectComponents } from '@/components/generator/config' import {deepClone} from '@/utils/index' @@ -259,6 +260,7 @@ export default { pItem.sort = res.data.sort isSuccess = true }) + // 如果是分页组件 刷新所有分页的页码 if (item.typeId === 'PAGINATION') { this.updatePaginationList() }