hitDetailDialog.vue
4.32 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
<template>
<a-modal
title="命中详情"
v-if="isVisible"
v-model:visible="isVisible"
width="1500px"
:dialog-style="{ top: '20px',height:'90%' }"
class="detail-modal"
>
<div style="height: 700px;overflow-y: auto;">
<template v-for="person in hitPersonList">
<div class="classBox" :class="person.expand?'expand':''">
<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>
人id:{{ ' ' + person.personId }}
图片数量:{{ person.count }}
<el-radio class="checkBox" v-model="checked" :label="person.personId">以此为对比项</el-radio>
</div>
<el-row :gutter="10">
<el-col :span="3" v-for="item in person.records">
<div>
<el-image :src="item.picture_url"
:fit="'fill'"
class="single-image" >
</el-image>
</div>
</el-col>
</el-row>
</div>
</template>
</div>
<template #footer>
<a-button @click="onCancel">返回</a-button>
<a-button @click="onConfirm" type="primary">确定</a-button>
</template>
</a-modal>
</template>
<script>
import moment from 'moment'
import { reactive, ref,toRaw } from "vue";
import {isArray } from '@/PublicUtil/Judgment'
import {ElMessage} from 'element-plus'
import FeatureMatchingAccuracyApi from '@/views/FeatureMatchingAccuracy/FeatureMatchingAccuracyApi'
export default {
setup(props,context) {
const isVisible = ref(false);
const isLoading = ref(false)
const accountId = ref('');
const mallId = ref('');
const checked = ref('');
const hitPersonList = ref([])
const regId = ref()
const initDialog = function(parmas) {
regId.value = parmas.regId
hitPersonList.value = parmas.data
checked.value = parmas.checkPersonId
isVisible.value = true;
};
const expandChange = function(data){
hitPersonList.value.forEach(item=>{
if (data.personId == item.personId) {
item.expand = !item.expand
}
})
}
const refreshParentTable = function(){
context.emit('refreshParentTable')
}
const onCancel = () => {
isVisible.value = false;
};
const onConfirm = function(){
if(!checked.value){
ElMessage({
message: `请选择对比项`,
type: 'warning'
})
return false;
}
FeatureMatchingAccuracyApi.getMatchHit({
id:regId.value,
personUnid:checked.value
}).then(
(r) => {
if(r.msg_code==200){
ElMessage({
message: `${r.msg_info}`,
type: 'success'
})
refreshParentTable()
isVisible.value = false;
}else{
ElMessage({
message: `${r.msg_info}`,
type: 'error'
})
}
}
)
}
return {
isVisible,
onCancel,
onConfirm,
initDialog,
hitPersonList,
expandChange,
checked,
refreshParentTable
};
},
};
</script>
<style lang="less" scoped>
.single-image{
width: 100%;
height: 220px;
}
.boxInfo{
line-height: 28px;
margin-bottom: 10px;
}
.checkBox{
margin-left: 15px;
}
.classBox{
margin-bottom: 10px;
border: solid 1px black;
height: 265px;
overflow: hidden;
padding: 5px;
}
.expand{
height: auto;
overflow-y: auto;
}
.expandWord{
color: #1890ff;
margin-right: 5px;
cursor: pointer;
float: right;
}
.iconExpand{
cursor: pointer;
float: right;
color: #1890ff;
margin-right: 20px;
}
</style>