Compare commits
4 Commits
b61840fa9f
...
56110de415
Author | SHA1 | Date | |
---|---|---|---|
56110de415 | |||
1becac5894 | |||
cfce325111 | |||
7001633625 |
31
src/App.vue
31
src/App.vue
@ -5,12 +5,11 @@
|
||||
<transition v-if="isLock && $route.name !== 'login'" name="slide-up">
|
||||
<LockScreen />
|
||||
</transition>
|
||||
<global-websocket :uri="'/api/websocket/' + userInfo.id" @rollback="rollback" />
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { computed, onMounted, onUnmounted, defineAsyncComponent, h } from 'vue';
|
||||
import { ConfigProvider, notification } from 'ant-design-vue';
|
||||
import { computed, onMounted, onUnmounted ,h } from 'vue';
|
||||
import { ConfigProvider } from 'ant-design-vue';
|
||||
import { LockScreen } from '@/components/Lockscreen';
|
||||
import { useLockscreenStore } from '@/store/modules/lockscreen';
|
||||
import { useRoute } from 'vue-router';
|
||||
@ -28,15 +27,12 @@
|
||||
const route = useRoute();
|
||||
const locale = zhCN;
|
||||
const useLockscreen = useLockscreenStore();
|
||||
const userStore = useUserStore();
|
||||
const userInfo: object = userStore.getUserInfo || {};
|
||||
const isLock = computed(() => useLockscreen.isLock);
|
||||
const lockTime = computed(() => useLockscreen.lockTime);
|
||||
const { getIsWaterMark } = useProjectSetting();
|
||||
const GlobalWebsocket = defineAsyncComponent(() => import('@/components/Websocket/index.vue'));
|
||||
const {getIsWaterMark} = useProjectSetting();
|
||||
let timer;
|
||||
|
||||
/**
|
||||
/**
|
||||
* 定义锁屏
|
||||
*/
|
||||
const timekeeping = () => {
|
||||
@ -56,26 +52,15 @@
|
||||
}
|
||||
}, 1000);
|
||||
};
|
||||
|
||||
/**
|
||||
* 通知回调
|
||||
*/
|
||||
const rollback = (msg) => {
|
||||
notification.info({
|
||||
message: '通知',
|
||||
description: () => h('div', msg),
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
/**
|
||||
* 钩子函数
|
||||
*/
|
||||
onMounted(() => {
|
||||
if (getIsWaterMark.value) {
|
||||
if(getIsWaterMark.value) {
|
||||
const waterText = import.meta.env.VITE_GLOB_APP_TITLE;
|
||||
Watermark.set(waterText);
|
||||
Watermark.set(waterText)
|
||||
} else {
|
||||
Watermark.del();
|
||||
Watermark.del()
|
||||
}
|
||||
// document.addEventListener('mousedown', timekeeping);
|
||||
});
|
||||
|
@ -49,11 +49,13 @@
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
<global-websocket :uri="'/api/websocket/'+userInfo.id" @rollback="rollback" />
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { ref, unref, reactive, computed, provide, h, watchEffect, watch } from 'vue';
|
||||
import { ref, unref, reactive, computed, provide, h, watchEffect, watch,defineAsyncComponent } from 'vue';
|
||||
import { useAsyncRouteStore } from '@/store/modules/asyncRoute';
|
||||
import {notification } from 'ant-design-vue';
|
||||
import { generatorMenu } from '@/utils/index';
|
||||
import { useRouter } from 'vue-router';
|
||||
import { TabsView } from './components/TagsView';
|
||||
@ -66,12 +68,17 @@
|
||||
import { useProjectSettingStore } from '@/store/modules/projectSetting';
|
||||
import type { RouteContextProps } from '@ant-design-vue/pro-layout';
|
||||
import { useFullscreen } from '@vueuse/core';
|
||||
import { useUserStore } from '@/store/modules/user';
|
||||
import ProjectSetting from './components/Header/ProjectSetting.vue';
|
||||
import { SettingOutlined } from '@ant-design/icons-vue';
|
||||
import { initWebSocket } from '@/components/Websocket/index';
|
||||
const GlobalWebsocket = defineAsyncComponent(() => import('@/components/Websocket/index.vue'));
|
||||
|
||||
// 当前路由
|
||||
const router = useRouter();
|
||||
const settingStore = useProjectSettingStore();
|
||||
const userStore = useUserStore();
|
||||
const userInfo: object = userStore.getUserInfo || {};
|
||||
const {
|
||||
getLayout,
|
||||
getNavTheme,
|
||||
@ -166,6 +173,13 @@
|
||||
const { openDrawer } = drawerSetting.value;
|
||||
openDrawer();
|
||||
}
|
||||
const rollback = (msg)=>{
|
||||
notification.info({
|
||||
message: '通知',
|
||||
description: () =>
|
||||
h('div', msg),
|
||||
});
|
||||
}
|
||||
</script>
|
||||
<style lang="less" scoped>
|
||||
.ant-admin-layout {
|
||||
|
@ -173,7 +173,7 @@
|
||||
title: '提示',
|
||||
content: '确定标记为已读?',
|
||||
onOk: async () => {
|
||||
id ? await setRead(id) : await setRead(selectionData.value);
|
||||
id ? await setRead({ idList: [id] }) : await setRead({idList:selectionData.value});
|
||||
message.success('标记成功');
|
||||
reloadTable();
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user