DetailDialogComparison.vue
7.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
<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">左侧<span style="float: right;margin-right: 25px;" v-if="dataListLeft.length">共{{dataListLeft.length}}张</span></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">右侧<span style="float: right;margin-right: 25px;" v-if="dataListRight.length">共{{dataListRight.length}}张</span></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
}
}
}
)
}
};
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>