mirror of https://gitee.com/godoos/godoos.git
13 changed files with 359 additions and 3801 deletions
File diff suppressed because it is too large
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,167 +1,175 @@ |
|||||
<template> |
<template> |
||||
<div class="s-option"> |
<div class="s-option"> |
||||
<div class="s-option-inner"> |
<div class="s-option-inner"> |
||||
<div class="s-option-button" @click.stop="($ev) => handleClick(0, $ev)" v-glowing> |
<div |
||||
<div class="s-option-button_img"> |
v-if="sys.getConfig('userType') == 'member'" |
||||
<svg class="icon" aria-hidden="true"> |
class="s-option-button" |
||||
<use xlink:href="#icon-setup"></use> |
@click.stop="handleLogout" |
||||
</svg> |
v-glowing |
||||
</div> |
> |
||||
<div class="s-option-button_title"> |
<div class="s-option-button_img"> |
||||
{{ t("startMenu.power") }} |
<svg |
||||
</div> |
class="icon" |
||||
</div> |
aria-hidden="true" |
||||
<div class="s-option-button" @click.stop="($ev) => handleClick(1, $ev)" v-glowing> |
> |
||||
<div class="s-option-button_img"> |
<use xlink:href="#icon-logout"></use> |
||||
<svg class="icon" aria-hidden="true"> |
</svg> |
||||
<use xlink:href="#icon-setting"></use> |
</div> |
||||
</svg> |
<div class="s-option-button_title"> |
||||
</div> |
{{ t("startMenu.logout") }} |
||||
<div class="s-option-button_title"> |
</div> |
||||
{{ t("setting") }} |
</div> |
||||
</div> |
<div |
||||
</div> |
class="s-option-button" |
||||
</div> |
@click.stop="handleRecover" |
||||
</div> |
v-glowing |
||||
|
> |
||||
|
<div class="s-option-button_img"> |
||||
|
<svg |
||||
|
class="icon" |
||||
|
aria-hidden="true" |
||||
|
> |
||||
|
<use xlink:href="#icon-huifu"></use> |
||||
|
</svg> |
||||
|
</div> |
||||
|
<div class="s-option-button_title"> |
||||
|
{{ t("startMenu.recover") }} |
||||
|
</div> |
||||
|
</div> |
||||
|
<div |
||||
|
class="s-option-button" |
||||
|
@click.stop="($ev) => handleClick(1, $ev)" |
||||
|
v-glowing |
||||
|
> |
||||
|
<div class="s-option-button_img"> |
||||
|
<svg |
||||
|
class="icon" |
||||
|
aria-hidden="true" |
||||
|
> |
||||
|
<use xlink:href="#icon-setting"></use> |
||||
|
</svg> |
||||
|
</div> |
||||
|
<div class="s-option-button_title"> |
||||
|
{{ t("setting") }} |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
</template> |
</template> |
||||
|
|
||||
<script lang="ts" setup> |
<script lang="ts" setup> |
||||
import { emitEvent } from "@/system/event"; |
import { BrowserWindow, Dialog, t, useSystem } from "@/system"; |
||||
import { useSystem, Dialog, t, Menu, BrowserWindow } from "@/system"; |
import { fetchGet } from "@/system/config"; |
||||
import { vGlowing } from "@/util/glowingBorder"; |
import { emitEvent } from "@/system/event"; |
||||
import { fetchGet } from "@/system/config"; |
import { vGlowing } from "@/util/glowingBorder"; |
||||
import { RestartApp } from "@/util/goutil"; |
import { RestartApp } from "@/util/goutil"; |
||||
|
|
||||
|
const sys = useSystem(); |
||||
|
|
||||
const sys = useSystem(); |
function handleLogout() { |
||||
function handleClick(key: number, ev: MouseEvent) { |
const userInfo: any = sys.getConfig("userInfo"); |
||||
switch (key) { |
fetchGet(userInfo.url + "/member/loginout").then(() => { |
||||
case 0: |
RestartApp(); |
||||
const actions = [ |
}); |
||||
{ |
} |
||||
label: t("startMenu.shutdown"), |
|
||||
click: () => { |
|
||||
emitEvent("system.shutdown"); |
|
||||
}, |
|
||||
}, |
|
||||
{ |
|
||||
label: t("startMenu.recover"), |
|
||||
click: () => { |
|
||||
Dialog.showMessageBox({ |
|
||||
title: t("startMenu.recover"), |
|
||||
message: t("is.recover"), |
|
||||
buttons: [t("startMenu.recover"), t("cancel")], |
|
||||
}).then((res) => { |
|
||||
//console.log(res) |
|
||||
if (res.response === -1) { |
|
||||
emitEvent("system.recover"); |
|
||||
} |
|
||||
}); |
|
||||
}, |
|
||||
}, |
|
||||
] |
|
||||
if(sys.getConfig('userType') == 'member'){ |
|
||||
actions.push({ |
|
||||
label: '退出', |
|
||||
click: () => { |
|
||||
const userInfo:any = sys.getConfig('userInfo') |
|
||||
fetchGet(userInfo.url + "/member/loginout").then(() => { |
|
||||
RestartApp() |
|
||||
}) |
|
||||
}, |
|
||||
}) |
|
||||
} |
|
||||
Menu.buildFromTemplate(actions).popup(ev); |
|
||||
|
|
||||
break; |
function handleRecover() { |
||||
case 1: { |
Dialog.showMessageBox({ |
||||
emitEvent("startMenu.set.click", { |
title: t("startMenu.recover"), |
||||
mouse: ev, |
message: t("is.recover"), |
||||
}); |
buttons: [t("startMenu.recover"), t("cancel")], |
||||
//console.log(sys._rootState.windowMap) |
}).then((res) => { |
||||
const winopt = sys._rootState.windowMap["Menulist"].get("setting"); |
if (res.response === -1) { |
||||
|
emitEvent("system.recover"); |
||||
|
} |
||||
|
}); |
||||
|
} |
||||
|
|
||||
if (winopt) { |
function handleClick(key: number, ev: MouseEvent) { |
||||
if (winopt._hasShow) { |
if (key === 1) { |
||||
return; |
emitEvent("startMenu.set.click", { |
||||
} else { |
mouse: ev, |
||||
winopt._hasShow = true; |
}); |
||||
const win = new BrowserWindow(winopt.window); |
const winopt = sys._rootState.windowMap["Menulist"].get("setting"); |
||||
win.show(); |
|
||||
win.on("close", () => { |
|
||||
winopt._hasShow = false; |
|
||||
}); |
|
||||
} |
|
||||
} |
|
||||
break; |
|
||||
} |
|
||||
|
|
||||
default: |
if (winopt) { |
||||
break; |
if (winopt._hasShow) { |
||||
} |
return; |
||||
} |
} else { |
||||
|
winopt._hasShow = true; |
||||
|
const win = new BrowserWindow(winopt.window); |
||||
|
win.show(); |
||||
|
win.on("close", () => { |
||||
|
winopt._hasShow = false; |
||||
|
}); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
||||
</script> |
</script> |
||||
<style lang="scss" scoped> |
<style lang="scss" scoped> |
||||
.s-option { |
.s-option { |
||||
position: relative; |
position: relative; |
||||
width: var(--startmenu-icon-size); |
width: var(--startmenu-icon-size); |
||||
height: 100%; |
height: 100%; |
||||
z-index: 40; |
z-index: 40; |
||||
user-select: none; |
user-select: none; |
||||
|
|
||||
.s-option-inner { |
.s-option-inner { |
||||
position: absolute; |
position: absolute; |
||||
height: 100%; |
height: 100%; |
||||
width: var(--startmenu-icon-size); |
width: var(--startmenu-icon-size); |
||||
background-color: #f5f5f5; |
background-color: #f5f5f5; |
||||
// background-color: var(--theme-main-color-opacity); |
// background-color: var(--theme-main-color-opacity); |
||||
|
|
||||
transition: width 0.1s ease-in-out, box-shadow 0.1s ease-in-out; |
transition: width 0.1s ease-in-out, box-shadow 0.1s ease-in-out; |
||||
transition-delay: 0s; |
transition-delay: 0s; |
||||
display: flex; |
display: flex; |
||||
flex-direction: column-reverse; |
flex-direction: column-reverse; |
||||
overflow: hidden; |
overflow: hidden; |
||||
|
|
||||
.s-option-button { |
.s-option-button { |
||||
height: var(--start-option-size); |
height: var(--start-option-size); |
||||
width: var(--startmenu-icon-size-hover); |
width: var(--startmenu-icon-size-hover); |
||||
display: flex; |
display: flex; |
||||
justify-content: center; |
justify-content: center; |
||||
align-items: center; |
align-items: center; |
||||
position: relative; |
position: relative; |
||||
z-index: 1; |
z-index: 1; |
||||
|
|
||||
.s-option-button_img { |
.s-option-button_img { |
||||
height: var(--start-option-size); |
height: var(--start-option-size); |
||||
width: var(--start-option-size); |
width: var(--start-option-size); |
||||
display: flex; |
display: flex; |
||||
justify-content: center; |
justify-content: center; |
||||
align-items: center; |
align-items: center; |
||||
|
|
||||
svg { |
svg { |
||||
width: 40%; |
width: 40%; |
||||
} |
} |
||||
} |
} |
||||
|
|
||||
.s-option-button_title { |
.s-option-button_title { |
||||
width: 100%; |
width: 100%; |
||||
height: var(--start-option-size); |
height: var(--start-option-size); |
||||
display: flex; |
display: flex; |
||||
justify-content: flex-start; |
justify-content: flex-start; |
||||
align-items: center; |
align-items: center; |
||||
opacity: 0.8; |
opacity: 0.8; |
||||
} |
} |
||||
} |
} |
||||
|
|
||||
.s-option-button:hover { |
.s-option-button:hover { |
||||
// background-color: var(--color-gray-hover); |
// background-color: var(--color-gray-hover); |
||||
} |
} |
||||
} |
} |
||||
} |
} |
||||
|
|
||||
.s-option:hover { |
.s-option:hover { |
||||
.s-option-inner { |
.s-option-inner { |
||||
transition-delay: 0.5s; |
transition-delay: 0.5s; |
||||
width: var(--startmenu-icon-size-hover); |
width: var(--startmenu-icon-size-hover); |
||||
box-shadow: 10px 0px 20px 0px rgba(0, 0, 0, 0.216); |
box-shadow: 10px 0px 20px 0px rgba(0, 0, 0, 0.216); |
||||
} |
} |
||||
} |
} |
||||
</style> |
</style> |
||||
|
Loading…
Reference in new issue