Compare commits
No commits in common. "71aff5d1f8cb3dbe669ee1b4c5b9b3705265d4cd" and "67bc54765c930e40f6f922c457d8b0c6e5fb9583" have entirely different histories.
71aff5d1f8
...
67bc54765c
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "electron-app",
|
||||
"version": "1.0.1",
|
||||
"version": "1.0.0",
|
||||
"description": "An Electron application with Vue",
|
||||
"main": "./out/main/index.js",
|
||||
"author": "example.com",
|
||||
|
@ -22,7 +22,6 @@
|
|||
"@electron-toolkit/preload": "^3.0.1",
|
||||
"@electron-toolkit/utils": "^3.0.0",
|
||||
"@element-plus/icons-vue": "^2.3.1",
|
||||
"@electron/remote": "^2.1.2",
|
||||
"@vitejs/plugin-vue-jsx": "^4.0.0",
|
||||
"@vueuse/core": "^10.11.0",
|
||||
"crypto-js": "^4.2.0",
|
||||
|
@ -45,6 +44,7 @@
|
|||
},
|
||||
"devDependencies": {
|
||||
"@electron-toolkit/eslint-config": "^1.0.2",
|
||||
"@electron/remote": "^2.1.2",
|
||||
"@rushstack/eslint-patch": "^1.10.3",
|
||||
"@vitejs/plugin-vue": "^5.0.5",
|
||||
"@vue/eslint-config-prettier": "^9.0.0",
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
/**
|
||||
* @description: electron 封装的工具函数
|
||||
*/
|
||||
const { ipcRenderer } = window.electron || {}
|
||||
// const { ipcRenderer } = window.electron || {}
|
||||
// import { ipcRenderer } from 'electron' // 渲染器里面可以使用ipcRenderer
|
||||
|
||||
|
||||
const path = require('path')
|
||||
// const path = require('path')
|
||||
const Remote = require('@electron/remote')
|
||||
|
||||
// 常用变量
|
||||
|
@ -16,11 +16,11 @@ const isDev = process.env.NODE_ENV !== 'production'
|
|||
/**
|
||||
* @description 消息发送-nodejs 消息发送
|
||||
* @form src/main/tool.js 来源
|
||||
* @param {*} key 消息key
|
||||
* @param {*} key 消息key
|
||||
* tool-sphere:create 创建-悬浮球
|
||||
* @param {*} data 参数
|
||||
* @param {*} data 参数
|
||||
* url:路由地址,width:窗口宽度,height:窗口高度,option:自定义选项
|
||||
* @returns
|
||||
* @returns
|
||||
*/
|
||||
export function ipcMsgSend(key, data) {
|
||||
return new Promise((resolve) => {
|
||||
|
@ -37,7 +37,7 @@ export function ipcMsgSend(key, data) {
|
|||
* @param {*} type 类型
|
||||
* tool-sphere 创建-悬浮球
|
||||
* @param {*} data 参数
|
||||
* @returns
|
||||
* @returns
|
||||
*/
|
||||
export const createWindow = async (type, data) => {
|
||||
if (!type) return console.error('createWindow: type is null')
|
||||
|
@ -97,7 +97,7 @@ export function toolWindow({url, isFile, isConsole, option={}}) {
|
|||
let height = option?.height || 600
|
||||
const mainWin = Remote.getCurrentWindow() // 获取主窗口对象
|
||||
const devUrl = `${BaseUrl}${url}`
|
||||
const buildUrl = path.join(__dirname, 'index.html#')
|
||||
const buildUrl = `file://${__dirname}/index.html${url}`
|
||||
const urlAll = isDev ? devUrl : buildUrl
|
||||
return new Promise((resolve) => {
|
||||
const config = {
|
||||
|
@ -113,9 +113,8 @@ export function toolWindow({url, isFile, isConsole, option={}}) {
|
|||
}
|
||||
// 创建-新窗口
|
||||
let win = new Remote.BrowserWindow(config)
|
||||
console.log(urlAll)
|
||||
if (!!isFile) win.loadFile(urlAll+url) // 加载文件
|
||||
else win.loadURL(urlAll,{hash: url}) // 加载url
|
||||
if (!!isFile) win.loadFile(urlAll) // 加载文件
|
||||
else win.loadURL(urlAll) // 加载url
|
||||
win.once('ready-to-show', () => {resolve(win)})
|
||||
// 主窗口关闭事件
|
||||
mainWin.once('closed', () => { win.destroy()})
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<template>
|
||||
<el-card style="width: 100%;height: 100%">
|
||||
<el-card style="width: 100%">
|
||||
<template #header>
|
||||
<div style="text-align: left">
|
||||
<el-button v-if="classInfo.teacher.length > 0" type="danger" @click="deleteClassRoom">删除班级</el-button>
|
||||
|
|
|
@ -15,15 +15,12 @@
|
|||
</el-aside>
|
||||
<el-main :style="{'min-height': (viewportHeight - 160) + 'px'}">
|
||||
<!-- <router-view :style="{'height': (viewportHeight - 120) + 'px','overflow-y': 'auto'}" :key="route.path"></router-view>-->
|
||||
<div :style="{'height': (viewportHeight - 120) + 'px','overflow-y': 'auto'}">
|
||||
<!-- 班级概况-->
|
||||
<ClassInfo v-if="currentIndex==0" :classId="classId"></ClassInfo>
|
||||
<!-- 学生列表-->
|
||||
<StudentList v-else-if="currentIndex==1" :classId="classId"></StudentList>
|
||||
<!-- 分组情况-->
|
||||
<BasicGroup v-else-if="currentIndex==2" :classId="classId"></BasicGroup>
|
||||
</div>
|
||||
|
||||
<!-- 班级概况-->
|
||||
<ClassInfo v-if="currentIndex==0" :classId="classId"></ClassInfo>
|
||||
<!-- 学生列表-->
|
||||
<StudentList v-else-if="currentIndex==1" :classId="classId"></StudentList>
|
||||
<!-- 分组情况-->
|
||||
<BasicGroup v-else-if="currentIndex==2" :classId="classId"></BasicGroup>
|
||||
</el-main>
|
||||
</el-container>
|
||||
</div>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<template>
|
||||
<div style="height: 100%">
|
||||
<div>
|
||||
<el-card style="width: 100%;height: 100%">
|
||||
<template #header>
|
||||
<div style="text-align: left;display: flex;justify-content: space-between">
|
||||
|
@ -19,8 +19,8 @@
|
|||
src="https://cube.elemecdn.com/0/88/03b0d39583f48206768a7534e55bcpng.png"
|
||||
/>
|
||||
</div>
|
||||
<div><el-text class="mx-1" type="primary">{{ item.name }}</el-text></div>
|
||||
<div><el-text class="mx-1" type="warning">{{ item.username }}</el-text></div>
|
||||
<div>{{ item.name }}</div>
|
||||
<div>{{ item.username }}</div>
|
||||
</div>
|
||||
</template>
|
||||
<template v-else>
|
||||
|
|
Loading…
Reference in New Issue