heyujie
2021-07-30 4b43bfb3f6f499f480712dd29bef52275466afd6
src/pages/search/index/Searching.vue
@@ -4,7 +4,7 @@
      <div class="searching-right-nav">
        <el-breadcrumb separator-class="el-icon-arrow-right" style="display: inline-block;">
          <el-breadcrumb-item>
            <span @click="uploadChange()">检索</span>
            <span @click="uploadChange">检索</span>
          </el-breadcrumb-item>
          <el-breadcrumb-item v-if="!VideoPhotoData.uploadType">全部</el-breadcrumb-item>
          <el-breadcrumb-item v-if="VideoPhotoData.uploadType">以图搜图</el-breadcrumb-item>
@@ -156,17 +156,6 @@
            </div>
          </div>
        </div>
        <!-- <div class="foot">
          <el-pagination
            :current-page="VideoPhotoData.page"
            @current-change="changePages"
            @size-change="sizeChange"
            :page-sizes="VideoPhotoData.pageSizeOption"
            :page-size="VideoPhotoData.size"
            layout="total, sizes, prev, pager, next, jumper"
            :total="VideoPhotoData.total"
          ></el-pagination>
        </div>-->
      </div>
    </div>
    <hsc-window-style-metal class="windown-model">
@@ -237,8 +226,8 @@
<script>
import Card from "@/components/subComponents/Card";
import UploadImg from "@/components/searching/UploadImg";
//import CardWindow from "../components/cardWindow";
import bus from "./main";
import { getUrlKey } from "@/api/utils";
export default {
  components: {
    Card,
@@ -256,7 +245,6 @@
      searchImgCardWidth: "",
      tagValues: [],
      alarmValues: [],
      dialogVisible: false,
      taskValues: [],
      searchTime: [
        this.$moment().format("YYYY-MM-DD 00:00:00"),
@@ -264,7 +252,6 @@
      ],
      searchText: "",
      currentPage: 1,
    };
  },
  computed: {
@@ -298,8 +285,8 @@
    //     this.VideoTaskData.tasks[this.VideoTaskData.activeIndex].taskId
    //   ];
    // }
      let start =  this.getUrlKey("start")
      let end =  this.getUrlKey("end")
      let start =  getUrlKey("start")
      let end =  getUrlKey("end")
    if (start&&end) {
      this.searchTime = [start,end]
     this.VideoPhotoData.searchTime = [start,end]
@@ -310,14 +297,13 @@
    // 暂时关闭跳转 20200730
    // if (this.$route.query.showType === "findByPic") {
    if (this.getUrlKey("showType")) {
    if (getUrlKey("showType")) {
      this.VideoPhotoData.uploadDiaplay = true;
      // console.log("别处跳过来的以图搜图");
      this.VideoPhotoData.picUrl = this.getUrlKey("picSmUrl");
      this.VideoPhotoData.uploadImg = this.getUrlKey("picSmUrl");
      this.VideoPhotoData.picUrl = getUrlKey("picSmUrl");
      this.VideoPhotoData.uploadImg = getUrlKey("picSmUrl");
      this.VideoPhotoData.uploadType = true
      this.VideoPhotoData.compTargetId = this.getUrlKey("targetId")
      this.VideoPhotoData.compTargetType = this.getUrlKey("compType")
      this.VideoPhotoData.compTargetId = getUrlKey("targetId")
      this.VideoPhotoData.compTargetType = getUrlKey("compType")
      this.VideoPhotoData.size = 30
      this.VideoPhotoData.compareTabs = ["esData"];
      this.VideoPhotoData.findPerson2(); // 查找此人
@@ -325,7 +311,6 @@
      this.searchTime = this.getDateInit();
      this.VideoPhotoData.searchTime = this.getDateInit();
      // this.VideoPhotoData.querySearchList();
      console.log('mounted 查询es')
      this.setLoadSearch(this.VideoPhotoData.querySearchList());
    }
@@ -356,7 +341,6 @@
  watch: {
    'TreeDataPool.treeActiveName' (n, o) {
      if (n && n == 'camera') {
        console.log('mounted 查询es')
        this.VideoPhotoData.treeNodes = [];
        this.setLoadSearch(this.VideoPhotoData.querySearchList());
      }
@@ -367,14 +351,12 @@
        this.VideoPhotoData.findPersonByPage();
      } else {
        // this.VideoPhotoData.querySearchList();
        console.log('showTreeBox 查询es')
        this.setLoadSearch(this.VideoPhotoData.querySearchList());
      }
    },
    // "TreeDataPool.selectedNodes": function(newValue,oldValue) {
    //   if (newValue !== oldValue) {
    //     this.VideoPhotoData.treeNodes = newValue;
    //     console.log("监听树节点中的刷新方法", newValue,oldValue);
    //     this.VideoPhotoData.querySearchList();
    //   }
    // },
@@ -385,8 +367,6 @@
          if (this.VideoPhotoData.uploadType) {
            this.VideoPhotoData.findPersonByPage()
          } else {
            console.log('TreeDataPool.selectedNodes 查询es')
            this.setLoadSearch(this.VideoPhotoData.querySearchList());
          }
@@ -403,7 +383,6 @@
            this.VideoPhotoData.findPersonByPage()
          } else {
            // this.VideoPhotoData.querySearchList();
            console.log('DataStackPool.selectedDir 查询es')
            this.setLoadSearch(this.VideoPhotoData.querySearchList());
          }
        }
@@ -426,7 +405,6 @@
      }
    },
    "VideoPhotoData.uploadType": function (value) {
      console.log("页面模式:", value)
      if (value) {
        this.typeDisable = true;
        this.disabled = true;
@@ -443,10 +421,8 @@
    },
    "VideoPhotoData.uploadDiaplay": function (value) {
      this.getHeight();
      console.log("upload的值是:", value)
      if (value) {
        if (!this.VideoPhotoData.uploadType) {
          console.log("uploadDisplay中的刷新");
          let scrollContain = this.$refs.scrollContain
          this.VideoPhotoData.scrollContainDom = scrollContain
          this.VideoPhotoData.showType = "search";
@@ -465,12 +441,9 @@
  },
  methods: {
    isShowUpload () {
      console.log('isShowUpload', this.VideoPhotoData.uploadDiaplay)
      this.getHeight();
      console.log("upload的值是:", this.VideoPhotoData.uploadDiaplay)
      if (this.VideoPhotoData.uploadDiaplay) {
        if (!this.VideoPhotoData.uploadType) {
          console.log("uploadDisplay中的刷新");
          let scrollContain = this.$refs.scrollContain
          this.VideoPhotoData.scrollContainDom = scrollContain
          this.VideoPhotoData.showType = "search";
@@ -498,7 +471,6 @@
      let integerSearchImg = parseInt((w - 300) / 325);
      // 取消size修改
      // console.log(integer, integerSearchImg)
      // this.handleSizeChange(integer, integerSearchImg);
      this.cardWidth = `calc(${100 / integer}% - 20px)`;
@@ -506,6 +478,7 @@
    },
    uploadChange () {
      this.VideoPhotoData.uploadDiaplay = false;
      this.VideoPhotoData.clearStatus()
    },
    blackAngWhite () {
      if (this.VideoPhotoData.selectBlacks.length > 0) {
@@ -544,7 +517,6 @@
      }
      let res = this.VideoPhotoData.addBase(item)
      res.then(data => {
        console.log("then", data)
        if (data.success) {
          this.$notify({
            title: "成功",
@@ -617,12 +589,10 @@
    },
    searchingBtn () {
      // let obj = document.getElementById('searchMid');
      // console.log(obj,'target',document)
      // let load = this.$loading({
      //   target:obj,
      // })
      // load.close();
      // console.log(load,'loading')
      // this.AuthData.loading = true
      this.VideoPhotoData.page = 1;
      this.VideoPhotoData.queryTabs = this.tagValues;
@@ -639,14 +609,11 @@
      //this.VideoPhotoData.inputValue = this.searchText;
      this.VideoPhotoData.showType = this.showType;
      if (!this.VideoPhotoData.uploadType) {
        console.log("查询方法");
        this.VideoPhotoData.uploadDiaplay = false;
        //this.VideoPhotoData.page = this.currentPage;
        // this.VideoPhotoData.querySearchList();
        console.log('搜索按钮触发 查询es')
        this.setLoadSearch(this.VideoPhotoData.querySearchList());
      } else {
        console.log("以图搜图");
        //this.VideoPhotoData.page = this.currentPage;
        // this.VideoPhotoData.findPersonByPage();
        this.setLoadSearch(this.VideoPhotoData.findPersonByPage());
@@ -674,13 +641,11 @@
          arr.push(5);
        }
      });
      // console.log("输出的数组:", arr);
      return arr;
    },
    changePages (page) {
      this.VideoPhotoData.page = page;
      if (!this.VideoPhotoData.uploadType) {
        console.log("分页改变!")
        this.VideoPhotoData.uploadDiaplay = false;
        // this.VideoPhotoData.querySearchList();
        this.setLoadSearch(this.VideoPhotoData.querySearchList());
@@ -745,11 +710,7 @@
        this.AuthData.closeLoad();
      })
    },
    getUrlKey (name) {
      return decodeURIComponent((new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(location.href) || [, ""])[1].replace(/\+/g, '%20')) || null
    },
    tagChange (obj) {
      console.log(obj)
      if (obj.length > 0) {
        this.showType = "compare";
      } else {