管道基础大数据平台系统开发-【前端】-新系統界面
Surpriseplus
2023-02-15 343e6c2730ffb99db591732ff5ef1494e233c6bc
src/views/maintenance/systemMonitoring.vue
@@ -1,99 +1,25 @@
<template>
  <div class="systemMonitoring_box">
    <My-bread
      :list="[
    <My-bread :list="[
        `${$t('operatManage.operatManage')}`,
        `${$t('operatManage.systemMonitoring')}`,
      ]"
    ></My-bread>
      ]"></My-bread>
    <el-divider />
    <div class="content_Box">
      <div class="cloumn_Box">
        <div class="flex_Box">
          <div style="width: 100%; height: 20px">
            <div class="image1"></div>
            <div class="imageTitle">
              {{ $t('operatManage.systemMonitoringObj.memoryMonitoring') }}
            </div>
          </div>
          <div class="top_Box1">
            <div class="top_box_left">
              <div class="left_title">
                <div class="height_title">
                  <label>
                    {{
                      $t('operatManage.systemMonitoringObj.haveBeenUsed')
                    }}</label
                  >
                  <p>{{ memInfo.use }}</p>
                </div>
                <div class="height_title">
                  <label>
                    {{
                      $t('operatManage.systemMonitoringObj.usageRate')
                    }}</label
                  >
                  <p>{{ memInfo.usage }}</p>
                </div>
              </div>
              <div class="left_title">
                <div class="height_title">
                  <label>
                    {{
                      $t('operatManage.systemMonitoringObj.totalMemory')
                    }}</label
                  >
                  <p>{{ memInfo.totalMem }}</p>
                </div>
                <div class="height_title">
                  <label>
                    {{
                      $t('operatManage.systemMonitoringObj.remainingMemory')
                    }}</label
                  >
                  <p>{{ memInfo.remainMem }}</p>
                </div>
              </div>
            </div>
            <div class="top_box_right">
              <div id="shuiwen" style="width: 300px; height: 300px"></div>
            </div>
          </div>
        </div>
        <div class="flex_Box">
          <div>
            <div class="image2"></div>
            <div style="line-height: 32px" class="imageTitle">
              {{ $t('operatManage.systemMonitoringObj.cpuMonitoring') }}
            </div>
          </div>
          <div
            id="Sys_cpu_chart"
            style="width: 100%; height: 86%; margin-top: 8%"
          ></div>
        </div>
        <div class="flex_Box">
          <div style="width: 100%; height: 34px">
            <div class="image3"></div>
            <div style="line-height: 32px" class="imageTitle">
              {{ $t('operatManage.systemMonitoringObj.heteroconstant') }}
            </div>
          </div>
          <div class="ycsBox">
            <div class="ycTltle">{{ resInfoCount }}</div>
            <div class="heteroTitle">
              {{ $t('operatManage.systemMonitoringObj.numberOfExceptions') }}
            </div>
          </div>
        </div>
      </div>
      <div class="cloumn_Box1">
        <div class="flex_Box1">
          <el-tabs v-model="activeName" @tab-click="handleClick">
        <div class="flex_Box1 subpage_Div">
          <el-tabs
            v-model="activeName"
            @tab-click="handleClick"
          >
            <el-tab-pane
              :label="$t('operatManage.systemMonitoringObj.abnormalResources')"
              name="first"
              ><el-table :data="resInfo" style="width: 100%; height: 310px">
            >
              <el-table
                :data="resInfo"
                style="width: 100%; height: 100%"
              >
                <el-table-column
                  prop="id"
                  :label="$t('operatManage.systemMonitoringObj.resourceID')"
@@ -114,15 +40,21 @@
                  :label="$t('operatManage.systemMonitoringObj.abnormaltime')"
                  show-overflow-tooltip
                >
                </el-table-column> </el-table
            ></el-tab-pane>
                </el-table-column>
              </el-table>
            </el-tab-pane>
            <el-tab-pane
              :label="
                $t('operatManage.systemMonitoringObj.serviceResourceStatus')
              "
              name="second"
            >
              <div id="resUseChart" style="width: 995px; height: 310px"></div>
              <div
                id="resUseChart"
                style="width:101vh; height: 30vh; "
              ></div>
            </el-tab-pane>
            <el-tab-pane
              :label="$t('operatManage.systemMonitoringObj.userloginStatus')"
