张恒

升级依赖,修正web打包失败

......@@ -9,6 +9,7 @@ const MinifyPlugin = require("babel-minify-webpack-plugin");
const CopyWebpackPlugin = require('copy-webpack-plugin')
const MiniCssExtractPlugin = require('mini-css-extract-plugin')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const TerserPlugin = require('terser-webpack-plugin');
const { VueLoaderPlugin } = require('vue-loader')
function resolve(dir) {
......@@ -87,6 +88,7 @@ let webConfig = {
use: {
loader: 'url-loader',
query: {
esModule: false,
limit: 10000,
name: 'imgs/[name].[ext]'
}
......@@ -97,6 +99,7 @@ let webConfig = {
use: {
loader: 'url-loader',
query: {
esModule: false,
limit: 10000,
name: 'fonts/[name].[ext]'
}
......@@ -159,6 +162,50 @@ if (process.env.NODE_ENV === 'production') {
minimize: true
})
)
webConfig.optimization = {
splitChunks: {
chunks: "async",
cacheGroups: {
vendor: { // 将第三方模块提取出来
minSize: 30000,
minChunks: 1,
test: /node_modules/,
chunks: 'initial',
name: 'vendor',
priority: 1
},
commons: {
test: /[\\/]src[\\/]common[\\/]/,
name: 'commons',
minSize: 30000,
minChunks: 3,
chunks: 'initial',
priority: -1,
reuseExistingChunk: true // 这个配置允许我们使用已经存在的代码块
}
}
},
runtimeChunk: { name: 'runtime' },
minimizer: [
new TerserPlugin({
test: /\.js(\?.*)?$/i,
extractComments: false,
cache: false,
sourceMap: false,
terserOptions: {
warnings: false,
compress: {
warnings: false,
drop_console: true,
drop_debugger: true,
pure_funcs: ['console.log']
},
output: {
comments: false,
},
}
})]
}
}
module.exports = webConfig
......
......@@ -50,6 +50,7 @@ npm config edit
这是花裤衩大大原本的[地址](https://github.com/PanJiaChen/electron-vue-admin)
# 更新日志
- 2020年04月29日:修复web打包失败,提升依赖;文档待完善
- 2020年02月09日:添加[中文在线文档](https://umbrella22.github.io/electron-vue-template-doc/)[国内访问地址](https://zh-sky.gitee.io/electron-vue-template-doc/)
- 剔除win打包依赖,因为太大了,将它放到码云的额外仓库中,[地址](https://gitee.com/Zh-Sky/HardToDownloadLib)
- 2020年02月06日更新:激进分支更新至8.0.0.
......
......@@ -4,12 +4,6 @@
"lockfileVersion": 1,
"requires": true,
"dependencies": {
"7zip": {
"version": "0.0.6",
"resolved": "https://registry.npm.taobao.org/7zip/download/7zip-0.0.6.tgz",
"integrity": "sha1-nK+xca+CMpSQNTtIFvAzR6oVCjA=",
"dev": true
},
"7zip-bin": {
"version": "5.0.3",
"resolved": "https://registry.npm.taobao.org/7zip-bin/download/7zip-bin-5.0.3.tgz",
......@@ -3309,9 +3303,9 @@
}
},
"builder-util-runtime": {
"version": "8.6.2",
"resolved": "https://registry.npm.taobao.org/builder-util-runtime/download/builder-util-runtime-8.6.2.tgz",
"integrity": "sha1-gnDhWwEtjTsRDz4yew/YsOB7FoY=",
"version": "8.7.0",
"resolved": "https://registry.npm.taobao.org/builder-util-runtime/download/builder-util-runtime-8.7.0.tgz",
"integrity": "sha1-5IrQBINcgoRmLo6vR6U0aMZujo0=",
"requires": {
"debug": "^4.1.1",
"sax": "^1.2.4"
......@@ -4339,12 +4333,6 @@
"which": "^2.0.1"
}
},
"cross-unzip": {
"version": "0.0.2",
"resolved": "https://registry.npm.taobao.org/cross-unzip/download/cross-unzip-0.0.2.tgz",
"integrity": "sha1-UYO8R6CVWb78+YzEZXlkmZNZNy8=",
"dev": true
},
"crypto-browserify": {
"version": "3.12.0",
"resolved": "https://registry.npm.taobao.org/crypto-browserify/download/crypto-browserify-3.12.0.tgz",
......@@ -5024,22 +5012,24 @@
}
},
"electron-devtools-installer": {
"version": "2.2.4",
"resolved": "https://registry.npm.taobao.org/electron-devtools-installer/download/electron-devtools-installer-2.2.4.tgz?cache=0&sync_timestamp=1586224685521&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Felectron-devtools-installer%2Fdownload%2Felectron-devtools-installer-2.2.4.tgz",
"integrity": "sha1-JhpQM343Eh0zi5ZvB5IutJOah2M=",
"version": "3.0.0",
"resolved": "https://registry.npm.taobao.org/electron-devtools-installer/download/electron-devtools-installer-3.0.0.tgz?cache=0&sync_timestamp=1586224685521&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Felectron-devtools-installer%2Fdownload%2Felectron-devtools-installer-3.0.0.tgz",
"integrity": "sha1-tcQ5cIdG7Tb3sCIOGGV1Z7yiddg=",
"dev": true,
"requires": {
"7zip": "0.0.6",
"cross-unzip": "0.0.2",
"rimraf": "^2.5.2",
"semver": "^5.3.0"
"rimraf": "^3.0.2",
"semver": "^7.2.1",
"unzip-crx": "^0.2.0"
},
"dependencies": {
"semver": {
"version": "5.7.1",
"resolved": "https://registry.npm.taobao.org/semver/download/semver-5.7.1.tgz?cache=0&sync_timestamp=1586534511518&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fsemver%2Fdownload%2Fsemver-5.7.1.tgz",
"integrity": "sha1-qVT5Ma66UI0we78Gnv8MAclhFvc=",
"dev": true
"rimraf": {
"version": "3.0.2",
"resolved": "https://registry.npm.taobao.org/rimraf/download/rimraf-3.0.2.tgz?cache=0&sync_timestamp=1581229865753&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Frimraf%2Fdownload%2Frimraf-3.0.2.tgz",
"integrity": "sha1-8aVAK6YiCtUswSgrrBrjqkn9Bho=",
"dev": true,
"requires": {
"glob": "^7.1.3"
}
}
}
},
......@@ -5157,30 +5147,17 @@
"dev": true
},
"electron-updater": {
"version": "4.2.5",
"resolved": "https://registry.npm.taobao.org/electron-updater/download/electron-updater-4.2.5.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Felectron-updater%2Fdownload%2Felectron-updater-4.2.5.tgz",
"integrity": "sha1-287Y2m+Mb8LcZi8ndhMfWknOAY0=",
"version": "4.3.1",
"resolved": "https://registry.npm.taobao.org/electron-updater/download/electron-updater-4.3.1.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Felectron-updater%2Fdownload%2Felectron-updater-4.3.1.tgz",
"integrity": "sha1-nUhbYmK8Vvz37mKx3Bs7EFo+lqc=",
"requires": {
"@types/semver": "^7.1.0",
"builder-util-runtime": "8.6.2",
"fs-extra": "^8.1.0",
"builder-util-runtime": "8.7.0",
"fs-extra": "^9.0.0",
"js-yaml": "^3.13.1",
"lazy-val": "^1.0.4",
"lodash.isequal": "^4.5.0",
"pako": "^1.0.11",
"semver": "^7.1.3"
},
"dependencies": {
"fs-extra": {
"version": "8.1.0",
"resolved": "https://registry.npm.taobao.org/fs-extra/download/fs-extra-8.1.0.tgz",
"integrity": "sha1-SdQ8RaiM2Wd2aMt74bRu/bjS4cA=",
"requires": {
"graceful-fs": "^4.2.0",
"jsonfile": "^4.0.0",
"universalify": "^0.1.0"
}
}
}
},
"element-ui": {
......@@ -7677,7 +7654,7 @@
},
"semver": {
"version": "5.7.1",
"resolved": "https://registry.npm.taobao.org/semver/download/semver-5.7.1.tgz?cache=0&sync_timestamp=1586534511518&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fsemver%2Fdownload%2Fsemver-5.7.1.tgz",
"resolved": "https://registry.npm.taobao.org/semver/download/semver-5.7.1.tgz",
"integrity": "sha1-qVT5Ma66UI0we78Gnv8MAclhFvc=",
"dev": true
}
......@@ -8864,6 +8841,7 @@
"version": "4.0.0",
"resolved": "https://registry.npm.taobao.org/jsonfile/download/jsonfile-4.0.0.tgz",
"integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=",
"dev": true,
"requires": {
"graceful-fs": "^4.1.6"
}
......@@ -8880,6 +8858,29 @@
"verror": "1.10.0"
}
},
"jszip": {
"version": "3.4.0",
"resolved": "https://registry.npm.taobao.org/jszip/download/jszip-3.4.0.tgz?cache=0&sync_timestamp=1587341448981&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fjszip%2Fdownload%2Fjszip-3.4.0.tgz",
"integrity": "sha1-GmlCH6Xwu5vCIqRryogYL7oHU1A=",
"dev": true,
"requires": {
"lie": "~3.3.0",
"pako": "~1.0.2",
"readable-stream": "~2.3.6",
"set-immediate-shim": "~1.0.1"
},
"dependencies": {
"lie": {
"version": "3.3.0",
"resolved": "https://registry.npm.taobao.org/lie/download/lie-3.3.0.tgz",
"integrity": "sha1-3Pgt7lRfRgdNryAMfBxaCOD0D2o=",
"dev": true,
"requires": {
"immediate": "~3.0.5"
}
}
}
},
"keyv": {
"version": "3.1.0",
"resolved": "https://registry.npm.taobao.org/keyv/download/keyv-3.1.0.tgz",
......@@ -10710,7 +10711,8 @@
"pako": {
"version": "1.0.11",
"resolved": "https://registry.npm.taobao.org/pako/download/pako-1.0.11.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fpako%2Fdownload%2Fpako-1.0.11.tgz",
"integrity": "sha1-bJWZ00DVTf05RjgCUqNXBaa5kr8="
"integrity": "sha1-bJWZ00DVTf05RjgCUqNXBaa5kr8=",
"dev": true
},
"parallel-transform": {
"version": "1.2.0",
......@@ -10978,9 +10980,9 @@
}
},
"portfinder": {
"version": "1.0.25",
"resolved": "https://registry.npm.taobao.org/portfinder/download/portfinder-1.0.25.tgz",
"integrity": "sha1-JU/TN/+6hp9LnTftwpgFnLTTXso=",
"version": "1.0.26",
"resolved": "https://registry.npm.taobao.org/portfinder/download/portfinder-1.0.26.tgz",
"integrity": "sha1-R1ZY1WyjC+1yrH8TeO01C9G2TnA=",
"dev": true,
"requires": {
"async": "^2.6.2",
......@@ -11139,7 +11141,7 @@
},
"posthtml": {
"version": "0.9.2",
"resolved": "https://registry.npm.taobao.org/posthtml/download/posthtml-0.9.2.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fposthtml%2Fdownload%2Fposthtml-0.9.2.tgz",
"resolved": "https://registry.npm.taobao.org/posthtml/download/posthtml-0.9.2.tgz",
"integrity": "sha1-9MBtufZ7Yf0XxOJW5+PZUVv3Jv0=",
"dev": true,
"requires": {
......@@ -12536,6 +12538,12 @@
"integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=",
"dev": true
},
"set-immediate-shim": {
"version": "1.0.1",
"resolved": "https://registry.npm.taobao.org/set-immediate-shim/download/set-immediate-shim-1.0.1.tgz",
"integrity": "sha1-SysbJ+uAip+NzEgaWOXlb1mfP2E=",
"dev": true
},
"set-value": {
"version": "2.0.1",
"resolved": "https://registry.npm.taobao.org/set-value/download/set-value-2.0.1.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fset-value%2Fdownload%2Fset-value-2.0.1.tgz",
......@@ -13314,9 +13322,9 @@
"dev": true
},
"style-loader": {
"version": "1.2.0",
"resolved": "https://registry.npm.taobao.org/style-loader/download/style-loader-1.2.0.tgz?cache=0&sync_timestamp=1587731556074&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fstyle-loader%2Fdownload%2Fstyle-loader-1.2.0.tgz",
"integrity": "sha1-945NScr1AY98A64YhuEnAST+6wo=",
"version": "1.2.1",
"resolved": "https://registry.npm.taobao.org/style-loader/download/style-loader-1.2.1.tgz",
"integrity": "sha1-xcu/vxFw0HbP3YbgEJxbuhFLqho=",
"dev": true,
"requires": {
"loader-utils": "^2.0.0",
......@@ -13526,9 +13534,9 @@
}
},
"svg-baker-runtime": {
"version": "1.4.6",
"resolved": "https://registry.npm.taobao.org/svg-baker-runtime/download/svg-baker-runtime-1.4.6.tgz",
"integrity": "sha1-c0mXNsY2YQEhqeF65s6y6hAj7Gs=",
"version": "1.4.7",
"resolved": "https://registry.npm.taobao.org/svg-baker-runtime/download/svg-baker-runtime-1.4.7.tgz?cache=0&sync_timestamp=1588076122804&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fsvg-baker-runtime%2Fdownload%2Fsvg-baker-runtime-1.4.7.tgz",
"integrity": "sha1-9HIGN/W2IC7vY3jYHx/q0IFfik4=",
"dev": true,
"requires": {
"deepmerge": "1.3.2",
......@@ -13545,9 +13553,9 @@
}
},
"svg-sprite-loader": {
"version": "4.2.6",
"resolved": "https://registry.npm.taobao.org/svg-sprite-loader/download/svg-sprite-loader-4.2.6.tgz?cache=0&sync_timestamp=1587916768179&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fsvg-sprite-loader%2Fdownload%2Fsvg-sprite-loader-4.2.6.tgz",
"integrity": "sha1-n1rG1114voB1iWarxCEKKF7bIHM=",
"version": "4.2.7",
"resolved": "https://registry.npm.taobao.org/svg-sprite-loader/download/svg-sprite-loader-4.2.7.tgz?cache=0&sync_timestamp=1588076872686&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fsvg-sprite-loader%2Fdownload%2Fsvg-sprite-loader-4.2.7.tgz",
"integrity": "sha1-IwQwm0Y2ijTnsnFpNmTZJ2HYuU4=",
"dev": true,
"requires": {
"bluebird": "^3.5.0",
......@@ -13557,7 +13565,7 @@
"html-webpack-plugin": "^3.2.0",
"loader-utils": "^1.1.0",
"svg-baker": "^1.5.0",
"svg-baker-runtime": "^1.4.6",
"svg-baker-runtime": "^1.4.7",
"url-slug": "2.0.0"
},
"dependencies": {
......@@ -14284,7 +14292,8 @@
"universalify": {
"version": "0.1.2",
"resolved": "https://registry.npm.taobao.org/universalify/download/universalify-0.1.2.tgz?cache=0&sync_timestamp=1583530825899&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Funiversalify%2Fdownload%2Funiversalify-0.1.2.tgz",
"integrity": "sha1-tkb2m+OULavOzJ1mOcgNwQXvqmY="
"integrity": "sha1-tkb2m+OULavOzJ1mOcgNwQXvqmY=",
"dev": true
},
"unpipe": {
"version": "1.0.0",
......@@ -14331,6 +14340,17 @@
}
}
},
"unzip-crx": {
"version": "0.2.0",
"resolved": "https://registry.npm.taobao.org/unzip-crx/download/unzip-crx-0.2.0.tgz",
"integrity": "sha1-TAuqi9rHViVnVL7KeEPBPXuFjBg=",
"dev": true,
"requires": {
"jszip": "^3.1.0",
"mkdirp": "^0.5.1",
"yaku": "^0.16.6"
}
},
"upath": {
"version": "1.2.0",
"resolved": "https://registry.npm.taobao.org/upath/download/upath-1.2.0.tgz?cache=0&sync_timestamp=1567457281208&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fupath%2Fdownload%2Fupath-1.2.0.tgz",
......@@ -15955,6 +15975,12 @@
"integrity": "sha1-le+U+F7MgdAHwmThkKEg8KPIVms=",
"dev": true
},
"yaku": {
"version": "0.16.7",
"resolved": "https://registry.npm.taobao.org/yaku/download/yaku-0.16.7.tgz",
"integrity": "sha1-HRlceKqbW/hHnIlblQT9TwhHmE4=",
"dev": true
},
"yallist": {
"version": "3.1.1",
"resolved": "https://registry.npm.taobao.org/yallist/download/yallist-3.1.1.tgz",
......
......@@ -72,7 +72,7 @@
"dependencies": {
"axios": "^0.19.2",
"date-fns": "^2.12.0",
"electron-updater": "^4.2.5",
"electron-updater": "^4.3.1",
"element-ui": "^2.13.1",
"express": "^4.17.1",
"fs-extra": "^9.0.0",
......@@ -138,11 +138,11 @@
"multispinner": "^0.2.1",
"node-loader": "^0.6.0",
"node-sass": "^4.14.0",
"portfinder": "^1.0.25",
"portfinder": "^1.0.26",
"sass-loader": "^8.0.2",
"split2": "^3.1.1",
"style-loader": "^1.2.0",
"svg-sprite-loader": "^4.2.6",
"style-loader": "^1.2.1",
"svg-sprite-loader": "^4.2.7",
"terser-webpack-plugin": "^2.3.6",
"through2-filter": "^3.0.0",
"url-loader": "^4.1.0",
......
......@@ -53,7 +53,6 @@
<script>
import SystemInformation from "./LandingPage/SystemInformation";
import ipcApi from "../utils/ipcRenderer";
import { message } from "@/api/login";
export default {
name: "landing-page",
......@@ -90,8 +89,8 @@ export default {
});
},
StartServer() {
ipcApi.send("statr-server");
ipcApi.on("confirm-start", (event, arg) => {
this.$ipcApi.send("statr-server");
this.$ipcApi.on("confirm-start", (event, arg) => {
console.log(arg);
this.$message({
type: "success",
......@@ -130,8 +129,8 @@ export default {
noLink: true,
message: "此操作会清空本地数据库中的所有数据,是否继续?"
};
ipcApi.send("open-messagebox", data);
ipcApi.on("confirm-message", (event, arg) => {
this.$ipcApi.send("open-messagebox", data);
this.$ipcApi.on("confirm-message", (event, arg) => {
console.log(arg);
if (arg.response === 0) {
this.$db.deleall({ name: "yyy" }).then(res => {
......@@ -147,7 +146,7 @@ export default {
title: "错误",
message: "已经没有数据可以被删除!"
};
ipcApi.send("open-errorbox", errormsg);
this.$ipcApi.send("open-errorbox", errormsg);
}
});
}
......@@ -157,9 +156,9 @@ export default {
switch (data) {
case "one":
const dialog = this.$electron.remote.dialog;
ipcApi.send("check-update");
this.$ipcApi.send("check-update");
console.log("启动检查");
ipcApi.on("UpdateMsg", (event, data) => {
this.$ipcApi.on("UpdateMsg", (event, data) => {
console.log(data);
switch (data.state) {
case -1:
......@@ -189,7 +188,7 @@ export default {
this.$alert("更新下载完成!", "提示", {
confirmButtonText: "确定",
callback: action => {
ipcApi.send("confirm-update");
this.$ipcApi.send("confirm-update");
}
});
break;
......@@ -201,34 +200,34 @@ export default {
break;
case "two":
console.log(111);
ipcApi.send("start-download");
ipcApi.on("confirm-download", (event, arg) => {
this.$ipcApi.send("start-download");
this.$ipcApi.on("confirm-download", (event, arg) => {
if (arg) {
this.dialogVisible = true;
}
});
ipcApi.on("download-progress", (event, arg) => {
this.$ipcApi.on("download-progress", (event, arg) => {
this.percentage = Number(arg);
});
ipcApi.on("download-error", (event, arg) => {
this.$ipcApi.on("download-error", (event, arg) => {
if (arg) {
this.progressStaus = "exception";
this.percentage = 40;
this.colors = "#d81e06";
}
});
ipcApi.on("download-paused", (event, arg) => {
this.$ipcApi.on("download-paused", (event, arg) => {
if (arg) {
this.progressStaus = "warning";
this.$alert("下载由于未知原因被中断!", "提示", {
confirmButtonText: "重试",
callback: action => {
ipcApi.send("satrt-download");
this.$ipcApi.send("satrt-download");
}
});
}
});
ipcApi.on("download-done", (event, age) => {
this.$ipcApi.on("download-done", (event, age) => {
this.filePath = age.filePath;
this.progressStaus = "success";
this.$alert("更新下载完成!", "提示", {
......@@ -249,12 +248,12 @@ export default {
}
},
destroyed() {
ipcApi.remove("confirm-message");
ipcApi.remove("download-done");
ipcApi.remove("download-paused");
ipcApi.remove("confirm-download");
ipcApi.remove("download-progress");
ipcApi.remove("download-error");
this.$ipcApi.remove("confirm-message");
this.$ipcApi.remove("download-done");
this.$ipcApi.remove("download-paused");
this.$ipcApi.remove("confirm-download");
this.$ipcApi.remove("download-progress");
this.$ipcApi.remove("download-error");
}
};
</script>
......
......@@ -35,49 +35,51 @@
</template>
<script>
export default {
data () {
return {
electron: process.versions.electron,
name: this.$route.name,
node: process.versions.node,
path: this.$route.path,
platform: require('os').platform(),
arch:require('os').arch(),
vue: require('vue/package.json').version
}
},
mounted(){
console.log(this.$route)
}
export default {
data() {
return {
electron: process.versions.electron || "浏览器环境",
name: this.$route.name,
node: process.versions.node || "浏览器环境",
path: this.$route.path,
platform: require("os").platform(),
arch: require("os").arch(),
vue: require("vue/package.json").version
};
},
mounted() {
console.log(this.$route);
}
};
</script>
<style scoped>
.title {
color: #888;
font-size: 18px;
font-weight: initial;
letter-spacing: .25px;
margin-top: 10px;
}
.title {
color: #888;
font-size: 18px;
font-weight: initial;
letter-spacing: 0.25px;
margin-top: 10px;
}
.items { margin-top: 8px; }
.items {
margin-top: 8px;
}
.item {
display: flex;
align-items: center;
margin-bottom: 6px;
line-height: 24px;
}
.item {
display: flex;
align-items: center;
margin-bottom: 6px;
line-height: 24px;
}
.item .name {
color: #6a6a6a;
margin-right: 6px;
}
.item .name {
color: #6a6a6a;
margin-right: 6px;
}
.item .value {
color: #35495e;
font-weight: bold;
}
.item .value {
color: #35495e;
font-weight: bold;
}
</style>
......
<!-- -->
<template>
<div class="window-title" v-if="!IsUseSysTitle&&isMac">
<div class="window-title" v-if="!IsUseSysTitle&&isMac&&!IsWeb">
<!-- 软件logo预留位置 -->
<div style="-webkit-app-region: drag;" class="logo">
<svg-icon icon-class="electron-logo"></svg-icon>
......@@ -25,32 +25,35 @@
</template>
<script>
import ipcApi from "@/utils/ipcRenderer";
export default {
data: () => ({
mix: false,
IsUseSysTitle: false,
isMac:process.platform !== 'darwin'
isMac: process.platform !== "darwin",
IsWeb: process.env.IS_WEB
}),
components: {},
created() {
ipcApi.send("IsUseSysTitle");
ipcApi.on("CisUseSysTitle", (event, arg) => (this.IsUseSysTitle = arg));
this.$ipcApi.send("IsUseSysTitle");
this.$ipcApi.on(
"CisUseSysTitle",
(event, arg) => (this.IsUseSysTitle = arg)
);
},
mounted() {},
methods: {
Mini() {
ipcApi.send("windows-mini");
this.$ipcApi.send("windows-mini");
},
MixOrReduction() {
ipcApi.send("window-max");
ipcApi.on("window-confirm", (event, arg) => (this.mix = arg));
this.$ipcApi.send("window-max");
this.$ipcApi.on("window-confirm", (event, arg) => (this.mix = arg));
},
Close() {
ipcApi.send("window-close");
this.$ipcApi.send("window-close");
}
}
};
......@@ -69,7 +72,7 @@ export default {
.title {
text-align: center;
}
.logo{
.logo {
margin-left: 20px;
}
.controls-container {
......
......@@ -3,8 +3,6 @@ import Vue from 'vue'
import App from './App'
import router from './router'
import store from './store'
// 导入数据操作库
import db from './api/operationalData'
// 引用element
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
......@@ -14,14 +12,18 @@ import './error'
import './icons'
import '@/styles/index.scss'
if (!require('../../config').IsUseSysTitle) require('@/styles/custom-title.scss')
if (!process.env.IS_WEB) Vue.use(require('vue-electron'))
if (!process.env.IS_WEB) {
Vue.use(require('vue-electron'))
if (!require('../../config').IsUseSysTitle) {
require('@/styles/custom-title.scss')
}
// 当处于electron状态下才引用db
Vue.prototype.$db = require('./api/operationalData').default
Vue.prototype.$ipcApi = require('./utils/ipcRenderer').default
}
Vue.use(ElementUI)
Vue.prototype.$db = db
Vue.config.productionTip = false
/* eslint-disable no-new */
const vue = new Vue({
......