fuliqi
2025-01-15 79f0dbe2bc5588c617ddfd82ac027977c764f5fe
src/views/system/data-manage/equipment/index.vue
@@ -12,28 +12,29 @@
        <el-col :xl="14" :lg="14" :md="12" :sm="14" :xs="16">
          <div class="dashboard">
            <div class="dashboard-item">
              <h3 style="color: #5C9BF8">{{ count.totalPosts }}</h3>
              <h3 style="color: #5C9BF8">{{ count.total }}</h3>
              <p>设备总数</p >
            </div>
              <div class="dashboard-item">
                <h3 style="color: #5C9BF8">{{ count.video }}</h3>
                <p>视频设备数</p >
              </div>
            <div class="dashboard-item">
              <h3 style="color: #5C9BF8">{{ count.totalPosts }}</h3>
              <p>人脸设备数</p >
            </div>
            <div class="dashboard-item">
              <h3 style="color: #5C9BF8">{{ count.totalPosts }}</h3>
              <h3 style="color: #5C9BF8">{{ count.car }}</h3>
              <p>车辆设备数</p >
            </div>
            <div class="dashboard-item">
              <h3 style="color: #5C9BF8">{{ count.totalPosts }}</h3>
              <p>视频设备数</p >
              <h3 style="color: #5C9BF8">{{ count.face }}</h3>
              <p>人脸设备数</p >
            </div>
            <div class="dashboard-item">
              <h3 style="color: #3eba45">{{ count.examine }}</h3>
              <p>考核中</p >
            </div>
            <div class="dashboard-item">
              <h3 style="color: #3eba45">{{ count.totalMembers }}</h3>
              <p>正常数</p >
            </div>
            <div class="dashboard-item">
              <h3 style="color: #fe640d">{{ count.postsPercentage }}</h3>
              <p>异常数</p >
              <h3 style="color: #6f7583">{{ count.notExamine }}</h3>
              <p>未考核</p >
            </div>
          </div>
        </el-col>
@@ -49,37 +50,31 @@
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="区域" prop="onState">
      <el-form-item label="考核状态" prop="examineStatus">
        <el-select
          v-model="queryParams.address"
          placeholder="请选择区域"
          v-model="queryParams.examineStatus"
          placeholder="请选择状态"
          clearable
        >
          <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 label="考核中" :value="1"/>
          <el-option label="未考核" :value="0"/>
        </el-select>
      </el-form-item>
      <el-form-item label="设备状态" prop="onState">
        <el-select
          v-model="queryParams.onState"
          placeholder="设备状态"
          clearable
          style="width: 100px"
        >
        <el-option
          v-for="dict in dict.type.camera_state"
          :key="dict.value"
          :label="dict.label"
          :value="dict.value"
        />
        </el-select>
      </el-form-item>
<!--      <el-form-item label="设备状态" prop="onState">-->
<!--        <el-select-->
<!--          v-model="queryParams.onState"-->
<!--          placeholder="设备状态"-->
<!--          clearable-->
<!--          style="width: 100px"-->
<!--        >-->
<!--        <el-option-->
<!--          v-for="dict in dict.type.camera_state"-->
<!--          :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="small" @click="handleQuery">搜索</el-button>
@@ -88,14 +83,23 @@
    </el-form>
    <el-row :gutter="10" class="mb8">
<!--      <el-col :span="1.5">-->
<!--        <el-button-->
<!--          type="warning"-->
<!--          plain-->
<!--          icon="el-icon-download"-->
<!--          size="mini"-->
<!--          @click="handleExport"-->
<!--        >导出</el-button>-->
<!--      </el-col>-->
      <el-col :span="1.5">
        <el-button
          type="warning"
          type="danger"
          plain
          icon="el-icon-download"
          icon="el-icon-delete"
          size="mini"
          @click="handleExport"
        >导出</el-button>
          @click="clearMonitor"
        >清理一机一档</el-button>
      </el-col>
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList" :columns="columns"></right-toolbar>
    </el-row>
@@ -104,20 +108,22 @@
      <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" v-if="columns[0].visible"/>
<!--      <el-table-column label="标签" align="center" prop="publicSecurity" width="180" v-if="columns[0].visible"/>-->
      <el-table-column label="区域" align="center" prop="cameraCaptureArea" width="180" v-if="columns[1].visible"/>
      <el-table-column label="设备状态" align="center" prop="onState" v-if="columns[2].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"/>