@@ -130,7 +62,7 @@
            >
              <div
                id="userLoginChart"
                style="width: 995px; height: 310px"
                style="width:101vh; height: 30vh; "
              ></div>
            </el-tab-pane>
            <el-tab-pane
@@ -138,20 +70,28 @@
                $t('operatManage.systemMonitoringObj.resourceOperationStatus')
              "
              name="fourth"
              ><div
            >
              <div
                id="operateCountChart"
                style="width: 995px; height: 310px"
              ></div
            ></el-tab-pane>
                style="width:101vh; height: 30vh; "
              ></div>
            </el-tab-pane>
          </el-tabs>
        </div>
        <div class="flex_Box">
        <div class="flex_Box subpage_Div">
          <div>
            <div style="line-height: 32px" class="imageTitle">
            <div
              style="line-height: 32px"
              class="imageTitle"
            >
              {{ $t('operatManage.systemMonitoringObj.onlinePersonnel') }}
            </div>
          </div>
          <el-table :data="tableData" style="width: 100%" height="90%">
          <el-table
            :data="tableData"
            style="width: 100%"
            height="90%"
          >
            <el-table-column
              align="center"
              type="index"
@@ -177,6 +117,97 @@
          </el-table>
        </div>
      </div>
      <div class="cloumn_Box">
        <div class="flex_Box subpage_Div">
          <div style="width: 100%; height: 20px">
            <div class="image1"></div>
            <div class="imageTitle">
              {{ $t('operatManage.systemMonitoringObj.memoryMonitoring') }}
            </div>
          </div>
          <div class="top_Box1">
            <div class="top_box_left">
              <div class="left_title">
                <div class="height_title">
                  <label>
                    {{
                      $t('operatManage.systemMonitoringObj.haveBeenUsed')
                    }}</label>
                  <p>{{ memInfo.use }}</p>
                </div>
                <div class="height_title">
                  <label>
                    {{
                      $t('operatManage.systemMonitoringObj.usageRate')
                    }}</label>
                  <p>{{ memInfo.usage }}</p>
                </div>
              </div>
              <div class="left_title">
                <div class="height_title">
                  <label>
                    {{
                      $t('operatManage.systemMonitoringObj.totalMemory')
                    }}</label>
                  <p>{{ memInfo.totalMem }}</p>
                </div>
                <div class="height_title">
                  <label>
                    {{
                      $t('operatManage.systemMonitoringObj.remainingMemory')
                    }}</label>
                  <p>{{ memInfo.remainMem }}</p>
                </div>
              </div>
            </div>
            <div
              id="fathershuiWen"
              class="top_box_right"
            >
              <div id="shuiwen"></div>
            </div>
          </div>
        </div>
        <div class="flex_Box subpage_Div">
          <div>
            <div class="image2"></div>
            <div
              style="line-height: 32px"
              class="imageTitle"
            >
              {{ $t('operatManage.systemMonitoringObj.cpuMonitoring') }}
            </div>
          </div>
          <div
            id="Sys_cpu_chart"
            style="width: 100%; height: 86%; margin-top: 8%"
          ></div>
        </div>
        <div class="flex_Box subpage_Div">
          <div style="width: 100%; height: 34px">
            <div class="image3"></div>
            <div
              style="line-height: 32px"
              class="imageTitle"
            >
              {{ $t('operatManage.systemMonitoringObj.heteroconstant') }}
            </div>
          </div>
          <div class="ycContent">
            <div class="ycsBox">
              <div style="width:100%;height:100%">
                <div class="ycTltle">{{ resInfoCount }}</div>
                <div class="heteroTitle">
                  {{ $t('operatManage.systemMonitoringObj.numberOfExceptions') }}
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
    <!-- <div class="inform_box">
      <div class="content_box">
