fuliqi
2024-09-24 b3be6406c8105376eef209af3bd6635cb95fa81d
src/views/system/monitor/car/index.vue
@@ -1,16 +1,19 @@
<template>
  <div class="app-container">
    <div
      style="display: flex;flex-direction: row;min-width: 158px;max-width: 158px;margin-bottom: 5px;border-radius: 1px; user-select: none"
      style="display: flex;flex-direction: row;min-width: 300px;max-width: 300px;margin-bottom: 5px;border-radius: 1px; user-select: none"
    >
      <div @click="clickTab(null)" class="tab"
           :class="{tabActive: null == queryParams.provinceTag, tabInactive: null != queryParams.provinceTag}">全部
           :class="{tabActive: !queryParams.provinceTag && !queryParams.deptTag, tabInactive: queryParams.provinceTag || queryParams.deptTag}">全部
      </div>
      <div @click="clickTab(0)" class="tab"
           :class="{tabActive: 0 === queryParams.provinceTag, tabInactive: 0 !== queryParams.provinceTag}">省厅考核
           :class="{tabActive: queryParams.provinceTag, tabInactive: !queryParams.provinceTag}">省厅考核
      </div>
      <div @click="clickTab(1)" class="tab"
           :class="{tabActive: queryParams.deptTag, tabInactive: !queryParams.deptTag}">公安部考核
      </div>
    </div>
    <el-card class="box-card" >
    <el-card class="box-card">
      <el-row type="flex" align="middle" justify="space-between">
        <el-col :span="4">
          <div class="icon-container" style="background-color: #1890FF">
@@ -21,19 +24,19 @@
          <div class="dashboard">
            <div class="dashboard-item">
              <h3 style="color: #5C9BF8">{{ count.totalPosts }}</h3>
              <p>设备总数</p >
              <p>设备总数</p>
            </div>
            <div class="dashboard-item">
              <h3 style="color: #3eba45">{{ count.totalMembers }}</h3>
              <p>正常数</p >
              <p>正常数</p>
            </div>
            <div class="dashboard-item">
              <h3 style="color: #fe640d">{{ count.postsPercentage }}</h3>
              <p>异常数</p >
              <p>异常数</p>
            </div>
            <div class="dashboard-item">
              <h3>{{ count.viewsPercentage }}%</h3>
              <p>设备运行率</p >
              <p>设备运行率</p>
            </div>
          </div>
        </el-col>
@@ -56,7 +59,7 @@
          clearable
          @change="handleQuery"
        >
        <el-option
          <el-option
            v-for="dept in deptList"
            :key="dept.deptId"
            :label="dept.area"
@@ -71,12 +74,12 @@
          clearable
          style="width: 100px"
        >
        <el-option
          v-for="dict in dict.type.camera_state"
          :key="dict.value"
          :label="dict.label"
          :value="dict.value"
        />
          <el-option
            v-for="dict in dict.type.camera_state"
            :key="dict.value"
            :label="dict.label"
            :value="dict.value"
          />
        </el-select>
      </el-form-item>
@@ -93,16 +96,22 @@
      <el-table-column label="ip" align="center" prop="ip" width="180"/>
      <el-table-column label="标签" align="center" width="180" v-if="columns[0].visible">
        <template slot-scope="scope">
          <div>{{ scope.row.provinceTag == 0 ? "省厅" : "市局" }}</div>
          <div>
            {{
              (
                (scope.row.provinceTag ? '省厅、' : '') +
                (scope.row.deptTag ? '公安部、' : '')).replace(/、$/, '')
            }}
          </div>
        </template>
      </el-table-column>
      <el-table-column label="区域" align="center" prop="area" width="180" v-if="columns[1].visible" />
      <el-table-column label="区域" align="center" prop="area" width="180" v-if="columns[1].visible"/>
      <el-table-column label="设备状态" align="center" prop="onState" v-if="columns[2].visible">
      <template slot-scope="scope">
        <dict-tag :options="dict.type.camera_state" :value="scope.row.onState"/>
      </template>
        <template slot-scope="scope">
          <dict-tag :options="dict.type.camera_state" :value="scope.row.onState"/>
        </template>
      </el-table-column>
      <el-table-column label="是否生成异常工单" align="center" prop="error" width="180" v-if="columns[3].visible" />
      <el-table-column label="是否生成异常工单" align="center" prop="error" width="180" v-if="columns[3].visible"/>
      <el-table-column label="管理单位" align="center" prop="unitName" width="180" v-if="columns[4].visible"/>
      <el-table-column label="数据时间" align="center" prop="mongoCreateTime" width="180" v-if="columns[5].visible"/>
      <el-table-column label="一机一档状态" align="center" prop="monitorQualify" width="180" v-if="columns[6].visible">
