1. 修复图片上传组件的大图预览功能;

2. 修复部分拼写错误。
master
vdpAdmin 2022-08-04 15:58:12 +08:00
parent db3d7d5063
commit 07c9f5f846
5 changed files with 34 additions and 12 deletions

View File

@ -8,7 +8,7 @@
:with-credentials="field.options.withCredentials"
:multiple="field.options.multipleSelect" :file-list="fileList" :show-file-list="field.options.showFileList"
list-type="picture-card" :class="{'hideUploadDiv': uploadBtnHidden}"
:limit="field.options.limit" :on-exceed="handlePictureExceed"
:limit="field.options.limit" :on-exceed="handlePictureExceed" :on-preview="handlePicturePreview"
:before-upload="beforePictureUpload"
:on-success="handlePictureUpload" :on-error="handleUploadError" :on-remove="handlePictureRemove">
<div slot="tip" class="el-upload__tip"
@ -119,6 +119,11 @@
this.$message.warning( this.i18nt('render.hint.uploadExceed').replace('${uploadLimit}', uploadLimit) )
},
handlePicturePreview(file) {
this.previewUrl = file.url
this.showPreviewDialogFlag = true
},
beforePictureUpload(file) {
let fileTypeCheckResult = false
if (!!this.field.options && !!this.field.options.fileTypes) {

View File

@ -1,6 +1,6 @@
<template>
<div class="field-wrapper" :class="{'design-time-bottom-margin': !!this.designer}" :style="{display: displayStyle}">
<div class="static-content-item" v-show="!field.options.hidden || (designState === true)" :style="{display: displayStyle}"
<div class="static-content-item" v-if="!field.options.hidden || (designState === true)" :style="{display: displayStyle}"
:class="[selected ? 'selected' : '', customClass]" @click.stop="selectField(field)">
<slot></slot>
</div>

View File

@ -69,6 +69,7 @@
<el-button v-if="false" @click="printFormJson">PrintFormJson</el-button>
<el-button v-if="false" @click="testValidate">TestValidate</el-button>
<el-button v-if="false" @click="testSetFormData">TestSF</el-button>
<el-button v-if="false" @click="testReloadOptionData">Test ROD</el-button>
</div>
</el-dialog>
@ -238,7 +239,13 @@
{label: '01', value: 1},
{label: '22', value: 2},
{label: '333', value: 3},
]
],
'select001': [
{label: '辣椒', value: 1},
{label: '菠萝', value: 2},
{label: '丑橘子', value: 3},
],
},
}
@ -618,6 +625,16 @@
this.$refs['preForm'].setFormData(nfData)
},
testReloadOptionData() {
this.testOptionData['select001'].push({
label: 'aaa',
value: 888
})
//this.$refs.preForm.reloadOptionData()
this.$refs.preForm.reloadOptionData('select001')
},
handleFormChange(fieldName, newValue, oldValue, formModel) {
/*
console.log('---formChange start---')

View File

@ -152,7 +152,7 @@ export function traverseFieldWidgets(widgetList, handler, parent = null) {
})
}
export function traverseContainWidgets(widgetList, handler) {
export function traverseContainerWidgets(widgetList, handler) {
widgetList.forEach(w => {
if (w.category === 'container') {
handler(w)
@ -160,22 +160,22 @@ export function traverseContainWidgets(widgetList, handler) {
if (w.type === 'grid') {
w.cols.forEach(col => {
traverseContainWidgets(col.widgetList, handler)
traverseContainerWidgets(col.widgetList, handler)
})
} else if (w.type === 'table') {
w.rows.forEach(row => {
row.cols.forEach(cell => {
traverseContainWidgets(cell.widgetList, handler)
traverseContainerWidgets(cell.widgetList, handler)
})
})
} else if (w.type === 'tab') {
w.tabs.forEach(tab => {
traverseContainWidgets(tab.widgetList, handler)
traverseContainerWidgets(tab.widgetList, handler)
})
} else if (w.type === 'sub-form') {
traverseContainWidgets(w.widgetList, handler)
traverseContainerWidgets(w.widgetList, handler)
} else if (w.category === 'container') { //自定义容器
traverseContainWidgets(w.widgetList, handler)
traverseContainerWidgets(w.widgetList, handler)
}
})
}
@ -286,7 +286,7 @@ export function getAllContainerWidgets(widgetList) {
container: w
})
}
traverseContainWidgets(widgetList, handlerFn)
traverseContainerWidgets(widgetList, handlerFn)
return result
}

View File

@ -1,4 +1,4 @@
import {isNotNull, traverseContainWidgets, traverseFieldWidgets} from "@/utils/util";
import {isNotNull, traverseContainerWidgets, traverseFieldWidgets} from "@/utils/util";
import {translate} from "@/utils/i18n";
import FormValidators, {getRegExp} from "@/utils/validators";
@ -79,7 +79,7 @@ export function buildActiveTabs(formConfig, widgetList) {
cw.tabs.length > 0 && resultList.push(`'${cop.name}ActiveTab': '${cw.tabs[0].options.name}',`)
}
}
traverseContainWidgets(widgetList, handlerFn)
traverseContainerWidgets(widgetList, handlerFn)
return resultList
}