App.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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">
  45. // update-begin--author:liaozhiyang---date:20230803---for:【QQYUN-5839】windi会影响到html2canvas绘制的图片样式
  46. img{display:inline-block;}
  47. // update-end--author:liaozhiyang---date:20230803---for:【QQYUN-5839】windi会影响到html2canvas绘制的图片样式
  48. </style>
  49. <style lang="less" scoped>
  50. #app {
  51. overflow: hidden;
  52. }
  53. @font-face {
  54. font-family: 'douyuFont';
  55. src: url('/@/assets/font/douyuFont.otf');
  56. font-weight: normal;
  57. font-style: normal;
  58. }
  59. @font-face {
  60. font-family: 'numberFont';
  61. src: url('/@/assets/font/yjsz.TTF');
  62. font-weight: normal;
  63. font-style: normal;
  64. }
  65. @font-face {
  66. font-family: 'electronicFont';
  67. src: url('/@/assets/font/DS-DIGIT.TTF');
  68. font-weight: normal;
  69. font-style: normal;
  70. }
  71. @font-face {
  72. font-family: 'ysbtFont';
  73. src: url('/@/assets/font/ysbtFont.ttf');
  74. font-weight: normal;
  75. font-style: normal;
  76. }
  77. </style>