index.vue 883 B

123456789101112131415161718192021222324252627
  1. <template>
  2. <component :is="currentCity" />
  3. </template>
  4. <script lang="tsx" setup name="qualityIndex">
  5. import { defineAsyncComponent, computed } from 'vue';
  6. import { useThemeConfig } from '@/stores/themeConfig';
  7. import { storeToRefs } from 'pinia';
  8. // 引入组件
  9. const YiBin = defineAsyncComponent(() => import('@/views/quality/index/YBQuality.vue')); // 宜宾工单质检
  10. const ZiGong = defineAsyncComponent(() => import('@/views/quality/index/ZGQuality.vue')); // 自贡工单质检
  11. const LuZhou = defineAsyncComponent(() => import('@/views/quality/index/YBQuality.vue')); // 泸州工单质检
  12. const storesThemeConfig = useThemeConfig();
  13. const { themeConfig } = storeToRefs(storesThemeConfig);
  14. const COMPONENT_LIST = {
  15. YiBin,
  16. ZiGong,
  17. LuZhou
  18. };
  19. // 当前地州市
  20. const currentCity = computed(() => {
  21. return COMPONENT_LIST[themeConfig.value.appScope];
  22. });
  23. </script>