@@ -308,7 +339,7 @@
          @size-change="handleSizeChange"
          @current-change="handleCurrentChange"
          :current-page="currentPage4"
          :page-sizes="[10, 20, 30, 40]"
          :page-sizes="[10, 20, 50, 100]"
          :page-size="10"
          layout="total, sizes, prev, pager, next, jumper"
          :total="4"
@@ -351,7 +382,7 @@
          @size-change="handleSizeChange"
          @current-change="handleCurrentChange"
          :current-page="currentPage4"
          :page-sizes="[10, 20, 30, 40]"
          :page-sizes="[10, 20, 50, 100]"
          :page-size="10"
          layout="total, sizes, prev, pager, next, jumper"
          :total="4"
@@ -440,6 +471,13 @@
            seriesIndex: 0,
          },
        ],
        toolbox: {
          show: true,
          feature: {
            saveAsImage: { show: true }
          }
        },
        title: [],
        tooltip: {
          trigger: 'axis',
@@ -448,6 +486,7 @@
          type: 'category',
          boundaryGap: false,
          data: ['', '', '', '', '', '', ''],
        },
        yAxis: [
          {
@@ -469,6 +508,16 @@
            type: 'line',
            showSymbol: false,
            data: valueList,
            // itemStyle: {
            //   normal: {
            //     color: "#009cff", //改变折线点的颜色
            //     lineStyle: {
            //       color: "#009cff", //改变折线颜色
            //     },
            //   },
            // }
          },
        ],
      };
