2023-01-29 15:26:45 +08:00
|
|
|
<template>
|
2025-03-04 19:24:24 +00:00
|
|
|
<AConfigProvider :locale="locale" :theme="tokenTheme">
|
2025-04-07 23:52:21 +08:00
|
|
|
<FsFormProvider>
|
2025-03-21 23:11:58 +08:00
|
|
|
<contextHolder />
|
2025-03-06 21:11:07 +08:00
|
|
|
<router-view />
|
2025-04-07 23:52:21 +08:00
|
|
|
</FsFormProvider>
|
2025-03-04 19:24:24 +00:00
|
|
|
</AConfigProvider>
|
2023-01-29 15:26:45 +08:00
|
|
|
</template>
|
|
|
|
|
|
2024-10-15 17:12:42 +08:00
|
|
|
<script lang="ts" setup>
|
2025-05-07 14:15:32 +08:00
|
|
|
import { computed, onMounted, provide, ref } from "vue";
|
2023-03-09 19:24:01 +00:00
|
|
|
import "dayjs/locale/zh-cn";
|
|
|
|
|
import "dayjs/locale/en";
|
|
|
|
|
import dayjs from "dayjs";
|
2025-03-03 19:24:51 +00:00
|
|
|
import { usePreferences, preferences } from "/@/vben/preferences";
|
|
|
|
|
import { useAntdDesignTokens } from "/@/vben/hooks";
|
|
|
|
|
import { theme } from "ant-design-vue";
|
2025-03-04 19:24:24 +00:00
|
|
|
import AConfigProvider from "ant-design-vue/es/config-provider";
|
2024-10-15 17:12:42 +08:00
|
|
|
import { Modal } from "ant-design-vue";
|
2025-05-07 14:15:32 +08:00
|
|
|
import MaxKBChat from "/@/components/ai/index.vue";
|
|
|
|
|
import { util } from "/@/utils";
|
2025-05-15 23:06:22 +08:00
|
|
|
import { useSettingStore } from "/@/store/settings";
|
2024-10-15 17:12:42 +08:00
|
|
|
defineOptions({
|
2025-03-21 23:11:58 +08:00
|
|
|
name: "App",
|
2024-10-15 17:12:42 +08:00
|
|
|
});
|
|
|
|
|
const [modal, contextHolder] = Modal.useModal();
|
|
|
|
|
provide("modal", modal);
|
|
|
|
|
|
2025-05-16 23:14:43 +08:00
|
|
|
|
2025-03-03 19:24:51 +00:00
|
|
|
const { isDark } = usePreferences();
|
|
|
|
|
const { tokens } = useAntdDesignTokens();
|
2023-01-29 15:26:45 +08:00
|
|
|
|
2025-03-03 19:24:51 +00:00
|
|
|
const tokenTheme = computed(() => {
|
|
|
|
|
const algorithm = isDark.value ? [theme.darkAlgorithm] : [theme.defaultAlgorithm];
|
|
|
|
|
|
|
|
|
|
// antd 紧凑模式算法
|
|
|
|
|
if (preferences.app.compact) {
|
|
|
|
|
algorithm.push(theme.compactAlgorithm);
|
2023-01-29 15:26:45 +08:00
|
|
|
}
|
2025-03-03 19:24:51 +00:00
|
|
|
|
|
|
|
|
return {
|
|
|
|
|
algorithm,
|
2025-03-21 23:11:58 +08:00
|
|
|
token: tokens,
|
2025-03-03 19:24:51 +00:00
|
|
|
};
|
|
|
|
|
});
|
2025-05-16 23:14:43 +08:00
|
|
|
|
2023-01-29 15:26:45 +08:00
|
|
|
</script>
|