diff --git a/vite/src/router/index.ts b/vite/src/router/index.ts index bc0c2aac70b000e0dce82f7437dbd0ece67da9b8..95a1945480d903bc4726c7ef8193b5fd8c2967eb 100644 --- a/vite/src/router/index.ts +++ b/vite/src/router/index.ts @@ -2,52 +2,43 @@ import { createRouter, createWebHashHistory, RouteRecordRaw } from 'vue-router' import Home from '../views/Home.vue' import Dish from '../views/Dish.vue' import Card from '../views/RouterCard.vue' -import Admin from '@/views/Admin.vue'; -import Teacher from '@/views/Teacher.vue'; -import Student from '@/views/Student.vue'; +import Admin from '@/views/Admin.vue' +import Teacher from '@/views/Teacher.vue' +import Student from '@/views/Student.vue' const routes: Array = [ - { - path: '/', - name: 'home', - redirect: '/dish', - component: Home, - - // 子路由 - children: [ - { - path: '/dish', - name: 'dish', - component: Dish - }, - { - path: '/card', - name: 'card', - component: Card - }, - { - path: '/Admin', - name: 'Admin', - component: Admin - }, - { - path: '/Teacher', - name: 'Teacher', - component: Teacher - }, - { - path: '/Student', - name: 'Student', - component: Student - } - ] - }, - + { + path: '/', + name: 'home', + component: Home, + children: [ + { + path: '', // 默认子路由,访问/时显示 + name: 'home-default', + component: Admin + }, + { + path: 'admin', + name: 'admin', + component: Admin + }, + { + path: 'teacher', + name: 'teacher', + component: Teacher + }, + { + path: 'student', + name: 'student', + component: Student + } + ] + } ] const router = createRouter({ - history: createWebHashHistory(), // 最好使用WebHashHistory方式;如果使用WebHistory会非常麻烦,不建议使用这种方式 - routes + history: createWebHashHistory(), + routes }) -export default router +export default router \ No newline at end of file diff --git a/vite/src/views/Admin.vue b/vite/src/views/Admin.vue index 31c0154d39b8e21225c564d601bc4faee0f3359a..fc95264426f95fbe917ff216c0c327267904f1d6 100644 --- a/vite/src/views/Admin.vue +++ b/vite/src/views/Admin.vue @@ -133,9 +133,11 @@ 申请编号 - 申请类型 - 申请人 - 申请时间 + 用户Id + 课程id + 数据库Id + 描述 + 创建时间 状态 操作 @@ -143,12 +145,14 @@ {{ app.id }} - {{ app.type }} - {{ app.applicant }} - {{ app.time }} + {{ app.userId }} + {{ app.courseid }} + {{ app.dataBaseId }} + {{ app.description }} + {{ app.createTime }} - - {{ app.status }} + + {{ getStatusText(app.status) }} @@ -169,21 +173,23 @@
-
- - -
+
+
+ +
@@ -203,9 +209,11 @@ 申请编号 - 申请类型 - 申请人 - 申请时间 + 用户Id + 课程id + 数据库Id + 描述 + 创建时间 状态 @@ -215,12 +223,14 @@ {{ app.id }} - {{ app.type }} - {{ app.applicant }} - {{ app.time }} + {{ app.userId }} + {{ app.courseid }} + {{ app.dataBaseId }} + {{ app.description }} + {{ app.createTime }} - - {{ app.status }} + + {{ getStatusText(app.status) }} @@ -259,8 +269,8 @@ 授权ID - 授权类型 用户/组 + 数据库ID 授权时间 到期时间 状态 @@ -270,8 +280,8 @@ {{ item.id }} - {{ item.type }} {{ item.user }} + {{ item.dataBaseId }} {{ item.authTime }} {{ item.expiryTime }} @@ -375,8 +385,28 @@ 操作 - - + + + {{ server.id }} + {{ server.name }} + {{ server.ip }} + {{ server.dbCount }} + {{ server.userCount }} + +
+
+
+ {{ server.usage }}% + + + + + +
@@ -442,8 +472,26 @@ 操作 - - + + + {{ db.id }} + {{ db.name }} + {{ db.user }} + {{ db.createTime }} + {{ db.size }} + {{ db.course }} + + + + + +
@@ -512,9 +560,24 @@ + + +
+
+
+ +
+
+

操作成功

+
申请已成功授权
+
+ +
+
- - - \ No newline at end of file diff --git a/vite/src/views/Home.vue b/vite/src/views/Home.vue index bb47e0383ba7e6eff38ea51845c94b34b846cafa..2110a97ff37bcd96f57c2c1d859bbdcd1ba1f73e 100644 --- a/vite/src/views/Home.vue +++ b/vite/src/views/Home.vue @@ -1,63 +1,48 @@ - - - \ No newline at end of file diff --git a/vite/src/views/Student.vue b/vite/src/views/Student.vue index eb15b909f2a150f271f01a422ba27cce5cf8a480..f93beb120a6b7b84d170db8a3cf80bbce9380105 100644 --- a/vite/src/views/Student.vue +++ b/vite/src/views/Student.vue @@ -1,3 +1,4 @@ + diff --git a/vite/src/views/Teacher.vue b/vite/src/views/Teacher.vue index bdd59fbac28ce888fefd1a9dff400be0e2433e30..e9faab870e8d731cfd63b6086063ecb1166bcd34 100644 --- a/vite/src/views/Teacher.vue +++ b/vite/src/views/Teacher.vue @@ -245,7 +245,7 @@ -- - @@ -261,7 +261,7 @@ 2025-06-19 10:20 - @@ -277,7 +277,7 @@ 2025-06-16 16:30 - @@ -314,28 +314,56 @@
+ +
+
+ + +
+
+ + +
+
+ +
+ + +
+
+
+
- - - + + + + + - + - - - + + + + + - - - - - - - - - - - - - - - - @@ -578,153 +604,148 @@
-
+

我的申请记录

-

查看所有数据库相关的申请记录和状态

+

查看所有数据库相关的申请历史记录

-
-
+ +
+
+ + +
+
+ + +
+
+ +
+ + +
+
+
+
- +
-
- -
-
- -
-
- -
+
-
-
申请编号学生姓名数据库名称申请时间用户Id课程id数据库Id描述创建时间 状态 操作
{{ app.id }}{{ app.student }}{{ app.dbName }}{{ app.time }}{{ app.userId }}{{ app.courseid }}{{ app.dataBaseId }}{{ app.description }}{{ app.createTime }} - - {{ app.status }} + + {{ getStatusText(app.status) }} @@ -351,17 +379,16 @@
- 显示 15 条,共 12 条记录 + 显示 {{ (currentPage - 1) * pageSize + 1 }}{{ Math.min(currentPage * pageSize, filteredStdAuthApplications.length) }} 条,共 {{ filteredStdAuthApplications.length }} 条记录
- - - - ... - - +
@@ -370,58 +397,89 @@
+ +
+
+ + +
+
+ + +
+
+ +
+ + +
+
+
+
- - + + + + + + - + - - - - - - - - - - - - - - + + + + + + + + + - - - - - - - -
授权编号学生姓名数据库名称用户Id课程id数据库Id描述授权人Id审批人Id 授权时间授权期限 状态操作
DBAuth20250620001张三 (S2023001)电商数据分析2025-06-20 15:452025-06-20 至 2025-12-20 - - 已授权 - -
DBAuth20250618002王五 (S2023032)数据库课程作业2025-06-18 11:302025-06-18 至 2025-09-18
{{ record.id }}{{ record.userId }}{{ record.courseid }}{{ record.dataBaseId }}{{ record.description }}{{ record.authorizedId }}{{ record.approverId }}{{ record.authTime }} - - 已授权 + + {{ getRecordStatusText(record.status) }}
DBAuth20250615003李四 (S2023015)机器学习实验2025-06-15 09:202025-06-15 至 2026-06-15 - - 已过期 - + +
+ + +
+
+ 显示 13 条,共 12 条记录 +
+
+ + + + ... + + +
+
@@ -530,39 +588,7 @@
-- - -
DBCreate20250615002教学案例库2025-06-15 14:30 - - 已通过 - - 2025-06-16 16:45 - -
DBCreate20250610003科研实验数据库2025-06-10 09:20 - - 已拒绝 - - 2025-06-12 11:30 -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
申请编号申请类型申请时间处理状态处理时间操作
DBView20250620001公共数据库表查看2025-06-20 09:30 - - 审核中 - - -- - -
DBCreate20250620001自建数据库申请2025-06-20 10:15 - - 审核中 - - -- - -
DBView20250618002公共数据库表查看2025-06-18 14:15 - - 已通过 - - 2025-06-19 10:20 - -
DBCreate20250615002自建数据库申请2025-06-15 14:30 - - 已通过 - - 2025-06-16 16:45 - -
DBView20250615003公共数据库表查看2025-06-15 11:45 - - 已拒绝 - - 2025-06-16 16:30 - -
-
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
申请编号申请类型申请内容申请时间处理状态处理时间操作
DBView20250620001公共数据库表查看教学数据库 - 学生信息表2025-06-20 09:30 + + 审核中 + + -- + +
DBView20250618002公共数据库表查看科研数据库 - 实验数据表2025-06-18 14:15 + + 已通过 + + 2025-06-19 10:20 + +
DBView20250615003公共数据库表查看经济类数据库 - 统计分析表2025-06-15 11:45 + + 已拒绝 + + 2025-06-16 16:30 + +
DBCreate20250620001自建数据库申请机器学习研究库2025-06-20 10:15 + + 审核中 + + -- + +
- 显示 15 条,共 12 条记录 + 显示 14 条,共 12 条记录
- + ... + ...
+
- -
-
-
-

选择数据库表

- -
-
- -
-
- - -
+ +
+ +
+ +
+

{{ modalTitle }}

+
-
- -
-
-
-

{{ stdAuthModalTitle }}

- -
-
- -
+ +
+ +
+
-

申请编号

-

{{ currentStdAuthApp?.id }}

+

申请编号

+

{{ currentApplyDetail.id }}

-

学生姓名

-

{{ currentStdAuthApp?.student }}

+

申请类型

+

{{ currentApplyDetail.type }}

-

数据库名称

-

{{ currentStdAuthApp?.dbName }}

+

申请时间

+

{{ currentApplyDetail.applyTime }}

-

申请时间

-

{{ currentStdAuthApp?.time }}

+

处理状态

+

{{ currentApplyDetail.status }}

-

申请理由

-
- 用于课程《数据库原理》的实验作业,需要访问数据库进行SQL查询练习和数据分析。 +

申请理由

+

{{ currentApplyDetail.reason }}

+
+
+

处理意见

+

{{ currentApplyDetail.processingOpinion || '无处理意见' }}

+
+
+ +

申请内容

+
+
+
+

数据库名称

+

{{ currentApplyDetail.dbName }}

+
+
+

数据库类型

+

{{ currentApplyDetail.dbType }}

+
+
+

关联课程

+

{{ currentApplyDetail.course || '无关联课程' }}

+
+
+

预期使用方式

+

{{ currentApplyDetail.useType || '未填写' }}

-
-

审核意见

- +
+
+ + +
+
+
+

申请编号

+

{{ currentStdAuth.id }}

-

授权期限

- +

用户Id

+

{{ currentStdAuth.userId }}

-

授权权限

-
-
- - -
-
- - -
-
- - -
-
- - -
+

课程Id

+

{{ currentStdAuth.courseid }}

+
+
+

数据库Id

+

{{ currentStdAuth.dataBaseId }}

+
+
+

创建时间

+

{{ currentStdAuth.createTime }}

+
+
+

当前状态

+

{{ getStatusText(currentStdAuth.status) }}

+
+
+

申请描述

+

{{ currentStdAuth.description }}

+
+
+ +

授权设置

+
+
+
+ + +
+
+ + +
+
+ +
-
- - -
-
-
- -
-
-
-
- © 2025 教师数据库管理系统. 保留所有权利. -
-
- - 帮助中心 - - - 联系我们 - - - 使用条款 - + +
+
+
+

授权编号

+

{{ currentAuthDetail.id }}

+
+
+

授权类型

+

{{ currentAuthDetail.type }}

+
+
+

被授权人

+

{{ currentAuthDetail.user }}

+
+
+

授权人

+

{{ currentAuthDetail.authorizer }}

+
+
+

授权时间

+

{{ currentAuthDetail.authTime }}

+
+
+

过期时间

+

{{ currentAuthDetail.expireTime }}

+
+
+

当前状态

+

{{ getRecordStatusText(currentAuthDetail.status) }}

+
+
+

授权权限

+

{{ currentAuthDetail.permission }}

+
+
+

授权描述

+

{{ currentAuthDetail.description }}

+
+
+

授权意见

+

{{ currentAuthDetail.opinion }}

+
-
+ + +
+ + + +
+
- \ No newline at end of file