广丰卷烟厂数采质量分析系统
zhuguifei
2026-03-20 3471290659516cf21db3211a9053daff5f283e03
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<script setup lang="ts">
import { computed } from 'vue';
import { NConfigProvider, darkTheme } from 'naive-ui';
import type { WatermarkProps } from 'naive-ui';
import { useAppStore } from './store/modules/app';
import { useThemeStore } from './store/modules/theme';
import { naiveDateLocales, naiveLocales } from './locales/naive';
 
defineOptions({
  name: 'App'
});
 
const appStore = useAppStore();
const themeStore = useThemeStore();
 
const naiveDarkTheme = computed(() => (themeStore.darkMode ? darkTheme : undefined));
 
const naiveLocale = computed(() => {
  return naiveLocales[appStore.locale];
});
 
const naiveDateLocale = computed(() => {
  return naiveDateLocales[appStore.locale];
});
 
const watermarkProps = computed<WatermarkProps>(() => {
  return {
    content: themeStore.watermarkContent,
    cross: true,
    fullscreen: true,
    fontSize: 14,
    lineHeight: 14,
    width: 384,
    height: 384,
    xOffset: 12,
    yOffset: 60,
    rotate: -13,
    zIndex: 9999,
    fontColor: themeStore.darkMode ? 'rgba(200, 200, 200, 0.03)' : 'rgba(200, 200, 200, 0.2)'
  };
});
</script>
 
<template>
  <NConfigProvider
    :theme="naiveDarkTheme"
    :theme-overrides="themeStore.naiveTheme"
    :locale="naiveLocale"
    :date-locale="naiveDateLocale"
    class="h-full"
  >
    <AppProvider>
      <RouterView class="bg-layout" />
      <NWatermark v-if="themeStore.watermark.visible" v-bind="watermarkProps" />
    </AppProvider>
  </NConfigProvider>
</template>
 
<style scoped></style>