App.vue 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. <template>
  2. <AdaptiveContainer :options="{ width: width, height: height }" style="overflow-y: hidden">
  3. <ConfigProvider :locale="getAntdLocale" prefixCls="zxm">
  4. <AppProvider>
  5. <RouterView />
  6. </AppProvider>
  7. </ConfigProvider>
  8. </AdaptiveContainer>
  9. </template>
  10. <script lang="ts" setup>
  11. import { ref, watch, onUnmounted } from 'vue';
  12. import { ConfigProvider } from 'ant-design-vue';
  13. import { AppProvider } from '/@/components/Application';
  14. import { useTitle } from '/@/hooks/web/useTitle';
  15. import { useLocale } from '/@/locales/useLocale';
  16. import AdaptiveContainer from '/@/components/Container/src/Adaptive.vue';
  17. import { useAppStore } from '/@/store/modules/app';
  18. // 解决日期时间国际化问题
  19. import 'dayjs/locale/zh-cn';
  20. const appStore = useAppStore();
  21. // support Multi-language
  22. const { getAntdLocale } = useLocale();
  23. const width = ref(1920);
  24. const height = ref(928);
  25. const body = document.body.getBoundingClientRect();
  26. if (screen.height === body.height && screen.width === body.width) {
  27. height.value = 1080;
  28. }
  29. watch([()=> appStore.getWidthScale, () => appStore.getHeightScale], () => {
  30. const popoverDomList = document.getElementsByClassName('zxm-popover')
  31. Array.prototype.map.call(popoverDomList, dom => {
  32. console.log('弹窗节点------>',dom,);
  33. })
  34. })
  35. useTitle();
  36. onUnmounted(() => {
  37. window['renderer']?.dispose()
  38. window['renderer']?.forceContextLoss()
  39. if(window['renderer'])window['renderer'].content = null
  40. const gl = window['renderer']?.domElement.getContext('webgl')
  41. gl && gl.getExtension('WEBGL_lose_context').loseContext()
  42. })
  43. </script>
  44. <style lang="less" scoped>
  45. #app {
  46. overflow: hidden;
  47. }
  48. @font-face {
  49. font-family: 'douyuFont';
  50. src: url('/@/assets/font/douyuFont.otf');
  51. font-weight: normal;
  52. font-style: normal;
  53. }
  54. @font-face {
  55. font-family: 'numberFont';
  56. src: url('/@/assets/font/yjsz.TTF');
  57. font-weight: normal;
  58. font-style: normal;
  59. }
  60. @font-face {
  61. font-family: 'electronicFont';
  62. src: url('/@/assets/font/DS-DIGIT.TTF');
  63. font-weight: normal;
  64. font-style: normal;
  65. }
  66. @font-face {
  67. font-family: 'ysbtFont';
  68. src: url('/@/assets/font/ysbtFont.ttf');
  69. font-weight: normal;
  70. font-style: normal;
  71. }
  72. </style>