<!--          <dict-tag :options="dict.type.camera_state" :value="scope.row.onState"/>-->
          <div v-if="scope.row.onState ==1">考核中</div>
          <div v-else-if="scope.row.onState ==0" >未考核</div>
        </template>
      </el-table-column>
      <el-table-column label="数据时间" align="center" prop="installedTime" width="180" v-if="columns[3].visible"/>
      <el-table-column label="管理单位" align="center" prop="managementUnit" width="180" v-if="columns[4].visible"/>
      <el-table-column v-for="(column, index) in dynamicColumnList" :key="index" :label="column.labelValue" :prop="column.propName" align="center">
        <template slot-scope="scope">
          {{ getDynamicValue(scope.row, column.propName) }}
        </template>
      </el-table-column>
<!--      <el-table-column v-for="(column, index) in dynamicColumnList" :key="index" :label="column.labelValue" :prop="column.propName" align="center">-->
<!--        <template slot-scope="scope">-->
<!--          {{ getDynamicValue(scope.row, column.propName) }}-->
<!--        </template>-->
<!--      </el-table-column>-->
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width"  fixed="right">
          <template slot-scope="scope">
            <el-button
@@ -145,22 +151,22 @@
          <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.deptName }} </el-form-item>
            <el-form-item label="设备状态:">
              <div v-if="form.onState === 1">可用</div>
              <div v-else-if="form.onState === 2">不可用</div>
            <el-form-item label="地区:">{{ form.cameraCaptureArea }} </el-form-item>
            <el-form-item label="管理单位:">{{ form.managementUnit }} </el-form-item>
            <el-form-item label="考核状态:">
              <div v-if="form.onState == 1">考核中</div>
              <div v-else-if="form.onState == 0">未考核</div>
            </el-form-item>
          </el-col>
<!--          <el-col :span="24">-->
<!--            <el-form-item label="地址:">{{ form.address }}</el-form-item>-->
<!--          </el-col>-->
          <el-col :span="24">
            <el-form-item label="地址:">{{ form.address }}</el-form-item>
            <el-form-item label="数据时间:">{{ form.installedTime }}</el-form-item>
          </el-col>
          <el-col :span="24">
            <el-form-item label="安装时间:">{{ form.installedTime }}</el-form-item>
          </el-col>
          <el-col :span="24">
            <el-form-item label="管理单位:">{{ form.managementUnit }}</el-form-item>
          </el-col>
<!--          <el-col :span="24">-->
<!--            <el-form-item label="管理单位:">{{ form.managementUnit }}</el-form-item>-->
<!--          </el-col>-->
        </el-row>
      </el-form>
      <div slot="footer" class="dialog-footer">
@@ -173,7 +179,7 @@
<script>
import { videoCount, listMonitor, getMonitor, delMonitor, addMonitor, updateMonitor } from "@/api/platform/monitor";
import { getDynamicColumnList } from '@/api/platform/dynamicColumn'
import { dataCenter } from "@/api/platform/data-center";
import { dataCenter,clearMonitor,assetManagementCount } from "@/api/platform/data-center";
export default {
  name: "Monitor",
  dicts: ['sys_normal_disable', 'platform_yes_no','camera_state'],
@@ -248,10 +254,20 @@
    };
  },
  created() {
    this.getVideoCount();
    this.getCount();
    this.getList();
  },
  methods: {
    //清理一机一档
    clearMonitor() {
      this.$modal.confirm('是否确认清理一机一档?').then(function() {
        return clearMonitor();
      }).then(() => {
        this.getList()
        this.getCount();
        this.$modal.msgSuccess("清理成功");
      }).catch(() => {});
    },
    getDyColumn() {
      // 查询动态列
      let params = {
@@ -276,8 +292,8 @@
      });
    },
     /** 查询设备资产统计数 */
     getVideoCount() {
      videoCount('1').then(response => {
     getCount() {
       assetManagementCount().then(response => {
        this.count = response.data;
      });
    },
@@ -303,9 +319,8 @@
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.queryParams.cameraFunType = 1;
      this.getList();
      this.getVideoCount();
      this.getCount();
    },
    /** 重置按钮操作 */
    resetQuery() {