Compare commits
No commits in common. "7b09c8ec815ebcaa03c7d87c5e73141048240d3d" and "8ed27fc9255fa84e76e11671b47d9d32a53a3706" have entirely different histories.
7b09c8ec81
...
8ed27fc925
|
@ -1,61 +0,0 @@
|
|||
<template>
|
||||
<div class="header-tool flex">
|
||||
<span title="最小化" @click="minimizeWindow"><i class="iconfont icon-zuixiaohua"></i></span>
|
||||
<span v-if="isHasMax" :title="isMaxSize ? '向下还原' : '最大化'" @click="maximizeWindow">
|
||||
<i class="iconfont" :class="isMaxSize ? 'icon-zuidahua' : 'icon-window-max_line'"></i></span>
|
||||
<span class="close" title="关闭" @click="closeWindow"><i class="iconfont icon-close"></i></span>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref } from 'vue'
|
||||
const { ipcRenderer } = window.electron || {}
|
||||
|
||||
const props = defineProps({
|
||||
isHasMax: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
}
|
||||
})
|
||||
const isMaxSize = ref(false)
|
||||
|
||||
// 最小化
|
||||
const minimizeWindow = () => {
|
||||
ipcRenderer?.send('minimize-window')
|
||||
}
|
||||
//最大化
|
||||
const maximizeWindow = () => {
|
||||
ipcRenderer?.send('maximize-window')
|
||||
isMaxSize.value = !isMaxSize.value
|
||||
}
|
||||
//关闭
|
||||
const closeWindow = () => {
|
||||
ipcRenderer?.send('close-window')
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.header-tool {
|
||||
-webkit-app-region: no-drag;
|
||||
|
||||
span {
|
||||
border-radius: 3px;
|
||||
cursor: pointer;
|
||||
padding: 2px 10px;
|
||||
|
||||
&:hover {
|
||||
background-color: #c4c4c4;
|
||||
}
|
||||
}
|
||||
|
||||
.close {
|
||||
&:hover {
|
||||
background-color: #fb4a3e;
|
||||
|
||||
.iconfont {
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -14,7 +14,12 @@
|
|||
</div>
|
||||
|
||||
<div class="right-section flex">
|
||||
<WindowTools/>
|
||||
<div class="header-tool flex">
|
||||
<span title="最小化" @click="minimizeWindow"><i class="iconfont"></i></span>
|
||||
<span :title="isMaxSize ? '向下还原' : '最大化'" @click="maximizeWindow"><i class="iconfont">{{ isMaxSize ? '' :
|
||||
'' }}</i></span>
|
||||
<span class="close" title="关闭" @click="closeWindow"><i class="iconfont"></i></span>
|
||||
</div>
|
||||
<div class="user flex">
|
||||
<div class="avatar-container">
|
||||
<el-dropdown @command="handleCommand" class="right-menu-item hover-effect" trigger="click">
|
||||
|
@ -41,11 +46,11 @@
|
|||
import { ref, watch } from 'vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
import { ElMessageBox } from 'element-plus'
|
||||
import WindowTools from '@/components/window-tools/index.vue'
|
||||
import useUserStore from '@/store/modules/user'
|
||||
|
||||
|
||||
const userStore = useUserStore()
|
||||
const { ipcRenderer } = window.electron || {}
|
||||
const isMaxSize = ref(false)
|
||||
const router = useRouter()
|
||||
const currentRoute = ref('')
|
||||
|
||||
|
@ -76,6 +81,19 @@ watch(
|
|||
{ immediate: true }
|
||||
)
|
||||
|
||||
// 最小化
|
||||
const minimizeWindow = () => {
|
||||
ipcRenderer.send('minimize-window')
|
||||
}
|
||||
//最大化
|
||||
const maximizeWindow = () => {
|
||||
ipcRenderer?.send('maximize-window')
|
||||
isMaxSize.value = !isMaxSize.value
|
||||
}
|
||||
//关闭
|
||||
const closeWindow = () => {
|
||||
ipcRenderer.send('close-window')
|
||||
}
|
||||
|
||||
const changePage = (url) => {
|
||||
router.push(url)
|
||||
|
@ -100,9 +118,11 @@ function logout() {
|
|||
type: 'warning'
|
||||
}).then(() => {
|
||||
userStore.logOut().then(() => {
|
||||
// location.href = '/index#/login';
|
||||
router.replace('/login')
|
||||
}).catch(()=>{
|
||||
router.replace('/login')
|
||||
// location.href = '/index#/login';
|
||||
})
|
||||
}).catch(() => { });
|
||||
}
|
||||
|
@ -193,6 +213,25 @@ watch(()=> userStore.avatar,() => {
|
|||
padding-bottom: 5px;
|
||||
flex-direction: column;
|
||||
|
||||
.header-tool {
|
||||
-webkit-app-region: no-drag;
|
||||
span {
|
||||
border-radius: 3px;
|
||||
cursor: pointer;
|
||||
padding: 2px 10px;
|
||||
&:hover {
|
||||
background-color: #c4c4c4;
|
||||
}
|
||||
}
|
||||
.close{
|
||||
&:hover{
|
||||
background-color: #fb4a3e;
|
||||
.iconfont{
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.user {
|
||||
.user-info {
|
||||
|
|
|
@ -7,7 +7,10 @@
|
|||
<img class="welcome-img" :src="leftBg2" />
|
||||
</div>
|
||||
<div class="box-item login">
|
||||
<WindowTools :isHasMax="false"/>
|
||||
<div class="header-tool flex">
|
||||
<span @click="minimizeWindow" title="最小化"><i class="iconfont"></i></span>
|
||||
<span @click="closeWindow" title="关闭"><i class="iconfont"></i></span>
|
||||
</div>
|
||||
<div class="login-title">账号登录</div>
|
||||
<el-form ref="formRef" class="login-form" :model="loginForm" :rules="rules" size="large">
|
||||
<el-form-item prop="username">
|
||||
|
@ -41,10 +44,8 @@ import Cookies from 'js-cookie'
|
|||
import { encrypt, decrypt } from '@/utils/jsencrypt'
|
||||
import useUserStore from '@/store/modules/user'
|
||||
import leftBg2 from '@/assets/images/login/left-bg2.png'
|
||||
import WindowTools from '@/components/window-tools/index.vue'
|
||||
import SelectSubject from '@/components/select-subject/index.vue'
|
||||
|
||||
|
||||
const { ipcRenderer } = window.electron || {}
|
||||
const formRef = ref()
|
||||
const userStore = useUserStore()
|
||||
|
|
Loading…
Reference in New Issue