|
|
@@ -10,13 +10,14 @@ |
|
|
|
: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 /> |
|
|
|
<el-select v-if="opt.select" v-model="dataForm[opt.prop]" v-bind="opt.bind" clearable> |
|
|
|
<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" :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 /> |
|
|
|
<el-date-picker v-if="opt.timerange" v-model="dataForm[opt.prop]" v-bind="opt.bind" clearable size="small" /> |
|
|
|
<el-upload |
|
|
|
v-if="opt.upload" |
|
|
|
size="small" |
|
|
|
:key="'upload_' + Math.random().toString()" |
|
|
|
class="inline-block pl-3" |
|
|
|
action="https://jsonplaceholder.typicode.com/posts/" |
|
|
@@ -26,7 +27,9 @@ |
|
|
|
<el-button |
|
|
|
v-if="opt.button && (!opt.button.permission || $hasPermission(opt.button.permission))" |
|
|
|
:key="'button' + Math.random().toString()" |
|
|
|
size="small" |
|
|
|
:type="opt.button.type" |
|
|
|
v-bind="opt.bind" |
|
|
|
@click="handleBtnClick(opt.button.name)" |
|
|
|
>{{ opt.button.name }}</el-button |
|
|
|
> |
|
|
@@ -37,7 +40,7 @@ |
|
|
|
|
|
|
|
<script> |
|
|
|
export default { |
|
|
|
name: "", |
|
|
|
name: "BaseSearchForm", |
|
|
|
props: { |
|
|
|
headConfig: { |
|
|
|
type: Object, |
|
|
@@ -65,7 +68,7 @@ export default { |
|
|
|
console.log("[BaseSearchForm] configs:", JSON.parse(JSON.stringify(this.headConfig))); |
|
|
|
|
|
|
|
this.headConfig.fields.forEach((field, index) => { |
|
|
|
// 没有 field.prop ,则为按钮之类的 |
|
|
|
// 没有 field.prop ,则为按钮之类的 |
|
|
|
if (!field.prop) return; |
|
|
|
|
|
|
|
if (!this.dataForm[field.prop]) { |
|
|
|