refactor: 更新API接口与数据结构,统一分页返回格式

This commit is contained in:
Ray.Hao
2026-01-09 00:07:25 +08:00
parent 4a8efc770e
commit a5885d0710
64 changed files with 1085 additions and 910 deletions

View File

@@ -262,7 +262,7 @@ defineOptions({
import { ref, reactive } from "vue";
import NoticeAPI from "@/api/system/notice";
import type { NoticePageVo, NoticeForm, NoticePageQuery, NoticeDetailVo } from "@/types/api";
import type { NoticeItem, NoticeForm, NoticeQueryParams, NoticeDetail } from "@/types/api";
import UserAPI from "@/api/system/user";
const queryFormRef = ref();
@@ -272,14 +272,14 @@ const loading = ref(false);
const selectIds = ref<number[]>([]);
const total = ref(0);
const queryParams = reactive<NoticePageQuery>({
const queryParams = reactive<NoticeQueryParams>({
pageNum: 1,
pageSize: 10,
});
const userOptions = ref<OptionType[]>([]);
const userOptions = ref<OptionItem[]>([]);
// 通知公告表格数据
const pageData = ref<NoticePageVo[]>([]);
const pageData = ref<NoticeItem[]>([]);
// 弹窗
const dialog = reactive({
@@ -316,7 +316,7 @@ const rules = reactive({
const detailDialog = reactive({
visible: false,
});
const currentNotice = ref<NoticeDetailVo>({});
const currentNotice = ref<NoticeDetail>({});
// 查询通知公告
function handleQuery() {
@@ -328,9 +328,9 @@ function handleQuery() {
function fetchData() {
loading.value = true;
NoticeAPI.getPage(queryParams)
.then((data) => {
pageData.value = data.list;
total.value = data.total;
.then((res) => {
pageData.value = res.data;
total.value = res.page?.total ?? 0;
})
.finally(() => {
loading.value = false;