Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation
This project
Loading...
Sign in
罗鑫霖
/
vion-tools
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit ff23185a
authored
May 25, 2023
by
李君
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
优化
1 parent
b4bfa343
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
228 additions
and
462 deletions
src/Request/PublicAxiosInstance.js
src/views/FeatureMatchingAccuracy/FeatureMatchingAccuracy.vue
src/views/FeatureMatchingAccuracy/FeatureMatchingAccuracyApi.js
src/views/FeatureMatchingAccuracy/addPerson.vue
src/views/FeatureMatchingAccuracy/editPerson.vue
src/views/SnapshotCluster/ClusterResult/ClusterResult.vue
src/views/SnapshotCluster/SnapshotRecord/SnapshotRecord.vue
src/Request/PublicAxiosInstance.js
View file @
ff23185
...
...
@@ -14,7 +14,7 @@ const axiosInstance = axios.create(
// 请求拦截器
axiosInstance
.
interceptors
.
request
.
use
(
config
=>
{
// Cookies.set('atoken','
57ac28e0-c2d9-4287-8d20-bc0332372dad
')
// Cookies.set('atoken','
33b0df7a-e5c6-49c3-b549-959179cd5904
')
if
(
!
Cookies
.
get
(
'atoken'
)){
ElMessage
({
message
:
`登录过期,请重新登录`
,
...
...
src/views/FeatureMatchingAccuracy/FeatureMatchingAccuracy.vue
View file @
ff23185
...
...
@@ -18,18 +18,18 @@
<!--
<a-button
type=
"primary"
@
click=
"confirmSearch"
class=
"btn"
>
预览报告
</a-button>
-->
</div>
<el-table
:data=
"resultList"
@
row-click=
'clickRow'
:highlight-current-row=
'true'
:rowKey=
"id"
:height=
"contentHeight"
style=
"width: 100%"
>
<el-table-column
type=
"index"
align=
"center"
label=
"序号"
width=
"80"
>
<
!--
<
el-table-column
type=
"index"
align=
"center"
label=
"序号"
width=
"80"
>
<template
#
default=
"scope"
>
<span
v-text=
"getIndex(scope.$index)"
>
</span>
</
template
>
</el-table-column>
</el-table-column>
-->
<el-table-column
prop=
"name"
align=
"center"
label=
"姓名"
>
</el-table-column>
<el-table-column
prop=
"regCount"
align=
"center"
label=
"注册图片数量"
>
</el-table-column>
<el-table-column
prop=
"hitCount"
align=
"center"
label=
"命中目标数量"
>
</el-table-column>
<el-table-column
prop=
"content"
align=
"center"
label=
"操作"
width=
"
15
0"
>
<el-table-column
prop=
"content"
align=
"center"
label=
"操作"
width=
"
22
0"
>
<
template
#
default=
"scope"
>
<el-button
@
click
.
stop
...
...
@@ -46,6 +46,13 @@
class=
"tab-btn"
>
删除
</el-button>
<el-button
@
click
.
stop
@
click=
"addSamplePic(scope.row)"
type=
"text"
size=
"small"
class=
"tab-btn"
>
添加样本图
</el-button>
<el-button
@
click
.
stop
@
click=
"hitDetail(scope.row)"
type=
"text"
...
...
@@ -134,7 +141,7 @@
</a-form-item>
<a-form-item
class=
"secondCondition"
>
<a-button
type=
"primary"
style=
"margin-right: 5px;"
@
click=
"searchPicture"
>
查询
</a-button>
<
a-button
type=
"primary"
@
click=
"checkPicture"
>
选中
</a-button
>
<
!-- <a-button type="primary" @click="checkPicture">选中</a-button> --
>
</a-form-item>
</a-form>
<div
class=
"identifyResult"
>
...
...
@@ -146,11 +153,16 @@
:fit=
"'fill'"
class=
"single-image"
>
</el-image>
<el-checkbox
class=
"checkBox"
v-model=
"item.checked"
></el-checkbox>
<span
class=
"score"
>
{{item.featureNum}}
</span>
<span
class=
"text"
@
click=
"clickPicture(item)"
>
<div
class=
"btnPic"
>
<el-button
type=
"primary"
class=
"checkBox "
@
click=
"checkPicture(item)"
>
选中
</el-button>
<el-button
type=
"primary"
class=
"checkBox text"
@
click=
"clickPicture(item)"
>
以图搜图
</el-button>
</div>
<!-- <el-checkbox class="checkBox" v-model="item.checked"></el-checkbox> -->
<!-- <span class="text" @click="clickPicture(item)">
<span class="el-icon-picture-outline iconPic"></span>
</span>
</span>
-->
</div>
</el-col>
</el-row>
...
...
@@ -170,7 +182,7 @@
</el-col>
</el-row>
<addPersonConfig
ref=
"addPersonConfigRef"
@
refreshParentTable =
'confirmSearch'
></addPersonConfig>
<editPersonConfig
ref=
"
editPerson
ConfigRef"
@
refreshParentTable =
'confirmSearch'
></editPersonConfig>
<editPersonConfig
ref=
"
addSamplePic
ConfigRef"
@
refreshParentTable =
'confirmSearch'
></editPersonConfig>
<hitDetailDialog
ref=
"hitDetailDialogRef"
@
refreshParentTable =
'confirmSearch'
></hitDetailDialog>
</div>
...
...
@@ -224,6 +236,7 @@
const
onAccountChange
=
function
()
{
getPlazaList
()
}
// 获取商场门店
const
getPlazaList
=
function
()
{
queryForm
.
plaza_id
=
''
plazaList
.
value
=
[]
...
...
@@ -245,7 +258,7 @@
}
)
}
// 获取集团
const
getAccountList
=
function
()
{
queryForm
.
account_id
=
''
accountList
.
value
=
[]
...
...
@@ -268,6 +281,7 @@
getGateList
()
}
const
gateList
=
ref
([])
// 获取监控点
const
getGateList
=
function
()
{
hitSearchObj
.
gate_id
=
[]
gateList
.
value
=
[]
...
...
@@ -299,6 +313,7 @@
pageNum
.
value
=
1
;
getTableData
()
}
// 获取注册人员列表
const
getTableData
=
function
(){
resultList
.
value
=
[]
const
data
=
filterEmptyValueInObject
(
...
...
@@ -335,28 +350,27 @@
const
total
=
ref
()
const
contentHeight
=
ref
(
0
)
const
addPersonConfigRef
=
ref
();
// 新增注册人员弹窗
const
addPersonFun
=
function
(){
addPersonConfigRef
.
value
.
initDialog
({
account_id
:
queryForm
.
account_id
,
plaza_id
:
queryForm
.
plaza_id
,
type
:
'add'
});
}
const
editPersonConfigRef
=
ref
();
// 编辑人员弹窗
const
editRow
=
function
(
row
){
FeatureMatchingAccuracyApi
.
getMatchOne
(
row
).
then
(
(
r
)
=>
{
if
(
r
.
msg_code
==
200
){
editPersonConfigRef
.
value
.
initDialog
(
r
.
data
);
}
else
{
ElMessage
({
message
:
r
.
msg_info
,
type
:
'error'
})
return
false
;
}
}
)
addPersonConfigRef
.
value
.
initDialog
({
account_id
:
row
.
accountId
,
plaza_id
:
row
.
mallId
,
type
:
'edit'
,
name
:
row
.
name
,
description
:
row
.
description
,
id
:
row
.
id
,
});
}
// 删除人员
const
deleteRow
=
function
(
row
){
ElMessageBox
.
confirm
(
'此操作将永久删除该文件, 是否继续?'
,
'提示'
,
{
confirmButtonText
:
'确定'
,
...
...
@@ -384,6 +398,7 @@
)
})
}
// 命中详情
const
hitDetailDialogRef
=
ref
()
const
hitDetail
=
function
(
row
){
const
data
=
filterEmptyValueInObject
(
...
...
@@ -415,11 +430,29 @@
}
)
}
// 添加注册样本图
const
addSamplePicConfigRef
=
ref
();
const
addSamplePic
=
function
(
row
){
FeatureMatchingAccuracyApi
.
getMatchOne
(
row
).
then
(
(
r
)
=>
{
if
(
r
.
msg_code
==
200
){
addSamplePicConfigRef
.
value
.
initDialog
(
r
.
data
);
}
else
{
ElMessage
({
message
:
r
.
msg_info
,
type
:
'error'
})
return
false
;
}
}
)
}
// 注册样本图
const
regPictureList
=
ref
([])
const
hitPictureList
=
ref
([])
const
regPersonId
=
ref
()
const
redPersonObj
=
ref
({})
// 点击行获取注册样本图和命中目标
const
clickRow
=
function
(
row
){
isLoading
.
value
=
true
;
redPersonObj
.
value
=
row
;
...
...
@@ -430,14 +463,19 @@
(
r
)
=>
{
isLoading
.
value
=
false
;
if
(
r
.
msg_code
==
200
){
r
.
data
.
faceList
.
forEach
(
item
=>
{
item
.
picture_url
=
window
.
_baseImgUrl
+
'picture/'
+
item
.
bodyPath
+
item
.
bodyPic
})
regPictureList
.
value
=
r
.
data
.
faceList
r
.
data
.
hitList
.
forEach
(
item
=>
{
item
.
picture_url
=
window
.
_baseImgUrl
+
'picture/'
+
item
.
bodyPath
+
item
.
bodyPic
})
hitPictureList
.
value
=
r
.
data
.
hitList
if
(
r
.
data
.
faceList
&&
r
.
data
.
faceList
.
length
>
0
){
r
.
data
.
faceList
.
forEach
(
item
=>
{
item
.
picture_url
=
window
.
_baseImgUrl
+
'tool/picture/'
+
item
.
bodyPath
+
item
.
bodyPic
})
regPictureList
.
value
=
r
.
data
.
faceList
}
if
(
r
.
data
.
hitList
&&
r
.
data
.
hitList
.
length
>
0
){
r
.
data
.
hitList
.
forEach
(
item
=>
{
item
.
picture_url
=
window
.
_baseImgUrl
+
'tool/picture/'
+
item
.
bodyPath
+
item
.
bodyPic
})
hitPictureList
.
value
=
r
.
data
.
hitList
}
}
}
)
...
...
@@ -458,6 +496,7 @@
clickPicture
()
}
const
currentId
=
ref
()
// 点击图片以图搜图
const
clickPicture
=
function
(
row
){
const
rawData
=
toRaw
(
hitSearchObj
)
// if(rawData.gate_id.length<1){
...
...
@@ -509,31 +548,31 @@
clickPicture
({
id
:
currentId
.
value
})
}
// 选中命中目标
const
checkPicture
=
function
(){
let
checkList
=
[]
identifyResultList
.
value
.
forEach
(
item
=>
{
if
(
item
.
checked
==
true
){
checkList
.
push
(
item
.
id
)
}
})
if
(
checkList
.
length
<
1
){
ElMessage
({
message
:
'请选择识别结果图片'
,
type
:
'warning'
})
return
false
;
}
if
(
!
regPersonId
.
value
){
ElMessage
({
message
:
'请选择注册人员'
,
type
:
'warning'
})
return
false
;
}
const
checkPicture
=
function
(
resData
){
//
let checkList = []
//
identifyResultList.value.forEach(item=>{
//
if(item.checked==true){
//
checkList.push(item.id)
//
}
//
})
//
if(checkList.length<1){
//
ElMessage({
//
message: '请选择识别结果图片',
//
type: 'warning'
//
})
//
return false;
//
}
//
if(!regPersonId.value){
//
ElMessage({
//
message: '请选择注册人员',
//
type: 'warning'
//
})
//
return false;
//
}
isLoading
.
value
=
true
;
FeatureMatchingAccuracyApi
.
addMatchHit
({
id
:
regPersonId
.
value
,
faceIds
:
checkList
faceIds
:
[
resData
.
id
]
}).
then
(
(
r
)
=>
{
isLoading
.
value
=
false
;
...
...
@@ -607,7 +646,7 @@
plazaList
,
resultList
,
addPersonConfigRef
,
editPerson
ConfigRef
,
addSamplePic
ConfigRef
,
hitSearchObj
,
gateList
,
activeKey
:
ref
(
'1'
),
...
...
@@ -638,7 +677,8 @@
checkPicture
,
delHitPic
,
hitDetail
,
delSamplePic
delSamplePic
,
addSamplePic
}
}
}
...
...
@@ -673,17 +713,37 @@
position
:
relative
;
cursor
:
pointer
;
}
.checkBox
{
.btnPic
{
display
:
none
;
position
:
absolute
;
left
:
1px
;
top
:
0
;
right
:
0
;
left
:
0
;
bottom
:
0
;
margin
:
auto
;
}
.pictureBox
:hover
.btnPic
{
display
:
block
;
width
:
100px
;
height
:
100px
;
}
.checkBox
{
width
:
100px
;
height
:
30px
;
margin-left
:
0
!important
;
margin-bottom
:
10px
;
//
position
:
absolute
;
//
left
:
1px
;
//
top
:
0
;
}
.score
{
position
:
absolute
;
left
:
5
0px
;
right
:
1
0px
;
top
:
0
;
color
:
red
;
font-weight
:
900
;
font-size
:
18px
;
}
.iconPic
{
position
:
absolute
;
...
...
src/views/FeatureMatchingAccuracy/FeatureMatchingAccuracyApi.js
View file @
ff23185
...
...
@@ -96,6 +96,16 @@ class FeatureMatchingAccuracy {
}
)
}
addMatchReg
(
data
){
return
axiosInstance
.
request
(
{
method
:
'POST'
,
url
:
`/feature/match/reg`
,
data
:
data
}
)
}
}
const
FeatureMatchingAccuracyApi
=
new
FeatureMatchingAccuracy
()
...
...
src/views/FeatureMatchingAccuracy/addPerson.vue
View file @
ff23185
<
template
>
<a-modal
title=
"新增注册人员
"
:title=
"type=='add'?'新增注册人员':'编辑注册人员'
"
v-if=
"isVisible"
v-model:visible=
"isVisible"
width=
"1500px"
:dialog-style=
"
{ top: '20px',height:'90%' }"
width=
"800px"
class=
"detail-modal"
>
<div
style=
"height: 700px;"
>
<a-form
:model=
"formObj"
layout=
"inline"
:label-col=
"
{ style: { width: '100px' } }">
<div>
<a-form
:model=
"formObj"
:label-col=
"
{ style: { width: '100px' } }">
<a-form-item
label=
"姓名:"
>
<a-input
v-model:value=
"formObj.name"
style=
"width: 500px"
>
</a-input>
...
...
@@ -17,102 +16,6 @@
<a-input
v-model:value=
"formObj.dec"
style=
"width: 500px"
>
</a-input>
</a-form-item>
<a-form-item
label=
"选择样本图:"
class=
"pictures"
>
<a-tabs
type=
"card"
v-model:activeKey=
"activeKey"
>
<a-tab-pane
key=
"1"
tab=
"本地上传"
>
<a-upload
:file-list=
"fileList"
:remove=
"handleRemove"
:before-upload=
"beforeUpload"
:multiple=
"false"
>
<a-button>
<upload-outlined></upload-outlined>
上传文件
</a-button>
</a-upload>
<a-button
type=
"primary"
:disabled=
"fileList.length === 0"
:loading=
"loading"
style=
"margin-top: 16px"
@
click=
"handleUpload"
>
{{
loading
?
'上传中'
:
'开始上传'
}}
</a-button>
</a-tab-pane>
<a-tab-pane
key=
"2"
tab=
"抓拍记录图"
class=
"resultPic"
>
<a-form-item
label=
"监控点:"
style=
"padding: 5px 0"
class=
"secondCondition"
>
<a-select
v-model:value=
"formObj.gate_id"
style=
"width: 270px"
mode=
"multiple"
:maxTagCount=
"1"
:options=
"gateList"
optionFilterProp=
"label"
show-search
>
</a-select>
</a-form-item>
<a-form-item
label=
"方向:"
style=
"padding: 5px 0"
class=
"secondCondition"
>
<a-select
v-model:value=
"formObj.direction"
mode=
"multiple"
:maxTagCount=
"1"
style=
"width: 200px"
>
<a-select-option
:value=
"1"
>
进
</a-select-option>
<a-select-option
:value=
"-1"
>
出
</a-select-option>
</a-select>
</a-form-item>
<a-form-item
label=
"选择日期:"
style=
"padding: 5px 0"
class=
"secondCondition"
>
<a-date-picker
v-model:value=
"formObj.date"
:format=
"'YYYY-MM-DD'"
style=
"width: 150px"
/>
</a-form-item>
<a-form-item
label=
"选择时间:"
style=
"padding: 5px 0"
class=
"secondCondition"
>
<a-time-picker
v-model:value=
"formObj.startTime"
style=
"width: 100px"
/>
<a-time-picker
v-model:value=
"formObj.endTime"
style=
"width: 100px"
/>
</a-form-item>
<a-form-item
style=
"padding: 5px 0"
class=
"secondCondition"
>
<a-button
type=
"primary"
@
click=
"picSearch"
:loading=
"isLoading"
style=
"margin-right: 10px;"
>
查询
</a-button>
<!--
<a-button
type=
"primary"
@
click=
"clickCheck"
>
选中
</a-button>
-->
</a-form-item>
<div
class=
"resultContent"
:style=
"
{'height':contentHeight+'px'}">
<template
v-for=
"person in dataList"
>
<div
class=
"classBox"
:class=
"person.expand?'expand':''"
>
<div>
<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>
<span
style=
"padding-left: 10px;"
>
人id:
{{
' '
+
person
.
person_unid
}}
图片数量:
{{
person
.
perrsonList
.
length
}}
</span>
</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"
class=
"picBox"
>
<el-checkbox
class=
"checkBox"
v-model=
"item.checked"
></el-checkbox>
<el-image
:src=
"item.picture_url"
:fit=
"'fill'"
class=
"single-image"
>
</el-image>
</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"
/>
</a-tab-pane>
</a-tabs>
</a-form-item>
</a-form>
</div>
<template
#
footer
>
...
...
@@ -123,221 +26,100 @@
</template>
<
script
>
import
moment
from
'moment'
import
{
reactive
,
ref
,
toRaw
}
from
"vue"
;
import
{
PlusOutlined
,
LoadingOutlined
}
from
'@ant-design/icons-vue'
;
import
{
isArray
}
from
'@/PublicUtil/Judgment'
import
snapshotRecordApi
from
'@/views/SnapshotCluster/SnapshotRecord/SnapshotRecordApi'
import
clusterResultApi
from
'@/views/SnapshotCluster/ClusterResult/ClusterResultApi'
import
FeatureMatchingAccuracyApi
from
'@/views/FeatureMatchingAccuracy/FeatureMatchingAccuracyApi'
import
{
filterEmptyValueInObject
,
formatDate
,
formatTime
,
getPagedList
}
from
'@/PublicUtil/PublicUtil'
import
{
ElMessage
}
from
'element-plus'
export
default
{
components
:
{
LoadingOutlined
,
PlusOutlined
,
},
setup
(
props
,
context
)
{
const
isVisible
=
ref
(
false
);
const
pageNum
=
ref
(
1
)
const
pageSize
=
ref
(
10
)
const
total
=
ref
()
const
dataList
=
ref
([])
// 暂时选中目标,但没提交
const
checkList
=
ref
([])
const
formObj
=
reactive
({
name
:
''
,
dec
:
''
,
gate_id
:
[],
direction
:
[
1
,
-
1
],
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'
),
})
const
isLoading
=
ref
(
false
)
const
accountId
=
ref
(
''
);
const
mallId
=
ref
(
''
);
const
gateList
=
ref
([])
const
getGateList
=
function
()
{
formObj
.
gate_id
=
[]
gateList
.
value
=
[]
snapshotRecordApi
.
getGateList
(
{
account_id
:
accountId
.
value
,
plaza_id
:
mallId
.
value
,
type
:
0
,
}
).
then
(
(
r
)
=>
{
if
(
isArray
(
r
.
data
))
{
for
(
const
item
of
r
.
data
)
{
gateList
.
value
.
push
(
{
value
:
item
.
id
,
label
:
item
.
name
,
}
)
}
picSearch
()
}
}
)
}
const
type
=
ref
(
''
)
const
initDialog
=
function
(
parmas
)
{
accountId
.
value
=
parmas
.
account_id
;
mallId
.
value
=
parmas
.
plaza_id
;
formObj
.
name
=
''
;
formObj
.
dec
=
''
;
getGateList
()
type
.
value
=
parmas
.
type
;
formObj
.
name
=
parmas
.
name
||
''
;
formObj
.
dec
=
parmas
.
description
||
''
;
if
(
parmas
.
type
==
'edit'
){
formObj
.
id
=
parmas
.
id
}
isVisible
.
value
=
true
;
};
const
onCancel
=
()
=>
{
dataList
.
value
=
[]
total
.
value
=
0
isVisible
.
value
=
false
;
isVisible
.
value
=
false
;
};
const
refreshParentTable
=
function
(){
context
.
emit
(
'refreshParentTable'
)
}
const
onConfirm
=
function
(){
let
faceIds
=
[]
dataList
.
value
.
forEach
((
itemPerson
)
=>
{
itemPerson
.
perrsonList
.
forEach
((
item
)
=>
{
if
(
item
.
checked
)
{
faceIds
.
push
(
item
.
id
)
if
(
type
.
value
==
'add'
){
const
data
=
filterEmptyValueInObject
(
{
accountId
:
accountId
.
value
,
mallId
:
mallId
.
value
,
name
:
formObj
.
name
,
description
:
formObj
.
dec
,
}
})
})
if
(
faceIds
.
length
<
1
){
ElMessage
({
message
:
`请选择图片`
,
type
:
'warning'
})
return
false
;
}
const
data
=
filterEmptyValueInObject
(
{
accountId
:
accountId
.
value
,
mallId
:
mallId
.
value
,
name
:
formObj
.
name
,
description
:
formObj
.
dec
,
faceIds
:
faceIds
}
)
FeatureMatchingAccuracyApi
.
addMatch
(
data
).
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
false
;
)
FeatureMatchingAccuracyApi
.
addMatch
(
data
).
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
false
;
}
}
}
)
}
const
loading
=
ref
(
false
);
const
imageUrl
=
ref
(
''
);
const
fileList
=
ref
([]);
const
beforeUpload
=
(
file
)
=>
{
fileList
.
value
=
[
file
];
return
false
;
};
const
handleRemove
=
(
file
)
=>
{
const
index
=
fileList
.
value
.
indexOf
(
file
);
const
newFileList
=
fileList
.
value
.
slice
();
newFileList
.
splice
(
index
,
1
);
fileList
.
value
=
newFileList
;
};
const
handleUpload
=
function
(){
const
formData
=
new
FormData
();
fileList
.
value
.
forEach
((
file
)
=>
{
formData
.
append
(
'files[]'
,
file
);
});
loading
.
value
=
true
;
}
const
sortDataList
=
function
(
list
)
{
list
.
sort
(
(
a
,
b
)
=>
{
return
(
b
.
perrsonList
.
length
-
a
.
perrsonList
.
length
)
}
)
}
const
picSearch
=
function
(){
pageNum
.
value
=
1
clickSearch
()
}
const
clickSearch
=
function
(){
const
rawData
=
toRaw
(
formObj
)
const
data
=
filterEmptyValueInObject
(
{
account_id
:
accountId
.
value
,
type
:
0
,
plaza_id
:
mallId
.
value
,
gate_id
:
rawData
.
gate_id
.
toString
(),
direction
:
rawData
.
direction
.
toString
(),
picType
:
2
,
personType
:
'1, 0,'
,
startTime
:
formatDate
(
rawData
.
date
)
+
' '
+
formatTime
(
rawData
.
startTime
),
endTime
:
formatDate
(
rawData
.
date
)
+
' '
+
formatTime
(
rawData
.
endTime
),
page
:
pageNum
.
value
-
1
,
pageSize
:
pageSize
.
value
,
}
)
clusterResultApi
.
getClusterResultList
(
data
).
then
(
(
r
)
=>
{
isLoading
.
value
=
false
sortDataList
(
r
.
data
.
persons
)
r
.
data
.
persons
.
forEach
((
itemPerson
)
=>
{
itemPerson
.
expand
=
false
itemPerson
.
perrsonList
.
forEach
((
item
)
=>
{
item
.
checked
=
false
;
if
(
item
.
picture_url
)
{
item
.
picture_url
=
window
.
_baseImgUrl
+
item
.
picture_url
}
})
})
dataList
.
value
=
r
.
data
.
persons
total
.
value
=
r
.
data
.
pageNum
document
.
getElementsByClassName
(
'resultContent'
)[
0
].
scrollTop
=
0
}
)
}
const
onPageNumChange
=
function
(
num
)
{
pageNum
.
value
=
num
clickSearch
()
}
const
onPageSizeChange
=
function
(
current
,
size
)
{
pageNum
.
value
=
1
pageSize
.
value
=
size
clickSearch
()
}
const
expandChange
=
function
(
data
){
dataList
.
value
.
forEach
(
item
=>
{
if
(
data
.
person_unid
==
item
.
person_unid
)
{
item
.
expand
=
!
item
.
expand
}
})
}
const
clickCheck
=
function
(){
dataList
.
value
.
forEach
((
itemPerson
)
=>
{
itemPerson
.
perrsonList
.
forEach
((
item
)
=>
{
if
(
item
.
checked
){
checkList
)
}
else
{
const
data
=
filterEmptyValueInObject
(
{
accountId
:
accountId
.
value
,
mallId
:
mallId
.
value
,
name
:
formObj
.
name
,
description
:
formObj
.
dec
,
id
:
formObj
.
id
,
}
})
})
)
FeatureMatchingAccuracyApi
.
editMatch
(
data
).
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
false
;
}
}
)
}
}
return
{
isVisible
,
...
...
@@ -345,86 +127,11 @@ export default {
onCancel
,
onConfirm
,
initDialog
,
activeKey
:
ref
(
'2'
),
beforeUpload
,
loading
,
imageUrl
,
fileList
,
handleUpload
,
handleRemove
,
gateList
,
isLoading
,
clickSearch
,
onPageNumChange
,
onPageSizeChange
,
total
,
dataList
,
pageNum
,
pageSize
,
getPagedList
,
expandChange
,
clickCheck
,
refreshParentTable
,
picSearch
type
};
},
};
</
script
>
<
style
lang=
"less"
scoped
>
.resultPic
{
border
:
1px
solid
#ddd
;
padding
:
0px
10px
;
}
.pictures
{
width
:
100%
;
margin-top
:
10px
;
}
.secondCondition
{
//
max-width
:
300px
;
display
:
inline-block
;
}
.resultContent
{
overflow
:
auto
;
max-height
:
540px
;
min-height
:
300px
;
margin-bottom
:
10px
;
}
.boxInfo
{
line-height
:
28px
;
margin-bottom
:
5px
;
}
.classBox
{
margin
:
7px
0
;
border
:
solid
1px
black
;
height
:
260px
;
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
;
}
.single-image
{
width
:
100%
;
height
:
220px
;
}
.picBox
{
position
:
relative
;
}
.checkBox
{
position
:
absolute
;
left
:
5px
;
top
:
0
;
}
</
style
>
src/views/FeatureMatchingAccuracy/editPerson.vue
View file @
ff23185
<
template
>
<a-modal
title=
"
编辑注册人员
"
title=
"
添加注册样本图
"
v-model:visible=
"isVisible"
width=
"1500px"
:dialog-style=
"
{ top: '20px',height:'90%' }"
class="detail-modal"
@cancel = 'onCancel()'
>
<div
style=
"height: 700px;"
>
<a-form
:model=
"formObj"
layout=
"inline"
:label-col=
"
{ style: { width: '100px' } }">
<a-form-item
label=
"姓名:"
>
<a-input
v-model:value=
"formObj.name"
style=
"width: 500px"
>
</a-input>
</a-form-item>
<a-form-item
label=
"描述:"
>
<a-input
v-model:value=
"formObj.dec"
style=
"width: 500px"
>
</a-input>
</a-form-item>
<a-form-item
label=
"选择样本图:"
class=
"pictures"
>
<a-form-item
class=
"pictures"
>
<a-tabs
type=
"card"
v-model:activeKey=
"activeKey"
>
<a-tab-pane
key=
"1"
tab=
"本地上传"
>
<a-upload
...
...
@@ -85,11 +78,12 @@
<el-row
v-for=
"row in getPagedList(person.perrsonList, 8)"
>
<el-col
:span=
"3"
v-for=
"item in row"
>
<div
style=
"margin: 0 5px"
class=
"picBox"
>
<
el-checkbox
class=
"checkBox"
v-model=
"item.checked"
></el-checkbox
>
<
!--
<el-checkbox
class=
"checkBox"
v-model=
"item.checked"
></el-checkbox>
--
>
<el-image
:src=
"item.picture_url"
:fit=
"'fill'"
class=
"single-image"
>
</el-image>
<el-button
type=
"primary"
:disabled=
"item.checked?true:false"
class=
"checkBox"
@
click=
"onConfirm(item)"
>
选中
</el-button>
</div>
</el-col>
</el-row>
...
...
@@ -116,7 +110,7 @@
</div>
<
template
#
footer
>
<a-button
@
click=
"onCancel"
>
返回
</a-button>
<
a-button
@
click=
"onConfirm"
type=
"primary"
>
确定
</a-button
>
<
!--
<a-button
@
click=
"onConfirm"
type=
"primary"
>
确定
</a-button>
--
>
</
template
>
</a-modal>
</template>
...
...
@@ -184,57 +178,42 @@ export default {
}
)
}
const
disabledPicList
=
ref
([])
const
initDialog
=
function
(
parmas
)
{
accountId
.
value
=
parmas
.
accountId
;
mallId
.
value
=
parmas
.
mallId
;
formObj
.
name
=
parmas
.
name
;
formObj
.
dec
=
parmas
.
description
;
formObj
.
id
=
parmas
.
id
;
// checkGateList.value = parmas.faceIds
getGateList
()
disabledPicList
.
value
=
parmas
.
faceIds
||
[]
isVisible
.
value
=
true
;
};
const
onCancel
=
()
=>
{
if
(
isAdd
.
value
){
refreshParentTable
()
}
isVisible
.
value
=
false
;
};
const
refreshParentTable
=
function
(){
context
.
emit
(
'refreshParentTable'
)
}
const
onConfirm
=
function
(){
let
faceIds
=
[]
dataList
.
value
.
forEach
((
itemPerson
)
=>
{
itemPerson
.
perrsonList
.
forEach
((
item
)
=>
{
if
(
item
.
checked
)
{
faceIds
.
push
(
item
.
id
)
}
})
})
if
(
faceIds
.
length
<
1
&&
checkGateList
.
length
<
1
){
ElMessage
({
message
:
`请选择图片`
,
type
:
'warning'
})
return
false
;
}
const
isAdd
=
ref
(
false
)
const
onConfirm
=
function
(
resData
){
const
data
=
filterEmptyValueInObject
(
{
// accountId: accountId.value,
// mallId: mallId.value,
name
:
formObj
.
name
,
description
:
formObj
.
dec
,
faceIds
:
faceIds
.
length
<
1
?
checkGateList
.
value
:
faceIds
,
faceIds
:[
resData
.
id
],
id
:
formObj
.
id
}
)
FeatureMatchingAccuracyApi
.
editMatch
(
data
).
then
(
FeatureMatchingAccuracyApi
.
addMatchReg
(
data
).
then
(
(
r
)
=>
{
if
(
r
.
msg_code
==
200
){
ElMessage
({
message
:
r
.
msg_info
,
type
:
'success'
})
refreshParentTable
()
isVisible
.
value
=
false
isAdd
.
value
=
true
;
disabledPicList
.
value
.
push
(
resData
.
id
)
clickSearch
()
}
else
{
ElMessage
({
message
:
r
.
msg_info
,
...
...
@@ -300,7 +279,7 @@ export default {
r
.
data
.
persons
.
forEach
((
itemPerson
)
=>
{
itemPerson
.
expand
=
false
itemPerson
.
perrsonList
.
forEach
((
item
)
=>
{
if
(
checkGate
List
.
value
.
includes
(
item
.
id
)){
if
(
disabledPic
List
.
value
.
includes
(
item
.
id
)){
item
.
checked
=
true
;
}
else
{
item
.
checked
=
false
;
...
...
@@ -362,7 +341,8 @@ export default {
expandChange
,
clickCheck
,
refreshParentTable
,
picSearch
picSearch
,
disabledPicList
};
},
};
...
...
@@ -419,9 +399,18 @@ export default {
.picBox
{
position
:
relative
;
}
.picBox
:hover
.checkBox
{
display
:
block
;
}
.checkBox
{
display
:
none
;
width
:
80px
;
height
:
30px
;
position
:
absolute
;
left
:
5
px
;
left
:
0
px
;
top
:
0
;
right
:
0
;
bottom
:
0
;
margin
:
auto
;
}
</
style
>
src/views/SnapshotCluster/ClusterResult/ClusterResult.vue
View file @
ff23185
...
...
@@ -142,7 +142,7 @@
</el-image>
<div>
时间:
{{
item
.
counttime
}}
</div>
<div>
人员类型:
{{
item
.
person_type
==
1
?
'店员'
:(
item
.
person_type
==
0
?
'顾客'
:
'未知'
)
}}
</div>
<div>
性别:
{{
formatGender
(
item
.
gender
)
}}
</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>
...
...
src/views/SnapshotCluster/SnapshotRecord/SnapshotRecord.vue
View file @
ff23185
...
...
@@ -118,7 +118,7 @@
</el-image>
<div>
时间:
{{
item
.
counttime
}}
</div>
<div>
人员类型:
{{
item
.
person_type
==
1
?
'店员'
:(
item
.
person_type
==
0
?
'顾客'
:
'未知'
)
}}
</div>
<div>
性别:
{{
formatGender
(
item
.
gender
)
}}
</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>
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment