Bladeren bron

添加自适应

hrx 2 jaren geleden
bovenliggende
commit
517abeeafb

+ 1 - 1
.env.development

@@ -24,5 +24,5 @@ VITE_GLOB_DOMAIN_URL=http://47.94.222.6:9999
 VITE_GLOB_API_URL_PREFIX=
 VITE_GLOB_API_URL_PREFIX=
 
 
 #微前端qiankun应用,命名必须以VITE_APP_SUB_开头,jeecg-app-1为子应用的项目名称,也是子应用的路由父路径
 #微前端qiankun应用,命名必须以VITE_APP_SUB_开头,jeecg-app-1为子应用的项目名称,也是子应用的路由父路径
-VITE_APP_SUB_APP = [["micro-need-air", "//182.92.126.35:8099/"], ["micro-vent-3dModal", "//localhost:8093/"], ["micro-fire-front", "//localhost:8090/"]]
+VITE_APP_SUB_APP = [["micro-need-air", "//182.92.126.35:8099/"], ["micro-vent-3dModal", "//localhost:8091/"], ["micro-fire-front", "//localhost:8090/"]]
 
 

+ 8 - 2
src/App.vue

@@ -28,8 +28,14 @@
 
 
   // support Multi-language
   // support Multi-language
   const { getAntdLocale } = useLocale();
   const { getAntdLocale } = useLocale();
-  const width = ref(document.body.clientWidth);
-  const height = ref(document.body.clientHeight);
+  const width = ref(1920);
+  const height = ref(929);
+
+  const body = document.body.getBoundingClientRect();
+  if (screen.height === body.height && screen.width === body.width) {
+    height.value = 1080;
+  }
+  console.log('[ 屏幕可视高 ] >', height.value, body.height);
 
 
   useTitle();
   useTitle();
 </script>
 </script>

+ 2 - 0
src/components/Container/src/Adaptive.vue

@@ -43,10 +43,12 @@
               //传入宽高
               //传入宽高
               width.value = ctx.options.width;
               width.value = ctx.options.width;
               height.value = ctx.options.height;
               height.value = ctx.options.height;
+              console.log('[ 屏幕可见宽高 ] >', [width.value, height.value]);
             } else {
             } else {
               //可见宽高
               //可见宽高
               width.value = dom.clientWidth;
               width.value = dom.clientWidth;
               height.value = dom.clientHeight;
               height.value = dom.clientHeight;
+              console.log('[ 屏幕可见宽高 ] >', [width.value, height.value]);
             }
             }
             // 获取画布尺寸
             // 获取画布尺寸
             if (!originalWidth.value || !originalHeight.value) {
             if (!originalWidth.value || !originalHeight.value) {

+ 1 - 1
src/layouts/default/content/index.vue

@@ -66,7 +66,7 @@
         const route = unref(currentRoute);
         const route = unref(currentRoute);
         if (!route.path.startsWith('/micro-')) {
         if (!route.path.startsWith('/micro-')) {
           document.getElementsByName('body')[0];
           document.getElementsByName('body')[0];
-          debugger;
+          // debugger;
         }
         }
       });
       });
       onMounted(() => {
       onMounted(() => {

+ 1 - 1
src/store/modules/user.ts

@@ -290,7 +290,7 @@ export const useUserStore = defineStore({
      * 退出询问
      * 退出询问
      */
      */
     confirmLoginOut() {
     confirmLoginOut() {
-      debugger;
+      // debugger;
       const { createConfirm } = useMessage();
       const { createConfirm } = useMessage();
       const { t } = useI18n();
       const { t } = useI18n();
       createConfirm({
       createConfirm({

+ 11 - 6
src/views/sys/login/Login.vue

@@ -1,5 +1,6 @@
 <template>
 <template>
-  <div class="login-container">
+  <!-- <AdaptiveContainer :options="{ width: 1920, height: 1080 }" style="overflow-y: hidden"> -->
+  <div class="login-container" style="position: absolute; top: 0; left: 0; width: 100%; height: 100%">
     <div class="login-bg"></div>
     <div class="login-bg"></div>
     <span class="-enter-x xl:hidden">
     <span class="-enter-x xl:hidden">
       <AppLogo :alwaysShowTitle="true" />
       <AppLogo :alwaysShowTitle="true" />
@@ -15,9 +16,10 @@
     </div>
     </div>
     <div class="bottom"> </div>
     <div class="bottom"> </div>
   </div>
   </div>
+  <!-- </AdaptiveContainer> -->
 </template>
 </template>
 <script lang="ts" setup>
 <script lang="ts" setup>
-  import { computed } from 'vue';
+  import { computed, ref } from 'vue';
   import { AppLogo } from '/@/components/Application';
   import { AppLogo } from '/@/components/Application';
   import LoginForm from './LoginForm.vue';
   import LoginForm from './LoginForm.vue';
   import { useGlobSetting } from '/@/hooks/setting';
   import { useGlobSetting } from '/@/hooks/setting';
@@ -25,12 +27,14 @@
   import { useDesign } from '/@/hooks/web/useDesign';
   import { useDesign } from '/@/hooks/web/useDesign';
   import { useLocaleStore } from '/@/store/modules/locale';
   import { useLocaleStore } from '/@/store/modules/locale';
   import { useLoginState } from './useLogin';
   import { useLoginState } from './useLogin';
+
+  import AdaptiveContainer from '/@/components/Container/src/Adaptive.vue';
+
   defineProps({
   defineProps({
     sessionTimeout: {
     sessionTimeout: {
       type: Boolean,
       type: Boolean,
     },
     },
   });
   });
-
   const globSetting = useGlobSetting();
   const globSetting = useGlobSetting();
   const { prefixCls } = useDesign('login');
   const { prefixCls } = useDesign('login');
   const { t } = useI18n();
   const { t } = useI18n();
@@ -81,7 +85,7 @@
 
 
   .login-container {
   .login-container {
     width: 100vw;
     width: 100vw;
-    height: 100vh;
+    height: 100%;
     background: linear-gradient(to bottom, #000c37, #001e63);
     background: linear-gradient(to bottom, #000c37, #001e63);
     padding: 0 !important;
     padding: 0 !important;
     position: relative;
     position: relative;
@@ -147,11 +151,12 @@
 
 
     .center {
     .center {
       width: 100%;
       width: 100%;
-      height: calc(100vh - 520px);
+      height: calc(100% - 540px);
       display: flex;
       display: flex;
-      left: 0px;
       flex-direction: column;
       flex-direction: column;
       align-items: center;
       align-items: center;
+      position: relative;
+      justify-content: center;
     }
     }
   }
   }
 
 

+ 2 - 2
src/views/sys/login/LoginForm.vue

@@ -191,8 +191,8 @@
     }
     }
     .btn-box {
     .btn-box {
       width: 100%;
       width: 100%;
-      position: fixed;
-      bottom: 100px;
+      position: relative;
+      top: 40px;
       left: 0px;
       left: 0px;
       display: flex;
       display: flex;
       justify-content: center;
       justify-content: center;

+ 1 - 1
src/views/system/notice/DetailModal.vue

@@ -27,7 +27,7 @@
       return;
       return;
     }
     }
     const document = iframe.ownerDocument;
     const document = iframe.ownerDocument;
-    debugger;
+    // debugger;
     document.body.style.backgroundColor = '#ffffff00';
     document.body.style.backgroundColor = '#ffffff00';
 
 
     // iframe.style.height = `${clientHeight}px`;
     // iframe.style.height = `${clientHeight}px`;