feat: 语法错误修复
This commit is contained in:
@@ -36,73 +36,6 @@ export const MAIN_WIN_SIZE = {
|
||||
} as const
|
||||
|
||||
|
||||
// 定义每个通道的参数和返回值类型
|
||||
interface IPCTypings {
|
||||
// 同步通信
|
||||
[IPC_EVENTS.APP_MINIMIZE]: {
|
||||
params: [window:number]
|
||||
return: {success: boolean, error?: string}
|
||||
}
|
||||
[IPC_EVENTS.APP_MAXIMIZE]: {
|
||||
params: [window:number]
|
||||
return: {success: boolean, error?: string}
|
||||
}
|
||||
[IPC_EVENTS.GET_WINDOW_ID]: {
|
||||
params: []
|
||||
return: number
|
||||
}
|
||||
|
||||
// 异步通信
|
||||
[IPC_EVENTS.FILE_READ]: {
|
||||
params: [filePath: string]
|
||||
return: Promise<{success: boolean, data?: string, error?: string}>
|
||||
}
|
||||
[IPC_EVENTS.FILE_WRITE]: {
|
||||
params: [filePath: string, content: string]
|
||||
return: Promise<{success: boolean, error?: string}>
|
||||
}
|
||||
|
||||
// 事件通信
|
||||
[IPC_EVENTS.TIME_UPDATE]: {
|
||||
params: [time: string]
|
||||
return: void
|
||||
}
|
||||
[IPC_EVENTS.CUSTOM_EVENT]: {
|
||||
params: [message: string]
|
||||
return: void
|
||||
}
|
||||
}
|
||||
|
||||
// 定义IPC API 接口
|
||||
export interface WindowApi {
|
||||
invoke<T extends keyof IPCTypings>(channel: T, ...args: IPCTypings[T]['params']): IPCTypings[T]['return'],
|
||||
invokeAsync<T extends keyof IPCTypings>(channel: T, ...args: IPCTypings[T]['params']): IPCTypings[T]['return'],
|
||||
on<T extends keyof IPCTypings>(channel: T, callback: (...args: IPCTypings[T]['params']) => void): () => void
|
||||
send<T extends keyof IPCTypings>(channel: T, ...args: IPCTypings[T]['params']): void,
|
||||
getCurrentWindowId(): number,
|
||||
versions: NodeJS.ProcessVersions,
|
||||
external: {
|
||||
open: (url: string) => void
|
||||
},
|
||||
window: {
|
||||
minimize: () => void,
|
||||
maximize: () => void,
|
||||
close: () => void
|
||||
},
|
||||
app: {
|
||||
setFrameless: (route?: string) => void
|
||||
},
|
||||
tabs: {
|
||||
create: (url?: string) => void,
|
||||
list: () => void,
|
||||
navigate: (tabId: string, url: string) => void,
|
||||
reload: (tabId: string) => void,
|
||||
back: (tabId: string) => void,
|
||||
forward: (tabId: string) => void,
|
||||
switch: (tabId: string) => void,
|
||||
close: (tabId: string) => void,
|
||||
on: (event: 'tab-updated' | 'tab-created' | 'tab-closed' | 'tab-switched', handler: (payload: any) => void) => void
|
||||
},
|
||||
readFile: (filePath: string) => Promise<{success: boolean, data?: string, error?: string}>,
|
||||
logToMain: (logLevel: string, message: string) => void,
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { contextBridge, ipcRenderer } from 'electron'
|
||||
import { IPC_EVENTS, WindowApi } from '@common/constants';
|
||||
import { IPC_EVENTS } from '@common/constants';
|
||||
|
||||
const api: WindowApi = {
|
||||
versions: process.versions,
|
||||
|
||||
@@ -10,16 +10,13 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { defineProps } from 'vue'
|
||||
interface TitleSectionProps {
|
||||
title?: string
|
||||
desc?: string
|
||||
}
|
||||
|
||||
const props = defineProps({
|
||||
title: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
desc: {
|
||||
type: String,
|
||||
default: ''
|
||||
}
|
||||
})
|
||||
</script>
|
||||
withDefaults(
|
||||
defineProps<TitleSectionProps>(),
|
||||
{ title: '', desc: '' }
|
||||
)
|
||||
</script>
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
<template>
|
||||
<ul class="versions">
|
||||
<li class="electron-version">Electron v{{ versions.electron }}</li>
|
||||
<li class="chrome-version">Chromium v{{ versions.chrome }}</li>
|
||||
<li class="node-version">Node v{{ versions.node }}</li>
|
||||
</ul>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { reactive } from 'vue'
|
||||
|
||||
const versions = reactive({ ...window.electron.process.versions })
|
||||
</script>
|
||||
@@ -19,6 +19,6 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="Layout">
|
||||
import TaskList from '@/components/TaskList/index.vue'
|
||||
import Menus from '@/components/Menus/index.vue'
|
||||
import TaskList from '@renderer/components/TaskList/index.vue'
|
||||
import Menus from '@renderer/components/Menus/index.vue'
|
||||
</script>
|
||||
@@ -1,16 +1,16 @@
|
||||
import { createRouter, createWebHistory } from "vue-router";
|
||||
import Layout from '@/layout/index.vue'
|
||||
import Layout from '@renderer/layout/index.vue'
|
||||
|
||||
const routes = [
|
||||
{
|
||||
path: "/login",
|
||||
name: "Login",
|
||||
component: () => import("@/views/login/index.vue"),
|
||||
component: () => import("@renderer/views/login/index.vue"),
|
||||
},
|
||||
{
|
||||
path: "/browser",
|
||||
name: "Browser",
|
||||
component: () => import("@/browser/BrowserLayout.vue"),
|
||||
component: () => import("@renderer/browser/BrowserLayout.vue"),
|
||||
meta: { requiresAuth: true },
|
||||
},
|
||||
{
|
||||
@@ -19,44 +19,44 @@ const routes = [
|
||||
children: [
|
||||
{
|
||||
path: "home",
|
||||
component: () => import("@/views/home/index.vue"),
|
||||
component: () => import("@renderer/views/home/index.vue"),
|
||||
name: "Home",
|
||||
meta: { requiresAuth: true },
|
||||
},
|
||||
{
|
||||
path: "stock",
|
||||
name: "Stock",
|
||||
component: () => import("@/views/stock/index.vue"),
|
||||
component: () => import("@renderer/views/stock/index.vue"),
|
||||
meta: { requiresAuth: true },
|
||||
},
|
||||
{
|
||||
path: "rate",
|
||||
name: "Rate",
|
||||
component: () => import("@/views/rate/index.vue"),
|
||||
component: () => import("@renderer/views/rate/index.vue"),
|
||||
meta: { requiresAuth: true },
|
||||
},
|
||||
{
|
||||
path: "order",
|
||||
name: "Order",
|
||||
component: () => import("@/views/order/index.vue"),
|
||||
component: () => import("@renderer/views/order/index.vue"),
|
||||
meta: { requiresAuth: true },
|
||||
},
|
||||
{
|
||||
path: "more",
|
||||
name: "More",
|
||||
component: () => import("@/views/more/index.vue"),
|
||||
component: () => import("@renderer/views/more/index.vue"),
|
||||
meta: { requiresAuth: true },
|
||||
},
|
||||
{
|
||||
path: "setting",
|
||||
name: "Setting",
|
||||
component: () => import("@/views/setting/index.vue"),
|
||||
component: () => import("@renderer/views/setting/index.vue"),
|
||||
meta: { requiresAuth: true },
|
||||
},
|
||||
{
|
||||
path: "/dashboard",
|
||||
name: "Dashboard",
|
||||
component: () => import("@/views/dashboard/index.vue"),
|
||||
component: () => import("@renderer/views/dashboard/index.vue"),
|
||||
meta: { requiresAuth: true },
|
||||
},
|
||||
]
|
||||
@@ -64,7 +64,7 @@ const routes = [
|
||||
{
|
||||
path: "/about",
|
||||
name: "About",
|
||||
component: () => import("@/views/about/index.vue"),
|
||||
component: () => import("@renderer/views/about/index.vue"),
|
||||
},
|
||||
];
|
||||
|
||||
|
||||
0
src/renderer/shared/index.ts
Normal file
0
src/renderer/shared/index.ts
Normal file
@@ -1,12 +0,0 @@
|
||||
export interface PaginationProps {
|
||||
currentPage?: number
|
||||
total: number
|
||||
pageSize: number
|
||||
pageSizes?: number[]
|
||||
}
|
||||
|
||||
export interface EmitsProps {
|
||||
(e: 'update:currentPage', value: number): void
|
||||
(e: 'update:pageSize', value: string): void
|
||||
(e: 'currentChange', value: number): void
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
import { PaginationProps, EmitsProps } from './PaginationProps'
|
||||
|
||||
export { PaginationProps, EmitsProps }
|
||||
@@ -77,7 +77,7 @@
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive } from "vue";
|
||||
import { useRouter } from "vue-router";
|
||||
// import { login as apiLogin } from "@/renderer/api/login";
|
||||
// import { login as apiLogin } from "@renderer/api/login";
|
||||
import { RiUser3Fill, RiKey2Fill } from '@remixicon/vue'
|
||||
|
||||
const router = useRouter();
|
||||
|
||||
@@ -16,8 +16,8 @@
|
||||
|
||||
<script setup lang="ts" name="RateContentSection">
|
||||
import { ref } from 'vue'
|
||||
import { commentList } from '@/constant/rate'
|
||||
import Pagination from '@/components/Pagination/index.vue'
|
||||
import { commentList } from '@renderer/constant/rate'
|
||||
import Pagination from '@renderer/components/Pagination/index.vue'
|
||||
import RateFilterSection from '../RateFilterSection/index.vue'
|
||||
import RateListSection from '../RateListSection/index.vue'
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="Rate">
|
||||
import TitleSection from '@/components/TitleSection/index.vue'
|
||||
import TitleSection from '@renderer/components/TitleSection/index.vue'
|
||||
import RatePanelSection from './components/RatePanelSection/index.vue'
|
||||
import RateContentSection from './components/RateContentSection/index.vue'
|
||||
</script>
|
||||
|
||||
@@ -24,6 +24,6 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import { RiCheckboxCircleFill } from '@remixicon/vue'
|
||||
import TitleSection from '@/components/TitleSection/index.vue'
|
||||
import TitleSection from '@renderer/components/TitleSection/index.vue'
|
||||
|
||||
</script>
|
||||
@@ -31,6 +31,6 @@
|
||||
<script setup lang="ts">
|
||||
import { channel } from '@constant/channel'
|
||||
import { RiForbidLine } from '@remixicon/vue'
|
||||
import TitleSection from '@/components/TitleSection/index.vue'
|
||||
import TitleSection from '@renderer/components/TitleSection/index.vue'
|
||||
|
||||
</script>
|
||||
@@ -15,7 +15,7 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, defineEmits } from 'vue'
|
||||
import { systemMenus } from '@/constant/system-config'
|
||||
import { systemMenus } from '@renderer/constant/system-config'
|
||||
|
||||
const currentId = ref(1)
|
||||
|
||||
|
||||
@@ -12,5 +12,5 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import TitleSection from '@/components/TitleSection/index.vue'
|
||||
import TitleSection from '@renderer/components/TitleSection/index.vue'
|
||||
</script>
|
||||
Reference in New Issue
Block a user