fix Style

1.x
王良 2024-11-15 16:43:10 +08:00
parent f78b38226c
commit 5751cea1c4
6 changed files with 57 additions and 53 deletions

View File

@ -179,7 +179,7 @@ function createWindow (startHideWindow) {
// preload: path.join(__dirname, 'preload.js'), // preload: path.join(__dirname, 'preload.js'),
// Use pluginOptions.nodeIntegration, leave this alone // Use pluginOptions.nodeIntegration, leave this alone
// See nklayman.github.io/vue-cli-plugin-electron-builder/guide/security.html#node-integration for more info // 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, show: !startHideWindow,
icon: path.join(__static, 'icon.png') icon: path.join(__static, 'icon.png')

View File

@ -43,7 +43,7 @@ class PowerMonitor {
if (event === 'shutdown' && process.platform === 'win32') { if (event === 'shutdown' && process.platform === 'win32') {
if (!this._shutdownCallback) { if (!this._shutdownCallback) {
this._shutdownCallback = async () => { this._shutdownCallback = async () => {
await Promise.all(this._listeners.map((fn) => fn())) await Promise.all(this._listeners.map(fn => fn()))
releaseShutdownBlock() releaseShutdownBlock()
} }
insertWndProcHook(this._shutdownCallback) insertWndProcHook(this._shutdownCallback)
@ -57,7 +57,7 @@ class PowerMonitor {
off (event, listener) { off (event, listener) {
if (event === 'shutdown' && process.platform === 'win32') { if (event === 'shutdown' && process.platform === 'win32') {
this._listeners = this._listeners.filter((fn) => fn !== listener) this._listeners = this._listeners.filter(fn => fn !== listener)
} else { } else {
return _powerMonitor.off(event, listener) return _powerMonitor.off(event, listener)
} }

View File

@ -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> <script>
import createMenus from '@/view/router/menu' import createMenus from '@/view/router/menu'
import zhCN from 'ant-design-vue/lib/locale-provider/zh_CN' import zhCN from 'ant-design-vue/lib/locale-provider/zh_CN'
export default { export default {
name: 'App', name: 'App',
components: { components: {
@ -58,7 +16,7 @@ export default {
}, },
computed: { computed: {
themeClass () { themeClass () {
return 'theme-' + this.config.app.theme return `theme-${this.config.app.theme}`
}, },
theme () { theme () {
return this.config.app.theme return this.config.app.theme
@ -67,7 +25,7 @@ export default {
created () { created () {
this.menus = createMenus(this) this.menus = createMenus(this)
this.config = this.$global.config this.config = this.$global.config
this.$api.info.get().then(ret => { this.$api.info.get().then((ret) => {
this.info = ret this.info = ret
}) })
}, },
@ -86,6 +44,49 @@ export default {
} }
</script> </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"> <style lang="scss">
body{ body{
height: 100%; height: 100%;

View File

@ -1,10 +1,11 @@
import lodash from 'lodash'
import { ipcRenderer, shell } from 'electron' import { ipcRenderer, shell } from 'electron'
import lodash from 'lodash'
let inited = false let inited = false
let apiObj = null let apiObj = null
export function apiInit (app) { export function apiInit (app) {
const invoke = (api, args) => { const invoke = (api, args) => {
return ipcRenderer.invoke('apiInvoke', [api, args]).catch(e => { return ipcRenderer.invoke('apiInvoke', [api, args]).catch((e) => {
app.$notification.error({ app.$notification.error({
message: 'Api invoke error', message: 'Api invoke error',
description: e.message description: e.message
@ -42,7 +43,7 @@ export function apiInit (app) {
} }
if (!inited) { if (!inited) {
return invoke('getApiList').then(list => { return invoke('getApiList').then((list) => {
inited = true inited = true
for (const item of list) { for (const item of list) {
bindApi(item) bindApi(item)
@ -52,7 +53,7 @@ export function apiInit (app) {
}) })
} }
return new Promise(resolve => { return new Promise((resolve) => {
resolve(apiObj) resolve(apiObj)
}) })
} }

View File

@ -1,6 +1,7 @@
import { apiInit, useApi } from './api'
import modules from '../bridge/front' import modules from '../bridge/front'
import { apiInit, useApi } from './api'
import status from './status' import status from './status'
export default { export default {
initApi: apiInit, initApi: apiInit,
async initPre (Vue, api) { async initPre (Vue, api) {

View File

@ -1,5 +1,6 @@
import lodash from 'lodash' import lodash from 'lodash'
import Vue from 'vue' import Vue from 'vue'
const status = { const status = {
server: { server: {
enabled: false enabled: false