fix(dict): 分页上限 1000→200,修复字典类型列表加载失败
后端 PageQuery @Max(200),前端 dict/分配角色/用户导出传 1000 会 400, 导致字典管理页类型列表为空。 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
parent
3746198f19
commit
348221d198
@ -53,7 +53,7 @@ export function listDicts(signal?: AbortSignal): Promise<{ list: DictEntry[] }>
|
||||
|
||||
// ---- 字典类型 ----
|
||||
|
||||
export function listDictTypes(page = 1, pageSize = 1000, signal?: AbortSignal): Promise<PageResult<DictType>> {
|
||||
export function listDictTypes(page = 1, pageSize = 200, signal?: AbortSignal): Promise<PageResult<DictType>> {
|
||||
return http.get<PageResult<DictType>>('/dict-types', { params: { page, pageSize }, signal })
|
||||
}
|
||||
|
||||
|
||||
@ -98,7 +98,7 @@ const COLOR_LABELS: Record<string, string> = {
|
||||
}
|
||||
|
||||
// ---- 字典类型(左) ----
|
||||
const { data: typePage, refresh: refreshTypes } = useRequest((signal: AbortSignal) => listDictTypes(1, 1000, signal))
|
||||
const { data: typePage, refresh: refreshTypes } = useRequest((signal: AbortSignal) => listDictTypes(1, 200, signal))
|
||||
const types = computed<DictType[]>(() => typePage.value?.list ?? [])
|
||||
|
||||
const typeKeyword = ref('')
|
||||
|
||||
@ -20,7 +20,7 @@ defineOptions({ name: 'AssignRolesForm' })
|
||||
|
||||
const props = defineProps<{ userId: string }>()
|
||||
|
||||
const { data: rolePage } = useRequest((signal: AbortSignal) => listRoles({ page: 1, pageSize: 1000 }, signal))
|
||||
const { data: rolePage } = useRequest((signal: AbortSignal) => listRoles({ page: 1, pageSize: 200 }, signal))
|
||||
const { data: assigned } = useRequest((signal: AbortSignal) => listUserRoles(props.userId, signal))
|
||||
|
||||
const roles = computed(() => rolePage.value?.list ?? [])
|
||||
|
||||
@ -229,7 +229,7 @@ function escapeCsv(v: unknown): string {
|
||||
}
|
||||
|
||||
async function exportUsers(): Promise<void> {
|
||||
const result = await listUsers({ page: 1, pageSize: 1000 })
|
||||
const result = await listUsers({ page: 1, pageSize: 200 })
|
||||
const headers = ['用户名', '昵称', '邮箱', '手机', '状态', '所属组织', '创建时间']
|
||||
const lines = [headers.join(',')]
|
||||
for (const u of result.list) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user