xiangpei
2024-04-03 1259bce460f41ef166e4bb25a81690bcfd457e1b
src/views/system/face/index.vue
@@ -10,27 +10,27 @@
        <el-col :xl="14" :lg="14" :md="12" :sm="14" :xs="16">
          <div class="dashboard">
            <div class="dashboard-item">
              <h3 style="color: #5C9BF8">{{ totalPosts }}</h3>
              <h3 style="color: #5C9BF8">{{ count.totalPosts }}</h3>
              <p>设备总数</p >
            </div>
            <div class="dashboard-item">
              <h3 style="color: #3eba45">{{ totalMembers }}</h3>
              <h3 style="color: #3eba45">{{ count.totalMembers }}</h3>
              <p>正常数</p >
            </div>
            <div class="dashboard-item">
              <h3 style="color: #fe640d">{{ postsPercentage }}</h3>
              <h3 style="color: #fe640d">{{ count.postsPercentage }}</h3>
              <p>异常数</p >
            </div>
            <div class="dashboard-item">
              <h3>{{ totalOrders }}</h3>
              <h3>{{ count.totalViews }}</h3>
              <p>生成异常工单数</p >
            </div>
            <div class="dashboard-item">
              <h3>{{ totalViews }}</h3>
              <h3>{{ count.totalFace }}</h3>
              <p>抓拍数据总量</p >
            </div>
            <div class="dashboard-item">
              <h3>{{ viewsPercentage }}%</h3>
              <h3>{{ count.viewsPercentage }}%</h3>
              <p>设备运行率</p >
            </div>
          </div>
@@ -109,29 +109,29 @@
          @click="handleExport"
        >导出</el-button>
      </el-col>
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList" :columns="columns"></right-toolbar>
    </el-row>
    <el-table v-loading="loading" :data="monitorList" @selection-change="handleSelectionChange">
      <el-table-column type="selection" align="center" />
      <el-table-column label="设备名称" align="center" prop="name" width="280" fixed/>
      <el-table-column label="设备编码" align="center" prop="serialNumber" width="180"/>
      <el-table-column label="标签" align="center" prop="publicSecurity" width="180"/>
      <el-table-column label="区域" align="center" prop="address" width="180"/>
      <el-table-column label="设备状态" align="center" prop="onState">
      <el-table-column label="标签" align="center" prop="publicSecurity" width="180" v-if="columns[0].visible"/>
      <el-table-column label="区域" align="center" prop="address" 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>
      </el-table-column>
      <el-table-column label="是否生成异常工单" align="center" prop="defaultOrder" width="180">
      <el-table-column label="是否生成异常工单" align="center" prop="defaultOrder" width="180" v-if="columns[3].visible">
      <template slot-scope="scope">
        <dict-tag :options="dict.type.platform_yes_no" :value="scope.row.defaultOrder"/>
      </template>
      </el-table-column>
      <el-table-column label="数据时间" align="center" prop="installedTime" width="180"/>
      <el-table-column label="管理单位" align="center" prop="managementUnit" width="180"/>
      <el-table-column label="抓拍量" align="center" prop="model" width="180"/>
      <el-table-column label="持续无数据天数" align="center" prop="recovery" width="180"/>
      <el-table-column label="数据时间" align="center" prop="installedTime" width="180" v-if="columns[4].visible"/>
      <el-table-column label="管理单位" align="center" prop="managementUnit" width="180" v-if="columns[5].visible"/>
      <el-table-column label="抓拍量" align="center" prop="a" width="180" v-if="columns[6].visible"/>
      <el-table-column label="持续无数据天数" align="center" prop="a" width="180" v-if="columns[7].visible"/>
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width"  fixed="right">
          <template slot-scope="scope">
            <el-button
@@ -222,10 +222,10 @@
            <el-form-item label="管理单位:">{{ form.managementUnit }}</el-form-item>
          </el-col>
          <el-col :span="24">
            <el-form-item label="抓拍量:">{{ form.model }}</el-form-item>
            <el-form-item label="抓拍量:"></el-form-item>
          </el-col>
          <el-col :span="24">
            <el-form-item label="持续无数据天数:">{{ form.recovery }}</el-form-item>
            <el-form-item label="持续无数据天数:"></el-form-item>
          </el-col>
        </el-row>
      </el-form>
@@ -237,20 +237,32 @@
</template>
<script>
import { listMonitor, getMonitor, delMonitor, addMonitor, updateMonitor } from "@/api/platform/monitor";
import { videoCount, listMonitor, getMonitor, delMonitor, addMonitor, updateMonitor } from "@/api/platform/monitor";
export default {
  name: "Monitor",
  dicts: ['sys_normal_disable','platform_yes_no','camera_state'],
  data() {
    return {
      totalPosts: 1490,
      totalMembers: 1090,
      postsPercentage: 319,
      totalViews: 1200164,
      totalOrders: 81,
      viewsPercentage: 73.15,
      totalErrors: 0,
      // 列信息
      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: true },
        { key: 6, label: `抓拍量`, visible: true },
        { key: 7, label: `持续无数据天数`, visible: true }
      ],
      count: {
        totalPosts: 0,
        totalMembers: 0,
        postsPercentage: 0,
        totalViews: 0,
        totalFace: 0,
        viewsPercentage: 0
      },
      // 遮罩层
      loading: true,
      // 选中数组
@@ -302,6 +314,7 @@
    };
  },
  created() {
    this.getVideoCount();
    this.getList();
  },
  methods: {
@@ -312,6 +325,12 @@
        this.monitorList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    /** 查询设备资产统计数 */
    getVideoCount() {
      videoCount('3').then(response => {
        this.count = response.data;
      });
    },
    // 取消按钮
@@ -337,6 +356,7 @@
      this.queryParams.pageNum = 1;
      this.queryParams.cameraFunType = 3
      this.getList();
      this.getVideoCount();
    },
    /** 重置按钮操作 */
    resetQuery() {