Commit f41139ec by Tianqing Liu

feat: 聚类结果,批量删除

1 parent 5519d217
......@@ -132,6 +132,14 @@
<span class="expandWord" @click='expandChange(person)'>{{person.expand?'收起':'展开'}}</span>
<!--修正组类型数据-->
<a-popconfirm
title="您确认要删除此记录吗?"
ok-text="是"
cancel-text="否"
@confirm="deletePersonRecord(person)"
>
<span class="expandWord">删除</span>
</a-popconfirm>
<span class="expandWord" @click='updatePersonInfoByGroup(person)'>类型修正</span>
<el-checkbox class="checkBox" v-model="person.checked" @change='checkChange(person)'></el-checkbox>
......@@ -142,8 +150,8 @@
<el-col :span="3" v-for="item in row">
<div
style="margin: 0 5px"
:class="currentItemId==item.id?'actived':''"
@click="handleClick(item)"
:class="(currentItemId==item.id || isSelectedPerson(item.id))?'actived':''"
@click="handleClick(item, $event)"
>
<div style="">
<span @click="downloadTrajectoryFile(item.track_url)"
......@@ -565,6 +573,27 @@ export default {
// isShowGroupEditor.value = true
personGroupEditorRef.value.initDialog(data);
}
// 删除人员
const selectedPersonList = ref([])
const deletePersonRecord = (data) => {
console.log('deletePersonRecord', data)
clusterResultApi.deletePerson(data).then(
(r) => {
if(r.msg_code==200){
ElMessage({
message: `删除成功`,
type: 'success'
})
selectedPersonList.value = []
// 刷新列表
clickSearch()
}
}
)
}
const isSelectedPerson = (id) => {
return selectedPersonList.value.some(item => item.id === id)
}
const downloadFile = function(url) {
window.open(url)
......@@ -572,14 +601,13 @@ export default {
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 handleClick = function(data, event){
console.log('handleClick', event)
currentItemId.value = data.id
currobj.value = data;
if (event.metaKey) {
selectedPersonList.value.push(data)
}
}
const checkChange = function(data){
console.log(data)
......@@ -742,6 +770,9 @@ export default {
checkChange,
expandChange,
updatePersonInfoByGroup,
deletePersonRecord,
isSelectedPerson,
selectedPersonList,
clerkComparativeFun,
singleComparativeFun,
formatGender,
......
......@@ -91,6 +91,15 @@ class ClusterResultApi {
}
)
}
// 多选删除
deletePerson(data) {
return axiosInstance.request(
{
method: 'DELETE',
url: `/faceRecognitions/${data.id}`,
}
)
}
}
const clusterResultApi = new ClusterResultApi()
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!