@@ -125,19 +134,21 @@
      <el-table-column label="当日抓拍量" align="center" prop="snapCount" width="180" v-if="columns[9].visible"/>
      <el-table-column label="时钟准确率" align="center" prop="clockPercent" width="180" v-if="columns[10].visible"/>
      <el-table-column label="上传及时率" align="center" prop="uploadPercent" width="180" v-if="columns[11].visible"/>
      <el-table-column label="主要属性一致率" align="center" prop="importantConPercent" width="180" v-if="columns[12].visible"/>
      <el-table-column label="主要属性一致率" align="center" prop="importantConPercent" width="180"
                       v-if="columns[12].visible"/>
      <el-table-column label="全量属性一致率" align="center" prop="majorConPercent" width="180" v-if="columns[13].visible"/>
      <el-table-column label="大图可用率" align="center" prop="bigUsefulPercent" width="180" v-if="columns[14].visible"/>
      <el-table-column label="url可用率" align="center" prop="urlPercent" width="180" v-if="columns[15].visible"/>
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width"  fixed="right">
          <template slot-scope="scope">
            <el-button
              size="mini"
              type="text"
              icon="el-icon-view"
              @click="handleView(scope.row,scope.index)"
            >详细</el-button>
          </template>
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right">
        <template slot-scope="scope">
          <el-button
            size="mini"
            type="text"
            icon="el-icon-view"
            @click="handleView(scope.row,scope.index)"
          >详细
          </el-button>
        </template>
      </el-table-column>
    </el-table>
@@ -156,7 +167,12 @@
          <el-form-item label="设备名称:">{{ form.name }}</el-form-item>
          <el-col :span="12">
            <el-form-item label="设备编码:">{{ form.serialNumber }}</el-form-item>
            <el-form-item label="标签:">{{ form.provinceTag == 0 ? '省厅' : '市局' }}</el-form-item>
            <el-form-item label="标签:">
              {{
                ((form.provinceTag ? '省厅、' : '') +
                  (form.deptTag ? '公安部、' : '')).replace(/、$/, '')
              }}
            </el-form-item>
            <el-form-item label="设备状态:">
              <div v-if="form.onState === 0">离线</div>
              <div v-else-if="form.onState === 1">在线</div>
