fix(projects): 微调布局显示
This commit is contained in:
@@ -98,7 +98,7 @@ function serializeAttachments(attachments: Api.Project.AttachmentItem[]): string
|
||||
return attachments.length ? JSON.stringify(attachments) : '';
|
||||
}
|
||||
|
||||
/** 分页(全量,不按提交人过滤;默认 createTime 倒序由后端保证) */
|
||||
/** 分页(支持按提交人 creator 过滤;默认 createTime 倒序由后端保证) */
|
||||
export async function fetchGetFeedbackPage(params: Api.Feedback.FeedbackSearchParams) {
|
||||
const result = await request<FeedbackPageResponse>({
|
||||
...safeJsonRequestConfig,
|
||||
|
||||
2
src/typings/api/feedback.d.ts
vendored
2
src/typings/api/feedback.d.ts
vendored
@@ -15,6 +15,8 @@ declare namespace Api {
|
||||
status?: string | number | null;
|
||||
/** 标题关键词,模糊匹配 */
|
||||
title?: string;
|
||||
/** 提交人用户 id(按提交人过滤;ID 铁律 string) */
|
||||
creator?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
1
src/typings/components.d.ts
vendored
1
src/typings/components.d.ts
vendored
@@ -138,7 +138,6 @@ declare module 'vue' {
|
||||
IconMdiPencilOutline: typeof import('~icons/mdi/pencil-outline')['default']
|
||||
IconMdiPlus: typeof import('~icons/mdi/plus')['default']
|
||||
IconMdiRefresh: typeof import('~icons/mdi/refresh')['default']
|
||||
IconMdiTagOutline: typeof import('~icons/mdi/tag-outline')['default']
|
||||
IconMdiUpload: typeof import('~icons/mdi/upload')['default']
|
||||
IconUilSearch: typeof import('~icons/uil/search')['default']
|
||||
LangSwitch: typeof import('./../components/common/lang-switch.vue')['default']
|
||||
|
||||
@@ -45,7 +45,7 @@ function canEditRow(row: Api.Feedback.FeedbackItem) {
|
||||
}
|
||||
|
||||
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(
|
||||
@@ -220,9 +220,10 @@ function handleSearch() {
|
||||
getDataByPage(1);
|
||||
}
|
||||
|
||||
// 搜索区「重置」只清搜索区自有字段(标题);左侧分面选中的 type/status 由分面单独控制,不在此连带清除
|
||||
// 搜索区「重置」清搜索区自有字段(标题、提交人);左侧分面选中的 type/status 由分面单独控制,不在此连带清除
|
||||
function resetSearchParams() {
|
||||
searchParams.title = undefined;
|
||||
searchParams.creator = undefined;
|
||||
searchParams.pageNo = 1;
|
||||
getDataByPage(1);
|
||||
}
|
||||
|
||||
@@ -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 取用户 id,ID 铁律 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>
|
||||
|
||||
Reference in New Issue
Block a user