feat: 项目结构重构优化

This commit is contained in:
Ray.Hao
2025-12-26 12:35:37 +08:00
parent 65ad4fe59f
commit aa374dd2ba
164 changed files with 11305 additions and 3103 deletions

View File

@@ -1,4 +1,4 @@
<!-- 系统配置 -->
<!-- 系统配置 -->
<template>
<div class="app-container">
<!-- 搜索区域 -->
@@ -53,8 +53,8 @@
>
<el-table-column type="index" label="序号" width="60" />
<el-table-column key="configName" label="配置名称" prop="configName" min-width="100" />
<el-table-column key="configKey" label="配置" prop="configKey" min-width="100" />
<el-table-column key="configValue" label="配置" prop="configValue" min-width="100" />
<el-table-column key="configKey" label="配置" prop="configKey" min-width="100" />
<el-table-column key="configValue" label="配置" prop="configValue" min-width="100" />
<el-table-column key="remark" label="描述" prop="remark" min-width="100" />
<el-table-column fixed="right" label="操作" width="220">
<template #default="scope">
@@ -108,11 +108,11 @@
<el-form-item label="配置名称" prop="configName">
<el-input v-model="formData.configName" placeholder="请输入配置名称" :maxlength="50" />
</el-form-item>
<el-form-item label="配置" prop="configKey">
<el-form-item label="配置" prop="configKey">
<el-input v-model="formData.configKey" placeholder="请输入配置键" :maxlength="50" />
</el-form-item>
<el-form-item label="配置" prop="configValue">
<el-input v-model="formData.configValue" placeholder="请输入配置" :maxlength="100" />
<el-form-item label="配置" prop="configValue">
<el-input v-model="formData.configValue" placeholder="请输入配置" :maxlength="100" />
</el-form-item>
<el-form-item label="描述" prop="remark">
<el-input
@@ -142,7 +142,7 @@ defineOptions({
});
import ConfigAPI from "@/api/system/config";
import type { ConfigPageVo, ConfigForm, ConfigPageQuery } from "@/api/types";
import type { ConfigPageVo, ConfigForm, ConfigPageQuery } from "@/types/api";
import { ElMessage, ElMessageBox } from "element-plus";
import { useDebounceFn } from "@vueuse/core";

View File

@@ -1,4 +1,4 @@
<template>
<template>
<div class="app-container">
<!-- 搜索区域 -->
<div class="filter-section">
@@ -129,7 +129,7 @@
<el-input v-model="formData.name" placeholder="请输入部门名称" />
</el-form-item>
<el-form-item label="部门编号" prop="code">
<el-input v-model="formData.code" placeholder="请输入部门编" />
<el-input v-model="formData.code" placeholder="请输入部门编" />
</el-form-item>
<el-form-item label="显示排序" prop="sort">
<el-input-number
@@ -149,8 +149,8 @@
<template #footer>
<div class="dialog-footer">
<el-button type="primary" @click="handleSubmit"> </el-button>
<el-button @click="handleCloseDialog"> </el-button>
<el-button type="primary" @click="handleSubmit">确定</el-button>
<el-button @click="handleCloseDialog">取消</el-button>
</div>
</template>
</el-dialog>
@@ -164,7 +164,7 @@ defineOptions({
});
import DeptAPI from "@/api/system/dept";
import type { DeptVo, DeptForm, DeptQuery } from "@/api/types";
import type { DeptVo, DeptForm, DeptQuery } from "@/types/api";
const queryFormRef = ref();
const deptFormRef = ref();

View File

