liuqiao 2 年之前
父節點
當前提交
7970f03b9f
共有 3 個文件被更改,包括 25 次插入5 次删除
  1. 19 5
      src/views/home/myproject/index.vue
  2. 1 0
      src/views/index/HCFDLab/websocket.vue
  3. 5 0
      vue.config.js

+ 19 - 5
src/views/home/myproject/index.vue

@@ -33,7 +33,7 @@
       v-loading="loading"
      element-loading-text="拼命加载中"
       :data="tableData"
-         height="600"
+         :height="tableHeight"
       class="lbg_color2"
       @row-click="rowclinck"
       style="width: 100%">
@@ -121,6 +121,8 @@ export default {
          },
   data() {
     return {
+      tableHeight: window.innerHeight - 350, //表格动态高度
+      screenHeight: window.innerHeight, //内容区域高度
        loading: false, // 是显示加载
         paginationConfig: {
         hideSinglePage: false,
@@ -184,7 +186,22 @@ export default {
   },
   mounted(){
 this.init();
+// window.onresize:浏览器尺寸变化响应事件
+      window.onresize = () => {
+      return (() => {
+      window.screenHeight = window.innerHeight
+      this.screenHeight = window.screenHeight
+      })()
+      }
   },
+  watch: {
+    // 监听screenHeight从而改变table的高度
+    screenHeight(val) {
+    this.screenHeight = val
+    this.tableHeight = this.screenHeight -350
+    console.log( this.tableHeight);
+    }
+},
   methods: {
     init(){
       this.projectlist('');
@@ -312,9 +329,6 @@ position:relative;
  box-sizing: border-box; 
  overflow: hidden;
  color: #fff;
-  &:hover{
-
-  }
   .search{
     padding: 0 10px;
   }
@@ -340,7 +354,7 @@ position:relative;
   border: none;
 }
 .pagination{
-  margin-top: 50px;
+  margin-top: 30px;
 }
 .page-content .el-pagination .el-pagination__jump{
       margin-top: -3px;

+ 1 - 0
src/views/index/HCFDLab/websocket.vue

@@ -38,6 +38,7 @@ export default {
     methods: {
     initWebSocket(){ //初始化weosocket
         const wsuri = "ws://192.168.0.44:8082/websocket?vdioId="+this.projectId+this.servertype+this.bStep;
+           //   const wsuri = "ws://"+process.env.VUE_APP_BASE_websokt+"//eswebsocket?projectId="+this.projectId;
         this.websock = new WebSocket(wsuri);
         this.websock.onmessage = this.websocketonmessage;
         this.websock.onopen = this.websocketonopen;

+ 5 - 0
vue.config.js

@@ -48,6 +48,11 @@ module.exports = {
         pathRewrite: { // 路径重写
           '^/file': ''
         }
+      },
+      '/websokct':{
+        target: 'http://192.168.0.43:8081/',
+        // target: 'https://www.gzchain.org.cn/managersvc/', //后端接口地址
+        secure: false, //接受使用https
       }
     },
     open: false,//不自动打开浏览器