zhangzengfei
2020-10-14 261e25074b7f35010efccb86bf82f6fe36e4b10d
添加硬件信息显示
1个文件已修改
56 ■■■■ 已修改文件
src/pages/settings/components/BasicSetting.vue 56 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/settings/components/BasicSetting.vue
@@ -110,6 +110,22 @@
                  <div class="xiangqin-label">硬盘个数</div>
                  <div class="xiangqing-info">{{sysinfo.diskCount}}</div>
                </el-col>
                <el-col :span="12" class="flex-box">
                  <div class="xiangqin-label">硬盘信息</div>
                  <div class="xiangqing-info">{{sysinfo.disks}}</div>
                </el-col>
                <el-col :span="12" class="flex-box">
                  <div class="xiangqin-label">CPU</div>
                  <div class="xiangqing-info">{{sysinfo.cpuInfo}}</div>
                </el-col>
                <el-col :span="12" class="flex-box">
                  <div class="xiangqin-label">内存</div>
                  <div class="xiangqing-info">{{sysinfo.mem}}</div>
                </el-col>
                <el-col :span="12" class="flex-box">
                  <div class="xiangqin-label">运行时间</div>
                  <div class="xiangqing-info">{{sysinfo.uptime}}</div>
                </el-col>
              </el-row>
            </el-menu-item-group>
          </el-submenu>
@@ -159,7 +175,6 @@
            </el-menu-item-group>
          </el-submenu>
          <!-- 对外服务IP 改名为外部网络(新tab)-->
        </el-menu>
      </el-tab-pane>
@@ -186,7 +201,7 @@
                :value="item.value"
              ></el-option>
            </el-select>
          </el-form-item> -->
          </el-form-item>-->
          <div style="text-align: left;padding: 10px 0px">
            <div class="time-type">NTP校时</div>
            <div style="padding: 10px 0px;">
@@ -234,7 +249,6 @@
              placeholder="选择日期时间"
              size="small"
              value-format="yyyy-MM-dd HH:mm:ss"
              :disabled="syncType === '1'"
            ></el-date-picker>
            <el-checkbox
@@ -295,7 +309,6 @@
              </el-form>
            </el-menu-item-group>
          </el-submenu>
        </el-menu>
      </el-tab-pane> -->
      <el-tab-pane label="权限管理" name="user">
@@ -466,7 +479,7 @@
      this.initResourceConfig();
      this.initClockConf();
      //this.markStartTime();
    });
  },
  beforeDestroy() {
@@ -487,6 +500,16 @@
          this.alarmConf.min_video_len = rsp.data.min_video_len;
          this.alarmConf.max_video_len = rsp.data.max_video_len;
          if (this.sysinfo.deviceInfo) {
            let devInfo = this.sysinfo.deviceInfo;
            this.sysinfo.cpuInfo = devInfo.cpu[0].modelName;
            this.sysinfo.disks = devInfo.disk;
            this.sysinfo.mem = (devInfo.mem.total / 1024 / 1024 / 1024).toFixed(2) + "KB";
            // this.sysinfo.arch = devInfo.host.kernelArch;
            this.sysinfo.uptime = this.secondsFormat(devInfo.host.uptime);
          }
          if (!this.sysinfo.server_port) {
            this.sysinfo.server_port = 7003;
          }
@@ -498,6 +521,13 @@
      }).catch(err => {
        this.loading = false;
      });
    },
    secondsFormat(s) {
      var day = Math.floor(s / (24 * 3600)); // Math.floor()向下取整
      var hour = Math.floor((s - day * 24 * 3600) / 3600);
      var minute = Math.floor((s - day * 24 * 3600 - hour * 3600) / 60);
      var second = s - day * 24 * 3600 - hour * 3600 - minute * 60;
      return day + "天" + hour + "时" + minute + "分" + second + "秒";
    },
    initClockConf() {
      getClockInfo().then(rsp => {
@@ -549,7 +579,7 @@
        }, 1000)
      }
    },
    markStartTime(){
    markStartTime() {
      let timestamp = new Date().getTime() / 1000;
      this.settime = this.formatTime(timestamp, 'Y-M-D h:m:s')
    },
@@ -622,9 +652,9 @@
        }
      });
    },
    checkTimeZone(val){
    checkTimeZone(val) {
      debugger;
    },
    submitClock() {
      if (this.syncType === '1') {
@@ -794,8 +824,8 @@
    // margin-left: -80px;
    .el-form-item {
      text-align: left;
      &.is-required:not(.is-no-asterisk)>.el-form-item__label:before{
        margin-left:-8px;
      &.is-required:not(.is-no-asterisk) > .el-form-item__label:before {
        margin-left: -8px;
      }
      .el-button {
        float: right;
@@ -944,12 +974,12 @@
    width: 300px;
  }
}
.desc-info{
.desc-info {
  margin-bottom: 14px;
  .flex-box{
  .flex-box {
    height: 40px;
    line-height: 40px;
    .xiangqin-label{
    .xiangqin-label {
      width: 80px;
    }
  }