Commit 73119f4a authored by xinzhedeai's avatar xinzhedeai

报警:人员分布

parent 4f0c45ba
import request from '@/utils/request'
// 查询报警设置列表
export function listSetting(query) {
export function listInfo(query) {
return request({
url: '/alarm/setting/getRemoteAlarmSettingList',
url: '/sos/alarm/getAlarmList',
method: 'get',
params: query
})
}
// 查询报警设置详细
export function getSetting(id) {
export function getAlarmById(id) {
return request({
url: '/alarm/setting/getRemoteAlarmSettingById',
url: '/sos/alarm/getAlarmById'+id,
method: 'get'
})
}
// 新增报警设置
export function addSetting(data) {
export function addAlarm(data) {
return request({
url: '/alarm/setting/addRemoteAlarmSetting',
url: '/sos/alarm/addAlarm',
method: 'post',
data: data
})
}
// 修改报警设置
export function updateSetting(data) {
export function update(data) {
return request({
url: '/alarm/setting/updateRemoteAlarmSetting',
url: '/sos/alarm/updateAlarm',
method: 'put',
data: data
})
......@@ -37,9 +37,9 @@ export function updateSetting(data) {
// 删除报警设置
export function delSetting(id) {
export function deleteAlarm(id) {
return request({
url: '/alarm/setting/deleteRemoteAlarmSetting',
url: '/sos/alarm/deleteAlarm'+id,
method: 'delete'
})
}
......@@ -49,7 +49,7 @@ export function delSetting(id) {
// 添加聚集远程报警设置
export function addJujiSetting(id) {
return request({
url: '/alarm/setting/addRemoteGatherAlarmSetting',
url: '/sos/alarm/addRemoteGatherAlarmSetting',
method: 'post'
})
}
......@@ -58,7 +58,7 @@ export function addJujiSetting(id) {
// 更新聚集远程报警设置
export function updateJujiSetting(id) {
return request({
url: '/alarm/setting/updateRemoteGatherAlarmSetting',
url: '/sos/alarm/updateRemoteGatherAlarmSetting',
method: 'put'
})
}
......@@ -66,7 +66,7 @@ export function updateJujiSetting(id) {
// 删除聚集远程报警设置
export function deleteJujiSetting(id) {
return request({
url: '/alarm/setting/deleteRemoteGatherAlarmSetting',
url: '/sos/alarm/deleteRemoteGatherAlarmSetting',
method: 'delete'
})
}
......@@ -75,7 +75,7 @@ export function deleteJujiSetting(id) {
// 查询聚集报警设置列表
export function getRemoteGatherAlarmSettingList(query) {
return request({
url: '/alarm/setting/getRemoteGatherAlarmSettingList',
url: '/sos/alarm/getRemoteGatherAlarmSettingList',
method: 'get',
params: query
})
......
......@@ -58,34 +58,33 @@
:data="infoList"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="人员类型" align="center" prop="personTypeName" />
<el-table-column label="姓名" align="center" prop="realName" />
<el-table-column label="联系方式" align="center" prop="phone" />
<el-table-column label="定位卡号" align="center" prop="cardId" />
<el-table-column label="SOS报警时间" align="center" prop="deptName" />
<el-table-column
label="报警地点经纬度"
align="center"
prop="positionName"
/>
<el-table-column label="报警状态" align="center" prop="idNumber">
<el-table-column label="SOS报警时间" align="center" prop="alarmTime" />
<el-table-column label="报警地点经纬度" align="center">
<template slot-scope="scope">
<div>{{ scope.row.coordinates }}</div>
<div>{{ scope.row.coordinates }}</div>
</template>
</el-table-column>
<el-table-column label="报警状态" align="center">
<template slot-scope="scope">
{{ scope.row.idNumber }}
<!-- 当报警状态为Y时显示处置按钮 -->
<el-button
v-if="scope.row.idNumber != 'Y'"
v-if="scope.row.alarmStatus !== 0"
type="primary"
size="mini"
@click="handleDispose(scope.row)"
>
处置
</el-button>
<span v-if="scope.row.alarmStatus == 1">已处置</span>
</template>
</el-table-column>
<el-table-column label="解除原因" align="center" prop="idNumber" />
<el-table-column label="解除人" align="center" prop="idNumber" />
<el-table-column label="解除时间" align="center" prop="idNumber" />
<el-table-column label="解除原因" align="center" prop="relieveReason" />
<el-table-column label="解除人" align="center" prop="relieveBy" />
<el-table-column label="解除时间" align="center" prop="relieveTime" />
</el-table>
<pagination
......@@ -98,12 +97,12 @@
<!-- 处置弹窗 -->
<el-dialog
title="处置报警"
title="解除报警"
:visible.sync="disposeDialogVisible"
width="500px"
>
<el-form :model="disposeForm" ref="disposeFormRef" label-width="120px">
<el-form-item label="解除报警原因" prop="reason" required>
<el-form-item label="选择解除报警原因" prop="reason" required>
<div
v-for="item in reasonOptions"
:key="item.dictValue"
......@@ -142,7 +141,7 @@
</template>
<script>
import { listInfo } from "@/api/jinrun/renyuan";
import { listInfo, update } from "@/api/jinrun/alarm";
import { getDict } from "@/api/jinrun/common";
// 假设解除原因的字典类型为 'alarm_dispose_reason'
......@@ -190,88 +189,13 @@ export default {
pageNum: 1,
pageSize: 10,
personType: "",
personTypeName: null,
staffType: null,
staffTypeName: null,
positionIconType: null,
positionIconTypeName: null,
realName: null,
phone: null,
sex: null,
birth: null,
email: null,
nativePlace: null,
nation: null,
maritalStatus: null,
politicsStatus: null,
healthStatus: null,
idType: null,
idNumber: null,
personIc: null,
personCode: null,
personSource: null,
company: null,
companyName: null,
administratorName: null,
administratorPhone: null,
jobNumber: null,
jobStatus: null,
hireDate: null,
hireDateAlias: null,
dimissionDate: null,
officePhone: null,
duty: null,
professionalTitle: null,
professionalTitleNumber: null,
seniority: null,
experience: null,
yearPlusExperience: null,
highestEducation: null,
highestDegree: null,
profession: null,
school: null,
diplomaNumber: null,
cengNumber: null,
accessory: null,
accessoryList: null,
contractorId: null,
contractorName: null,
receiveLeader: null,
receivePhone: null,
gateThrough: null,
leaveTime: null,
visitorStatus: null,
visitTime: null,
process: null,
lastUpdateDate: null,
lastCreateDate: null,
updateFail: null,
onlineStatus: null,
inOutStatus: null,
cardType: null,
cardTypeName: null,
cardId: null,
icCardId: null,
cardPower: null,
personPhoto: null,
photoSign: null,
deptName: null,
reservationEntryStartTime: null,
reservationEntryEndTime: null,
reservationVisitingTime: null,
curUserName: null,
visitorId: null,
realName: null,
},
// 表单参数
form: {
personType: "",
},
// 表单校验
rules: {
personType: [
{ required: true, message: "人员类型不能为空", trigger: "change" },
],
},
};
},
created() {
......@@ -428,82 +352,6 @@ export default {
this.single = selection.length !== 1;
this.multiple = !selection.length;
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加人员信息";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
listInfo({
pageNum: 1,
pageSize: 1,
personId: row.personId,
}).then((response) => {
this.form = response.data[0];
this.open = true;
this.title = "修改人员信息";
});
},
/** 提交按钮 */
submitForm() {
// 简单的表单验证
if (!this.disposeForm.reason) {
this.$message.error("请选择解除报警原因");
return;
}
if (this.showOtherReason && !this.disposeForm.otherReason.trim()) {
this.$message.error("请输入其他解除原因");
return;
}
// 构建提交数据
const submitData = {
personId: this.disposeForm.personId,
reason: this.disposeForm.reason,
otherReason: this.disposeForm.otherReason,
};
updateInfo(this.form).then((response) => {
this.disposeDialogVisible = false;
this.$modal.msgSuccess("解除报警成功");
this.getList(); // 重新加载列表数据
});
},
/** 解绑卡按钮操作 */
handleUnbindCard(row) {
this.$modal
.confirm("是否确认解绑该人员的卡?")
.then(function () {
return unbindCard({
personId: row.personId,
personType: row.personType,
});
})
.then(() => {
this.getList();
this.$modal.msgSuccess("解绑卡成功");
})
.catch(() => {});
},
/** 删除按钮操作 */
handleDelete(row) {
this.$modal
.confirm("是否确认删除该数据项?")
.then(function () {
return delInfo({
personIds: [row.personId],
personType: row.personType,
});
})
.then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
})
.catch(() => {});
},
},
};
</script>
......
<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="realName">
<el-input
v-model="queryParams.realName"
placeholder="请输入月份"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="创建时间">
<el-date-picker
v-model="queryParams.dateRange"
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>
<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="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
>导出</el-button
>
</el-col>
</el-row>
<el-table
v-loading="loading"
:data="infoList"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="序号" align="center" type="index" width="50" />
<el-table-column label="日期" align="center" prop="realName" />
<el-table-column label="矿区内人数" align="center" prop="deptName" />
<el-table-column label="矿区外人数" align="center" prop="positionName" />
<el-table-column label="矿区外人员姓名" align="center" prop="cardId" />
</el-table>
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</div>
</template>
<script>
import { listInfo } from "@/api/jinrun/renyuan";
import { getDict } from "@/api/jinrun/common";
export default {
name: "Info",
data() {
return {
// 人员类型下拉列表数据
personTypeOptions: [],
// 遮罩层
loading: true,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 人员信息表格数据
infoList: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
// 查询参数
queryParams: {
dateRange: null,
realName: null,
pageNum: 1,
pageSize: 10,
},
// 表单参数
form: {
personType: "",
},
};
},
created() {
this.getList();
},
methods: {
/** 查询人员信息列表 */
getList() {
this.loading = true;
listInfo(this.queryParams).then((response) => {
this.infoList = response.records;
this.total = response.total;
this.loading = false;
});
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map((item) => item.personId);
this.single = selection.length !== 1;
this.multiple = !selection.length;
},
/** 导出按钮操作 */
handleExport() {
this.download(
"system/info/export",
{
...this.queryParams,
},
`info_${new Date().getTime()}.xlsx`
);
},
},
};
</script>
<style scoped lang="scss">
.image-slot {
display: flex;
justify-content: center;
align-items: center;
width: 50px;
height: 50px;
background-color: #f5f7fa;
color: #909399;
font-size: 20px;
}
</style>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment