App.vue 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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, 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']) {
  48. window['renderer'].content = null;
  49. }
  50. const gl = window['renderer']?.domElement.getContext('webgl');
  51. gl && gl.getExtension('WEBGL_lose_context').loseContext();
  52. });
  53. </script>
  54. <style lang="less">
  55. // update-begin--author:liaozhiyang---date:20230803---for:【QQYUN-5839】windi会影响到html2canvas绘制的图片样式
  56. img {
  57. display: inline-block;
  58. }
  59. // update-end--author:liaozhiyang---date:20230803---for:【QQYUN-5839】windi会影响到html2canvas绘制的图片样式
  60. </style>
  61. <style lang="less" scoped>
  62. #app {
  63. overflow: hidden;
  64. }
  65. @font-face {
  66. font-family: 'douyuFont';
  67. src: url('/@/assets/font/douyuFont.otf');
  68. font-weight: normal;
  69. font-style: normal;
  70. }
  71. @font-face {
  72. font-family: 'numberFont';
  73. src: url('/@/assets/font/yjsz.TTF');
  74. font-weight: normal;
  75. font-style: normal;
  76. }
  77. @font-face {
  78. font-family: 'electronicFont';
  79. src: url('/@/assets/font/DS-DIGIT.TTF');
  80. font-weight: normal;
  81. font-style: normal;
  82. }
  83. @font-face {
  84. font-family: 'ysbtFont';
  85. src: url('/@/assets/font/ysbtFont.ttf');
  86. font-weight: normal;
  87. font-style: normal;
  88. }
  89. </style>