mirror of
https://gitee.com/dromara/electron-egg.git
synced 2026-05-19 14:38:10 +08:00
demo 登录
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
const { Controller } = require('ee-core');
|
||||
const { dialog } = require('electron');
|
||||
const _ = require('lodash');
|
||||
const CoreWindow = require('ee-core/electron/window');
|
||||
|
||||
/**
|
||||
* 特效 - 功能demo
|
||||
@@ -17,7 +18,7 @@ class EffectController extends Controller {
|
||||
/**
|
||||
* 选择文件
|
||||
*/
|
||||
selectFile () {
|
||||
selectFile() {
|
||||
const filePaths = dialog.showOpenDialogSync({
|
||||
properties: ['openFile']
|
||||
});
|
||||
@@ -27,6 +28,42 @@ class EffectController extends Controller {
|
||||
}
|
||||
|
||||
return filePaths[0];
|
||||
}
|
||||
|
||||
/**
|
||||
* login window
|
||||
*/
|
||||
loginWindow(args) {
|
||||
const { width, height } = args;
|
||||
const win = CoreWindow.getMainWindow();
|
||||
|
||||
const size = {
|
||||
width: width || 400,
|
||||
height: height || 300
|
||||
}
|
||||
win.setSize(size.width, size.height);
|
||||
win.setResizable(true);
|
||||
win.center();
|
||||
win.show();
|
||||
win.focus();
|
||||
}
|
||||
|
||||
/**
|
||||
* restore window
|
||||
*/
|
||||
restoreWindow(args) {
|
||||
const { width, height } = args;
|
||||
const win = CoreWindow.getMainWindow();
|
||||
|
||||
const size = {
|
||||
width: width || 980,
|
||||
height: height || 650
|
||||
}
|
||||
win.setSize(size.width, size.height);
|
||||
win.setResizable(true);
|
||||
win.center();
|
||||
win.show();
|
||||
win.focus();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user