Commit eb251211 by 李君

记录增加删除

1 parent 4c5642f8
window._serverHost = ['localhost', '192.168.1.168'].includes(window.location.hostname) ? 'mall.keliuyun.com' : window.location.host
window._baseUrl = ['localhost', '192.168.1.168'].includes(window.location.hostname) ? 'https://mall.keliuyun.com//tool/' : `${window.location.origin}/btool/`
window._baseImgUrl = ['localhost', '192.168.1.168'].includes(window.location.hostname) ? 'https://mall.keliuyun.com/images/' : `${window.location.origin}/images/`
window._socketUrl = ['localhost', '192.168.1.168'].includes(window.location.hostname) ? `wss://${window._serverHost}/btool/` : `wss://${window._serverHost}/btool/`
window._serverHost = ['localhost', '192.168.1.134'].includes(window.location.hostname) ? '117.133.143.116:33333' : window.location.host
window._baseUrl = ['localhost', '192.168.1.134'].includes(window.location.hostname) ? 'http://117.133.143.116:33333/tool/' : `${window.location.origin}/btool/`
window._baseImgUrl = ['localhost', '192.168.1.134'].includes(window.location.hostname) ? 'http://117.133.143.116:33333/images/' : `${window.location.origin}/images/`
window._socketUrl = ['localhost', '192.168.1.134'].includes(window.location.hostname) ? `wss://${window._serverHost}/btool/` : `wss://${window._serverHost}/btool/`
const log = console.log.bind(console)
\ No newline at end of file
......@@ -4,7 +4,7 @@ import Cookies from "js-cookie"
import {getTimestampString} from "@/PublicUtil/PublicUtil"
import {ElMessage} from 'element-plus'
// 创建 axios 的一个实例
let baseURL = ['localhost', '192.168.1.28'].includes(window.location.hostname) ? '' : window._baseUrl
let baseURL = ['localhost', '192.168.1.134'].includes(window.location.hostname) ? '' : window._baseUrl
const axiosInstance = axios.create(
{
baseURL: baseURL,
......@@ -14,14 +14,14 @@ const axiosInstance = axios.create(
// 请求拦截器
axiosInstance.interceptors.request.use(
config => {
// Cookies.set('atoken','8367538e-7bb0-4f9e-984e-d01aba8e70bd')
Cookies.set('atoken','8246b767-9f23-47ac-bf2c-ef0ddfe8d629')
if(!Cookies.get('atoken')){
ElMessage({
message: `登录过期,请重新登录`,
type: 'warning'
})
setTimeout(()=>{
let url = ['localhost', '192.168.1.28'].includes(window.location.hostname) ? 'https://store.keliuyun.com/' : window.location.origin
let url = ['localhost', '192.168.1.134'].includes(window.location.hostname) ? 'https://store.keliuyun.com/' : window.location.origin
// if(url.includes('36.112.68.214')){
// url = 'http://36.112.68.214:33333/'
// }
......@@ -45,7 +45,7 @@ axiosInstance.interceptors.response.use(
type: 'warning'
})
setTimeout(()=>{
let url = ['localhost', '192.168.1.28'].includes(window.location.hostname) ? 'https://store.keliuyun.com/' : window.location.origin
let url = ['localhost', '192.168.1.134'].includes(window.location.hostname) ? 'https://store.keliuyun.com/' : window.location.origin
// if(url.includes('36.112.68.214')){
// url = 'http://36.112.68.214:33333/'
// }
......
......@@ -30,6 +30,10 @@ const menuRoute = [
component: () => import("@/views/SnapshotCluster/SnapshotCluster.vue"),
},
{
path: 'SnapshotCluster1',
component: () => import("@/views/SnapshotCluster1/SnapshotCluster.vue"),
},
{
path: 'EquipmentTimeErrorVerification',
component: () => import("@/views/EquipmentTimeErrorVerification/EquipmentTimeErrorVerification.vue"),
},
......
......@@ -115,6 +115,12 @@
<span style="padding: 0 5px">停留时长检索</span>
</div>
</a-menu-item>
<a-menu-item :key="'/Main/SnapshotCluster1'">
<div class="flex-vertical-center">
<img :src="require('./Icons/6.svg')" style="height: auto;width:20px"/>
<span style="padding: 0 5px">抓拍聚类</span>
</div>
</a-menu-item>
</a-menu>
</el-aside>
<el-main>
......
......@@ -77,6 +77,14 @@ class SnapshotRecordApi {
}
)
}
delRecord(data) {
return axiosInstance.request(
{
method: 'DELETE',
url: `/faceRecognitions/${data.id}`,
}
)
}
}
......
.single-image {
height: 300px;
width: 100%;
}
.direction{
font-weight: 900;
background-color: red;
color: white;
}
.direction1{
background-color: green;
}
.direction0{
background-color: orange;
}
<template>
<div class="containter">
<a-form :model="queryForm" layout="inline" :label-col="{ style: { width: '70px' } }">
<a-form-item label="集团:" style="padding: 5px 0">
<a-select v-model:value="queryForm.account_id"
style="width: 240px"
mode="multiple"
:maxTagCount="1"
@change="onAccountChange"
:options="accountList"
optionFilterProp="label"
show-search
>
</a-select>
</a-form-item>
<a-form-item label="广场:" style="padding: 5px 0">
<a-select v-model:value="queryForm.plaza_id"
style="width: 240px"
mode="multiple"
:maxTagCount="1"
@change="onPlazaChange"
:options="plazaList"
optionFilterProp="label"
show-search
>
</a-select>
</a-form-item>
<a-form-item label="出入类型:" style="padding: 5px 0">
<a-select v-model:value="queryForm.type" style="width: 240px">
<a-select-option :value="0">全场</a-select-option>
<a-select-option :value="1">广场出入口</a-select-option>
<a-select-option :value="2">楼层出入口</a-select-option>
<a-select-option :value="3">店铺出入口</a-select-option>
<a-select-option :value="4">其他</a-select-option>
</a-select>
</a-form-item>
<a-form-item label="区域信息:" style="padding: 5px 0">
<a-select v-model:value="queryForm.zone_id"
style="width: 240px"
mode="multiple"
:maxTagCount="1"
@change="onZoneChange"
:options="zoneList"
optionFilterProp="label"
show-search
>
</a-select>
</a-form-item>
<a-form-item label="监控点:" style="padding: 5px 0">
<a-select v-model:value="queryForm.gate_id"
style="width: 240px"
mode="multiple"
:maxTagCount="1"
:options="gateList"
optionFilterProp="label"
show-search
>
</a-select>
</a-form-item>
<a-form-item label="方向:" style="padding: 5px 0">
<a-select v-model:value="queryForm.direction"
mode="multiple"
:maxTagCount="1"
style="width: 240px">
<a-select-option :value="1"></a-select-option>
<a-select-option :value="-1"></a-select-option>
<a-select-option :value="0">横穿</a-select-option>
</a-select>
</a-form-item>
<a-form-item label="抓拍类型:" style="padding: 5px 0">
<a-select v-model:value="queryForm.picType" style="width: 240px">
<a-select-option :value="1">半身照</a-select-option>
<a-select-option :value="2">全身照</a-select-option>
</a-select>
</a-form-item>
<a-form-item label="人员类型:" style="padding: 5px 0">
<a-select v-model:value="queryForm.personType"
mode="multiple"
:maxTagCount="1"
style="width: 240px">
<a-select-option :value="1">店员</a-select-option>
<a-select-option :value="0">顾客</a-select-option>
<a-select-option :value="-99">未知</a-select-option>
</a-select>
</a-form-item>
<a-form-item label="年龄类型:" style="padding: 5px 0">
<a-select v-model:value="queryForm.childAdult"
mode="multiple"
:maxTagCount="1"
style="width: 240px">
<a-select-option :value="1">成人</a-select-option>
<a-select-option :value="0">儿童</a-select-option>
<a-select-option :value="-1">未知</a-select-option>
</a-select>
</a-form-item>
<a-form-item label="选择日期:" style="padding: 5px 0">
<a-date-picker v-model:value="queryForm.date" :format="'YYYY-MM-DD'" style="width: 240px"/>
</a-form-item>
<a-form-item label="选择时间:" style="padding: 5px 0">
<a-time-picker v-model:value="queryForm.startTime" style="width: 140px"/>
<a-time-picker v-model:value="queryForm.endTime" style="width: 140px"/>
</a-form-item>
<a-form-item label="图片数量:" style="padding: 5px 0">
<a-input v-model:value="queryForm.minPic" style="width: 129px"/>
<a-input v-model:value="queryForm.maxPic" style="width: 129px"/>
</a-form-item>
<a-form-item style="padding: 5px 0">
<a-button type="primary" @click="clickSearch" :loading="isLoading">查询</a-button>
</a-form-item>
<a-form-item style="padding: 5px 0">
<a-button type="primary" @click="comparativeFun">特征对比</a-button>
</a-form-item>
<a-form-item style="padding: 5px 0">
<a-button type="primary" @click="singleComparativeFun">单张特征对比</a-button>
</a-form-item>
<a-form-item style="padding: 5px 0">
<a-button type="primary" @click="clerkComparativeFun">店员特征对比</a-button>
</a-form-item>
</a-form>
<div v-loading="isLoading">
<div class="resultContent" :style="{'height':contentHeight+'px'}">
<template v-for="person in dataList">
<div class="classBox" :class="person.expand?'expand':''">
<div :class="person.checked?'checked':''">
<div class="boxInfo">
<span class="iconExpand" v-show="!person.expand"></span>
<span class="iconExpand" v-show="person.expand"></span>
<span class="expandWord" @click='expandChange(person)'>{{person.expand?'收起':'展开'}}</span>
<el-checkbox class="checkBox" v-model="person.checked" @change='checkChange(person)'></el-checkbox>
人id:{{ ' ' + person.person_unid }}
图片数量:{{ person.perrsonList.length }}
</div>
<el-row v-for="row in getPagedList(person.perrsonList, 8)">
<el-col :span="3" v-for="item in row">
<div style="margin: 0 5px" @click="handleClick(item)" :class="currentItemId==item.id?'actived':''">
<div style="">
<span @click="downloadTrajectoryFile(item.track_url)"
class="downBtn">
轨迹
</span>
<span @click="downloadFile(item.features_url)"
class="downBtn" style="margin-left: 55px;">
特征
</span>
<span @click="delFile(item)"
class="downBtn downBtn1">
删除
</span>
</div>
<el-image :src="item.picture_url"
:fit="'fill'"
class="single-image" >
</el-image>
<div>时间:{{ item.counttime }}</div>
<div>人员类型:{{ item.person_type==1?'店员':(item.person_type==0?'顾客':'未知') }}({{ item.childAdult==1?'成人':(item.childAdult==0?'儿童':'未知') }})</div>
<div>性别:{{ formatGender(item.gender) }}({{item.age}})</div>
<div class="direction" :class="'direction'+item.direction">方向:{{ formatDirection(item.direction) }}</div>
<div>地点:{{ item.gate_name }}</div>
</div>
</el-col>
</el-row>
</div>
</div>
</template>
</div>
<a-pagination
v-model:current="pageNum"
v-model:pageSize="pageSize"
:total="total"
:show-total="total => `共 ${total} 条`"
:pageSizeOptions="['10', '20', '40', '80']"
@change="onPageNumChange"
@showSizeChange="onPageSizeChange"
show-size-changer
show-quick-jumper
style="text-align:center"
/>
</div>
</div>
<!-- <imgDialog ref='imgModelRef'></imgDialog> -->
<DetailDialog ref="DetailDialogRef" />
<DetailDialogComparison ref="DetailDialogComparisonRef" />
<singleImgComparisonDialog ref="singleImgComparisonRef"></singleImgComparisonDialog>
</template>
<script>
import {computed, reactive, ref, toRaw} from 'vue'
import clusterResultApi from '@/views/SnapshotCluster/ClusterResult/ClusterResultApi'
import {isArray} from '@/PublicUtil/Judgment'
import moment from 'moment'
import {filterEmptyValueInObject, formatDate, formatTime, getPagedList} from '@/PublicUtil/PublicUtil'
// import imgDialog from '../imgDialog.vue'
import {ElMessage,ElMessageBox} from 'element-plus'
import DetailDialog from "../../ComparisonCapturedPictures/DetailDialog.vue";
import DetailDialogComparison from "../../ComparisonCapturedPictures/DetailDialogComparisonNew.vue";
import singleImgComparisonDialog from "../singleImgComparisonDialog.vue";
import snapshotRecordApi from '@/views/SnapshotCluster/SnapshotRecord/SnapshotRecordApi'
export default {
components:{
// imgDialog
DetailDialog,
DetailDialogComparison,
singleImgComparisonDialog
},
setup() {
// scalar
const pageNum = ref(1)
const pageSize = ref(10)
const total = ref()
const isLoading = ref(false)
const currobj = ref({})
const currentItemId = ref()
// sequence
const dataList = ref([])
const accountList = ref([])
const plazaList = ref([])
const zoneList = ref([])
const gateList = ref([])
// const imgModelRef = ref();
const pagedTableDataList = computed(
() => {
return getPagedList(dataList.value, 8)
}
)
const DetailDialogRef = ref();
const DetailDialogComparisonRef = ref();
const singleImgComparisonRef = ref()
const queryForm = reactive(
{
account_id: [],
plaza_id: [],
zone_id: [],
gate_id: [],
type: 0,
direction: [1, -1, 0],
picType: 2,
personType: [1, 0],
date: moment(moment().format('YYYY-MM-DD'), 'YYYY-MM-DD'),
startTime: moment('00:00:00', 'HH:mm:ss'),
endTime: moment('23:59:59', 'HH:mm:ss'),
minPic: 0,
maxPic: 100,
childAdult:[],
}
)
const searchCondition = ref({})
if(window.localStorage.getItem('searchCondition')){
searchCondition.value = JSON.parse(window.localStorage.getItem('searchCondition'));
queryForm.type = searchCondition.value.type;
queryForm.zone_id = searchCondition.value.zone_id;
queryForm.gate_id = searchCondition.value.gate_id;
queryForm.direction = searchCondition.value.direction;
queryForm.picType = searchCondition.value.picType;
queryForm.date = searchCondition.value.date;
queryForm.startTime = searchCondition.value.startTime;
queryForm.endTime = searchCondition.value.endTime;
queryForm.minPic = searchCondition.value.minPic||0;
queryForm.maxPic = searchCondition.value.maxPic||100;
}
// function
const onPageNumChange = function(num) {
pageNum.value = num
confirmSearch()
}
const onPageSizeChange = function(current, size) {
pageNum.value = 1
pageSize.value = size
confirmSearch()
}
const onAccountChange = function() {
getPlazaList(1)
// getZoneList()
// getGateList()
}
const onPlazaChange = function() {
getZoneList()
getGateList()
}
const onZoneChange = function() {
getGateList()
}
const getPlazaList = function(val) {
queryForm.plaza_id = []
plazaList.value = []
clusterResultApi.getPlazaList(
{
account_id: queryForm.account_id.toString()
}
).then(
(r) => {
if (isArray(r))
{
for (const item of r)
{
plazaList.value.push(
{
value: item.id,
label: item.name,
}
)
}
if(plazaList.value.length>0){
if(!val&&searchCondition.value.plaza_id && searchCondition.value.plaza_id.length>0){
queryForm.plaza_id = searchCondition.value.plaza_id
}else{
queryForm.plaza_id.push(plazaList.value[0].value)
}
getZoneList(1)
getGateList(1)
confirmSearch()
}
}
}
)
}
const getZoneList = function(val) {
zoneList.value = []
clusterResultApi.getZoneList(
{
account_id: queryForm.account_id.toString(),
plaza_id: queryForm.plaza_id.toString(),
}
).then(
(r) => {
if (isArray(r))
{
for (const item of r)
{
zoneList.value.push(
{
value: item.id,
label: item.name,
}
)
}
if(zoneList.value.length){
if(val&&searchCondition.value.zone_id && searchCondition.value.zone_id.length>0){
queryForm.zone_id = searchCondition.value.zone_id
}else{
queryForm.zone_id = []
}
}else{
queryForm.zone_id = []
}
}
}
)
}
const getGateList = function(val) {
gateList.value = []
clusterResultApi.getGateList(
{
account_id: queryForm.account_id.toString(),
plaza_id: queryForm.plaza_id.toString(),
zone_id: queryForm.zone_id.toString(),
type: queryForm.type,
}
).then(
(r) => {
if (isArray(r.data))
{
for (const item of r.data)
{
gateList.value.push(
{
value: item.id,
label: item.name,
}
)
}
if(gateList.value.length){
if(val&&searchCondition.value.gate_id && searchCondition.value.gate_id.length>0){
queryForm.gate_id = searchCondition.value.gate_id
}else{
queryForm.gate_id = []
}
}else{
queryForm.gate_id = []
}
}
}
)
}
const getAccountList = function() {
queryForm.account_id = []
accountList.value = []
clusterResultApi.getAccountList().then(
(r) => {
if (isArray(r))
{
for (const item of r)
{
accountList.value.push(
{
value: item.id,
label: item.name,
}
)
}
if(accountList.value.length){
if(searchCondition.value.account_id && searchCondition.value.account_id.length>0){
queryForm.account_id = searchCondition.value.account_id
}else{
queryForm.account_id.push(accountList.value[0].value)
}
getPlazaList()
}
}
}
)
}
const clickSearch = function() {
pageNum.value = 1
confirmSearch()
}
const confirmSearch = function() {
isLoading.value = true
const rawData = toRaw(queryForm)
const data = filterEmptyValueInObject(
{
account_id: rawData.account_id.toString(),
type: rawData.type,
plaza_id: rawData.plaza_id.toString(),
zone_id: rawData.zone_id.toString(),
gate_id: rawData.gate_id.toString(),
direction: rawData.direction.toString(),
picType: rawData.picType,
personType: rawData.personType.toString(),
startTime: formatDate(rawData.date) + ' ' + formatTime(rawData.startTime),
endTime: formatDate(rawData.date) + ' ' + formatTime(rawData.endTime),
minPic: rawData.minPic,
maxPic: rawData.maxPic,
page: pageNum.value - 1,
pageSize: pageSize.value,
childAdult: rawData.childAdult.toString(),
}
)
const storageData = filterEmptyValueInObject(
{
account_id: rawData.account_id,
type: rawData.type,
plaza_id: rawData.plaza_id,
zone_id: rawData.zone_id,
gate_id: rawData.gate_id,
direction: rawData.direction,
picType: rawData.picType,
personType: rawData.personType,
date: rawData.date,
minPic: rawData.minPic,
maxPic: rawData.maxPic,
startTime: formatDate(rawData.date) + ' ' + formatTime(rawData.startTime),
endTime: formatDate(rawData.date) + ' ' + formatTime(rawData.endTime),
}
)
window.localStorage.setItem('searchCondition',JSON.stringify(storageData))
clusterResultApi.getClusterResultList(data).then(
(r) => {
isLoading.value = false
sortDataList(r.data.persons)
r.data.persons.forEach((itemPerson)=>{
itemPerson.checked = false
itemPerson.expand = false
itemPerson.perrsonList.forEach((item)=>{
if (item.features_url) {
item.features_url = window._baseImgUrl + item.features_url
}
if (item.picture_url) {
item.picture_url = window._baseImgUrl + item.picture_url
}
if (item.track_url) {
item.track_url = window._baseImgUrl + item.track_url
}
})
})
dataList.value = r.data.persons
total.value = r.data.pageNum
document.getElementsByClassName('resultContent')[0].scrollTop = 0
}
)
}
const formatGender = function(number){
switch (number)
{
case 1:
{
return '男'
}
case -1:
{
return '未知'
}
case 0:
{
return '女'
}
default:
{
break
}
}
}
const formatDirection = function(number) {
switch (number)
{
case 1:
{
return '进'
}
case -1:
{
return '出'
}
case 0:
{
return '横穿'
}
default:
{
break
}
}
}
const sortDataList = function(list) {
list.sort(
(a, b) => {
return (b.perrsonList.length - a.perrsonList.length)
}
)
}
const downloadFile = function(url) {
window.open(url)
}
const downloadTrajectoryFile = function(url){
window.open(url)
}
const handleClick = function(data){
currentItemId.value = data.id
currobj.value = data;
// clusterResultApi.getBodyPoint({'feature_url':feature}).then(
// (r) => {
// imgModelRef.value.initDialog(url,r.data);
// }
// )
}
const checkChange = function(data){
console.log(data)
}
const expandChange = function(data){
dataList.value.forEach(item=>{
if (data.person_unid == item.person_unid) {
item.expand = !item.expand
}
})
}
// 特征对比
const comparativeFun = function(){
const rawData = toRaw(queryForm)
if(!currobj.value.id){
ElMessage(
{
message: `请选择图片`,
type: 'warning'
}
)
return
}
if(!currobj.value.picture_url){
ElMessage(
{
message: `该图片没有特征,请选择有效的图片`,
type: 'warning'
}
)
return
}
let parmas = {
mall_id:currobj.value.mall_id,
picType:rawData.picType,
pic_id:currobj.value.id,
countdate:formatDate(rawData.date),
dataList:[]
}
dataList.value.forEach(item=>{
if (item.checked && item.checked == true) {
parmas.dataList.push(item)
}
})
if(parmas.dataList && parmas.dataList.length > 0){
DetailDialogComparisonRef.value.initDialog(currobj.value,parmas);
}else{
ElMessage(
{
message: `请选择聚类图片`,
type: 'warning'
}
)
return
}
}
//单张特征对比
const singleComparativeFun = function(){
if(!currobj.value.id){
ElMessage(
{
message: `请选择图片`,
type: 'warning'
}
)
return
}
if(!currobj.value.picture_url){
ElMessage(
{
message: `该图片没有特征,请选择有效的图片`,
type: 'warning'
}
)
return
}
const rawData = toRaw(queryForm)
let parmas = {
person_unid:currobj.value.person_unid,
pic_type:rawData.picType,
countdate:formatDate(rawData.date),
pic_id:currobj.value.id,
ip:window._baseImgUrl,
plaza_id:currobj.value.mall_id
}
singleImgComparisonRef.value.initDialog(parmas);
}
// 店员特征对比
const clerkComparativeFun = function(){
const rawData = toRaw(queryForm)
if(!currobj.value.id){
ElMessage(
{
message: `请选择图片进行对比`,
type: 'warning'
}
)
return
}
if(!currobj.value.picture_url){
ElMessage(
{
message: `该图片没有特征,请选择有效的图片`,
type: 'warning'
}
)
return
}
let parmas = {
plaza_id:currobj.value.mall_id,
pic_type:rawData.picType,
pic_id:currobj.value.id,
ip:window._baseImgUrl,
countdate:formatDate(rawData.date)
}
DetailDialogRef.value.initDialog(currobj.value,parmas);
}
const delFile = function(item){
ElMessageBox.confirm(
'确认删除?',
{
confirmButtonText: '确认',
cancelButtonText: '取消',
}
).then(() => {
snapshotRecordApi.delRecord(item).then(
(r) => {
console.log(r)
if(r.msg_code==200){
ElMessage({
message: `删除成功`,
type: 'success'
})
confirmSearch()
}
}
)
})
.catch(() => {
})
}
const contentHeight = ref(0)
const __main = function() {
getAccountList()
contentHeight.value = window.innerHeight - 310
}
__main()
return {
// scalar
isLoading,
pageNum,
pageSize,
total,
currentItemId,
currobj,
// sequence
accountList,
plazaList,
zoneList,
gateList,
pagedTableDataList,
dataList,
contentHeight,
// mapping
queryForm,
// function
onPageNumChange,
onPageSizeChange,
onAccountChange,
onPlazaChange,
onZoneChange,
confirmSearch,
formatDirection,
downloadFile,
getPagedList,
handleClick,
comparativeFun,
checkChange,
expandChange,
clerkComparativeFun,
singleComparativeFun,
formatGender,
downloadTrajectoryFile,
clickSearch,
delFile,
// ref
// imgModelRef,
DetailDialogRef,
DetailDialogComparisonRef,
singleImgComparisonRef
}
}
}
</script>
<style lang="less" scoped>
@import "./ClusterResult";
.actived{
border: 3px solid #1890ff;
}
.checkBox{
margin-left: 10px;
}
.boxInfo{
line-height: 28px;
margin-bottom: 10px;
}
.classBox{
margin: 10px 0;
border: solid 1px black;
height: 485px;
overflow-y: hidden;
}
.expand{
height: auto;
overflow: auto;
}
.expandWord{
color: #1890ff;
margin-right: 5px;
cursor: pointer;
float: right;
}
.iconExpand{
cursor: pointer;
float: right;
color: #1890ff;
margin-right: 20px;
}
.checked{
background-color: #bbb;
}
.resultContent{
overflow: auto;
min-height: 500px;
}
.downBtn{
color: #409EFF;
font-size: 15px;
cursor: pointer;
display: inline-block;
width: auto;
}
.downBtn1{
float: right;
}
</style>
import axiosInstance from "@/Request/PublicAxiosInstance"
import {filterEmptyValueInObject} from "@/PublicUtil/PublicUtil"
class ClusterResultApi {
getClusterResultList(data) {
return axiosInstance.request(
{
method: 'GET',
url: `/faceRecognitions/faceRecordGroup`,
params: filterEmptyValueInObject(
data
)
}
)
}
getAccountList() {
return axiosInstance.request(
{
method: 'GET',
url: `/accounts`,
}
)
}
getPlazaList(data) {
return axiosInstance.request(
{
method: 'GET',
url: `/malls`,
params: filterEmptyValueInObject(
{
accountIds: data.account_id
},
)
}
)
}
getZoneList(data) {
return axiosInstance.request(
{
method: 'GET',
url: `/zones/zoneList`,
params: filterEmptyValueInObject(
{
account_id: data.account_id,
plaza_id: data.plaza_id,
},
)
}
)
}
getGateList(data) {
return axiosInstance.request(
{
method: 'GET',
url: `/gates/gateByInfo`,
params: filterEmptyValueInObject(
{
account_id: data.account_id,
plaza_id: data.plaza_id,
zone_id: data.zone_id,
type: data.type,
},
)
}
)
}
getBodyPoint(data) {
return axiosInstance.request(
{
method: 'GET',
url: `/feature/bodyPoint`,
params: filterEmptyValueInObject(
data
)
}
)
}
}
const clusterResultApi = new ClusterResultApi()
export default clusterResultApi
<template>
<a-menu v-model:selectedKeys="currentMenu" mode="horizontal">
<a-menu-item :key="'抓拍记录'">
抓拍记录
</a-menu-item>
<a-menu-item :key="'聚类结果'">
聚类结果
</a-menu-item>
</a-menu>
<div v-if="currentMenu[0] === '抓拍记录'">
<SnapshotRecord></SnapshotRecord>
</div>
<div v-if="currentMenu[0] === '聚类结果'">
<ClusterResult></ClusterResult>
</div>
</template>
<script>
import {ref} from 'vue'
import SnapshotRecord from './SnapshotRecord/SnapshotRecord.vue'
import ClusterResult from './ClusterResult/ClusterResult.vue'
export default {
components: {
SnapshotRecord,
ClusterResult,
},
setup() {
// scalar
const currentMenu = ref(['抓拍记录'])
// sequence
// mapping
// function
return {
// scalar
currentMenu,
// sequence
// mapping
// function
}
}
}
</script>
<style scoped>
</style>
.single-image {
height: 300px;
width: 100%;
}
.direction{
font-weight: 900;
background-color: red;
color: white;
}
.direction1{
background-color: green;
}
.direction0{
background-color: orange;
}
<template>
<a-form :model="queryForm" layout="inline" :label-col="{ style: { width: '70px' } }">
<a-form-item label="集团:" style="padding: 5px 0">
<a-select v-model:value="queryForm.account_id"
style="width: 280px"
mode="multiple"
:maxTagCount="1"
@change="onAccountChange"
:options="accountList"
optionFilterProp="label"
show-search
>
</a-select>
</a-form-item>
<a-form-item label="广场:" style="padding: 5px 0">
<a-select v-model:value="queryForm.plaza_id"
style="width: 280px"
mode="multiple"
:maxTagCount="1"
@change="onPlazaChange"
:options="plazaList"
optionFilterProp="label"
show-search
>
</a-select>
</a-form-item>
<a-form-item label="出入类型:" style="padding: 5px 0">
<a-select v-model:value="queryForm.type" style="width: 280px">
<a-select-option :value="0">全场</a-select-option>
<a-select-option :value="1">广场出入口</a-select-option>
<a-select-option :value="2">楼层出入口</a-select-option>
<a-select-option :value="3">店铺出入口</a-select-option>
<a-select-option :value="4">其他</a-select-option>
</a-select>
</a-form-item>
<a-form-item label="区域信息:" style="padding: 5px 0">
<a-select v-model:value="queryForm.zone_id"
style="width: 280px"
mode="multiple"
:maxTagCount="1"
@change="onZoneChange"
:options="zoneList"
optionFilterProp="label"
show-search
>
</a-select>
</a-form-item>
<a-form-item label="监控点:" style="padding: 5px 0">
<a-select v-model:value="queryForm.gate_id"
style="width: 280px"
mode="multiple"
:maxTagCount="1"
:options="gateList"
optionFilterProp="label"
show-search
>
</a-select>
</a-form-item>
<a-form-item label="方向:" style="padding: 5px 0">
<a-select v-model:value="queryForm.direction"
mode="multiple"
:maxTagCount="1"
style="width: 280px">
<a-select-option :value="1"></a-select-option>
<a-select-option :value="-1"></a-select-option>
<a-select-option :value="0">横穿</a-select-option>
</a-select>
</a-form-item>
<a-form-item label="抓拍类型:" style="padding: 5px 0">
<a-select v-model:value="queryForm.picType" style="width: 280px">
<a-select-option :value="1">半身照</a-select-option>
<a-select-option :value="2">全身照</a-select-option>
</a-select>
</a-form-item>
<a-form-item label="人员类型:" style="padding: 5px 0">
<a-select v-model:value="queryForm.personType"
mode="multiple"
:maxTagCount="1"
style="width: 280px">
<a-select-option :value="1">店员</a-select-option>
<a-select-option :value="0">顾客</a-select-option>
<a-select-option :value="-99">未知</a-select-option>
</a-select>
</a-form-item>
<a-form-item label="年龄类型:" style="padding: 5px 0">
<a-select v-model:value="queryForm.childAdult"
mode="multiple"
:maxTagCount="1"
style="width: 280px">
<a-select-option :value="1">成人</a-select-option>
<a-select-option :value="0">儿童</a-select-option>
<a-select-option :value="-1">未知</a-select-option>
</a-select>
</a-form-item>
<a-form-item label="选择日期:" style="padding: 5px 0">
<a-date-picker v-model:value="queryForm.date" :format="'YYYY-MM-DD'" style="width: 280px"/>
</a-form-item>
<a-form-item label="选择时间:" style="padding: 5px 0">
<a-time-picker v-model:value="queryForm.startTime" style="width: 140px"/>
<a-time-picker v-model:value="queryForm.endTime" style="width: 140px"/>
</a-form-item>
<a-form-item style="padding: 5px 0">
<a-button type="primary" @click="clickSearch" :loading="isLoading">查询</a-button>
</a-form-item>
<a-form-item style="padding: 5px 0">
<a-button type="primary" @click="comparativeFun">特征对比验证</a-button>
</a-form-item>
</a-form>
<div v-loading="isLoading">
<div class="resultContent" :style="{'height':contentHeight+'px'}">
<el-row v-for="row in pagedTableDataList">
<el-col :span="3" v-for="item in row">
<div style="margin: 0 5px;cursor: pointer;" @click="handleClick(item)" :class="currentItemId==item.id?'actived':''">
<div style="">
<span @click="downloadTrajectoryFile(item.track_url)"
class="downBtn">
轨迹
</span>
<span @click="downloadFile(item.features_url)"
class="downBtn" style="margin-left: 55px;">
特征
</span>
<span @click="delFile(item)"
class="downBtn downBtn1">
删除
</span>
</div>
<el-image :src="item.picture_url"
:fit="'fill'"
class="single-image">
</el-image>
<div>时间:{{ item.counttime }}</div>
<div>人员类型:{{ item.person_type==1?'店员':(item.person_type==0?'顾客':'未知')}}({{ item.childAdult==1?'成人':(item.childAdult==0?'儿童':'未知') }})</div>
<div>性别:{{ formatGender(item.gender) }}({{item.age}})</div>
<div class="direction" :class="'direction'+item.direction">方向:{{ formatDirection(item.direction) }}</div>
<div>地点:{{ item.gate_name }}</div>
</div>
</el-col>
</el-row>
</div>
<a-pagination
v-model:current="pageNum"
v-model:pageSize="pageSize"
:total="total"
:show-total="total => `共 ${total} 条`"
:pageSizeOptions="['24', '48', '96', '192']"
@change="onPageNumChange"
@showSizeChange="onPageSizeChange"
show-size-changer
show-quick-jumper
style="text-align:center"
/>
</div>
<!-- <imgDialog ref='imgModelRef'></imgDialog> -->
<DetailDialog ref="DetailDialogRef" />
</template>
<script>
import {computed, reactive, ref, toRaw} from 'vue'
import snapshotRecordApi from '@/views/SnapshotCluster/SnapshotRecord/SnapshotRecordApi'
import {isArray} from '@/PublicUtil/Judgment'
import moment from 'moment'
import {filterEmptyValueInObject, formatDate, formatTime, getPagedList} from '@/PublicUtil/PublicUtil'
// import imgDialog from '../imgDialog.vue'
import {ElMessage,ElMessageBox} from 'element-plus'
import DetailDialog from "../../ComparisonCapturedPictures/DetailDialog.vue";
export default {
components:{
// imgDialog ,
DetailDialog
},
setup() {
// scalar
const pageNum = ref(1)
const pageSize = ref(24)
const total = ref()
const isLoading = ref(false)
// sequence
const dataList = ref([])
const accountList = ref([])
const plazaList = ref([])
const zoneList = ref([])
const gateList = ref([])
const imgModelRef = ref();
const currentItemId = ref()
const currobj = ref({})
// ref
const DetailDialogRef = ref();
const pagedTableDataList = computed(
() => {
return getPagedList(dataList.value, 8)
}
)
const queryForm = reactive(
{
account_id: [],
plaza_id: [],
zone_id: [],
gate_id: [],
type: 0,
direction: [1, -1, 0],
picType: 2,
personType: [1, 0],
date: moment(moment().format('YYYY-MM-DD'), 'YYYY-MM-DD'),
startTime: moment('00:00:00', 'HH:mm:ss'),
endTime: moment('23:59:59', 'HH:mm:ss'),
childAdult:[],
}
)
const searchCondition = ref({})
if(window.localStorage.getItem('searchCondition')){
searchCondition.value = JSON.parse(window.localStorage.getItem('searchCondition'));
queryForm.type = searchCondition.value.type;
queryForm.zone_id = searchCondition.value.zone_id;
queryForm.gate_id = searchCondition.value.gate_id;
queryForm.direction = searchCondition.value.direction;
queryForm.picType = searchCondition.value.picType;
queryForm.date = searchCondition.value.date;
queryForm.startTime = searchCondition.value.startTime;
queryForm.endTime = searchCondition.value.endTime;
}
// function
const onPageNumChange = function(num) {
pageNum.value = num
confirmSearch()
}
const onPageSizeChange = function(current, size) {
pageNum.value = 1
pageSize.value = size
confirmSearch()
}
const onAccountChange = function() {
getPlazaList(1)
// getZoneList()
// getGateList()
}
const onPlazaChange = function() {
getZoneList()
getGateList()
}
const onZoneChange = function() {
getGateList()
}
const getPlazaList = function(val) {
queryForm.plaza_id = []
plazaList.value = []
snapshotRecordApi.getPlazaList(
{
account_id: queryForm.account_id.toString()
}
).then(
(r) => {
if (isArray(r)){
for (const item of r){
plazaList.value.push(
{
value: item.id,
label: item.name,
}
)
}
if(plazaList.value.length){
if(!val&&searchCondition.value.plaza_id && searchCondition.value.plaza_id.length>0){
queryForm.plaza_id = searchCondition.value.plaza_id
}else{
queryForm.plaza_id.push(plazaList.value[0].value)
}
getZoneList(1)
getGateList(1)
confirmSearch()
}
}
}
)
}
const getZoneList = function(val) {
queryForm.zone_id = []
zoneList.value = []
snapshotRecordApi.getZoneList(
{
account_id: queryForm.account_id.toString(),
plaza_id: queryForm.plaza_id.toString(),
}
).then(
(r) => {
if (isArray(r))
{
for (const item of r)
{
zoneList.value.push(
{
value: item.id,
label: item.name,
}
)
}
if(zoneList.value.length){
if(val&&searchCondition.value.zone_id && searchCondition.value.zone_id.length>0){
queryForm.zone_id = searchCondition.value.zone_id
}else{
queryForm.zone_id = []
}
}else{
queryForm.zone_id = []
}
}
}
)
}
const getGateList = function(val) {
gateList.value = []
snapshotRecordApi.getGateList(
{
account_id: queryForm.account_id.toString(),
plaza_id: queryForm.plaza_id.toString(),
zone_id: queryForm.zone_id.toString(),
type: queryForm.type,
}
).then(
(r) => {
if (isArray(r.data))
{
for (const item of r.data)
{
gateList.value.push(
{
value: item.id,
label: item.name,
}
)
}
if(gateList.value.length){
if(val&&searchCondition.value.gate_id && searchCondition.value.gate_id.length>0){
queryForm.gate_id = searchCondition.value.gate_id
}else{
queryForm.gate_id = []
}
}else{
queryForm.gate_id = []
}
}
}
)
}
const getAccountList = function() {
queryForm.account_id = []
accountList.value = []
snapshotRecordApi.getAccountList().then(
(r) => {
if (isArray(r))
{
for (const item of r)
{
accountList.value.push(
{
value: item.id,
label: item.name,
}
)
}
if(accountList.value.length){
if(searchCondition.value.account_id && searchCondition.value.account_id.length>0){
queryForm.account_id = searchCondition.value.account_id
}else{
queryForm.account_id.push(accountList.value[0].value)
}
getPlazaList()
}
}
}
)
}
const confirmSearch = function() {
isLoading.value = true
const rawData = toRaw(queryForm)
const data = filterEmptyValueInObject(
{
account_id: rawData.account_id.toString(),
type: rawData.type,
plaza_id: rawData.plaza_id.toString(),
zone_id: rawData.zone_id.toString(),
gate_id: rawData.gate_id.toString(),
direction: rawData.direction.toString(),
picType: rawData.picType,
personType: rawData.personType.toString(),
startTime: formatDate(rawData.date) + ' ' + formatTime(rawData.startTime),
endTime: formatDate(rawData.date) + ' ' + formatTime(rawData.endTime),
page: pageNum.value - 1,
pageSize: pageSize.value,
childAdult: rawData.childAdult.toString(),
}
)
const storageData = filterEmptyValueInObject(
{
account_id: rawData.account_id,
type: rawData.type,
plaza_id: rawData.plaza_id,
zone_id: rawData.zone_id,
gate_id: rawData.gate_id,
direction: rawData.direction,
picType: rawData.picType,
personType: rawData.personType,
date: rawData.date,
startTime: formatDate(rawData.date) + ' ' + formatTime(rawData.startTime),
endTime: formatDate(rawData.date) + ' ' + formatTime(rawData.endTime),
}
)
window.localStorage.setItem('searchCondition',JSON.stringify(storageData))
snapshotRecordApi.getSnapshotRecordList(data).then(
(r) => {
isLoading.value = false
r.data.persons.forEach((item)=>{
if (item.features_url) {
item.features_url = window._baseImgUrl + item.features_url
}
if (item.picture_url) {
item.picture_url = window._baseImgUrl + item.picture_url
}
if (item.track_url) {
item.track_url = window._baseImgUrl + item.track_url
}
})
dataList.value = r.data.persons
total.value = r.data.pageNum
document.getElementsByClassName('resultContent')[0].scrollTop = 0
}
)
}
const formatGender = function(number){
switch (number)
{
case 1:
{
return '男'
}
case -1:
{
return '未知'
}
case 0:
{
return '女'
}
default:
{
break
}
}
}
const formatDirection = function(number) {
switch (number)
{
case 1:
{
return '进'
}
case -1:
{
return '出'
}
case 0:
{
return '横穿'
}
default:
{
break
}
}
}
const downloadFile = function(url) {
window.open(url)
}
const downloadTrajectoryFile = function(url){
window.open(url)
}
const handleClick = function(data){
currentItemId.value = data.id
currobj.value = data;
}
const comparativeFun = function(){
if(currobj.value=={}) {
ElMessage({
message: `请选择图片进行对比验证`,
type: 'warning'
});
return false
}
if(!currobj.value.picture_url){
ElMessage({
message: `该图片没有特征,请选择有效的图片`,
type: 'warning'
})
return
}
const rawData = toRaw(queryForm)
let parmas = {
plaza_id:currobj.value.mall_id,
pic_type:rawData.picType,
pic_id:currobj.value.id,
ip:window._baseImgUrl,
countdate:formatDate(rawData.date)
}
DetailDialogRef.value.initDialog(currobj.value,parmas);
}
const clickSearch = function() {
pageNum.value = 1
confirmSearch()
}
const delFile = function(item){
ElMessageBox.confirm(
'确认删除?',
{
confirmButtonText: '确认',
cancelButtonText: '取消',
}
).then(() => {
snapshotRecordApi.delRecord(item).then(
(r) => {
console.log(r)
if(r.msg_code==200){
ElMessage({
message: `删除成功`,
type: 'success'
})
confirmSearch()
}
}
)
})
.catch(() => {
})
}
const contentHeight = ref(0)
const __main = function() {
getAccountList()
contentHeight.value = window.innerHeight - 310
}
__main()
return {
// scalar
isLoading,
pageNum,
pageSize,
total,
currobj,
// sequence
accountList,
plazaList,
zoneList,
gateList,
pagedTableDataList,
currentItemId,
contentHeight,
// mapping
queryForm,
// function
onPageNumChange,
onPageSizeChange,
onAccountChange,
onPlazaChange,
onZoneChange,
confirmSearch,
formatDirection,
downloadFile,
downloadTrajectoryFile,
handleClick,
comparativeFun,
formatGender,
clickSearch,
delFile,
// ref
DetailDialogRef,
imgModelRef
}
}
}
</script>
<style lang="less" scoped>
@import "./SnapshotRecord";
.actived{
border: 3px solid #1890ff;
}
.resultContent{
overflow: auto;
min-height: 500px;
}
.downBtn{
color: #409EFF;
font-size: 15px;
cursor: pointer;
display: inline-block;
width: auto;
}
.downBtn1{
float: right;
}
</style>
import axiosInstance from "@/Request/PublicAxiosInstance"
import {filterEmptyValueInObject} from "@/PublicUtil/PublicUtil"
class SnapshotRecordApi {
getSnapshotRecordList(data) {
return axiosInstance.request(
{
method: 'GET',
url: `/faceRecognitions/faceRecord`,
params: filterEmptyValueInObject(
data
)
}
)
}
getAccountList() {
return axiosInstance.request(
{
method: 'GET',
url: `/accounts`,
}
)
}
getPlazaList(data) {
return axiosInstance.request(
{
method: 'GET',
url: `/malls`,
params: filterEmptyValueInObject(
{
accountIds: data.account_id
},
)
}
)
}
getResidenceList(data) {
return axiosInstance.request(
{
method: 'GET',
url: `/residence`,
params:data
}
)
}
getZoneList(data) {
return axiosInstance.request(
{
method: 'GET',
url: `/zones/zoneList`,
params: filterEmptyValueInObject(
{
account_id: data.account_id,
plaza_id: data.plaza_id,
},
)
}
)
}
getGateList(data) {
return axiosInstance.request(
{
method: 'GET',
url: `/gates/gateByInfo`,
params: filterEmptyValueInObject(
{
account_id: data.account_id,
plaza_id: data.plaza_id,
zone_id: data.zone_id,
type: data.type,
},
)
}
)
}
}
const snapshotRecordApi = new SnapshotRecordApi()
export default snapshotRecordApi
<template>
<a-modal
title="图片"
v-if='isVisible'
v-model:visible="isVisible"
width="1200px"
height='90%'
class="detail-modal"
>
<canvas id="myCanvas"></canvas>
<img :src="imgUrl" alt="" id="img">
<template #footer>
<a-button @click="onCancel">返回</a-button>
</template>
</a-modal>
</template>
<script>
import { reactive, ref } from "vue";
export default {
setup() {
const isVisible = ref(false);
const isLoading = ref(false);
const detailData = ref({});
const imgUrl = ref()
const canvas = ref()
const ctx = ref()
const initDialog = (url,data) => {
imgUrl.value = url
isVisible.value = true;
setTimeout(()=>{
var imgscream=document.getElementById("img");
let height = imgscream.offsetHeight;
let width = imgscream.offsetWidth;
canvas.value = document.getElementById("myCanvas");//初始化
canvas.value.height = height;
canvas.value.width = width;
ctx.value = canvas.value.getContext("2d")
ctx.value.drawImage(imgscream,0,0,width,height);
ctx.value.beginPath();
ctx.value.lineWidth = 3
ctx.value.strokeStyle = "red";
ctx.value.moveTo(data.head_x_inSmall, data.head_y_inSmall);//起始位置
ctx.value.lineTo(data.foot_x_inSmall, data.foot_y_inSmall);//停止位置
ctx.value.stroke();
},0)
};
const onCancel = () => {
canvas.value = ''
isVisible.value = false;
};
return {
isVisible,
onCancel,
initDialog,
isLoading,
imgUrl,
detailData
};
},
};
</script>
<style lang="less" scoped>
#myCanvas{
display: block;
margin: 0 auto;
}
#img{
position: relative;
top: -5000px;
float: left;
}
</style>
<template>
<a-modal
title="单张图片特征对比"
v-if='isVisible'
v-model:visible="isVisible"
width="1600px"
height='90%'
class="detail-modal"
>
<el-row :gutter="20">
<el-col :span="8" class='imgBox1' v-loading='isLoading'>
<p class="title">
<span class="name">现在聚类</span>
<span class="id">{{detailData.person_unid}}</span>
<span class="num">{{featureList.length}}</span>
</p>
<el-row :gutter="10" class="imgBox1_top">
<el-col :span="8" class="itemBox" v-for="item in featureList">
<el-image :src="item.picture_url" :fit="'fill'" class="single-image" @click='clickItem(item)'>
</el-image>
<span class="el-icon-document downloadFile" @click="downloadFile(item,$event)"></span>
<span class="el-icon-picture-outline openImage" @click="openImage(item,$event)"></span>
<p class="featureNum">{{(item.featureNum).toFixed(2)}}</p>
<div>时间:{{ item.counttime }}</div>
<div>人员类型:{{ item.person_type==1?'店员':'顾客' }}</div>
<div class="direction" :class="'direction'+item.direction">方向:{{ formatDirection(item.direction) }}</div>
<div>地点:{{ item.gate_name }}</div>
</el-col>
<a-empty v-if='featureList.length==0' style='margin: 0 auto;'></a-empty>
</el-row>
</el-col>
<el-col :span="8" class='imgBox1' v-loading='isLoading1'>
<p class="title">
<span class="name">特征比对</span>
<span class="num">{{comparisonList.length}}</span>
</p>
<el-row :gutter="10" class="imgBox1_top">
<el-col :span="8" class="itemBox" v-for="item in comparisonList">
<el-image :src="item.picture_url" :fit="'fill'" class="single-image" @click='clickItem(item)'>
</el-image>
<span class="el-icon-picture-outline openImage" @click="openImage(item,$event)"></span>
<span class="el-icon-document downloadFile" @click="downloadFile(item,$event)"></span>
<p class="featureNum">{{item.featureNum?(item.featureNum).toFixed(2):0}}</p>
<div>时间:{{ item.counttime }}</div>
<div>人员类型:{{ item.person_type==1?'店员':'顾客' }}</div>
<div class="direction" :class="'direction'+item.direction">方向:{{ formatDirection(item.direction) }}</div>
<div>地点:{{ item.gate_name }}</div>
</el-col>
<a-empty v-if='comparisonList.length==0' style='margin: 0 auto;'></a-empty>
</el-row>
</el-col>
<el-col :span="8" class='imgBox1' v-loading='isLoading2'>
<p class="title">
<span class="name">重提特征后比对</span>
<a-button class="id" type="primary" @click="reComparisonFeature" >重提特征比对</a-button>
<span class="num">{{reComparisonList.length}}</span>
</p>
<el-row :gutter="10" class="imgBox1_top">
<el-col :span="8" class="itemBox" v-for="item in reComparisonList">
<el-image :src="item.picture_url" :fit="'fill'" class="single-image" @click='clickItem(item)'>
</el-image>
<span class="el-icon-picture-outline openImage" @click="openImage(item,$event)"></span>
<span class="el-icon-document downloadFile" @click="downloadFile(item,$event)"></span>
<p class="featureNum">{{item.featureNum?(item.featureNum).toFixed(2):0}}</p>
<div>时间:{{ item.counttime }}</div>
<div>人员类型:{{ item.person_type==1?'店员':'顾客' }}</div>
<div class="direction" :class="'direction'+item.direction">方向:{{ formatDirection(item.direction) }}</div>
<div>地点:{{ item.gate_name }}</div>
</el-col>
<a-empty v-if='reComparisonList.length==0' style='margin: 0 auto;'></a-empty>
</el-row>
</el-col>
</el-row>
<template #footer>
<a-button @click="onCancel">返回</a-button>
</template>
</a-modal>
<imgDialog ref='imgModelRef'></imgDialog>
<imgOtherDialog ref="imgOtherDialogRef" ></imgOtherDialog>
</template>
<script>
import { reactive, ref, watch } from "vue";
import featureApi from '@/views/FeatureComparisonVerification/api.js'
import clusterResultApi from '@/views/SnapshotCluster/ClusterResult/ClusterResultApi'
import {isArray} from '@/PublicUtil/Judgment'
import imgDialog from './imgDialog.vue'
import imgOtherDialog from "../ComparisonCapturedPictures/imgOtherDialog.vue";
export default {
components:{
imgDialog,
imgOtherDialog
},
setup() {
const isVisible = ref(false);
const isLoading = ref(false);
const isLoading1 = ref(false);
const isLoading2= ref(false);
const detailData = ref({});
const featureList = ref([])
const imgModelRef = ref();
const imgOtherDialogRef = ref();
const comparisonList = ref([])
const reComparisonList = ref([])
const formatDirection = function(number) {
switch (number) {
case 1: {
return '进'
}
case -1: {
return '出'
}
case 0: {
return '横穿'
}
default: {
break
}
}
}
watch([featureList],(newVal,oldVal)=>{
},{deep:true})
const initDialog = (data) => {
isLoading.value = true;
isLoading1.value = true;
isLoading2.value = false;
detailData.value = data;
featureList.value = []
reComparisonList.value = []
featureApi.getPersonContrastList(data).then((r) => {
isLoading.value = false
if (r.data&&isArray(r.data.personList)) {
r.data.personList.forEach((item) => {
if (item.features_url) {
item.features_url = window._baseImgUrl + item.features_url
}
if (item.picture_url) {
item.picture_url = window._baseImgUrl + item.picture_url
}
})
featureList.value = r.data.personList
}
}
)
comparisonList.value = []
featureApi.getAllPersonContrastList(data).then((r) => {
isLoading1.value = false
if (isArray(r.data)) {
if(r.data.length>0){
r.data.forEach((item) => {
if (item.features_url) {
item.features_url = window._baseImgUrl + item.features_url
}
if (item.picture_url) {
item.picture_url = window._baseImgUrl + item.picture_url
}
})
comparisonList.value = r.data
}
}
}
)
isVisible.value = true;
};
const clickItem = function(data){
clusterResultApi.getBodyPoint({'feature_url':data.features_url}).then((r) => {
imgModelRef.value.initDialog(data.picture_url,r.data);
})
}
const reComparisonFeature = function(){
isLoading2.value = true
reComparisonList.value = []
featureApi.getNewPersonContrastList(detailData.value).then((r) => {
isLoading2.value = false
if (isArray(r.data)) {
if(r.data.length>0){
r.data.forEach((item) => {
if (item.features_url) {
item.features_url = window._baseImgUrl + item.features_url
}
if (item.picture_url) {
item.picture_url = window._baseImgUrl + item.picture_url
}
})
reComparisonList.value = r.data
}
}
}
)
}
const downloadFile = function(item,event){
event.stopPropagation()
if(item.features_url){
window.open(item.features_url)
}else{
ElMessage(
{
message: `该图片没有特征`,
type: 'warning'
}
)
return
}
}
const openImage = function(item,event){
event.stopPropagation()
if(item.features_url){
let url = item.picture_url
imgOtherDialogRef.value.initDialog(url.split('0.jpg')[0]+'1.jpg')
}else{
ElMessage(
{
message: `该图片没有特征`,
type: 'warning'
}
)
return
}
}
const onCancel = () => {
isVisible.value = false;
};
return {
isVisible,
onCancel,
initDialog,
isLoading,
isLoading1,
isLoading2,
detailData,
featureList,
formatDirection,
downloadFile,
clickItem,
imgModelRef,
comparisonList,
reComparisonList,
reComparisonFeature,
openImage,
imgOtherDialogRef
};
},
};
</script>
<style lang="less" scoped>
.single-image {
height: 200px;
width: 150px;
cursor: pointer;
}
.direction{
font-weight: 900;
background-color: red;
color: white;
}
.direction1{
background-color: green;
}
.direction0{
background-color: orange;
}
.title{
height: 32px;
line-height: 32px;
padding: 0;
.name{
font-weight: 900;
font-size: 18px;
}
.id{
margin-left: 20px;
}
.num{
float: right;
margin-right: 15px;
}
}
.imgBox1{
// border-left: 10px solid #efefef;
box-sizing: border-box;
min-height: 100%;
.itemBox{
position: relative;
}
.downloadFile{
position: absolute;
color: #1890ff;
font-size: 32px;
top: 0;
right: 10px;
cursor: pointer;
}
.openImage{
position: absolute;
color: #1890ff;
font-size: 32px;
top: 0;
left: 90px;
cursor: pointer;
}
.featureNum{
position: absolute;
top: 0;
left: 15px;
color: red;
font-weight: 900;
font-size: 16px;
}
}
.imgBox1_top{
min-height: 400px;
max-height: 600px;
overflow-y: auto;
}
</style>
......@@ -58,7 +58,8 @@ module.exports = {
devServer: {
proxy: {
'/': {
target: 'https://mall.keliuyun.com/btool/',
// target: 'https://mall.keliuyun.com/btool/',
target: 'http://117.133.143.116:33333/btool/',
changeOrigin: true
}
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!