历史人员流动分析

This commit is contained in:
wangyan21 2023-10-17 17:48:59 +08:00
parent 033ca40527
commit 555987d2a7
3 changed files with 386 additions and 58 deletions

View File

@ -35,6 +35,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="equipName != null and equipName != ''"> and equip_name like concat('%', #{equipName}, '%')</if>
<if test="dataType != null and dataType != ''"> and data_type like concat('%', #{dataType}, '%')</if>
</where>
order by enter_time desc
</select>
<select id="selectZhcjPersonFlowById" parameterType="String" resultMap="ZhcjPersonFlowResult">

View File

@ -1,64 +1,11 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="区域" prop="areaInfo">
<el-input
v-model="queryParams.areaInfo"
placeholder="请输入区域"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<!-- <el-form-item label="行为类型" prop="behaviorType">-->
<!-- <el-select v-model="queryParams.behaviorType" placeholder="请选择行为类型" clearable>-->
<!-- <el-option-->
<!-- v-for="dict in dict.type.zhcj_behavior_type"-->
<!-- :key="dict.value"-->
<!-- :label="dict.label"-->
<!-- :value="dict.value"-->
<!-- />-->
<!-- </el-select>-->
<!-- <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">-->
<!-- <el-form-item>-->
<!-- <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>-->
<!-- <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="人员类型" prop="personType">-->
<!-- <el-input-->
<!-- v-model="queryParams.personType"-->
<!-- placeholder="请输入人员类型"-->
<!-- clearable-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="进出是由" prop="purposeType">-->
<!-- <el-input-->
<!-- v-model="queryParams.purposeType"-->
<!-- placeholder="请输入进出是由"-->
<!-- clearable-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<el-form-item label="统计时间">
<el-date-picker
v-model="daterangeEnterTime"
style="width: 240px"
value-format="yyyy-MM-dd"
type="daterange"
range-separator="-"
start-placeholder="开始日期"
end-placeholder="结束日期"
></el-date-picker>
</el-form-item>
<!-- <el-form-item label="排队时长" prop="queueTime">-->
<!-- <el-input-->
<!-- v-model="queryParams.queueTime"-->
<!-- placeholder="请输入排队时长"-->
<!-- clearable-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<!-- </el-form>-->
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">

View File

@ -0,0 +1,380 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="区域" prop="areaInfo">
<el-input
v-model="queryParams.areaInfo"
placeholder="请输入区域"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<!-- <el-form-item label="行为类型" prop="behaviorType">-->
<!-- <el-select v-model="queryParams.behaviorType" placeholder="请选择行为类型" clearable>-->
<!-- <el-option-->
<!-- v-for="dict in dict.type.zhcj_behavior_type"-->
<!-- :key="dict.value"-->
<!-- :label="dict.label"-->
<!-- :value="dict.value"-->
<!-- />-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="人员类型" prop="personType">-->
<!-- <el-input-->
<!-- v-model="queryParams.personType"-->
<!-- placeholder="请输入人员类型"-->
<!-- clearable-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="进出是由" prop="purposeType">-->
<!-- <el-input-->
<!-- v-model="queryParams.purposeType"-->
<!-- placeholder="请输入进出是由"-->
<!-- clearable-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<el-form-item label="统计时间">
<el-date-picker
v-model="daterangeEnterTime"
style="width: 240px"
value-format="yyyy-MM-dd"
type="daterange"
range-separator="-"
start-placeholder="开始日期"
end-placeholder="结束日期"
></el-date-picker>
</el-form-item>
<!-- <el-form-item label="排队时长" prop="queueTime">-->
<!-- <el-input-->
<!-- v-model="queryParams.queueTime"-->
<!-- placeholder="请输入排队时长"-->
<!-- clearable-->
<!-- @keyup.enter.native="handleQuery"-->
<!-- />-->
<!-- </el-form-item>-->
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['passenger:flow:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['passenger:flow:edit']"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['passenger:flow:remove']"
>删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['passenger:flow:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="flowList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<!-- <el-table-column label="姓名" align="center" prop="userName" />-->
<el-table-column label="区域" align="center" prop="areaInfo" />
<el-table-column label="门禁设备" align="center" prop="equipName" />
<el-table-column label="驶入人员数量" align="center" prop="personType" />
<el-table-column label="驶出人员数量" align="center" prop="purposeType" />
<!-- <el-table-column label="行为类型" align="center" prop="behaviorType">-->
<!-- <template slot-scope="scope">-->
<!-- <dict-tag :options="dict.type.zhcj_behavior_type" :value="scope.row.behaviorType"/>-->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column label="统计时间" align="center" prop="enterTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.enterTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<!-- <el-table-column label="排队时长(分钟)" align="center" prop="queueTime" />-->
<!-- <el-table-column label="备注" align="center" prop="remark" />-->
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['passenger:flow:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['passenger:flow:remove']"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改人员流量对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<!-- <el-form-item label="姓名" prop="userName">-->
<!-- <el-input v-model="form.userName" placeholder="请输入姓名" />-->
<!-- </el-form-item>-->
<el-form-item label="区域" prop="areaInfo">
<el-input v-model="form.areaInfo" placeholder="请输入区域" />
</el-form-item>
<el-form-item label="记录设备" prop="equipName">
<el-input v-model="form.equipName" placeholder="请输入记录设备" />
</el-form-item>
<el-form-item label="驶入人员数量" prop="personType">
<el-input v-model="form.personType" placeholder="请输入驶入人员数量" />
</el-form-item>
<el-form-item label="驶出人员数量" prop="purposeType">
<el-input v-model="form.purposeType" placeholder="请输入驶出人员数量" />
</el-form-item>
<!-- <el-form-item label="行为类型" prop="behaviorType">-->
<!-- <el-select v-model="form.behaviorType" placeholder="请选择行为类型">-->
<!-- <el-option-->
<!-- v-for="dict in dict.type.zhcj_behavior_type"-->
<!-- :key="dict.value"-->
<!-- :label="dict.label"-->
<!-- :value="dict.value"-->
<!-- ></el-option>-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<el-form-item label="发生时间" prop="enterTime">
<el-date-picker clearable
v-model="form.enterTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择发生时间">
</el-date-picker>
</el-form-item>
<!-- <el-form-item label="排队时长" prop="queueTime">-->
<!-- <el-input v-model="form.queueTime" placeholder="请输入排队时长,单位是分钟" />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="备注" prop="remark">-->
<!-- <el-input v-model="form.remark" placeholder="请输入备注" />-->
<!-- </el-form-item>-->
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listFlow, getFlow, delFlow, addFlow, updateFlow } from "@/api/passenger/flow";
import moment from "moment";
export default {
//
name: "HistoryFlowAnalysis",
dicts: ['zhcj_behavior_type'],
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
flowList: [],
//
title: "",
//
open: false,
//
daterangeEnterTime: [],
//
queryParams: {
pageNum: 1,
pageSize: 10,
userName: null,
areaInfo: null,
behaviorType: null,
personType: null,
purposeType: null,
enterTime: null,
queueTime: null,
dataType: "历史流量",
equipName: null
},
//
form: {},
//
timeDay: null,
//
timeDayFalse: true,
//
rules: {
}
};
},
created() {
this.getList();
},
methods: {
/** 查询人员流量列表 */
getList() {
this.loading = true;
this.queryParams.params = {};
if (null != this.daterangeEnterTime && '' != this.daterangeEnterTime) {
this.queryParams.params["beginEnterTime"] = this.daterangeEnterTime[0];
this.queryParams.params["endEnterTime"] = this.daterangeEnterTime[1];
this.timeDayFalse = false;
}
listFlow(this.queryParams).then(response => {
this.flowList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
id: null,
userName: null,
areaInfo: null,
behaviorType: null,
personType: null,
purposeType: null,
enterTime: null,
queueTime: null,
remark: null,
equipName: null
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.daterangeEnterTime = [];
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加人员流量";
this.form.dataType = "历史流量";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id || this.ids
getFlow(id).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改人员流量";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.id != null) {
updateFlow(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addFlow(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal.confirm('是否确认删除人员流量编号为"' + ids + '"的数据项?').then(function() {
return delFlow(ids);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download('passenger/flow/export', {
...this.queryParams
}, `flow_${new Date().getTime()}.xlsx`)
}
}
};
</script>