Commit eb87db47 by 李乾广

增加设备序列号筛选,出入类型增加选项

1 parent d39ead22
<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" showSearch placeholder="请选择分组id">
<a-select-option
v-for="item in showDataList"
:key="item"
:value="item"
>人id:{{item}}</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 { ElMessage } from "element-plus";
import clusterResultApi from './ClusterResultApi'
export default {
name: 'PersonGroupEditor',
props: {
dataList: {
type: Array,
default: () => [],
},
dataParams: {
type: Object,
default: null,
},
},
setup(props, { emit }) {
const isVisible = ref(false);
// 表单
function getInitialFormData() {
return {
personUnid: '',
unidList: [],
countdate: '',
}
}
const formData = ref(getInitialFormData())
const 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 : ''
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)
}
}
const onCancel = () => {
isVisible.value = false;
};
const onSave = () => {
const params = {
unid: formData.value.unidList.join(','),
personUnid: formData.value.personUnid,
countdate: formData.value.countdate,
}
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,
showDataList,
};
},
};
</script>
<style lang="less" scoped>
</style>
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
<a-select-option :value="2">楼层出入口</a-select-option> <a-select-option :value="2">楼层出入口</a-select-option>
<a-select-option :value="3">店铺出入口</a-select-option> <a-select-option :value="3">店铺出入口</a-select-option>
<a-select-option :value="4">其他</a-select-option> <a-select-option :value="4">其他</a-select-option>
<a-select-option :value="5">不以广场出入口开始</a-select-option>
</a-select> </a-select>
</a-form-item> </a-form-item>
<a-form-item label="区域信息:" style="padding: 5px 0"> <a-form-item label="区域信息:" style="padding: 5px 0">
...@@ -103,6 +104,9 @@ ...@@ -103,6 +104,9 @@
>{{item.label}}</a-select-option> >{{item.label}}</a-select-option>
</a-select> </a-select>
</a-form-item> </a-form-item>
<a-form-item label="设备序列号:" style="padding: 5px 0;" class="label-width-wu">
<a-input v-model:value="queryForm.deviceSerialNum" style="width: 240px"/>
</a-form-item>
<a-form-item label="人ID:" style="padding: 5px 0"> <a-form-item label="人ID:" style="padding: 5px 0">
<a-input v-model:value="queryForm.personUnid" style="width: 240px"/> <a-input v-model:value="queryForm.personUnid" style="width: 240px"/>
</a-form-item> </a-form-item>
...@@ -156,6 +160,7 @@ ...@@ -156,6 +160,7 @@
> >
<el-button type="text" :disabled="!isMultipleOperation">添加店员库</el-button> <el-button type="text" :disabled="!isMultipleOperation">添加店员库</el-button>
</a-popconfirm> </a-popconfirm>
<!-- <el-button type="text" :disabled="!isMultipleOperation" @click="addPersonnelPool(person)">添加人员库</el-button> -->
<a-popconfirm <a-popconfirm
title="将彻底删除,您确认吗?" title="将彻底删除,您确认吗?"
ok-text="是" ok-text="是"
...@@ -242,6 +247,7 @@ ...@@ -242,6 +247,7 @@
<PersonGroupEditor ref='personGroupEditorRef' @refresh="handleEditorRefresh" /> <PersonGroupEditor ref='personGroupEditorRef' @refresh="handleEditorRefresh" />
<UploadGroupDataEditor ref='uploadGroupDataEditorRef' @refresh="handleEditorRefresh" /> <UploadGroupDataEditor ref='uploadGroupDataEditorRef' @refresh="handleEditorRefresh" />
<PersonGroupMover ref='personGroupMoverRef' :data-params="currentSearchCondition" :data-list="dataList" @refresh="handleRefresh" /> <PersonGroupMover ref='personGroupMoverRef' :data-params="currentSearchCondition" :data-list="dataList" @refresh="handleRefresh" />
<AddPersonnelPool ref='personnelPoolRef' :data-params="currentSearchCondition" :data-list="dataList" @refresh="handleRefresh" />
<PersonGroupDialog ref='personGroupDialogRef' :query-form="queryForm" @refresh="handleRefresh" /> <PersonGroupDialog ref='personGroupDialogRef' :query-form="queryForm" @refresh="handleRefresh" />
</template> </template>
...@@ -261,6 +267,7 @@ import PersonGroupEditor from "./PersonGroupEditor.vue"; ...@@ -261,6 +267,7 @@ import PersonGroupEditor from "./PersonGroupEditor.vue";
import UploadGroupDataEditor from "./UploadGroupDataEditor.vue"; import UploadGroupDataEditor from "./UploadGroupDataEditor.vue";
import PersonGroupDialog from "./PersonGroupDialog.vue"; import PersonGroupDialog from "./PersonGroupDialog.vue";
import PersonGroupMover from "./PersonGroupMover.vue"; import PersonGroupMover from "./PersonGroupMover.vue";
import AddPersonnelPool from "./AddPersonnelPool.vue";
export default { export default {
components:{ components:{
...@@ -268,6 +275,7 @@ export default { ...@@ -268,6 +275,7 @@ export default {
UploadGroupDataEditor, UploadGroupDataEditor,
PersonGroupDialog, PersonGroupDialog,
PersonGroupMover, PersonGroupMover,
AddPersonnelPool,
// imgDialog // imgDialog
DetailDialog, DetailDialog,
PersonnelDialog, PersonnelDialog,
...@@ -315,6 +323,7 @@ export default { ...@@ -315,6 +323,7 @@ export default {
minPic: 0, minPic: 0,
maxPic: 100, maxPic: 100,
childAdult:[], childAdult:[],
deviceSerialNum:'',
} }
) )
const searchCondition = ref({}) const searchCondition = ref({})
...@@ -332,6 +341,7 @@ export default { ...@@ -332,6 +341,7 @@ export default {
queryForm.endTime = searchCondition.value.endTime; queryForm.endTime = searchCondition.value.endTime;
queryForm.minPic = searchCondition.value.minPic||0; queryForm.minPic = searchCondition.value.minPic||0;
queryForm.maxPic = searchCondition.value.maxPic||100; queryForm.maxPic = searchCondition.value.maxPic||100;
queryForm.deviceSerialNum = searchCondition.value.deviceSerialNum;
} }
// function // function
const onPageNumChange = function(num) { const onPageNumChange = function(num) {
...@@ -532,6 +542,7 @@ export default { ...@@ -532,6 +542,7 @@ export default {
// 查询条件 // 查询条件
age: rawData.childAdult?rawData.childAdult.toString():'', age: rawData.childAdult?rawData.childAdult.toString():'',
personUnid: rawData.personUnid, personUnid: rawData.personUnid,
deviceSerialNum: rawData.deviceSerialNum,
} }
) )
const storageData = filterEmptyValueInObject( const storageData = filterEmptyValueInObject(
...@@ -550,6 +561,7 @@ export default { ...@@ -550,6 +561,7 @@ export default {
maxPic: rawData.maxPic, maxPic: rawData.maxPic,
startTime: rawData.startTime, startTime: rawData.startTime,
endTime: rawData.endTime, endTime: rawData.endTime,
deviceSerialNum: rawData.deviceSerialNum,
} }
) )
let searchCondition = JSON.parse(window.localStorage.getItem('searchCondition')); let searchCondition = JSON.parse(window.localStorage.getItem('searchCondition'));
...@@ -858,6 +870,20 @@ export default { ...@@ -858,6 +870,20 @@ export default {
} }
) )
} }
// 添加人员库
const personnelPoolRef = ref();
const addPersonnelPool = () => {
console.log('addPersonnelPool')
if (selectedPersonList.value.length < 1) {
ElMessage({
message: `至少选择一条数据`,
type: 'error'
})
return
}
personnelPoolRef.value.initDialog(selectedPersonList.value);
}
// 移动人员 // 移动人员
const personGroupMoverRef = ref(); const personGroupMoverRef = ref();
const movePersonRecord = () => { const movePersonRecord = () => {
...@@ -1110,6 +1136,7 @@ export default { ...@@ -1110,6 +1136,7 @@ export default {
updatePersonInfoByGroup, updatePersonInfoByGroup,
uploadGroupData, uploadGroupData,
deletePersonRecord, deletePersonRecord,
addPersonnelPool,
movePersonRecord, movePersonRecord,
searchPersonInfoByGroup, searchPersonInfoByGroup,
isSelectedPerson, isSelectedPerson,
...@@ -1134,6 +1161,7 @@ export default { ...@@ -1134,6 +1161,7 @@ export default {
DetailDialogComparisonRef, DetailDialogComparisonRef,
singleImgComparisonRef, singleImgComparisonRef,
personGroupMoverRef, personGroupMoverRef,
personnelPoolRef,
reqPersonType, reqPersonType,
isMultipleOperation, isMultipleOperation,
...@@ -1206,5 +1234,10 @@ export default { ...@@ -1206,5 +1234,10 @@ export default {
display: inline-block; display: inline-block;
margin-left: 20px; margin-left: 20px;
} }
</style>
</style>
<style type="text/css">
.label-width-wu .ant-form-item-label{
width: 84px!important;
}
</style>
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
<a-select-option :value="2">楼层出入口</a-select-option> <a-select-option :value="2">楼层出入口</a-select-option>
<a-select-option :value="3">店铺出入口</a-select-option> <a-select-option :value="3">店铺出入口</a-select-option>
<a-select-option :value="4">其他</a-select-option> <a-select-option :value="4">其他</a-select-option>
<a-select-option :value="5">不以广场出入口开始</a-select-option>
</a-select> </a-select>
</a-form-item> </a-form-item>
<a-form-item label="区域信息:" style="padding: 5px 0"> <a-form-item label="区域信息:" style="padding: 5px 0">
...@@ -101,6 +102,9 @@ ...@@ -101,6 +102,9 @@
>{{item.label}}</a-select-option> >{{item.label}}</a-select-option>
</a-select> </a-select>
</a-form-item> </a-form-item>
<a-form-item label="设备序列号:" style="padding: 5px 0" class="label-width-wu">
<a-input v-model:value="queryForm.deviceSerialNum" style="width: 240px"/>
</a-form-item>
<a-form-item label="选择日期:" style="padding: 5px 0"> <a-form-item label="选择日期:" style="padding: 5px 0">
<a-date-picker v-model:value="queryForm.date" :format="'YYYY-MM-DD'" :allowClear="false" style="width: 280px"/> <a-date-picker v-model:value="queryForm.date" :format="'YYYY-MM-DD'" :allowClear="false" style="width: 280px"/>
</a-form-item> </a-form-item>
...@@ -273,6 +277,7 @@ export default { ...@@ -273,6 +277,7 @@ export default {
startTime: '00:00:00', startTime: '00:00:00',
endTime: '23:59:59', endTime: '23:59:59',
childAdult:[], childAdult:[],
deviceSerialNum:'',
} }
) )
const searchCondition = ref({}) const searchCondition = ref({})
...@@ -288,6 +293,7 @@ export default { ...@@ -288,6 +293,7 @@ export default {
queryForm.date = searchCondition.value.date; queryForm.date = searchCondition.value.date;
queryForm.startTime = searchCondition.value.startTime; queryForm.startTime = searchCondition.value.startTime;
queryForm.endTime = searchCondition.value.endTime; queryForm.endTime = searchCondition.value.endTime;
queryForm.deviceSerialNum = searchCondition.value.deviceSerialNum;
} }
// function // function
const onPageNumChange = function(num) { const onPageNumChange = function(num) {
...@@ -493,6 +499,7 @@ export default { ...@@ -493,6 +499,7 @@ export default {
pageSize: pageSize.value, pageSize: pageSize.value,
// childAdult: rawData.childAdult?rawData.childAdult.toString():'', // childAdult: rawData.childAdult?rawData.childAdult.toString():'',
age: rawData.childAdult?rawData.childAdult.toString():'', age: rawData.childAdult?rawData.childAdult.toString():'',
deviceSerialNum: rawData.deviceSerialNum,
} }
) )
const storageData = filterEmptyValueInObject( const storageData = filterEmptyValueInObject(
...@@ -509,6 +516,7 @@ export default { ...@@ -509,6 +516,7 @@ export default {
date: rawData.date, date: rawData.date,
startTime:rawData.startTime, startTime:rawData.startTime,
endTime:rawData.endTime, endTime:rawData.endTime,
deviceSerialNum: rawData.deviceSerialNum,
} }
) )
let searchCondition = JSON.parse(window.localStorage.getItem('searchCondition')); let searchCondition = JSON.parse(window.localStorage.getItem('searchCondition'));
...@@ -1059,4 +1067,9 @@ export default { ...@@ -1059,4 +1067,9 @@ export default {
line-height: 24px; line-height: 24px;
} }
</style> </style>
<style type="text/css">
.label-width-wu .ant-form-item-label{
width: 84px!important;
}
</style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!