|
@@ -5,7 +5,7 @@
|
|
|
<a-form :model="formState" layout="inline">
|
|
|
<a-form-item v-for="(item, index) in showIcon ? data : InitialData" :key="index" :label="item.label"
|
|
|
:field="item.field" :wrapper-col-style="{ marginBottom: '20px' }">
|
|
|
- <component :is="'a-' + item.type" v-model="formState[item.field].value"
|
|
|
+ <component :is="'a-' + item.type" v-model="formState[item.field]"
|
|
|
:placeholder="item.type == 'input' ? '请输入' : '请选择' + item.label" allow-clear
|
|
|
:style="{ width: item.width ? item.width + 'px' : '' }">
|
|
|
<template v-if="item.type == 'select'">
|
|
@@ -18,13 +18,12 @@
|
|
|
<a-form-item>
|
|
|
<a-button type="primary" @click="handleQuery">查询</a-button>
|
|
|
<a-button @click="handleReset" style="margin-left: 10px;">重置</a-button>
|
|
|
+ <div v-if="show" @click="showIcon = !showIcon" class="icon">
|
|
|
+ {{ showIcon ? '折叠' : '展开' }} <icon-down :rotate="showIcon ? 180 : 0" />
|
|
|
+ </div>
|
|
|
</a-form-item>
|
|
|
</a-form>
|
|
|
</div>
|
|
|
-
|
|
|
- <div v-if="show" @click="showIcon = !showIcon" class="icon">
|
|
|
- {{ showIcon ? '折叠' : '展开' }} <icon-down :rotate="showIcon ? 180 : 0" />
|
|
|
- </div>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -74,9 +73,7 @@ const data = ref()
|
|
|
|
|
|
const emit = defineEmits(['query'])
|
|
|
SearchForm.value.forEach(item => {
|
|
|
- formState.value[item.field] = {
|
|
|
- value: item.value,
|
|
|
- };
|
|
|
+ formState.value[item.field] = item.value;
|
|
|
});
|
|
|
|
|
|
// 字典加载
|
|
@@ -111,7 +108,6 @@ watch(
|
|
|
|
|
|
// 查询操作
|
|
|
const handleQuery = () => {
|
|
|
- // 将表单数据通过事件传递给父组件
|
|
|
emit('query', formState.value);
|
|
|
};
|
|
|
|
|
@@ -129,15 +125,17 @@ const handleReset = () => {
|
|
|
justify-content: space-between;
|
|
|
}
|
|
|
|
|
|
-.Form{
|
|
|
+.Form {
|
|
|
width: 95%;
|
|
|
}
|
|
|
|
|
|
-.icon{
|
|
|
+.icon {
|
|
|
display: flex;
|
|
|
// align-items: center;
|
|
|
color: #3491fa;
|
|
|
- font-size: 18px;
|
|
|
+ font-size: 15px;
|
|
|
cursor: pointer;
|
|
|
+ font-weight: 600;
|
|
|
+ margin-left: 15px;
|
|
|
}
|
|
|
</style>
|