lohir
2024-10-23 8527e27c33e1006186a365fbf0eb9074ff952b22
src/views/system/data-manage/data-detail/index.vue
@@ -1,13 +1,16 @@
<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: 400px;max-width: 400px;margin-bottom: 5px;border-radius: 1px; user-select: none"
      v-show="index !== 'image_resource_security'">
      <div @click="clickTab(0)" class="tab"
           :class="{tabActive: 0 === queryParams.dataType, tabInactive: 0 !== queryParams.dataType}">全部
      </div>
      <div @click="clickTab(1)" class="tab"
           :class="{tabActive: 1 === queryParams.dataType, tabInactive: 1 !== queryParams.dataType}">省厅考核
      </div>
      <div @click="clickTab(2)" class="tab"
           :class="{tabActive: 2 === queryParams.dataType, tabInactive: 2 !== queryParams.dataType}">公安部考核
      </div>
    </div>
    <el-card class="box-card" v-show="index !== 'image_resource_security'">
@@ -76,14 +79,13 @@
        <el-form-item label="关键词" prop="bayonetNumber">
          <el-input v-model="queryParams.keyword" placeholder="关键词搜索" clearable @input="handleQuery"/>
        </el-form-item>
        <el-form-item label="时间范围" prop="timeRange">
          <el-date-picker
            v-model="queryParams.timeRange"
            type="daterange"
            range-separator="至"
            start-placeholder="开始日期"
            end-placeholder="结束日期">
          </el-date-picker>
        <el-form-item label="时间" prop="date">
            <el-date-picker
              v-model="queryParams.date"
              type="date"
              placeholder="选择日期"
              value-format="yyyy-MM-dd">
            </el-date-picker>
        </el-form-item>
        <el-form-item>
          <el-button type="primary" icon="el-icon-search" size="small" @click="handleQuery">搜索</el-button>
@@ -168,7 +170,7 @@
<script>
import {dataCenter} from "@/api/platform/data-center";
import {videoData, carData, faceData, equipment} from "./list";
import {carData, equipment, faceData, videoData} from "./list";
import {listSecurity, updateSecurity} from '@/api/platform/resource-security';
import {getToken} from "@/utils/auth";
@@ -225,7 +227,7 @@
        pageNum: 1,
        pageSize: 10,
        keyword: '',
        timeRange: [],
        date: '',
        dataType: 0,
      },
      // 表单参数
@@ -260,18 +262,13 @@
    // 获取当前日期
    const today = new Date();
    // 将日期减去一天
    const yesterday = new Date(today.getTime() - 24 * 60 * 60 * 1000);
    // 获取年、月、日
    const year = yesterday.getFullYear();
    let month = (yesterday.getMonth() + 1).toString().padStart(2, '0'); // 月份是从0开始的,所以加1
    let day = yesterday.getDate().toString().padStart(2, '0');
    const year = today.getFullYear();
    let month = (today.getMonth() + 1).toString().padStart(2, '0'); // 月份是从0开始的,所以加1
    let day = today.getDate().toString().padStart(2, '0');
    // 拼接成 yyyy-MM-dd 格式
    let yesterday1 = `${year}-${month}-${day}`;
    this.queryParams.timeRange = [yesterday1, yesterday1]
    this.index = this.$route.query.index;
    this.queryParams.date = `${year}-${month}-${day}`;
    if (this.$route.query.type === '1') {
      let data = videoData.table.filter(item => item.index === this.$route.query.index)[0]
      this.tableHead = data.columns;
@@ -296,6 +293,7 @@
      this.cardList = data.card;
      this.showList = data.showList;
    }
    this.getDicts(this.$route.query.dict)
    this.getList();
  },
  methods: {
@@ -352,10 +350,6 @@
      this.loading = true;
      if (this.index === 'image_resource_security') {
        this.getSecurityCard()
      }
      if (this.queryParams.timeRange && this.queryParams.timeRange.length > 0) {
        this.queryParams.startTime = this.queryParams.timeRange[0]
        this.queryParams.endTime = this.queryParams.timeRange[1]
      }
      dataCenter(url, this.queryParams).then(response => {
        response.data.list = response.data.list && response.data.list.length > 0 ? response.data.list : []