mirror of
https://github.com/fastapiadmin/FastapiAdmin.git
synced 2026-10-01 16:21:20 +00:00
refactor(api): 统一更新接口使用路径参数传递ID
refactor(backend): 重构CRUD基类查询方法去除重复结果 feat(application): 新增应用系统模块基础结构 fix(backend): 修复多处日志记录ID变量名错误 style(backend): 清理无用代码和注释 fix(frontend): 修复用户导入功能参数错误 docs(backend): 更新环境配置示例注释 perf(backend): 优化导出功能数据处理逻辑 test(frontend): 添加任务日志功能开发中提示 chore: 更新角色菜单权限数据
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
<template>
|
||||
<div>
|
||||
<h1>我的应用管理开发中,暂未提供</h1>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
</style>
|
||||
@@ -416,7 +416,7 @@ async function handleSubmit() {
|
||||
const id = formData.id;
|
||||
if (id) {
|
||||
try {
|
||||
await ExampleAPI.updateExample({ id, ...formData })
|
||||
await ExampleAPI.updateExample(id, { id, ...formData })
|
||||
dialogVisible.visible = false;
|
||||
resetForm();
|
||||
handleCloseDialog();
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
<!-- 字典数据 -->
|
||||
<template>
|
||||
<el-drawer v-model="drawerVisible" :title="'【' + props.dictLabel + '】日志数据'" :size="drawerSize">
|
||||
<!-- 搜索区域 -->
|
||||
<div class="search-container">
|
||||
<!-- 开发中 -->
|
||||
</div>
|
||||
</el-drawer>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
// 处理可以参考字典数据抽屉
|
||||
// 添加 props 来接收 dictType
|
||||
const props = defineProps({
|
||||
dictType: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
dictLabel: {
|
||||
type: String,
|
||||
required: true
|
||||
}
|
||||
})
|
||||
|
||||
import { useAppStore } from "@/store/modules/app.store";
|
||||
import { DeviceEnum } from "@/enums/settings/device.enum";
|
||||
|
||||
const appStore = useAppStore();
|
||||
const drawerSize = computed(() => (appStore.device === DeviceEnum.DESKTOP ? "80%" : "60%"));
|
||||
const drawerVisible = ref<boolean>(false);
|
||||
|
||||
</script>
|
||||
@@ -189,6 +189,15 @@
|
||||
<el-table-column fixed="right" label="操作" min-width="240">
|
||||
<template #default="scope">
|
||||
<div class="flex">
|
||||
<el-button
|
||||
type="info"
|
||||
size="small"
|
||||
link
|
||||
icon="document"
|
||||
@click="handleOpenDialog('log', scope.row.id)"
|
||||
>
|
||||
日志
|
||||
</el-button>
|
||||
<el-button
|
||||
type="info"
|
||||
size="small"
|
||||
@@ -627,7 +636,7 @@ const formData = reactive<JobForm>({
|
||||
const dialogVisible = reactive({
|
||||
title: "",
|
||||
visible: false,
|
||||
type: "create" as "create" | "update" | "detail",
|
||||
type: "create" as "create" | "update" | "detail" | "log",
|
||||
});
|
||||
|
||||
// 表单验证规则
|
||||
@@ -731,7 +740,7 @@ async function handleCloseDialog() {
|
||||
|
||||
// 打开弹窗
|
||||
async function handleOpenDialog(
|
||||
type: "create" | "update" | "detail",
|
||||
type: "create" | "update" | "detail" | "log",
|
||||
id?: number
|
||||
) {
|
||||
dialogVisible.type = type;
|
||||
@@ -743,6 +752,10 @@ async function handleOpenDialog(
|
||||
} else if (type === "update") {
|
||||
dialogVisible.title = "修改任务";
|
||||
Object.assign(formData, response.data.data);
|
||||
} else if (type === "log") {
|
||||
// 处理可以参考字典数据
|
||||
dialogVisible.title = "任务日志";
|
||||
ElMessage.success("开发中...");
|
||||
}
|
||||
} else {
|
||||
dialogVisible.title = "新增任务";
|
||||
@@ -761,7 +774,7 @@ async function handleSubmit() {
|
||||
const id = formData.id;
|
||||
if (id) {
|
||||
try {
|
||||
await JobAPI.updateJob(formData);
|
||||
await JobAPI.updateJob(id, formData);
|
||||
dialogVisible.visible = false;
|
||||
resetForm();
|
||||
handleCloseDialog();
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
<template>
|
||||
<div>
|
||||
<h1>资源管理开发中,暂未提供</h1>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
</style>
|
||||
@@ -101,7 +101,7 @@ const submitChanges = async () => {
|
||||
// 并行处理所有修改请求,提高性能
|
||||
const updatePromises = keysToSubmit.map(key => {
|
||||
const item = systemConfigs.value[key as keyof typeof systemConfigs.value] || logoConfigs.value[key as keyof typeof logoConfigs.value];
|
||||
return item ? ConfigAPI.updateConfig({ ...item }) : Promise.resolve();
|
||||
return item && item.id ? ConfigAPI.updateConfig(item.id, { ...item }) : Promise.resolve();
|
||||
});
|
||||
|
||||
await Promise.all(updatePromises);
|
||||
|
||||
@@ -191,7 +191,7 @@ defineOptions({
|
||||
});
|
||||
|
||||
import ConfigAPI, { ConfigTable, ConfigForm, ConfigPageQuery } from "@/api/system/config";
|
||||
import { ElMessage, ElMessageBox } from "element-plus";
|
||||
import { ElMessageBox } from "element-plus";
|
||||
|
||||
const queryFormRef = ref();
|
||||
const dataFormRef = ref();
|
||||
@@ -369,7 +369,7 @@ async function handleSubmit() {
|
||||
const id = formData.id;
|
||||
if (id) {
|
||||
try {
|
||||
await ConfigAPI.updateConfig(formData)
|
||||
await ConfigAPI.updateConfig(id, formData)
|
||||
dialogVisible.visible = false;
|
||||
resetForm();
|
||||
handleResetQuery();
|
||||
|
||||
@@ -183,7 +183,7 @@ defineOptions({
|
||||
});
|
||||
|
||||
import DeptAPI, { DeptTable, DeptForm, DeptPageQuery } from "@/api/system/dept";
|
||||
import { ElMessage, ElMessageBox } from "element-plus";
|
||||
import { ElMessageBox } from "element-plus";
|
||||
import { listToTree, formatTree } from "@/utils/common";
|
||||
|
||||
const queryFormRef = ref();
|
||||
@@ -373,7 +373,7 @@ async function handleSubmit() {
|
||||
const id = formData.id;
|
||||
if (id) {
|
||||
try {
|
||||
await DeptAPI.updateDept({ id, ...formData })
|
||||
await DeptAPI.updateDept(id, { id, ...formData })
|
||||
dialogVisible.visible = false;
|
||||
resetForm();
|
||||
handleResetQuery();
|
||||
|
||||
@@ -234,7 +234,7 @@ const props = defineProps({
|
||||
})
|
||||
|
||||
import DictAPI, { DictDataTable, DictDataForm, DictDataPageQuery } from "@/api/system/dict";
|
||||
import { ElMessage, ElMessageBox } from "element-plus";
|
||||
import { ElMessageBox } from "element-plus";
|
||||
import { Check, Close } from '@element-plus/icons-vue'
|
||||
import { useAppStore } from "@/store/modules/app.store";
|
||||
import { DeviceEnum } from "@/enums/settings/device.enum";
|
||||
@@ -417,7 +417,7 @@ async function handleSubmit() {
|
||||
const id = formData.id;
|
||||
if (id) {
|
||||
try {
|
||||
await DictAPI.updateDictData({ id, ...formData })
|
||||
await DictAPI.updateDictData(id, { id, ...formData })
|
||||
dialogVisible.visible = false;
|
||||
resetForm();
|
||||
handleResetQuery();
|
||||
|
||||
@@ -207,7 +207,7 @@ defineOptions({
|
||||
});
|
||||
|
||||
import DictAPI, { DictTable, DictForm, DictPageQuery } from "@/api/system/dict";
|
||||
import { ElMessage, ElMessageBox } from "element-plus";
|
||||
import { ElMessageBox } from "element-plus";
|
||||
import DataDrawer from "@/views/system/dict/components/DataDrawer.vue"
|
||||
|
||||
const queryFormRef = ref();
|
||||
@@ -392,7 +392,7 @@ async function handleSubmit() {
|
||||
const id = formData.id;
|
||||
if (id) {
|
||||
try {
|
||||
await DictAPI.updateDictType({ id, ...formData })
|
||||
await DictAPI.updateDictType(id, { id, ...formData })
|
||||
dialogVisible.visible = false;
|
||||
resetForm();
|
||||
handleResetQuery();
|
||||
|
||||
@@ -178,7 +178,7 @@
|
||||
<el-tag v-if="detailFormData.type === MenuTypeEnum.EXTLINK" type="info">外链</el-tag>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="图标" :span="2">
|
||||
<template #default="scope">
|
||||
<template #default>
|
||||
<template v-if=" detailFormData.icon && detailFormData.icon.startsWith('el-icon')">
|
||||
<el-icon style="vertical-align: -0.15em">
|
||||
<component :is="detailFormData.icon.replace('el-icon-', '')" />
|
||||
@@ -721,7 +721,7 @@ async function handleSubmit() {
|
||||
const id = formData.id;
|
||||
if (id) {
|
||||
try {
|
||||
await MenuAPI.updateMenu(formData)
|
||||
await MenuAPI.updateMenu(id, formData)
|
||||
await userStore.getUserInfo();
|
||||
dialogVisible.visible = false;
|
||||
resetForm();
|
||||
|
||||
@@ -253,7 +253,7 @@ defineOptions({
|
||||
});
|
||||
|
||||
import NoticeAPI, { NoticeTable, NoticeForm, NoticePageQuery } from "@/api/system/notice";
|
||||
import { ElMessage, ElMessageBox } from "element-plus";
|
||||
import { ElMessageBox } from "element-plus";
|
||||
|
||||
const queryFormRef = ref();
|
||||
const dataFormRef = ref();
|
||||
@@ -429,7 +429,7 @@ async function handleSubmit() {
|
||||
const id = formData.id;
|
||||
if (id) {
|
||||
try {
|
||||
await NoticeAPI.updateNotice({ id, ...formData })
|
||||
await NoticeAPI.updateNotice(id, { id, ...formData })
|
||||
dialogVisible.visible = false;
|
||||
resetForm();
|
||||
handleCloseDialog();
|
||||
|
||||
@@ -196,7 +196,7 @@ defineOptions({
|
||||
});
|
||||
|
||||
import PositionAPI, { PositionTable, PositionForm, PositionPageQuery } from "@/api/system/position";
|
||||
import { ElMessage, ElMessageBox } from "element-plus";
|
||||
import { ElMessageBox } from "element-plus";
|
||||
|
||||
const queryFormRef = ref();
|
||||
const dataFormRef = ref();
|
||||
@@ -370,7 +370,7 @@ async function handleSubmit() {
|
||||
const id = formData.id;
|
||||
if (id) {
|
||||
try {
|
||||
await PositionAPI.updatePosition({ id, ...formData })
|
||||
await PositionAPI.updatePosition(id, { id, ...formData })
|
||||
dialogVisible.visible = false;
|
||||
resetForm();
|
||||
handleResetQuery();
|
||||
|
||||
@@ -424,7 +424,7 @@ async function handleSubmit() {
|
||||
const id = formData.id;
|
||||
if (id) {
|
||||
try {
|
||||
await RoleAPI.updateRole({ id, ...formData })
|
||||
await RoleAPI.updateRole(id, { id, ...formData })
|
||||
dialogVisible.visible = false;
|
||||
resetForm();
|
||||
handleResetQuery();
|
||||
|
||||
@@ -603,7 +603,7 @@ async function handleSubmit() {
|
||||
// 编辑用户时,不传递密码字段
|
||||
const updateData = { id, ...formData };
|
||||
delete updateData.password;
|
||||
await UserAPI.updateUser(updateData)
|
||||
await UserAPI.updateUser(id, updateData)
|
||||
dialogVisible.visible = false;
|
||||
resetForm();
|
||||
handleCloseDialog();
|
||||
@@ -724,7 +724,7 @@ function handleOpenImportDialog() {
|
||||
const emit = defineEmits(['import-success']);
|
||||
|
||||
// 上传文件
|
||||
const handleUpload = async (formData: FormData, file: File) => {
|
||||
const handleUpload = async (formData: FormData) => {
|
||||
try {
|
||||
const response = await UserAPI.importUser(formData);
|
||||
if (response.data.code === ResultEnum.SUCCESS) {
|
||||
|
||||
Reference in New Issue
Block a user