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

@@ -1,6 +1,6 @@
<!-- 接口文档 -->
<template>
<div class="app-container">
<div class="page-container">
<iframe
src="https://www.apifox.cn/apidoc/shared-195e783f-4d85-4235-a038-eec696de4ea5"
width="100%"
@@ -12,14 +12,14 @@
<style lang="scss" scoped>
/** 关闭tag标签 */
.app-container {
.page-container {
/* 50px = navbar = 50px */
height: calc(100vh - 50px);
}
/** 开启tag标签 */
.hasTagsView {
.app-container {
.page-container {
/* 84px = navbar + tags-view = 50px + 34px */
height: calc(100vh - 84px);
}

View File

@@ -1,6 +1,6 @@
<!-- 文件上传组件示例 -->
<template>
<div class="app-container">
<div class="page-container">
<el-link
href="https://gitee.com/youlaiorg/vue3-element-admin/blob/master/src/views/demo/auto-opreation-column.vue"
type="primary"

View File

@@ -1,5 +1,5 @@
<template>
<div class="app-container h-full flex flex-1 flex-col">
<div class="page-container h-full flex flex-1 flex-col">
<div class="mb-10">
<el-link
href="https://gitee.com/youlaiorg/vue3-element-admin/blob/master/src/views/demo/curd-demo.vue"
@@ -76,7 +76,7 @@
import UserAPI from "@/api/system/user";
import DeptAPI from "@/api/system/dept";
import RoleAPI from "@/api/system/role";
import type { UserForm, UserQueryParams, UserItem } from "@/types/api";
import type { UserForm, UserQueryParams, UserItem } from "@/api/system/user";
import type { IObject, IModalConfig, IContentConfig, ISearchConfig } from "@/components/CURD/types";
import { DeviceEnum } from "@/enums/settings";
import { useAppStore } from "@/store";
@@ -585,7 +585,7 @@ onMounted(() => {
</script>
<style scoped>
.app-container {
.page-container {
padding: 20px;
}
</style>

View File

@@ -1,5 +1,5 @@
import UserAPI from "@/api/system/user";
import type { UserForm } from "@/types/api";
import type { UserForm } from "@/api/system/user";
import type { IModalConfig } from "@/components/CURD/types";
import { deptArr, roleArr } from "./options";

View File

@@ -1,6 +1,6 @@
import UserAPI from "@/api/system/user";
import RoleAPI from "@/api/system/role";
import type { UserQueryParams, UserItem } from "@/types/api";
import type { UserQueryParams, UserItem } from "@/api/system/user";
import type { IContentConfig } from "@/components/CURD/types";
const contentConfig: IContentConfig<UserQueryParams, UserItem> = {

View File

@@ -1,5 +1,5 @@
import UserAPI from "@/api/system/user";
import type { UserForm } from "@/types/api";
import type { UserForm } from "@/api/system/user";
import type { IModalConfig } from "@/components/CURD/types";
import { DeviceEnum } from "@/enums/settings";
import { useAppStore } from "@/store";

View File

@@ -1,4 +1,4 @@
import type { UserForm } from "@/types/api";
import type { UserForm } from "@/api/system/user";
import type { IModalConfig } from "@/components/CURD/types";
import { deptArr } from "../config/options";

View File

@@ -1,5 +1,5 @@
<template>
<div class="app-container h-full flex flex-1 flex-col">
<div class="page-container h-full flex flex-1 flex-col">
<div class="flex-x-between mb-10">
<el-link
href="https://gitee.com/youlaiorg/vue3-element-admin/blob/master/src/views/demo/curd/index.vue"

View File

@@ -1,5 +1,5 @@
<template>
<div class="app-container">
<div class="page-container">
<el-card class="box-card">
<template #header>
<div class="card-header">
@@ -143,7 +143,7 @@
import { useDictStoreHook } from "@/store/modules/dict";
import { useDateFormat } from "@vueuse/core";
import DictAPI from "@/api/system/dict";
import type { DictItemForm } from "@/types/api";
import type { DictItemForm } from "@/api/system/dict";
import { useDictSync, DictMessage } from "@/composables";
// 性别字典编码

View File

@@ -1,6 +1,6 @@
<!-- 字典组件示例 -->
<template>
<div class="app-container">
<div class="page-container">
<el-link
href="https://gitee.com/youlaiorg/vue3-element-admin/blob/master/src/views/demo/dictionary.vue"
type="primary"

View File

@@ -1,5 +1,5 @@
<template>
<div class="app-container">
<div class="page-container">
<el-row :gutter="24">
<el-col :span="12">
<el-card shadow="never">
@@ -71,7 +71,7 @@ const userList = ref([
</script>
<style lang="scss" scoped>
.app-container {
.page-container {
padding: 20px;
.el-card {

View File

@@ -1,6 +1,6 @@
<!-- 图标选择器示例 -->
<template>
<div class="app-container">
<div class="page-container">
<el-link
href="https://gitee.com/youlaiorg/vue3-element-admin/blob/master/src/views/demo/icon-selector.vue"
type="primary"

View File

@@ -1,18 +1,18 @@
<template>
<div class="app-container">
<div class="page-container">
<iframe src="https://juejin.cn/post/7228990409909108793" frameborder="0" />
</div>
</template>
<style lang="scss" scoped>
/** 关闭tag标签 */
.app-container {
.page-container {
/* 50px = navbar = 50px */
height: calc(100vh - 50px);
}
/** 开启tag标签 */
.hasTagsView {
.app-container {
.page-container {
/* 84px = navbar + tags-view = 50px + 34px */
height: calc(100vh - 84px);
}

View File

@@ -1,5 +1,5 @@
<template>
<div class="app-container">
<div class="page-container">
<div flex flex-col gap-20px>
<MultiLevel1 />
<MultiLevel2 />

View File

@@ -1,5 +1,5 @@
<template>
<div class="app-container">
<div class="page-container">
<div flex flex-col gap-20px>
<MultiLevel1 />
<MultiLevel2 />

View File

@@ -1,6 +1,6 @@
<!-- 列表选择器示例 -->
<template>
<div class="app-container">
<div class="page-container">
<el-link
href="https://gitee.com/youlaiorg/vue3-element-admin/blob/master/src/views/demo/table-select/index.vue"
type="primary"

View File

@@ -1,5 +1,5 @@
<template>
<div class="app-container">
<div class="page-container">
<!-- 基础用法 -->
<TextScroll text="这是一条基础的滚动公告,默认向左滚动" typewriter />
@@ -22,7 +22,7 @@ import TextScroll from "@/components/TextScroll/index.vue";
</script>
<style lang="scss" scoped>
.app-container {
.page-container {
:deep(.text-scroll-container) {
margin-bottom: 20px;
}

View File

@@ -1,6 +1,6 @@
<!-- 文件上传组件示例 -->
<template>
<div class="app-container">
<div class="page-container">
<el-link
href="https://gitee.com/youlaiorg/vue3-element-admin/blob/master/src/views/demo/upload.vue"
type="primary"

View File

@@ -1,5 +1,5 @@
<template>
<div class="app-container">
<div class="page-container">
<!-- 表格 -->
<vxe-grid ref="xGrid" v-bind="gridOptions" v-on="gridEvents">
<!-- 搜索 -->

View File

@@ -1,6 +1,6 @@
<!-- wangEditor富文本编辑器示例 -->
<template>
<div class="app-container">
<div class="page-container">
<el-link
href="https://gitee.com/youlaiorg/vue3-element-admin/blob/master/src/views/demo/wang-editor.vue"
type="primary"