Commit e0fedd15 by 李君

特征比对

1 parent b393711c
window._serverHost = ['localhost', '192.168.1.168'].includes(window.location.hostname) ? '36.112.68.214:9999/' : window.location.host
window._baseUrl = ['localhost', '192.168.1.168'].includes(window.location.hostname) ? 'http://36.112.68.214:9999/' : `http://${window._serverHost}`
// window._baseUrl = 'http://36.112.68.214:9999'
window._baseImgUrl = ['localhost', '192.168.1.168'].includes(window.location.hostname) ? 'http://36.112.68.214:33333/' : window.location.origin
const log = console.log.bind(console)
<template>
<a-modal
title="店员特征对比"
v-model:visible="isVisible"
width="1500px"
height='90%'
class="detail-modal"
>
<div v-loading='isLoading'>
<a-row :gutter="[16,16]">
<a-col :span='4'>
<div style="margin: 0 5px">
<el-image :src="detailData.picture_url" :fit="'fill'" class="single-image">
</el-image>
<div>时间:{{ detailData.counttime }}</div>
<div>方向:{{ formatDirection(detailData.direction) }}</div>
<div>地点:{{ detailData.gate_name }}</div>
</div>
</a-col>
<a-col :span='20'>
<a-row v-for="(row,index) in dataList" :key='index' class='rowBox'>
<p>{{row.name}} {{row.shopname}}</p>
<a-col :span="6" v-for="item in row.personList" class='itemBox' :key='item.id'>
<div style="margin: 0 5px">
<el-image :src="item.picture_url" :fit="'fill'" class="single-image">
</el-image>
<p class="featureNum">{{item.featureNum}}</p>
<div>时间:{{ item.counttime }}</div>
</div>
</a-col>
</a-row>
</a-col>
</a-row>
</div>
<template #footer>
<a-button @click="onCancel">返回</a-button>
</template>
</a-modal>
</template>
<script>
import { reactive, ref } from "vue";
import {isArray } from '@/PublicUtil/Judgment'
import comparsionResultApi from '@/views/ComparisonCapturedPictures/api'
export default {
setup() {
const isVisible = ref(false);
const isLoading = ref(false);
const detailData = ref({});
const dataList = ref([])
const initDialog = (record,parmas) => {
detailData.value = record;
isVisible.value = true;
dataList.value = []
isLoading.value = true
comparsionResultApi.getStaffContrastList(parmas).then((r) => {
isLoading.value = false
if (isArray(r.data)) {
if(r.data.length>0){
dataList.value = r.data
console.log(r.data)
}
}
}
)
};
const formatDirection = function(number) {
switch (number) {
case 1: {
return '进'
}
case -1: {
return '出'
}
case 0: {
return '横穿'
}
default: {
break
}
}
}
const onCancel = () => {
isVisible.value = false;
};
return {
isVisible,
detailData,
onCancel,
dataList,
initDialog,
isLoading,
formatDirection
};
},
};
</script>
<style lang="less" scoped>
.single-image {
height: 300px;
width: 100%;
}
.rowBox{
border : 2px dashed #ccc;
padding: 0 5px;
margin-bottom: 15px;
}
.itemBox{
position: relative;
}
.featureNum{
position: absolute;
top: 0;
left: 15px;
color: red;
font-weight: 900;
font-size: 16px;
}
</style>
<template>
<a-modal
title="特征对比"
v-model:visible="isVisible"
width="1500px"
class="detail-modal"
>
<div>
<a-row :gutter="[16,16]">
<a-col :span='4'>
<div style="margin: 0 5px">
<el-image :src="detailData.picture_url" :fit="'fill'" class="single-image">
</el-image>
<div>时间:{{ detailData.counttime }}</div>
<div>方向:{{ formatDirection(detailData.direction) }}</div>
<div>地点:{{ detailData.gate_name }}</div>
</div>
</a-col>
<a-col :span='20'>
<div v-loading='isLoadingTop' class='rowBox'>
<p v-if="dataListLeft">左侧</p>
<a-row >
<a-col :span="6" v-for="(item,index) in dataListLeft" :key='index'>
<div style="margin: 0 5px" class="itemBox">
<el-image :src="item.picture_url" :fit="'fill'" class="single-image">
</el-image>
<p class="featureNum">{{(item.featureNum).toFixed(2)}}</p>
<div>时间:{{ item.counttime }}</div>
<div>方向:{{ formatDirection(item.direction) }}</div>
<div>地点:{{ item.gate_name }}</div>
</div>
</a-col>
</a-row>
</div>
<div v-loading='isLoadingBottom' class='rowBox'>
<p v-if="dataListRight">右侧</p>
<a-row>
<a-col :span="6" v-for="(item,index) in dataListRight" :key='index'>
<div style="margin: 0 5px" class="itemBox">
<el-image :src="item.picture_url" :fit="'fill'" class="single-image">
</el-image>
<p class="featureNum">{{(item.featureNum).toFixed(2)}}</p>
<div>时间:{{ item.counttime }}</div>
<div>方向:{{ formatDirection(item.direction) }}</div>
<div>地点:{{ item.gate_name }}</div>
</div>
</a-col>
</a-row>
</div>
</a-col>
</a-row>
</div>
<template #footer>
<a-button @click="onCancel">返回</a-button>
</template>
</a-modal>
</template>
<script>
import { reactive, ref } from "vue";
import {isArray } from '@/PublicUtil/Judgment'
import comparsionResultApi from '@/views/ComparisonCapturedPictures/api'
export default {
setup() {
const isVisible = ref(false);
const isLoadingTop = ref(false);
const isLoadingBottom = ref(false);
const detailData = ref({});
const dataListLeft = ref([])
const dataListRight = ref([])
const initDialog = (record,parmas) => {
detailData.value = record;
isVisible.value = true;
dataListLeft.value = []
dataListRight.value = []
if(parmas.persionlistLeft.length>0){
isLoadingTop.value = true
// 左侧
let parmasObj = {
mall_id:parmas.mall_id,
picType:parmas.picType,
pic_id:parmas.pic_id,
countdate:parmas.countdate,
personList:parmas.persionlistLeft
}
comparsionResultApi.getPersonContrastList(parmasObj).then((r) => {
isLoadingTop.value = false
if (r.data&&isArray(r.data.personList)) {
if(r.data.personList.length>0){
// r.data.forEach((item) => {
// let str = item.features_url.indexOf("/images/feature")
// if (item.features_url) {
// item.features_url = window._baseImgUrl + item.features_url.substring(str)
// }
// let str1 = item.picture_url.indexOf("/images/picture")
// if (item.picture_url) {
// item.picture_url = window._baseImgUrl + item.picture_url.substring(str1)
// }
// })
dataListLeft.value = r.data.personList
console.log(r.data)
}
}
}
)
}
if(parmas.persionlistRight.length>0){
isLoadingBottom.value = true
let parmasObj = {
mall_id:parmas.mall_id,
picType:parmas.picType,
pic_id:parmas.pic_id,
countdate:parmas.countdate,
personList:parmas.persionlistRight
}
//右侧
comparsionResultApi.getPersonContrastList(parmasObj).then((r) => {
isLoadingBottom.value = false
if (r.data&&isArray(r.data.personList)) {
if(r.data.personList.length>0){
// r.data.forEach((item) => {
// let str = item.features_url.indexOf("/images/feature")
// if (item.features_url) {
// item.features_url = window._baseImgUrl + item.features_url.substring(str)
// }
// let str1 = item.picture_url.indexOf("/images/picture")
// if (item.picture_url) {
// item.picture_url = window._baseImgUrl + item.picture_url.substring(str1)
// }
// })
dataListRight.value = r.data.personList
console.log(r.data)
}
}
}
)
}
};
const formatDirection = function(number) {
switch (number) {
case 1: {
return '进'
}
case -1: {
return '出'
}
case 0: {
return '横穿'
}
default: {
break
}
}
}
const onCancel = () => {
isVisible.value = false;
};
return {
isVisible,
detailData,
onCancel,
dataListLeft,
dataListRight,
initDialog,
formatDirection,
isLoadingTop,
isLoadingBottom
};
},
};
</script>
<style lang="less" scoped>
.single-image {
height: 300px;
width: 100%;
}
.rowBox{
border : 2px dashed #ccc;
padding: 0 5px;
margin-bottom: 15px;
}
.itemBox{
position: relative;
}
.featureNum{
position: absolute;
top: 0;
left: 15px;
color: red;
font-weight: 900;
font-size: 16px;
}
</style>
import axiosInstance from "@/Request/PublicAxiosInstance"
import {filterEmptyValueInObject} from "@/PublicUtil/PublicUtil"
class ComparisonResultApi {
getPersonGroupList(data) {
return axiosInstance.request(
{
method: 'GET',
url: `/feature/personGroup`,
params: filterEmptyValueInObject(
data
)
}
)
}
// 人员列表详情
getPersonsDetailList(data) {
return axiosInstance.request(
{
method: 'GET',
url: `/feature/persons`,
params: filterEmptyValueInObject(
data
)
}
)
}
// 店员特征对比
getStaffContrastList(data) {
return axiosInstance.request(
{
method: 'GET',
url: `/feature/staffContrast`,
params: filterEmptyValueInObject(
data
)
}
)
}
// 特征对比
getPersonContrastList(data) {
return axiosInstance.request(
{
method: 'POST',
url: `/feature/personContrast`,
data: filterEmptyValueInObject(
data
)
}
)
}
}
const comparsionResultApi = new ComparisonResultApi()
export default comparsionResultApi
\ No newline at end of file
import axiosInstance from "@/Request/PublicAxiosInstance"
import {filterEmptyValueInObject} from "@/PublicUtil/PublicUtil"
class FeatureResultApi {
getPersonContrastList(data) {
return axiosInstance.request(
{
method: 'POST',
url: `/feature/personContrast`,
data: filterEmptyValueInObject(
data
)
}
)
}
// 重新比对
getAllPersonContrastList(data) {
return axiosInstance.request(
{
method: 'GET',
url: `/feature/allPersonContrast`,
params: filterEmptyValueInObject(
data
)
}
)
}
// 特征重提
getNewPersonContrastList(data) {
return axiosInstance.request(
{
method: 'GET',
url: `/feature/newPersonContrast`,
params: filterEmptyValueInObject(
data
)
}
)
}
}
const featureResultApi = new FeatureResultApi()
export default featureResultApi
\ No newline at end of file
......@@ -67,7 +67,7 @@
<a-select-option :value="0">横穿</a-select-option>
</a-select>
</a-form-item>
<a-form-item label="抓类型:" style="padding: 5px 0">
<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>
......@@ -337,13 +337,11 @@ export default {
sortDataList(r.data.persons)
r.data.persons.forEach((itemPerson)=>{
itemPerson.perrsonList.forEach((item)=>{
let str = item.features_url.indexOf("/images/feature")
if(item.features_url){
item.features_url = window.location.origin+item.features_url.substring(str)
if (item.features_url) {
item.features_url = window._baseImgUrl + item.features_url
}
let str1 = item.picture_url.indexOf("/images/picture")
if(item.picture_url){
item.picture_url = window.location.origin+item.picture_url.substring(str1)
if (item.picture_url) {
item.picture_url = window._baseImgUrl + item.picture_url
}
})
})
......
......@@ -66,7 +66,7 @@
<a-select-option :value="0">横穿</a-select-option>
</a-select>
</a-form-item>
<a-form-item label="抓类型:" style="padding: 5px 0">
<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>
......@@ -323,13 +323,11 @@ export default {
(r) => {
isLoading.value = false
r.data.persons.forEach((item)=>{
let str = item.features_url.indexOf("/images/feature")
if(item.features_url){
item.features_url = window.location.origin+item.features_url.substring(str)
if (item.features_url) {
item.features_url = window._baseImgUrl + item.features_url
}
let str1 = item.picture_url.indexOf("/images/picture")
if(item.picture_url){
item.picture_url = window.location.origin+item.picture_url.substring(str1)
if (item.picture_url) {
item.picture_url = window._baseImgUrl + item.picture_url
}
})
dataList.value = r.data.persons
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!