Commit a3964c09 by Tianqing Liu

feat: 批量删除功能完成

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