@@ -216,32 +232,33 @@
</template>
<script>
import { videoCount, listMonitor, getMonitor, delMonitor, addMonitor, updateMonitor } from "@/api/platform/monitor";
import { listDept } from "@/api/system/dept";
import {videoCount, listMonitor, getMonitor, delMonitor, addMonitor, updateMonitor} from "@/api/platform/monitor";
import {listDept} from "@/api/system/dept";
export default {
  name: "Monitor",
  dicts: ['sys_normal_disable','platform_yes_no','camera_state'],
  dicts: ['sys_normal_disable', 'platform_yes_no', 'camera_state'],
  data() {
    return {
      deptList: [],
      // 列信息
      columns: [
        { key: 0, label: `标签`, visible: true },
        { key: 1, label: `区域`, visible: true },
        { key: 2, label: `设备状态`, visible: true },
        { key: 3, label: `是否生成异常工单`, visible: true },
        { key: 4, label: `管理单位`, visible: true },
        { key: 5, label: `数据时间`, visible: false },
        { key: 6, label: `一机一档状态`, visible: false },
        { key: 7, label: `是否为未注册设备`, visible: false },
        { key: 8, label: `抓拍数据量监测`, visible: false },
        { key: 9, label: `当日抓拍量`, visible: false },
        { key: 10, label: `时钟准确率`, visible: false },
        { key: 11, label: `上传及时率`, visible: false },
        { key: 12, label: `主要属性一致率`, visible: false },
        { key: 13, label: `全量属性一致率`, visible: false },
        { key: 14, label: `图片访问异常量`, visible: false },
        { key: 15, label: `大图不可用量`, visible: false }
        {key: 0, label: `标签`, visible: true},
        {key: 1, label: `区域`, visible: true},
        {key: 2, label: `设备状态`, visible: true},
        {key: 3, label: `是否生成异常工单`, visible: true},
        {key: 4, label: `管理单位`, visible: true},
        {key: 5, label: `数据时间`, visible: false},
        {key: 6, label: `一机一档状态`, visible: false},
        {key: 7, label: `是否为未注册设备`, visible: false},
        {key: 8, label: `抓拍数据量监测`, visible: false},
        {key: 9, label: `当日抓拍量`, visible: false},
        {key: 10, label: `时钟准确率`, visible: false},
        {key: 11, label: `上传及时率`, visible: false},
        {key: 12, label: `主要属性一致率`, visible: false},
        {key: 13, label: `全量属性一致率`, visible: false},
        {key: 14, label: `图片访问异常量`, visible: false},
        {key: 15, label: `大图不可用量`, visible: false}
      ],
      count: {
        totalPosts: 0,
@@ -287,16 +304,16 @@
      // 表单校验
      rules: {
        serialNumber: [
          { required: true, message: "设备编码不能为空", trigger: "blur" }
          {required: true, message: "设备编码不能为空", trigger: "blur"}
        ],
        name: [
          { required: true, message: "设备名称不能为空", trigger: "blur" }
          {required: true, message: "设备名称不能为空", trigger: "blur"}
        ],
        onState: [
          { required: true, message: "设备状态", trigger: "blur" }
          {required: true, message: "设备状态", trigger: "blur"}
        ],
        address: [
          { required: true, message: "地址不能为空", trigger: "blur" }
          {required: true, message: "地址不能为空", trigger: "blur"}
        ],
      }
    };
@@ -304,13 +321,22 @@
  created() {
    this.getVideoCount();
    this.getList();
    listDept({ status: 0 }).then(response => {
    listDept({status: 0}).then(response => {
      this.deptList = response.data.filter(item => item.area);
    });
  },
  methods: {
    clickTab(active) {
      this.queryParams.provinceTag = active
      if (active === 0) {
        this.queryParams.provinceTag = true
        this.queryParams.deptTag =null
      } else if (active === 1) {
        this.queryParams.provinceTag = null
        this.queryParams.deptTag = true
      }else {
        this.queryParams.provinceTag = null
        this.queryParams.deptTag = null
      }
      this.getList()
      this.getVideoCount()
    },
@@ -368,7 +394,7 @@
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.id)
      this.single = selection.length!==1
      this.single = selection.length !== 1
      this.multiple = !selection.length
    },
    /** 新增按钮操作 */
@@ -410,12 +436,13 @@
    /** 删除按钮操作 */
    handleDelete(row) {
      const ids = row.id || this.ids;
      this.$modal.confirm('是否确认删除设备资产编号为"' + ids + '"的数据项?').then(function() {
      this.$modal.confirm('是否确认删除设备资产编号为"' + ids + '"的数据项?').then(function () {
        return delMonitor(ids);
      }).then(() => {
        this.getList();
        this.$modal.msgSuccess("删除成功");
      }).catch(() => {});
      }).catch(() => {
      });
    },
    /** 导出按钮操作 */
    handleExport() {
@@ -454,13 +481,13 @@
}
.box-card {
  background-color: #ffffff;
  width: 100%;
  margin-bottom: 20px;
  height: 120px
}
.icon-container {
  display: flex;
  justify-content: center;
@@ -470,6 +497,7 @@
  height: 80px;
  margin-left: 5%;
}
.el-icon-truck {
  font-size: 50px;
  color: #FFFFFF;