正在显示
5 个修改的文件
包含
162 行增加
和
164 行删除
| ... | @@ -57,7 +57,7 @@ let mainConfig = { | ... | @@ -57,7 +57,7 @@ let mainConfig = { |
| 57 | ], | 57 | ], |
| 58 | resolve: { | 58 | resolve: { |
| 59 | alias: { | 59 | alias: { |
| 60 | - 'config': resolve('config'), | 60 | + '@config': resolve('config'), |
| 61 | }, | 61 | }, |
| 62 | extensions: ['.js', '.json', '.node'] | 62 | extensions: ['.js', '.json', '.node'] |
| 63 | }, | 63 | }, | ... | ... |
| ... | @@ -6,6 +6,7 @@ | ... | @@ -6,6 +6,7 @@ |
| 6 | "license": "MIT", | 6 | "license": "MIT", |
| 7 | "main": "./dist/electron/main.js", | 7 | "main": "./dist/electron/main.js", |
| 8 | "scripts": { | 8 | "scripts": { |
| 9 | + "dev": "node .electron-vue/dev-runner.js", | ||
| 9 | "build": "node .electron-vue/build.js && electron-builder", | 10 | "build": "node .electron-vue/build.js && electron-builder", |
| 10 | "build:win32": "node .electron-vue/build.js && electron-builder --win --ia32", | 11 | "build:win32": "node .electron-vue/build.js && electron-builder --win --ia32", |
| 11 | "build:win64": "node .electron-vue/build.js && electron-builder --win --x64", | 12 | "build:win64": "node .electron-vue/build.js && electron-builder --win --x64", |
| ... | @@ -13,12 +14,15 @@ | ... | @@ -13,12 +14,15 @@ |
| 13 | "build:dir": "node .electron-vue/build.js && electron-builder --dir", | 14 | "build:dir": "node .electron-vue/build.js && electron-builder --dir", |
| 14 | "build:clean": "cross-env BUILD_TARGET=clean node .electron-vue/build.js", | 15 | "build:clean": "cross-env BUILD_TARGET=clean node .electron-vue/build.js", |
| 15 | "build:web": "cross-env BUILD_TARGET=web node .electron-vue/build.js", | 16 | "build:web": "cross-env BUILD_TARGET=web node .electron-vue/build.js", |
| 16 | - "dev": "node .electron-vue/dev-runner.js", | ||
| 17 | "pack": "npm run pack:main && npm run pack:renderer", | 17 | "pack": "npm run pack:main && npm run pack:renderer", |
| 18 | "pack:main": "cross-env NODE_ENV=production webpack --progress --colors --config .electron-vue/webpack.main.config.js", | 18 | "pack:main": "cross-env NODE_ENV=production webpack --progress --colors --config .electron-vue/webpack.main.config.js", |
| 19 | "pack:renderer": "cross-env NODE_ENV=production webpack --progress --colors --config .electron-vue/webpack.renderer.config.js" | 19 | "pack:renderer": "cross-env NODE_ENV=production webpack --progress --colors --config .electron-vue/webpack.renderer.config.js" |
| 20 | }, | 20 | }, |
| 21 | "build": { | 21 | "build": { |
| 22 | + "nsis": { | ||
| 23 | + "oneClick": false, | ||
| 24 | + "allowToChangeInstallationDirectory": true | ||
| 25 | + }, | ||
| 22 | "productName": "electron-vue-admin", | 26 | "productName": "electron-vue-admin", |
| 23 | "appId": "org.simulatedgreg.electron-vue", | 27 | "appId": "org.simulatedgreg.electron-vue", |
| 24 | "directories": { | 28 | "directories": { |
| ... | @@ -28,8 +32,7 @@ | ... | @@ -28,8 +32,7 @@ |
| 28 | "dist/electron/**/*" | 32 | "dist/electron/**/*" |
| 29 | ], | 33 | ], |
| 30 | "dmg": { | 34 | "dmg": { |
| 31 | - "contents": [ | 35 | + "contents": [{ |
| 32 | - { | ||
| 33 | "x": 410, | 36 | "x": 410, |
| 34 | "y": 150, | 37 | "y": 150, |
| 35 | "type": "link", | 38 | "type": "link", |
| ... | @@ -131,4 +134,4 @@ | ... | @@ -131,4 +134,4 @@ |
| 131 | "webpack-hot-middleware": "^2.25.0", | 134 | "webpack-hot-middleware": "^2.25.0", |
| 132 | "webpack-merge": "^4.2.1" | 135 | "webpack-merge": "^4.2.1" |
| 133 | } | 136 | } |
| 134 | -} | 137 | +} |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| ... | @@ -2,20 +2,21 @@ | ... | @@ -2,20 +2,21 @@ |
| 2 | 2 | ||
| 3 | import { app } from 'electron' | 3 | import { app } from 'electron' |
| 4 | import '../renderer/store' | 4 | import '../renderer/store' |
| 5 | -import loadindWindow from './services/windowManager' | 5 | +import initWindow from './services/windowManager' |
| 6 | +import path from 'path' | ||
| 6 | 7 | ||
| 7 | /** | 8 | /** |
| 8 | * Set `__static` path to static files in production | 9 | * Set `__static` path to static files in production |
| 9 | * https://simulatedgreg.gitbooks.io/electron-vue/content/en/using-static-assets.html | 10 | * https://simulatedgreg.gitbooks.io/electron-vue/content/en/using-static-assets.html |
| 10 | */ | 11 | */ |
| 11 | if (process.env.NODE_ENV !== 'development') { | 12 | if (process.env.NODE_ENV !== 'development') { |
| 12 | - global.__static = require('path').join(__dirname, '/static').replace(/\\/g, '\\\\') | 13 | + global.__static = path.join(__dirname, '/static').replace(/\\/g, '\\\\') |
| 13 | } | 14 | } |
| 14 | 15 | ||
| 15 | const loadingURL = process.env.NODE_ENV === 'development' ? `http://localhost:9080/static/loader.html` : `file://${__static}/loader.html` | 16 | const loadingURL = process.env.NODE_ENV === 'development' ? `http://localhost:9080/static/loader.html` : `file://${__static}/loader.html` |
| 16 | 17 | ||
| 17 | function onAppReady () { | 18 | function onAppReady () { |
| 18 | - loadindWindow(loadingURL) | 19 | + initWindow(loadingURL) |
| 19 | } | 20 | } |
| 20 | 21 | ||
| 21 | app.isReady() ? onAppReady() : app.on('ready', onAppReady) | 22 | app.isReady() ? onAppReady() : app.on('ready', onAppReady) |
| ... | @@ -25,7 +26,9 @@ app.on('window-all-closed', () => { | ... | @@ -25,7 +26,9 @@ app.on('window-all-closed', () => { |
| 25 | app.quit() | 26 | app.quit() |
| 26 | } | 27 | } |
| 27 | }) | 28 | }) |
| 28 | - | 29 | +app.on('browser-window-created', () => { |
| 30 | + console.log(11111) | ||
| 31 | +}) | ||
| 29 | // app.on('activate', () => { | 32 | // app.on('activate', () => { |
| 30 | // if (mainWindow === null) { | 33 | // if (mainWindow === null) { |
| 31 | // createWindow() | 34 | // createWindow() | ... | ... |
| ... | @@ -13,7 +13,6 @@ function createMainWindow () { | ... | @@ -13,7 +13,6 @@ function createMainWindow () { |
| 13 | useContentSize: true, | 13 | useContentSize: true, |
| 14 | width: 1000, | 14 | width: 1000, |
| 15 | show: false, | 15 | show: false, |
| 16 | - backgroundColor: '#fffff', | ||
| 17 | titleBarStyle: 'hidden', | 16 | titleBarStyle: 'hidden', |
| 18 | webPreferences: { | 17 | webPreferences: { |
| 19 | nodeIntegration: true | 18 | nodeIntegration: true |
| ... | @@ -32,15 +31,14 @@ function createMainWindow () { | ... | @@ -32,15 +31,14 @@ function createMainWindow () { |
| 32 | mainWindow = null | 31 | mainWindow = null |
| 33 | }) | 32 | }) |
| 34 | } | 33 | } |
| 35 | -// if(require('config').UseUseStartupChart){ | ||
| 36 | 34 | ||
| 37 | -// } | ||
| 38 | function loadindWindow (loadingURL) { | 35 | function loadindWindow (loadingURL) { |
| 39 | const loadWindow = new BrowserWindow({ | 36 | const loadWindow = new BrowserWindow({ |
| 40 | width: 400, | 37 | width: 400, |
| 41 | height: 600, | 38 | height: 600, |
| 42 | frame: false, | 39 | frame: false, |
| 43 | - backgroundColor: '#222428' | 40 | + transparent: true, |
| 41 | + webPreferences: { experimentalFeatures: true } | ||
| 44 | }) | 42 | }) |
| 45 | 43 | ||
| 46 | loadWindow.loadURL(loadingURL) | 44 | loadWindow.loadURL(loadingURL) |
| ... | @@ -52,5 +50,11 @@ function loadindWindow (loadingURL) { | ... | @@ -52,5 +50,11 @@ function loadindWindow (loadingURL) { |
| 52 | loadWindow.destroy() | 50 | loadWindow.destroy() |
| 53 | }, 2000) | 51 | }, 2000) |
| 54 | } | 52 | } |
| 55 | - | 53 | +function initWindow (loadingURL) { |
| 56 | -export default loadindWindow | 54 | + if (require('@config').UseStartupChart) { |
| 55 | + return loadindWindow(loadingURL) | ||
| 56 | + } else { | ||
| 57 | + return createMainWindow() | ||
| 58 | + } | ||
| 59 | +} | ||
| 60 | +export default initWindow | ... | ... |
| 1 | <!doctype html> | 1 | <!doctype html> |
| 2 | <html> | 2 | <html> |
| 3 | + | ||
| 3 | <head> | 4 | <head> |
| 4 | -<meta charset="utf-8"> | 5 | + <meta charset="utf-8"> |
| 5 | -<title></title> | 6 | + <title></title> |
| 6 | - | 7 | + |
| 7 | -<style> | 8 | + <style> |
| 8 | -/* Demo Styles - It's all in the SVG */ | 9 | + /* Demo Styles - It's all in the SVG */ |
| 9 | -html { | 10 | + html { |
| 10 | - height: 100%; | 11 | + height: 100%; |
| 11 | - min-height: 100%; | 12 | + min-height: 100%; |
| 12 | - overflow: hidden; | 13 | + overflow: hidden; |
| 13 | -} | 14 | + } |
| 14 | -html body { | 15 | + |
| 15 | - background: #222428; | 16 | + html body { |
| 16 | - background-size: 163px; | 17 | + background: #222428af; |
| 17 | - font: 14px/21px Monaco, sans-serif; | 18 | + backdrop-filter: blur(8px); |
| 18 | - color: #999; | 19 | + background-size: 163px; |
| 19 | - font-smoothing: antialiased; | 20 | + font: 14px/21px Monaco, sans-serif; |
| 20 | - -webkit-text-size-adjust: 100%; | 21 | + color: #999; |
| 21 | - -moz-text-size-adjust: 100%; | 22 | + font-smoothing: antialiased; |
| 23 | + -webkit-text-size-adjust: 100%; | ||
| 24 | + -moz-text-size-adjust: 100%; | ||
| 22 | -ms-text-size-adjust: 100%; | 25 | -ms-text-size-adjust: 100%; |
| 23 | - text-size-adjust: 100%; | 26 | + text-size-adjust: 100%; |
| 24 | - height: 100%; | 27 | + height: 100%; |
| 25 | - min-height: 100%; | 28 | + min-height: 100%; |
| 26 | -} | 29 | + } |
| 27 | -html body a, html body a:visited { | 30 | + |
| 28 | - text-decoration: none; | 31 | + html body a, |
| 29 | - color: #FF805F; | 32 | + html body a:visited { |
| 30 | -} | 33 | + text-decoration: none; |
| 31 | -html body h4 { | 34 | + color: #FF805F; |
| 32 | - margin: 0; | 35 | + } |
| 33 | - color: #666; | 36 | + |
| 34 | -} | 37 | + html body h4 { |
| 35 | - | 38 | + margin: 0; |
| 36 | -.scene { | 39 | + color: #666; |
| 37 | - width: 100%; | 40 | + } |
| 38 | - height: 100%; | 41 | + |
| 39 | - -webkit-perspective: 600; | 42 | + .scene { |
| 40 | - perspective: 600; | 43 | + width: 100%; |
| 41 | - display: flex; | 44 | + height: 100%; |
| 42 | - align-items: center; | 45 | + -webkit-perspective: 600; |
| 43 | - justify-content: center; | 46 | + perspective: 600; |
| 44 | -} | 47 | + display: flex; |
| 45 | -.scene svg { | 48 | + align-items: center; |
| 46 | - width: 240px; | 49 | + justify-content: center; |
| 47 | - height: 240px; | 50 | + } |
| 48 | -} | 51 | + |
| 49 | - | 52 | + .scene svg { |
| 50 | -.dc-logo { | 53 | + width: 240px; |
| 51 | - position: fixed; | 54 | + height: 240px; |
| 52 | - right: 10px; | 55 | + } |
| 53 | - bottom: 10px; | 56 | + |
| 54 | -} | 57 | + .dc-logo { |
| 55 | - | 58 | + position: fixed; |
| 56 | -.dc-logo:hover svg { | 59 | + right: 10px; |
| 57 | - -webkit-transform-origin: 50% 50%; | 60 | + bottom: 10px; |
| 58 | - transform-origin: 50% 50%; | 61 | + } |
| 59 | - -webkit-animation: arrow-spin 2.5s 0s cubic-bezier(0.165, 0.84, 0.44, 1) infinite; | 62 | + |
| 60 | - animation: arrow-spin 2.5s 0s cubic-bezier(0.165, 0.84, 0.44, 1) infinite; | 63 | + .dc-logo:hover svg { |
| 61 | -} | 64 | + -webkit-transform-origin: 50% 50%; |
| 62 | -.dc-logo:hover:hover:before { | 65 | + transform-origin: 50% 50%; |
| 63 | - content: '\2764'; | 66 | + -webkit-animation: arrow-spin 2.5s 0s cubic-bezier(0.165, 0.84, 0.44, 1) infinite; |
| 64 | - padding: 6px; | 67 | + animation: arrow-spin 2.5s 0s cubic-bezier(0.165, 0.84, 0.44, 1) infinite; |
| 65 | - font: 10px/1 Monaco, sans-serif; | 68 | + } |
| 66 | - font-size: 10px; | 69 | + |
| 67 | - color: #00fffe; | 70 | + .dc-logo:hover:hover:before { |
| 68 | - text-transform: uppercase; | 71 | + content: '\2764'; |
| 69 | - position: absolute; | 72 | + padding: 6px; |
| 70 | - left: -70px; | 73 | + font: 10px/1 Monaco, sans-serif; |
| 71 | - top: -30px; | 74 | + font-size: 10px; |
| 72 | - white-space: nowrap; | 75 | + color: #00fffe; |
| 73 | - z-index: 20px; | 76 | + text-transform: uppercase; |
| 74 | - box-shadow: 0px 0px 4px #222; | 77 | + position: absolute; |
| 75 | - background: rgba(0, 0, 0, 0.4); | 78 | + left: -70px; |
| 76 | -} | 79 | + top: -30px; |
| 77 | -.dc-logo:hover:hover:after { | 80 | + white-space: nowrap; |
| 78 | - content: 'Digital Craft'; | 81 | + z-index: 20px; |
| 79 | - padding: 6px; | 82 | + box-shadow: 0px 0px 4px #222; |
| 80 | - font: 10px/1 Monaco, sans-serif; | 83 | + background: rgba(0, 0, 0, 0.4); |
| 81 | - font-size: 10px; | 84 | + } |
| 82 | - color: #6E6F71; | 85 | + |
| 83 | - text-transform: uppercase; | 86 | + .dc-logo:hover:hover:after { |
| 84 | - position: absolute; | 87 | + content: 'Digital Craft'; |
| 85 | - right: 0; | 88 | + padding: 6px; |
| 86 | - top: -30px; | 89 | + font: 10px/1 Monaco, sans-serif; |
| 87 | - white-space: nowrap; | 90 | + font-size: 10px; |
| 88 | - z-index: 20px; | 91 | + color: #6E6F71; |
| 89 | - box-shadow: 0px 0px 4px #222; | 92 | + text-transform: uppercase; |
| 90 | - background: rgba(0, 0, 0, 0.4); | 93 | + position: absolute; |
| 91 | - background-image: none; | 94 | + right: 0; |
| 92 | -} | 95 | + top: -30px; |
| 93 | - | 96 | + white-space: nowrap; |
| 94 | -@-webkit-keyframes arrow-spin { | 97 | + z-index: 20px; |
| 95 | - 50% { | 98 | + box-shadow: 0px 0px 4px #222; |
| 96 | - -webkit-transform: rotateY(360deg); | 99 | + background: rgba(0, 0, 0, 0.4); |
| 97 | - transform: rotateY(360deg); | 100 | + background-image: none; |
| 98 | - } | 101 | + } |
| 99 | -} | 102 | + |
| 100 | - | 103 | + @-webkit-keyframes arrow-spin { |
| 101 | -@keyframes arrow-spin { | 104 | + 50% { |
| 102 | - 50% { | 105 | + -webkit-transform: rotateY(360deg); |
| 103 | - -webkit-transform: rotateY(360deg); | 106 | + transform: rotateY(360deg); |
| 104 | - transform: rotateY(360deg); | 107 | + } |
| 105 | - } | 108 | + } |
| 106 | -} | 109 | + |
| 107 | -</style> | 110 | + @keyframes arrow-spin { |
| 111 | + 50% { | ||
| 112 | + -webkit-transform: rotateY(360deg); | ||
| 113 | + transform: rotateY(360deg); | ||
| 114 | + } | ||
| 115 | + } | ||
| 116 | + </style> | ||
| 108 | </head> | 117 | </head> |
| 118 | + | ||
| 109 | <body> | 119 | <body> |
| 110 | -<div class="scene"> | 120 | + <div class="scene"> |
| 111 | - <svg | 121 | + <svg version="1.1" id="dc-spinner" xmlns="http://www.w3.org/2000/svg" x="0px" y="0px" width:"38" height:"38" |
| 112 | - version="1.1" | 122 | + viewBox="0 0 38 38" preserveAspectRatio="xMinYMin meet"> |
| 113 | - id="dc-spinner" | 123 | + <text x="13" y="21" font-family="Monaco" font-size="2px" style="letter-spacing:0.6" fill="grey">准备资源中... |
| 114 | - xmlns="http://www.w3.org/2000/svg" | 124 | + <animate attributeName="opacity" values="0;1;0" dur="1.8s" repeatCount="indefinite" /> |
| 115 | - x="0px" y="0px" | 125 | + </text> |
| 116 | - width:"38" | 126 | + <path fill="#373a42" d="M20,35c-8.271,0-15-6.729-15-15S11.729,5,20,5s15,6.729,15,15S28.271,35,20,35z M20,5.203 |
| 117 | - height:"38" | ||
| 118 | - viewBox="0 0 38 38" | ||
| 119 | - preserveAspectRatio="xMinYMin meet" | ||
| 120 | - > | ||
| 121 | - <text x="13" y="21" font-family="Monaco" font-size="2px" style="letter-spacing:0.6" fill="grey">准备资源中... | ||
| 122 | - <animate | ||
| 123 | - attributeName="opacity" | ||
| 124 | - values="0;1;0" dur="1.8s" | ||
| 125 | - repeatCount="indefinite"/> | ||
| 126 | - </text> | ||
| 127 | - <path fill="#373a42" d="M20,35c-8.271,0-15-6.729-15-15S11.729,5,20,5s15,6.729,15,15S28.271,35,20,35z M20,5.203 | ||
| 128 | C11.841,5.203,5.203,11.841,5.203,20c0,8.159,6.638,14.797,14.797,14.797S34.797,28.159,34.797,20 | 127 | C11.841,5.203,5.203,11.841,5.203,20c0,8.159,6.638,14.797,14.797,14.797S34.797,28.159,34.797,20 |
| 129 | C34.797,11.841,28.159,5.203,20,5.203z"> | 128 | C34.797,11.841,28.159,5.203,20,5.203z"> |
| 130 | - </path> | 129 | + </path> |
| 131 | 130 | ||
| 132 | - <path fill="#373a42" d="M20,33.125c-7.237,0-13.125-5.888-13.125-13.125S12.763,6.875,20,6.875S33.125,12.763,33.125,20 | 131 | + <path fill="#373a42" d="M20,33.125c-7.237,0-13.125-5.888-13.125-13.125S12.763,6.875,20,6.875S33.125,12.763,33.125,20 |
| 133 | S27.237,33.125,20,33.125z M20,7.078C12.875,7.078,7.078,12.875,7.078,20c0,7.125,5.797,12.922,12.922,12.922 | 132 | S27.237,33.125,20,33.125z M20,7.078C12.875,7.078,7.078,12.875,7.078,20c0,7.125,5.797,12.922,12.922,12.922 |
| 134 | S32.922,27.125,32.922,20C32.922,12.875,27.125,7.078,20,7.078z"> | 133 | S32.922,27.125,32.922,20C32.922,12.875,27.125,7.078,20,7.078z"> |
| 135 | - </path> | 134 | + </path> |
| 136 | 135 | ||
| 137 | - <path fill="#2AA198" stroke="#2AA198" stroke-width="0.6027" stroke-miterlimit="10" d="M5.203,20 | 136 | + <path fill="#2AA198" stroke="#2AA198" stroke-width="0.6027" stroke-miterlimit="10" |
| 137 | + d="M5.203,20 | ||
| 138 | c0-8.159,6.638-14.797,14.797-14.797V5C11.729,5,5,11.729,5,20s6.729,15,15,15v-0.203C11.841,34.797,5.203,28.159,5.203,20z"> | 138 | c0-8.159,6.638-14.797,14.797-14.797V5C11.729,5,5,11.729,5,20s6.729,15,15,15v-0.203C11.841,34.797,5.203,28.159,5.203,20z"> |
| 139 | - <animateTransform | 139 | + <animateTransform attributeName="transform" type="rotate" from="0 20 20" to="360 20 20" calcMode="spline" |
| 140 | - attributeName="transform" | 140 | + keySplines="0.4, 0, 0.2, 1" keyTimes="0;1" dur="2s" repeatCount="indefinite" /> |
| 141 | - type="rotate" | 141 | + </path> |
| 142 | - from="0 20 20" | 142 | + |
| 143 | - to="360 20 20" | 143 | + <path fill="#859900" stroke="#859900" stroke-width="0.2027" stroke-miterlimit="10" d="M7.078,20 |
| 144 | - calcMode="spline" | ||
| 145 | - keySplines="0.4, 0, 0.2, 1" | ||
| 146 | - keyTimes="0;1" | ||
| 147 | - dur="2s" | ||
| 148 | - repeatCount="indefinite" /> | ||
| 149 | - </path> | ||
| 150 | - | ||
| 151 | - <path fill="#859900" stroke="#859900" stroke-width="0.2027" stroke-miterlimit="10" d="M7.078,20 | ||
| 152 | c0-7.125,5.797-12.922,12.922-12.922V6.875C12.763,6.875,6.875,12.763,6.875,20S12.763,33.125,20,33.125v-0.203 | 144 | c0-7.125,5.797-12.922,12.922-12.922V6.875C12.763,6.875,6.875,12.763,6.875,20S12.763,33.125,20,33.125v-0.203 |
| 153 | C12.875,32.922,7.078,27.125,7.078,20z"> | 145 | C12.875,32.922,7.078,27.125,7.078,20z"> |
| 154 | - <animateTransform | 146 | + <animateTransform attributeName="transform" type="rotate" from="0 20 20" to="360 20 20" dur="1.8s" |
| 155 | - attributeName="transform" | 147 | + repeatCount="indefinite" /> |
| 156 | - type="rotate" | 148 | + </path> |
| 157 | - from="0 20 20" | 149 | + </svg> |
| 158 | - to="360 20 20" | 150 | + </div> |
| 159 | - dur="1.8s" | ||
| 160 | - repeatCount="indefinite" /> | ||
| 161 | - </path> | ||
| 162 | - </svg> | ||
| 163 | -</div> | ||
| 164 | 151 | ||
| 165 | </body> | 152 | </body> |
| 166 | -</html> | 153 | + |
| 154 | +</html> | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
-
请 注册 或 登录 后发表评论