fuliqi
2024-09-06 9e8d1bd0b6fb495920921214775b84d490e032a3
src/views/system/monitor/car/index.vue
@@ -2,12 +2,12 @@
  <div class="app-container">
    <el-card class="box-card" >
      <el-row type="flex" align="middle" justify="space-between">
        <el-col :xl="8" :lg="8" :md="10" :sm="8" :xs="6">
          <div class="icon-container" style="background-color: #5599F7">
        <el-col :span="4">
          <div class="icon-container" style="background-color: #1890FF">
            <i class="el-icon-truck"></i>
          </div>
        </el-col>
        <el-col :xl="14" :lg="14" :md="12" :sm="14" :xs="16">
        <el-col :span="20">
          <div class="dashboard">
            <div class="dashboard-item">
              <h3 style="color: #5C9BF8">{{ count.totalPosts }}</h3>
@@ -20,14 +20,6 @@
            <div class="dashboard-item">
              <h3 style="color: #fe640d">{{ count.postsPercentage }}</h3>
              <p>异常数</p >
            </div>
            <div class="dashboard-item">
              <h3>{{ count.totalViews }}</h3>
              <p>生成异常工单数</p >
            </div>
            <div class="dashboard-item">
              <h3>{{ count.totalCar }}</h3>
              <p>过车数据总量</p >
            </div>
            <div class="dashboard-item">
              <h3>{{ count.viewsPercentage }}%</h3>
@@ -52,15 +44,14 @@
          v-model="queryParams.address"
          placeholder="请选择区域"
          clearable
          @change="handleQuery"
        >
        <el-option label="自贡市" value="自贡市"/>
        <el-option label="沿滩区" value="沿滩区"/>
        <el-option label="大安区" value="大安区"/>
        <el-option label="贡井区" value="贡井区"/>
        <el-option label="自流井区" value="自流井区"/>
        <el-option label="高新区" value="高新区"/>
        <el-option label="荣县" value="荣县"/>
        <el-option label="富顺县" value="富顺县"/>
        <el-option
            v-for="dept in deptList"
            :key="dept.deptId"
            :label="dept.area"
            :value="dept.deptId"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="设备状态" prop="onState">
@@ -79,29 +70,14 @@
        </el-select>
      </el-form-item>
       <el-form-item label="是否生成异常工单" prop="defaultOrder" label-width="130px">
         <el-select
           v-model="queryParams.defaultOrder"
           placeholder="是否生成异常工单"
           clearable
           style="width: 170px"
         >
         <el-option
           v-for="dict in dict.type.platform_yes_no"
           :key="dict.value"
           :label="dict.label"
           :value="dict.value"
         />
         </el-select>
        </el-form-item>
      <el-form-item>
        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
        <el-button type="primary" icon="el-icon-search" size="small" @click="handleQuery">搜索</el-button>
        <el-button icon="el-icon-refresh" size="small" @click="resetQuery">重置</el-button>
      </el-form-item>
    </el-form>
    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
      <!-- <el-col :span="1.5">
        <el-button
          type="warning"
          plain
@@ -110,30 +86,32 @@
          @click="handleExport"
          v-hasPermi="['system:monitor:export']"
        >导出</el-button>
      </el-col>
      </el-col> -->
      <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="name" width="280" fixed show-overflow-tooltip/>
      <el-table-column label="设备编码" align="center" prop="serialNumber" width="180"/>
      <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" width="180" v-if="columns[0].visible">
        <template slot-scope="scope">
          <div>{{ scope.row.provinceTag == 0 ? "省厅" : "市局" }}</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="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" 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" 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" prop="error" width="180" v-if="columns[3].visible" />
      <el-table-column label="数据时间" align="center" prop="mongoCreateTime" width="180" v-if="columns[4].visible"/>
      <el-table-column label="管理单位" align="center" prop="unitName" width="180" v-if="columns[5].visible"/>
      <el-table-column label="当日抓拍量" align="center" prop="dataCount" width="180" v-if="columns[6].visible"/>
      <el-table-column label="时钟准确率" align="center" prop="clockPercent" width="180" v-if="columns[7].visible"/>
      <el-table-column label="大图可用率" align="center" prop="bigUsefulPercent" width="180" v-if="columns[8].visible"/>
      <el-table-column label="主要属性一致率" align="center" prop="majorConPercent" width="180" v-if="columns[9].visible"/>
      <el-table-column label="重要属性一致率" align="center" prop="importantConPercent" width="180" v-if="columns[10].visible"/>
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width"  fixed="right">
          <template slot-scope="scope">
            <el-button
@@ -161,7 +139,7 @@
          <el-col :span="12">
            <el-form-item label="设备编码:">{{ form.serialNumber }}</el-form-item>
            <el-form-item label="设备名称:">{{ form.name }} </el-form-item>
            <el-form-item label="地区:">{{ form.address }} </el-form-item>
            <el-form-item label="地区:">{{ form.area }} </el-form-item>
            <el-form-item label="上报部门:">{{ form.deptName }} </el-form-item>
            <el-form-item label="设备状态:">
              <div v-if="form.onState === 1">可用</div>
@@ -199,12 +177,13 @@
<script>
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'],
  data() {
    return {
      deptList: [],
      // 列信息
      columns: [
        { key: 0, label: `标签`, visible: true },
@@ -213,8 +192,11 @@
        { 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 },
        { key: 6, label: `当日抓拍量`, visible: true },
        { key: 7, label: `时钟准确率`, visible: true },
        { key: 8, label: `大图可用率`, visible: true },
        { key: 9, label: `主要属性一致率`, visible: true },
        { key: 10, label: `重要属性一致率`, visible: true },
      ],
      count: {
        totalPosts: 0,
@@ -277,6 +259,9 @@
  created() {
    this.getVideoCount();
    this.getList();
    listDept({ status: 0 }).then(response => {
      this.deptList = response.data.filter(item => item.area);
    });
  },
  methods: {
    /** 查询设备资产列表 */
@@ -326,6 +311,7 @@
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.queryParams.address = '';
      this.resetForm("queryForm");
      this.handleQuery();
    },
@@ -394,7 +380,7 @@
<style lang="scss" scoped>
.box-card {
  background-color: #F5F9FE;
  background-color: #ffffff;
  width: 100%;
  margin-bottom: 20px;
  height: 120px
@@ -403,8 +389,8 @@
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 20px;
  width: 20%;
  border-radius: 10px;
  width: 130px;
  height: 80px;
  margin-left: 5%;
}
@@ -415,9 +401,10 @@
.dashboard {
  display: flex;
  gap: 10%;
  gap: 5%;
  align-items: center;
  margin-left: -50%;
  justify-content: space-between;
  margin-right: 20px;
}
.dashboard-item {