<script lang="ts" setup>
|
import { computed } from 'vue';
|
|
import { useAntdDesignTokens } from '@vben/hooks';
|
import { preferences, usePreferences } from '@vben/preferences';
|
|
import { App, ConfigProvider, theme } from 'ant-design-vue';
|
|
import GlobalCustomViewModal from '#/components/GlobalCustomViewModal/index.vue';
|
import GlobalFormModal from '#/components/GlobalFormModal/index.vue';
|
import GlobalCustomPrintModal from '#/components/GlobalCustomPrintModal/index.vue';
|
import GlobalFlowDetailPopup from '#/components/GlobalFlowDetailPopup/index.vue';
|
import GlobalFlowListModal from '#/components/GlobalFlowListModal/index.vue';
|
import GlobalListModal from '#/components/GlobalListModal/index.vue';
|
import GlobalOfficeDocumentModal from '#/components/GlobalOfficeDocumentModal/index.vue';
|
import GlobalReportViewModal from '#/components/GlobalReportViewModal/index.vue';
|
import { antdLocale } from '#/locales';
|
|
defineOptions({ name: 'App' });
|
|
const { isDark } = usePreferences();
|
const { tokens } = useAntdDesignTokens();
|
|
const tokenTheme = computed(() => {
|
const algorithm = isDark.value ? [theme.darkAlgorithm] : [theme.defaultAlgorithm];
|
|
// antd 紧凑模式算法
|
if (preferences.app.compact) {
|
algorithm.push(theme.compactAlgorithm);
|
}
|
|
return {
|
algorithm,
|
token: {
|
...tokens,
|
borderRadius: 4,
|
},
|
};
|
});
|
</script>
|
|
<template>
|
<ConfigProvider :locale="antdLocale" :theme="tokenTheme">
|
<App>
|
<RouterView />
|
<GlobalCustomViewModal />
|
<GlobalFormModal />
|
<GlobalCustomPrintModal />
|
<GlobalFlowDetailPopup />
|
<GlobalFlowListModal />
|
<GlobalListModal />
|
<GlobalOfficeDocumentModal />
|
<GlobalReportViewModal />
|
</App>
|
</ConfigProvider>
|
</template>
|