diff --git a/components.d.ts b/components.d.ts index 4dbba03..6558830 100644 --- a/components.d.ts +++ b/components.d.ts @@ -8,12 +8,24 @@ export {} /* prettier-ignore */ declare module 'vue' { export interface GlobalComponents { + ChatContent: typeof import('./src/components/mainwindow/ChatView/ChatContent.vue')['default'] + ChatInput: typeof import('./src/components/mainwindow/ChatView/ChatInput.vue')['default'] + ChatTitle: typeof import('./src/components/mainwindow/ChatView/ChatTitle.vue')['default'] + ElBadge: typeof import('element-plus/es')['ElBadge'] ElIcon: typeof import('element-plus/es')['ElIcon'] ElLink: typeof import('element-plus/es')['ElLink'] ElText: typeof import('element-plus/es')['ElText'] FluentCheckBox: typeof import('./src/components/fluent-ui/FluentCheckBox.vue')['default'] FluentInput: typeof import('./src/components/fluent-ui/FluentInput.vue')['default'] + InputSearch: typeof import('./src/components/common/InputBox/InputSearch.vue')['default'] + MessageListItem: typeof import('./src/components/mainwindow/MessageList/MessageListItem.vue')['default'] + NavBar: typeof import('./src/components/mainwindow/NavBar.vue')['default'] + PopMenu: typeof import('./src/components/common/PopMenu/PopMenu.vue')['default'] + PopMenuItem: typeof import('./src/components/common/PopMenu/PopMenuItem.vue')['default'] RouterLink: typeof import('vue-router')['RouterLink'] RouterView: typeof import('vue-router')['RouterView'] + SideBar: typeof import('./src/components/mainwindow/SideBar.vue')['default'] + SvgIcon: typeof import('./src/components/common/SvgIcon.vue')['default'] + TitleBar: typeof import('./src/components/common/TitleBar.vue')['default'] } } diff --git a/electron-builder.json5 b/electron-builder.json5 index 71a15e8..1222b0e 100644 --- a/electron-builder.json5 +++ b/electron-builder.json5 @@ -1,37 +1,45 @@ // @see - https://www.electron.build/configuration/configuration { - $schema: "https://raw.githubusercontent.com/electron-userland/electron-builder/master/packages/app-builder-lib/scheme.json", - appId: "cn.programcx", - asar: true, - productName: "Flow Message", - directories: { - output: "release/${version}", + "$schema": "https://raw.githubusercontent.com/electron-userland/electron-builder/master/packages/app-builder-lib/scheme.json", + "appId": "cn.programcx", + "asar": true, + "productName": "Flow Message", + "directories": { + "output": "release/${version}" }, - files: ["dist", "dist-electron"], - mac: { - target: ["dmg"], - artifactName: "${productName}-Mac-${version}-Installer.${ext}", + "files": [ + "dist", + "dist-electron" + ], + "mac": { + "target": [ + "dmg" + ], + "artifactName": "${productName}-Mac-${version}-Installer.${ext}", icon: "public/icon/icon.icns", }, - win: { - target: [ + "win": { + "target": [ { - target: "nsis", - arch: ["x64"], - }, + "target": "nsis", + "arch": [ + "x64" + ] + } ], - artifactName: "${productName}-Windows-${version}-Setup.${ext}", + "artifactName": "${productName}-Windows-${version}-Setup.${ext}", icon: "public/icon/icon.ico", }, - nsis: { - oneClick: false, - perMachine: false, - allowToChangeInstallationDirectory: true, - deleteAppDataOnUninstall: false, - }, - linux: { - target: ["AppImage"], - artifactName: "${productName}-Linux-${version}.${ext}", - "icon": "public/icon/icon.png", + "nsis": { + "oneClick": false, + "perMachine": false, + "allowToChangeInstallationDirectory": true, + "deleteAppDataOnUninstall": false }, -} + "linux": { + "target": [ + "AppImage" + ], + "artifactName": "${productName}-Linux-${version}.${ext}" + } +} \ No newline at end of file diff --git a/electron/ipc/window.ts b/electron/ipc/window.ts index abe81c5..cf79c35 100644 --- a/electron/ipc/window.ts +++ b/electron/ipc/window.ts @@ -1,318 +1,310 @@ -import { BrowserWindow, ipcMain } from "electron"; +import { BrowserWindow } from "electron"; export default function setupWindowIpcHandlers(win: BrowserWindow | null) { - //改变窗口大小 - ipcMain.on("resize-window", (_event, width: number, height: number) => { - if (win) { - win.setSize(width, height); - } - }); - //设置窗口边框是否可见 - ipcMain.on("set-window-frame-visible", (_event, isFrameVisible: boolean) => { - if (win) { - win.setMenuBarVisibility(isFrameVisible); - win.setResizable(isFrameVisible); - } - }); - - //设置窗口标题 - ipcMain.on("set-window-title", (_event, title: string) => { - if (win) { - win.setTitle(title); - } - }); - - //设置窗口图标 - ipcMain.on("set-window-central", (_event) => { - if (win) { - const { width, height } = win.getBounds(); - const { workAreaSize } = require("electron").screen.getPrimaryDisplay(); - const x = (workAreaSize.width - width) / 2; - const y = (workAreaSize.height - height) / 2; - win.setBounds({ x, y }); - } - }); - - //设置窗口是是否置顶 - ipcMain.on("set-window-always-on-top", (_event, alwaysOnTop: boolean) => { - if (win) { - win.setAlwaysOnTop(alwaysOnTop); - } - }); - - //设置窗口是否可见 - ipcMain.on("set-window-visible", (_event, visible: boolean) => { - if (win) { - visible ? win.show() : win.hide(); - } - }); - - //设置窗口菜单栏是否可见 - ipcMain.on("set-window-menu-bar-visible", (_event, visible: boolean) => { - if (win) { - win.setMenuBarVisibility(visible); - } - }); - - //设置窗口是否可改变大小 - ipcMain.on("set-window-resizable", (_event, resizable: boolean) => { - if (win) { - win.setResizable(resizable); - } - }); - - //设置窗口是否可移动 - ipcMain.on("set-window-movable", (_event, movable: boolean) => { - if (win) { - win.setMovable(movable); - } - }); - - //设置窗口最小化 - ipcMain.on("set-window-minimizable", (_event, minimizable: boolean) => { - if (win) { - win.setMinimizable(minimizable); - } - }); - - //设置窗口最大化 - ipcMain.on("set-window-maximizable", (_event, maximizable: boolean) => { - if (win) { - win.setMaximizable(maximizable); - } - }); - - //设置窗口是否全屏 - ipcMain.on("set-window-full-screen", (_event, fullScreen: boolean) => { - if (win) { - win.setFullScreen(fullScreen); - } - }); - - //设置窗口背景颜色 - ipcMain.on("set-window-background-color", (_event, color: string) => { - if (win) { - win.setBackgroundColor(color); - } - }); - - //设置窗口图标 - ipcMain.on("set-window-icon", (_event, iconPath: string) => { - if (win) { - win.setIcon(iconPath); - } - }); - - //设置窗口是否在所有工作区可见 - ipcMain.on( - "set-window-visible-on-all-workspaces", - (_event, visible: boolean) => { - if (win) { - win.setVisibleOnAllWorkspaces(visible); + // 判断窗口是否有效,返回 true 表示窗口可用 + const checkWindow = () => { + return win && !win.isDestroyed(); + }; + + // ----------------- Set 系列操作(使用 win.webContents 绑定) ----------------- + + if (checkWindow()) { + win.webContents.on("ipc-message", (_event, channel, ...args) => { + // 根据 channel 处理 set 操作 + switch (channel) { + // 改变窗口大小 + case "resize-window": { + const [width, height] = args as number[]; + win.setSize(width, height,true); + console.log("resize-window", width, height); + break; + } + // 设置窗口边框是否可见 + case "set-window-frame-visible": { + const [isFrameVisible] = args as [boolean]; + win.setMenuBarVisibility(isFrameVisible); + win.setResizable(isFrameVisible); + break; + } + // 设置窗口标题 + case "set-window-title": { + const [title] = args as [string]; + win.setTitle(title); + break; + } + // 设置窗口图标(居中窗口) + case "set-window-central": { + const { width, height } = win.getBounds(); + const { workAreaSize } = require("electron").screen.getPrimaryDisplay(); + const x = (workAreaSize.width - width) / 2; + const y = (workAreaSize.height - height) / 2; + win.setBounds({ x, y }); + break; + } + // 设置窗口是否置顶 + case "set-window-always-on-top": { + const [alwaysOnTop] = args as [boolean]; + win.setAlwaysOnTop(alwaysOnTop); + break; + } + // 设置窗口是否可见 + case "set-window-visible": { + const [visible] = args as [boolean]; + visible ? win.show() : win.hide(); + break; + } + // 设置窗口菜单栏是否可见 + case "set-window-menu-bar-visible": { + const [visible] = args as [boolean]; + win.setMenuBarVisibility(visible); + break; + } + // 设置窗口是否可改变大小 + case "set-window-resizable": { + const [resizable] = args as [boolean]; + win.setResizable(resizable); + break; + } + // 设置窗口是否可移动 + case "set-window-movable": { + const [movable] = args as [boolean]; + win.setMovable(movable); + break; + } + // 设置窗口最小化 + case "set-window-minimizable": { + const [minimizable] = args as [boolean]; + win.setMinimizable(minimizable); + break; + } + // 设置窗口最大化 + case "set-window-maximizable": { + const [maximizable] = args as [boolean]; + win.setMaximizable(maximizable); + break; + } + // 设置窗口是否全屏 + case "set-window-full-screen": { + const [fullScreen] = args as [boolean]; + win.setFullScreen(fullScreen); + break; + } + // 设置窗口背景颜色 + case "set-window-background-color": { + const [color] = args as [string]; + win.setBackgroundColor(color); + break; + } + // 设置窗口图标 + case "set-window-icon": { + const [iconPath] = args as [string]; + win.setIcon(iconPath); + break; + } + // 设置窗口是否在所有工作区可见 + case "set-window-visible-on-all-workspaces": { + const [visible] = args as [boolean]; + win.setVisibleOnAllWorkspaces(visible); + break; + } + // 设置窗口大小 + case "set-window-size": { + const [width, height] = args as number[]; + win.setSize(width, height); + break; + } + // 设置窗口位置 + case "set-window-position": { + const [x, y] = args as number[]; + win.setPosition(x, y); + break; + } + // 设置窗口透明度 + case "set-window-opacity": { + const [opacity] = args as [number]; + win.setOpacity(opacity); + break; + } + // 设置窗口是否在任务栏中显示 + case "set-window-in-taskbar": { + const [inTaskbar] = args as [boolean]; + win.setSkipTaskbar(!inTaskbar); + break; + } + // 设置窗口最小化 + case "minimize-window": { + win.minimize(); + break; + } + // 设置窗口最大化 + case "maximize-window": { + win.maximize(); + break; + } + // 设置窗口还原 + case "restore-window": { + win.restore(); + break; + } + // 设置窗口最小大小 + case "set-window-min-size": { + const [minWidth, minHeight] = args as number[]; + win.setMinimumSize(minWidth, minHeight); + break; + } + // 关闭窗口(只触发一次) + case "close-window": { + win.close(); + break; + } + // 销毁窗口 + case "destroy-window": { + win.destroy(); + break; + } + default: { + console.warn("Unknown set-window ipc-message channel:", channel); + } } - } - ); - - //设置窗口大小 - ipcMain.on("set-window-size", (_event, width: number, height: number) => { - if (win) { - win.setSize(width, height); - } - }); - - //设置窗口位置 - ipcMain.on("set-window-position", (_event, x: number, y: number) => { - if (win) { - win.setPosition(x, y); - } - }); - - //设置窗口透明度 - ipcMain.on("set-window-opacity", (_event, opacity: number) => { - if (win) { - win.setOpacity(opacity); - } - }); - - //设置窗口是否在任务栏中显示 - ipcMain.on("set-window-in-taskbar", (_event, inTaskbar: boolean) => { - if (win) { - win.setSkipTaskbar(!inTaskbar); - } - }); - - //设置窗口最小化 - ipcMain.on("minimize-window", () => { - if (win) { - win.minimize(); - } - }); - - //设置窗口最大化 - ipcMain.on("maximize-window", () => { - if (win) { - win.maximize(); - } - }); - - //设置窗口还原 - ipcMain.on("restore-window", () => { - if (win) { - win.restore(); - } - }); - - //关闭窗口 - ipcMain.on("close-window", () => { - if (win) { - win.close(); - } - }); - - //销毁窗口 - ipcMain.on("destroy-window", () => { - if (win) { - win.destroy(); - } - }); - - //获取窗口位置 - ipcMain.on("get-window-position", (_event) => { - if (win) { - const [x, y] = win.getPosition(); - _event.reply("get-window-position-reply", { x, y }); - } - }); - - //获取窗口大小 - ipcMain.on("get-window-size", (_event) => { - if (win) { - const [width, height] = win.getSize(); - _event.reply("get-window-size-reply", { width, height }); - } - }); - - //获取窗口标题 - ipcMain.on("get-window-title", (_event) => { - if (win) { - const title = win.getTitle(); - _event.reply("get-window-title-reply", title); - } - }); - - //获取窗口背景色 - ipcMain.on("get-window-background-color", (_event) => { - if (win) { - const color = win.getBackgroundColor(); - _event.reply("get-window-background-color-reply", color); - } - }); - - //获取窗口透明度 - ipcMain.on("get-window-opacity", (_event) => { - if (win) { - const opacity = win.getOpacity(); - _event.reply("get-window-opacity-reply", opacity); - } - }); - - //获取窗口是否可见 - ipcMain.on("is-window-visible", (_event) => { - if (win) { - const visible = win.isVisible(); - _event.reply("is-window-visible-reply", visible); - } - }); - - //获取窗口是否最大化 - ipcMain.on("is-window-maximized", (_event) => { - if (win) { - const maximized = win.isMaximized(); - _event.reply("is-window-maximized-reply", maximized); - } - }); - - //获取窗口是否最小化 - ipcMain.on("is-window-minimized", (_event) => { - if (win) { - const minimized = win.isMinimized(); - _event.reply("is-window-minimized-reply", minimized); - } - }); - - //获取窗口是否全屏 - ipcMain.on("is-window-full-screen", (_event) => { - if (win) { - const fullScreen = win.isFullScreen(); - _event.reply("is-window-full-screen-reply", fullScreen); - } - }); - - //获取窗口是否可以改变大小 - ipcMain.on("is-window-resizable", (_event) => { - if (win) { - const resizable = win.isResizable(); - _event.reply("is-window-resizable-reply", resizable); - } - }); - - //获取窗口是否在所有工作区可见 - ipcMain.on("is-window-visible-on-all-workspaces", (_event) => { - if (win) { - const visibleOnAllWorkspaces = win.isVisibleOnAllWorkspaces(); - _event.reply( - "is-window-visible-on-all-workspaces-reply", - visibleOnAllWorkspaces - ); - } - }); - - //获取窗口是否置顶 - ipcMain.on("is-window-always-on-top", (_event) => { - if (win) { - const alwaysOnTop = win.isAlwaysOnTop(); - _event.reply("is-window-always-on-top-reply", alwaysOnTop); - } - }); - - //获取窗口是否可移动 - ipcMain.on("is-window-movable", (_event) => { - if (win) { - const movable = win.isMovable(); - _event.reply("is-window-movable-reply", movable); - } - }); - - //获取窗口是否可最小化 - ipcMain.on("is-window-minimizable", (_event) => { - if (win) { - const minimizable = win.isMinimizable(); - _event.reply("is-window-minimizable-reply", minimizable); - } - }); - - //获取窗口是否可最大化 - ipcMain.on("is-window-maximizable", (_event) => { - if (win) { - const maximizable = win.isMaximizable(); - _event.reply("is-window-maximizable-reply", maximizable); - } - }); - - //获取窗口是否可关闭 - ipcMain.on("is-window-closable", (_event) => { - if (win) { - const closable = win.isClosable(); - _event.reply("is-window-closable-reply", closable); - } - }); - - //获取窗口是否在任务栏中显示 - ipcMain.on("is-window-menu-bar-visible", (_event) => { - if (win) { - const menuBarVisible = win.isMenuBarVisible(); - _event.reply("is-window-menu-bar-visible-reply", menuBarVisible); - } - }); + }); + } } +// // ----------------- Get 系列操作(使用全局 ipcMain) ----------------- + +// // 获取窗口位置 +// ipcMain.on("get-window-position", (_event) => { +// if (checkWindow()) { +// const [x, y] = win.getPosition(); +// return { x, y }; +// } +// }); + +// // 获取窗口大小 +// ipcMain.on("get-window-size", (_event) => { +// if (checkWindow()) { +// const [width, height] = win.getSize(); +// return { width, height }; +// } +// }); + +// // 获取窗口标题 +// ipcMain.on("get-window-title", (_event) => { +// if (checkWindow()) { +// const title = win.getTitle(); +// return title; +// } +// }); + +// // 获取窗口背景色 +// ipcMain.on("get-window-background-color", (_event) => { +// if (checkWindow()) { +// const color = win.getBackgroundColor(); +// return color; +// } +// }); + +// // 获取窗口透明度 +// ipcMain.on("get-window-opacity", (_event) => { +// if (checkWindow()) { +// const opacity = win.getOpacity(); +// return opacity; +// } +// }); + +// // 获取窗口是否可见 +// ipcMain.on("is-window-visible", (_event) => { +// if (checkWindow()) { +// const visible = win.isVisible(); +// return visible; +// } +// }); + +// // 获取窗口是否最大化 +// ipcMain.on("is-window-maximized", (_event) => { +// if (checkWindow()) { +// const maximized = win.isMaximized(); +// return maximized; +// } +// }); + +// // 获取窗口是否最小化 +// ipcMain.on("is-window-minimized", (_event) => { +// if (checkWindow()) { +// const minimized = win.isMinimized(); +// return minimized; +// } +// }); + +// // 获取窗口是否全屏 +// ipcMain.on("is-window-full-screen", (_event) => { +// if (checkWindow()) { +// const fullScreen = win.isFullScreen(); +// return fullScreen; +// } +// }); + +// // 获取窗口是否可以改变大小 +// ipcMain.on("is-window-resizable", (_event) => { +// if (checkWindow()) { +// const resizable = win.isResizable(); +// return resizable; +// } +// }); + +// // 获取窗口是否在所有工作区可见 +// ipcMain.on("is-window-visible-on-all-workspaces", (_event) => { +// if (checkWindow()) { +// const visibleOnAllWorkspaces = win.isVisibleOnAllWorkspaces(); +// return visibleOnAllWorkspaces; +// } +// }); + +// // 获取窗口是否置顶 +// ipcMain.on("is-window-always-on-top", (_event) => { +// if (checkWindow()) { +// const alwaysOnTop = win.isAlwaysOnTop(); +// return alwaysOnTop; +// } +// }); + +// // 获取窗口是否可移动 +// ipcMain.on("is-window-movable", (_event) => { +// if (checkWindow()) { +// const movable = win.isMovable(); +// return movable; +// } +// }); + +// // 获取窗口是否可最小化 +// ipcMain.on("is-window-minimizable", (_event) => { +// if (checkWindow()) { +// const minimizable = win.isMinimizable(); +// return minimizable; +// } +// }); + +// // 获取窗口是否可最大化 +// ipcMain.on("is-window-maximizable", (_event) => { +// if (checkWindow()) { +// const maximizable = win.isMaximizable(); +// return maximizable; +// } +// }); + +// // 获取窗口是否可关闭 +// ipcMain.on("is-window-closable", (_event) => { +// if (checkWindow()) { +// const closable = win.isClosable(); +// return closable; +// } +// }); + +// // 获取窗口是否在任务栏中显示 +// ipcMain.on("is-window-menu-bar-visible", (_event) => { +// if (checkWindow()) { +// const menuBarVisible = win.isMenuBarVisible(); +// return menuBarVisible; +// } +// }); +// } diff --git a/electron/main.ts b/electron/main.ts index dd363e6..eb8ed35 100644 --- a/electron/main.ts +++ b/electron/main.ts @@ -1,23 +1,11 @@ import { app, BrowserWindow, ipcMain } from "electron"; import { fileURLToPath } from "node:url"; import setupIpcHandlers from "./ipc"; - import path from "node:path"; const __dirname = path.dirname(fileURLToPath(import.meta.url)); -// The built directory structure -// -// ├─┬─┬ dist -// │ │ └── index.html -// │ │ -// │ ├─┬ dist-electron -// │ │ ├── main.js -// │ │ └── preload.mjs -// │ process.env.APP_ROOT = path.join(__dirname, ".."); - -// 🚧 Use ['ENV_NAME'] avoid vite:define plugin - Vite@2.x export const VITE_DEV_SERVER_URL = process.env["VITE_DEV_SERVER_URL"]; export const MAIN_DIST = path.join(process.env.APP_ROOT, "dist-electron"); export const RENDERER_DIST = path.join(process.env.APP_ROOT, "dist"); @@ -26,15 +14,9 @@ process.env.VITE_PUBLIC = VITE_DEV_SERVER_URL ? path.join(process.env.APP_ROOT, "public") : RENDERER_DIST; -let wins: Array = []; // Store all windows +let wins: Array = []; -/** - * - * @param route 需要加载的URL路径 - * @param width 设置窗口宽度 - * @param height 设置窗口高度 - * @param frame 是否显示窗口边框 - */ +// 创建新窗口 function createNewWindow( route: string, width: number, @@ -73,33 +55,38 @@ function createNewWindow( const finalRoute = route.startsWith("/") ? route : "/" + route; - //加载html文件 + // 加载URL或者本地HTML if (VITE_DEV_SERVER_URL) { const fullUrl = `${VITE_DEV_SERVER_URL}#${finalRoute}`; newWin.loadURL(fullUrl); - newWin.webContents.openDevTools(); + } else { const indexPath = path.join(RENDERER_DIST, "index.html"); newWin.loadFile(indexPath, { hash: finalRoute }); } + newWin.webContents.openDevTools(); - // 等待加载完后再展示窗口 + // 窗口加载完成后显示并发送消息 newWin.webContents.on("did-finish-load", () => { - newWin.show(); - newWin.webContents.send( - "main-process-message", - new Date().toLocaleString() - ); + if (!newWin.isDestroyed()) { + newWin.show(); + newWin.webContents.send( + "main-process-message", + new Date().toLocaleString() + ); + } }); + // 窗口关闭时处理 newWin.on("closed", () => { const index = wins.indexOf(newWin); - //将销毁的窗口从数组中删除 - if (index !== -1) wins.splice(index, 1); + if (index !== -1) { + wins.splice(index, 1); + } + newWin.removeAllListeners(); }); - //设置IPC通信 - setupIpcHandlers(newWin); + setupIpcHandlers(newWin); // 设置IPC处理 wins.push(newWin); } @@ -109,7 +96,6 @@ app.on("window-all-closed", () => { app.quit(); wins.forEach((win) => { win.destroy(); - win = null; }); wins = []; } @@ -117,17 +103,17 @@ app.on("window-all-closed", () => { app.on("activate", () => { if (BrowserWindow.getAllWindows().length === 0) { - createNewWindow("/", 300, 500, true); + createNewWindow("/", 350, 500, true); } }); -//打开应用程序时创建初始窗口 +// 应用程序准备好后创建初始窗口 app.whenReady().then(() => { createNewWindow( "/", - 300, + 350, 500, - true, + false, true, true, true, @@ -140,38 +126,35 @@ app.whenReady().then(() => { ); }); -ipcMain.on( - "create-new-window", - ( - _event, - route: string, - width: number, - height: number, - frame: boolean = true, - hideMenuBar: boolean = true, - resizable: boolean = true, - movable: boolean = true, - minimizable: boolean = true, - maximizable: boolean = true, - fullScreen: boolean = false, - alwaysOnTop: boolean = false, - inTaskbar: boolean = true, - opacity: number = 1 - ) => { - createNewWindow( - route, - width, - height, - frame, - hideMenuBar, - resizable, - movable, - minimizable, - maximizable, - fullScreen, - alwaysOnTop, - inTaskbar, - opacity - ); - } -); +ipcMain.on("create-new-window", ( + _event, + route: string, + width: number, + height: number, + frame: boolean = false, + hideMenuBar: boolean = true, + resizable: boolean = true, + movable: boolean = true, + minimizable: boolean = true, + maximizable: boolean = true, + fullScreen: boolean = false, + alwaysOnTop: boolean = false, + inTaskbar: boolean = true, + opacity: number = 1 +) => { + createNewWindow( + route, + width, + height, + frame, + hideMenuBar, + resizable, + movable, + minimizable, + maximizable, + fullScreen, + alwaysOnTop, + inTaskbar, + opacity + ); +}); diff --git a/electron/preload.ts b/electron/preload.ts index 1d178c4..27943ff 100644 --- a/electron/preload.ts +++ b/electron/preload.ts @@ -86,6 +86,10 @@ contextBridge.exposeInMainWorld("electron", { setWindowInTaskbar: (inTaskbar: boolean) => ipcRenderer.send("set-window-in-taskbar", inTaskbar), + //设置窗口最小大小 + setMinimumSize: (width: number, height: number) => + ipcRenderer.send("set-window-min-size", width, height), + // 窗口操作 minimizeWindow: () => ipcRenderer.send("minimize-window"), maximizeWindow: () => ipcRenderer.send("maximize-window"), diff --git a/package.json b/package.json index eca68b7..e063b08 100644 --- a/package.json +++ b/package.json @@ -37,10 +37,9 @@ "vite": "^5.1.6", "vite-plugin-electron": "^0.28.6", "vite-plugin-electron-renderer": "^0.14.5", + "vite-plugin-svgr": "^4.3.0", "vue-tsc": "^2.0.26" }, "main": "dist-electron/main.js", - "build": { - "publish": null - } -} \ No newline at end of file + "build-icon": "electron-icon-builder --input=./public/favicon.png --output=public --flatten" +} diff --git a/public/assets/svg/add_24.svg b/public/assets/svg/add_24.svg new file mode 100644 index 0000000..43ad117 --- /dev/null +++ b/public/assets/svg/add_24.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/assets/svg/administering_user_16.svg b/public/assets/svg/administering_user_16.svg new file mode 100644 index 0000000..c8f78c0 --- /dev/null +++ b/public/assets/svg/administering_user_16.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/assets/svg/administering_user_24.svg b/public/assets/svg/administering_user_24.svg new file mode 100644 index 0000000..5c79bb2 --- /dev/null +++ b/public/assets/svg/administering_user_24.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/assets/svg/arrow_down_16.svg b/public/assets/svg/arrow_down_16.svg new file mode 100644 index 0000000..7c92567 --- /dev/null +++ b/public/assets/svg/arrow_down_16.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/assets/svg/arrow_down_24.svg b/public/assets/svg/arrow_down_24.svg new file mode 100644 index 0000000..af17ec5 --- /dev/null +++ b/public/assets/svg/arrow_down_24.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/assets/svg/arrow_down_mini_16.svg b/public/assets/svg/arrow_down_mini_16.svg new file mode 100644 index 0000000..49d61bf --- /dev/null +++ b/public/assets/svg/arrow_down_mini_16.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/assets/svg/arrow_down_small_16.svg b/public/assets/svg/arrow_down_small_16.svg new file mode 100644 index 0000000..0fbaad4 --- /dev/null +++ b/public/assets/svg/arrow_down_small_16.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/assets/svg/arrow_left_16.svg b/public/assets/svg/arrow_left_16.svg new file mode 100644 index 0000000..c837423 --- /dev/null +++ b/public/assets/svg/arrow_left_16.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/assets/svg/arrow_left_24.svg b/public/assets/svg/arrow_left_24.svg new file mode 100644 index 0000000..f988703 --- /dev/null +++ b/public/assets/svg/arrow_left_24.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/assets/svg/arrow_left_small_16.svg b/public/assets/svg/arrow_left_small_16.svg new file mode 100644 index 0000000..d97c548 --- /dev/null +++ b/public/assets/svg/arrow_left_small_16.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/assets/svg/arrow_right_16.svg b/public/assets/svg/arrow_right_16.svg new file mode 100644 index 0000000..fba80ff --- /dev/null +++ b/public/assets/svg/arrow_right_16.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/assets/svg/arrow_right_24.svg b/public/assets/svg/arrow_right_24.svg new file mode 100644 index 0000000..89e00e5 --- /dev/null +++ b/public/assets/svg/arrow_right_24.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/assets/svg/arrow_right_small_16.svg b/public/assets/svg/arrow_right_small_16.svg new file mode 100644 index 0000000..30ab31c --- /dev/null +++ b/public/assets/svg/arrow_right_small_16.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/assets/svg/arrow_up_16.svg b/public/assets/svg/arrow_up_16.svg new file mode 100644 index 0000000..e6c5600 --- /dev/null +++ b/public/assets/svg/arrow_up_16.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/assets/svg/arrow_up_24.svg b/public/assets/svg/arrow_up_24.svg new file mode 100644 index 0000000..acd09af --- /dev/null +++ b/public/assets/svg/arrow_up_24.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/assets/svg/arrow_up_small_16.svg b/public/assets/svg/arrow_up_small_16.svg new file mode 100644 index 0000000..15f063c --- /dev/null +++ b/public/assets/svg/arrow_up_small_16.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/assets/svg/arrows_16.svg b/public/assets/svg/arrows_16.svg new file mode 100644 index 0000000..02f7f25 --- /dev/null +++ b/public/assets/svg/arrows_16.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/assets/svg/arrows_24.svg b/public/assets/svg/arrows_24.svg new file mode 100644 index 0000000..26908a2 --- /dev/null +++ b/public/assets/svg/arrows_24.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/assets/svg/brush_16.svg b/public/assets/svg/brush_16.svg new file mode 100644 index 0000000..f6456e8 --- /dev/null +++ b/public/assets/svg/brush_16.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/assets/svg/brush_24.svg b/public/assets/svg/brush_24.svg new file mode 100644 index 0000000..ef7e40d --- /dev/null +++ b/public/assets/svg/brush_24.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/assets/svg/caution_16.svg b/public/assets/svg/caution_16.svg new file mode 100644 index 0000000..f65967e --- /dev/null +++ b/public/assets/svg/caution_16.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/assets/svg/caution_24.svg b/public/assets/svg/caution_24.svg new file mode 100644 index 0000000..c85d99e --- /dev/null +++ b/public/assets/svg/caution_24.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/assets/svg/channel_discover_friend_24.svg b/public/assets/svg/channel_discover_friend_24.svg new file mode 100644 index 0000000..7524b32 --- /dev/null +++ b/public/assets/svg/channel_discover_friend_24.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/assets/svg/channel_discover_star_24.svg b/public/assets/svg/channel_discover_star_24.svg new file mode 100644 index 0000000..e485ef4 --- /dev/null +++ b/public/assets/svg/channel_discover_star_24.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/assets/svg/close_16.svg b/public/assets/svg/close_16.svg new file mode 100644 index 0000000..681d808 --- /dev/null +++ b/public/assets/svg/close_16.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/assets/svg/close_24.svg b/public/assets/svg/close_24.svg new file mode 100644 index 0000000..f6b549b --- /dev/null +++ b/public/assets/svg/close_24.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/assets/svg/esc_16.svg b/public/assets/svg/esc_16.svg new file mode 100644 index 0000000..a8f6b16 --- /dev/null +++ b/public/assets/svg/esc_16.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/assets/svg/esc_24.svg b/public/assets/svg/esc_24.svg new file mode 100644 index 0000000..e14a8bb --- /dev/null +++ b/public/assets/svg/esc_24.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/assets/svg/filelook_ai_16.svg b/public/assets/svg/filelook_ai_16.svg new file mode 100644 index 0000000..2f83d94 --- /dev/null +++ b/public/assets/svg/filelook_ai_16.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/assets/svg/filelook_apk_16.svg b/public/assets/svg/filelook_apk_16.svg new file mode 100644 index 0000000..d62721a --- /dev/null +++ b/public/assets/svg/filelook_apk_16.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/assets/svg/filelook_audio_16.svg b/public/assets/svg/filelook_audio_16.svg new file mode 100644 index 0000000..8c8f06f --- /dev/null +++ b/public/assets/svg/filelook_audio_16.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/assets/svg/filelook_doc_16.svg b/public/assets/svg/filelook_doc_16.svg new file mode 100644 index 0000000..1265643 --- /dev/null +++ b/public/assets/svg/filelook_doc_16.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/assets/svg/filelook_exe_16.svg b/public/assets/svg/filelook_exe_16.svg new file mode 100644 index 0000000..b014b09 --- /dev/null +++ b/public/assets/svg/filelook_exe_16.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/assets/svg/filelook_folder_16.svg b/public/assets/svg/filelook_folder_16.svg new file mode 100644 index 0000000..1a0aeed --- /dev/null +++ b/public/assets/svg/filelook_folder_16.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/assets/svg/filelook_html_16.svg b/public/assets/svg/filelook_html_16.svg new file mode 100644 index 0000000..86c278b --- /dev/null +++ b/public/assets/svg/filelook_html_16.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/assets/svg/filelook_image_16.svg b/public/assets/svg/filelook_image_16.svg new file mode 100644 index 0000000..a54cb09 --- /dev/null +++ b/public/assets/svg/filelook_image_16.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/assets/svg/filelook_ipa_16.svg b/public/assets/svg/filelook_ipa_16.svg new file mode 100644 index 0000000..661b2a7 --- /dev/null +++ b/public/assets/svg/filelook_ipa_16.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/assets/svg/filelook_link_16.svg b/public/assets/svg/filelook_link_16.svg new file mode 100644 index 0000000..5f907ce --- /dev/null +++ b/public/assets/svg/filelook_link_16.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/assets/svg/filelook_multi_files_16.svg b/public/assets/svg/filelook_multi_files_16.svg new file mode 100644 index 0000000..96a8263 --- /dev/null +++ b/public/assets/svg/filelook_multi_files_16.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/assets/svg/filelook_pdf_16.svg b/public/assets/svg/filelook_pdf_16.svg new file mode 100644 index 0000000..1459635 --- /dev/null +++ b/public/assets/svg/filelook_pdf_16.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/assets/svg/filelook_ppt_16.svg b/public/assets/svg/filelook_ppt_16.svg new file mode 100644 index 0000000..3b113ac --- /dev/null +++ b/public/assets/svg/filelook_ppt_16.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/assets/svg/filelook_ps_16.svg b/public/assets/svg/filelook_ps_16.svg new file mode 100644 index 0000000..95e28e9 --- /dev/null +++ b/public/assets/svg/filelook_ps_16.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/assets/svg/filelook_sketch_16.svg b/public/assets/svg/filelook_sketch_16.svg new file mode 100644 index 0000000..cb385bc --- /dev/null +++ b/public/assets/svg/filelook_sketch_16.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/assets/svg/filelook_txt_16.svg b/public/assets/svg/filelook_txt_16.svg new file mode 100644 index 0000000..90f069d --- /dev/null +++ b/public/assets/svg/filelook_txt_16.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/assets/svg/filelook_unknown_16.svg b/public/assets/svg/filelook_unknown_16.svg new file mode 100644 index 0000000..99fc70a --- /dev/null +++ b/public/assets/svg/filelook_unknown_16.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/assets/svg/filelook_video_16.svg b/public/assets/svg/filelook_video_16.svg new file mode 100644 index 0000000..578c897 --- /dev/null +++ b/public/assets/svg/filelook_video_16.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/assets/svg/filelook_xls_16.svg b/public/assets/svg/filelook_xls_16.svg new file mode 100644 index 0000000..6d2782c --- /dev/null +++ b/public/assets/svg/filelook_xls_16.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/assets/svg/filelook_zip_16.svg b/public/assets/svg/filelook_zip_16.svg new file mode 100644 index 0000000..df284b9 --- /dev/null +++ b/public/assets/svg/filelook_zip_16.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/assets/svg/files_16.svg b/public/assets/svg/files_16.svg new file mode 100644 index 0000000..dd33f46 --- /dev/null +++ b/public/assets/svg/files_16.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/assets/svg/files_24.svg b/public/assets/svg/files_24.svg new file mode 100644 index 0000000..62ffb16 --- /dev/null +++ b/public/assets/svg/files_24.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/assets/svg/filter_16.svg b/public/assets/svg/filter_16.svg new file mode 100644 index 0000000..c7b743c --- /dev/null +++ b/public/assets/svg/filter_16.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/assets/svg/filter_24.svg b/public/assets/svg/filter_24.svg new file mode 100644 index 0000000..1aa3c4b --- /dev/null +++ b/public/assets/svg/filter_24.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/assets/svg/finger_16.svg b/public/assets/svg/finger_16.svg new file mode 100644 index 0000000..f83b3a1 --- /dev/null +++ b/public/assets/svg/finger_16.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/assets/svg/finger_24.svg b/public/assets/svg/finger_24.svg new file mode 100644 index 0000000..d2a3d67 --- /dev/null +++ b/public/assets/svg/finger_24.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/assets/svg/full_screen_16.svg b/public/assets/svg/full_screen_16.svg new file mode 100644 index 0000000..c5b8a14 --- /dev/null +++ b/public/assets/svg/full_screen_16.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/assets/svg/full_screen_24.svg b/public/assets/svg/full_screen_24.svg new file mode 100644 index 0000000..563f38f --- /dev/null +++ b/public/assets/svg/full_screen_24.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/assets/svg/full_screen_off_16.svg b/public/assets/svg/full_screen_off_16.svg new file mode 100644 index 0000000..8f375ee --- /dev/null +++ b/public/assets/svg/full_screen_off_16.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/assets/svg/full_screen_off_24.svg b/public/assets/svg/full_screen_off_24.svg new file mode 100644 index 0000000..6f27257 --- /dev/null +++ b/public/assets/svg/full_screen_off_24.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/assets/svg/gif_16.svg b/public/assets/svg/gif_16.svg new file mode 100644 index 0000000..8e7a27e --- /dev/null +++ b/public/assets/svg/gif_16.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/assets/svg/gif_24.svg b/public/assets/svg/gif_24.svg new file mode 100644 index 0000000..8dff24a --- /dev/null +++ b/public/assets/svg/gif_24.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/assets/svg/group_16.svg b/public/assets/svg/group_16.svg new file mode 100644 index 0000000..debe90d --- /dev/null +++ b/public/assets/svg/group_16.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/assets/svg/group_24.svg b/public/assets/svg/group_24.svg new file mode 100644 index 0000000..c771257 --- /dev/null +++ b/public/assets/svg/group_24.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/assets/svg/home_16.svg b/public/assets/svg/home_16.svg new file mode 100644 index 0000000..ccfd41b --- /dev/null +++ b/public/assets/svg/home_16.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/assets/svg/home_24.svg b/public/assets/svg/home_24.svg new file mode 100644 index 0000000..cb603e2 --- /dev/null +++ b/public/assets/svg/home_24.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/assets/svg/image_16.svg b/public/assets/svg/image_16.svg new file mode 100644 index 0000000..44e885d --- /dev/null +++ b/public/assets/svg/image_16.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/assets/svg/image_24.svg b/public/assets/svg/image_24.svg new file mode 100644 index 0000000..c969ef8 --- /dev/null +++ b/public/assets/svg/image_24.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/assets/svg/like_filled_24.svg b/public/assets/svg/like_filled_24.svg new file mode 100644 index 0000000..f756ca8 --- /dev/null +++ b/public/assets/svg/like_filled_24.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/assets/svg/like_outline_16.svg b/public/assets/svg/like_outline_16.svg new file mode 100644 index 0000000..c13d538 --- /dev/null +++ b/public/assets/svg/like_outline_16.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/assets/svg/like_outline_24.svg b/public/assets/svg/like_outline_24.svg new file mode 100644 index 0000000..c50004f --- /dev/null +++ b/public/assets/svg/like_outline_24.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/assets/svg/link_16.svg b/public/assets/svg/link_16.svg new file mode 100644 index 0000000..f7a3131 --- /dev/null +++ b/public/assets/svg/link_16.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/assets/svg/link_24.svg b/public/assets/svg/link_24.svg new file mode 100644 index 0000000..8d0f1ee --- /dev/null +++ b/public/assets/svg/link_24.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/assets/svg/lock_16.svg b/public/assets/svg/lock_16.svg new file mode 100644 index 0000000..2dec0ba --- /dev/null +++ b/public/assets/svg/lock_16.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/assets/svg/lock_24.svg b/public/assets/svg/lock_24.svg new file mode 100644 index 0000000..e06ccc7 --- /dev/null +++ b/public/assets/svg/lock_24.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/assets/svg/long_screenshot_16.svg b/public/assets/svg/long_screenshot_16.svg new file mode 100644 index 0000000..64cb6f7 --- /dev/null +++ b/public/assets/svg/long_screenshot_16.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/assets/svg/long_screenshot_24.svg b/public/assets/svg/long_screenshot_24.svg new file mode 100644 index 0000000..f43f5d8 --- /dev/null +++ b/public/assets/svg/long_screenshot_24.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/assets/svg/max_16.svg b/public/assets/svg/max_16.svg new file mode 100644 index 0000000..c2c3355 --- /dev/null +++ b/public/assets/svg/max_16.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/assets/svg/max_24.svg b/public/assets/svg/max_24.svg new file mode 100644 index 0000000..a84f080 --- /dev/null +++ b/public/assets/svg/max_24.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/assets/svg/minimize_16.svg b/public/assets/svg/minimize_16.svg new file mode 100644 index 0000000..3d88a7d --- /dev/null +++ b/public/assets/svg/minimize_16.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/assets/svg/minimize_24.svg b/public/assets/svg/minimize_24.svg new file mode 100644 index 0000000..6ad1c6c --- /dev/null +++ b/public/assets/svg/minimize_24.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/assets/svg/more_16.svg b/public/assets/svg/more_16.svg new file mode 100644 index 0000000..2e21863 --- /dev/null +++ b/public/assets/svg/more_16.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/assets/svg/more_24.svg b/public/assets/svg/more_24.svg new file mode 100644 index 0000000..afbdffd --- /dev/null +++ b/public/assets/svg/more_24.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/assets/svg/nav/collection_24.svg b/public/assets/svg/nav/collection_24.svg new file mode 100644 index 0000000..4fddb2b --- /dev/null +++ b/public/assets/svg/nav/collection_24.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/assets/svg/nav/download_16.svg b/public/assets/svg/nav/download_16.svg new file mode 100644 index 0000000..e72ca23 --- /dev/null +++ b/public/assets/svg/nav/download_16.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/assets/svg/nav/download_24.svg b/public/assets/svg/nav/download_24.svg new file mode 100644 index 0000000..b8e45e6 --- /dev/null +++ b/public/assets/svg/nav/download_24.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/assets/svg/nav/folder_24.svg b/public/assets/svg/nav/folder_24.svg new file mode 100644 index 0000000..5b6af13 --- /dev/null +++ b/public/assets/svg/nav/folder_24.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/assets/svg/nav/menu_24.svg b/public/assets/svg/nav/menu_24.svg new file mode 100644 index 0000000..f82fd61 --- /dev/null +++ b/public/assets/svg/nav/menu_24.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/assets/svg/nav/nav_application_normal_24.svg b/public/assets/svg/nav/nav_application_normal_24.svg new file mode 100644 index 0000000..c925129 --- /dev/null +++ b/public/assets/svg/nav/nav_application_normal_24.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/assets/svg/nav/nav_contact_active_24.svg b/public/assets/svg/nav/nav_contact_active_24.svg new file mode 100644 index 0000000..1fe5469 --- /dev/null +++ b/public/assets/svg/nav/nav_contact_active_24.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/assets/svg/nav/nav_contact_normal_24.svg b/public/assets/svg/nav/nav_contact_normal_24.svg new file mode 100644 index 0000000..2bf0d7c --- /dev/null +++ b/public/assets/svg/nav/nav_contact_normal_24.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/assets/svg/nav/nav_message_active_24.svg b/public/assets/svg/nav/nav_message_active_24.svg new file mode 100644 index 0000000..3bc090a --- /dev/null +++ b/public/assets/svg/nav/nav_message_active_24.svg @@ -0,0 +1,13 @@ + + + + + + + + + + diff --git a/public/assets/svg/nav/nav_message_normal_24.svg b/public/assets/svg/nav/nav_message_normal_24.svg new file mode 100644 index 0000000..b321ca0 --- /dev/null +++ b/public/assets/svg/nav/nav_message_normal_24.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/assets/svg/nav/nav_setting_normal_16.svg b/public/assets/svg/nav/nav_setting_normal_16.svg new file mode 100644 index 0000000..f3be97e --- /dev/null +++ b/public/assets/svg/nav/nav_setting_normal_16.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/assets/svg/nav/update_16.svg b/public/assets/svg/nav/update_16.svg new file mode 100644 index 0000000..674a1ba --- /dev/null +++ b/public/assets/svg/nav/update_16.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/assets/svg/nav/update_24.svg b/public/assets/svg/nav/update_24.svg new file mode 100644 index 0000000..726ca72 --- /dev/null +++ b/public/assets/svg/nav/update_24.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/assets/svg/open_file_16.svg b/public/assets/svg/open_file_16.svg new file mode 100644 index 0000000..c221dee --- /dev/null +++ b/public/assets/svg/open_file_16.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/assets/svg/open_file_24.svg b/public/assets/svg/open_file_24.svg new file mode 100644 index 0000000..a890ae5 --- /dev/null +++ b/public/assets/svg/open_file_24.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/assets/svg/paste_16.svg b/public/assets/svg/paste_16.svg new file mode 100644 index 0000000..c7c3263 --- /dev/null +++ b/public/assets/svg/paste_16.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/assets/svg/paste_24.svg b/public/assets/svg/paste_24.svg new file mode 100644 index 0000000..d8d92bf --- /dev/null +++ b/public/assets/svg/paste_24.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/assets/svg/pause_16.svg b/public/assets/svg/pause_16.svg new file mode 100644 index 0000000..91f0631 --- /dev/null +++ b/public/assets/svg/pause_16.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/assets/svg/pause_24.svg b/public/assets/svg/pause_24.svg new file mode 100644 index 0000000..371e61f --- /dev/null +++ b/public/assets/svg/pause_24.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/assets/svg/pause_circle_16.svg b/public/assets/svg/pause_circle_16.svg new file mode 100644 index 0000000..51ade29 --- /dev/null +++ b/public/assets/svg/pause_circle_16.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/assets/svg/pause_circle_24.svg b/public/assets/svg/pause_circle_24.svg new file mode 100644 index 0000000..f0f8195 --- /dev/null +++ b/public/assets/svg/pause_circle_24.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/assets/svg/pause_circle_filled_16.svg b/public/assets/svg/pause_circle_filled_16.svg new file mode 100644 index 0000000..2bb62fb --- /dev/null +++ b/public/assets/svg/pause_circle_filled_16.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/assets/svg/pause_circle_filled_24.svg b/public/assets/svg/pause_circle_filled_24.svg new file mode 100644 index 0000000..2337d18 --- /dev/null +++ b/public/assets/svg/pause_circle_filled_24.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/assets/svg/question_16.svg b/public/assets/svg/question_16.svg new file mode 100644 index 0000000..de7cbe7 --- /dev/null +++ b/public/assets/svg/question_16.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/assets/svg/question_24.svg b/public/assets/svg/question_24.svg new file mode 100644 index 0000000..1673d12 --- /dev/null +++ b/public/assets/svg/question_24.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/assets/svg/search.svg b/public/assets/svg/search.svg new file mode 100644 index 0000000..14d1753 --- /dev/null +++ b/public/assets/svg/search.svg @@ -0,0 +1,3 @@ + + + diff --git a/public/assets/svg/star_16.svg b/public/assets/svg/star_16.svg new file mode 100644 index 0000000..f616da8 --- /dev/null +++ b/public/assets/svg/star_16.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/assets/svg/star_24.svg b/public/assets/svg/star_24.svg new file mode 100644 index 0000000..3178bce --- /dev/null +++ b/public/assets/svg/star_24.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/assets/svg/tick_16.svg b/public/assets/svg/tick_16.svg new file mode 100644 index 0000000..1db769b --- /dev/null +++ b/public/assets/svg/tick_16.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/assets/svg/tick_24.svg b/public/assets/svg/tick_24.svg new file mode 100644 index 0000000..7d4e98b --- /dev/null +++ b/public/assets/svg/tick_24.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/assets/svg/transmission_file_16.svg b/public/assets/svg/transmission_file_16.svg new file mode 100644 index 0000000..b017796 --- /dev/null +++ b/public/assets/svg/transmission_file_16.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/assets/svg/transmission_file_24.svg b/public/assets/svg/transmission_file_24.svg new file mode 100644 index 0000000..7b6e05b --- /dev/null +++ b/public/assets/svg/transmission_file_24.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/assets/svg/update_16.svg b/public/assets/svg/update_16.svg new file mode 100644 index 0000000..674a1ba --- /dev/null +++ b/public/assets/svg/update_16.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/assets/svg/update_24.svg b/public/assets/svg/update_24.svg new file mode 100644 index 0000000..726ca72 --- /dev/null +++ b/public/assets/svg/update_24.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/assets/svg/user.svg b/public/assets/svg/user.svg new file mode 100644 index 0000000..8e6b3fe --- /dev/null +++ b/public/assets/svg/user.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/assets/svg/user_24.svg b/public/assets/svg/user_24.svg new file mode 100644 index 0000000..4bcfc44 --- /dev/null +++ b/public/assets/svg/user_24.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/assets/svg/voice_high_16.svg b/public/assets/svg/voice_high_16.svg new file mode 100644 index 0000000..46ef331 --- /dev/null +++ b/public/assets/svg/voice_high_16.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/assets/svg/voice_high_24.svg b/public/assets/svg/voice_high_24.svg new file mode 100644 index 0000000..77959cb --- /dev/null +++ b/public/assets/svg/voice_high_24.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/assets/svg/zoom_in_16.svg b/public/assets/svg/zoom_in_16.svg new file mode 100644 index 0000000..86e8a10 --- /dev/null +++ b/public/assets/svg/zoom_in_16.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/assets/svg/zoom_in_24.svg b/public/assets/svg/zoom_in_24.svg new file mode 100644 index 0000000..26cd857 --- /dev/null +++ b/public/assets/svg/zoom_in_24.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/assets/svg/zoom_out_16.svg b/public/assets/svg/zoom_out_16.svg new file mode 100644 index 0000000..3b7b943 --- /dev/null +++ b/public/assets/svg/zoom_out_16.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/public/assets/svg/zoom_out_24.svg b/public/assets/svg/zoom_out_24.svg new file mode 100644 index 0000000..41ed179 --- /dev/null +++ b/public/assets/svg/zoom_out_24.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/App.vue b/src/App.vue index 1be21bf..4689e7a 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,7 +1,11 @@ - + @@ -10,6 +14,7 @@ .app { width: 100%; height: 100%; + padding: 0 0; display: flex; flex-direction: column; justify-content: center; diff --git a/src/assets/icon.png b/src/assets/icon.png new file mode 100644 index 0000000..bd13b8b Binary files /dev/null and b/src/assets/icon.png differ diff --git a/src/assets/png/avatar.png.jpg b/src/assets/png/avatar.png.jpg new file mode 100644 index 0000000..be6a4fe Binary files /dev/null and b/src/assets/png/avatar.png.jpg differ diff --git a/src/assets/png/c4ccf3a3-4b98-4056-a480-a2ef1d63158f.png b/src/assets/png/c4ccf3a3-4b98-4056-a480-a2ef1d63158f.png new file mode 100644 index 0000000..543d8db Binary files /dev/null and b/src/assets/png/c4ccf3a3-4b98-4056-a480-a2ef1d63158f.png differ diff --git a/src/assets/png/c61ad9e2-8cf5-43d5-b043-1e21a582182d.png b/src/assets/png/c61ad9e2-8cf5-43d5-b043-1e21a582182d.png new file mode 100644 index 0000000..e10f08a Binary files /dev/null and b/src/assets/png/c61ad9e2-8cf5-43d5-b043-1e21a582182d.png differ diff --git a/src/components/common/InputBox/InputSearch.vue b/src/components/common/InputBox/InputSearch.vue new file mode 100644 index 0000000..131ddaa --- /dev/null +++ b/src/components/common/InputBox/InputSearch.vue @@ -0,0 +1,82 @@ + + + + + + \ No newline at end of file diff --git a/src/components/common/PopMenu/PopMenu.vue b/src/components/common/PopMenu/PopMenu.vue new file mode 100644 index 0000000..d12e8df --- /dev/null +++ b/src/components/common/PopMenu/PopMenu.vue @@ -0,0 +1,110 @@ + + + + \ No newline at end of file diff --git a/src/components/common/PopMenu/PopMenuItem.vue b/src/components/common/PopMenu/PopMenuItem.vue new file mode 100644 index 0000000..2fa6737 --- /dev/null +++ b/src/components/common/PopMenu/PopMenuItem.vue @@ -0,0 +1,129 @@ + + + + + \ No newline at end of file diff --git a/src/components/common/PopMenu/index.d.ts b/src/components/common/PopMenu/index.d.ts new file mode 100644 index 0000000..8844289 --- /dev/null +++ b/src/components/common/PopMenu/index.d.ts @@ -0,0 +1,22 @@ +import { iconMap, type IconKey } from '../../../util/icon/iconMap'; + +interface PopMenuAttributeInterface { + items: PopMenuItemInterface[]; + position?: { + x: number; + y: number; + }; + visible: boolean; + autoPositioning?: boolean; +} + +interface PopMenuItemInterface{ + name: string; + icon?:IconKey; + click?: () => void; + children?: PopMenuAttributeInterface; + disabled?: boolean; + divider?: boolean; +} + +export {PopMenuAttributeInterface, PopMenuItemInterface} diff --git a/src/components/common/SvgIcon.vue b/src/components/common/SvgIcon.vue new file mode 100644 index 0000000..b09139f --- /dev/null +++ b/src/components/common/SvgIcon.vue @@ -0,0 +1,66 @@ + + + + + diff --git a/src/components/common/TitleBar.vue b/src/components/common/TitleBar.vue new file mode 100644 index 0000000..01bf1ab --- /dev/null +++ b/src/components/common/TitleBar.vue @@ -0,0 +1,86 @@ + + + diff --git a/src/components/mainwindow/ChatView/ChatContent.vue b/src/components/mainwindow/ChatView/ChatContent.vue new file mode 100644 index 0000000..d483c37 --- /dev/null +++ b/src/components/mainwindow/ChatView/ChatContent.vue @@ -0,0 +1,29 @@ + + + + + \ No newline at end of file diff --git a/src/components/mainwindow/ChatView/ChatInput.vue b/src/components/mainwindow/ChatView/ChatInput.vue new file mode 100644 index 0000000..e705e62 --- /dev/null +++ b/src/components/mainwindow/ChatView/ChatInput.vue @@ -0,0 +1,18 @@ + + + \ No newline at end of file diff --git a/src/components/mainwindow/MessageList/MessageListItem.vue b/src/components/mainwindow/MessageList/MessageListItem.vue new file mode 100644 index 0000000..21873a9 --- /dev/null +++ b/src/components/mainwindow/MessageList/MessageListItem.vue @@ -0,0 +1,103 @@ + + + + + \ No newline at end of file diff --git a/src/components/mainwindow/NavBar.vue b/src/components/mainwindow/NavBar.vue new file mode 100644 index 0000000..e8e7950 --- /dev/null +++ b/src/components/mainwindow/NavBar.vue @@ -0,0 +1,110 @@ + + + \ No newline at end of file diff --git a/src/components/mainwindow/SideBar.vue b/src/components/mainwindow/SideBar.vue new file mode 100644 index 0000000..3ac5680 --- /dev/null +++ b/src/components/mainwindow/SideBar.vue @@ -0,0 +1,138 @@ + + + + \ No newline at end of file diff --git a/src/composables/SideBar/useBadge.ts b/src/composables/SideBar/useBadge.ts new file mode 100644 index 0000000..16f6fa9 --- /dev/null +++ b/src/composables/SideBar/useBadge.ts @@ -0,0 +1,68 @@ +/** + * @description: 侧边栏导航栏数据 + * @module useBadge + * @date 2024-04-10 + */ +import { NavBarItem } from '../../components/mainwindow/NavBar.vue'; +import { ref } from 'vue'; + +export const navData = ref([ + { + icon: 'message', + activeIcon: 'messageActive', + routeName: 'MessageList', + isTab: true, + default: true, + badgeType: 'none', + }, + { + icon: 'contact', + activeIcon: 'contactActive', + routeName: 'contactlist', + isTab: true, + badgeType: 'none', + } +]) + +export const bottomNavData = ref([ + { + icon: 'setting', + activeIcon: 'setting', + routeName: 'setting', + isTab: false, + badgeType: 'none', + }, + { + icon: 'collection', + activeIcon: 'collection', + routeName: 'collection', + isTab: false, + badgeType: 'none', + }, + { + icon: 'folder', + activeIcon: 'folder', + routeName: 'folder', + isTab: false, + badgeType: 'dot', + }, + { + icon: 'menu', + activeIcon: 'menu', + /*click属性等待注入*/ + isTab: false, + badgeType: 'none', + } + +]) +export const setNavBadge=(badgeType: 'dot' | 'number' | 'none', iconType: 'message' | 'contact' | 'setting' | 'collection' | 'folder' | 'menu', number?: number)=> { + const index = navData.value.findIndex((item) => item.icon === iconType); + if (index !== -1) { + navData.value[index].badgeType = badgeType; + if (badgeType === 'number') { + navData.value[index].badgeNumber = number; + } else { + navData.value[index].badgeNumber = 0; + } + } +} diff --git a/src/electron/window.ts b/src/electron/window.ts index 7714928..0c473bf 100644 --- a/src/electron/window.ts +++ b/src/electron/window.ts @@ -127,6 +127,10 @@ export default class Window { window.electron.maximizeWindow(); } + static setMinimumSize(width: number, height: number) { + window.electron.setMinimumSize(width, height); + } + static restoreWindow() { window.electron.restoreWindow(); } @@ -139,107 +143,107 @@ export default class Window { window.electron.destroyWindow(); } - static async getWindowPosition() { - return await window.electron.getWindowPosition().then((position) => { - return position; - }); - } - - static async getWindowSize() { - return await window.electron.getWindowSize().then((size) => { - return size; - }); - } - - static async getWindowTitle() { - return await window.electron.getWindowTitle().then((title) => { - return title; - }); - } - - static async getWindowBackgroundColor() { - return await window.electron.getWindowBackgroundColor().then((color) => { - return color; - }); - } - - static async getWindowOpacity() { - return await window.electron.getWindowOpacity().then((opacity) => { - return opacity; - }); - } - - static async isWindowVisible() { - return await window.electron.isWindowVisible().then((visible) => { - return visible; - }); - } - - static async isWindowMaximized() { - return await window.electron.isWindowMaximized().then((maximized) => { - return maximized; - }); - } - - static async isWindowMinimized() { - return await window.electron.isWindowMinimized().then((minimized) => { - return minimized; - }); - } - - static async isWindowFullScreen() { - return await window.electron.isWindowFullScreen().then((fullScreen) => { - return fullScreen; - }); - } - - static async isWindowResizable() { - return await window.electron.isWindowResizable().then((resizable) => { - return resizable; - }); - } - - static async isWindowVisibleOnAllWorkspaces() { - return await window.electron - .isWindowVisibleOnAllWorkspaces() - .then((visible) => { - return visible; - }); - } - - static async isWindowAlwaysOnTop() { - return await window.electron.isWindowAlwaysOnTop().then((alwaysOnTop) => { - return alwaysOnTop; - }); - } - - static async isWindowMovable() { - return await window.electron.isWindowMovable().then((movable) => { - return movable; - }); - } - - static async isWindowMinimizable() { - return await window.electron.isWindowMinimizable().then((minimizable) => { - return minimizable; - }); - } - - static async isWindowMaximizable() { - return await window.electron.isWindowMaximizable().then((maximizable) => { - return maximizable; - }); - } - - static async isWindowClosable() { - return await window.electron.isWindowClosable().then((closable) => { - return closable; - }); - } - - static async isWindowMenuBarVisible() { - return await window.electron.isWindowMenuBarVisible().then((visible) => { - return visible; - }); - } + // static async getWindowPosition() { + // return await window.electron.getWindowPosition().then((position) => { + // return position; + // }); + // } + + // static async getWindowSize() { + // return await window.electron.getWindowSize().then((size) => { + // return size; + // }); + // } + + // static async getWindowTitle() { + // return await window.electron.getWindowTitle().then((title) => { + // return title; + // }); + // } + + // static async getWindowBackgroundColor() { + // return await window.electron.getWindowBackgroundColor().then((color) => { + // return color; + // }); + // } + + // static async getWindowOpacity() { + // return await window.electron.getWindowOpacity().then((opacity) => { + // return opacity; + // }); + // } + + // static async isWindowVisible() { + // return await window.electron.isWindowVisible().then((visible) => { + // return visible; + // }); + // } + + // static async isWindowMaximized() { + // return await window.electron.isWindowMaximized().then((maximized) => { + // return maximized; + // }); + // } + + // static async isWindowMinimized() { + // return await window.electron.isWindowMinimized().then((minimized) => { + // return minimized; + // }); + // } + + // static async isWindowFullScreen() { + // return await window.electron.isWindowFullScreen().then((fullScreen) => { + // return fullScreen; + // }); + // } + + // static async isWindowResizable() { + // return await window.electron.isWindowResizable().then((resizable) => { + // return resizable; + // }); + // } + + // static async isWindowVisibleOnAllWorkspaces() { + // return await window.electron + // .isWindowVisibleOnAllWorkspaces() + // .then((visible) => { + // return visible; + // }); + // } + + // static async isWindowAlwaysOnTop() { + // return await window.electron.isWindowAlwaysOnTop().then((alwaysOnTop) => { + // return alwaysOnTop; + // }); + // } + + // static async isWindowMovable() { + // return await window.electron.isWindowMovable().then((movable) => { + // return movable; + // }); + // } + + // static async isWindowMinimizable() { + // return await window.electron.isWindowMinimizable().then((minimizable) => { + // return minimizable; + // }); + // } + + // static async isWindowMaximizable() { + // return await window.electron.isWindowMaximizable().then((maximizable) => { + // return maximizable; + // }); + // } + + // static async isWindowClosable() { + // return await window.electron.isWindowClosable().then((closable) => { + // return closable; + // }); + // } + + // static async isWindowMenuBarVisible() { + // return await window.electron.isWindowMenuBarVisible().then((visible) => { + // return visible; + // }); + // } } diff --git a/src/route/index.ts b/src/route/index.ts index f454396..f177e37 100644 --- a/src/route/index.ts +++ b/src/route/index.ts @@ -16,6 +16,24 @@ const routes: RouteRecordRaw[] = [ path: "/home", name: "home", component: () => import("../view/MainWindow.vue"), + children:[ + { + path: "messagelist", + name: "MessageList", + component: () => import("../view/mainwindow/MessageList.vue"), + // children:[ + // { + // path: "chatroom/:id", + // name: "chatroom", + // component: () => import("../view/mainwindow/ChatRoom.vue"), + // } + // ] + },{ + path: "contactlist", + name: "contactlist", + component: () => import("../view/mainwindow/ContactList.vue"), + } + ] }, ]; diff --git a/src/style.css b/src/style.css index 1d5d53f..0eab0dc 100644 --- a/src/style.css +++ b/src/style.css @@ -15,15 +15,109 @@ html.dark { --main-bg-color: rgb(40, 40, 40); + --main-fore-color: #ffffff; + + --dim-background-color: rgb(50, 50, 50); + --dim2-background-color: rgb(55, 55, 55); + --dim3-background-color: rgb(60, 60, 60); + --dim4-background-color: rgb(65, 65, 6); + --dim5-background-color: rgb(70, 70, 70); + --dim6-background-color: rgb(75, 75, 75); + --dim7-background-color: rgb(80, 80, 80); + --dim8-background-color: rgb(85, 85, 85); + --dim9-background-color: rgb(90, 90, 90); + + --sidebar-background-color:#1F1F1F; + + --bar-gradient-color: linear-gradient(135deg,#2F2932 0%,#13212F 100%); + + --nav-icon-color: rgb(255, 255, 255, 0.7); + --nav-icon-color-active: #0065d1; + + --mv-list-background-color: #1B1B1B; + + --pop-menu-background-color: rgba(40, 40, 40, 0.3); + --pop-item-background-color-hover: var(--dim2-background-color); + --pop-item-background-color-active: rgba(35, 35, 35,0.2); + --pop-menu-border-color:rgba(80, 80, 80); + --pop-menu-box-shadow: none; + + --inputbox-background-color: #282828; + --inputbox-background-color-hover: #808080; + --inputbox-border-color-active: #0066CC ; + --inputbox-placeholder-color: #e3e3e3; + + --list-item-background-color: #1B1B1B; + --list-item-background-color-hover: #2D2D2D; + --list-item-background-color-active: #162A3F; + --list-item-background-color-top: #282828; + + --tip-grey-fore-color: #808080; + + --grey-button-background-color: #393939; + --grey-button-background-color-hover: #222222; + + --topbar-icon-color: var(--main-fore-color); + --topbar-icon-color-hover: #0066CC ; + + --border-bottom-color: #393B40; } html { --main-bg-color: white; --main-fore-color: rgb(40, 40, 40); + --dim-background-color: rgba(250, 250, 250, 0.9); + --dim2-background-color: rgba(250, 250, 250, 0.8); + --dim3-background-color: rgba(250, 250, 250, 0.7); + --dim4-background-color: rgba(250, 250, 250, 0.6); + --dim5-background-color: rgba(250, 250, 250, 0.5); + --dim6-background-color: rgba(250, 250, 250, 0.4); + --dim7-background-color: rgba(250, 250, 250, 0.3); + --dim8-background-color: rgba(250, 250, 250, 0.2); + --dim9-background-color: rgba(250, 250, 250, 0.1); + + --sidebar-background-color: #0099FF; + + --bar-gradient-color: linear-gradient(125deg,#FEF3FF 0%,#D9EBFF 100%); + + --nav-icon-color: rgba(255, 255, 255, 0.7); + + --nav-icon-color-active: #fff; + + --mv-list-background-color: #ffffff; + + --pop-menu-background-color: var(--dim2-background-color); + --pop-item-background-color-hover: rgba(240, 240, 240, 0.1); + --pop-item-background-color-active: rgba(230, 230, 230, 0.2); + --pop-menu-box-shadow: 8px 6px 10px 0px rgba(196, 196, 196, 0.2); + + --inputbox-background-color: #F5F5F5; + --inputbox-placeholder-color: #999999; + --inputbox-border-color-active: #0099FF; + --inputbox-background-color-hover: #5e5e5e; + + --grey-button-background-color: #EBEBEB; + --grey-button-background-color-active: #D7D7D7; + + --list-item-background-color: #FFFFFF; + --list-item-background-color-hover: #F5F5F5; + --list-item-background-color-active: #CCEBFF; + --list-item-background-color-top: #E7E7E7; + + --tip-grey-fore-color: #a2a2a2; + background-color: var(--main-bg-color); + color: var(--main-fore-color); + + --pop-menu-border-color:none; + + --topbar-icon-color: var(--main-fore-color); + --topbar-icon-color-hover:var(--sidebar-background-color) ; + + --border-bottom-color: #d9d9d9; } @@ -35,7 +129,7 @@ body { #app { margin: 0 auto; - padding: 2rem; + padding: 0; text-align: center; } @@ -66,7 +160,7 @@ body { align-items: center; } -.flex-row-space-bettween { +.flex-row-space-between { display: flex; flex-direction: row; justify-content: space-between; @@ -85,13 +179,19 @@ body { justify-content: center; } +.flex-column-space-between { + display: flex; + flex-direction: column; + justify-content: space-between; +} + .flex-row { - display: row; + display: flex; flex-direction: row; } .flex-column { - display: column; + display: flex; flex-direction: column; } @@ -114,4 +214,28 @@ body { color: #213547; background-color: #ffffff; } -} */ \ No newline at end of file +} */ + +/* 为滚动条整体设置样式 */ +::-webkit-scrollbar { + width: 6px; + height: 6px; +} + +/* 为滚动条的轨道设置样式 */ +::-webkit-scrollbar-track { + background: rgba(#101F1C, 0.1); + border-radius: 2em; +} + +/* 为滚动条的滑块设置样式 */ +::-webkit-scrollbar-thumb { + background-color: rgba(144, 147, 153, .3); + border-radius: 2em; + transition: background-color .3s; +} + +/* 当鼠标悬停在滑块上时改变滑块的颜色 */ +::-webkit-scrollbar-thumb:hover { + background-color: rgba(144, 147, 153, .1); +} \ No newline at end of file diff --git a/src/types/ElectronRawApi.d.ts b/src/types/ElectronRawApi.d.ts index fd26a6d..1c7fda8 100644 --- a/src/types/ElectronRawApi.d.ts +++ b/src/types/ElectronRawApi.d.ts @@ -33,27 +33,28 @@ declare interface Window { setWindowPosition: (x: number, y: number) => void; setWindowOpacity: (opacity: number) => void; setWindowInTaskbar: (inTaskbar: boolean) => void; + setMinimumSize: (width: number, height: number) => void; minimizeWindow: () => void; maximizeWindow: () => void; restoreWindow: () => void; closeWindow: () => void; destroyWindow: () => void; - getWindowPosition: () => Promise<{ x: number; y: number }>; - getWindowSize: () => Promise<{ width: number; height: number }>; - getWindowTitle: () => Promise; - getWindowBackgroundColor: () => Promise; - getWindowOpacity: () => Promise; - isWindowVisible: () => Promise; - isWindowMaximized: () => Promise; - isWindowMinimized: () => Promise; - isWindowFullScreen: () => Promise; - isWindowResizable: () => Promise; - isWindowVisibleOnAllWorkspaces: () => Promise; - isWindowAlwaysOnTop: () => Promise; - isWindowMovable: () => Promise; - isWindowMinimizable: () => Promise; - isWindowMaximizable: () => Promise; - isWindowClosable: () => Promise; - isWindowMenuBarVisible: () => Promise; + // getWindowPosition: () => Promise<{ x: number; y: number }>; + // getWindowSize: () => Promise<{ width: number; height: number }>; + // getWindowTitle: () => Promise; + // getWindowBackgroundColor: () => Promise; + // getWindowOpacity: () => Promise; + // isWindowVisible: () => Promise; + // isWindowMaximized: () => Promise; + // isWindowMinimized: () => Promise; + // isWindowFullScreen: () => Promise; + // isWindowResizable: () => Promise; + // isWindowVisibleOnAllWorkspaces: () => Promise; + // isWindowAlwaysOnTop: () => Promise; + // isWindowMovable: () => Promise; + // isWindowMinimizable: () => Promise; + // isWindowMaximizable: () => Promise; + // isWindowClosable: () => Promise; + // isWindowMenuBarVisible: () => Promise; }; } diff --git a/src/util/icon/iconMap.ts b/src/util/icon/iconMap.ts new file mode 100644 index 0000000..6745ba8 --- /dev/null +++ b/src/util/icon/iconMap.ts @@ -0,0 +1,76 @@ +/** + * @description: 图标映射表 + * @module iconMap + * @date 2024-04-09 + */ + +import MessageIcon from '/assets/svg/nav/nav_message_normal_24.svg'; +import MessageActiveIcon from '/assets/svg/nav/nav_message_active_24.svg'; +import ContactIcon from '/assets/svg/nav/nav_contact_normal_24.svg'; +import ContactActiveIcon from '/assets/svg/nav/nav_contact_active_24.svg'; +import SettingIcon from '/assets/svg/nav/nav_setting_normal_16.svg'; +import Collection from '/assets/svg/nav/collection_24.svg'; +import Menu from '/assets/svg/nav/menu_24.svg'; +import Folder from '/assets/svg/nav/folder_24.svg'; +import Lock from '/assets/svg/lock_24.svg'; +import Caution from '/assets/svg/caution_24.svg'; +import Esc from '/assets/svg/esc_24.svg'; +import Question from '/assets/svg/question_24.svg'; +import Update from '/assets/svg/update_24.svg'; +import arrowRightSmall from '/assets/svg/arrow_right_small_16.svg'; +import Close from '/assets/svg/close_24.svg'; +import Minimize from '/assets/svg/minimize_24.svg'; +import Max from '/assets/svg/max_24.svg'; +import Brush from '/assets/svg/brush_24.svg'; +import Search from '/assets/svg/search.svg'; +import Add from '/assets/svg/add_24.svg'; +import More from '/assets/svg/more_24.svg'; +// 图标 key 类型 +export type IconKey = + | 'message' + | 'messageActive' + | 'contact' + | 'contactActive' + | 'setting' + | 'collection' + | 'menu' + | 'folder' + | 'lock' + | 'caution' + | 'esc' + | 'question' + | 'update' + | 'arrowRightSmall' + | 'close' + | 'minimize' + | 'max' + | 'brush' + | 'search' + | 'add' + | 'more'; + +// 图标映射表 +export const iconMap: Record = { + message: MessageIcon, + messageActive: MessageActiveIcon, + contact: ContactIcon, + contactActive: ContactActiveIcon, + setting: SettingIcon, + collection: Collection, + menu: Menu, + folder: Folder, + lock: Lock, + caution: Caution, + esc :Esc, + question: Question, + update: Update, + arrowRightSmall: arrowRightSmall, + close: Close, + minimize: Minimize, + max: Max, + brush: Brush, + search: Search, + add: Add, + more: More, +}; + diff --git a/src/view/Login.vue b/src/view/Login.vue index e51e83f..c65aa55 100644 --- a/src/view/Login.vue +++ b/src/view/Login.vue @@ -30,7 +30,7 @@
记住我 - 注册 + 注册
@@ -54,7 +54,7 @@ {{ messageRegister }}
- +
@@ -228,7 +228,7 @@ const login = () => { return; } console.log('loginData', loginData.value); - Window.createNewWindow('/home', 400, 400, true); + Window.createNewWindow('/home/messagelist', 900, 700, false); } @@ -245,20 +245,34 @@ watch(isDark, (newValue) => { immediate: true, deep: true }) -watch(isLogin, (newValue) => { - if (newValue) { - // window.electron.setWindowFrameVisible(true); - Window.setWindowTitle('登录'); - Window.setWindowSize(350, 500); - } else { - window.electron.setWindowTitle('注册'); - window.electron.resizeWindow(350, 580); - } -}, { - immediate: true, - deep: true -}) +// watch(isLogin.value, (newValue) => { +// if (newValue) { +// // window.electron.setWindowFrameVisible(true); +// Window.setWindowTitle('登录'); +// Window.setWindowSize(350, 400); +// } else { +// window.electron.setWindowTitle('注册'); +// window.electron.resizeWindow(350, 580); +// } +// }, { +// immediate: true, +// deep: true +// }) + +const toggleState = (login: boolean) => { + Window.setWindowResizable(true); + if(login){ + Window.setWindowTitle('登录'); + + Window.setWindowSize(350, 500); + }else{ + window.electron.setWindowTitle('注册'); + window.electron.resizeWindow(350, 580); + } + isLogin.value = !isLogin.value; + Window.setWindowResizable(false); +} onMounted(() => { window.electron.setWindowTitle('登录'); //防止页面滚动 @@ -266,6 +280,7 @@ onMounted(() => { if (body) { body.style.overflow = 'hidden'; } + Window.setWindowResizable(false); }) diff --git a/src/view/MainWindow.vue b/src/view/MainWindow.vue index e6000dc..bee6ca8 100644 --- a/src/view/MainWindow.vue +++ b/src/view/MainWindow.vue @@ -1,5 +1,73 @@ + + \ No newline at end of file + + + + + \ No newline at end of file diff --git a/src/view/mainwindow/ChatView.vue b/src/view/mainwindow/ChatView.vue new file mode 100644 index 0000000..2a636a9 --- /dev/null +++ b/src/view/mainwindow/ChatView.vue @@ -0,0 +1,26 @@ + + + \ No newline at end of file diff --git a/src/view/mainwindow/ContactList.vue b/src/view/mainwindow/ContactList.vue new file mode 100644 index 0000000..250f44b --- /dev/null +++ b/src/view/mainwindow/ContactList.vue @@ -0,0 +1,6 @@ + + \ No newline at end of file diff --git a/src/view/mainwindow/ListView.vue b/src/view/mainwindow/ListView.vue new file mode 100644 index 0000000..f29ce65 --- /dev/null +++ b/src/view/mainwindow/ListView.vue @@ -0,0 +1,63 @@ + + + \ No newline at end of file diff --git a/src/view/mainwindow/MessageList.vue b/src/view/mainwindow/MessageList.vue new file mode 100644 index 0000000..a80a024 --- /dev/null +++ b/src/view/mainwindow/MessageList.vue @@ -0,0 +1,51 @@ + + + + + \ No newline at end of file diff --git a/tsconfig.json b/tsconfig.json index 39a1578..c84de58 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -21,14 +21,19 @@ "strict": false, "noUnusedLocals": true, "noUnusedParameters": true, - "noFallthroughCasesInSwitch": true + "noFallthroughCasesInSwitch": true, + "baseUrl": ".", + "paths": { + "@/*": ["src/*"] + } }, "include": [ "src/**/*.ts", "src/**/*.tsx", "src/**/*.vue", - "electron" + "electron", ], + "exclude": ["node_modules"], "references": [ { "path": "./tsconfig.node.json" diff --git a/vite.config.ts b/vite.config.ts index 7ed6143..ac22c63 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -5,11 +5,13 @@ import vue from "@vitejs/plugin-vue"; import AutoImport from "unplugin-auto-import/vite"; import Components from "unplugin-vue-components/vite"; import { ElementPlusResolver } from "unplugin-vue-components/resolvers"; +import svgr from 'vite-plugin-svgr'; // https://vitejs.dev/config/ export default defineConfig({ plugins: [ vue(), + svgr(), electron({ main: { // Shortcut of `build.lib.entry`. @@ -36,4 +38,9 @@ export default defineConfig({ resolvers: [ElementPlusResolver()], }), ], + resolve: { + alias: { + '@': path.resolve(__dirname, 'src'), + }, + }, }); diff --git a/vite.config.ts.timestamp-1744225182689-98e3a8e5570f9.mjs b/vite.config.ts.timestamp-1744225182689-98e3a8e5570f9.mjs new file mode 100644 index 0000000..f7832a4 --- /dev/null +++ b/vite.config.ts.timestamp-1744225182689-98e3a8e5570f9.mjs @@ -0,0 +1,45 @@ +// vite.config.ts +import { defineConfig } from "file:///E:/Document/Projects/flow_im/node_modules/.store/vite@5.4.17/node_modules/vite/dist/node/index.js"; +import path from "node:path"; +import electron from "file:///E:/Document/Projects/flow_im/node_modules/.store/vite-plugin-electron@0.28.8/node_modules/vite-plugin-electron/dist/simple.mjs"; +import vue from "file:///E:/Document/Projects/flow_im/node_modules/.store/@vitejs+plugin-vue@5.2.3/node_modules/@vitejs/plugin-vue/dist/index.mjs"; +import AutoImport from "file:///E:/Document/Projects/flow_im/node_modules/.store/unplugin-auto-import@19.1.2/node_modules/unplugin-auto-import/dist/vite.js"; +import Components from "file:///E:/Document/Projects/flow_im/node_modules/.store/unplugin-vue-components@28.4.1/node_modules/unplugin-vue-components/dist/vite.js"; +import { ElementPlusResolver } from "file:///E:/Document/Projects/flow_im/node_modules/.store/unplugin-vue-components@28.4.1/node_modules/unplugin-vue-components/dist/resolvers.js"; +var __vite_injected_original_dirname = "E:\\Document\\Projects\\flow_im"; +var vite_config_default = defineConfig({ + plugins: [ + vue(), + electron({ + main: { + // Shortcut of `build.lib.entry`. + entry: "electron/main.ts" + }, + preload: { + // Shortcut of `build.rollupOptions.input`. + // Preload scripts may contain Web assets, so use the `build.rollupOptions.input` instead `build.lib.entry`. + input: path.join(__vite_injected_original_dirname, "electron/preload.ts") + }, + // Ployfill the Electron and Node.js API for Renderer process. + // If you want use Node.js in Renderer process, the `nodeIntegration` needs to be enabled in the Main process. + // See 👉 https://github.com/electron-vite/vite-plugin-electron-renderer + renderer: process.env.NODE_ENV === "test" ? ( + // https://github.com/electron-vite/vite-plugin-electron-renderer/issues/78#issuecomment-2053600808 + void 0 + ) : {} + }), + AutoImport({ + resolvers: [ + ElementPlusResolver() + /* auto import element-plus */ + ] + }), + Components({ + resolvers: [ElementPlusResolver()] + }) + ] +}); +export { + vite_config_default as default +}; +//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsidml0ZS5jb25maWcudHMiXSwKICAic291cmNlc0NvbnRlbnQiOiBbImNvbnN0IF9fdml0ZV9pbmplY3RlZF9vcmlnaW5hbF9kaXJuYW1lID0gXCJFOlxcXFxEb2N1bWVudFxcXFxQcm9qZWN0c1xcXFxmbG93X2ltXCI7Y29uc3QgX192aXRlX2luamVjdGVkX29yaWdpbmFsX2ZpbGVuYW1lID0gXCJFOlxcXFxEb2N1bWVudFxcXFxQcm9qZWN0c1xcXFxmbG93X2ltXFxcXHZpdGUuY29uZmlnLnRzXCI7Y29uc3QgX192aXRlX2luamVjdGVkX29yaWdpbmFsX2ltcG9ydF9tZXRhX3VybCA9IFwiZmlsZTovLy9FOi9Eb2N1bWVudC9Qcm9qZWN0cy9mbG93X2ltL3ZpdGUuY29uZmlnLnRzXCI7aW1wb3J0IHsgZGVmaW5lQ29uZmlnIH0gZnJvbSBcInZpdGVcIjtcbmltcG9ydCBwYXRoIGZyb20gXCJub2RlOnBhdGhcIjtcbmltcG9ydCBlbGVjdHJvbiBmcm9tIFwidml0ZS1wbHVnaW4tZWxlY3Ryb24vc2ltcGxlXCI7XG5pbXBvcnQgdnVlIGZyb20gXCJAdml0ZWpzL3BsdWdpbi12dWVcIjtcbmltcG9ydCBBdXRvSW1wb3J0IGZyb20gXCJ1bnBsdWdpbi1hdXRvLWltcG9ydC92aXRlXCI7XG5pbXBvcnQgQ29tcG9uZW50cyBmcm9tIFwidW5wbHVnaW4tdnVlLWNvbXBvbmVudHMvdml0ZVwiO1xuaW1wb3J0IHsgRWxlbWVudFBsdXNSZXNvbHZlciB9IGZyb20gXCJ1bnBsdWdpbi12dWUtY29tcG9uZW50cy9yZXNvbHZlcnNcIjtcblxuLy8gaHR0cHM6Ly92aXRlanMuZGV2L2NvbmZpZy9cbmV4cG9ydCBkZWZhdWx0IGRlZmluZUNvbmZpZyh7XG4gIHBsdWdpbnM6IFtcbiAgICB2dWUoKSxcbiAgICBlbGVjdHJvbih7XG4gICAgICBtYWluOiB7XG4gICAgICAgIC8vIFNob3J0Y3V0IG9mIGBidWlsZC5saWIuZW50cnlgLlxuICAgICAgICBlbnRyeTogXCJlbGVjdHJvbi9tYWluLnRzXCIsXG4gICAgICB9LFxuICAgICAgcHJlbG9hZDoge1xuICAgICAgICAvLyBTaG9ydGN1dCBvZiBgYnVpbGQucm9sbHVwT3B0aW9ucy5pbnB1dGAuXG4gICAgICAgIC8vIFByZWxvYWQgc2NyaXB0cyBtYXkgY29udGFpbiBXZWIgYXNzZXRzLCBzbyB1c2UgdGhlIGBidWlsZC5yb2xsdXBPcHRpb25zLmlucHV0YCBpbnN0ZWFkIGBidWlsZC5saWIuZW50cnlgLlxuICAgICAgICBpbnB1dDogcGF0aC5qb2luKF9fZGlybmFtZSwgXCJlbGVjdHJvbi9wcmVsb2FkLnRzXCIpLFxuICAgICAgfSxcbiAgICAgIC8vIFBsb3lmaWxsIHRoZSBFbGVjdHJvbiBhbmQgTm9kZS5qcyBBUEkgZm9yIFJlbmRlcmVyIHByb2Nlc3MuXG4gICAgICAvLyBJZiB5b3Ugd2FudCB1c2UgTm9kZS5qcyBpbiBSZW5kZXJlciBwcm9jZXNzLCB0aGUgYG5vZGVJbnRlZ3JhdGlvbmAgbmVlZHMgdG8gYmUgZW5hYmxlZCBpbiB0aGUgTWFpbiBwcm9jZXNzLlxuICAgICAgLy8gU2VlIFx1RDgzRFx1REM0OSBodHRwczovL2dpdGh1Yi5jb20vZWxlY3Ryb24tdml0ZS92aXRlLXBsdWdpbi1lbGVjdHJvbi1yZW5kZXJlclxuICAgICAgcmVuZGVyZXI6XG4gICAgICAgIHByb2Nlc3MuZW52Lk5PREVfRU5WID09PSBcInRlc3RcIlxuICAgICAgICAgID8gLy8gaHR0cHM6Ly9naXRodWIuY29tL2VsZWN0cm9uLXZpdGUvdml0ZS1wbHVnaW4tZWxlY3Ryb24tcmVuZGVyZXIvaXNzdWVzLzc4I2lzc3VlY29tbWVudC0yMDUzNjAwODA4XG4gICAgICAgICAgICB1bmRlZmluZWRcbiAgICAgICAgICA6IHt9LFxuICAgIH0pLFxuICAgIEF1dG9JbXBvcnQoe1xuICAgICAgcmVzb2x2ZXJzOiBbRWxlbWVudFBsdXNSZXNvbHZlcigpIC8qIGF1dG8gaW1wb3J0IGVsZW1lbnQtcGx1cyAqL10sXG4gICAgfSksXG4gICAgQ29tcG9uZW50cyh7XG4gICAgICByZXNvbHZlcnM6IFtFbGVtZW50UGx1c1Jlc29sdmVyKCldLFxuICAgIH0pLFxuICBdLFxufSk7XG4iXSwKICAibWFwcGluZ3MiOiAiO0FBQThRLFNBQVMsb0JBQW9CO0FBQzNTLE9BQU8sVUFBVTtBQUNqQixPQUFPLGNBQWM7QUFDckIsT0FBTyxTQUFTO0FBQ2hCLE9BQU8sZ0JBQWdCO0FBQ3ZCLE9BQU8sZ0JBQWdCO0FBQ3ZCLFNBQVMsMkJBQTJCO0FBTnBDLElBQU0sbUNBQW1DO0FBU3pDLElBQU8sc0JBQVEsYUFBYTtBQUFBLEVBQzFCLFNBQVM7QUFBQSxJQUNQLElBQUk7QUFBQSxJQUNKLFNBQVM7QUFBQSxNQUNQLE1BQU07QUFBQTtBQUFBLFFBRUosT0FBTztBQUFBLE1BQ1Q7QUFBQSxNQUNBLFNBQVM7QUFBQTtBQUFBO0FBQUEsUUFHUCxPQUFPLEtBQUssS0FBSyxrQ0FBVyxxQkFBcUI7QUFBQSxNQUNuRDtBQUFBO0FBQUE7QUFBQTtBQUFBLE1BSUEsVUFDRSxRQUFRLElBQUksYUFBYTtBQUFBO0FBQUEsUUFFckI7QUFBQSxVQUNBLENBQUM7QUFBQSxJQUNULENBQUM7QUFBQSxJQUNELFdBQVc7QUFBQSxNQUNULFdBQVc7QUFBQSxRQUFDLG9CQUFvQjtBQUFBO0FBQUEsTUFBZ0M7QUFBQSxJQUNsRSxDQUFDO0FBQUEsSUFDRCxXQUFXO0FBQUEsTUFDVCxXQUFXLENBQUMsb0JBQW9CLENBQUM7QUFBQSxJQUNuQyxDQUFDO0FBQUEsRUFDSDtBQUNGLENBQUM7IiwKICAibmFtZXMiOiBbXQp9Cg==