|
|
@@ -6,12 +6,14 @@ import {
|
|
|
LogoutOutlined,
|
|
|
HistoryOutlined,
|
|
|
StarOutlined,
|
|
|
+ ExclamationCircleOutlined,
|
|
|
} from '@ant-design/icons-vue';
|
|
|
-import { onMounted, ref, watch } from 'vue';
|
|
|
+import { createVNode, onMounted, ref, watch } from 'vue';
|
|
|
import { useRoute, RouterLink } from "vue-router";
|
|
|
import _ from "lodash";
|
|
|
import { useAuthStore } from '@/stores/auth.store';
|
|
|
import { routeToLogin } from "@/router";
|
|
|
+import { Modal } from 'ant-design-vue';
|
|
|
|
|
|
const selectedKeys = ref<string[]>(['/']);
|
|
|
const openKeys = ref<string[]>(['/']);
|
|
|
@@ -54,6 +56,19 @@ function logout(e: MouseEvent) {
|
|
|
routeToLogin();
|
|
|
e.stopPropagation();
|
|
|
}
|
|
|
+
|
|
|
+function logoutConfirm(e: MouseEvent) {
|
|
|
+ Modal.confirm({
|
|
|
+ title: '正在退出系统,退出请点击确认。',
|
|
|
+ icon: createVNode(ExclamationCircleOutlined),
|
|
|
+ okText: '确认',
|
|
|
+ okType: 'danger',
|
|
|
+ cancelText: '取消',
|
|
|
+ onOk() {
|
|
|
+ logout(e);
|
|
|
+ }
|
|
|
+ });
|
|
|
+}
|
|
|
</script>
|
|
|
|
|
|
<template>
|
|
|
@@ -73,10 +88,6 @@ function logout(e: MouseEvent) {
|
|
|
<a-menu-item key="/report/template">
|
|
|
<RouterLink to="/report/template">模板管理</RouterLink>
|
|
|
</a-menu-item>
|
|
|
- <!-- <a-menu-item key="/report/create" @click="onCreateReport"> -->
|
|
|
- <!-- <RouterLink to="/report/create">创建报告</RouterLink> -->
|
|
|
- <!-- 创建报告 -->
|
|
|
- <!-- </a-menu-item> -->
|
|
|
</a-sub-menu>
|
|
|
<a-sub-menu key="/search">
|
|
|
<template #icon>
|
|
|
@@ -111,7 +122,7 @@ function logout(e: MouseEvent) {
|
|
|
</template>
|
|
|
<RouterLink to="/favorite">我的收藏</RouterLink>
|
|
|
</a-menu-item>
|
|
|
- <a-menu-item key="/logout" @click="logout">
|
|
|
+ <a-menu-item key="/logout" @click="logoutConfirm">
|
|
|
<template #icon>
|
|
|
<logout-outlined />
|
|
|
</template>
|