Compare commits

...

2 Commits
main ... master

Author SHA1 Message Date
ea900046c8 feat(Admin): Compete Admin Page layouts. 2024-08-05 19:08:30 +08:00
f83303d6ae test(README.md):just a test for gitea. 2024-08-04 07:21:29 +08:00
6 changed files with 131 additions and 44 deletions

View File

@ -73,3 +73,4 @@ bun run preview
```
Check out the [deployment documentation](https://nuxt.com/docs/getting-started/deployment) for more information.
Test

View File

@ -0,0 +1,26 @@
<template>
1
<el-progress :text-inside="true" :stroke-width="26" :percentage="70" />
<el-progress
:text-inside="true"
:stroke-width="24"
:percentage="100"
status="success"
/>
<el-progress
:text-inside="true"
:stroke-width="22"
:percentage="80"
status="warning"
/>
<el-progress
:text-inside="true"
:stroke-width="20"
:percentage="50"
status="exception"
/>
</template>
<script lang="ts" setup>
const data = await $fetch("/api/admin/analysis");
const Data = ref(data);
</script>

62
layouts/admin.vue Normal file
View File

@ -0,0 +1,62 @@
<template>
<div class="common-layout">
<el-container>
<el-header>
<DefaultHeader />
</el-header>
<el-main>
<client-only>
<el-container>
<el-aside width="64px">
<el-menu
default-active="2"
class="el-menu-vertical-demo"
collapse
>
<el-menu-item index="1" @click="navigateTo('/admin/')">
<el-icon><DataAnalysis /></el-icon>
<template #title>总览</template>
</el-menu-item>
<el-menu-item
index="2"
@click="navigateTo('/admin/applications')"
>
<el-icon><Stamp /></el-icon>
<template #title>申请审批</template>
</el-menu-item>
<el-menu-item index="3" @click="navigateTo('/admin/loginlogs')">
<el-icon><TakeawayBox /></el-icon>
<template #title>日志</template>
</el-menu-item>
<el-menu-item index="4">
<el-icon><setting /></el-icon>
<template #title>Navigator Four</template>
</el-menu-item>
</el-menu>
</el-aside>
<el-main>
<slot />
</el-main>
</el-container>
</client-only>
</el-main>
<el-footer>
<DefaultFooter />
</el-footer>
</el-container>
</div>
</template>
<script setup lang="ts">
import {
DataAnalysis,
Setting,
Stamp,
TakeawayBox,
} from "@element-plus/icons-vue";
const route = useRoute();
useHead({
meta: [{ property: "title", content: `管理后台 - ${route.meta.title}` }],
});
</script>

View File

@ -0,0 +1,14 @@
<template>
<Head>
<Title>申请审批</Title>
<Meta name="description" />
</Head>
<client-only>
<AdminApplicationDataTable />
</client-only>
</template>
<script lang="ts" setup>
definePageMeta({
layout: "admin",
});
</script>

View File

@ -3,51 +3,11 @@
<Title>管理界面</Title>
<Meta name="description" />
</Head>
<client-only>
<el-container>
<el-aside width="64px">
<el-menu default-active="2" class="el-menu-vertical-demo" collapse>
<el-sub-menu index="1">
<template #title>
<el-icon><location /></el-icon>
<span>Navigator One</span>
</template>
<el-menu-item-group>
<template #title><span>Group One</span></template>
<el-menu-item index="1-1">item one</el-menu-item>
<el-menu-item index="1-2">item two</el-menu-item>
</el-menu-item-group>
<el-menu-item-group title="Group Two">
<el-menu-item index="1-3">item three</el-menu-item>
</el-menu-item-group>
<el-sub-menu index="1-4">
<template #title><span>item four</span></template>
<el-menu-item index="1-4-1">item one</el-menu-item>
</el-sub-menu>
</el-sub-menu>
<el-menu-item index="2">
<el-icon><Stamp /></el-icon>
<template #title>申请审批</template>
</el-menu-item>
<el-menu-item index="3" @click="navigateTo('/admin/loginlogs')">
<el-icon><TakeawayBox /></el-icon>
<template #title>日志</template>
</el-menu-item>
<el-menu-item index="4">
<el-icon><setting /></el-icon>
<template #title>Navigator Four</template>
</el-menu-item>
</el-menu>
</el-aside>
<el-main>
<div class="area">
<AdminApplicationDataTable />
</div>
</el-main>
</el-container>
</client-only>
<AdminDashBoardApplication />
</template>
<script lang="ts" setup>
import { Location, Setting, Stamp, TakeawayBox } from "@element-plus/icons-vue";
definePageMeta({
layout: "admin",
});
</script>
<style></style>

View File

@ -0,0 +1,24 @@
import { PrismaClient } from "@prisma/client";
import type { Application } from "~/types/Application";
const db = new PrismaClient();
export default defineEventHandler(async (event) => {
const applications = {
amounts: (await db.application.findMany()).length,
passAmounts: (
await db.application.findMany({
where: {
deploy: true,
},
})
).length,
unHandleAmounts: (
await db.application.findMany({
where: {
deploy: false,
},
})
).length,
};
await db.$disconnect();
return applications;
});