diff --git a/src/App.vue b/src/App.vue index d947c4a..5e38ba5 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,5 +1,5 @@ diff --git a/src/assets/404.jpg b/src/assets/404.jpg new file mode 100644 index 0000000..0d227b1 Binary files /dev/null and b/src/assets/404.jpg differ diff --git a/src/assets/favicon.ico b/src/assets/favicon.ico new file mode 100644 index 0000000..df36fcf Binary files /dev/null and b/src/assets/favicon.ico differ diff --git a/src/main.ts b/src/main.ts index 4699532..4a0741e 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,22 +1,22 @@ -import ElementPlus from 'element-plus' -import 'element-plus/dist/index.css' -import { createApp } from 'vue' -import { createPinia } from 'pinia' -import * as ElementPlusIconsVue from '@element-plus/icons-vue' -import App from './App.vue' -import router from './router' -import piniaPluginPersistedstate from 'pinia-plugin-persistedstate' -import '@/assets/global.css' +import ElementPlus from "element-plus"; +import "element-plus/dist/index.css"; +import { createApp } from "vue"; +import { createPinia } from "pinia"; +import * as ElementPlusIconsVue from "@element-plus/icons-vue"; +import App from "./App.vue"; +import router from "./router"; +import piniaPluginPersistedstate from "pinia-plugin-persistedstate"; +import "@/assets/global.css"; +import { useFilesStore } from "@/stores/index"; - - -const app = createApp(App) +const app = createApp(App); for (const [key, component] of Object.entries(ElementPlusIconsVue)) { - app.component(key, component) + app.component(key, component); } -app.use(ElementPlus) -app.use(createPinia().use(piniaPluginPersistedstate)) -app.use(router) +app.use(ElementPlus); +app.use(createPinia().use(piniaPluginPersistedstate)); +app.use(router); +app.provide("filesStore", useFilesStore()); -app.mount('#app') +app.mount("#app"); diff --git a/src/router/index.ts b/src/router/index.ts index dcb8a48..3625452 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -1,3 +1,4 @@ +import NotFound from "@/views/404/NotFound.vue"; import { createRouter, createWebHistory } from "vue-router"; const router = createRouter({ @@ -5,8 +6,12 @@ const router = createRouter({ routes: [ { path: "/", - component: import("@/views/layout/layoutContainer.vue"), + component: () => import("@/views/dashboard/layout.vue"), }, + { + path:"/404", + component: ()=> import("@/views/404/NotFound.vue"), + } // { // path: '/about', // name: 'about', diff --git a/src/stores/index.ts b/src/stores/index.ts index e69de29..313ee5e 100644 --- a/src/stores/index.ts +++ b/src/stores/index.ts @@ -0,0 +1,2 @@ +export * from "./modules/files"; +export * from "./modules/user"; diff --git a/src/stores/modules/files.ts b/src/stores/modules/files.ts new file mode 100644 index 0000000..c07625d --- /dev/null +++ b/src/stores/modules/files.ts @@ -0,0 +1,27 @@ +import { defineStore } from "pinia"; +import { ref, type Ref, computed, type ComputedRef } from "vue"; +import { type file } from "@/stores/type"; +export const useFilesStore = defineStore( + "files", + () => { + const Files: Ref = ref([]); + const clearFiles = () => { + Files.value = []; + }; + const setFiles = (files: file[]) => { + Files.value = files; + }; + const isEmpty: ComputedRef = computed(() => { + return Files.value.length === 0; + }); + return { + Files, + isEmpty, + clearFiles, + setFiles, + }; + }, + { + persist: true, + } +); diff --git a/src/stores/modules/user.ts b/src/stores/modules/user.ts index 8d63296..46e36f0 100644 --- a/src/stores/modules/user.ts +++ b/src/stores/modules/user.ts @@ -1,25 +1,23 @@ -import { defineStore } from 'pinia' -import { ref, type Ref } from 'vue' +import { defineStore } from "pinia"; +import { ref, type Ref } from "vue"; export const useUserStore = defineStore( - 'user', - () => { - const token: Ref = ref("") - const setToken = (newToken: string) => { - token.value = newToken; - }; - const removeToken = () => { - token.value = ""; - }; - return { - token, - setToken, - removeToken, - - } - - }, - { - persist: true, - } -) \ No newline at end of file + "user", + () => { + const token: Ref = ref(""); + const setToken = (newToken: string) => { + token.value = newToken; + }; + const removeToken = () => { + token.value = ""; + }; + return { + token, + setToken, + removeToken, + }; + }, + { + persist: true, + } +); diff --git a/src/stores/type.ts b/src/stores/type.ts new file mode 100644 index 0000000..d29b472 --- /dev/null +++ b/src/stores/type.ts @@ -0,0 +1,22 @@ +export interface option { + name: string; + icon: any; + click: Function; +} +/** + * + * + * @export + * @interface file + */ +export interface file { + name: string; + isFolder: boolean; + updateTime: string; + id: string; + fileType: string; + size: number; + icon: any; + isVisible: boolean; + options: option[]; +} diff --git a/src/views/404/NotFound.vue b/src/views/404/NotFound.vue new file mode 100644 index 0000000..0e0209c --- /dev/null +++ b/src/views/404/NotFound.vue @@ -0,0 +1,94 @@ + + + + + 页面未找到 + 抱歉,您访问的页面不存在。 + + + + 返回首页 + + + + + + + + \ No newline at end of file diff --git a/src/views/dashboard/components/FileTable.vue b/src/views/dashboard/components/FileTable.vue new file mode 100644 index 0000000..6daf802 --- /dev/null +++ b/src/views/dashboard/components/FileTable.vue @@ -0,0 +1,81 @@ + + + + + + + + + + + + {{ scope.row.name }} + + + + + + + + + {{ option.name }} + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/views/dashboard/components/NavigationBar.vue b/src/views/dashboard/components/NavigationBar.vue new file mode 100644 index 0000000..7af0997 --- /dev/null +++ b/src/views/dashboard/components/NavigationBar.vue @@ -0,0 +1,48 @@ + + + + + 盘网网盘 + + + + + + + + + + + 个人主页 + + + + + + 帮助中心 + + + + + + 退出登录 + + + + + + diff --git a/src/views/dashboard/components/PageHeader.vue b/src/views/dashboard/components/PageHeader.vue new file mode 100644 index 0000000..ef75841 --- /dev/null +++ b/src/views/dashboard/components/PageHeader.vue @@ -0,0 +1,135 @@ + + + + + + + + + + + 上传文件 + + + + + + 创建新文件夹 + + + + + + + + + + {{ button.name }} + + + + + + + + + + + + + + {{ path }} + + + + + {{ paths.slice(-1)[0] }} + + + + + diff --git a/src/views/dashboard/components/Pagination.vue b/src/views/dashboard/components/Pagination.vue new file mode 100644 index 0000000..cd1833a --- /dev/null +++ b/src/views/dashboard/components/Pagination.vue @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/src/views/dashboard/components/SideBar.vue b/src/views/dashboard/components/SideBar.vue new file mode 100644 index 0000000..c8573c2 --- /dev/null +++ b/src/views/dashboard/components/SideBar.vue @@ -0,0 +1,87 @@ + + + + + + + + + + + + + + + 首页 + + + + + + + 文件 + + + + + + {{ item.content }} + + + + + + + 分享 + + + + + + 回收站 + + + + + + diff --git a/src/views/dashboard/components/test-data.ts b/src/views/dashboard/components/test-data.ts new file mode 100644 index 0000000..c29713c --- /dev/null +++ b/src/views/dashboard/components/test-data.ts @@ -0,0 +1,183 @@ +import { type file } from "@/stores/type"; +import { ref, type Ref, markRaw } from "vue"; +import { + ElIcon, + ElMessage, + ElTable, + ElTableColumn, + ElPopover, + ElInput, +} from "element-plus"; +import { + Document, + VideoPlay, + MoreFilled, + Download, + DocumentDelete, + Edit, + Picture, + Headset, +} from "@element-plus/icons-vue"; + +export const files: Ref = ref([ + { + name: "123", + isFolder: false, + updateTime: "2003-01-2", + id: "adsacafasf", + fileType: "image", + size: 22, + icon: markRaw(Picture), + isVisible: false, + options: [ + { + name: "下载", + icon: markRaw(Download), + click: () => { + ElMessage("下载"); + }, + }, + { + name: "删除", + icon: markRaw(DocumentDelete), + click: () => { + ElMessage("删除"); + }, + }, + { + name: "编辑", + icon: markRaw(Edit), + click: () => { + ElMessage("编辑"); + }, + }, + { + name: "更多", + icon: markRaw(MoreFilled), + click: () => { + ElMessage("更多"); + }, + }, + ], + }, + { + name: "sffdasd", + isFolder: false, + updateTime: "2023-01-12", + id: "adsacaf", + fileType: "video", + size: 22, + icon: markRaw(VideoPlay), + isVisible: false, + options: [ + { + name: "下载", + icon: markRaw(Download), + click: () => { + ElMessage("下载"); + }, + }, + { + name: "删除", + icon: markRaw(DocumentDelete), + click: () => { + ElMessage("删除"); + }, + }, + { + name: "编辑", + icon: markRaw(Edit), + click: () => { + ElMessage("编辑"); + }, + }, + { + name: "更多", + icon: markRaw(MoreFilled), + click: () => { + ElMessage("更多"); + }, + }, + ], + }, + { + name: "sgdfhnd", + isFolder: false, + updateTime: "2013-01-12", + id: "bsdfsdfg", + fileType: "document", + size: 22, + icon: markRaw(Document), + isVisible: false, + options: [ + { + name: "下载", + icon: markRaw(Download), + click: () => { + ElMessage("下载"); + }, + }, + { + name: "删除", + icon: markRaw(DocumentDelete), + click: () => { + ElMessage("删除"); + }, + }, + { + name: "编辑", + icon: markRaw(Edit), + click: () => { + ElMessage("编辑"); + }, + }, + { + name: "更多", + icon: markRaw(MoreFilled), + click: () => { + ElMessage("更多"); + }, + }, + ], + }, + { + name: "basdf", + isFolder: false, + updateTime: "2024-01-12", + id: "bsddfhdhfdfg", + fileType: "audio", + size: 22, + icon: markRaw(Headset), + isVisible: false, + options: [ + { + name: "下载", + icon: markRaw(Download), + click: () => { + ElMessage("下载"); + }, + }, + { + name: "删除", + icon: markRaw(DocumentDelete), + click: () => { + ElMessage("删除"); + }, + }, + { + name: "编辑", + icon: markRaw(Edit), + click: () => { + ElMessage("编辑"); + }, + }, + { + name: "更多", + icon: markRaw(MoreFilled), + click: () => { + ElMessage("更多"); + }, + }, + ], + }, +]); diff --git a/src/views/dashboard/layout.vue b/src/views/dashboard/layout.vue new file mode 100644 index 0000000..ce0802a --- /dev/null +++ b/src/views/dashboard/layout.vue @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + diff --git a/src/views/layout/components/NavigationBar.vue b/src/views/layout/components/NavigationBar.vue deleted file mode 100644 index 7f501ab..0000000 --- a/src/views/layout/components/NavigationBar.vue +++ /dev/null @@ -1,32 +0,0 @@ - - - - - Processing Center - - Workspace - item one - item two - item three - - item four - item one - item two - item three - - - Info - Orders - - - - diff --git a/src/views/layout/components/PageHeader.vue b/src/views/layout/components/PageHeader.vue deleted file mode 100644 index 2ae1ca9..0000000 --- a/src/views/layout/components/PageHeader.vue +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - homepage - - route 1 - route 2 - - - - Title - - - - - diff --git a/src/views/layout/components/SideBar.vue b/src/views/layout/components/SideBar.vue deleted file mode 100644 index 60368eb..0000000 --- a/src/views/layout/components/SideBar.vue +++ /dev/null @@ -1,69 +0,0 @@ - - - - - - - - - - - Navigator One - - - item one - item two - - - item three - - - item four - item one - - - - - Navigator Two - - - - - - Navigator Three - - - - - - Navigator Four - - - - - - diff --git a/src/views/layout/layoutContainer.vue b/src/views/layout/layoutContainer.vue deleted file mode 100644 index 0d66d5e..0000000 --- a/src/views/layout/layoutContainer.vue +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - - - - - - - - - - - - - - diff --git a/src/views/user-info-page/UserInfo.vue b/src/views/user-info-page/UserInfo.vue new file mode 100644 index 0000000..27d97dd --- /dev/null +++ b/src/views/user-info-page/UserInfo.vue @@ -0,0 +1,304 @@ + + + + + + + + + + + + + + 操作 + + + + + + + + 头像 + + + + + + + + + + username + + + {{ account }} + + + + + + + 昵称 + + {{ nickname }} + + + + + + + 年龄 + + {{ age }} + + + + + + + + + + 性别 + + {{ sex }} + + + + + + + 邮箱Email + + {{ email }} + + + + + + + 手机号码 + + {{ mobilePhoneNumber }} + + + + + + + 地区 + + {{ area }} + + + + + + + 职业 + + {{ work }} + + + + + + + + 兴趣爱好 + + {{ hobby }} + + + + + + + 个性签名 + + {{ design }} + + + + + + + 注册日期 + + {{ createDate | formatDate }} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/views/user-info-page/components/FootLeft.vue b/src/views/user-info-page/components/FootLeft.vue new file mode 100644 index 0000000..7d044a5 --- /dev/null +++ b/src/views/user-info-page/components/FootLeft.vue @@ -0,0 +1,73 @@ + + + + + + + 个人中心 + + + + + + + + 个人简介 + + + + + + 个人文件 + + + + + + 收藏文件 + + + + + + 回收站 + + + + + + + \ No newline at end of file diff --git a/src/views/user-info-page/components/Header.vue b/src/views/user-info-page/components/Header.vue new file mode 100644 index 0000000..6c2ca36 --- /dev/null +++ b/src/views/user-info-page/components/Header.vue @@ -0,0 +1,139 @@ + + + + + + + + + + + {{ nickname }} + + + 优质网盘作者 + + + {{ design }} + + + 编辑 + + + + + {{ recycleCounts }} + 回收数 + + + {{ collectCounts }} + 收藏数 + + + {{ goodCounts }} + 文件数 + + + + + + + \ No newline at end of file
抱歉,您访问的页面不存在。