Commit a3964c09 by Tianqing Liu

feat: 批量删除功能完成

1 parent 5b362a60
......@@ -146,14 +146,14 @@
<i class="el-icon-arrow-right el-icon--right"></i>
</el-button>
<!--批量子操作-->
<el-button type="text" :disabled="mutipleOperationDisabled" @click="movePersonRecord(person)">移动</el-button>
<el-button type="text" :disabled="mutipleOperationDisabled || !isCurrentGroup(person)" @click="movePersonRecord(person)">移动</el-button>
<a-popconfirm
title="将从本组中剔除,您确认吗?"
ok-text="是"
cancel-text="否"
@confirm="deletePersonRecord(person)"
>
<el-button type="text" :disabled="mutipleOperationDisabled">剔除</el-button>
<el-button type="text" :disabled="mutipleOperationDisabled || !isCurrentGroup(person)">剔除</el-button>
</a-popconfirm>
<a-popconfirm
title="将彻底删除,您确认吗?"
......@@ -161,7 +161,7 @@
cancel-text="否"
@confirm="deleteRealPersonRecord(person)"
>
<el-button type="text" :disabled="mutipleOperationDisabled">删除</el-button>
<el-button type="text" :disabled="mutipleOperationDisabled || !isCurrentGroup(person)">删除</el-button>
</a-popconfirm>
</div>
</div>
......@@ -468,6 +468,8 @@ export default {
confirmSearch()
}
const handleRefresh = function() {
isMultipleOperation.value = false
currentMultipleGroupId.value = ''
selectedPersonList.value = []
confirmSearch()
}
......@@ -639,10 +641,7 @@ export default {
return currentMultipleGroupId.value === data.person_unid
}
const mutipleOperationDisabled = computed(() => {
return !(
isMultipleOperation.value
&& selectedPersonList.value.length > 0
)
return !(selectedPersonList.value.length > 0 && isMultipleOperation.value)
})
const isSelectedPerson = (id) => {
return selectedPersonList.value.some(item => item.id === id)
......@@ -674,7 +673,7 @@ export default {
})
selectedPersonList.value = []
// 刷新列表
clickSearch()
handleRefresh()
} else {
ElMessage({
message: `剔除失败`,
......@@ -688,27 +687,24 @@ export default {
const deleteRealPersonRecord = (data) => {
console.log('deletePersonRecord', data, selectedPersonList)
const unidList = selectedPersonList.value.map(item => item.unid)
const strIdList = selectedPersonList.value.map(item => item.id).join(',')
const params = {
unid: unidList.join(','),
personUnid: '',
countdate: selectedPersonList.value[0].counttime
id: strIdList,
}
// TODO: 需要增加方法
clusterResultApi.updateRecognition(params).then(
clusterResultApi.deleteRecognition(params).then(
(r) => {
if(r.msg_code==200){
ElMessage({
message: `除成功`,
message: `除成功`,
type: 'success'
})
selectedPersonList.value = []
// 刷新列表
clickSearch()
handleRefresh()
} else {
ElMessage({
message: `除失败`,
message: `除失败`,
type: 'error'
})
}
......
......@@ -110,6 +110,16 @@ class ClusterResultApi {
}
)
}
// 删除图片
deleteRecognition(data) {
return axiosInstance.request(
{
method: 'POST',
url: `/faceRecognitions/batchDelete`,
data: data
}
)
}
// 获取UUID,移动图片时需要
getClusterResultUidList(data) {
return axiosInstance.request(
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!