fix(工作反馈、工作日志): 添加超大尺寸对话框预设并优化反馈搜索功能。
- 在 BusinessFormDialog 组件中添加 xl 尺寸预设,宽度设置为 1200px - 移除 feedback-search.vue 中废弃的 useDict 钩子导入 - 将反馈搜索的状态选择器从普通下拉改为字典类型,统一值转换逻辑 - 更新反馈初始搜索参数中的状态值类型从数字改为字符串 - 任务工时对话框使用 xl 预设以获得更大显示区域
This commit is contained in:
@@ -7,7 +7,7 @@ defineOptions({
|
|||||||
inheritAttrs: false
|
inheritAttrs: false
|
||||||
});
|
});
|
||||||
|
|
||||||
type DialogPreset = 'sm' | 'md' | 'lg';
|
type DialogPreset = 'sm' | 'md' | 'lg' | 'xl';
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
title: string;
|
title: string;
|
||||||
@@ -50,7 +50,8 @@ const visible = defineModel<boolean>({
|
|||||||
const DIALOG_WIDTH_MAP: Record<DialogPreset, string> = {
|
const DIALOG_WIDTH_MAP: Record<DialogPreset, string> = {
|
||||||
sm: '520px',
|
sm: '520px',
|
||||||
md: '720px',
|
md: '720px',
|
||||||
lg: '960px'
|
lg: '960px',
|
||||||
|
xl: '1200px'
|
||||||
};
|
};
|
||||||
|
|
||||||
const dialogWidth = computed(() => props.width ?? DIALOG_WIDTH_MAP[props.preset]);
|
const dialogWidth = computed(() => props.width ?? DIALOG_WIDTH_MAP[props.preset]);
|
||||||
|
|||||||
@@ -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: 1, title: undefined, creator: undefined };
|
return { pageNo: 1, pageSize: 20, type: undefined, status: '1', title: undefined, creator: undefined };
|
||||||
}
|
}
|
||||||
|
|
||||||
function transformPageResult(
|
function transformPageResult(
|
||||||
|
|||||||
@@ -2,7 +2,6 @@
|
|||||||
import { computed, onMounted, ref } from 'vue';
|
import { computed, onMounted, ref } from 'vue';
|
||||||
import { FEEDBACK_STATUS_DICT_CODE } from '@/constants/dict';
|
import { FEEDBACK_STATUS_DICT_CODE } from '@/constants/dict';
|
||||||
import { fetchGetUserSimpleList } from '@/service/api';
|
import { fetchGetUserSimpleList } from '@/service/api';
|
||||||
import { useDict } from '@/hooks/business/dict';
|
|
||||||
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' });
|
||||||
@@ -14,9 +13,8 @@ const emit = defineEmits<{
|
|||||||
|
|
||||||
const model = defineModel<Api.Feedback.FeedbackSearchParams>('model', { required: true });
|
const model = defineModel<Api.Feedback.FeedbackSearchParams>('model', { required: true });
|
||||||
|
|
||||||
// 提交人下拉选项(全员简易列表;value 取用户 id,ID 铁律 string)
|
// 提交人下拉选项(全员简表;value 使用用户 id,ID 铁律 string)
|
||||||
const userOptions = ref<{ label: string; value: string }[]>([]);
|
const userOptions = ref<{ label: string; value: string }[]>([]);
|
||||||
const { dictOptions: statusOptions } = useDict(FEEDBACK_STATUS_DICT_CODE);
|
|
||||||
|
|
||||||
// 分类保留在左侧分面;搜索区补充标题关键词、提交人、状态
|
// 分类保留在左侧分面;搜索区补充标题关键词、提交人、状态
|
||||||
const fields = computed<SearchField[]>(() => [
|
const fields = computed<SearchField[]>(() => [
|
||||||
@@ -32,9 +30,11 @@ const fields = computed<SearchField[]>(() => [
|
|||||||
{
|
{
|
||||||
key: 'status',
|
key: 'status',
|
||||||
label: '状态',
|
label: '状态',
|
||||||
type: 'select',
|
type: 'dict',
|
||||||
|
dictCode: FEEDBACK_STATUS_DICT_CODE,
|
||||||
placeholder: '请选择状态',
|
placeholder: '请选择状态',
|
||||||
options: statusOptions.value
|
resolveValue: value => (value === null || value === undefined || value === '' ? undefined : String(value)),
|
||||||
|
transformValue: value => (value === null || value === undefined || value === '' ? undefined : String(value))
|
||||||
}
|
}
|
||||||
]);
|
]);
|
||||||
|
|
||||||
@@ -50,7 +50,7 @@ function reset() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function search() {
|
function search() {
|
||||||
// 输入期不实时 trim(避免受控 input 吃掉词间空格);提交前规整一次,空串归一为 undefined
|
// 输入期不实时 trim,避免受控 input 吃掉词间空格;提交前规整一次,空串归一为 undefined
|
||||||
model.value.title = model.value.title?.trim() || undefined;
|
model.value.title = model.value.title?.trim() || undefined;
|
||||||
emit('search');
|
emit('search');
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ watch(visible, value => {
|
|||||||
<BusinessFormDialog
|
<BusinessFormDialog
|
||||||
v-model="visible"
|
v-model="visible"
|
||||||
:title="dialogTitle"
|
:title="dialogTitle"
|
||||||
preset="lg"
|
preset="xl"
|
||||||
:show-footer="false"
|
:show-footer="false"
|
||||||
:scrollbar="false"
|
:scrollbar="false"
|
||||||
@closed="handleClosed"
|
@closed="handleClosed"
|
||||||
|
|||||||
Reference in New Issue
Block a user