From 929cf4c7be11bfd1e134d0cb0d7cbbe94772ebdf Mon Sep 17 00:00:00 2001
From: zhangzengfei <zhangzengfei@iotlink.com>
Date: 星期一, 07 九月 2020 15:35:14 +0800
Subject: [PATCH] 摄像机树增加导入功能

---
 src/pages/library/components/personList.vue |  174 +++++++++++++++++++++++++++++++++++++++++++++++++++++-----
 1 files changed, 159 insertions(+), 15 deletions(-)

diff --git a/src/pages/library/components/personList.vue b/src/pages/library/components/personList.vue
index 4e75db3..b86297b 100644
--- a/src/pages/library/components/personList.vue
+++ b/src/pages/library/components/personList.vue
@@ -55,7 +55,7 @@
       <el-col :span="2">
         <div class="text-left">
           <upload
-            limitTypes=".jpg,.png,.jpeg,.gif,.mp4"
+            limitTypes=".jpg,.png,.jpeg"
             limitSize
             uploadBtntext="涓婁紶鐓х墖"
             uploadBtnIcon
@@ -77,7 +77,6 @@
         tooltip-effect="dark"
         style="width: 100%;"
         :fit="true"
-        :max-height="tableHeight"
         :default-sort="{prop: 'createTime', order: 'descending'}"
         @selection-change="handleSelectionChange"
         :header-cell-style="{background:'#f8f8f8',color:'#222222'}"
@@ -156,6 +155,9 @@
             <el-tooltip content="鏌ユ壘姝や汉" placement="top" popper-class="atooltip">
               <span class="iconfont iconsousuoren iconStyle1" @click="tosearch(scope.row)"></span>
             </el-tooltip>
+            <el-tooltip content="鏌ョ湅璇︽儏" placement="top" popper-class="atooltip">
+              <span class="iconfont iconsousuoren iconStyle1" @click="showDetail(scope.row)"></span>
+            </el-tooltip>
             <fTemplate authority="videoTable:edit">
               <el-tooltip content="澶嶅埗" placement="top" popper-class="atooltip">
                 <span
@@ -189,7 +191,7 @@
         </el-table-column>
       </el-table>
     </div>
-    <div class="pt5 pb20" style="height:40px;position:relative">
+    <div class="pt5 " style="height:40px;position:relative">
       <el-pagination
         @current-change="refrash"
         :current-page="BaseManageData.page"
@@ -198,6 +200,46 @@
         :total="BaseManageData.total"
       ></el-pagination>
     </div>
+    <el-dialog title="鎶撴媿璇︽儏" :visible.sync="cameraDetailVisible" okText="纭畾" >
+      <div class="top-bar">
+        <el-date-picker size="mini" @change="timeChange" v-model="timeRange" value-format="yyyy-MM-dd HH:mm:ss"
+            type="datetimerange" range-separator="鑷�" start-placeholder="寮�濮嬫椂闂�" end-placeholder="缁撴潫鏃堕棿"></el-date-picker>
+        <div style="margin:0 10px;display:flex;"><span style="width:68px;">鍋滅暀鏃堕暱:</span><el-input size="mini" style="width: 80px;"  v-model.number="reqCameraParams.thresholdTime"></el-input>s</div> 
+          <el-button size="mini" type="primary" @click="postCameraData">鏌ヨ</el-button>
+      </div>
+      <p class="member-info">
+        <label class="">浜哄憳淇℃伅:</label>
+        <ul>
+          <li><span>濮撳悕:</span><span>{{memberInfo.personName}}</span></li>
+          <li><span>鎬у埆:</span><span>{{memberInfo.sex}}</span></li>
+          <li><span>韬唤璇佸彿:</span><span>{{memberInfo.idCard}}</span></li>
+          <li><span>鎰忓浘:</span><span>{{memberInfo.reserved}}</span></li>
+        </ul>
+      </p>
+      <el-table :data="cameraDetailData" border>
+        <el-table-column prop="startFacePicUrl" label="鎶撴媿瀹炴櫙" width="160" align="center">
+          <template slot-scope="scope">
+            <div>
+              <img
+                v-if="scope.row.startFacePicUrl"
+                :src="`/httpImage/`+scope.row.startFacePicUrl"
+                style="max-height:84px;width:84px;object-fit:contain;background:rgba(0,0,0,0.35);"
+                class="avatar"
+              />
+            </div>
+          </template>
+        </el-table-column>
+        <el-table-column prop="cameraName" label="鎽勫儚鏈哄悕绉�" width="100" align="center"></el-table-column>
+        <el-table-column prop="startTime" label="寮�濮嬫椂闂�"  align="center"></el-table-column>
+        <el-table-column prop="endTime" label="缁撴潫鏃堕棿"  align="center"></el-table-column>
+        <el-table-column prop="stayTime" label="鍋滅暀鏃堕暱" width="99" align="center">
+          <template slot-scope="scope">
+            <span>{{scope.row.stayTime}} 绉� </span>
+          </template>
+        </el-table-column>
+      </el-table>
+      <p style="text-align:right; font-size: 14px;">鍏眥{faceDataCount}}鏉℃暟鎹�</p>
+    </el-dialog>
     <el-dialog
       title="淇敼淇℃伅"
       :visible.sync="dialogFormVisible"
