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

@@ -98,7 +98,7 @@ function serializeAttachments(attachments: Api.Project.AttachmentItem[]): string
return attachments.length ? JSON.stringify(attachments) : ''; return attachments.length ? JSON.stringify(attachments) : '';
} }
/** 分页(全量,不按提交人过滤;默认 createTime 倒序由后端保证) */ /** 分页(支持按提交人 creator 过滤;默认 createTime 倒序由后端保证) */
export async function fetchGetFeedbackPage(params: Api.Feedback.FeedbackSearchParams) { export async function fetchGetFeedbackPage(params: Api.Feedback.FeedbackSearchParams) {
const result = await request<FeedbackPageResponse>({ const result = await request<FeedbackPageResponse>({
...safeJsonRequestConfig, ...safeJsonRequestConfig,

View File

@@ -15,6 +15,8 @@ declare namespace Api {
status?: string | number | null; status?: string | number | null;
/** 标题关键词,模糊匹配 */ /** 标题关键词,模糊匹配 */
title?: string; title?: string;
/** 提交人用户 id按提交人过滤ID 铁律 string */
creator?: string;
} }
/** /**

View File

@@ -138,7 +138,6 @@ declare module 'vue' {
IconMdiPencilOutline: typeof import('~icons/mdi/pencil-outline')['default'] IconMdiPencilOutline: typeof import('~icons/mdi/pencil-outline')['default']
IconMdiPlus: typeof import('~icons/mdi/plus')['default'] IconMdiPlus: typeof import('~icons/mdi/plus')['default']
IconMdiRefresh: typeof import('~icons/mdi/refresh')['default'] IconMdiRefresh: typeof import('~icons/mdi/refresh')['default']
IconMdiTagOutline: typeof import('~icons/mdi/tag-outline')['default']
IconMdiUpload: typeof import('~icons/mdi/upload')['default'] IconMdiUpload: typeof import('~icons/mdi/upload')['default']
IconUilSearch: typeof import('~icons/uil/search')['default'] IconUilSearch: typeof import('~icons/uil/search')['default']
LangSwitch: typeof import('./../components/common/lang-switch.vue')['default'] LangSwitch: typeof import('./../components/common/lang-switch.vue')['default']

View File

@@ -45,7 +45,7 @@ function canEditRow(row: Api.Feedback.FeedbackItem) {
} }
function getInitSearchParams(): Api.Feedback.FeedbackSearchParams { function getInitSearchParams(): Api.Feedback.FeedbackSearchParams {
return { pageNo: 1, pageSize: 20, type: undefined, status: undefined, title: undefined }; return { pageNo: 1, pageSize: 20, type: undefined, status: undefined, title: undefined, creator: undefined };
} }
function transformPageResult( function transformPageResult(
@@ -220,9 +220,10 @@ function handleSearch() {
getDataByPage(1); getDataByPage(1);
} }
// 搜索区「重置」清搜索区自有字段(标题);左侧分面选中的 type/status 由分面单独控制,不在此连带清除 // 搜索区「重置」清搜索区自有字段(标题、提交人);左侧分面选中的 type/status 由分面单独控制,不在此连带清除
function resetSearchParams() { function resetSearchParams() {
searchParams.title = undefined; searchParams.title = undefined;
searchParams.creator = undefined;
searchParams.pageNo = 1; searchParams.pageNo = 1;
getDataByPage(1); getDataByPage(1);
} }

View File

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