Commit 0a12916a authored by wuhao's avatar wuhao 🎯

adder

parent c77d166b
No preview for this file type
# EE框架 v3
[![star](https://gitee.com/dromara/electron-egg/badge/star.svg?theme=gvp)](https://gitee.com/dromara/electron-egg/stargazers)
<div align=center>
<h3>🎉🎉🎉 框架下载量突破10万+ 🎉🎉🎉</h3>
<h3>🎉🎉🎉 ElectronEgg V3.7.0已发布! 🎉🎉🎉</h3>
</div>
<br>
......@@ -15,19 +14,22 @@
</div>
<br>
## 🌏 [English](https://www.yuque.com/u34495/ee-doc) | [中文](https://www.kaka996.com/)
<!-- ## 🌏 [English](https://www.yuque.com/u34495/ee-doc) | [中文](https://www.kaka996.com/) -->
## 📋 介绍
#### 框架已经广泛应用于记账、政务、企业、医疗、学校、股票交易、ERP、娱乐、视频等领域客户端,请放心使用!
- 🍩 **为什么使用?** 桌面软件(办公方向、 个人工具),仍然是未来十几年PC端需求之一,提高工作效率
- 🍉 **简单:** 只需懂 JavaScript
- 🍑 **愿景:** 所有开发者都能学会桌面软件研发
- 🍰 **gitee:** https://gitee.com/dromara/electron-egg **3400+**
- 🍨 **github:** https://github.com/dromara/electron-egg **900+**
- 🍰 **gitee:** https://gitee.com/dromara/electron-egg **3700+**
- 🍨 **github:** https://github.com/dromara/electron-egg **1000+**
- 🏆 码云最有价值开源项目
![](https://wallace5303.gitee.io/ee/images/electron-egg/ee-zs.png)
## 📚 文档
- [教程文档](https://www.kaka996.com/)
- 快速体验:[教程文档](https://www.kaka996.com/)
![](https://wallace5303.gitee.io/ee/images/electron-egg/v3-home.png)
## 📦 特性
1. 🍄 跨平台:一套代码,可以打包成windows版、Mac版、Linux版、国产UOS、Deepin、麒麟等
......@@ -76,7 +78,10 @@
- ✒️ [安装文档](https://www.kaka996.com/pages/e64ff6/)
## 🐶 项目案例
- 🐟 EE框架已经应用于医疗、学校、政务、股票交易、ERP、娱乐、视频、企业等领域客户端
- 🐟 框架已经应用于医疗、学校、政务、股票交易、ERP、娱乐、视频、企业等领域客户端
- 🐸 壁纸
![](https://wallace5303.gitee.io/ee/images/electron-egg/aw/aw-3.png)
- 🐸 英雄联盟助手
![](https://wallace5303.gitee.io/ee/images/electron-egg/serendipity/lol-zhanji.png)
......
# EE框架 v3
[![star](https://gitee.com/dromara/electron-egg/badge/star.svg?theme=gvp)](https://gitee.com/dromara/electron-egg/stargazers)
<div align=center>
<h3>🎉🎉🎉 框架下载量突破10万+ 🎉🎉🎉</h3>
<h3>🎉🎉🎉 ElectronEgg V3.7.0已发布! 🎉🎉🎉</h3>
</div>
<br>
......@@ -15,19 +14,22 @@
</div>
<br>
## 🌏 [English](https://www.yuque.com/u34495/ee-doc) | [中文](https://www.kaka996.com/)
<!-- ## 🌏 [English](https://www.yuque.com/u34495/ee-doc) | [中文](https://www.kaka996.com/) -->
## 📋 介绍
#### 框架已经广泛应用于记账、政务、企业、医疗、学校、股票交易、ERP、娱乐、视频等领域客户端,请放心使用!
- 🍩 **为什么使用?** 桌面软件(办公方向、 个人工具),仍然是未来十几年PC端需求之一,提高工作效率
- 🍉 **简单:** 只需懂 JavaScript
- 🍑 **愿景:** 所有开发者都能学会桌面软件研发
- 🍰 **gitee:** https://gitee.com/dromara/electron-egg **3400+**
- 🍨 **github:** https://github.com/dromara/electron-egg **900+**
- 🍰 **gitee:** https://gitee.com/dromara/electron-egg **3700+**
- 🍨 **github:** https://github.com/dromara/electron-egg **1000+**
- 🏆 码云最有价值开源项目
![](https://wallace5303.gitee.io/ee/images/electron-egg/ee-zs.png)
## 📚 文档
- [教程文档](https://www.kaka996.com/)
- 快速体验:[教程文档](https://www.kaka996.com/)
![](https://wallace5303.gitee.io/ee/images/electron-egg/v3-home.png)
## 📦 特性
1. 🍄 跨平台:一套代码,可以打包成windows版、Mac版、Linux版、国产UOS、Deepin、麒麟等
......@@ -76,7 +78,10 @@
- ✒️ [安装文档](https://www.kaka996.com/pages/e64ff6/)
## 🐶 项目案例
- 🐟 EE框架已经应用于医疗、学校、政务、股票交易、ERP、娱乐、视频、企业等领域客户端
- 🐟 框架已经应用于医疗、学校、政务、股票交易、ERP、娱乐、视频、企业等领域客户端
- 🐸 壁纸
![](https://wallace5303.gitee.io/ee/images/electron-egg/aw/aw-3.png)
- 🐸 英雄联盟助手
![](https://wallace5303.gitee.io/ee/images/electron-egg/serendipity/lol-zhanji.png)
......
......@@ -2,7 +2,7 @@
"cache": {
"config": {
"env": "local",
"name": "standaloneframe",
"name": "ee",
"baseDir": "/Users/wuhao/Desktop/demos/standaloneframe/electron",
"HOME": "/Users/wuhao/Desktop/demos/standaloneframe",
"rundir": "/Users/wuhao/Desktop/demos/standaloneframe/electron/run",
......@@ -11,9 +11,9 @@
},
"homeDir": "/Users/wuhao/Desktop/demos/standaloneframe",
"root": "/Users/wuhao/Desktop/demos/standaloneframe",
"appUserDataDir": "/Users/wuhao/Library/Application Support/standaloneframe",
"appUserDataDir": "/Users/wuhao/Library/Application Support/ee",
"userHome": "/Users/wuhao",
"appVersion": "3.4.0",
"appVersion": "3.7.0",
"isPackaged": false,
"execDir": "/Users/wuhao/Desktop/demos/standaloneframe",
"logger": {
......@@ -57,17 +57,17 @@
}
},
"developmentMode": {
"default": "react",
"default": "vue",
"mode": {
"vue": {
"protocol": "http://",
"hostname": "localhost",
"port": 4399
"port": 8080
},
"react": {
"protocol": "http://",
"hostname": "localhost",
"port": 8000
"port": 3000
},
"html": {
"protocol": "http://",
......@@ -93,7 +93,7 @@
}
},
"httpServer": {
"enable": true,
"enable": false,
"https": {
"enable": false,
"key": "/public/ssl/localhost+1.key",
......@@ -103,9 +103,7 @@
"host": "localhost",
"port": 7071,
"cors": {
"origin": false,
"allowMethods": "GET,HEAD,PUT,POST,DELETE,PATCH,OPTIONS",
"credentials": true
"origin": "*"
},
"body": {
"multipart": true,
......@@ -121,7 +119,7 @@
}
},
"mainServer": {
"protocol": "http://",
"protocol": "file://",
"indexPath": "/public/dist/index.html",
"host": "localhost",
"port": 7072,
......@@ -131,7 +129,7 @@
"cert": ""
}
},
"openAppMenu": "dev-show",
"openAppMenu": true,
"hardGpu": {
"enable": false
},
......@@ -146,7 +144,7 @@
"tray": {
"enable": true,
"title": "EE程序",
"icon": "/public/images/tray_logo.png"
"icon": "/public/images/tray.png"
},
"security": {
"enable": true
......@@ -180,7 +178,9 @@
"childExit": true,
"rendererExit": true
},
"openDevTools": false,
"openDevTools": {
"mode": "undocked"
},
"windowsOption": {
"title": "EE框架",
"width": 980,
......@@ -188,6 +188,7 @@
"minWidth": 800,
"minHeight": 650,
"webPreferences": {
"webSecurity": false,
"contextIsolation": false,
"nodeIntegration": true
},
......@@ -199,9 +200,6 @@
"enable": false,
"url": "http://electron-egg.kaka996.com/"
},
"testConfig": {
"login": "http://local.com/api/login"
},
"coreMiddlewares": [],
"coreMiddleware": [],
"appMiddlewares": [],
......
......@@ -102,9 +102,12 @@ class AutoUpdaterAddon {
info.status = status.downloaded;
info.desc = '下载完成';
this.sendStatusToWindow(info);
// quit and update
// app.appQuit();
autoUpdater.quitAndInstall();
// const mainWindow = CoreWindow.getMainWindow();
// if (mainWindow) {
// mainWindow.destroy()
// }
// electronApp.appQuit()
});
}
......
......@@ -45,7 +45,16 @@ class JavaServerAddon {
* @since 1.0.0
*/
async check () {
Log.info("进入-----检查服务是否启动------"+this.javaServer);
if(this.javaServer == undefined){
Log.info("[addon:javaServer:check] status-----------"+false);
return false;
}
const flag = await this.javaServer.isRun(Conf.getValue('addons.javaServer'));
Log.info("[addon:javaServer:check] status-----------"+flag);
return flag;
}
/**
......
......@@ -95,6 +95,32 @@ class JavaServer {
// todo linux
}
}
/**
* 服务是否运行中
*/
async isRun(cfg){
const jarName = cfg.name;
if (is.windows()) {
const resultList = ps.lookup({
command: "java",
where: 'caption="javaw.exe"',
arguments: jarName,
});
Log.info("[addon:javaServer] resultList:", resultList);
return resultList.length>0;
} else if (is.macOS()) {
const cmd = `ps -ef | grep java | grep ${jarName} | grep -v grep | awk '{print $2}' `;
Log.info("[addon:javaServer:isRun] cmdStr:", cmd);
const result = execSync(cmd);
Log.info('[addon:javaServer:isRun] result:', result.toString());
//不等于空说明正在运行
return result.toString()!==""
} else {
// todo linux
}
}
}
module.exports = JavaServer;
\ No newline at end of file
const { Tray, Menu, shell } = require('electron');
const { Tray, Menu } = require('electron');
const path = require('path');
const Ps = require('ee-core/ps');
const Log = require('ee-core/log');
......@@ -62,12 +62,6 @@ class TrayAddon {
this.tray.setToolTip(cfg.title);
const contextMenu = Menu.buildFromTemplate(trayMenuTemplate);
this.tray.setContextMenu(contextMenu);
// 使用默认浏览器打开链接
mainWindow.webContents.setWindowOpenHandler(({ url }) => {
shell.openExternal(url);
return { action: 'deny' }
})
}
}
......
/**
* ee-bin 配置
* 仅适用于开发环境
*/
module.exports = {
/**
* development serve ("frontend" "electron" )
* ee-bin dev
*/
dev: {
frontend: {
directory: './frontend',
cmd: 'npm',
args: ['run', 'dev'],
protocol: 'http://',
hostname: 'localhost',
port: 8080,
indexPath: 'index.html'
},
electron: {
directory: './',
cmd: 'electron',
args: ['.', '--env=local'],
}
},
/**
* 前端构建
* ee-bin build
*/
build: {
directory: './frontend',
cmd: 'npm',
args: ['run', 'build'],
},
/**
* 移动资源
* ee-bin rd
*/
rd: {
dist: './frontend/dist',
target: './public/dist'
},
/**
* 预发布模式(prod)
* ee-bin start
*/
start: {
directory: './',
cmd: 'electron',
args: ['.', '--env=prod']
},
/**
* 加密
*/
encrypt: {
type: 'confusion',
files: [
'electron/**/*.(js|json)',
'!electron/config/encrypt.js',
'!electron/config/nodemon.json',
'!electron/config/builder.json',
'!electron/config/bin.json',
],
fileExt: ['.js'],
confusionOptions: {
compact: true,
stringArray: true,
stringArrayEncoding: ['none'],
deadCodeInjection: false,
}
}
};
\ No newline at end of file
{
"productName": "standaloneframe",
"productName": "ee",
"appId": "com.electron.ee",
"copyright": "© 2023 哆啦好梦 Technology Co., Ltd.",
"directories": {
......@@ -26,7 +26,7 @@
"installerHeaderIcon": "build/icons/icon.ico",
"createDesktopShortcut": true,
"createStartMenuShortcut": true,
"shortcutName": "制作器-单机版"
"shortcutName": "EE框架"
},
"mac": {
"icon": "build/icons/icon.icns",
......
"use strict";
'use strict';
const path = require("path");
const path = require('path');
/**
* 默认配置
*/
module.exports = (appInfo) => {
const config = {};
/**
* 应用模式配置
*/
config.developmentMode = {
default: "react",
mode: {
vue: {
hostname: "localhost",
port: 4399,
},
react: {
hostname: "localhost",
port: 8000,
},
html: {
hostname: "localhost",
indexPage: "index.html",
},
},
};
const config = {};
/**
* 开发者工具
......@@ -37,54 +17,54 @@ module.exports = (appInfo) => {
/**
* 应用程序顶部菜单
*/
config.openAppMenu = "dev-show";
config.openAppMenu = true;
/**
* 主窗口
*/
config.windowsOption = {
title: "EE框架",
title: 'EE框架',
width: 980,
height: 650,
minWidth: 800,
minHeight: 650,
webPreferences: {
//webSecurity: false, // 跨域问题 -> 打开注释
webSecurity: false,
contextIsolation: false, // false -> 可在渲染进程中使用electron的api,true->需要bridge.js(contextBridge)
nodeIntegration: true,
//preload: path.join(appInfo.baseDir, 'preload', 'bridge.js'),
},
frame: true,
show: false,
icon: path.join(appInfo.home, "public", "images", "logo-32.png"),
icon: path.join(appInfo.home, 'public', 'images', 'logo-32.png'),
};
/**
* ee框架日志
*/
*/
config.logger = {
encoding: "utf8",
level: "INFO",
encoding: 'utf8',
level: 'INFO',
outputJSON: false,
buffer: true,
enablePerformanceTimer: false,
rotator: "day",
appLogName: "ee.log",
coreLogName: "ee-core.log",
errorLogName: "ee-error.log",
};
rotator: 'day',
appLogName: 'ee.log',
coreLogName: 'ee-core.log',
errorLogName: 'ee-error.log'
}
/**
* 远程模式-web地址
*/
*/
config.remoteUrl = {
enable: false,
url: "http://electron-egg.kaka996.com/",
url: 'http://electron-egg.kaka996.com/'
};
/**
* 内置socket服务
*/
*/
config.socketServer = {
enable: false,
port: 7070,
......@@ -96,52 +76,52 @@ module.exports = (appInfo) => {
transports: ["polling", "websocket"],
cors: {
origin: true,
},
}
};
/**
* 内置http服务
*/
*/
config.httpServer = {
enable: true,
enable: false,
https: {
enable: false,
key: "/public/ssl/localhost+1.key",
cert: "/public/ssl/localhost+1.pem",
enable: false,
key: '/public/ssl/localhost+1.key',
cert: '/public/ssl/localhost+1.pem'
},
port: 7071,
cors: {
origin: false,
allowMethods: "GET,HEAD,PUT,POST,DELETE,PATCH,OPTIONS",
credentials: true,
origin: "*"
},
body: {
multipart: true,
formidable: {
keepExtensions: true,
},
keepExtensions: true
}
},
filterRequest: {
uris: ["favicon.ico"],
returnData: "",
},
uris: [
'favicon.ico'
],
returnData: ''
}
};
/**
* 主进程
*/
*/
config.mainServer = {
protocol: "http://",
indexPath: "/public/dist/index.html",
host: "localhost",
protocol: 'file://',
indexPath: '/public/dist/index.html',
host: 'localhost',
port: 7072,
};
};
/**
* 硬件加速
*/
config.hardGpu = {
enable: false,
enable: false
};
/**
......@@ -151,7 +131,7 @@ module.exports = (appInfo) => {
mainExit: false,
childExit: true,
rendererExit: true,
};
};
/**
* 插件功能
......@@ -162,38 +142,38 @@ module.exports = (appInfo) => {
},
tray: {
enable: true,
title: "EE程序",
icon: "/public/images/tray_logo.png",
title: 'EE程序',
icon: '/public/images/tray.png'
},
security: {
enable: true,
},
awaken: {
enable: true,
protocol: "ee",
args: [],
protocol: 'ee',
args: []
},
autoUpdater: {
enable: true,
windows: false,
macOS: false,
windows: false,
macOS: false,
linux: false,
options: {
provider: "generic",
url: "http://kodo.qiniu.com/",
provider: 'generic',
url: 'http://kodo.qiniu.com/'
},
force: false,
},
javaServer: {
enable: false,
port: 18080,
jreVersion: "jre1.8.0_201",
jreVersion: 'jre1.8.0_201',
opt: '-server -Xms512M -Xmx512M -Xss512k -Dspring.profiles.active=prod -Dserver.port=${port} -Dlogging.file.path="${path}" ',
name: "java-app.jar",
},
name: 'java-app.jar'
}
};
return {
...config,
...config
};
};
}
'use strict';
/*
* test
/**
* 开发环境配置,覆盖 config.default.js
*/
exports.testConfig = {
login: 'http://local.com/api/login',
module.exports = (appInfo) => {
const config = {};
/**
* 开发者工具
*/
config.openDevTools = {
mode: 'undocked'
};
/**
* 应用程序顶部菜单
*/
config.openAppMenu = true;
return {
...config
};
};
'use strict';
/*
* test
/**
* 生产环境配置,覆盖 config.default.js
*/
exports.testConfig = {
login: 'http://prod.com/api/login',
module.exports = (appInfo) => {
const config = {};
/**
* 开发者工具
*/
config.openDevTools = false;
/**
* 应用程序顶部菜单
*/
config.openAppMenu = false;
return {
...config
};
};
/**
* 加密配置
* @param type - confusion | bytecode | strict
*/
module.exports = {
type: "bytecode",
directory: ["electron"],
files: [
"electron/**/*.(js|json)",
"!electron/config/encrypt.js",
"!electron/config/nodemon.json",
"!electron/config/builder.json",
],
fileExt: [".js"],
confusionOptions: {},
};
"use strict";
'use strict';
const { Controller } = require("ee-core");
const Log = require("ee-core/log");
const Services = require("ee-core/services");
const db = require("../model");
const { Controller } = require('ee-core');
const Log = require('ee-core/log');
const Services = require('ee-core/services');
/**
* example
* @class
*/
class ExampleController extends Controller {
constructor(ctx) {
super(ctx);
}
/**
* 所有方法接收两个参数
* @param args 前端传的参数
......@@ -23,23 +24,13 @@ class ExampleController extends Controller {
/**
* test
*/
async test() {
const User = require("../model/user")(db.sequelize, db.Sequelize.DataTypes);
// const result = await Services.get("example").test("electron");
// Log.info("service result:", result, db );
let res = await User.create({
username: "丁大炮",
email: "1148547900@qq.com",
});
async test () {
const result = await Services.get('example').test('electron');
Log.info('service result:', result);
return {
code: 0,
data: res,
};
return 'hello electron-egg';
}
}
ExampleController.toString = () => "[class ExampleController]";
module.exports = ExampleController;
ExampleController.toString = () => '[class ExampleController]';
module.exports = ExampleController;
\ No newline at end of file
{
"development": {
"dialect": "sqlite",
"storage": "/Users/wuhao/Desktop/demos/standaloneframe/data/database.sqlite"
},
"test": {
"dialect": "sqlite",
"storage": "/Users/wuhao/Desktop/demos/standaloneframe/data/database.sqlite"
},
"production": {
"dialect": "sqlite",
"storage": "/Users/wuhao/Desktop/demos/standaloneframe/data/database.sqlite"
}
}
\ No newline at end of file
"use strict";
/** @type {import('sequelize-cli').Migration} */
module.exports = {
async up(queryInterface, Sequelize) {
await queryInterface.createTable("Users", {
id: {
allowNull: false,
autoIncrement: true,
primaryKey: true,
type: Sequelize.INTEGER,
},
username: {
type: Sequelize.STRING,
},
email: {
type: Sequelize.STRING,
},
createdAt: {
allowNull: false,
type: Sequelize.DATE,
},
updatedAt: {
allowNull: false,
type: Sequelize.DATE,
},
});
},
async down(queryInterface, Sequelize) {
await queryInterface.dropTable("Users");
},
};
......@@ -32,6 +32,7 @@ class Index extends Application {
const win = this.electron.mainWindow;
win.once('ready-to-show', () => {
win.show();
win.focus();
})
}
}
......
const Job = require('ee-core/jobs/baseJobClass');
const Loader = require('ee-core/loader');
const Log = require('ee-core/log');
const Ps = require('ee-core/ps');
const { childMessage } = require('ee-core/message');
const Hello = Loader.requireJobsModule('./example/hello');
/**
* example - TimerJob
......@@ -22,31 +19,9 @@ class TimerJob extends Job {
async handle () {
Log.info("[child-process] TimerJob params: ", this.params);
// 计时器任务
let eventName = 'job-timer-progress';
let number = 0;
let jobId = this.params.jobId;
let timer = setInterval(function() {
Hello.welcome();
childMessage.send(eventName, {jobId, number});
number++;
}, 1000);
// 用 setTimeout 模拟任务运行时长
setTimeout(() => {
// 关闭定时器
clearInterval(timer);
// 任务结束,重置前端显示
childMessage.send(eventName, {jobId, number:0, pid:0});
// 如果是childJob任务,必须调用 Ps.exit() 方法,让进程退出,否则会常驻内存
// 如果是childPoolJob任务,常驻内存,等待下一个业务
if (Ps.isChildJob()) {
Ps.exit();
}
}, 10 * 1000)
if (Ps.isChildJob()) {
Ps.exit();
}
}
}
......
"use strict";
const Sequelize = require("sequelize");
const process = require("process");
const env = process.env.NODE_ENV || "development";
const config = require("../database/config.json")[env];
const db = {};
let sequelize = new Sequelize(
config.database,
config.username,
config.password,
config
);
Object.keys(db).forEach((modelName) => {
if (db[modelName].associate) {
db[modelName].associate(db);
}
});
db.sequelize = sequelize;
db.Sequelize = Sequelize;
module.exports = db;
"use strict";
const { Model } = require("sequelize");
module.exports = (sequelize, DataTypes) => {
class User extends Model {
/**
* Helper method for defining associations.
* This method is not a part of Sequelize lifecycle.
* The `models/index` file will call this method automatically.
*/
static associate(models) {
// define association here
}
}
User.init(
{
username: DataTypes.STRING,
email: DataTypes.STRING,
},
{
sequelize,
modelName: "User",
}
);
return User;
};
/*************************************************
** preload为预加载模块,该文件将会在程序启动时加载 **
*************************************************/
const Addon = require('ee-core/addon');
const Addon = require('ee-core/addon');
/**
* 预加载模块入口
*/
module.exports = async () => {
// 示例功能模块,可选择性使用和修改
Addon.get('tray').create();
Addon.get('security').create();
Addon.get('awaken').create();
Addon.get('autoUpdater').create();
}
\ No newline at end of file
/**
* 预加载模块入口
*/
module.exports = async () => {
// 示例功能模块,可选择性使用和修改
Addon.get('tray').create();
Addon.get('security').create();
Addon.get('awaken').create();
Addon.get('autoUpdater').create();
}
\ No newline at end of file
PORT=8080
\ No newline at end of file
......@@ -17,6 +17,7 @@
"dayjs": "^1.11.7",
"react-resizable": "^3.0.5",
"react-reveal": "^1.2.2",
"techui-react-lite": "^0.0.6",
"umi": "^4.0.69",
"umi-request": "^1.4.0"
},
......
......@@ -28,6 +28,7 @@ a {
z-index: 1111;
transition: all 0.4s;
cursor: pointer;
pointer-events: none;
}
.ant-pro-form-login-header {
height: auto !important;
......@@ -87,7 +88,7 @@ a {
.ant-tabs-nav::before {
border: none !important;
}
.ant-card-head{
.ant-card-head {
border: none !important;
}
}
......@@ -137,9 +138,59 @@ a {
.contained {
.ant-drawer-body {
padding: 0 !important;
padding-right: 24px !important;
}
}
.contain {
margin: 0 12px;
}
.ant-table-content {
margin-right: -6px;
padding-right: 6px;
}
/* 显示内容的滚动条 */
.ant-table-content::-webkit-scrollbar {
width: 0.5em; /* 调整滚动条宽度 */
height: 4px;
}
/* 滚动条的轨道 */
.ant-table-content::-webkit-scrollbar-track {
background: transparent; /* 设置轨道的背景颜色 */
}
/* 滚动条的滑块 */
.ant-table-content::-webkit-scrollbar-thumb {
background: rgba(163, 163, 163, 0.454); /* 设置滑块的背景颜色 */
border-radius: 4px; /* 设置滑块的圆角 */
}
/* 鼠标悬停在滑块上时 */
.ant-table-content::-webkit-scrollbar-thumb:hover {
background: #555; /* 设置悬停状态下滑块的背景颜色 */
}
.element{
margin-right: -6px;
padding-right: 6px;
}
/* 显示内容的滚动条 */
.element::-webkit-scrollbar {
width: 0.5em; /* 调整滚动条宽度 */
}
/* 滚动条的轨道 */
.element::-webkit-scrollbar-track {
background: transparent; /* 设置轨道的背景颜色 */
}
/* 滚动条的滑块 */
.element::-webkit-scrollbar-thumb {
background: rgba(163, 163, 163, 0.454); /* 设置滑块的背景颜色 */
border-radius: 4px; /* 设置滑块的圆角 */
}
/* 鼠标悬停在滑块上时 */
.element::-webkit-scrollbar-thumb:hover {
background: #555; /* 设置悬停状态下滑块的背景颜色 */
}
......@@ -62,7 +62,7 @@ function Headers({ currentUser, children, broken }) {
shape="circle"
></Button>
</div>
<div style={{ marginRight: 112, gap: 12 }} className="centerl">
<div style={{ marginRight: 24, gap: 12 }} className="centerl">
<Dropdown
menu={{
items,
......
export default {
token: {
colorPrimary: "#59c4f2", //主题颜色
colorBorder: "transparent",
colorBgContainer: "#102536",
colorBgElevated: "rgba(0,0,0,0.8)",
colorBgDeep: "#081520"
},
};
/*
* @Author: wuhao930406 1148547900@qq.com
* @Date: 2023-10-17 10:14:53
* @LastEditors: wuhao930406 1148547900@qq.com
* @LastEditTime: 2023-10-17 15:58:12
* @FilePath: /standaloneframe/frontend/src/layouts/index.jsx
* @Description:
*
* Copyright (c) 2023 by ${git_name_email}, All Rights Reserved.
*/
import { Link, Outlet, history } from "umi";
import { Button, ConfigProvider, theme, Segmented, Space, Divider } from "antd";
import styles from "./index.less";
......@@ -8,28 +18,25 @@ import Switches from "@/components/Switches";
import zhCN from "antd/locale/zh_CN";
import "dayjs/locale/zh-cn";
import dayjs from "dayjs";
import themeconfig from "./components/theme";
dayjs.locale("zh-cn");
export default function Layout() {
const [mode, setmode] = useState("light");
return (
<ConfigProvider
theme={{
algorithm: mode === "light" ? theme.algorithm : theme.darkAlgorithm,
token: {
colorPrimary: "#59c4f2",
colorBorder:mode === "light" ? "#f0f0f0": "transparent"
},
algorithm: theme.darkAlgorithm,
...themeconfig,
}}
locale={zhCN}
>
<div
style={{ backgroundColor: mode === "light" ? "#fff" : "#363636" }}
style={{ backgroundColor:"#363636" }}
>
<div className="drag"></div>
<Space
{/* <Space
align="center"
direction="horizontal"
split={<Divider type="vertical" />}
......@@ -47,7 +54,7 @@ export default function Layout() {
setmode(val);
}}
></Switches>
</Space>
</Space> */}
<Outlet context={{ mode }} />
</div>
</ConfigProvider>
......
......@@ -19,4 +19,5 @@
line-height: 64px;
cursor: pointer;
transition: color 0.3s;
color:#081520
}
......@@ -30,11 +30,12 @@ const items = [UserOutlined, VideoCameraOutlined].map((icon, index) => ({
}));
const Dashboard = () => {
const [collapsed, setCollapsed] = useState(false);
const collapsed = true;
const [collapseds, setCollapsed] = useState(false);
const [broken, setbroken] = useState(false);
const [open, setopen] = useState(false);
const {
token: { colorBgContainer, colorTextBase },
token: { colorBgContainer, colorTextBase, colorBgDeep },
} = theme.useToken();
const {
......@@ -48,12 +49,9 @@ const Dashboard = () => {
const MenuDOM = (
<div
style={{
backgroundColor: mode === "light" ? "#f5f5f5" : "rgba(255,255,255,0.1)",
margin: 24,
marginRight: 0,
backgroundColor: colorBgDeep,
padding: 12,
borderRadius: 12,
height: "calc(100% - 48px)",
height: "calc(100%)",
color: colorTextBase,
display: "flex",
flexDirection: "column",
......@@ -97,7 +95,7 @@ const Dashboard = () => {
<div style={{ flex: 1 }}>
<Menu
theme={mode}
theme={"dark"}
mode="inline"
selectedKeys={[pathname]}
items={items}
......@@ -121,10 +119,6 @@ const Dashboard = () => {
<Tooltip title="退出登录" placement="right">
<div
className="sorts"
style={{
"--color":
mode === "light" ? "rgba(0,0,0,0.1)" : "rgba(255,255,255,0.1)",
}}
onClick={() => {
doFetch({ url: "/webtool/logout", params: {} }).then((res) => {
localStorage.removeItem("TOKENES");
......@@ -136,17 +130,12 @@ const Dashboard = () => {
</div>
</Tooltip>
<div style={{ marginTop: collapsed ? 14 : 0 }}>
<div
className="sorts"
style={{
"--color":
mode === "light" ? "rgba(0,0,0,0.1)" : "rgba(255,255,255,0.1)",
}}
>
<div className="sorts">
{React.createElement(
collapsed ? MenuUnfoldOutlined : MenuFoldOutlined,
{
className: "trigger",
style: { color: colorTextBase },
onClick: () => setCollapsed(!collapsed),
}
)}
......@@ -157,13 +146,7 @@ const Dashboard = () => {
);
return (
<Layout
hasSider
className="contained"
style={{
"--bgcolor": mode === "light" ? "#fff" : "rgba(255,255,255,0.1)",
}}
>
<Layout hasSider className="contained">
<Drawer
title={null}
open={open}
......@@ -174,7 +157,7 @@ const Dashboard = () => {
zIndex={99999}
closable={false}
maskClosable={true}
width={260}
width={200}
getContainer={false}
>
{MenuDOM}
......@@ -188,14 +171,12 @@ const Dashboard = () => {
style={{
overflow: "auto",
height: "100vh",
background: colorBgContainer,
"--width": broken ? 0 : 100,
"--width": broken ? 0 : 78,
}}
trigger={null}
collapsible
collapsed={collapsed}
collapsedWidth={broken ? 0 : 100}
theme={mode}
collapsedWidth={broken ? 0 : 78}
>
{!broken && MenuDOM}
</Sider>
......@@ -212,17 +193,12 @@ const Dashboard = () => {
history.push("/");
}}
/>
<div
className="sorts"
style={{
"--color":
mode === "light" ? "rgba(0,0,0,0.1)" : "rgba(255,255,255,0.1)",
}}
>
<div className="sorts">
{React.createElement(
collapsed ? MenuUnfoldOutlined : MenuFoldOutlined,
{
className: "trigger",
style: { color: colorTextBase },
onClick: () => setopen(!open),
}
)}
......
......@@ -21,6 +21,9 @@ const Login = () => {
console.log(ipc);
const handleSubmit = async (values) => {
history.push("/");
return
if (loginType === "account") {
// 登录
const msg = await doFetch({
......@@ -60,12 +63,6 @@ const Login = () => {
const [loginType, setLoginType] = useState("account");
const { data } = useRequest(async () => {
let res = await getFetch({ url: "/controller/example/test", params: {} });
return res?.data;
});
console.log(data);
return (
<div
......@@ -94,7 +91,7 @@ const Login = () => {
logo={
<img alt="logo" src="./logo.png" style={{ borderRadius: "50%" }} />
}
subTitle={data?.username + "———军工健康监测系统"}
subTitle={"———军工健康监测系统"}
initialValues={{
autoLogin: true,
}}
......
......@@ -3083,6 +3083,25 @@ axios@^0.27.2:
follow-redirects "^1.14.9"
form-data "^4.0.0"
ayin-color@*:
version "1.0.9"
resolved "https://registry.npmmirror.com/ayin-color/-/ayin-color-1.0.9.tgz#5d4698bd7aa5ceedb0a3ba7b1606009c2edaef9e"
integrity sha512-15iZN205m0TzrqxzkfiYxVUQ18yVIG/s8CTh/9q7KLVkWhv0nfpSGBnFeOZtFIy0HZ2Qv5IyVmlI65e1SmrOOA==
dependencies:
ayin-lessmixins "*"
chroma-js "*"
less "*"
less-loader "*"
ayin-lessmixins@*:
version "1.1.0"
resolved "https://registry.npmmirror.com/ayin-lessmixins/-/ayin-lessmixins-1.1.0.tgz#ef389de9a8fefe7afffda12c11513b9c4c6535c6"
integrity sha512-l0alHVeJfVFF/huui59hxm/TKiLTluhtZJIriCUM93vXUjNME34fi11aoUAIwN/F0UhQxstaZ71f2uy7z0kq9g==
dependencies:
ayin-color "*"
less "*"
less-loader "*"
babel-jest@^29.4.3:
version "29.5.0"
resolved "https://registry.npmmirror.com/babel-jest/-/babel-jest-29.5.0.tgz#3fe3ddb109198e78b1c88f9ebdecd5e4fc2f50a5"
......@@ -3446,6 +3465,11 @@ chokidar@3.5.3, chokidar@^3.4.0, chokidar@^3.5.3:
optionalDependencies:
fsevents "~2.3.2"
chroma-js@*:
version "2.4.2"
resolved "https://registry.npmmirror.com/chroma-js/-/chroma-js-2.4.2.tgz#dffc214ed0c11fa8eefca2c36651d8e57cbfb2b0"
integrity sha512-U9eDw6+wt7V8z5NncY2jJfZa+hUH8XEj8FQHgFJTrUFnJfXYf4Ml4adI2vXZOjqRDpFWtYVWypDfZwnJ+HIR4A==
ci-info@^3.2.0:
version "3.8.0"
resolved "https://registry.npmmirror.com/ci-info/-/ci-info-3.8.0.tgz#81408265a5380c929f0bc665d62256628ce9ef91"
......@@ -4041,6 +4065,14 @@ dva-loading@^3.0.22:
dependencies:
"@babel/runtime" "^7.0.0"
echarts@*:
version "5.4.3"
resolved "https://registry.npmmirror.com/echarts/-/echarts-5.4.3.tgz#f5522ef24419164903eedcfd2b506c6fc91fb20c"
integrity sha512-mYKxLxhzy6zyTi/FaEbJMOZU1ULGEQHaeIeuMR5L+JnJTpz+YR03mnnpBhbR4+UYJAgiXgpyTVLffPAjOTLkZA==
dependencies:
tslib "2.3.0"
zrender "5.4.4"
electron-to-chromium@^1.4.411:
version "1.4.416"
resolved "https://registry.npmmirror.com/electron-to-chromium/-/electron-to-chromium-1.4.416.tgz#7291f704168d3842ae4da3ae9fdc7bfbeb97d116"
......@@ -5490,6 +5522,28 @@ kolorist@^1.6.0:
resolved "https://registry.npmmirror.com/kolorist/-/kolorist-1.8.0.tgz#edddbbbc7894bc13302cdf740af6374d4a04743c"
integrity sha512-Y+60/zizpJ3HRH8DCss+q95yr6145JXZo46OTpFvDZWLfRCE4qChOyk1b26nMaNpfHHgxagk9dXT5OP0Tfe+dQ==
less-loader@*:
version "11.1.3"
resolved "https://registry.npmmirror.com/less-loader/-/less-loader-11.1.3.tgz#1bb62d6ca9bf00a177c02793b54baac40f9be694"
integrity sha512-A5b7O8dH9xpxvkosNrP0dFp2i/dISOJa9WwGF3WJflfqIERE2ybxh1BFDj5CovC2+jCE4M354mk90hN6ziXlVw==
less@*:
version "4.2.0"
resolved "https://registry.npmmirror.com/less/-/less-4.2.0.tgz#cbefbfaa14a4cd388e2099b2b51f956e1465c450"
integrity sha512-P3b3HJDBtSzsXUl0im2L7gTO5Ubg8mEN6G8qoTS77iXxXX4Hvu4Qj540PZDvQ8V6DmX6iXo98k7Md0Cm1PrLaA==
dependencies:
copy-anything "^2.0.1"
parse-node-version "^1.0.1"
tslib "^2.3.0"
optionalDependencies:
errno "^0.1.1"
graceful-fs "^4.1.2"
image-size "~0.5.0"
make-dir "^2.1.0"
mime "^1.4.1"
needle "^3.1.0"
source-map "~0.6.0"
less@4.1.3:
version "4.1.3"
resolved "https://registry.npmmirror.com/less/-/less-4.1.3.tgz#175be9ddcbf9b250173e0a00b4d6920a5b770246"
......@@ -7924,6 +7978,14 @@ tapable@^2.0.0, tapable@^2.2.0, tapable@^2.2.1:
resolved "https://registry.npmmirror.com/tapable/-/tapable-2.2.1.tgz#1967a73ef4060a82f12ab96af86d52fdb76eeca0"
integrity sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ==
techui-react-lite@^0.0.6:
version "0.0.6"
resolved "https://registry.npmmirror.com/techui-react-lite/-/techui-react-lite-0.0.6.tgz#3600d8dca301f3f7ba78a0570dc19428ef902796"
integrity sha512-CrbHbzrW18xUw5Q8ou9dIa50tMQVezQzQF54Ed1cVxnURO73+waRpPX0aCvF7V/uPT5WJyffwj7ZbnxM0AVlOA==
dependencies:
ayin-color "*"
echarts "*"
terser@^5.10.0:
version "5.17.6"
resolved "https://registry.npmmirror.com/terser/-/terser-5.17.6.tgz#d810e75e1bb3350c799cd90ebefe19c9412c12de"
......@@ -8004,6 +8066,11 @@ tslib@2.0.1:
resolved "https://registry.npmmirror.com/tslib/-/tslib-2.0.1.tgz#410eb0d113e5b6356490eec749603725b021b43e"
integrity sha512-SgIkNheinmEBgx1IUNirK0TUD4X9yjjBRTqqjggWCU3pUEqIk3/Uwl3yRixYKT6WjQuGiwDv4NomL3wqRCj+CQ==
tslib@2.3.0:
version "2.3.0"
resolved "https://registry.npmmirror.com/tslib/-/tslib-2.3.0.tgz#803b8cdab3e12ba581a4ca41c8839bbb0dacb09e"
integrity sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg==
tslib@^1.8.1:
version "1.14.1"
resolved "https://registry.npmmirror.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00"
......@@ -8396,3 +8463,10 @@ yocto-queue@^0.1.0:
version "0.1.0"
resolved "https://registry.npmmirror.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b"
integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==
zrender@5.4.4:
version "5.4.4"
resolved "https://registry.npmmirror.com/zrender/-/zrender-5.4.4.tgz#8854f1d95ecc82cf8912f5a11f86657cb8c9e261"
integrity sha512-0VxCNJ7AGOMCWeHVyTrGzUgrK4asT4ml9PEkeGirAkKNYXYzoPJCLvmyfdoOXcjTHPs10OZVMfD1Rwg16AZyYw==
dependencies:
tslib "2.3.0"
2023-06-15 13:35:12,015 INFO 9746 [addon:tray] load
2023-06-15 13:35:12,026 INFO 9746 [addon:security] load
2023-06-15 13:35:12,026 INFO 9746 [addon:awaken] load
2023-06-15 13:35:12,028 INFO 9746 [addon:autoUpdater] load
2023-06-15 13:35:39,860 INFO 9788 [addon:tray] load
2023-06-15 13:35:39,867 INFO 9788 [addon:security] load
2023-06-15 13:35:39,868 INFO 9788 [addon:awaken] load
2023-06-15 13:35:39,870 INFO 9788 [addon:autoUpdater] load
2023-06-15 15:51:15,745 INFO 11081 [addon:tray] load
2023-06-15 15:51:15,758 INFO 11081 [addon:security] load
2023-06-15 15:51:15,758 INFO 11081 [addon:awaken] load
2023-06-15 15:51:15,761 INFO 11081 [addon:autoUpdater] load
2023-06-15 16:11:40,938 INFO 11439 [addon:tray] load
2023-06-15 16:11:40,950 INFO 11439 [addon:security] load
2023-06-15 16:11:40,950 INFO 11439 [addon:awaken] load
2023-06-15 16:11:40,952 INFO 11439 [addon:autoUpdater] load
2023-06-15 17:40:03,715 INFO 12266 [addon:tray] load
2023-06-15 17:40:03,726 INFO 12266 [addon:security] load
2023-06-15 17:40:03,726 INFO 12266 [addon:awaken] load
2023-06-15 17:40:03,728 INFO 12266 [addon:autoUpdater] load
2023-06-15 17:40:44,366 INFO 12336 [addon:tray] load
2023-06-15 17:40:44,376 INFO 12336 [addon:security] load
2023-06-15 17:40:44,377 INFO 12336 [addon:awaken] load
2023-06-15 17:40:44,379 INFO 12336 [addon:autoUpdater] load
2023-06-15 13:35:12,032 INFO 9746 [ee-core] Env: local, Type: spa
2023-06-15 13:35:12,032 INFO 9746 [ee-core] App running at: http://localhost:8080
2023-06-15 13:35:12,119 ERROR 9746 [ee-core] Please check the http://localhost:8080 are running OR modify config file !
2023-06-15 13:35:39,873 INFO 9788 [ee-core] Env: local, Type: spa
2023-06-15 13:35:39,874 INFO 9788 [ee-core] App running at: http://localhost:8080
2023-06-15 13:35:39,950 ERROR 9788 [ee-core] Please check the http://localhost:8080 are running OR modify config file !
2023-06-15 15:51:15,765 INFO 11081 [ee-core] Env: local, Type: spa
2023-06-15 15:51:15,765 INFO 11081 [ee-core] App running at: http://localhost:8000
2023-06-15 15:51:15,878 ERROR 11081 [ee-core] Please check the http://localhost:8000 are running OR modify config file !
2023-06-15 16:11:40,956 INFO 11439 [ee-core] Env: local, Type: spa
2023-06-15 16:11:40,956 INFO 11439 [ee-core] App running at: http://localhost:8000
2023-06-15 17:40:03,732 INFO 12266 [ee-core] Env: local, Type: spa
2023-06-15 17:40:03,732 INFO 12266 [ee-core] App running at: http://localhost:8000
2023-06-15 17:40:03,848 ERROR 12266 [ee-core] Please check the http://localhost:8000 are running OR modify config file !
2023-06-15 17:40:44,383 INFO 12336 [ee-core] Env: local, Type: spa
2023-06-15 17:40:44,383 INFO 12336 [ee-core] App running at: http://localhost:8000
2023-06-15 13:35:12,119 ERROR 9746 [ee-core] Please check the http://localhost:8080 are running OR modify config file !
2023-06-15 13:35:39,950 ERROR 9788 [ee-core] Please check the http://localhost:8080 are running OR modify config file !
2023-06-15 15:51:15,878 ERROR 11081 [ee-core] Please check the http://localhost:8000 are running OR modify config file !
2023-06-15 17:40:03,848 ERROR 12266 [ee-core] Please check the http://localhost:8000 are running OR modify config file !
{
"name": "standaloneframe",
"version": "3.4.0",
"name": "ee",
"version": "3.7.0",
"description": "A fast, desktop software development framework",
"main": "main.js",
"scripts": {
"start": "electron . ",
"dev": "electron . --env=local",
"dev": "ee-bin dev",
"dev-frontend": "ee-bin dev --serve=frontend",
"dev-electron": "ee-bin dev --serve=electron",
"build-frontend": "ee-bin build",
"start": "ee-bin start",
"rd": "ee-bin rd",
"encrypt": "ee-bin encrypt",
"clean": "ee-bin clean",
"icon": "ee-bin icon",
"reload": "nodemon --config ./electron/config/nodemon.json",
"test": "set DEBUG=* && electron . --env=local",
"rebuild": "electron-rebuild",
"re-sqlite": "electron-rebuild -f -w better-sqlite3",
"build-w": "electron-builder --config=./electron/config/builder.json -w=nsis --x64",
"build-w-32": "electron-builder --config=./electron/config/builder.json -w=nsis --ia32",
"build-w-64": "electron-builder --config=./electron/config/builder.json -w=nsis --x64",
......@@ -25,22 +33,20 @@
"build-l-armv7l": "electron-builder --config=./electron/config/builder.json -l=deb --armv7l",
"build-lr-64": "electron-builder --config=./electron/config/builder.json -l=rpm --x64",
"build-lp-64": "electron-builder --config=./electron/config/builder.json -l=pacman --x64",
"rd": "ee-core rd --dist_dir=./frontend/dist",
"encrypt": "ee-core encrypt",
"clean": "ee-core clean",
"rebuild": "electron-rebuild",
"re-sqlite": "electron-rebuild -f -w better-sqlite3"
"test": "set DEBUG=* && electron . --env=local"
},
"repository": "https://github.com/dromara/electron-egg.git",
"keywords": [
"Electron",
"electron-egg"
"electron-egg",
"ElectronEgg"
],
"author": "哆啦好梦, Inc <530353222@qq.com>",
"license": "Apache",
"devDependencies": {
"@electron/rebuild": "^3.2.13",
"debug": "^4.3.3",
"ee-bin": "^1.2.0",
"electron": "^21.4.4",
"electron-builder": "^23.6.0",
"eslint": "^5.13.0",
......@@ -48,13 +54,9 @@
"nodemon": "^2.0.16"
},
"dependencies": {
"sequelize-cli": "^6.6.1",
"better-sqlite3": "^8.4.0",
"dayjs": "^1.10.7",
"ee-core": "^2.2.3",
"ee-core": "^2.5.0",
"electron-updater": "^5.3.0",
"lodash": "^4.17.21",
"sequelize": "^6.32.0",
"sqlite3": "^5.1.6"
"lodash": "^4.17.21"
}
}
\ No newline at end of file
}
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment