App.vue 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. <template>
  2. <AdaptiveContainer :options="{ width: width, height: height }" style="overflow-y: hidden">
  3. <ConfigProvider :locale="getAntdLocale" prefixCls="zxm">
  4. <AppProvider>
  5. <RouterView v-if="!isReload"/>
  6. </AppProvider>
  7. </ConfigProvider>
  8. </AdaptiveContainer>
  9. </template>
  10. <script lang="ts" setup>
  11. import { ref, watch, onUnmounted, nextTick, provide } 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 isReload = ref(false)
  21. const appStore = useAppStore();
  22. // support Multi-language
  23. const { getAntdLocale } = useLocale();
  24. const width = ref(1920);
  25. const height = ref(928);
  26. const body = document.body.getBoundingClientRect();
  27. if (screen.height === body.height && screen.width === body.width) {
  28. height.value = 1080;
  29. }
  30. const reloadRouter = () => {
  31. debugger
  32. isReload.value = true
  33. nextTick(() => {
  34. isReload.value = false
  35. })
  36. }
  37. watch([()=> appStore.getWidthScale, () => appStore.getHeightScale], () => {
  38. const popoverDomList = document.getElementsByClassName('zxm-popover')
  39. Array.prototype.map.call(popoverDomList, dom => {
  40. console.log('弹窗节点------>',dom,);
  41. })
  42. })
  43. useTitle();
  44. provide('reloadRouter', reloadRouter)
  45. onUnmounted(() => {
  46. window['renderer']?.dispose()
  47. window['renderer']?.forceContextLoss()
  48. if(window['renderer'])window['renderer'].content = null
  49. const gl = window['renderer']?.domElement.getContext('webgl')
  50. gl && gl.getExtension('WEBGL_lose_context').loseContext()
  51. })
  52. </script>
  53. <style lang="less">
  54. // update-begin--author:liaozhiyang---date:20230803---for:【QQYUN-5839】windi会影响到html2canvas绘制的图片样式
  55. img{display:inline-block;}
  56. // update-end--author:liaozhiyang---date:20230803---for:【QQYUN-5839】windi会影响到html2canvas绘制的图片样式
  57. </style>
  58. <style lang="less" scoped>
  59. #app {
  60. overflow: hidden;
  61. }
  62. @font-face {
  63. font-family: 'douyuFont';
  64. src: url('/@/assets/font/douyuFont.otf');
  65. font-weight: normal;
  66. font-style: normal;
  67. }
  68. @font-face {
  69. font-family: 'numberFont';
  70. src: url('/@/assets/font/yjsz.TTF');
  71. font-weight: normal;
  72. font-style: normal;
  73. }
  74. @font-face {
  75. font-family: 'electronicFont';
  76. src: url('/@/assets/font/DS-DIGIT.TTF');
  77. font-weight: normal;
  78. font-style: normal;
  79. }
  80. @font-face {
  81. font-family: 'ysbtFont';
  82. src: url('/@/assets/font/ysbtFont.ttf');
  83. font-weight: normal;
  84. font-style: normal;
  85. }
  86. </style>