@@ -1,4 +1,4 @@
<!-- 字典 -->
<!-- 字典 -->
<template>
<div class="app-container">
<div class="filter-section">
@@ -86,7 +86,7 @@
/>
</el-card>
<!--字典项弹窗-->
<!-- 字典项弹窗 -->
<el-dialog
v-model="dialog.visible"
:title="dialog.title"
@@ -146,7 +146,7 @@
<template #footer>
<div class="dialog-footer">
<el-button type="primary" @click="handleSubmitClick"> </el-button>
<el-button @click="handleCloseDialog"> </el-button>
<el-button @click="handleCloseDialog"> </el-button>
</div>
</template>
</el-dialog>
@@ -156,7 +156,7 @@
<script setup lang="ts">
import type { TagProps } from "element-plus";
import DictAPI from "@/api/system/dict";
import type { DictItemPageQuery, DictItemPageVo, DictItemForm } from "@/api/types";
import type { DictItemPageQuery, DictItemPageVo, DictItemForm } from "@/types/api";
const route = useRoute();
@@ -229,7 +229,7 @@ function handleSelectionChange(selection: any) {
// 打开弹窗
function handleOpenDialog(row?: DictItemPageVo) {
dialog.visible = true;
dialog.title = row ? "编辑字典" : "新增字典";
dialog.title = row ? "编辑字典" : "新增字典";
if (row?.id) {
DictAPI.getDictItemFormData(dictCode.value, row.id).then((data) => {

View File

@@ -1,4 +1,4 @@
<!-- 字典 -->
<!-- 字典 -->
<template>
<div class="app-container">
<!-- 搜索区域 -->
@@ -124,7 +124,7 @@
<template #footer>
<div class="dialog-footer">
<el-button type="primary" @click="handleSubmitClick"> </el-button>
<el-button @click="handleCloseDialog"> </el-button>
<el-button @click="handleCloseDialog"> </el-button>
</div>
</template>
</el-dialog>
@@ -137,8 +137,9 @@ defineOptions({
inherititems: false,
});
import { ref, reactive } from "vue";
import DictAPI from "@/api/system/dict";
import type { DictPageQuery, DictPageVo, DictForm } from "@/api/types";
import type { DictPageQuery, DictPageVo, DictForm } from "@/types/api";
import router from "@/router";
@@ -285,11 +286,11 @@ function handleDelete(id?: number) {
);
}
// 打开字典
// 打开字典值"
function handleOpenDictData(row: DictPageVo) {
router.push({
path: "/system/dict-item",
query: { dictCode: row.dictCode, title: "【" + row.name + "】字典数据" },
query: { dictCode: row.dictCode, title: `${row.name}】字典数据` },
});
}

View File

@@ -1,4 +1,4 @@
<template>
<template>
<div class="app-container">
<!-- 搜索区域 -->
<div class="search-container">
@@ -69,7 +69,7 @@ defineOptions({
});
import LogAPI from "@/api/system/log";
import type { LogPageVo, LogPageQuery } from "@/api/types";
import type { LogPageVo, LogPageQuery } from "@/types/api";
const queryFormRef = ref();
@@ -99,7 +99,7 @@ function fetchData() {
});
}
/** 查询(重置页码后获取数据) */
/** 查询(重置页码后获取数据)*/
function handleQuery() {
queryParams.pageNum = 1;
fetchData();

View File

@@ -1,4 +1,4 @@
<template>
<template>
<div class="app-container">
<!-- 搜索区域 -->
<div class="filter-section">
@@ -156,7 +156,7 @@
路由名称
<el-tooltip placement="bottom" effect="light">
<template #content>
如果需要开启缓存需保证页面 defineOptions 中的 name 与此处一致建议使用驼峰
如果需要开启缓存需保证页面 defineOptions 中的 name 与此处一致建议使用驼峰
</template>
<el-icon class="ml-1 cursor-pointer">
<QuestionFilled />
@@ -241,7 +241,7 @@
<span class="mx-1">=</span>
<el-input v-model="item.value" placeholder="参数" style="width: 100px" />
<el-input v-model="item.value" placeholder="参数" style="width: 100px" />
<el-icon
v-if="formData.params.indexOf(item) === formData.params.length - 1"
@@ -332,8 +332,8 @@
<template #footer>
<div class="dialog-footer">
<el-button type="primary" @click="handleSubmit"> </el-button>
<el-button @click="handleCloseDialog"> </el-button>
<el-button type="primary" @click="handleSubmit">确定</el-button>
<el-button @click="handleCloseDialog">取消</el-button>
</div>
</template>
</el-drawer>
@@ -341,11 +341,11 @@
</template>
<script setup lang="ts">
import { useAppStore } from "@/store/modules/app-store";
import { useAppStore } from "@/store/modules/app";
import { DeviceEnum } from "@/enums/settings";
import MenuAPI from "@/api/system/menu";
import type { MenuQuery, MenuForm, MenuVo } from "@/api/types";
import type { MenuQuery, MenuForm, MenuVo } from "@/types/api";
import { MenuTypeEnum } from "@/enums/business";
defineOptions({
@@ -472,7 +472,7 @@ function handleMenuTypeChange() {
// 如果菜单类型改变
if (formData.value.type !== initialMenuFormData.value.type) {
if (formData.value.type === MenuTypeEnum.MENU) {
// 目录切换到菜单时,清空组件路径
// 目录切换到菜单时,清空组件路径"
if (initialMenuFormData.value.type === MenuTypeEnum.CATALOG) {
formData.value.component = "";
} else {

View File

@@ -1,4 +1,4 @@
<template>
<template>
<div class="app-container">
<!-- 搜索区域 -->
<div class="filter-section">
@@ -68,13 +68,13 @@
<el-table-column label="通知标题" prop="title" min-width="200" />
<el-table-column align="center" label="通知类型" width="150">
<template #default="scope">
<DictLabel v-model="scope.row.type" :code="'notice_type'" />
<DictTag v-model="scope.row.type" :code="'notice_type'" />
</template>
</el-table-column>
<el-table-column align="center" label="发布人" prop="publisherName" width="150" />
<el-table-column align="center" label="通知等级" width="100">
<template #default="scope">
<DictLabel v-model="scope.row.level" code="notice_level" />
<DictTag v-model="scope.row.level" code="notice_level" />
</template>
</el-table-column>
<el-table-column align="center" label="通告目标类型" prop="targetType" min-width="100">
@@ -260,8 +260,9 @@ defineOptions({
inheritAttrs: false,
});
import { ref, reactive } from "vue";
import NoticeAPI from "@/api/system/notice";
import type { NoticePageVo, NoticeForm, NoticePageQuery, NoticeDetailVo } from "@/api/types";
import type { NoticePageVo, NoticeForm, NoticePageQuery, NoticeDetailVo } from "@/types/api";
import UserAPI from "@/api/system/user";
const queryFormRef = ref();
@@ -288,8 +289,8 @@ const dialog = reactive({
// 通知公告表单数据
const formData = reactive<NoticeForm>({
level: "L", // 默认优先级为
targetType: 1, // 默认目标类型为全
level: "L", // 默认优先级为 L
targetType: 1, // 默认目标类型为全
});
// 通知公告表单校验规则
@@ -431,7 +432,7 @@ function handleDelete(id?: number) {
return;
}
ElMessageBox.confirm("确认删除已选中的数据项?", "警告", {
ElMessageBox.confirm("确认删除已选中的数据项吗?", "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",

View File

@@ -1,4 +1,4 @@
<template>
<template>
<div class="app-container">
<!-- 搜索区域 -->
<div class="filter-section">
@@ -142,8 +142,8 @@
<template #footer>
<div class="dialog-footer">
<el-button type="primary" @click="handleSubmit"> </el-button>
<el-button @click="handleCloseDialog"> </el-button>
<el-button type="primary" @click="handleSubmit">确定</el-button>
<el-button @click="handleCloseDialog">取消</el-button>
</div>
</template>
</el-dialog>
@@ -203,8 +203,8 @@
</el-tree>
<template #footer>
<div class="dialog-footer">
<el-button type="primary" @click="handleAssignPermSubmit"> </el-button>
<el-button @click="assignPermDialogVisible = false"> </el-button>
<el-button type="primary" @click="handleAssignPermSubmit">确定</el-button>
<el-button @click="assignPermDialogVisible = false">取消</el-button>
</div>
</template>
</el-drawer>
@@ -212,11 +212,11 @@
</template>
<script setup lang="ts">
import { useAppStore } from "@/store/modules/app-store";
import { useAppStore } from "@/store/modules/app";
import { DeviceEnum } from "@/enums/settings";
import RoleAPI from "@/api/system/role";
import type { RolePageVo, RoleForm, RolePageQuery } from "@/api/types";
import type { RolePageVo, RoleForm, RolePageQuery } from "@/types/api";
import MenuAPI from "@/api/system/menu";
defineOptions({

View File

@@ -1,4 +1,4 @@
<template>
<template>
<div class="app-container">
<!-- 搜索区域 -->
<div class="filter-section">
@@ -204,7 +204,7 @@ import { useDebounceFn } from "@vueuse/core";
import { hasPerm } from "@/utils/auth";
import TenantAPI from "@/api/system/tenant";
import type { TenantCreateForm, TenantForm, TenantPageQuery, TenantPageVo } from "@/api/types";
import type { TenantCreateForm, TenantForm, TenantPageQuery, TenantPageVo } from "@/types/api";
const queryFormRef = ref();
const dataFormRef = ref();

View File

@@ -1,5 +1,4 @@
<!-- 部门树 -->
<template>
<template>
<el-card shadow="never">
<el-input v-model="deptName" placeholder="部门名称" clearable>
<template #prefix>

View File

@@ -1,4 +1,4 @@
<template>
<template>
<div>
<el-dialog
v-model="visible"
@@ -14,7 +14,7 @@
:model="importFormData"
:rules="importFormRules"
>
<el-form-item label="文件" prop="files">
<el-form-item label="文件" prop="files">
<el-upload
ref="uploadRef"
v-model:file-list="importFormData.files"
@@ -32,7 +32,7 @@
</div>
<template #tip>
<div class="el-upload__tip">
格式为*.xlsx / *.xls文件不超过一个
格式为 *.xlsx / *.xls文件不超过1M
<el-link
type="primary"
icon="download"
@@ -57,9 +57,9 @@
:disabled="importFormData.files.length === 0"
@click="handleUpload"
>
确定
</el-button>
<el-button @click="handleClose"> </el-button>
<el-button @click="handleClose">取消</el-button>
</div>
</template>
</el-dialog>

View File

@@ -1,4 +1,4 @@
<!-- 用户管理 -->
<!-- 用户管理 -->
<template>
<div class="app-container">
<el-row :gutter="20">
@@ -103,7 +103,7 @@
<el-table-column label="昵称" width="150" align="center" prop="nickname" />
<el-table-column label="性别" width="100" align="center">
<template #default="scope">
<DictLabel v-model="scope.row.gender" code="gender" />
<DictTag v-model="scope.row.gender" code="gender" />
</template>
</el-table-column>
<el-table-column label="部门" width="120" align="center" prop="deptName" />
@@ -253,11 +253,10 @@ import { useDebounceFn } from "@vueuse/core";
import { ElMessage, ElMessageBox, type FormInstance } from "element-plus";
// ==================== 3. 类型定义 ====================
import type { UserForm, UserPageQuery, UserPageVo } from "@/api/types";
import type { UserForm, UserPageQuery, UserPageVo } from "@/types/api";
// ==================== 3.5 工具函数 ====================
import { downloadFile } from "@/utils";
import { VALIDATORS } from "@/utils/validators";
import { downloadFile, VALIDATORS } from "@/utils";
// ==================== 4. API 服务 ====================
import UserAPI from "@/api/system/user";
import DeptAPI from "@/api/system/dept";
@@ -570,7 +569,7 @@ useAiAction({
*/
updateUserNickname: {
needConfirm: true,
callBackendApi: true, // 自动调用后端 API
callBackendApi: true,
confirmMessage: (args: any) =>
`AI 助手将执行以下操作:<br/>
<strong>修改用户:</strong> ${args.username}<br/>