App.vue 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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. isReload.value = true
  32. nextTick(() => {
  33. isReload.value = false
  34. })
  35. }
  36. watch([()=> appStore.getWidthScale, () => appStore.getHeightScale], () => {
  37. const popoverDomList = document.getElementsByClassName('zxm-popover')
  38. Array.prototype.map.call(popoverDomList, dom => {
  39. console.log('弹窗节点------>',dom,);
  40. })
  41. })
  42. useTitle();
  43. provide('reloadRouter', reloadRouter)
  44. onUnmounted(() => {
  45. window['renderer']?.dispose()
  46. window['renderer']?.forceContextLoss()
  47. if(window['renderer'])window['renderer'].content = null
  48. const gl = window['renderer']?.domElement.getContext('webgl')
  49. gl && gl.getExtension('WEBGL_lose_context').loseContext()
  50. })
  51. </script>
  52. <style lang="less">
  53. // update-begin--author:liaozhiyang---date:20230803---for:【QQYUN-5839】windi会影响到html2canvas绘制的图片样式
  54. img{display:inline-block;}
  55. // update-end--author:liaozhiyang---date:20230803---for:【QQYUN-5839】windi会影响到html2canvas绘制的图片样式
  56. </style>
  57. <style lang="less" scoped>
  58. #app {
  59. overflow: hidden;
  60. }
  61. @font-face {
  62. font-family: 'douyuFont';
  63. src: url('/@/assets/font/douyuFont.otf');
  64. font-weight: normal;
  65. font-style: normal;
  66. }
  67. @font-face {
  68. font-family: 'numberFont';
  69. src: url('/@/assets/font/yjsz.TTF');
  70. font-weight: normal;
  71. font-style: normal;
  72. }
  73. @font-face {
  74. font-family: 'electronicFont';
  75. src: url('/@/assets/font/DS-DIGIT.TTF');
  76. font-weight: normal;
  77. font-style: normal;
  78. }
  79. @font-face {
  80. font-family: 'ysbtFont';
  81. src: url('/@/assets/font/ysbtFont.ttf');
  82. font-weight: normal;
  83. font-style: normal;
  84. }
  85. </style>