Commit e7f5b49c by Tianqing Liu

feat: 增加移动分组功能

1 parent c2d2d0a8
...@@ -138,8 +138,15 @@ ...@@ -138,8 +138,15 @@
cancel-text="否" cancel-text="否"
@confirm="deletePersonRecord(person)" @confirm="deletePersonRecord(person)"
> >
<span class="expandWord">剔除</span> <a-tooltip placement="bottom">
<template #title>按下cmd或alt键可多选</template>
<span class="expandWord">剔除</span>
</a-tooltip>
</a-popconfirm> </a-popconfirm>
<a-tooltip placement="bottom">
<template #title>按下cmd或alt键可多选</template>
<span class="expandWord" @click="movePersonRecord(person)">移动</span>
</a-tooltip>
<span class="expandWord" @click='updatePersonInfoByGroup(person)'>类型修正</span> <span class="expandWord" @click='updatePersonInfoByGroup(person)'>类型修正</span>
<span class="expandWord" @click='searchPersonInfoByGroup(person)'>搜索</span> <span class="expandWord" @click='searchPersonInfoByGroup(person)'>搜索</span>
...@@ -200,6 +207,7 @@ ...@@ -200,6 +207,7 @@
<singleImgComparisonDialog ref="singleImgComparisonRef"></singleImgComparisonDialog> <singleImgComparisonDialog ref="singleImgComparisonRef"></singleImgComparisonDialog>
<PersonGroupEditor ref='personGroupEditorRef' @refresh="clickSearch" /> <PersonGroupEditor ref='personGroupEditorRef' @refresh="clickSearch" />
<PersonGroupMover ref='personGroupMoverRef' :data-list="dataList" @refresh="clickSearch" />
<PersonGroupDialog ref='personGroupDialogRef' @refresh="clickSearch" /> <PersonGroupDialog ref='personGroupDialogRef' @refresh="clickSearch" />
</template> </template>
...@@ -216,11 +224,13 @@ import DetailDialogComparison from "../../ComparisonCapturedPictures/DetailDialo ...@@ -216,11 +224,13 @@ import DetailDialogComparison from "../../ComparisonCapturedPictures/DetailDialo
import singleImgComparisonDialog from "../singleImgComparisonDialog.vue"; import singleImgComparisonDialog from "../singleImgComparisonDialog.vue";
import PersonGroupEditor from "./PersonGroupEditor.vue"; import PersonGroupEditor from "./PersonGroupEditor.vue";
import PersonGroupDialog from "./PersonGroupDialog.vue"; import PersonGroupDialog from "./PersonGroupDialog.vue";
import PersonGroupMover from "./PersonGroupMover.vue";
export default { export default {
components:{ components:{
PersonGroupEditor, PersonGroupEditor,
PersonGroupDialog, PersonGroupDialog,
PersonGroupMover,
// imgDialog // imgDialog
DetailDialog, DetailDialog,
DetailDialogComparison, DetailDialogComparison,
...@@ -581,6 +591,14 @@ export default { ...@@ -581,6 +591,14 @@ export default {
const selectedPersonList = ref([]) const selectedPersonList = ref([])
const deletePersonRecord = (data) => { const deletePersonRecord = (data) => {
console.log('deletePersonRecord', data) console.log('deletePersonRecord', data)
if (selectedPersonList.value.length < 1) {
ElMessage({
message: `至少选择一条数据`,
type: 'error'
})
return
}
const unidList = selectedPersonList.value.map(item => item.unid) const unidList = selectedPersonList.value.map(item => item.unid)
const params = { const params = {
unid: unidList.join(','), unid: unidList.join(','),
...@@ -608,6 +626,20 @@ export default { ...@@ -608,6 +626,20 @@ export default {
const isSelectedPerson = (id) => { const isSelectedPerson = (id) => {
return selectedPersonList.value.some(item => item.id === id) return selectedPersonList.value.some(item => item.id === id)
} }
// 移动人员
const personGroupMoverRef = ref();
const movePersonRecord = (data) => {
console.log('movePersonRecord', data)
if (selectedPersonList.value.length < 1) {
ElMessage({
message: `至少选择一条数据`,
type: 'error'
})
return
}
personGroupMoverRef.value.initDialog(data, selectedPersonList.value);
}
// 查询组 // 查询组
const personGroupDialogRef = ref(); const personGroupDialogRef = ref();
const searchPersonInfoByGroup = function(data) { const searchPersonInfoByGroup = function(data) {
...@@ -806,6 +838,7 @@ export default { ...@@ -806,6 +838,7 @@ export default {
expandChange, expandChange,
updatePersonInfoByGroup, updatePersonInfoByGroup,
deletePersonRecord, deletePersonRecord,
movePersonRecord,
searchPersonInfoByGroup, searchPersonInfoByGroup,
isSelectedPerson, isSelectedPerson,
selectedPersonList, selectedPersonList,
...@@ -821,6 +854,7 @@ export default { ...@@ -821,6 +854,7 @@ export default {
personGroupEditorRef, personGroupEditorRef,
DetailDialogComparisonRef, DetailDialogComparisonRef,
singleImgComparisonRef, singleImgComparisonRef,
personGroupMoverRef,
} }
} }
} }
......
...@@ -100,7 +100,7 @@ class ClusterResultApi { ...@@ -100,7 +100,7 @@ class ClusterResultApi {
} }
) )
} }
// 剔除 // 剔除或移动
updateRecognition(data) { updateRecognition(data) {
return axiosInstance.request( return axiosInstance.request(
{ {
......
...@@ -81,6 +81,11 @@ export default { ...@@ -81,6 +81,11 @@ export default {
// 刷新列表 // 刷新列表
emit('refresh') emit('refresh')
onCancel() onCancel()
} else {
ElMessage({
message: `保存失败`,
type: 'error'
})
} }
} }
) )
......
<template>
<a-modal
title="人员移动"
v-if='isVisible'
v-model:visible="isVisible"
width="520px"
height='50%'
class="detail-modal"
>
<a-form :model="formData">
<a-form-item label="分组">
<a-select v-model:value="formData.personUnid" placeholder="请选择分组id">
<a-select-option
v-for="item in dataList"
:key="item.person_unid"
:value="item.person_unid"
>人id:{{item.person_unid}}</a-select-option>
</a-select>
</a-form-item>
</a-form>
<template #footer>
<a-button type="primary" @click="onSave">保存</a-button>
<a-button @click="onCancel">返回</a-button>
</template>
</a-modal>
</template>
<script>
import { ref } from "vue";
import clusterResultApi from '@/views/SnapshotCluster/ClusterResult/ClusterResultApi'
import { ElMessage } from "element-plus";
export default {
name: 'PersonGroupEditor',
props: {
dataList: {
type: Array,
default: () => [],
},
},
setup(props, { emit }) {
const isVisible = ref(false);
// 表单
function getInitialFormData() {
return {
personUnid: '',
unidList: [],
}
}
const formData = ref(getInitialFormData())
const initDialog = (data, selectedList) => {
console.log('initDialog', data, selectedList)
formData.value = getInitialFormData()
formData.value.unidList = selectedList.map(item => item.person_unid)
isVisible.value = true;
};
const onCancel = () => {
isVisible.value = false;
};
const onSave = () => {
const params = {
unid: formData.value.unidList.join(','),
personUnid: formData.value.personUnid,
}
clusterResultApi.updateRecognition(params).then(
(r) => {
if(r.msg_code==200){
ElMessage({
message: `保存成功`,
type: 'success'
})
// 刷新列表
emit('refresh')
onCancel()
} else {
ElMessage({
message: `保存失败`,
type: 'error'
})
}
}
)
};
return {
isVisible,
formData,
onSave,
onCancel,
initDialog,
};
},
};
</script>
<style lang="less" scoped>
</style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!