Commit 1f6327c1 by 李金轩

ljx

1 parent a2828121
...@@ -343,8 +343,9 @@ export const addSerialNumber = function(sourceData) { ...@@ -343,8 +343,9 @@ export const addSerialNumber = function(sourceData) {
// 把 date 对象转换为 0000-00-00 这种日期形式 // 把 date 对象转换为 0000-00-00 这种日期形式
export const formatDate = function(date) { export const formatDate = function(date) {
if (isDate(date)) return moment(date).format("YYYY-MM-DD")
{ }
return moment(date).format("YYYY-MM-DD")
} export const formatTime = function(date) {
return moment(date).format("HH:mm:ss")
} }
...@@ -15,7 +15,7 @@ axiosInstance.interceptors.request.use( ...@@ -15,7 +15,7 @@ axiosInstance.interceptors.request.use(
config => { config => {
if (window.location.hostname === 'localhost') if (window.location.hostname === 'localhost')
{ {
config.headers.Authorization = '68e02bdc-5815-44e1-94c2-8a01d3270c4c' config.headers.Authorization = 'c3b85226-4301-45fb-a087-4caf3194fc90'
} }
else else
{ {
......
.single-image {
height: 300px;
width: 100%;
}
import axiosInstance from "@/Request/PublicAxiosInstance"
import {filterEmptyValueInObject} from "@/PublicUtil/PublicUtil"
class ClusterResultApi {
getClusterResultList(data) {
return axiosInstance.request(
{
method: 'GET',
url: `/faceRecognitions/faceRecord`,
params: filterEmptyValueInObject(
data
)
}
)
}
getAccountList() {
return axiosInstance.request(
{
method: 'GET',
url: `/accounts`,
}
)
}
getPlazaList(data) {
return axiosInstance.request(
{
method: 'GET',
url: `/malls`,
params: filterEmptyValueInObject(
{
accountIds: data.account_id
},
)
}
)
}
getZoneList(data) {
return axiosInstance.request(
{
method: 'GET',
url: `/zones/zoneList`,
params: filterEmptyValueInObject(
{
account_id: data.account_id,
plaza_id: data.plaza_id,
},
)
}
)
}
getGateList(data) {
return axiosInstance.request(
{
method: 'GET',
url: `/gates/gateByInfo`,
params: filterEmptyValueInObject(
{
account_id: data.account_id,
plaza_id: data.plaza_id,
zone_id: data.zone_id,
type: data.type,
},
)
}
)
}
}
const clusterResultApi = new ClusterResultApi()
export default clusterResultApi
...@@ -7,10 +7,10 @@ ...@@ -7,10 +7,10 @@
聚类结果 聚类结果
</a-menu-item> </a-menu-item>
</a-menu> </a-menu>
<div v-if="currentMenu[0] === '抓拍记录'"> <div v-show="currentMenu[0] === '抓拍记录'">
<SnapshotRecord></SnapshotRecord> <SnapshotRecord></SnapshotRecord>
</div> </div>
<div v-if="currentMenu[0] === '聚类结果'"> <div v-show="currentMenu[0] === '聚类结果'">
<ClusterResult></ClusterResult> <ClusterResult></ClusterResult>
</div> </div>
</template> </template>
......
.single-image {
height: 300px;
width: 100%;
}
...@@ -66,10 +66,13 @@ ...@@ -66,10 +66,13 @@
</a-select> </a-select>
</a-form-item> </a-form-item>
<a-form-item label="方向:"> <a-form-item label="方向:">
<a-select v-model:value="queryAlarmEventForm.direction" style="width: 200px"> <a-select v-model:value="queryAlarmEventForm.direction"
mode="multiple"
:maxTagCount="1"
style="width: 200px">
<a-select-option :value="1"></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-option :value="2">横穿</a-select-option> <a-select-option :value="0">横穿</a-select-option>
</a-select> </a-select>
</a-form-item> </a-form-item>
<a-form-item label="抓怕类型:"> <a-form-item label="抓怕类型:">
...@@ -79,50 +82,89 @@ ...@@ -79,50 +82,89 @@
</a-select> </a-select>
</a-form-item> </a-form-item>
<a-form-item label="人员类型:"> <a-form-item label="人员类型:">
<a-select v-model:value="queryAlarmEventForm.personType" style="width: 200px"> <a-select v-model:value="queryAlarmEventForm.personType"
mode="multiple"
:maxTagCount="1"
style="width: 200px">
<a-select-option :value="1">店员</a-select-option> <a-select-option :value="1">店员</a-select-option>
<a-select-option :value="2">顾客</a-select-option> <a-select-option :value="2">顾客</a-select-option>
</a-select> </a-select>
</a-form-item> </a-form-item>
<a-form-item label="选择日期:"> <a-form-item label="选择日期:">
<a-range-picker <a-date-picker v-model:value="queryAlarmEventForm.date" :format="'YYYY-MM-DD'"/>
v-model:value="queryAlarmEventForm.time" </a-form-item>
:show-time="{ format: 'HH:mm' }" <a-form-item label="选择时间:">
format="YYYY-MM-DD HH:mm" <a-time-picker v-model:value="queryAlarmEventForm.startTime"/>
/> <a-time-picker v-model:value="queryAlarmEventForm.endTime"/>
</a-form-item> </a-form-item>
<a-form-item> <a-form-item>
<a-button type="primary" @click="onSubmit">查询</a-button> <a-button type="primary" @click="confirmSearch">查询</a-button>
</a-form-item> </a-form-item>
</a-form> </a-form>
<el-pagination @current-change="onPageNumChange" <div v-loading="isLoading">
@size-change="onPageSizeChange" <el-row v-for="row in pagedTableDataList">
:current-page="pageNum" <el-col :span="3" v-for="item in row">
:page-size="pageSize" <div style="margin: 0 5px">
:total="total" <div style="display:flex; justify-content: flex-end ">
:page-sizes="[12, 24, 36, 48]" <span @click="downloadFile(item.features_url)"
layout="total, sizes, prev, pager, next, jumper" style="color: #409EFF;font-size: 15px;cursor: pointer;">
style="text-align:center" 下载特征值文件
> </span>
</el-pagination> </div>
<el-image :src="item.picture_url"
:fit="'contain'"
class="single-image">
</el-image>
<div>时间:{{ item.counttime }}</div>
<div>方向:{{ formatDirection(item.direction) }}</div>
<div>地点:{{ item.gate_name }}</div>
</div>
</el-col>
</el-row>
<a-pagination
v-model:current="pageNum"
v-model:pageSize="pageSize"
:total="total"
:show-total="total => `共 ${total} 条`"
:pageSizeOptions="['24', '48', '96', '192']"
@change="onPageNumChange"
@showSizeChange="onPageSizeChange"
show-size-changer
show-quick-jumper
style="text-align:center"
/>
</div>
</template> </template>
<script> <script>
import {reactive, ref} from 'vue' import {computed, reactive, ref, toRaw} from 'vue'
import snapshotRecordApi from '@/views/SnapshotCluster/SnapshotRecord/SnapshotRecordApi' import snapshotRecordApi from '@/views/SnapshotCluster/SnapshotRecord/SnapshotRecordApi'
import {isArray} from '@/PublicUtil/Judgment' import {isArray} from '@/PublicUtil/Judgment'
import moment from 'moment'
import {filterEmptyValueInObject, formatDate, formatTime, getPagedList} from '@/PublicUtil/PublicUtil'
export default { export default {
setup() { setup() {
// scalar // scalar
const pageNum = ref(1) const pageNum = ref(1)
const pageSize = ref(12) const pageSize = ref(24)
const total = ref() const total = ref()
const isLoading = ref(false)
// sequence
const dataList = ref([])
const accountList = ref([]) const accountList = ref([])
const plazaList = ref([]) const plazaList = ref([])
const zoneList = ref([]) const zoneList = ref([])
const gateList = ref([]) const gateList = ref([])
const pagedTableDataList = computed(
() => {
return getPagedList(dataList.value, 8)
}
)
const queryAlarmEventForm = reactive( const queryAlarmEventForm = reactive(
{ {
account_id: [], account_id: [],
...@@ -130,29 +172,24 @@ export default { ...@@ -130,29 +172,24 @@ export default {
zone_id: [], zone_id: [],
gate_id: [], gate_id: [],
type: 0, type: 0,
direction: '', direction: [1, -1, 0],
picType: '', picType: 2,
personType: '', personType: [1, 2],
startTime: '', date: moment(moment().format('YYYY-MM-DD'), 'YYYY-MM-DD'),
endTime: '', startTime: moment('00:00:00', 'HH:mm:ss'),
endTime: moment('23:59:59', 'HH:mm:ss'),
time: '',
} }
) )
// function // function
const onPageNumChange = function(num) { const onPageNumChange = function(num) {
pageNum.value = num pageNum.value = num
getPeopleImageFolderList() confirmSearch()
} }
const onPageSizeChange = function(size) {
const onPageSizeChange = function(current, size) {
pageNum.value = 1 pageNum.value = 1
pageSize.value = size pageSize.value = size
getPeopleImageFolderList() confirmSearch()
}
const getPeopleImageFolderList = function() {
} }
const onSubmit = function() { const onSubmit = function() {
...@@ -242,6 +279,62 @@ export default { ...@@ -242,6 +279,62 @@ export default {
) )
} }
const confirmSearch = function() {
isLoading.value = true
const rawData = toRaw(queryAlarmEventForm)
const data = filterEmptyValueInObject(
{
account_id: rawData.account_id.toString(),
type: rawData.type,
plaza_id: rawData.plaza_id.toString(),
zone_id: rawData.zone_id.toString(),
gate_id: rawData.gate_id.toString(),
direction: rawData.direction.toString(),
picType: rawData.picType,
personType: rawData.personType.toString(),
startTime: formatDate(rawData.date) + ' ' + formatTime(rawData.startTime),
endTime: formatDate(rawData.date) + ' ' + formatTime(rawData.endTime),
page: pageNum.value - 1,
pageSize: pageSize.value,
}
)
snapshotRecordApi.getSnapshotRecordList(data).then(
(r) => {
isLoading.value = false
dataList.value = r.data.persons
total.value = r.data.pageNum
}
)
}
const formatDirection = function(number) {
switch (number)
{
case 1:
{
return '进'
}
case 0:
{
return '出'
}
case 2:
{
return '横穿'
}
default:
{
break
}
}
}
const downloadFile = function(url) {
window.open(url)
}
const initialize = function() { const initialize = function() {
getAccountList() getAccountList()
} }
...@@ -250,15 +343,17 @@ export default { ...@@ -250,15 +343,17 @@ export default {
return { return {
// scalar // scalar
isLoading,
pageNum, pageNum,
pageSize, pageSize,
total, total,
// sequence // sequence
// mapping
accountList, accountList,
plazaList, plazaList,
zoneList, zoneList,
gateList, gateList,
pagedTableDataList,
// mapping
queryAlarmEventForm, queryAlarmEventForm,
// function // function
onPageNumChange, onPageNumChange,
...@@ -267,11 +362,15 @@ export default { ...@@ -267,11 +362,15 @@ export default {
onAccountChange, onAccountChange,
onPlazaChange, onPlazaChange,
onZoneChange, onZoneChange,
confirmSearch,
formatDirection,
downloadFile,
} }
} }
} }
</script> </script>
<style scoped> <style lang="less" scoped>
@import "./SnapshotRecord";
</style> </style>
...@@ -2,6 +2,18 @@ import axiosInstance from "@/Request/PublicAxiosInstance" ...@@ -2,6 +2,18 @@ import axiosInstance from "@/Request/PublicAxiosInstance"
import {filterEmptyValueInObject} from "@/PublicUtil/PublicUtil" import {filterEmptyValueInObject} from "@/PublicUtil/PublicUtil"
class SnapshotRecordApi { class SnapshotRecordApi {
getSnapshotRecordList(data) {
return axiosInstance.request(
{
method: 'GET',
url: `/faceRecognitions/faceRecord`,
params: filterEmptyValueInObject(
data
)
}
)
}
getAccountList() { getAccountList() {
return axiosInstance.request( return axiosInstance.request(
{ {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!