@@ -482,6 +531,8 @@
      });
    },
    lineChart2(res) {
      var a = 0;
      if (res != 0) {
        a = res.split('%').join('');
@@ -623,12 +674,18 @@
        tooltip: {
          trigger: 'item',
        },
        toolbox: {
          show: true,
          feature: {
            saveAsImage: { show: true }
          }
        },
        legend: {
          top: '5%',
          left: 'center',
          textStyle: {
            fontSize: 18, //字体大小
            color: '#ffffff', //字体颜色
          },
        },
        series: [
@@ -732,6 +789,13 @@
            type: 'shadow',
          },
        },
        toolbox: {
          show: true,
          feature: {
            saveAsImage: { show: true }
          }
        },
        grid: {
          left: '3%',
          right: '4%',
@@ -777,7 +841,7 @@
    }
    Window.ws = new WebSocket(socketUrl);
    Window.ws.option = () => {};
    Window.ws.option = () => { };
    var that = this;
    Window.ws.onmessage = (msg) => {
      // console.log('来自服务器端的数据:' + msg.data); //监听接受来自服务端的信息
@@ -794,6 +858,17 @@
  },
  mounted() {
    var mywidth = $("#fathershuiWen").width();
    var mysright = $("#fathershuiWen").height();
    var width = (mywidth * 1.5) + "px"
    var height = (mysright * 1.5) + "px"
    $("#shuiwen").width(width);
    $("#shuiwen").height(height);
    this.lineChart2(0);
  },
};
@@ -801,13 +876,14 @@
<style lang="less" scoped>
//@import url(); 引入公共css类
.systemMonitoring_box {
  border-radius: 10px;
  height: 100%;
  box-sizing: border-box;
  height: 98%;
  width: 98%;
  padding: 1%;
  .content_Box {
    width: 97%;
    height: 74%;
    position: absolute;
    width: 100%;
    height: 90%;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
@@ -820,16 +896,15 @@
      .flex_Box {
        width: 30.5%;
        height: 88%;
        border: 1px solid rgb(202, 201, 204);
        border-radius: 5px;
        padding: 1%;
        background: rgb(21, 20, 20);
        .image1 {
          width: 46px;
          height: 20px;
          float: left;
          background: url('../../assets/img/systemMonitoring/图层 38.png')
          background: url("../../assets/img/systemMonitoring/图层 38.png")
            no-repeat;
          background-size: 100% 100%;
        }
@@ -837,7 +912,7 @@
          width: 34px;
          height: 34px;
          float: left;
          background: url('../../assets/img/systemMonitoring/图层 37.png')
          background: url("../../assets/img/systemMonitoring/图层 37.png")
            no-repeat;
          background-size: 100% 100%;
        }
@@ -845,50 +920,56 @@
          width: 32px;
          height: 32px;
          float: left;
          background: url('../../assets/img/systemMonitoring/图层 40.png')
          background: url("../../assets/img/systemMonitoring/图层 40.png")
            no-repeat;
          background-size: 100% 100%;
        }
      }
      .ycsBox {
        width: 200px;
        height: 200px;
        margin-left: 30%;
        background: url('../../assets/img/systemMonitoring/图层 39.png')
        width: 495px;
        height: 182px;
        background: url("../../assets/img/systemMonitoring/图层 39.png")
          no-repeat;
        background-size: 100% 100%;
        border: 1px;
        display: flex;
        align-items: center;
      }
      .ycTltle {
        width: 28px;
        height: 47px;
        font-size: 60px;
        font-family: Microsoft YaHei;
        font-weight: 300;
        color: #009cff;
        margin-top: 61px;
        margin-left: 88px;
      }
      .heteroTitle {
      .ycContent {
        width: 100%;
        height: 16px;
        font-size: 16px;
        font-family: Microsoft YaHei;
        font-weight: 300;
        color: #ffffff;
        line-height: 49px;
        padding: 1%;
        height: 80%;
        margin-top: 20px;
        text-align: center;
        display: flex;
        justify-content: center;
      }
    }
    .imageTitle {
      float: left;
      color: white;
      margin-left: 10px;
    }
    .ycTltle {
      width: 100%;
      margin-top: 8%;
      font-size: 60px;
      font-family: Microsoft YaHei;
      font-weight: 300;
      color: #009cff;
      text-align: center;
    }
    .heteroTitle {
      width: 100%;
      text-align: center;
      font-size: 16px;
      font-family: Microsoft YaHei;
      font-weight: 300;
      line-height: 49px;
      // margin-top: 20px;
      // text-align: center;
    }
    .top_Box1 {
      width: 96%;
@@ -911,11 +992,8 @@
          .height_title {
            width: 100%;
            height: 48%;
            label {
              color: white;
            }
            p {
              color: white;
              margin-top: 3%;
              font-size: 24px;
            }
@@ -938,82 +1016,16 @@
        width: 64%;
        height: 92%;
        padding: 1%;
        border: 1px solid rgb(202, 201, 204);
        border-radius: 5px;
        background: rgb(21, 20, 20);
      }
      .flex_Box {
        width: 30.5%;
        height: 92%;
        border: 1px solid rgb(202, 201, 204);
        border-radius: 5px;
        padding: 1%;
        background: rgb(21, 20, 20);
      }
    }
  }
  /deep/.el-tabs__item {
    color: white;
  }
  /deep/.el-tabs__item.is-active {
    color: #009cff;
  }
  /*修改table 表体的背景颜色和文字颜色*/
  /deep/ .el-table {
    background-color: transparent;
    th,
    td {
      background-color: transparent;
    }
    .el-table__expanded-cell {
      background-color: transparent !important;
    }
    // 表头背景色
    th.el-table__cell {
      background-color: #303030;
      color: #fff;
    }
    tr > td {
      background-color: #303030;
      color: #fff;
    }
    // hover效果
    tr:hover > td {
      background-color: rgba(255, 255, 255, 0.3) !important;
    }
    tbody tr:hover {
      background-color: rgba(255, 255, 255, 0.3) !important;
      // text-align: center;
    }
    // 滚动条宽高
    .el-table__body-wrapper::-webkit-scrollbar {
      width: 5px;
      height: 5px;
    }
    .el-table__body-wrapper::-webkit-scrollbar {
      width: 5px;
      /*滚动条宽度*/
      height: 10px;
      /*滚动条高度*/
    }
    /*定义滚动条轨道 内阴影+圆角*/
    .el-table__body-wrapper::-webkit-scrollbar-track {
      box-shadow: 0px 1px 3px #216fe6 inset;
      /*滚动条的背景区域的内阴影*/
      border-radius: 10px;
    }
    /*定义滑块 内阴影+圆角*/
    .el-table__body-wrapper::-webkit-scrollbar-thumb {
      box-shadow: 0px 1px 3px #216fe6 inset;
      border-radius: 6px;
      background-color: #216fe6;
    }
  }
}