fix(projects): 微调布局显示

This commit is contained in:
2026-06-29 09:53:24 +08:00
parent 499f2115b2
commit 4f357a35a9
5 changed files with 33 additions and 7 deletions

View File

@@ -1,4 +1,6 @@
<script setup lang="ts">
import { computed, onMounted, ref } from 'vue';
import { fetchGetUserSimpleList } from '@/service/api';
import TableSearchFields, { type SearchField } from '@/components/custom/table-search-fields.vue';
defineOptions({ name: 'FeedbackSearch' });
@@ -10,8 +12,28 @@ const emit = defineEmits<{
const model = defineModel<Api.Feedback.FeedbackSearchParams>('model', { required: true });
// 分类 / 状态筛选已迁移至左侧分面面板,搜索区只保留标题关键词
const fields: SearchField[] = [{ key: 'title', label: '标题', type: 'input', placeholder: '请输入标题关键词' }];
// 提交人下拉选项全员简易列表value 取用户 idID 铁律 string
const userOptions = ref<{ label: string; value: string }[]>([]);
// 分类 / 状态筛选已迁移至左侧分面面板,搜索区保留标题关键词 + 提交人
const fields = computed<SearchField[]>(() => [
{ key: 'title', label: '标题', type: 'input', placeholder: '请输入标题关键词' },
{
key: 'creator',
label: '提交人',
type: 'select',
placeholder: '请选择提交人',
filterable: true,
options: userOptions.value
}
]);
async function loadUserOptions() {
const { data, error } = await fetchGetUserSimpleList();
if (!error && data) {
userOptions.value = data.map(item => ({ label: item.nickname, value: item.id }));
}
}
function reset() {
emit('reset');
@@ -22,10 +44,12 @@ function search() {
model.value.title = model.value.title?.trim() || undefined;
emit('search');
}
onMounted(loadUserOptions);
</script>
<template>
<TableSearchFields v-model="model" :fields="fields" :columns="2" @reset="reset" @search="search" />
<TableSearchFields v-model="model" :fields="fields" :columns="4" @reset="reset" @search="search" />
</template>
<style scoped></style>