refactor: 重构 API 层目录结构 & 样式模块化拆分

- API 层按业务域拆分(api/auth/, api/file/, api/system/*)
- 类型定义从 types/api/ 移入对应 api 模块内(就近原则)
- 公共类型统一为 api/common.ts,移除冗余类型重导出
- 样式文件按职责拆分(base/, layout/, vendors/),移除 common.scss
- 移除失效的单元测试文件
This commit is contained in:
Ray.Hao
2026-03-30 08:11:03 +08:00
parent 3a27da6607
commit 3fedf4943d
107 changed files with 464 additions and 8264 deletions

View File

@@ -4,7 +4,7 @@ import type PageContent from "./PageContent.vue";
import type PageModal from "./PageModal.vue";
import type PageSearch from "./PageSearch.vue";
import type { CSSProperties } from "vue";
import type { PageResult } from "@/types/api/common";
import type { PageResult } from "@/api/common";
export type PageSearchInstance = InstanceType<typeof PageSearch>;
export type PageContentInstance = InstanceType<typeof PageContent>;

View File

@@ -2,7 +2,7 @@
* 通知中心逻辑
*/
import { ref, onMounted, onBeforeUnmount } from "vue";
import type { NoticeItem, NoticeDetail, NoticeQueryParams } from "@/types/api";
import type { NoticeItem, NoticeDetail, NoticeQueryParams } from "@/api/system/notice";
import NoticeAPI from "@/api/system/notice";
import { useSse } from "@/composables";
import router from "@/router";

View File

@@ -1,6 +1,6 @@
<template>
<el-scrollbar>
<div :class="{ hidden: hidden }" class="pagination">
<div :class="{ hidden: hidden }" class="p-3 flex justify-end">
<el-pagination
v-model:current-page="currentPage"
v-model:page-size="pageSize"
@@ -79,13 +79,3 @@ function handleCurrentChange(val: number) {
emit("pagination", { page: val, limit: pageSize.value });
}
</script>
<style lang="scss" scoped>
.pagination {
padding: 12px;
&.hidden {
display: none;
}
}
</style>

View File

@@ -54,7 +54,7 @@ import {
} from "element-plus";
import FileAPI from "@/api/file";
import type { FileInfo } from "@/types/api";
import type { FileInfo } from "@/api/file";
const props = defineProps({
/**

View File

@@ -41,7 +41,7 @@
<script setup lang="ts">
import { UploadRawFile, UploadRequestOptions, UploadUserFile } from "element-plus";
import FileAPI from "@/api/file";
import type { FileInfo } from "@/types/api";
import type { FileInfo } from "@/api/file";
const props = defineProps({
/**

View File

@@ -34,7 +34,7 @@
<script setup lang="ts">
import { UploadRawFile, UploadRequestOptions } from "element-plus";
import FileAPI from "@/api/file";
import type { FileInfo } from "@/types/api";
import type { FileInfo } from "@/api/file";
const props = defineProps({
/**