Browse Source

感知事件

wangqin
zhoule 10 months ago
parent
commit
a4d7067093
  1. 2
      ruoyi-ui/src/views/JiHeExpressway/components/RoadStateCard/index.vue
  2. 4
      ruoyi-ui/src/views/JiHeExpressway/pages/control/event/event/EventDetailDialog/data.js
  3. 182
      ruoyi-ui/src/views/JiHeExpressway/pages/control/event/event/index.vue

2
ruoyi-ui/src/views/JiHeExpressway/components/RoadStateCard/index.vue

@ -12,7 +12,7 @@
</p>
</div>
<div class="controls">
<Button :style="{ background: firstBtnColor,width: '50%' }" @click.native="$emit('firstBtnClick', $event)">{{
<Button :style="{ background: firstBtnColor,width: '50%' }" @click.native="$emit('firstBtnClick', cardData.id)">{{
firstBtnText
}}</Button>
<Button v-if="cardData.state != 3" :style="{ background: lastBtnColor,width: '50%' }" @click.native="$emit('lastBtnClick', $event)">{{ lastBtnText

4
ruoyi-ui/src/views/JiHeExpressway/pages/control/event/event/EventDetailDialog/data.js

@ -46,7 +46,7 @@ export const formList = [
},
{
label: "事件状态:",
key: "eventState",
key: "stringEventState",
type: "input",
options: {
disabled: true,
@ -55,7 +55,7 @@ export const formList = [
},
{
label: "操作员:",
key: "createBy",
key: "nickName",
type: "input",
options: {
disabled: true,

182
ruoyi-ui/src/views/JiHeExpressway/pages/control/event/event/index.vue

@ -1,5 +1,5 @@
<template>
<div class='RoadNetworkMonitoring2'>
<div class="RoadNetworkMonitoring2">
<Tabs :panels="panels" :default-active="activeName" @select="handleSelect" />
<!-- 搜索栏 -->
@ -25,7 +25,7 @@
</ButtonGradient>
</div>
<InputSearch style="width: 402px;" :formList="searchFormList" @handleSearch="handleSearch" />
<InputSearch style="width: 402px" :formList="searchFormList" @handleSearch="handleSearch" />
</div>
<!-- 内容 -->
@ -36,7 +36,7 @@
<!-- 分页 -->
<div class="footer">
<Pagination @current-change="getData" @size-change="onSizeChange" width="'100%'" :page-sizes="[12, 16, 20, 30, 50,]"
<Pagination @current-change="getData" @size-change="onSizeChange" width="'100%'" :page-sizes="[12, 16, 20, 30, 50]"
:page-size="searchData.pageSize" :current-page.sync="searchData.pageNum" layout="total, sizes, prev, pager, next"
:total="total">
</Pagination>
@ -46,23 +46,23 @@
<EventDetailDialog :visible="eventDetailDialogVisible" :formData="detailDialogFormData" @update:value="handleClose" />
<!-- "新增"弹出框 -->
<FormEvent :visible="isShowAddNew" @close="onCloseAddNew" />
</div>
</template>
<script>
import ButtonGradient from '@screen/components/Buttons/ButtonGradient.vue';
import Tabs from '@screen/components/Tabs/index.vue';
import RoadStateCard from '@screen/components/RoadStateCard/index.vue';
import Pagination from '@screen/components/Pagination.vue';
import InputSearch from '@screen/components/InputSearch/index.vue';
import ButtonGradient from "@screen/components/Buttons/ButtonGradient.vue";
import Tabs from "@screen/components/Tabs/index.vue";
import RoadStateCard from "@screen/components/RoadStateCard/index.vue";
import Pagination from "@screen/components/Pagination.vue";
import InputSearch from "@screen/components/InputSearch/index.vue";
import EventDetailDialog from "./EventDetailDialog/index";
import FormEvent from "./FormEvent/index";
import { tabMap, searchFormList } from "./data";
import request from "@/utils/request";
import { Loading } from 'element-ui';
function getRandomData(min = 1, max = 15) {
return Math.floor(Math.random() * (max - min + 1)) + min
return Math.floor(Math.random() * (max - min + 1)) + min;
}
function getMockData() {
@ -70,12 +70,12 @@ function getMockData() {
time: "2023.12.22 13:00:00",
source: "视频智能识别",
location: "k100+000",
direction: "济南方向"
}))
direction: "济南方向",
}));
}
export default {
name: 'RoadNetworkMonitoring2',
name: "RoadNetworkMonitoring2",
components: {
ButtonGradient,
Tabs,
@ -83,7 +83,7 @@ export default {
RoadStateCard,
InputSearch,
EventDetailDialog,
FormEvent
FormEvent,
},
data() {
return {
@ -93,19 +93,19 @@ export default {
activeName: "-1",
panels: [
{
label: "告警事件(20)",
label: "告警事件",
key: "-1"
},
{
label: "待确认事件(125)",
label: "待确认事件",
key: "0"
},
{
label: "处置中事件(230)",
label: "处置中事件",
key: "1"
},
{
label: "已处置事件(76)",
label: "已处置事件",
key: "2"
},
],
@ -114,10 +114,10 @@ export default {
searchData: {
pageSize: 12,
pageNum: 1,
eventState: null
eventState: null,
},
detailDialogFormData: {}
}
detailDialogFormData: {},
};
},
created() {
this.getData();
@ -126,127 +126,153 @@ export default {
handleSelect(activeName) {
this.activeName = activeName;
this.searchData.eventState = activeName == '-1' ? null : activeName;
this.searchData.eventState = activeName == "-1" ? null : activeName;
this.getData();
},
getStateCardBind(item) {
const { state, textColor, text } = tabMap[this.activeName]
const { state, textColor, text } = tabMap[this.activeName];
return {
cardData: { ...item, state },
lastBtnColor: textColor,
lastBtnText: text
}
lastBtnText: text,
};
},
getData() {
request({
url: `/dc/system/event/list`,
method: "get",
params: this.searchData
}).then(result => {
params: this.searchData,
}).then((result) => {
if (result.code != 200) return Message.error(result?.msg);
this.data = result.rows;
this.total = result.total;
})
});
// request({
// url: `/dc/system/event/count`,
// method: "get",
// }).then((result) => {
// if (result.code != 200) return Message.error(result?.msg);
// this.panels = [
// {
// label: `(${result.warningCount})`,
// key: "-1",
// },
// {
// label: `(${result.state0Count})`,
// key: "0",
// },
// {
// label: `(${result.state1Count})`,
// key: "1",
// },
// {
// label: `(${result.state2Count})`,
// key: "2",
// },
// ];
// });
},
onRefresh() {
this.data = [];
setTimeout(() => {
this.getData();
}, 100)
}, 100);
},
onSizeChange(pageSize) {
this.searchData.pageSize = pageSize
this.searchData.pageSize = pageSize;
this.getData();
},
onAddNew() {
this.isShowAddNew = true;
},
onExport() {
let loadingInstance = Loading.service({ fullscreen: true, background: "#00000052", text: "文件正在下载..." });
request({
url: '/dc/system/event/export',
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
responseType: 'blob'
}).then((res) => {
console.log(res);
const url = window.URL.createObjectURL(new Blob([res]))
let link = document.createElement('a')
link.style.display = 'none'
link.href = url
link.setAttribute('download', '事件信息列表.xlsx')
document.body.appendChild(link)
link.click()
URL.revokeObjectURL(link.href) // URL
document.body.removeChild(link)
link = null
loadingInstance.close();
}).catch(err => {
Message.error(err);
loadingInstance.close();
})
let loadingInstance = Loading.service({
fullscreen: true,
background: "#00000052",
text: "文件正在下载...",
});
request.post('/dc/system/event/export', {}, { headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, responseType: 'blob' })
.then((res) => {
console.log(res);
const url = window.URL.createObjectURL(new Blob([res]));
let link = document.createElement("a");
link.style.display = "none";
link.href = url;
link.setAttribute("download", "事件信息列表.xlsx");
document.body.appendChild(link);
link.click();
URL.revokeObjectURL(link.href); // URL
document.body.removeChild(link);
link = null;
loadingInstance.close();
})
.catch((err) => {
Message.error(err);
loadingInstance.close();
});
},
onCloseAddNew() {
this.isShowAddNew = false;
},
firstBtnClick(id) {
console.log('id', id)
console.log("id", id);
request({
url: `/dc/system/event/${id}`,
method: "get",
}).then(result => {
}).then((result) => {
if (result.code != 200) return Message.error(result?.msg);
this.detailDialogFormData = result.data;
this.eventDetailDialogVisible = true
})
this.eventDetailDialogVisible = true;
});
},
handleClose() {
this.eventDetailDialogVisible = false;
},
handleSearch(data) {
console.log('data', data);
console.log("data", data);
let daterange = data.daterange;
let dStakeMark = data.stakeMark;
let dendStakeMark = data.endStakeMark;
let stakeMark = `K${dStakeMark[0]}+${dStakeMark[1]}`
let endStakeMark = `K${dendStakeMark[0]}+${dendStakeMark[1]}`
let stakeMark = `K${dStakeMark[0]}+${dStakeMark[1]}`;
let endStakeMark = `K${dendStakeMark[0]}+${dendStakeMark[1]}`;
this.searchData = {
...this.searchData,
eventType: data.eventType,
eventSources: data.eventSources,
startTime: (daterange && daterange.length > 0) ? daterange[0] : '',
endTime: (daterange && daterange.length > 0) ? daterange[1] : '',
startTime: daterange && daterange.length > 0 ? daterange[0] : "",
endTime: daterange && daterange.length > 0 ? daterange[1] : "",
stakeMark: stakeMark,
endStakeMark: endStakeMark
}
endStakeMark: endStakeMark,
};
this.getData();
},
resultMapping(type, value) {
const keyMap = {
'eventSource': {
1: '96659',
2: '交警转接',
3: '道路巡查',
4: '视频巡查',
5: '视频AI',
6: '一键救援',
7: '其他',
}
}
eventSource: {
1: "96659",
2: "交警转接",
3: "道路巡查",
4: "视频巡查",
5: "视频AI",
6: "一键救援",
7: "其他",
},
};
return keyMap[type][value];
},
}
}
},
};
</script>
<style lang='scss' scoped>
<style lang="scss" scoped>
.RoadNetworkMonitoring2 {
padding: 21px;

Loading…
Cancel
Save