mirror of
https://github.com/fastapiadmin/FastapiAdmin.git
synced 2026-09-26 22:31:21 +00:00
chore: 整理项目配置与代码优化
1. 统一前端环境变量命名,新增通用项目标题配置 2. 修复后端接口参数绑定方式,将Depends改为Query适配FastAPI解析 3. 优化表格列排序、搜索过滤功能与页面布局样式 4. 重构路由与状态管理代码,移除循环依赖 5. 更新依赖版本与脚本命令,修复构建警告 6. 调整多语言文案与快捷入口配置 7. 修复通知中心样式与接口返回格式
This commit is contained in:
@@ -278,6 +278,7 @@ const { isFullscreen, toggle: toggleFullscreen } = useFullscreen();
|
||||
onMounted(() => {
|
||||
initLanguage();
|
||||
document.addEventListener("click", bodyCloseNotice);
|
||||
noticeStore.getNotice();
|
||||
});
|
||||
|
||||
onUnmounted(() => {
|
||||
|
||||
@@ -21,8 +21,11 @@
|
||||
class="box-border flex-c px-3.5 py-3.5 c-p last:border-b-0 hover:bg-g-200/60"
|
||||
@click="handleMarkAsRead(index)"
|
||||
>
|
||||
<div class="size-9 leading-9 text-center rounded-lg flex-cc bg-theme/12 text-theme">
|
||||
<FaSvgIcon class="text-lg bg-transparent!" icon="ri:notification-3-line" />
|
||||
<div
|
||||
class="size-9 leading-9 text-center rounded-lg flex-cc"
|
||||
:class="item.type === 2 ? 'bg-warning/12 text-warning' : 'bg-theme/12 text-theme'"
|
||||
>
|
||||
<FaSvgIcon class="text-lg bg-transparent!" :icon="getNoticeIcon(item.type)" />
|
||||
</div>
|
||||
<div class="w-[calc(100%-45px)] ml-3.5">
|
||||
<h4 class="text-sm font-normal leading-5.5 text-g-900">{{ item.title }}</h4>
|
||||
@@ -58,10 +61,13 @@ import NoticeAPI from "@/api/module_system/notice";
|
||||
|
||||
defineOptions({ name: "FaNotification" });
|
||||
|
||||
const router = useRouter();
|
||||
|
||||
interface NoticeItem {
|
||||
title: string;
|
||||
time: string;
|
||||
read: boolean;
|
||||
type: number;
|
||||
}
|
||||
|
||||
interface Props {
|
||||
@@ -81,6 +87,9 @@ const visible = ref(false);
|
||||
const noticeList = ref<NoticeItem[]>([]);
|
||||
const loading = ref(false);
|
||||
|
||||
const getNoticeIcon = (type: number) =>
|
||||
type === 2 ? "ri:megaphone-line" : "ri:notification-3-line";
|
||||
|
||||
const fetchNotices = async () => {
|
||||
loading.value = true;
|
||||
try {
|
||||
@@ -90,6 +99,7 @@ const fetchNotices = async () => {
|
||||
title: n.notice_title ?? "",
|
||||
time: n.created_time ?? "",
|
||||
read: false,
|
||||
type: Number(n.notice_type) || 1,
|
||||
}));
|
||||
} catch {
|
||||
noticeList.value = [];
|
||||
@@ -104,8 +114,7 @@ watch(visible, (v) => {
|
||||
});
|
||||
|
||||
const handleViewAll = () => {
|
||||
const router = useRouter();
|
||||
router.push("/module_system/notice");
|
||||
router.push("/system/notice");
|
||||
emit("update:value", false);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user