Files
cn-rdms-web/src/views/feedback/modules/feedback-search.vue
dk bc5815416b fix(工作反馈、工作日志): 添加超大尺寸对话框预设并优化反馈搜索功能。
- 在 BusinessFormDialog 组件中添加 xl 尺寸预设,宽度设置为 1200px
- 移除 feedback-search.vue 中废弃的 useDict 钩子导入
- 将反馈搜索的状态选择器从普通下拉改为字典类型,统一值转换逻辑
- 更新反馈初始搜索参数中的状态值类型从数字改为字符串
- 任务工时对话框使用 xl 预设以获得更大显示区域
2026-07-03 17:34:48 +08:00

66 lines
2.0 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<script setup lang="ts">
import { computed, onMounted, ref } from 'vue';
import { FEEDBACK_STATUS_DICT_CODE } from '@/constants/dict';
import { fetchGetUserSimpleList } from '@/service/api';
import TableSearchFields, { type SearchField } from '@/components/custom/table-search-fields.vue';
defineOptions({ name: 'FeedbackSearch' });
const emit = defineEmits<{
reset: [];
search: [];
}>();
const model = defineModel<Api.Feedback.FeedbackSearchParams>('model', { required: true });
// 提交人下拉选项全员简表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
},
{
key: 'status',
label: '状态',
type: 'dict',
dictCode: FEEDBACK_STATUS_DICT_CODE,
placeholder: '请选择状态',
resolveValue: value => (value === null || value === undefined || value === '' ? undefined : String(value)),
transformValue: value => (value === null || value === undefined || value === '' ? undefined : String(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');
}
function search() {
// 输入期不实时 trim避免受控 input 吃掉词间空格;提交前规整一次,空串归一为 undefined
model.value.title = model.value.title?.trim() || undefined;
emit('search');
}
onMounted(loadUserOptions);
</script>
<template>
<TableSearchFields v-model="model" :fields="fields" :columns="4" @reset="reset" @search="search" />
</template>
<style scoped></style>