ai视频报警

pull/1/head
dearlin 2024-01-26 15:52:00 +08:00
parent 41f08a759e
commit 04f28b4acc
7 changed files with 446 additions and 100 deletions

View File

@ -818,13 +818,13 @@ export default [
path: "/keyprojects/inspection/record_list",
meta: {
title: "查看列表",
activeMenu: "/keyprojects/inspection"
activeMenu: "/keyprojects/inspection",
},
component: "children",
children: [
{
path: "",
component: "keyprojects/inspection/record_list"
component: "keyprojects/inspection/record_list",
},
{
path: "/keyprojects/inspection/record_view",
@ -834,9 +834,9 @@ export default [
},
component: "keyprojects/inspection/record_view",
},
]
],
},
]
],
},
{
path: "/keyprojects/hidden",
@ -851,13 +851,13 @@ export default [
path: "/keyprojects/hidden/record_list",
meta: {
title: "查看列表",
activeMenu: "/keyprojects/hidden"
activeMenu: "/keyprojects/hidden",
},
component: "children",
children: [
{
path: "",
component: "keyprojects/hidden/record_list"
component: "keyprojects/hidden/record_list",
},
{
path: "/keyprojects/hidden/record_view",
@ -867,9 +867,9 @@ export default [
},
component: "keyprojects/hidden/record_view",
},
]
],
},
]
],
},
{
path: "/keyprojects/punish",
@ -884,13 +884,13 @@ export default [
path: "/keyprojects/punish/record_list",
meta: {
title: "查看列表",
activeMenu: "/keyprojects/punish"
activeMenu: "/keyprojects/punish",
},
component: "children",
children: [
{
path: "",
component: "keyprojects/punish/record_list"
component: "keyprojects/punish/record_list",
},
{
path: "/keyprojects/punish/record_view",
@ -900,9 +900,9 @@ export default [
},
component: "keyprojects/punish/record_view",
},
]
],
},
]
],
},
{
path: "/keyprojects/aiwarning",
@ -1969,6 +1969,11 @@ export default [
meta: { title: "视频设备列表", isSubMenu: false },
component: "video_manager/video_manager/index",
},
{
path: "/video_manager/ai_warning",
meta: { title: "Ai报警", isSubMenu: false },
component: "video_manager/ai_warning/index",
},
],
},
{

View File

@ -0,0 +1,8 @@
import { post } from "@/request/axios.js";
export const getAiWarningList = (params) => post("/aiwarning/list", params); // ai报警列表
export const getAiWarningView = (params) => post("/aiwarning/goEdit", params); // 台账添加
export const setAiWarningDelete = (params) =>
post("/aiwarning/removeByIds", params); // 删除
export const setAiWarningEdit = (params) => post("/aiwarning/edit", params); // 修改

View File

@ -58,8 +58,8 @@
<el-form-item label="定位卡号" prop="CARDNO">
<el-input
v-model="data.form.CARDNO"
maxlength="4"
minlength="4"
maxlength="5"
minlength="5"
show-word-limit
placeholder="请输入"
/>

View File

@ -33,7 +33,10 @@
style="width: 240px"
disabled
/>
<el-button type="primary" @click="fnRegName" style="margin-left: 10px"
<el-button
type="primary"
@click="data.drawer = true"
style="margin-left: 10px"
>添加</el-button
>
<el-button
@ -48,84 +51,24 @@
<el-button @click="fnClose"></el-button>
<el-button type="primary" @click="fnSubmit"> </el-button>
</template>
<electronic-fence v-model:visible="data.drawer" v-model:form="form" />
</el-dialog>
<el-drawer
v-model="data.drawer"
title="电子围栏台账"
direction="rtl"
:before-close="handleClose"
size="50%"
>
<el-card>
<el-form
:model="searchForm"
label-width="20px"
@submit.prevent="fnResetPagination"
>
<el-row>
<el-col :span="12">
<el-form-item label="关键字" prop="KEYWORDS" label-width="60px">
<el-input
v-model="searchForm.KEYWORDS"
placeholder="请输入关键字"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label-width="30px">
<el-button type="primary" native-type="submit">搜索</el-button>
<el-button native-type="reset" @click="fnResetPagination">
重置
</el-button>
</el-form-item>
</el-col>
</el-row>
</el-form>
</el-card>
<layout-card>
<layout-table
ref="tableRef"
:data="list"
v-model:pagination="pagination"
@get-data="fnGetData"
>
<el-table-column reserve-selection type="selection" width="55" />
<el-table-column label="序号" width="70">
<template v-slot="{ $index }">
{{ serialNumber(pagination, $index) }}
</template>
</el-table-column>
<el-table-column property="layName" label="所属图层" width="150" />
<el-table-column property="regName" label="名称" />
<el-table-column label="操作" width="200">
<template v-slot="{ row }">
<el-button type="primary" text link @click="handleJoin(row)"
>绑定</el-button
>
</template>
</el-table-column>
</layout-table>
</layout-card>
</el-drawer>
</template>
<script setup>
import { serialNumber } from "@/assets/js/utils.js";
import { nextTick, reactive, ref } from "vue";
import { reactive, ref } from "vue";
import { useVModels } from "@vueuse/core";
import { debounce } from "throttle-debounce";
import useFormValidate from "@/assets/js/useFormValidate.js";
import { ElMessage } from "element-plus";
import {
getRiskPointListAll,
getRyRegionList,
setIdentifyingPartsAdd,
setIdentifyingPartsEdit,
} from "@/request/risk_control.js";
import LayoutUpload from "@/components/upload/index.vue";
import useListData from "@/assets/js/useListData.js";
const { list, pagination, searchForm, fnGetData, fnResetPagination, tableRef } =
useListData(getRyRegionList);
import ElectronicFence from "./electronic_fence.vue";
const props = defineProps({
visible: {
type: Boolean,
@ -177,16 +120,7 @@ const fnClose = () => {
formRef.value.resetFields();
visible.value = false;
};
const handleJoin = debounce(
1000,
async (row) => {
form.value.ELECTRONIC_FENCE = row.regName;
form.value.ELECTRONIC_FENCE_ID = row.uuid;
data.drawer = false;
await nextTick();
},
{ atBegin: true }
);
const fnRemoveRegName = debounce(
1000,
async () => {
@ -195,18 +129,7 @@ const fnRemoveRegName = debounce(
},
{ atBegin: true }
);
const fnRegName = debounce(
1000,
async () => {
data.drawer = true;
await fnResetPagination();
},
{ atBegin: true }
);
const handleClose = () => {
data.drawer = false;
};
const fnSubmit = debounce(
1000,
async () => {

View File

@ -0,0 +1,81 @@
<template>
<el-drawer v-model="visible" title="电子围栏台账" direction="rtl" size="50%">
<el-card>
<el-form
:model="searchForm"
label-width="20px"
@submit.prevent="fnResetPagination"
>
<el-row>
<el-col :span="12">
<el-form-item label="关键字" prop="KEYWORDS" label-width="60px">
<el-input
v-model="searchForm.KEYWORDS"
placeholder="请输入关键字"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label-width="30px">
<el-button type="primary" native-type="submit">搜索</el-button>
<el-button native-type="reset" @click="fnResetPagination">
重置
</el-button>
</el-form-item>
</el-col>
</el-row>
</el-form>
</el-card>
<layout-card>
<layout-table
ref="tableRef"
:data="list"
v-model:pagination="pagination"
@get-data="fnGetData"
>
<el-table-column reserve-selection type="selection" width="55" />
<el-table-column label="序号" width="70">
<template v-slot="{ $index }">
{{ serialNumber(pagination, $index) }}
</template>
</el-table-column>
<el-table-column property="layName" label="所属图层" width="150" />
<el-table-column property="regName" label="名称" />
<el-table-column label="操作" width="200">
<template v-slot="{ row }">
<el-button type="primary" text link @click="handleJoin(row)"
>绑定</el-button
>
</template>
</el-table-column>
</layout-table>
</layout-card>
</el-drawer>
</template>
<script setup>
import { serialNumber } from "@/assets/js/utils.js";
import useListData from "@/assets/js/useListData.js";
import { getRyRegionList } from "@/request/risk_control.js";
import { useVModels } from "@vueuse/core";
const { list, pagination, searchForm, fnGetData, fnResetPagination, tableRef } =
useListData(getRyRegionList);
const props = defineProps({
visible: {
type: Boolean,
required: true,
default: false,
},
form: {
type: Object,
required: true,
default: () => {},
},
});
const emits = defineEmits(["update:visible", "update:form"]);
const { visible, form } = useVModels(props, emits);
const handleJoin = (row) => {
form.value.ELECTRONIC_FENCE = row.regName;
form.value.ELECTRONIC_FENCE_ID = row.uuid;
visible.value = false;
};
</script>

View File

@ -0,0 +1,155 @@
<template>
<el-dialog
v-model="visible"
:title="type === 'edit' ? '审核' : '新增'"
:before-close="fnClose"
>
<el-form ref="formRef" :rules="rules" :model="form" label-width="150px">
<el-form-item label="监控设备名称" prop="VIDEONAME">
<el-input v-model="form.VIDEONAME" disabled />
</el-form-item>
<el-form-item label="监控设备编码" prop="CODE">
<el-input v-model="form.CODE" disabled />
</el-form-item>
<el-form-item label="报警类型" prop="TYPE">
<el-input v-model="form.TYPE" disabled />
</el-form-item>
<el-form-item label="报警时间" prop="CREATTIME">
<el-input v-model="form.CREATTIME" disabled />
</el-form-item>
<el-form-item v-if="form.IMG_PATH" label="报警截图" prop="IMG_PATH">
<img
v-viewer
:src="VITE_FILE_URL + form.IMG_PATH"
width="100"
height="100"
alt=""
class="ml-10"
/>
</el-form-item>
<el-form-item v-if="form.VIDEO_PATH" label="报警视频" prop="VIDEO_PATH">
<el-icon
size="30px"
@click="
data.videoDialog.visible = true;
data.videoDialog.src = form.VIDEO_PATH;
"
style="cursor: pointer"
>
<video-play />
</el-icon>
</el-form-item>
<el-form-item label="是否真实报警" prop="ISTRUE">
<el-select
v-model="form.ISTRUE"
class="m-2"
placeholder="Select"
size="large"
style="width: 240px"
>
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
</el-form>
<template #footer>
<el-button @click="fnClose"></el-button>
<el-button type="primary" @click="fnSubmit"> </el-button>
</template>
<layout-video
v-model:visible="data.videoDialog.visible"
:src="data.videoDialog.src"
/>
</el-dialog>
</template>
<script setup>
import { reactive, ref } from "vue";
import { useVModels } from "@vueuse/core";
import { debounce } from "throttle-debounce";
import useFormValidate from "@/assets/js/useFormValidate.js";
import { ElMessage } from "element-plus";
import { VideoPlay } from "@element-plus/icons-vue";
import LayoutVideo from "@/components/video/index.vue";
import { setAiWarningEdit } from "@/request/aiwarning_manager.js";
const VITE_FILE_URL = import.meta.env.VITE_FILE_URL;
const props = defineProps({
visible: {
type: Boolean,
required: true,
default: false,
},
form: {
type: Object,
required: true,
default: () => ({}),
},
type: {
type: String,
required: true,
default: "",
},
});
const options = [
{
value: 1,
label: "是",
},
{
value: 2,
label: "否",
},
{
value: 3,
label: "请选择",
},
];
const data = reactive({
videoDialog: {
visible: false,
src: "",
},
});
const emits = defineEmits(["update:visible", "update:form", "get-data"]);
const { visible, form } = useVModels(props, emits);
const rules = {
VIDEONAME: [{ required: true, message: "视频名称不能为空", trigger: "blur" }],
VIDEOURL: [
{ required: true, message: "播放地址不能为空", trigger: "change" },
],
CODE: [
{ required: true, message: "监控设备编码不能为空", trigger: "change" },
],
};
const formRef = ref(null);
const fnClose = () => {
formRef.value.resetFields();
visible.value = false;
};
const fnSubmit = debounce(
1000,
async () => {
if (form.value.ISTRUE === 3) {
ElMessage.warning("请选是否真实报警");
return;
}
await useFormValidate(formRef);
await setAiWarningEdit({ ...form.value });
ElMessage.success("操作成功");
fnClose();
emits("get-data");
},
{ atBegin: true }
);
</script>
<style scoped lang="scss"></style>

View File

@ -0,0 +1,174 @@
<template>
<div>
<el-card>
<el-form
:model="searchForm"
label-width="50px"
@submit.prevent="fnResetPagination"
>
<el-row>
<el-col :span="6">
<el-form-item prop="KEYWORDS">
<el-input
v-model="searchForm.KEYWORDS"
placeholder="请输入关键字"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label-width="10px">
<el-button type="primary" native-type="submit">搜索</el-button>
<el-button native-type="reset" @click="fnResetPagination">
重置
</el-button>
</el-form-item>
</el-col>
</el-row>
</el-form>
</el-card>
<layout-card>
<layout-table
ref="tableRef"
:data="list"
v-model:pagination="pagination"
@get-data="fnGetData"
row-key="AIWARNING_ID"
>
<el-table-column reserve-selection type="selection" width="55" />
<el-table-column label="序号" width="70">
<template v-slot="{ $index }">
{{ serialNumber(pagination, $index) }}
</template>
</el-table-column>
<el-table-column prop="VIDEONAME" label="监控设备名称" />
<el-table-column prop="CODE" label="监控设备编码" />
<el-table-column prop="TYPE" label="报警类型" />
<el-table-column prop="CREATTIME" label="报警时间" />
<el-table-column prop="IMG_PATH" label="报警截图">
<template v-slot="{ row }">
<layout-tooltip-img
:imgs="row.IMG_PATH ? fnToArray(row.IMG_PATH) : []"
/>
</template>
</el-table-column>
<el-table-column prop="ISTRUE" label="是否审核">
<template v-slot="{ row }">
<span v-if="row.ISTRUE === 3"></span>
<span v-if="row.ISTRUE === 2"> </span>
<span v-if="row.ISTRUE === 1"> </span>
</template>
</el-table-column>
<el-table-column label="操作" width="250">
<template v-slot="{ row }">
<el-button
v-if="row.ISTRUE === 3"
type="primary"
text
link
@click="fnAddOrEdit(row.AIWARNING_ID, 'edit')"
>
审核
</el-button>
<el-button type="primary" text link @click="fnDeleteAiWarning(row)">
删除
</el-button>
</template>
</el-table-column>
<template #button>
<el-button type="danger" @click="fnBatchDelete()">
批量删除
</el-button>
</template>
</layout-table>
</layout-card>
<add
v-model:visible="data.addDialog.Visible"
v-model:form="data.addDialog.form"
:type="data.addDialog.type"
@get-data="fnResetPagination"
/>
<video-view
v-model:visible="data.videoDialog.visible"
:src="data.videoDialog.src"
/>
</div>
</template>
<script setup>
import { serialNumber } from "@/assets/js/utils.js";
import useListData from "@/assets/js/useListData.js";
import LayoutTooltipImg from "@/components/tooltip_img/index.vue";
import {
getAiWarningList,
getAiWarningView,
setAiWarningDelete,
} from "@/request/aiwarning_manager.js";
import Add from "./components/add.vue";
import { nextTick, reactive } from "vue";
import { ElMessage, ElMessageBox } from "element-plus";
import { debounce } from "throttle-debounce";
const data = reactive({
addDialog: {
Visible: false,
type: "",
form: {
VIDEONAME: "",
VIDEOURL: "",
CODE: "",
},
},
videoDialog: {
visible: false,
src: "",
},
});
const { list, pagination, searchForm, fnGetData, fnResetPagination, tableRef } =
useListData(getAiWarningList);
const fnDeleteAiWarning = async (row) => {
if (row) {
const ids = [];
ids.push(row.AIWARNING_ID);
await ElMessageBox.confirm("确定要删除吗?", { type: "warning" });
await setAiWarningDelete({
AIWARNING_IDS: ids.join(","),
});
ElMessage.success("删除成功");
fnResetPagination();
}
};
const fnToArray = (value) => {
const arr = [];
arr.push({ FILEPATH: value });
return arr;
};
const fnBatchDelete = debounce(
1000,
async () => {
const selectionData = tableRef.value.getSelectionRows();
if (selectionData.length === 0) {
ElMessage.warning("请选中要删除的项");
return;
}
await ElMessageBox.confirm("确定要删除选中的数据吗?", { type: "warning" });
const DATA_IDS = selectionData.map((item) => item.AIWARNING_ID).join(",");
await setAiWarningDelete({ AIWARNING_IDS: DATA_IDS });
ElMessage.success("删除成功");
fnResetPagination();
},
{ atBegin: true }
);
const fnAddOrEdit = async (AIWARNING_ID, type) => {
data.addDialog.Visible = true;
await nextTick();
data.addDialog.type = type;
if (type === "edit") {
const resData = await getAiWarningView({ AIWARNING_ID });
data.addDialog.form = resData.pd;
}
};
</script>
<style scoped></style>