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

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