wenhongquan 2 years ago
parent
commit
09a7926905
2 changed files with 18 additions and 3 deletions
  1. 16 1
      src/views/screen/index.vue
  2. 2 2
      vite.config.js

+ 16 - 1
src/views/screen/index.vue

@@ -1,5 +1,5 @@
 <template>
-  <div class="content">
+  <div class="content" :style="zoom">
     <div class="header">
       <div class="title"> <img src="@/assets/images/组_16@2x.png" /> 南宁北排综合生产数据平台</div>
       <div class="right">
@@ -230,6 +230,18 @@ const tableRowClassName = ({ row, rowIndex }) => {
   return ''
 }
 
+
+const zoom = ref("zoom:100%");
+var screenWidth = document.body.clientWidth; //监听页面缩放
+var screenHeight = document.body.clientHeight;
+zoom.value = "zoom:" + (100*screenHeight / 1080) + "%"
+window.onresize = () => {
+  return (() => {
+    screenWidth = document.body.clientWidth;
+    screenHeight = document.body.clientHeight;
+    zoom.value = "zoom:" + (100*screenHeight / 1080) + "%"
+  })();
+};
 const changemapshow = () => {
   addmarks();
 }
@@ -791,6 +803,9 @@ function addmarks() {
     //YYYY年MM月DD日 ddd A HH:mm:ss
     timestring.value = localLocale.format("LL dddd A LTS")
   }, 1000)
+
+
+
 }
 
 </script>

+ 2 - 2
vite.config.js

@@ -38,8 +38,8 @@ export default defineConfig(({ mode, command }) => {
             proxy: {
                 // 'http://nnbpbg.xt.wenhq.top:8083'
                 "/dev-api": {
-                    target: "http://localhost:8080/api",
-                    // target:"http://nnbpbg.xt.wenhq.top:8083/api",
+                    // target: "http://localhost:8080/api",
+                    target:"http://nnbpbg.xt.wenhq.top:8083/api",
                     changeOrigin: true,
                     rewrite: (p) => p.replace(/^\/dev-api/, ""),
                 },