@@ -450,14 +492,49 @@
 </template>
 <script>
 import { updateBasePerson, deleteBasePersons } from "@/api/baseLibrary";
+import { getCameraFaceData } from "@/api/es";
 import axios from "axios";
 // import { findByType } from '@/server/video.js'
 import Upload from "./upload";
 import fTemplate from "@/components/fTemplate";
 import UploadIcon from "@/components/searching/UploadIcon.vue";
+
+Date.prototype.Format = function (fmt) {
+  var o = {
+    "M+": this.getMonth() + 1, //鏈堜唤 
+    "d+": this.getDate(), //鏃� 
+    "H+": this.getHours(), //灏忔椂 
+    "m+": this.getMinutes(), //鍒� 
+    "s+": this.getSeconds(), //绉� 
+    "q+": Math.floor((this.getMonth() + 3) / 3), //瀛e害 
+    "S": this.getMilliseconds() //姣 
+  };
+  if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
+  for (var k in o)
+    if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
+  return fmt;
+}
+
 export default {
   data() {
     return {
+      timeRange: [new Date(2020, 7, 25, 8), new Date()],
+      memberInfo: {
+        personName: '',
+        sex: '',
+        idCard: '',
+        reserved: ''
+      },
+      reqCameraParams: {
+        cameraIds: [],
+        startDate: new Date(2020, 7, 25, 8).Format("yyyy-MM-dd HH:mm:ss"),
+        endDate: new Date().Format("yyyy-MM-dd HH:mm:ss"),
+        thresholdTime: 10,
+        personIds: []
+      },
+      cameraDetailData: [],
+      cameraDetailVisible: false,
+
       dialogFormVisible: false,
       copyVisiabled: false,
       moveVisiabled: false,
@@ -468,7 +545,7 @@
       pageSize: 10,
       total: 0,
       orderType: "desc",
-      orderName: "id",
+      orderName: "createTime",
       contentValue: "",
       visible: false,
       selectedRowKeys: [],
@@ -500,6 +577,7 @@
       peoperLevel: [],
       oldWidth: "",
       oldHeight: "",
+      faceDataCount: 0,
       // 涓婁紶鍚庣殑寮规鏄剧ず
       dialogVisible: false,
       // 鎵归噺涓婁紶鍚庣殑杩斿洖缁撴灉
@@ -521,6 +599,31 @@
     }
   },
   methods: {
+    postCameraData(){
+      getCameraFaceData(this.reqCameraParams).then(res=>{
+        if(res && res.code == 200){
+          this.cameraDetailData = res.data.allSource
+	  this.faceDataCount = res.data.count
+        }
+      })
+    },
+    timeChange(val) {
+      console.log(val);
+      this.reqCameraParams.startDate = val[0];
+      this.reqCameraParams.endDate = val[1];
+      
+    },
+    showDetail(row){
+      this.cameraDetailData = []
+      this.memberInfo.reserved = row.reserved;
+      this.memberInfo.idCard = row.idCard;
+      this.memberInfo.personName = row.personName;
+      this.memberInfo.sex = row.sex;
+      this.reqCameraParams.personIds = [];
+      this.reqCameraParams.personIds.push(row.id)
+      console.log(this.reqCameraParams)
+      this.cameraDetailVisible = true;
+    },
     isShow(authority) {
       if (this.isAdmin) {
         return true
@@ -816,18 +919,29 @@
         }
       }
     },
+    // tosearch(item) {
+    //   // console.log("璺宠浆鍦板潃", item)
+    //   var curWwwPath = window.document.location.href;
+    //   var pathname = window.document.location.pathname;
+    //   var pos = curWwwPath.indexOf(pathname);
+    //   var localhostPath = curWwwPath.substring(0, pos); //ip+port
+    //   var href = localhostPath + "/Layout/Searching"
+    //   let captureId = item.id == "" ? item.personId : item.id
+    //   var url = item.personPicUrl ? item.personPicUrl : item.personPicUrl
+    //   // console.log("璺宠浆鍦板潃",href,"url",url)
+    //   var compType = 0
+    //   window.open(href + '?showType=findByPic&targetId=' + captureId + '&picSmUrl=' + url + '&compType=' + compType)
+    // },
     tosearch(item) {
-      // console.log("璺宠浆鍦板潃", item)
-      var curWwwPath = window.document.location.href;
-      var pathname = window.document.location.pathname;
-      var pos = curWwwPath.indexOf(pathname);
-      var localhostPath = curWwwPath.substring(0, pos); //ip+port
-      var href = localhostPath + "/Layout/Searching"
+      //let captureId = item.id == "" ? item.baseInfo[0].targetId : item.id
       let captureId = item.id == "" ? item.personId : item.id
-      var url = item.personPicUrl ? item.personPicUrl : item.personPicUrl
-      // console.log("璺宠浆鍦板潃",href,"url",url)
-      var compType = 0
-      window.open(href + '?showType=findByPic&targetId=' + captureId + '&picSmUrl=' + url + '&compType=' + compType)
+      let imgUrl = item.personPicUrl ? item.personPicUrl : item.personPicUrl
+      let compType = 0;
+      
+      let message = 'toSearch?showType=findByPic&targetId=' + captureId + '&picSmUrl=' + imgUrl + '&compType=' + compType;
+      window.parent.postMessage({
+        msg: message
+      }, "*")
     },
     copyClick(row) {
       this.BaseManageData.personId = row.id
@@ -1032,6 +1146,12 @@
   border-bottom: none;
   // border-bottom: none;
 }
+.el-dialog{
+  min-width: 515px;
+  .el-button--info{
+    color: #222;
+  }
+}
 .el-dialog__header {
   padding: 20px 0 10px;
   text-align: left;
@@ -1077,7 +1197,10 @@
   color: #222222;
   text-align: center;
 }
-
+.el-table th{
+  color: #222;
+  background: #ececec;
+}
 .el-table .cell {
   padding-left: 8px !important;
   padding-right: 0px !important;
@@ -1150,4 +1273,25 @@
   min-height: 152px;
   border: 1px solid #eee;
 }
+.top-bar{
+  display: flex;
+  justify-content: space-between;
+  align-items: center;
+  line-height: 30px;
+}
+.member-info{
+  font-size: 13px;
+  margin: 10px 0;
+  display: flex;
+  label{
+    color: #999;
+    margin-right: 6px;
+  }
+  ul{
+    display: flex;
+    li{
+      margin-right: 8px;
+    }
+  }
+}
 </style>

--
Gitblit v1.8.0