You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

49 lines
1.3 KiB
Vue

<template>
<el-config-provider :locale="appStore.locale" :size="appStore.size">
<router-view />
</el-config-provider>
<PrintView ref="printView" />
<ai-assistant ref="aiAssistantRef" :isLeft="false" />
<div class="floatIcon" @click="openAiAssistantMenu">
<svg-icon class-name="search-icon" icon-class="Ai" />
</div>
</template>
<script setup lang="ts">
import useSettingsStore from '@/store/modules/settings';
import { handleThemeStyle } from '@/utils/theme';
import useAppStore from '@/store/modules/app';
import PrintView from '@/views/print/view.vue';
import SearchMenu from '@/layout/components/TopBar/search.vue';
import AiAssistant from '@/layout/components/TopBar/aiAssistant.vue';
const appStore = useAppStore();
const printView = ref();
const internalInstance = getCurrentInstance();
onMounted(() => {
nextTick(() => {
// 初始化主题样式
handleThemeStyle(useSettingsStore().theme);
if (internalInstance) {
internalInstance.appContext.config.globalProperties.$openPrint = printView.value.openPrint;
}
});
});
const aiAssistantRef = ref<InstanceType<typeof SearchMenu>>();
const openAiAssistantMenu = () => {
aiAssistantRef.value?.openSearch();
};
</script>
<style>
.floatIcon {
position: fixed;
top: 50%;
right: 0;
width: 24px;
height: 24px;
}
</style>