Commit 3687a857 by 李乾广

修改bug

1 parent 361479b5
<template>
<a-modal
title="人员移动"
title="添加人员库"
v-if='isVisible'
v-model:visible="isVisible"
width="520px"
......@@ -8,13 +8,13 @@
class="detail-modal"
>
<a-form :model="formData">
<a-form-item label="分组">
<a-select v-model:value="formData.personUnid" showSearch placeholder="请选择分组id">
<a-form-item label="人员类型">
<a-select v-model:value="formData.personType" showSearch placeholder="请选择">
<a-select-option
v-for="item in showDataList"
:key="item"
:value="item"
>人id:{{item}}</a-select-option>
v-for="(item,index) in showDataList"
:key="index"
:value="item.id"
>{{item.name}}</a-select-option>
</a-select>
</a-form-item>
</a-form>
......@@ -30,14 +30,10 @@
import { ref } from "vue";
import { ElMessage } from "element-plus";
import clusterResultApi from './ClusterResultApi'
import moment from 'moment'
export default {
name: 'PersonGroupEditor',
props: {
dataList: {
type: Array,
default: () => [],
},
dataParams: {
type: Object,
default: null,
......@@ -48,46 +44,40 @@ export default {
// 表单
function getInitialFormData() {
return {
personUnid: '',
unidList: [],
countdate: '',
personType: '',
countdate:'',
unids:[],
}
}
const formData = ref(getInitialFormData())
const initDialog = (selectedList) => {
console.log('initDialog', selectedList)
// console.log('initDialog', selectedList)
formData.value = getInitialFormData()
formData.value.unidList = selectedList.map(item => item.unid)
formData.value.countdate = selectedList.length > 0 ? selectedList[0].counttime : ''
formData.value.unids = selectedList.map(item => item.unid)
formData.value.countdate = selectedList.length > 0 ? moment(selectedList[0].counttime).format('YYYY-MM-DD 00:00:00') : ''
isVisible.value = true;
getDataList()
};
const showDataList = ref([])
const getDataList = () => {
if (props.dataParams) {
clusterResultApi.getClusterResultUidList(props.dataParams).then(r => {
console.log('getClusterResultUidList', r)
showDataList.value = r.data
})
} else {
// 使用props.dataList
showDataList.value = props.dataList.map(item => item.person_unid)
}
clusterResultApi.getPersonPoolType(props.dataParams).then(r => {
// console.log('getPersonPoolType', r)
showDataList.value = r.data
})
}
const onCancel = () => {
isVisible.value = false;
};
const onSave = () => {
const params = {
unid: formData.value.unidList.join(','),
personUnid: formData.value.personUnid,
unids: formData.value.unids,
personType: formData.value.personType,
countdate: formData.value.countdate,
mallId: props.dataParams.plaza_id,
}
clusterResultApi.updateRecognition(params).then(
clusterResultApi.addPerson(params).then(
(r) => {
if(r.msg_code==200){
ElMessage({
......
......@@ -160,7 +160,7 @@
>
<el-button type="text" :disabled="!isMultipleOperation">添加店员库</el-button>
</a-popconfirm>
<!-- <el-button type="text" :disabled="!isMultipleOperation" @click="addPersonnelPool(person)">添加人员库</el-button> -->
<el-button type="text" :disabled="!isMultipleOperation" @click="addPersonnelPool(person)">添加人员库</el-button>
<a-popconfirm
title="将彻底删除,您确认吗?"
ok-text="是"
......@@ -247,7 +247,7 @@
<PersonGroupEditor ref='personGroupEditorRef' @refresh="handleEditorRefresh" />
<UploadGroupDataEditor ref='uploadGroupDataEditorRef' @refresh="handleEditorRefresh" />
<PersonGroupMover ref='personGroupMoverRef' :data-params="currentSearchCondition" :data-list="dataList" @refresh="handleRefresh" />
<AddPersonnelPool ref='personnelPoolRef' :data-params="currentSearchCondition" :data-list="dataList" @refresh="handleRefresh" />
<AddPersonnelPool ref='personnelPoolRef' :data-params="currentSearchCondition" @refresh="handleRefresh" />
<PersonGroupDialog ref='personGroupDialogRef' :query-form="queryForm" @refresh="handleRefresh" />
</template>
......@@ -606,7 +606,7 @@ export default {
{ value: 1, label: '儿童' },
{ value: 2, label: '少年' },
{ value: 3, label: '青年' },
{ value: 4, label: '中' },
{ value: 4, label: '中' },
{ value: 5, label: '老年' },
{ value: -1, label: '未知' },
])
......@@ -886,7 +886,6 @@ export default {
})
return
}
personnelPoolRef.value.initDialog(selectedPersonList.value);
}
// 移动人员
......
......@@ -65,6 +65,20 @@ class ClusterResultApi {
}
)
}
// 查询集团级人员类型
getPersonPoolType(data) {
return axiosInstance.request(
{
method: 'GET',
url: `/persontype/getPersonPoolType`,
params: filterEmptyValueInObject(
{
plaza_id: data.plaza_id,
},
)
}
)
}
getGateList(data) {
return axiosInstance.request(
......@@ -133,6 +147,16 @@ class ClusterResultApi {
}
)
}
// 添加人员库
addPerson(data) {
return axiosInstance.request(
{
method: 'POST',
url: `/faceRecognitions/addPerson`,
data: data
}
)
}
// 剔除或移动
updateRecognition(data) {
return axiosInstance.request(
......
......@@ -554,7 +554,7 @@ export default {
{ value: 1, label: '儿童' },
{ value: 2, label: '少年' },
{ value: 3, label: '青年' },
{ value: 4, label: '中' },
{ value: 4, label: '中' },
{ value: 5, label: '老年' },
{ value: -1, label: '未知' },
])
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!