Commit 5519d217 by Tianqing Liu

feat: 聚类结果,弹窗中表单,数据回显

1 parent 548e6939
......@@ -190,7 +190,7 @@
<DetailDialogComparison ref="DetailDialogComparisonRef" />
<singleImgComparisonDialog ref="singleImgComparisonRef"></singleImgComparisonDialog>
<PersonGroupEditor ref='personGroupEditorRef' />
<PersonGroupEditor ref='personGroupEditorRef' @refresh="clickSearch" />
</template>
<script>
......
......@@ -68,7 +68,7 @@ class ClusterResultApi {
}
)
}
getBodyPoint(data) {
return axiosInstance.request(
{
......@@ -80,6 +80,17 @@ class ClusterResultApi {
}
)
}
// 人员类型修正
updatePerson(data) {
return axiosInstance.request(
{
method: 'POST',
url: `/faceRecognitions/updatePerson`,
data: data
}
)
}
}
const clusterResultApi = new ClusterResultApi()
......
......@@ -18,8 +18,8 @@
</a-form-item>
<a-form-item label="性别">
<a-select v-model:value="formData.gender">
<a-select-option :value="0"></a-select-option>
<a-select-option :value="1"></a-select-option>
<a-select-option :value="0"></a-select-option>
<a-select-option :value="1"></a-select-option>
</a-select>
</a-form-item>
<a-form-item label="类型">
......@@ -31,7 +31,7 @@
</a-form>
<template #footer>
<a-button type="primary" @click="onCancel">保存</a-button>
<a-button type="primary" @click="onSave">保存</a-button>
<a-button @click="onCancel">返回</a-button>
</template>
</a-modal>
......@@ -39,33 +39,57 @@
<script>
import { ref } from "vue";
import clusterResultApi from '@/views/SnapshotCluster/ClusterResult/ClusterResultApi'
import { ElMessage } from "element-plus";
export default {
name: 'PersonGroupEditor',
setup() {
setup(props, { emit }) {
const isVisible = ref(false);
// 表单
function getInitialFormData() {
return {
personUnid: '',
age: 1,
gender: 0,
type: 0,
}
}
const formData = ref(getInitialFormData())
const initDialog = (data) => {
console.log('initDialog', data)
formData.value = getInitialFormData()
formData.value.personUnid = data.person_unid
formData.value.age = data.perrsonList.length > 0 ? data.perrsonList[0].age : 1
formData.value.gender = data.perrsonList.length > 0 ? data.perrsonList[0].gender : 0
formData.value.type = data.perrsonList.length > 0 ? data.perrsonList[0].person_type : 0
isVisible.value = true;
};
// 表单
const formData = ref({
personUnid: '',
age: undefined,
gender: 0,
type: 0,
})
const onCancel = () => {
isVisible.value = false;
};
const onSave = () => {
clusterResultApi.updatePerson(formData.value).then(
(r) => {
if(r.msg_code==200){
ElMessage({
message: `保存成功`,
type: 'success'
})
// 刷新列表
emit('refresh')
onCancel()
}
}
)
};
return {
isVisible,
formData,
onSave,
onCancel,
initDialog,
};
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!