重庆市永川区,非法越界,明火识别,烟雾识别

This commit is contained in:
wangyan21 2024-01-05 16:29:05 +08:00
parent 219336a9a7
commit b64c1a42e8
3 changed files with 1256 additions and 0 deletions

View File

@ -0,0 +1,376 @@
<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="nameInfo">
<el-input
v-model="queryParams.nameInfo"
placeholder="请输入姓名"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="工号" prop="personNumber">
<el-input
v-model="queryParams.personNumber"
placeholder="请输入工号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="监测设备" prop="detectEquip">
<el-input
v-model="queryParams.detectEquip"
placeholder="请输入监测设备"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="发生时间">
<el-date-picker
v-model="daterangeDetectTime"
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="sexInfo">
<el-input
v-model="queryParams.sexInfo"
placeholder="请输入区域类型"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="区域名称" prop="behaviour">
<el-input
v-model="queryParams.behaviour"
placeholder="请输入区域名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="报警信息" prop="address">
<el-input
v-model="queryParams.address"
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="['cqycsjManage:behaviour: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="['cqycsjManage:behaviour: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="['cqycsjManage:behaviour:remove']"
>删除</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="behaviourList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="姓名" align="center" prop="nameInfo" />
<el-table-column label="工号" align="center" prop="personNumber" />
<el-table-column label="监测设备" align="center" prop="detectEquip" />
<el-table-column label="发生时间" align="center" prop="detectTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.detectTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
<el-table-column label="区域类型" align="center" prop="sexInfo">
</el-table-column>
<el-table-column label="区域名称" align="center" prop="behaviour" />
<!-- <el-table-column label="抓拍图片" align="center" prop="imageInfo" width="100">-->
<!-- <template slot-scope="scope">-->
<!-- <image-preview :src="scope.row.imageInfo" :width="50" :height="50"/>-->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column label="是否越界" align="center" prop="postRange" >
<template slot-scope="scope">
<el-tag type="success" v-if="scope.row.postRange === '否'">{{scope.row.postRange}}</el-tag>
<el-tag type="danger" v-else-if="scope.row.postRange === ''">{{scope.row.postRange}}</el-tag>
<el-tag type="info" v-else>{{scope.row.postRange}}</el-tag>
</template>
</el-table-column>
<el-table-column label="报警信息" align="center" prop="address" />
<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="['cqycsjManage:behaviour:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['cqycsjManage:behaviour: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="nameInfo">
<el-input v-model="form.nameInfo" placeholder="请输入姓名" />
</el-form-item>
<el-form-item label="工号" prop="personNumber">
<el-input v-model="form.personNumber" placeholder="请输入工号" />
</el-form-item>
<el-form-item label="监测设备" prop="detectEquip">
<el-input v-model="form.detectEquip" placeholder="请输入监测设备" />
</el-form-item>
<el-form-item label="发生时间" prop="detectTime">
<el-date-picker clearable
v-model="form.detectTime"
type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
placeholder="请选择发生时间">
</el-date-picker>
</el-form-item>
<el-form-item label="区域类型" prop="sexInfo">
<el-input v-model="form.sexInfo" placeholder="请输入区域类型" />
</el-form-item>
<el-form-item label="区域名称" prop="behaviour">
<el-input v-model="form.behaviour" placeholder="请输入区域名称" />
</el-form-item>
<!-- <el-form-item label="抓拍图片" prop="imageInfo">-->
<!-- <image-upload v-model="form.imageInfo"/>-->
<!-- </el-form-item>-->
<el-form-item label="是否越界" prop="postRange">
<el-input v-model="form.postRange" placeholder="请输入是否越界" />
</el-form-item>
<el-form-item label="报警信息" prop="address">
<el-input v-model="form.address" placeholder="请输入报警信息" />
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" type="textarea" 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 { listBehaviour, getBehaviour, delBehaviour, addBehaviour, updateBehaviour } from "@/api/cqycsjManage/behaviour";
export default {
//
name: "Behaviour",
dicts: ['sys_user_sex'],
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
behaviourList: [],
//
title: "",
//
open: false,
//
daterangeDetectTime: [],
//
queryParams: {
pageNum: 1,
pageSize: 10,
nameInfo: null,
personNumber: null,
detectEquip: null,
detectTime: null,
sexInfo: null,
postRange: null,
behaviour: null,
imageInfo: null,
address: null,
dataType: "非法越界识别",
},
//
form: {},
//
rules: {
}
};
},
created() {
this.getList();
},
methods: {
/** 查询异常行为识别列表 */
getList() {
this.loading = true;
this.queryParams.params = {};
if (null != this.daterangeDetectTime && '' != this.daterangeDetectTime) {
this.queryParams.params["beginDetectTime"] = this.daterangeDetectTime[0];
this.queryParams.params["endDetectTime"] = this.daterangeDetectTime[1];
}
listBehaviour(this.queryParams).then(response => {
this.behaviourList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
id: null,
nameInfo: null,
personNumber: null,
detectEquip: null,
detectTime: null,
sexInfo: null,
postRange: null,
behaviour: null,
imageInfo: null,
address: null,
dataType: null,
remark: null
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.daterangeDetectTime = [];
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
getBehaviour(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) {
updateBehaviour(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addBehaviour(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 delBehaviour(ids);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download('cqycsjManage/behaviour/export', {
...this.queryParams
}, `behaviour_${new Date().getTime()}.xlsx`)
}
}
};
</script>

View File

@ -0,0 +1,510 @@
<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="nameInfo">
<el-input
v-model="queryParams.nameInfo"
placeholder="请输入区域名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="设备类型" prop="personNumber">
<el-input
v-model="queryParams.personNumber"
placeholder="请输入设备类型"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="监测设备" prop="detectEquip">
<el-input
v-model="queryParams.detectEquip"
placeholder="请输入监测设备"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="检测时间">
<el-date-picker
v-model="daterangeDetectTime"
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="behaviour">
<el-input
v-model="queryParams.behaviour"
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="['cqycsjManage:behaviour: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="['cqycsjManage:behaviour: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="['cqycsjManage:behaviour:remove']"
>删除</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="behaviourList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="区域名称" align="center" prop="nameInfo" />
<el-table-column label="设备类型" align="center" prop="personNumber" />
<el-table-column label="监测设备" align="center" prop="detectEquip" />
<el-table-column label="检测时间" align="center" prop="detectTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.detectTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
<!-- <el-table-column label="性别" align="center" prop="sexInfo">-->
<!-- <template slot-scope="scope">-->
<!-- <dict-tag :options="dict.type.sys_user_sex" :value="scope.row.sexInfo"/>-->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column label="发生情况" align="center" prop="behaviour" />
<el-table-column label="抓拍图片" align="center" prop="imageInfo" width="100">
<template slot-scope="scope">
<image-preview :src="scope.row.imageInfo" :width="50" :height="50"/>
</template>
</el-table-column>
<el-table-column label="处理状态" align="center" prop="postRange" >
<template slot-scope="scope">
<el-tag type="success" v-if="scope.row.postRange === '已处理'">{{scope.row.postRange}}</el-tag>
<el-tag type="danger" v-else-if="scope.row.postRange === '未处理'">{{scope.row.postRange}}</el-tag>
<el-tag type="info" v-else>{{scope.row.postRange}}</el-tag>
</template>
</el-table-column>
<el-table-column label="报警信息" align="center" prop="address" />
<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="['cqycsjManage:behaviour:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['cqycsjManage:behaviour:remove']"
>删除</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-video-camera"
@click="playVideo(scope.row)"
>查看视频</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="nameInfo">
<el-input v-model="form.nameInfo" placeholder="请输入区域名称" />
</el-form-item>
<el-form-item label="设备类型" prop="personNumber">
<el-input v-model="form.personNumber" placeholder="请输入设备类型" />
</el-form-item>
<el-form-item label="监测设备" prop="detectEquip">
<el-input v-model="form.detectEquip" placeholder="请输入监测设备" />
</el-form-item>
<el-form-item label="检测时间" prop="detectTime">
<el-date-picker clearable
v-model="form.detectTime"
type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
placeholder="请选择检测时间">
</el-date-picker>
</el-form-item>
<!-- <el-form-item label="性别" prop="sexInfo">-->
<!-- <el-select v-model="form.sexInfo" placeholder="请选择性别">-->
<!-- <el-option-->
<!-- v-for="dict in dict.type.sys_user_sex"-->
<!-- :key="dict.value"-->
<!-- :label="dict.label"-->
<!-- :value="dict.value"-->
<!-- ></el-option>-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<el-form-item label="发生情况" prop="behaviour">
<el-input v-model="form.behaviour" placeholder="请输入发生情况" />
</el-form-item>
<el-form-item label="抓拍图片" prop="imageInfo">
<image-upload v-model="form.imageInfo"/>
</el-form-item>
<el-form-item label="处理状态" prop="postRange">
<el-input v-model="form.postRange" placeholder="请输入处理状态" />
</el-form-item>
<el-form-item label="报警信息" prop="address">
<el-input v-model="form.address" placeholder="请输入报警信息" />
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
</el-form-item>
<el-form-item label="文件上传">
<el-upload
class="upload-demo"
ref="uploadFile"
action=""
:on-preview="handlePreview"
:on-remove="handleRemoveFiles"
:on-change="handleChangeFiles"
:before-upload="beforeUploadFiles"
:file-list="fileList"
:auto-upload="true"
multiple
>
<el-button size="small" type="primary">上传视频</el-button>
<div slot="tip" class="el-upload__tip">只能上传mp4文件且不超过100M</div>
</el-upload>
</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>
<el-dialog title :visible="isShow" width="600px" @close="closeDialog" class="videoBox">
<video
:src="videoUrl"
controls
autoplay
class="video"
width="100%"
></video>
</el-dialog>
</div>
</template>
<script>
import { listBehaviour, getBehaviour, delBehaviour, addBehaviour, updateBehaviour } from "@/api/cqycsjManage/behaviour";
import { getToken } from "@/utils/auth";
import request from "@/utils/request";
export default {
//
name: "Behaviour",
dicts: ['sys_user_sex'],
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
behaviourList: [],
//
title: "",
//
open: false,
//
daterangeDetectTime: [],
//
queryParams: {
pageNum: 1,
pageSize: 10,
nameInfo: null,
personNumber: null,
detectEquip: null,
detectTime: null,
sexInfo: null,
postRange: null,
behaviour: null,
imageInfo: null,
address: null,
dataType: "明火报警",
},
//
form: {},
//
rules: {
},
//
fileInfoList: [],
fileList: [],
//
upload: {
//
headers: { Authorization: "Bearer " + getToken() },
// TODO
url: "/species/video/upload/file",
//
imageUrl: "",
//
data: {
tableName: "",
linkId: "",
workId: "",
},
},
isShow: false,
videoUrl: '',
baseUrl: process.env.VUE_APP_BASE_API,
};
},
created() {
this.getList();
},
methods: {
//
playVideo(row) {
this.isShow = true
// src
let url1 = row.sexInfo;
// this.videoUrl=this.baseUrl+"/profile/upload/2023/10/24/_20231024154211A001.mp4";
this.videoUrl = this.baseUrl + url1;
},
/**
* 关闭视频
*/
closeDialog () {
//
this.isShow = false
this.videoUrl = '' //
},
//
submit() {
this.submitUploadFiles();
},
handlePreview(file, fileList) {
console.log("--->>预览文件", file);
},
beforeUploadFiles: (file, fileList) => {
//
//
return false;
},
// false Promise rejectfunction(file, fileList)
handleRemoveFiles(file, fileList) {
this.fileList = fileList;
},
handleChangeFiles(file, fileList) {
this.fileList = fileList;
this.submitUploadFiles();
},
submitUploadFiles() {
if (this.fileList.length === 0) {
return this.$message.warning("请选取文件后再上传");
}
// FormData:
const formData = new FormData();
// 使FormData.append/
this.fileList.forEach((file) => {
formData.append("files", file.raw);
});
if (this.form.id && this.form.id != "null") {
formData.set("workId", this.form.id);
}
formData.set("dataType", this.form.dataType);
request({
method: "POST",
url: this.upload.url, //
data: formData, //formData
}).then((res) => {
if (res.code == 200) {
this.$message.success("上传成功");
// this.open = false;
// this.getList();
console.log("查看上传结果:",res);
if (res.data) {
this.form.sexInfo = res.data.fileUrl;
}
} else {
this.$message.error("上传失败");
}
//fileList
this.fileList = [];
});
// this.$refs.uploadFile.submit();
},
/** 查询异常行为识别列表 */
getList() {
this.loading = true;
this.queryParams.params = {};
if (null != this.daterangeDetectTime && '' != this.daterangeDetectTime) {
this.queryParams.params["beginDetectTime"] = this.daterangeDetectTime[0];
this.queryParams.params["endDetectTime"] = this.daterangeDetectTime[1];
}
listBehaviour(this.queryParams).then(response => {
this.behaviourList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
id: null,
nameInfo: null,
personNumber: null,
detectEquip: null,
detectTime: null,
sexInfo: null,
postRange: null,
behaviour: null,
imageInfo: null,
address: null,
dataType: null,
remark: null
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.daterangeDetectTime = [];
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
getBehaviour(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) {
updateBehaviour(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addBehaviour(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 delBehaviour(ids);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download('cqycsjManage/behaviour/export', {
...this.queryParams
}, `behaviour_${new Date().getTime()}.xlsx`)
}
}
};
</script>

View File

@ -0,0 +1,370 @@
<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="nameInfo">
<el-input
v-model="queryParams.nameInfo"
placeholder="请输入区域名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="区域类型" prop="personNumber">
<el-input
v-model="queryParams.personNumber"
placeholder="请输入区域类型"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="监测设备" prop="detectEquip">
<el-input
v-model="queryParams.detectEquip"
placeholder="请输入监测设备"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="检测时间">
<el-date-picker
v-model="daterangeDetectTime"
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="behaviour">
<el-input
v-model="queryParams.behaviour"
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="['cqycsjManage:behaviour: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="['cqycsjManage:behaviour: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="['cqycsjManage:behaviour:remove']"
>删除</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="behaviourList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="区域名称" align="center" prop="nameInfo" />
<el-table-column label="区域类型" align="center" prop="personNumber" />
<el-table-column label="监测设备" align="center" prop="detectEquip" />
<el-table-column label="检测时间" align="center" prop="detectTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.detectTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
<!-- <el-table-column label="性别" align="center" prop="sexInfo">-->
<!-- <template slot-scope="scope">-->
<!-- <dict-tag :options="dict.type.sys_user_sex" :value="scope.row.sexInfo"/>-->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column label="负责人" align="center" prop="behaviour" />
<el-table-column label="抓拍图片" align="center" prop="imageInfo" width="100">
<template slot-scope="scope">
<image-preview :src="scope.row.imageInfo" :width="50" :height="50"/>
</template>
</el-table-column>
<el-table-column label="是否烟雾" align="center" prop="postRange" >
<template slot-scope="scope">
<el-tag type="success" v-if="scope.row.postRange === '否'">{{scope.row.postRange}}</el-tag>
<el-tag type="danger" v-else-if="scope.row.postRange === ''">{{scope.row.postRange}}</el-tag>
<el-tag type="info" v-else>{{scope.row.postRange}}</el-tag>
</template>
</el-table-column>
<el-table-column label="预警信息" align="center" prop="address" />
<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="['cqycsjManage:behaviour:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['cqycsjManage:behaviour: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="nameInfo">
<el-input v-model="form.nameInfo" placeholder="请输入区域名称" />
</el-form-item>
<el-form-item label="区域类型" prop="personNumber">
<el-input v-model="form.personNumber" placeholder="请输入区域类型" />
</el-form-item>
<el-form-item label="监测设备" prop="detectEquip">
<el-input v-model="form.detectEquip" placeholder="请输入监测设备" />
</el-form-item>
<el-form-item label="检测时间" prop="detectTime">
<el-date-picker clearable
v-model="form.detectTime"
type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
placeholder="请选择检测时间">
</el-date-picker>
</el-form-item>
<!-- <el-form-item label="性别" prop="sexInfo">-->
<!-- <el-select v-model="form.sexInfo" placeholder="请选择性别">-->
<!-- <el-option-->
<!-- v-for="dict in dict.type.sys_user_sex"-->
<!-- :key="dict.value"-->
<!-- :label="dict.label"-->
<!-- :value="dict.value"-->
<!-- ></el-option>-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<el-form-item label="负责人" prop="behaviour">
<el-input v-model="form.behaviour" placeholder="请输入负责人" />
</el-form-item>
<el-form-item label="抓拍图片" prop="imageInfo">
<image-upload v-model="form.imageInfo"/>
</el-form-item>
<el-form-item label="是否烟雾" prop="postRange">
<el-input v-model="form.postRange" placeholder="请输入是否烟雾" />
</el-form-item>
<el-form-item label="预警信息" prop="address">
<el-input v-model="form.address" placeholder="请输入报警信息" />
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" type="textarea" 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 { listBehaviour, getBehaviour, delBehaviour, addBehaviour, updateBehaviour } from "@/api/cqycsjManage/behaviour";
export default {
//
name: "Behaviour",
dicts: ['sys_user_sex'],
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
behaviourList: [],
//
title: "",
//
open: false,
//
daterangeDetectTime: [],
//
queryParams: {
pageNum: 1,
pageSize: 10,
nameInfo: null,
personNumber: null,
detectEquip: null,
detectTime: null,
sexInfo: null,
postRange: null,
behaviour: null,
imageInfo: null,
address: null,
dataType: "烟雾识别报警",
},
//
form: {},
//
rules: {
}
};
},
created() {
this.getList();
},
methods: {
/** 查询异常行为识别列表 */
getList() {
this.loading = true;
this.queryParams.params = {};
if (null != this.daterangeDetectTime && '' != this.daterangeDetectTime) {
this.queryParams.params["beginDetectTime"] = this.daterangeDetectTime[0];
this.queryParams.params["endDetectTime"] = this.daterangeDetectTime[1];
}
listBehaviour(this.queryParams).then(response => {
this.behaviourList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
id: null,
nameInfo: null,
personNumber: null,
detectEquip: null,
detectTime: null,
sexInfo: null,
postRange: null,
behaviour: null,
imageInfo: null,
address: null,
dataType: null,
remark: null
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.daterangeDetectTime = [];
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
getBehaviour(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) {
updateBehaviour(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addBehaviour(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 delBehaviour(ids);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download('cqycsjManage/behaviour/export', {
...this.queryParams
}, `behaviour_${new Date().getTime()}.xlsx`)
}
}
};
</script>