parent
db3d7d5063
commit
07c9f5f846
|
@ -8,7 +8,7 @@
|
||||||
:with-credentials="field.options.withCredentials"
|
:with-credentials="field.options.withCredentials"
|
||||||
:multiple="field.options.multipleSelect" :file-list="fileList" :show-file-list="field.options.showFileList"
|
:multiple="field.options.multipleSelect" :file-list="fileList" :show-file-list="field.options.showFileList"
|
||||||
list-type="picture-card" :class="{'hideUploadDiv': uploadBtnHidden}"
|
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"
|
:before-upload="beforePictureUpload"
|
||||||
:on-success="handlePictureUpload" :on-error="handleUploadError" :on-remove="handlePictureRemove">
|
:on-success="handlePictureUpload" :on-error="handleUploadError" :on-remove="handlePictureRemove">
|
||||||
<div slot="tip" class="el-upload__tip"
|
<div slot="tip" class="el-upload__tip"
|
||||||
|
@ -119,6 +119,11 @@
|
||||||
this.$message.warning( this.i18nt('render.hint.uploadExceed').replace('${uploadLimit}', uploadLimit) )
|
this.$message.warning( this.i18nt('render.hint.uploadExceed').replace('${uploadLimit}', uploadLimit) )
|
||||||
},
|
},
|
||||||
|
|
||||||
|
handlePicturePreview(file) {
|
||||||
|
this.previewUrl = file.url
|
||||||
|
this.showPreviewDialogFlag = true
|
||||||
|
},
|
||||||
|
|
||||||
beforePictureUpload(file) {
|
beforePictureUpload(file) {
|
||||||
let fileTypeCheckResult = false
|
let fileTypeCheckResult = false
|
||||||
if (!!this.field.options && !!this.field.options.fileTypes) {
|
if (!!this.field.options && !!this.field.options.fileTypes) {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="field-wrapper" :class="{'design-time-bottom-margin': !!this.designer}" :style="{display: displayStyle}">
|
<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)">
|
:class="[selected ? 'selected' : '', customClass]" @click.stop="selectField(field)">
|
||||||
<slot></slot>
|
<slot></slot>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -69,6 +69,7 @@
|
||||||
<el-button v-if="false" @click="printFormJson">PrintFormJson</el-button>
|
<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="testValidate">TestValidate</el-button>
|
||||||
<el-button v-if="false" @click="testSetFormData">TestSF</el-button>
|
<el-button v-if="false" @click="testSetFormData">TestSF</el-button>
|
||||||
|
<el-button v-if="false" @click="testReloadOptionData">Test ROD</el-button>
|
||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
|
@ -238,7 +239,13 @@
|
||||||
{label: '01', value: 1},
|
{label: '01', value: 1},
|
||||||
{label: '22', value: 2},
|
{label: '22', value: 2},
|
||||||
{label: '333', value: 3},
|
{label: '333', value: 3},
|
||||||
]
|
],
|
||||||
|
|
||||||
|
'select001': [
|
||||||
|
{label: '辣椒', value: 1},
|
||||||
|
{label: '菠萝', value: 2},
|
||||||
|
{label: '丑橘子', value: 3},
|
||||||
|
],
|
||||||
},
|
},
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -618,6 +625,16 @@
|
||||||
this.$refs['preForm'].setFormData(nfData)
|
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) {
|
handleFormChange(fieldName, newValue, oldValue, formModel) {
|
||||||
/*
|
/*
|
||||||
console.log('---formChange start---')
|
console.log('---formChange start---')
|
||||||
|
|
|
@ -152,7 +152,7 @@ export function traverseFieldWidgets(widgetList, handler, parent = null) {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export function traverseContainWidgets(widgetList, handler) {
|
export function traverseContainerWidgets(widgetList, handler) {
|
||||||
widgetList.forEach(w => {
|
widgetList.forEach(w => {
|
||||||
if (w.category === 'container') {
|
if (w.category === 'container') {
|
||||||
handler(w)
|
handler(w)
|
||||||
|
@ -160,22 +160,22 @@ export function traverseContainWidgets(widgetList, handler) {
|
||||||
|
|
||||||
if (w.type === 'grid') {
|
if (w.type === 'grid') {
|
||||||
w.cols.forEach(col => {
|
w.cols.forEach(col => {
|
||||||
traverseContainWidgets(col.widgetList, handler)
|
traverseContainerWidgets(col.widgetList, handler)
|
||||||
})
|
})
|
||||||
} else if (w.type === 'table') {
|
} else if (w.type === 'table') {
|
||||||
w.rows.forEach(row => {
|
w.rows.forEach(row => {
|
||||||
row.cols.forEach(cell => {
|
row.cols.forEach(cell => {
|
||||||
traverseContainWidgets(cell.widgetList, handler)
|
traverseContainerWidgets(cell.widgetList, handler)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
} else if (w.type === 'tab') {
|
} else if (w.type === 'tab') {
|
||||||
w.tabs.forEach(tab => {
|
w.tabs.forEach(tab => {
|
||||||
traverseContainWidgets(tab.widgetList, handler)
|
traverseContainerWidgets(tab.widgetList, handler)
|
||||||
})
|
})
|
||||||
} else if (w.type === 'sub-form') {
|
} else if (w.type === 'sub-form') {
|
||||||
traverseContainWidgets(w.widgetList, handler)
|
traverseContainerWidgets(w.widgetList, handler)
|
||||||
} else if (w.category === 'container') { //自定义容器
|
} else if (w.category === 'container') { //自定义容器
|
||||||
traverseContainWidgets(w.widgetList, handler)
|
traverseContainerWidgets(w.widgetList, handler)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -286,7 +286,7 @@ export function getAllContainerWidgets(widgetList) {
|
||||||
container: w
|
container: w
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
traverseContainWidgets(widgetList, handlerFn)
|
traverseContainerWidgets(widgetList, handlerFn)
|
||||||
|
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import {isNotNull, traverseContainWidgets, traverseFieldWidgets} from "@/utils/util";
|
import {isNotNull, traverseContainerWidgets, traverseFieldWidgets} from "@/utils/util";
|
||||||
import {translate} from "@/utils/i18n";
|
import {translate} from "@/utils/i18n";
|
||||||
import FormValidators, {getRegExp} from "@/utils/validators";
|
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}',`)
|
cw.tabs.length > 0 && resultList.push(`'${cop.name}ActiveTab': '${cw.tabs[0].options.name}',`)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
traverseContainWidgets(widgetList, handlerFn)
|
traverseContainerWidgets(widgetList, handlerFn)
|
||||||
|
|
||||||
return resultList
|
return resultList
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue