广丰卷烟厂数采质量分析系统
zhuguifei
2026-03-13 06f6eb3b6159323a26e55cc15ef3000786931e24
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
<script setup lang="ts">
import { createTextVNode, defineComponent } from 'vue';
import { useDialog, useLoadingBar, useMessage, useNotification } from 'naive-ui';
import useContentLoading from '@/hooks/common/loading';
 
defineOptions({
  name: 'AppProvider'
});
 
const contentLoading = useContentLoading();
 
const ContextHolder = defineComponent({
  name: 'ContextHolder',
  setup() {
    function register() {
      window.$loadingBar = useLoadingBar();
      window.$dialog = useDialog();
      window.$message = useMessage();
      window.$notification = useNotification();
      window.$loading = contentLoading;
    }
 
    register();
 
    return () => createTextVNode();
  }
});
</script>
 
<template>
  <NSpin
    class="h-full"
    :size="52"
    content-class="h-full"
    :show="contentLoading.loading.value"
    :description="contentLoading.description.value"
  >
    <NLoadingBarProvider>
      <NDialogProvider>
        <NNotificationProvider>
          <NMessageProvider>
            <ContextHolder />
            <slot></slot>
          </NMessageProvider>
        </NNotificationProvider>
      </NDialogProvider>
    </NLoadingBarProvider>
  </NSpin>
</template>
 
<style scoped>
:deep(.n-spin-description) {
  margin-top: 24px;
  font-size: 16px;
}
</style>