This commit is contained in:
2025-03-18 16:56:15 +08:00
parent 11b632d4a9
commit 824f0ed09d
8 changed files with 579 additions and 37 deletions

View File

@@ -38,40 +38,44 @@ const reset = () => {
<div class="flex">
<div class="flex-grow">
<a-form class="AFORM">
<div class="grid grid-cols-3">
<a-form
:auto-label-width="true"
class="AFORM">
<a-row :gutter="24">
<template v-for="(item, index) in config" :key="index">
<a-form-item :label="item.label">
<template v-if="item.type === FROM_TYPE.INPUT">
<a-input
class="w-full"
v-model:model-value="from[item.key]"
:placeholder="item.placeholder">
</a-input>
</template>
<a-col :span="item.span || 8">
<a-form-item :label="item.label">
<template v-if="item.type === FROM_TYPE.INPUT">
<a-input
class="w-full"
v-model:model-value="from[item.key]"
:placeholder="item.placeholder">
</a-input>
</template>
<template v-if="item.type === FROM_TYPE.SELECT">
<x-select
class="w-full"
v-model:model-value="from[item.key]"
:placeholder="item.placeholder"
:api="item.api">
</x-select>
</template>
<template v-if="item.type === FROM_TYPE.SELECT">
<x-select
class="w-full"
v-model:model-value="from[item.key]"
:placeholder="item.placeholder"
:api="item.api">
</x-select>
</template>
<template v-if="item.type === FROM_TYPE.DATETIME">
<a-range-picker
class="w-full"
@change="(v) => from[item.key] = `${v[0]}~${v[1]}`">
</a-range-picker>
</template>
<template v-if="item.type === FROM_TYPE.DATETIME">
<a-range-picker
class="w-full"
@change="(v) => from[item.key] = `${v[0]}~${v[1]}`">
</a-range-picker>
</template>
<template v-if="item.type === FROM_TYPE.CUSTOM">
<slot :name="item.slotName" :scope="item"></slot>
</template>
</a-form-item>
<template v-if="item.type === FROM_TYPE.CUSTOM">
<slot :name="item.slotName" :scope="item"></slot>
</template>
</a-form-item>
</a-col>
</template>
</div>
</a-row>
</a-form>
</div>
@@ -86,7 +90,7 @@ const reset = () => {
</a-button>
<a-button @click="reset">
<template #icon>
<icon-refresh />
<icon-refresh/>
</template>
重置
</a-button>
@@ -104,9 +108,13 @@ const reset = () => {
text-align: left;
margin-bottom: 16px;
}
.AFORM {
:deep(.arco-row) {
margin-bottom: 16px;
}
:deep(.arco-form-item-label) {
@apply whitespace-nowrap;
}
}
</style>