bugfix 解决一部分0703反馈bug

This commit is contained in:
lb
2023-07-04 14:18:08 +08:00
parent f4be2d1efe
commit 9c3133aa29
12 changed files with 104 additions and 119 deletions

View File

@@ -6,26 +6,45 @@
<div class="actual-form">
<el-form :inline="true" :model="dataForm" :rules="headConfig.rules">
<!-- <el-col :span="opt.span ? +opt.span : 4" v-for="opt in options" :key="opt.id"> -->
<el-form-item
v-for="(opt, index) in headConfig.fields"
: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
@@ -34,9 +53,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>
</div>
@@ -61,21 +80,7 @@ export default {
dataForm: {},
};
},
// 这个 watch 出现得没啥必要......
// watch: {
// dataForm: {
// handler: (val) => {
// console.log("[BaseSearchForm::watcher::dataForm]", val);
// },
// deep: true,
// },
// },
created() {},
mounted() {
// console.log("[BaseSearchForm] configs:", JSON.parse(JSON.stringify(this.headConfig)));
this.headConfig.fields.forEach((field, index) => {
// 没有 field.prop ,则为按钮之类的
if (!field.prop) return;

View File

@@ -410,7 +410,7 @@ export default {
if (res.code === 0) {
this.$message.success(method === "POST" ? "添加成功" : "更新成功");
this.$emit("refreshDataList");
if (method === "POST") this.handleClose();
this.handleClose();
} else {
this.$message({
message: `${res.code}: ${res.msg}`,

View File

@@ -35,7 +35,8 @@
v-if="renderDialog"
fullscreen
:configs="dialogConfig"
@destroy-dialog="renderDialog = false" />
@destroy-dialog="renderDialog = false"
@refreshDataList="getAList(Object.assign({}, listQuery, extraSearchConditions, params));" />
<DialogWithMenu
modal-append-to-body
@@ -43,7 +44,8 @@
v-if="renderMenuDialog"
fullscreen
:configs="dialogConfig"
@destroy-dialog="renderMenuDialog = false" />
@destroy-dialog="renderMenuDialog = false"
@refreshDataList="getAList(Object.assign({}, listQuery, extraSearchConditions, params));" />
<DialogUpload
ref="uploadDialog"