fix Style
parent
f78b38226c
commit
5751cea1c4
|
@ -179,7 +179,7 @@ function createWindow (startHideWindow) {
|
|||
// preload: path.join(__dirname, 'preload.js'),
|
||||
// Use pluginOptions.nodeIntegration, leave this alone
|
||||
// See nklayman.github.io/vue-cli-plugin-electron-builder/guide/security.html#node-integration for more info
|
||||
nodeIntegration: true// process.env.ELECTRON_NODE_INTEGRATION
|
||||
nodeIntegration: true // process.env.ELECTRON_NODE_INTEGRATION
|
||||
},
|
||||
show: !startHideWindow,
|
||||
icon: path.join(__static, 'icon.png')
|
||||
|
|
|
@ -43,7 +43,7 @@ class PowerMonitor {
|
|||
if (event === 'shutdown' && process.platform === 'win32') {
|
||||
if (!this._shutdownCallback) {
|
||||
this._shutdownCallback = async () => {
|
||||
await Promise.all(this._listeners.map((fn) => fn()))
|
||||
await Promise.all(this._listeners.map(fn => fn()))
|
||||
releaseShutdownBlock()
|
||||
}
|
||||
insertWndProcHook(this._shutdownCallback)
|
||||
|
@ -57,7 +57,7 @@ class PowerMonitor {
|
|||
|
||||
off (event, listener) {
|
||||
if (event === 'shutdown' && process.platform === 'win32') {
|
||||
this._listeners = this._listeners.filter((fn) => fn !== listener)
|
||||
this._listeners = this._listeners.filter(fn => fn !== listener)
|
||||
} else {
|
||||
return _powerMonitor.off(event, listener)
|
||||
}
|
||||
|
|
|
@ -1,49 +1,7 @@
|
|||
<template>
|
||||
<a-config-provider :locale="locale">
|
||||
<div class="ds_layout" :class="themeClass">
|
||||
<a-layout>
|
||||
<a-layout-sider :theme="theme">
|
||||
<div class="logo"></div>
|
||||
<div class="aside">
|
||||
<a-menu
|
||||
mode="inline"
|
||||
:defaultSelectedKeys="[$route.fullPath]"
|
||||
:defaultOpenKeys="['/plugin']"
|
||||
>
|
||||
<template v-for="(item) of menus">
|
||||
<a-sub-menu v-if="item.children && item.children.length>0" :key="item.path" @titleClick="titleClick(item)">
|
||||
<span slot="title"><a-icon :type="item.icon?item.icon:'file'"/><span>{{item.title}}</span></span>
|
||||
<a-menu-item v-for="(sub) of item.children" :key="sub.path" @click="menuClick(sub)">
|
||||
<a-icon :type="sub.icon?sub.icon:'file'"/> {{ sub.title }}
|
||||
</a-menu-item>
|
||||
</a-sub-menu>
|
||||
<a-menu-item v-else :key="item.path" @click="menuClick(item)">
|
||||
<a-icon :type="item.icon?item.icon:'file'"/>
|
||||
<span class="nav-text">{{ item.title }}</span>
|
||||
</a-menu-item>
|
||||
</template>
|
||||
</a-menu>
|
||||
</div>
|
||||
</a-layout-sider>
|
||||
<a-layout>
|
||||
<!-- <a-layout-header>Header</a-layout-header>-->
|
||||
<a-layout-content>
|
||||
<router-view></router-view>
|
||||
</a-layout-content>
|
||||
<a-layout-footer>
|
||||
<div class="footer">
|
||||
©2020-2024 docmirror.cn by Greper, WangLiang <span>{{info.version}}</span>
|
||||
</div>
|
||||
</a-layout-footer>
|
||||
</a-layout>
|
||||
</a-layout>
|
||||
</div>
|
||||
</a-config-provider>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import createMenus from '@/view/router/menu'
|
||||
import zhCN from 'ant-design-vue/lib/locale-provider/zh_CN'
|
||||
|
||||
export default {
|
||||
name: 'App',
|
||||
components: {
|
||||
|
@ -58,7 +16,7 @@ export default {
|
|||
},
|
||||
computed: {
|
||||
themeClass () {
|
||||
return 'theme-' + this.config.app.theme
|
||||
return `theme-${this.config.app.theme}`
|
||||
},
|
||||
theme () {
|
||||
return this.config.app.theme
|
||||
|
@ -67,7 +25,7 @@ export default {
|
|||
created () {
|
||||
this.menus = createMenus(this)
|
||||
this.config = this.$global.config
|
||||
this.$api.info.get().then(ret => {
|
||||
this.$api.info.get().then((ret) => {
|
||||
this.info = ret
|
||||
})
|
||||
},
|
||||
|
@ -86,6 +44,49 @@ export default {
|
|||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<a-config-provider :locale="locale">
|
||||
<div class="ds_layout" :class="themeClass">
|
||||
<a-layout>
|
||||
<a-layout-sider :theme="theme">
|
||||
<div class="logo" />
|
||||
<div class="aside">
|
||||
<a-menu
|
||||
mode="inline"
|
||||
:default-selected-keys="[$route.fullPath]"
|
||||
:default-open-keys="['/plugin']"
|
||||
>
|
||||
<template v-for="(item) of menus">
|
||||
<a-sub-menu v-if="item.children && item.children.length > 0" :key="item.path" @titleClick="titleClick(item)">
|
||||
<span slot="title"><a-icon :type="item.icon ? item.icon : 'file'" /><span>{{ item.title }}</span></span>
|
||||
<a-menu-item v-for="(sub) of item.children" :key="sub.path" @click="menuClick(sub)">
|
||||
<a-icon :type="sub.icon ? sub.icon : 'file'" /> {{ sub.title }}
|
||||
</a-menu-item>
|
||||
</a-sub-menu>
|
||||
<a-menu-item v-else :key="item.path" @click="menuClick(item)">
|
||||
<a-icon :type="item.icon ? item.icon : 'file'" />
|
||||
<span class="nav-text">{{ item.title }}</span>
|
||||
</a-menu-item>
|
||||
</template>
|
||||
</a-menu>
|
||||
</div>
|
||||
</a-layout-sider>
|
||||
<a-layout>
|
||||
<!-- <a-layout-header>Header</a-layout-header> -->
|
||||
<a-layout-content>
|
||||
<router-view />
|
||||
</a-layout-content>
|
||||
<a-layout-footer>
|
||||
<div class="footer">
|
||||
©2020-2024 docmirror.cn by Greper, WangLiang <span>{{ info.version }}</span>
|
||||
</div>
|
||||
</a-layout-footer>
|
||||
</a-layout>
|
||||
</a-layout>
|
||||
</div>
|
||||
</a-config-provider>
|
||||
</template>
|
||||
|
||||
<style lang="scss">
|
||||
body{
|
||||
height: 100%;
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
import lodash from 'lodash'
|
||||
import { ipcRenderer, shell } from 'electron'
|
||||
import lodash from 'lodash'
|
||||
|
||||
let inited = false
|
||||
let apiObj = null
|
||||
export function apiInit (app) {
|
||||
const invoke = (api, args) => {
|
||||
return ipcRenderer.invoke('apiInvoke', [api, args]).catch(e => {
|
||||
return ipcRenderer.invoke('apiInvoke', [api, args]).catch((e) => {
|
||||
app.$notification.error({
|
||||
message: 'Api invoke error',
|
||||
description: e.message
|
||||
|
@ -42,7 +43,7 @@ export function apiInit (app) {
|
|||
}
|
||||
|
||||
if (!inited) {
|
||||
return invoke('getApiList').then(list => {
|
||||
return invoke('getApiList').then((list) => {
|
||||
inited = true
|
||||
for (const item of list) {
|
||||
bindApi(item)
|
||||
|
@ -52,7 +53,7 @@ export function apiInit (app) {
|
|||
})
|
||||
}
|
||||
|
||||
return new Promise(resolve => {
|
||||
return new Promise((resolve) => {
|
||||
resolve(apiObj)
|
||||
})
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import { apiInit, useApi } from './api'
|
||||
import modules from '../bridge/front'
|
||||
import { apiInit, useApi } from './api'
|
||||
import status from './status'
|
||||
|
||||
export default {
|
||||
initApi: apiInit,
|
||||
async initPre (Vue, api) {
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import lodash from 'lodash'
|
||||
import Vue from 'vue'
|
||||
|
||||
const status = {
|
||||
server: {
|
||||
enabled: false
|
||||
|
|
Loading…
Reference in New Issue