Commit 7d966b5d by Tianqing Liu

feat: 优化年龄类型,查询条件,抓拍记录

1 parent c262f73a
...@@ -79,7 +79,7 @@ ...@@ -79,7 +79,7 @@
style="width: 240px"> style="width: 240px">
</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">
<a-select v-model:value="queryForm.childAdult" <a-select v-model:value="queryForm.childAdult"
mode="multiple" mode="multiple"
:maxTagCount="1" :maxTagCount="1"
...@@ -88,6 +88,18 @@ ...@@ -88,6 +88,18 @@
<a-select-option :value="0">儿童</a-select-option> <a-select-option :value="0">儿童</a-select-option>
<a-select-option :value="-1">未知</a-select-option> <a-select-option :value="-1">未知</a-select-option>
</a-select> </a-select>
</a-form-item>-->
<a-form-item label="年龄类型:" style="padding: 5px 0">
<a-select v-model:value="queryForm.childAdult"
mode="multiple"
:maxTagCount="1"
style="width: 240px">
<a-select-option
v-for="item in childAdultOptions"
:key="item.value"
:value="item.value"
>{{item.label}}</a-select-option>
</a-select>
</a-form-item> </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"/>
...@@ -144,7 +156,7 @@ ...@@ -144,7 +156,7 @@
> >
</el-image> </el-image>
<div>时间:{{ item.counttime }}</div> <div>时间:{{ item.counttime }}</div>
<div>人员类型:{{ personTypeStr(item.person_type)}}({{ item.childAdult==1?'成人':(item.childAdult==0?'儿童':'未知') }})</div> <div>人员类型:{{ personTypeStr(item.person_type)}}({{ formatChildAdult(item.childAdult) }})</div>
<div> <div>
<span>性别:{{ formatGender(item.gender) }}({{item.age}})</span> <span>性别:{{ formatGender(item.gender) }}({{item.age}})</span>
<a-popover v-if="item.personLabel" trigger="click"> <a-popover v-if="item.personLabel" trigger="click">
...@@ -479,7 +491,8 @@ export default { ...@@ -479,7 +491,8 @@ export default {
endTime: formatDate(rawData.date) + ' ' + rawData.endTime, endTime: formatDate(rawData.date) + ' ' + rawData.endTime,
page: pageNum.value - 1, page: pageNum.value - 1,
pageSize: pageSize.value, pageSize: pageSize.value,
childAdult: rawData.childAdult?rawData.childAdult.toString():'', // childAdult: rawData.childAdult?rawData.childAdult.toString():'',
age: rawData.childAdult?rawData.childAdult.toString():'',
} }
) )
const storageData = filterEmptyValueInObject( const storageData = filterEmptyValueInObject(
...@@ -528,6 +541,20 @@ export default { ...@@ -528,6 +541,20 @@ export default {
const personTypeStr = function(val){ const personTypeStr = function(val){
return (personTypeList.value.filter(v => v.value == val)[0] || {label:'--'}).label return (personTypeList.value.filter(v => v.value == val)[0] || {label:'--'}).label
} }
const childAdultOptions = ref([
{ value: 0, label: '婴儿' },
{ value: 1, label: '儿童' },
{ value: 2, label: '少年' },
{ value: 3, label: '青年' },
{ value: 4, label: '中午' },
{ value: 5, label: '老年' },
{ value: -1, label: '未知' },
])
const formatChildAdult = function(val) {
const targetitem = childAdultOptions.value.find(item => item.value === val)
if (targetitem) return targetitem.label
else return '未知'
}
const formatGender = function(number){ const formatGender = function(number){
switch (number) switch (number)
{ {
...@@ -1000,7 +1027,10 @@ export default { ...@@ -1000,7 +1027,10 @@ export default {
suitTypeStr, suitTypeStr,
rucksackTypeStr, rucksackTypeStr,
handbagTypeStr, handbagTypeStr,
shoppingBagTypeStr shoppingBagTypeStr,
formatChildAdult,
childAdultOptions,
} }
} }
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!