diff --git a/frontend/package.json b/frontend/package.json index 3b768fd..c941648 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -23,6 +23,7 @@ "pinia": "^2.1.7", "pinia-plugin-persist": "^1.0.0", "swiper": "^11.1.15", + "vant": "^4.9.15", "vue": "^3.4.31", "vue-i18n": "^9.13.1", "vue-router": "^4.4.0", diff --git a/frontend/src/components/computer/Computer.vue b/frontend/src/components/computer/Computer.vue index ea75e58..0fc3a44 100644 --- a/frontend/src/components/computer/Computer.vue +++ b/frontend/src/components/computer/Computer.vue @@ -3,600 +3,543 @@
-
+
{{ t("back") }}
-
+
{{ t("view") }}
-
+
- +
-
-
-
- +
+
+
+ {{ t("desktop") }}
{{ t("computer") }}
- + -
+
{{ t("share") }}
- + -
+
-
- +
+ -
+
-
- +
diff --git a/frontend/src/components/desktop/DeskItem.vue b/frontend/src/components/desktop/DeskItem.vue index 098574a..73036ed 100644 --- a/frontend/src/components/desktop/DeskItem.vue +++ b/frontend/src/components/desktop/DeskItem.vue @@ -8,17 +8,30 @@ - + +
+ + {{ getName(item) }} +
+
diff --git a/frontend/src/components/desktop/Desktop.vue b/frontend/src/components/desktop/Desktop.vue index 46c11cd..a18a18d 100644 --- a/frontend/src/components/desktop/Desktop.vue +++ b/frontend/src/components/desktop/Desktop.vue @@ -19,6 +19,15 @@
+
+
+ + {{ getName(item) }} +
+
@@ -27,10 +36,113 @@ import { emitEvent } from "@/system/event"; import { useContextMenu } from "@/hook/useContextMenu"; import { useFileDrag } from "@/hook/useFileDrag"; import { Rect, useRectChosen } from "@/hook/useRectChosen"; -import { useSystem } from "@/system"; +import { useSystem, BrowserWindow } from "@/system"; import { onErrorCaptured } from "vue"; import { useUpgradeStore } from '@/stores/upgrade'; +import { isMobileDevice } from "@/util/device"; +import { basename } from "@/system/core/Path"; +import { t } from "@/i18n"; +import { useAppOpen } from "@/hook/useAppOpen"; + +const { openapp } = useAppOpen("menulist"); +function handle(item: any) { + if (item.name.includes('localchat')) { + openapp(item); + emitEvent("desktop.app.open"); + } else { + emitEvent("magnet.item.click", item); + } + + const sys = useSystem(); + const winopt = sys._rootState.windowMap["Menulist"].get(item.title); + if (winopt) { + if (winopt._hasShow) { + return; + } else { + winopt._hasShow = true; + winopt.window.fullscreen = true + const win = new BrowserWindow(winopt.window); + win.show(); + win.on("close", () => { + winopt._hasShow = false; + }); + } + } +} +function getName(item: any) { + const name = basename(item.path); + if (name.endsWith(".exe")) { + return t(name.replace(".exe", "")); + } else { + return name; + } +} +const bottomApp = [ + { + "isFile": true, + "isDirectory": false, + "isSymlink": false, + "size": 32, + "modTime": "2024-12-16T09:17:18.7214789+08:00", + "atime": "2024-12-16T09:17:18.7214789+08:00", + "birthtime": "2024-12-16T09:17:18.7214789+08:00", + "mtime": "2024-12-16T09:17:18.7214789+08:00", + "rdev": 0, + "mode": 511, + "name": "computer.exe", + "path": "/C/Users/Menulist/computer.exe", + "oldPath": "/C/Users/Menulist/computer.exe", + "parentPath": "/C/Users/Menulist", + "content": "link::Desktop::computer::diannao", + "ext": "exe", + "title": "computer", + "id": 1, + "isPwd": false + }, + { + "isFile": true, + "isDirectory": false, + "isSymlink": false, + "size": 31, + "modTime": "2024-12-16T09:17:18.7214789+08:00", + "atime": "2024-12-16T09:17:18.7214789+08:00", + "birthtime": "2024-12-16T09:17:18.7214789+08:00", + "mtime": "2024-12-16T09:17:18.7214789+08:00", + "rdev": 0, + "mode": 511, + "name": "setting.exe", + "path": "/C/Users/Menulist/setting.exe", + "oldPath": "/C/Users/Menulist/setting.exe", + "parentPath": "/C/Users/Menulist", + "content": "link::Desktop::setting::setting", + "ext": "exe", + "title": "setting", + "id": 15, + "isPwd": false + }, + { + "isFile": true, + "isDirectory": false, + "isSymlink": false, + "size": 30, + "modTime": "2024-12-16T09:17:18.7214789+08:00", + "atime": "2024-12-16T09:17:18.7214789+08:00", + "birthtime": "2024-12-16T09:17:18.7214789+08:00", + "mtime": "2024-12-16T09:17:18.7214789+08:00", + "rdev": 0, + "mode": 511, + "name": "localchat.exe", + "path": "/C/Users/Desktop/localchat.exe", + "oldPath": "/C/Users/Desktop/localchat.exe", + "parentPath": "/C/Users/Desktop", + "content": "link::Desktop::localchat::chat", + "ext": "exe", + "title": "localchat", + "id": 3, + "isPwd": false + } +]; const { createDesktopContextMenu } = useContextMenu(); const { choseStart, chosing, choseEnd, getRect, Chosen } = useRectChosen(); const system = useSystem(); @@ -119,5 +231,32 @@ onErrorCaptured((err) => { .bottom { display: none; } + + .bottom-bar { + display: flex; + justify-content: space-evenly; + position: absolute; + width: vw(340); + left: 50%; + transform: translateX(-50%); + bottom: vh(15); + height: vh(80); + border-radius: vw(50); + color: #e5e3e3d5; + background-color: rgba(255, 255, 255, .2); + backdrop-filter: blur(15px); + + .magnet-item { + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + + .magnet-item_img { + width: vw(40); + height: vh(40); + } + } + } } diff --git a/frontend/src/components/window/WindowNode.vue b/frontend/src/components/window/WindowNode.vue index 086b7dd..4e1a8a5 100644 --- a/frontend/src/components/window/WindowNode.vue +++ b/frontend/src/components/window/WindowNode.vue @@ -1,13 +1,11 @@ diff --git a/frontend/src/main.ts b/frontend/src/main.ts index 7a3dba6..b9bc522 100644 --- a/frontend/src/main.ts +++ b/frontend/src/main.ts @@ -1,24 +1,26 @@ -import * as ElementPlusIconsVue from '@element-plus/icons-vue'; +import * as ElementPlusIconsVue from "@element-plus/icons-vue" //svg插件需要配置代码 -import ElementPlus from 'element-plus'; -import 'element-plus/dist/index.css'; -import { createApp } from "vue"; -import screenShort from "vue-web-screen-shot"; -import App from "./App.vue"; -import './assets/windows10.scss'; -import { i18n } from './i18n/index.ts'; -import pinia from './stores/index.ts'; -import router from './system/router'; +import ElementPlus from "element-plus" +import "element-plus/dist/index.css" +import { createApp } from "vue" +import screenShort from "vue-web-screen-shot" +import App from "./App.vue" +import "./assets/windows10.scss" +import { i18n } from "./i18n/index.ts" +import pinia from "./stores/index.ts" +import router from "./system/router" +import { NavBar } from "vant" +import "vant/lib/index.css" const app = createApp(App) app.use(router) app.use(ElementPlus) app.use(pinia) app.use(i18n) - +app.use(NavBar) app.use(screenShort, { enableWebRtc: true }) for (const [key, component] of Object.entries(ElementPlusIconsVue)) { app.component(key, component) } -app.mount("#app"); +app.mount("#app")