bugfix 解决一部分0703反馈bug
This commit is contained in:
@@ -8,20 +8,40 @@
|
||||
:key="opt.prop"
|
||||
:label="opt.label ? opt.label : null"
|
||||
:prop="opt.prop ?? '' + index"
|
||||
:rules="opt.bind?.rules ? opt.bind.rules : undefined"
|
||||
>
|
||||
<el-input v-if="opt.input" v-model="dataForm[opt.prop]" v-bind="opt.bind" clearable size="small" />
|
||||
<el-select v-if="opt.select" v-model="dataForm[opt.prop]" v-bind="opt.bind" clearable size="small">
|
||||
<el-option v-for="item in opt.select" :key="item.value + Math.random().toString()" :label="item.label" :value="item.value" />
|
||||
:rules="opt.bind?.rules ? opt.bind.rules : undefined">
|
||||
<el-input
|
||||
v-if="opt.input"
|
||||
v-model="dataForm[opt.prop]"
|
||||
v-bind="opt.bind"
|
||||
clearable
|
||||
size="small"
|
||||
@keydown.enter.native.prevent="handleBtnClick('查询')" />
|
||||
<el-select
|
||||
v-if="opt.select"
|
||||
v-model="dataForm[opt.prop]"
|
||||
v-bind="opt.bind"
|
||||
clearable
|
||||
size="small"
|
||||
@keydown.enter.native.prevent="handleBtnClick('查询')">
|
||||
<el-option
|
||||
v-for="item in opt.select"
|
||||
:key="item.value + Math.random().toString()"
|
||||
:label="item.label"
|
||||
:value="item.value" />
|
||||
</el-select>
|
||||
<el-date-picker v-if="opt.timerange" v-model="dataForm[opt.prop]" v-bind="opt.bind" clearable size="small" />
|
||||
<el-date-picker
|
||||
v-if="opt.timerange"
|
||||
v-model="dataForm[opt.prop]"
|
||||
v-bind="opt.bind"
|
||||
clearable
|
||||
size="small"
|
||||
@keydown.enter.native.prevent="handleBtnClick('查询')" />
|
||||
<el-upload
|
||||
v-if="opt.upload"
|
||||
size="small"
|
||||
:key="'upload_' + Math.random().toString()"
|
||||
class="inline-block pl-3"
|
||||
action="https://jsonplaceholder.typicode.com/posts/"
|
||||
>
|
||||
action="https://jsonplaceholder.typicode.com/posts/">
|
||||
<el-button type="primary">上传文件</el-button>
|
||||
</el-upload>
|
||||
<el-button
|
||||
@@ -30,9 +50,9 @@
|
||||
size="small"
|
||||
:type="opt.button.type"
|
||||
v-bind="opt.bind"
|
||||
@click="handleBtnClick(opt.button.name)"
|
||||
>{{ opt.button.name }}</el-button
|
||||
>
|
||||
@click="handleBtnClick(opt.button.name)">
|
||||
{{ opt.button.name }}
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-row>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
:visible="dialogVisible"
|
||||
:destroy-on-close="false"
|
||||
@close="handleClose"
|
||||
:close-on-click-modal="configs.clickModalToClose ?? true">
|
||||
:close-on-click-modal="configs.clickModalToClose ?? false">
|
||||
<!-- title -->
|
||||
<div slot="title" class="dialog-title">
|
||||
<h1 class="">
|
||||
@@ -497,16 +497,18 @@ export default {
|
||||
setTimeout(
|
||||
() => {
|
||||
Object.keys(this.dataForm).forEach((key) => {
|
||||
console.log('reset form, key', key)
|
||||
if (excludeId && key === "id") return;
|
||||
if ("files" in this.dataForm) this.dataForm.files = [];
|
||||
if ("fileIds" in this.dataForm) this.dataForm.fileIds = [];
|
||||
else this.dataForm[key] = null;
|
||||
else if ("fileIds" in this.dataForm) this.dataForm.fileIds = [];
|
||||
else this.$set(this.dataForm, key, null)
|
||||
if (Array.isArray(this.fileList)) {
|
||||
this.fileList = [];
|
||||
}
|
||||
});
|
||||
this.activeMenu = this.configs.menu[0].name;
|
||||
this.$refs.dataForm[0].clearValidate();
|
||||
this.$refs.dataForm[0].resetFields();
|
||||
console.log("清除Form...", this.dataForm);
|
||||
},
|
||||
immediate ? 0 : 200
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user