Browse Source

更改

wangqin
zhangzhang 8 months ago
parent
commit
68aaaa6d69
  1. 8
      ruoyi-ui/src/api/manualWarning/index.js
  2. 2
      ruoyi-ui/src/views/JiHeExpressway/components/ManualWarningCard/index.vue
  3. 85
      ruoyi-ui/src/views/JiHeExpressway/pages/control/event/event/FormEvent/PresetFormItems.js
  4. 6
      ruoyi-ui/src/views/JiHeExpressway/pages/control/event/governanceAnalysis/components/eventTypeAnalysis/index.vue
  5. 109
      ruoyi-ui/src/views/JiHeExpressway/pages/control/manual/events/data.js
  6. 39
      ruoyi-ui/src/views/JiHeExpressway/pages/control/manual/events/index.vue
  7. 88
      ruoyi-ui/src/views/JiHeExpressway/pages/control/manual/statistic/components/Eventfiltering/index.vue
  8. 2
      ruoyi-ui/src/views/JiHeExpressway/pages/control/manual/statistic/components/Eventfiltering/trafficIncidentsCharts.js
  9. 40
      ruoyi-ui/src/views/JiHeExpressway/pages/control/manual/statistic/components/Eventfiltering/trafficIncidentsChartsPie.js
  10. 274
      ruoyi-ui/src/views/JiHeExpressway/pages/control/manual/statistic/components/Sitefiltering/index.vue
  11. 95
      ruoyi-ui/src/views/JiHeExpressway/pages/control/manual/statistic/components/Sitefiltering/trafficIncidentsCharts.js
  12. 232
      ruoyi-ui/src/views/JiHeExpressway/pages/control/manual/statistic/components/Sitefiltering/trafficIncidentsChartsPie.js
  13. 211
      ruoyi-ui/src/views/JiHeExpressway/pages/control/manual/statistic/components/Timefiltering/index.vue
  14. 95
      ruoyi-ui/src/views/JiHeExpressway/pages/control/manual/statistic/components/Timefiltering/trafficIncidentsCharts.js
  15. 15
      ruoyi-ui/src/views/JiHeExpressway/pages/control/manual/statistic/index.vue
  16. 59
      ruoyi-ui/src/views/JiHeExpressway/utils/enum.js

8
ruoyi-ui/src/api/manualWarning/index.js

@ -1,9 +1,13 @@
import request from "@/utils/request";
// 查询非机预警列表
export function perceivedEventsList(data) {
export function perceivedEventsList(data, pageNum, pageSize) {
return request({
url: "/perceivedEvents/warning/perceivedEventsList",
url:
"/perceivedEvents/warning/nonAutomaticWarningList?pageNum=" +
pageNum +
"&pageSize=" +
pageSize,
method: "post",
data,
});

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

@ -89,7 +89,7 @@ export default {
type: Array,
default: () => [
{
key: "warningType",
key: "warningTypeName",
label: "类型",
},
// {

85
ruoyi-ui/src/views/JiHeExpressway/pages/control/event/event/FormEvent/PresetFormItems.js

@ -1,4 +1,4 @@
import request from '@/utils/request'
import request from "@/utils/request";
import { Message } from "element-ui";
import moment from "moment";
@ -8,7 +8,7 @@ export const source = {
type: "RadioGroup",
isAlone: true,
required: true,
default: '1',
default: "1",
options: {
activeColor: "linear-gradient(180deg, #37E7FF 0%, #009BCC 100%)",
options: [
@ -50,7 +50,7 @@ export const illegalTriggeringType = {
type: "RadioGroup",
isAlone: true,
required: true,
default: '5-1',
default: "5-1",
options: {
activeColor: "linear-gradient(180deg, #37E7FF 0%, #009BCC 100%)",
options: [
@ -299,6 +299,45 @@ export const eventSources = {
},
};
export const warningType = {
label: "事件源:",
key: "warningType",
type: "select",
options: {
clearable: true,
options: [
{
key: "1",
label: "交通拥堵",
},
{
key: "2",
label: "行人",
},
{
key: "4",
label: "停车",
},
{
key: "5",
label: "违规驾驶",
},
{
key: "6",
label: "路障",
},
{
key: "7",
label: "道路施工",
},
{
key: "99",
label: "其他",
},
],
},
};
export const eventType = {
label: "事件类型:",
key: "eventType",
@ -495,7 +534,7 @@ export const isInTunnel = {
key: "inTunnel",
// isAlone: true,
required: true,
default: '0',
default: "0",
type: "RadioGroup",
options: {
activeColor: "linear-gradient(180deg, #37E7FF 0%, #009BCC 100%)",
@ -596,12 +635,15 @@ export const weatherSituation = {
],
},
visible: (data) => {
if (data?.eventSubclass == '10-1' || data?.eventSubclass == '10-2' || data?.eventSubclass == '10-3') {
if (
data?.eventSubclass == "10-1" ||
data?.eventSubclass == "10-2" ||
data?.eventSubclass == "10-3"
) {
return true;
}
return false;
},
};
export const additionalNotes = {
@ -717,24 +759,29 @@ export const locationMode = {
//路网设施 1 收费站 2 桥梁 3 互通立交 4 枢纽立交 5 隧道 6 服务区
request({
url: `/business/facility/query?facilityType=${facilityType}`,
method: "get"
}).then((result) => {
method: "get",
})
.then((result) => {
if (result.code != 200) return Message.error(result?.msg);
let lwss = [];
result.data.forEach(it => lwss.push({ key: it.id, label: it.facilityName}))
result.data.forEach((it) =>
lwss.push({ key: it.id, label: it.facilityName })
);
formList.forEach((it) => {
if(it.key == "dcEventAccident.facilityId" || it.key == "dcEventVehicleAccident.facilityId"){
if (
it.key == "dcEventAccident.facilityId" ||
it.key == "dcEventVehicleAccident.facilityId"
) {
it.options.options = lwss;
}
});
}).catch((err) => {
console.log('err',err)
Message.error("查询失败1", err);
})
.catch((err) => {
console.log("err", err);
Message.error("查询失败1", err);
});
}
},
},
};
@ -953,7 +1000,7 @@ export const constructionMeasurement = {
type: "RadioGroup",
isAlone: true,
required: true,
default:'0',
default: "0",
options: {
activeColor: "linear-gradient(180deg, #37E7FF 0%, #009BCC 100%)",
options: [
@ -983,7 +1030,7 @@ export const locationType = {
type: "RadioGroup",
isAlone: true,
required: true,
default: '1',
default: "1",
options: {
activeColor: "linear-gradient(180deg, #37E7FF 0%, #009BCC 100%)",
options: [
@ -1005,7 +1052,7 @@ export const specialConstruction = {
type: "RadioGroup",
isAlone: true,
required: true,
default: '1',
default: "1",
options: {
activeColor: "linear-gradient(180deg, #37E7FF 0%, #009BCC 100%)",
options: [
@ -1173,7 +1220,7 @@ export const congestionCause = {
},
},
visible: (data) => {
if (data?.eventSubclass != '4-1') {
if (data?.eventSubclass != "4-1") {
return false;
}
return true;

6
ruoyi-ui/src/views/JiHeExpressway/pages/control/event/governanceAnalysis/components/eventTypeAnalysis/index.vue

@ -25,7 +25,6 @@ export default {
methods: {
getAllEventNum() {
return allEventNum().then((response) => {
console.log("response", response);
let data = [];
let total = null;
let nameData = [];
@ -37,7 +36,6 @@ export default {
});
total += response.data[i].num;
}
console.log("total88", total);
for (let i = 0; i < data.length; i++) {
// if (i % 2 === 0) {
// data.splice(i + 1, 0, newObj)
@ -47,6 +45,10 @@ export default {
}
}
chartsStatistics.legend.data = nameData;
console.log(
"chartsStatistics.legend.data",
chartsStatistics.legend.data
);
chartsStatistics.legend.formatter = function (name) {
let tarValue = 0;
for (let i = 0; i < response.data.length; i++) {

109
ruoyi-ui/src/views/JiHeExpressway/pages/control/manual/events/data.js

@ -1,53 +1,30 @@
import * as PresetFormItems from "@screen/pages/control/event/event/FormEvent/PresetFormItems.js";
import { merge, cloneDeep } from "lodash";
import { warningType } from "@screen/utils/enum.js";
export const searchFormList = [
{
label: "事件状态:",
key: "eventState",
type: "RadioGroup",
default: "0",
options: {
options: [
{
key: "0",
label: "未解决",
},
{
key: "1",
label: "已解决",
},
{
key: "2",
label: "已关闭",
},
],
},
},
PresetFormItems.eventSources,
PresetFormItems.eventType,
{
label: "方向:",
key: "direction",
type: "RadioGroup",
default: "1",
options: {
options: [
{
key: "1",
label: "菏泽方向",
},
{
key: "2",
label: "双向",
},
{
key: "3",
label: "济南方向",
},
],
},
},
PresetFormItems.warningType,
// {
// label: "方向:",
// key: "direction",
// type: "RadioGroup",
// default: "1",
// options: {
// options: [
// {
// key: "1",
// label: "菏泽方向",
// },
// {
// key: "2",
// label: "双向",
// },
// {
// key: "3",
// label: "济南方向",
// },
// ],
// },
// },
{
label: "时间范围:",
key: "warningTime",
@ -59,23 +36,23 @@ export const searchFormList = [
valueFormat: "yyyy-MM-dd HH:mm:ss",
},
},
{
...PresetFormItems.station,
label: "开始桩号:",
required: false,
},
merge(cloneDeep(PresetFormItems.station), {
options: {
options: [
{
key: "endStakeMark[0]",
},
{
key: "endStakeMark[1]",
},
],
},
label: "结束桩号:",
required: false,
}),
// {
// ...PresetFormItems.station,
// label: "开始桩号:",
// required: false,
// },
// merge(cloneDeep(PresetFormItems.station), {
// options: {
// options: [
// {
// key: "endStakeMark[0]",
// },
// {
// key: "endStakeMark[1]",
// },
// ],
// },
// label: "结束桩号:",
// required: false,
// }),
];

39
ruoyi-ui/src/views/JiHeExpressway/pages/control/manual/events/index.vue

@ -41,8 +41,8 @@
@size-change="onSizeChange"
width="'100%'"
:page-sizes="[12, 16, 20, 30, 50]"
:page-size="searchData.pageSize"
:current-page.sync="searchData.pageNum"
:page-size="pageSize"
:current-page.sync="pageNum"
layout="total, sizes, prev, pager, next"
:total="total"
>
@ -60,6 +60,7 @@ import { perceivedEventsList } from "@/api/manualWarning/index.js";
// import EventDispatchDialog from "./EventDispatchDialog/index";
import { searchFormList } from "./data";
import request from "@/utils/request";
import { WarningType, WarningSubclass } from "@screen/utils/enum.js";
const directionMapping = {
1: "菏泽方向",
@ -78,14 +79,15 @@ export default {
},
data() {
return {
WarningSubclass,
searchFormList,
detailDialogFormData: {},
total: 0,
data: [],
eventId: "0",
searchData: {
pageSize: 16,
pageNum: 1,
searchData: {
warningSource: "6",
},
};
@ -101,17 +103,28 @@ export default {
//
onRefresh() {},
initData() {
perceivedEventsList(this.searchData).then((res) => {
perceivedEventsList(this.searchData, this.pageNum, this.pageSize).then(
(res) => {
if (res.code != 200) return Message.error(res?.msg);
this.total = res.total;
res.rows.forEach((it) => {
it.source = "非机预警";
it.stringDirection = directionMapping[it.direction] || it.direction;
it.otherConfig = JSON.parse(it.otherConfig);
if (it.warningSubclass) {
let i = it.warningType;
let r = it.warningSubclass;
it.warningTypeName =
WarningType[i] +
(WarningSubclass[i][r]
? "(" + WarningSubclass[i][r] + ")"
: "");
}
});
this.data = res.rows;
console.log("darta", this.data);
});
}
);
// request({
// // url: `/dc/system/event/dispatchEventList`,
// url: "/dc/system/event/list",
@ -126,11 +139,23 @@ export default {
// this.data = result.rows;
// });
},
onSizeChange(pageSize) {},
onSizeChange(pageSize) {
this.pageSize = pageSize;
this.initData();
},
getStateCardBind(item) {},
firstBtnClick(id) {},
handleSearch(data) {},
handleSearch(data) {
console.log("data", data);
this.searchData = {
...this.searchData,
warningType: data.warningType,
startTime: data.warningTime[0],
completeTime: data.warningTime[1],
};
this.initData();
},
},
};
</script>

88
ruoyi-ui/src/views/JiHeExpressway/pages/control/manual/statistic/components/Eventfiltering/index.vue

@ -6,8 +6,8 @@
@handleSearch="handleSearch"
/>
<div class="Eventfiltering-content">
<div class="Eventfiltering-left" id="trafficIncidents"></div>
<div class="Eventfiltering-right" id="trafficIncidentsPie"></div>
<div class="Eventfiltering-left" ref="trafficIncidents"></div>
<div class="Eventfiltering-right" ref="trafficIncidentsPie"></div>
</div>
</div>
</template>
@ -58,6 +58,8 @@ export default {
type: "day",
warningTime: "",
},
trafficIncidents: null,
trafficIncidentsPie: null,
searchFormList: [
{
label: "事件类型:",
@ -130,27 +132,54 @@ export default {
};
},
async mounted() {
setTimeout(() => {
this.$nextTick(async () => {
(this.formData.warningTime =
moment(new Date()).format("YYYY-MM-DD") + " 00:00:01"),
(this.trafficIncidents = echarts.init(this.$refs.trafficIncidents));
this.trafficIncidents.setOption(trafficIncidentsCharts);
this.trafficIncidentsPie = echarts.init(this.$refs.trafficIncidentsPie);
this.trafficIncidentsPie.setOption(trafficIncidentsChartsPie);
const domMap = this.$refs.trafficIncidentsPie;
let parentDiv = domMap.firstElementChild;
// // canvas;
let canvas = document.createElement("canvas");
canvas.width = parentDiv.offsetWidth;
canvas.height = parentDiv.offsetHeight;
parentDiv.appendChild(canvas);
const context = canvas.getContext("2d");
// //
let gr = context.createLinearGradient(280, 0, 580, 0);
gr.addColorStop(1, "rgba(92,197,255,0)");
gr.addColorStop(0, "rgba(92,197,255,0.5)");
context.lineWidth = 1; // 线
drawRoundRect(context, 430, 134, 280, 24, 12, gr);
drawRoundRect(context, 430, 168, 280, 24, 10, gr);
drawRoundRect(context, 430, 202, 280, 24, 10, gr);
drawRoundRect(context, 430, 236, 280, 24, 10, gr);
drawRoundRect(context, 430, 270, 280, 24, 10, gr);
drawRoundRect(context, 430, 304, 280, 24, 10, gr);
drawRoundRect(context, 430, 338, 280, 24, 10, gr);
drawRoundRect(context, 430, 372, 280, 24, 10, gr);
drawRoundRect(context, 430, 406, 280, 24, 10, gr);
drawRoundRect(context, 430, 440, 280, 24, 10, gr);
drawRoundRect(context, 430, 474, 280, 24, 10, gr);
await this.getNonAutomaticWarningType(this.formData);
var trafficIncidents = echarts.init(
document.getElementById("trafficIncidents")
);
trafficIncidents.setOption(trafficIncidentsCharts);
var trafficIncidentsPie = echarts.init(
document.getElementById("trafficIncidentsPie")
);
trafficIncidentsPie.setOption(trafficIncidentsChartsPie);
// drawRoundRect(context, 430, 508, 280, 24, 10, gr);
});
});
},
methods: {
getNonAutomaticWarningType(data) {
let that = this;
return nonAutomaticWarningType(data).then((res) => {
let newData = res.data;
let seriesData = [];
let xData = [];
let pieData = [];
let total = null;
console.log("++++++++++++", newData);
newData.forEach((item) => {
seriesData.push(item.number);
xData.push(item.subclass);
@ -162,7 +191,7 @@ export default {
});
trafficIncidentsCharts.series[0].data = seriesData;
trafficIncidentsCharts.xAxis.data = xData;
trafficIncidentsChartsPie.legend.data = xData;
trafficIncidentsChartsPie.legend.formatter = function (name) {
let tarValue = 0;
for (let i = 0; i < newData.length; i++) {
@ -173,34 +202,10 @@ export default {
var percert = total == 0 ? 0 : ((tarValue / total) * 100).toFixed(2);
return `{text|${name}} {number|${tarValue} 起 } {number|${percert}%}`;
};
trafficIncidentsChartsPie.legend.data = xData;
trafficIncidentsChartsPie.title[0].text = total;
trafficIncidentsChartsPie.series[2].data = seriesData;
// const domMap = document.getElementById("trafficIncidentsPie");
// let parentDiv = domMap.firstChild;
// console.log("parentDiv", parentDiv);
// // canvas;
// let canvas = document.createElement("canvas");
// canvas.width = parentDiv.offsetWidth;
// canvas.height = parentDiv.offsetHeight;
// parentDiv.appendChild(canvas);
// const context = canvas.getContext("2d");
// //
// let gr = context.createLinearGradient(240, 0, 450, 0);
// gr.addColorStop(1, "rgba(92,197,255,0)");
// gr.addColorStop(0, "rgba(92,197,255,0.5)");
// context.lineWidth = 1; // 线
// drawRoundRect(context, 100, 8, 280, 50, 12, gr);
// drawRoundRect(context, 202, 32, 280, 20, 10, gr);
// drawRoundRect(context, 202, 56, 280, 20, 10, gr);
// drawRoundRect(context, 202, 80, 280, 20, 10, gr);
// drawRoundRect(context, 202, 104, 280, 20, 10, gr);
// drawRoundRect(context, 202, 128, 280, 20, 10, gr);
// drawRoundRect(context, 202, 152, 280, 20, 10, gr);
// this.myChart = myChart;
trafficIncidentsChartsPie.series[2].data = pieData;
that.trafficIncidents.setOption(trafficIncidentsCharts);
that.trafficIncidentsPie.setOption(trafficIncidentsChartsPie);
});
},
handleSearch(value) {
@ -221,6 +226,7 @@ export default {
.search-box {
width: 402px !important;
float: right;
overflow: hidden;
}
.Eventfiltering-content {
@ -230,12 +236,12 @@ export default {
justify-content: space-between;
.Eventfiltering-left {
width: 65%;
width: 63%;
height: 100%;
}
.Eventfiltering-right {
width: 32%;
width: 34%;
height: 100%;
}
}

2
ruoyi-ui/src/views/JiHeExpressway/pages/control/manual/statistic/components/Eventfiltering/trafficIncidentsCharts.js

@ -16,7 +16,7 @@ var options = {
},
},
grid: {
left: "30px",
left: "50px",
right: "0%",
top: "50px",
bottom: "5%",

40
ruoyi-ui/src/views/JiHeExpressway/pages/control/manual/statistic/components/Eventfiltering/trafficIncidentsChartsPie.js

@ -18,9 +18,9 @@ var options = {
title: [
{
text: "999",
top: "25%",
top: "36%",
textAlign: "center",
left: "48%",
left: "29%",
textStyle: {
color: "#ffffff",
fontSize: 30,
@ -29,9 +29,9 @@ var options = {
},
{
text: "总数",
top: "38%",
top: "32%",
textAlign: "center",
left: "48%",
left: "29%",
textStyle: {
color: "rgba(242, 252, 253, 0.84)",
fontSize: 16,
@ -53,20 +53,22 @@ var options = {
},
},
legend: {
show: true,
width: "300px",
height: "120px",
height: "520px",
orient: "vertical",
icon: "circle",
top: "60%",
top: "15%",
left: "70%",
itemWidth: 10,
itemHeight: 10,
textStyle: {
color: "#ffffff",
fontSize: 14,
lineHeight: 22,
lineHeight: 24,
rich: {
text: {
width: 100,
width: 50,
marginLeft: 32,
fontSize: 14,
},
@ -82,20 +84,20 @@ var options = {
},
},
data: legendData,
pageIconColor: "#fff",
pageIconSize: 10,
pageTextStyle: {
color: "#fff",
},
type: "scroll",
pageButtonPosition: "end",
// pageIconColor: "#fff",
// pageIconSize: 10,
// pageTextStyle: {
// color: "#fff",
// },
// type: "scroll",
// pageButtonPosition: "end",
},
series: [
/** 饼图上刻度 */
{
type: "gauge",
center: ["50%", "35%"],
radius: "46%", // 错位调整此处
center: ["30%", "35%"],
radius: "43%", // 错位调整此处
startAngle: 0,
endAngle: 360,
splitNumber: 52,
@ -116,7 +118,7 @@ var options = {
tooltip: false,
type: "gauge",
radius: "30%",
center: ["50%", "35%"],
center: ["30%", "35%"],
startAngle: 0,
endAngle: 360,
axisLine: {
@ -183,7 +185,7 @@ var options = {
{
type: "pie",
radius: ["40%", "50%"],
center: ["50%", "35%"],
center: ["30%", "35%"],
z: 10,
label: {
show: false,

274
ruoyi-ui/src/views/JiHeExpressway/pages/control/manual/statistic/components/Sitefiltering/index.vue

@ -1,46 +1,270 @@
<template>
<div class="Eventfiltering">
<div class="Eventfiltering-left" id="trafficIncidentsCharts"></div>
<div class="Eventfiltering-right"></div>
<InputSearch
class="search-box"
:formList="searchFormList"
@handleSearch="handleSearch"
/>
<div class="Eventfiltering-content">
<div class="Eventfiltering-left" ref="trafficIncidents"></div>
<div class="Eventfiltering-right" ref="trafficIncidentsPie"></div>
</div>
</div>
</template>
<script>
// import trafficIncidentsCharts from "./trafficIncidentsCharts.js";
// import * as echarts from "echarts";
// export default {
// name: "Eventfiltering",
// components: { trafficIncidentsCharts },
// data() {
// return {};
// },
// mounted() {
// var trafficIncidentsCharts = echarts.init(
// document.getElementById("trafficIncidentsCharts")
// );
// trafficIncidentsCharts.setOption(trafficIncidentsCharts);
// },
// methods: {},
// };
import InputSearch from "@screen/components/InputSearch/index.vue";
import trafficIncidentsCharts1 from "./trafficIncidentsCharts.js";
import trafficIncidentsChartsPie1 from "./trafficIncidentsChartsPie.js";
import { nonAutomaticWarningFacility } from "@/api/manualWarning/index.js";
import * as echarts from "echarts";
import moment from "moment";
const drawRoundRect = (ctx, x, y, width, height, radius, gr) => {
// ctx, x, y, , ,
ctx.beginPath();
ctx.fillStyle = gr;
ctx.arc(x + radius, y + radius, radius, Math.PI, (Math.PI * 3) / 2);
ctx.lineTo(width - radius + x, y);
ctx.arc(
width - radius + x,
radius + y,
radius,
(Math.PI * 3) / 2,
Math.PI * 2
);
ctx.lineTo(width + x, height + y - radius);
ctx.arc(
width - radius + x,
height - radius + y,
radius,
0,
(Math.PI * 1) / 2
);
ctx.lineTo(radius + x, height + y);
ctx.arc(radius + x, height - radius + y, radius, (Math.PI * 1) / 2, Math.PI);
ctx.closePath();
//ctx.stroke();
ctx.fill();
};
export default {
name: "Sitefiltering",
components: {
InputSearch,
},
props: {
name: {
type: String,
},
},
data() {
return {
// loading: false,
trafficIncidents: null,
trafficIncidentsPie: null,
formData: {
type: "day",
warningTime: "",
},
searchFormList: [
{
label: "事件类型:",
key: "type",
type: "select",
default: "day",
options: {
clearable: true,
options: [
{
key: "day",
label: "天",
},
{
key: "month",
label: "月",
},
{
key: "year",
label: "年",
},
],
},
},
{
label: "日期:",
key: "warningTime",
required: true,
type: "datePicker",
options: {
valueFormat: "yyyy-MM-dd",
},
visible: (data) => {
if (data.type == "day") {
return true;
}
},
},
{
label: "日期:",
key: "warningTime",
required: true,
type: "datePicker",
options: {
type: "month",
valueFormat: "yyyy-MM-dd",
},
visible: (data) => {
if (data.type == "month") {
return true;
}
},
},
{
label: "日期:",
key: "warningTime",
required: true,
type: "datePicker",
options: {
type: "year",
valueFormat: "yyyy-MM-dd",
},
visible: (data) => {
if (data.type == "year") {
return true;
}
},
},
],
};
},
watch: {
name: {
handler(newValue, oldValue) {
console.log("newValue", newValue);
if (newValue == "second") {
this.getWarningCharts();
}
},
deep: true,
},
},
mounted() {},
methods: {
getWarningCharts() {
setTimeout(() => {
this.$nextTick(async () => {
(this.formData.warningTime =
moment(new Date()).format("YYYY-MM-DD") + " 00:00:01"),
(this.trafficIncidents = echarts.init(this.$refs.trafficIncidents));
this.trafficIncidents.setOption(trafficIncidentsCharts1);
this.trafficIncidentsPie = echarts.init(
this.$refs.trafficIncidentsPie
);
this.trafficIncidentsPie.setOption(trafficIncidentsChartsPie1);
const domMap = this.$refs.trafficIncidentsPie;
let parentDiv = domMap.firstElementChild;
// // canvas;
let canvas = document.createElement("canvas");
canvas.width = parentDiv.offsetWidth;
canvas.height = parentDiv.offsetHeight;
parentDiv.appendChild(canvas);
const context = canvas.getContext("2d");
// //
let gr = context.createLinearGradient(280, 0, 580, 0);
gr.addColorStop(1, "rgba(92,197,255,0)");
gr.addColorStop(0, "rgba(92,197,255,0.5)");
context.lineWidth = 1; // 线
drawRoundRect(context, 430, 134, 280, 24, 12, gr);
drawRoundRect(context, 430, 168, 280, 24, 10, gr);
drawRoundRect(context, 430, 202, 280, 24, 10, gr);
drawRoundRect(context, 430, 236, 280, 24, 10, gr);
drawRoundRect(context, 430, 270, 280, 24, 10, gr);
drawRoundRect(context, 430, 304, 280, 24, 10, gr);
drawRoundRect(context, 430, 338, 280, 24, 10, gr);
drawRoundRect(context, 430, 372, 280, 24, 10, gr);
drawRoundRect(context, 430, 406, 280, 24, 10, gr);
drawRoundRect(context, 430, 440, 280, 24, 10, gr);
// drawRoundRect(context, 430, 474, 280, 24, 10, gr);
await this.getNonAutomaticWarningFacility(this.formData);
});
});
},
getNonAutomaticWarningFacility(data) {
return nonAutomaticWarningFacility(data).then((res) => {
let newData = res.data;
let seriesData = [];
let xData = [];
let pieData = [];
let total = null;
newData.forEach((item) => {
seriesData.push(item.number);
xData.push(item.facilityName);
pieData.push({
value: item.number,
name: item.facilityName,
});
total += item.number;
});
trafficIncidentsCharts1.series[0].data = seriesData;
trafficIncidentsCharts1.xAxis.data = xData;
trafficIncidentsChartsPie1.legend.formatter = function (name) {
let tarValue = 0;
for (let i = 0; i < newData.length; i++) {
if (newData[i].facilityName === name) {
tarValue = newData[i].number;
}
}
var percert = total == 0 ? 0 : ((tarValue / total) * 100).toFixed(2);
return `{text|${name}} {number|${tarValue} 起 } {number|${percert}%}`;
};
trafficIncidentsChartsPie1.title[0].text = total;
trafficIncidentsChartsPie1.series[2].data = pieData;
trafficIncidentsChartsPie1.legend.data = xData;
this.trafficIncidents.setOption(trafficIncidentsCharts1);
this.trafficIncidentsPie.setOption(trafficIncidentsChartsPie1);
});
},
handleSearch(value) {
value.warningTime = value.warningTime + " 00:00:01";
this.formData = { ...value };
this.getNonAutomaticWarningFacility(this.formData);
},
},
};
</script>
<style lang="scss" scoped>
.Eventfiltering {
width: 99%;
height: 100%;
height: 94%;
margin: auto;
.search-box {
width: 402px !important;
float: right;
}
.Eventfiltering-content {
width: 100%;
height: 96%;
display: flex;
justify-content: space-between;
}
.Eventfiltering-left {
width: 60%;
width: 63%;
height: 100%;
background-color: #fff;
}
.Eventfiltering-right {
width: 40%;
width: 34%;
height: 100%;
background-color: #fff;
}
}
}
</style>

95
ruoyi-ui/src/views/JiHeExpressway/pages/control/manual/statistic/components/Sitefiltering/trafficIncidentsCharts.js

@ -0,0 +1,95 @@
var options = {
title: {
// text: '单位/%',
top: "0%",
left: "0%",
textStyle: {
fontSize: "10px",
fontWeight: 300,
color: "#B5C5D4",
opacity: 0.8,
},
},
tooltip: {
valueFormatter: function (value) {
return value + " 起";
},
},
grid: {
left: "50px",
right: "0%",
top: "50px",
bottom: "5%",
containLabel: true,
},
xAxis: {
type: "category",
data: [],
axisLine: {
lineStyle: {
color: "rgba(49, 217, 255, 0.8)",
},
},
axisTick: {
show: false,
},
axisLabel: {
color: "#fff",
fontSize: "18px",
},
},
yAxis: [
{
// type: 'value',
// min: function (value) {
// return value.min*0.9;
// },
name: "交通事件(起)",
nameTextStyle: {
color: "#fff",
fontSize: 18,
align: "center",
},
type: "value",
axisLine: {
show: false,
lineStyle: {
width: 1,
color: "#545454",
},
},
splitLine: {
lineStyle: {
color: "rgba(49, 217, 255, 0.5)",
},
},
axisTick: {
show: false,
},
axisLabel: {
color: "#fff",
fontSize: "18px",
formatter: (value) => {
return value;
},
},
},
],
series: [
{
// name: '审限内结案率',
data: [5, 10, 20, 30],
type: "pictorialBar",
symbol: "roundRect",
symbolRepeat: true,
symbolSize: [13, 4],
// symbolOffset: symbolOffset,
// barWidth:'40%',
itemStyle: {
color: "#20E7FF",
},
},
],
};
export default options;

232
ruoyi-ui/src/views/JiHeExpressway/pages/control/manual/statistic/components/Sitefiltering/trafficIncidentsChartsPie.js

@ -0,0 +1,232 @@
let colors = [
"#4278F8",
"#5372C4",
"#0046FF",
"#FB9434",
"#854101",
"#05E599",
"#219F73",
"#7CEDD5",
"#854101",
"#05E599",
"#219F73",
"#7CEDD5",
];
var legendData = [];
var options = {
title: [
{
text: "999",
top: "36%",
textAlign: "center",
left: "29%",
textStyle: {
color: "#ffffff",
fontSize: 30,
fontFamily: "SourceHanSansCN",
},
},
{
text: "总数",
top: "32%",
textAlign: "center",
left: "29%",
textStyle: {
color: "rgba(242, 252, 253, 0.84)",
fontSize: 16,
fontFamily: "SourceHanSansCN",
},
},
],
grid: {
top: "38%",
left: "6%",
right: "6%",
bottom: "3%",
containLabel: true,
},
tooltip: {
show: true,
valueFormatter: function (value) {
return value + " 起";
},
},
legend: {
show: true,
width: "300px",
height: "520px",
orient: "vertical",
icon: "circle",
top: "15%",
left: "70%",
itemWidth: 10,
itemHeight: 10,
textStyle: {
color: "#ffffff",
fontSize: 14,
lineHeight: 24,
rich: {
text: {
width: 100,
marginLeft: 32,
fontSize: 14,
},
number: {
fontSize: 14,
color: "#37E7FF",
marginLeft: 32,
fontWeight: "bold",
},
unit: {
fontSize: 14,
},
},
},
data: legendData,
// pageIconColor: "#fff",
// pageIconSize: 10,
// pageTextStyle: {
// color: "#fff",
// },
// type: "scroll",
// pageButtonPosition: "end",
},
series: [
/** 饼图上刻度 */
{
type: "gauge",
center: ["30%", "35%"],
radius: "43%", // 错位调整此处
startAngle: 0,
endAngle: 360,
splitNumber: 52,
axisLine: { show: false },
splitLine: {
// length: 39,
length: "2",
lineStyle: {
width: 5,
color: "#5CC5FF",
},
},
axisTick: { show: false },
axisLabel: { show: false },
},
{
name: "总数",
tooltip: false,
type: "gauge",
radius: "30%",
center: ["30%", "35%"],
startAngle: 0,
endAngle: 360,
axisLine: {
lineStyle: {
color: [[1, "#0AFFE950"]],
width: 1,
},
},
axisTick: {
show: false,
},
splitLine: {
show: false,
},
axisLabel: {
show: false,
},
detail: {
show: false,
},
pointer: {
show: false,
},
progress: {
show: true,
width: 80,
itemStyle: {
color: {
type: "radial",
x: 0.5,
y: 0.5,
r: 0.5,
colorStops: [
{
offset: 0,
color: "rgb(0, 224, 205, 0)",
},
{
offset: 0.7,
color: "rgba(0, 224, 205, 0)",
},
{
offset: 1,
color: "rgba(10, 255, 233, 0.5)",
},
],
},
},
},
data: [
{
value: 100,
},
],
tooltip: {
backgroundColor: "rgba(50,50,50,0)",
formatter: " ",
borderWidth: 0,
textStyle: {
textShadowColor: "rgba(50,50,50,0)",
},
},
},
{
type: "pie",
radius: ["40%", "50%"],
center: ["30%", "35%"],
z: 10,
label: {
show: false,
},
data: [],
labelLine: {
show: false,
},
itemStyle: {
normal: {
borderRadius: "5",
borderWidth: 2,
borderType: "solid",
borderCap: "round",
borderJoin: "round",
borderColor: "#064258",
borderMiterLimit: "20",
color: function (params) {
return {
type: "linear",
x: 0,
y: 0,
x2: 1,
y2: 1,
colorStops: [
{
offset: 0,
color: colors[params.dataIndex], // 0% 处的颜色
},
{
offset: 1,
color: colors[params.dataIndex], // 100% 处的颜色
},
],
globalCoord: false, // 缺省为 false
};
},
},
},
},
],
};
export default options;

211
ruoyi-ui/src/views/JiHeExpressway/pages/control/manual/statistic/components/Timefiltering/index.vue

@ -1,46 +1,203 @@
<template>
<div class="Eventfiltering">
<div class="Eventfiltering-left" id="trafficIncidentsCharts"></div>
<div class="Eventfiltering-right"></div>
<InputSearch
class="search-box"
:formList="searchFormList"
@handleSearch="handleSearch"
/>
<div class="Eventfiltering-content">
<div class="Eventfiltering-left" ref="trafficIncidents"></div>
</div>
</div>
</template>
<script>
// import trafficIncidentsCharts from "./trafficIncidentsCharts.js";
// import * as echarts from "echarts";
// export default {
// name: "Eventfiltering",
// components: { trafficIncidentsCharts },
// data() {
// return {};
// },
// mounted() {
// var trafficIncidentsCharts = echarts.init(
// document.getElementById("trafficIncidentsCharts")
// );
// trafficIncidentsCharts.setOption(trafficIncidentsCharts);
// },
// methods: {},
// };
import InputSearch from "@screen/components/InputSearch/index.vue";
import trafficIncidentsCharts2 from "./trafficIncidentsCharts.js";
import { nonAutomaticWarningTimeType } from "@/api/manualWarning/index.js";
import * as echarts from "echarts";
import moment from "moment";
export default {
name: "Sitefiltering",
components: {
InputSearch,
},
props: {
name: {
type: String,
},
},
data() {
return {
trafficIncidents: null,
formData: {
type: "day",
warningTime: "",
},
searchFormList: [
{
label: "事件类型:",
key: "type",
type: "select",
default: "day",
options: {
clearable: true,
options: [
{
key: "day",
label: "天",
},
{
key: "month",
label: "月",
},
{
key: "year",
label: "年",
},
],
},
},
{
label: "日期:",
key: "warningTime",
required: true,
type: "datePicker",
options: {
valueFormat: "yyyy-MM-dd",
},
visible: (data) => {
if (data.type == "day") {
return true;
}
},
},
{
label: "日期:",
key: "warningTime",
required: true,
type: "datePicker",
options: {
type: "month",
valueFormat: "yyyy-MM-dd",
},
visible: (data) => {
if (data.type == "month") {
return true;
}
},
},
{
label: "日期:",
key: "warningTime",
required: true,
type: "datePicker",
options: {
type: "year",
valueFormat: "yyyy-MM-dd",
},
visible: (data) => {
if (data.type == "year") {
return true;
}
},
},
],
};
},
watch: {
name: {
handler(newValue, oldValue) {
console.log("newValue", newValue);
if (newValue == "third") {
this.getWarningCharts();
}
},
deep: true,
},
},
mounted() {},
methods: {
getWarningCharts() {
setTimeout(() => {
this.$nextTick(async () => {
(this.formData.warningTime =
moment(new Date()).format("YYYY-MM-DD") + " 00:00:01"),
(this.trafficIncidents = echarts.init(this.$refs.trafficIncidents));
this.trafficIncidents.setOption(trafficIncidentsCharts2);
await this.getNonAutomaticWarningTimeType(this.formData);
});
});
},
getNonAutomaticWarningTimeType(data) {
console.log("data", data);
return nonAutomaticWarningTimeType(data).then((res) => {
let newData = res.data;
let seriesData = [];
let xData = [];
let pieData = [];
let total = null;
newData.forEach((item) => {
seriesData.push(item.number);
total += item.number;
if (data.type === "day") {
xData.push(item.time);
pieData.push({
value: item.number,
name: item.time,
});
} else if (data.type === "month") {
xData.push(item.day);
pieData.push({
value: item.number,
name: item.day,
});
} else {
xData.push(item.month);
pieData.push({
value: item.number,
name: item.month,
});
}
});
trafficIncidentsCharts2.series[0].data = pieData;
trafficIncidentsCharts2.xAxis.data = xData;
this.trafficIncidents.setOption(trafficIncidentsCharts2);
});
},
handleSearch(value) {
value.warningTime = value.warningTime + " 00:00:01";
this.formData = { ...value };
this.getNonAutomaticWarningTimeType(this.formData);
},
},
};
</script>
<style lang="scss" scoped>
.Eventfiltering {
width: 99%;
height: 100%;
height: 94%;
margin: auto;
.search-box {
width: 402px !important;
float: right;
}
.Eventfiltering-content {
width: 100%;
height: 96%;
display: flex;
justify-content: space-between;
}
.Eventfiltering-left {
width: 60%;
width: 100%;
height: 100%;
background-color: #fff;
}
.Eventfiltering-right {
width: 40%;
height: 100%;
background-color: #fff;
}
}
</style>

95
ruoyi-ui/src/views/JiHeExpressway/pages/control/manual/statistic/components/Timefiltering/trafficIncidentsCharts.js

@ -0,0 +1,95 @@
var options = {
title: {
// text: '单位/%',
top: "0%",
left: "0%",
textStyle: {
fontSize: "10px",
fontWeight: 300,
color: "#B5C5D4",
opacity: 0.8,
},
},
tooltip: {
valueFormatter: function (value) {
return value + " 起";
},
},
grid: {
left: "50px",
right: "0%",
top: "50px",
bottom: "5%",
containLabel: true,
},
xAxis: {
type: "category",
data: [],
axisLine: {
lineStyle: {
color: "rgba(49, 217, 255, 0.8)",
},
},
axisTick: {
show: false,
},
axisLabel: {
color: "#fff",
fontSize: "18px",
},
},
yAxis: [
{
// type: 'value',
// min: function (value) {
// return value.min*0.9;
// },
name: "交通事件(起)",
nameTextStyle: {
color: "#fff",
fontSize: 18,
align: "center",
},
type: "value",
axisLine: {
show: false,
lineStyle: {
width: 1,
color: "#545454",
},
},
splitLine: {
lineStyle: {
color: "rgba(49, 217, 255, 0.5)",
},
},
axisTick: {
show: false,
},
axisLabel: {
color: "#fff",
fontSize: "18px",
formatter: (value) => {
return value;
},
},
},
],
series: [
{
// name: '审限内结案率',
data: [5, 10, 20, 30],
type: "pictorialBar",
symbol: "roundRect",
symbolRepeat: true,
symbolSize: [13, 4],
// symbolOffset: symbolOffset,
// barWidth:'40%',
itemStyle: {
color: "#20E7FF",
},
},
],
};
export default options;

15
ruoyi-ui/src/views/JiHeExpressway/pages/control/manual/statistic/index.vue

@ -1,14 +1,14 @@
<template>
<div class="comp_box">
<el-tabs class="footTabs" v-model="activeName">
<el-tabs class="footTabs" v-model="activeName" @tab-click="handleClick">
<el-tab-pane label="按事件分类" name="first">
<Eventfiltering />
<Eventfiltering name="first" />
</el-tab-pane>
<el-tab-pane label="按卡口" name="second">
<Sitefiltering />
<Sitefiltering :name="activeName" />
</el-tab-pane>
<el-tab-pane label="按日期" name="third">
<Timefiltering />
<Timefiltering :name="activeName" />
</el-tab-pane>
</el-tabs>
</div>
@ -38,10 +38,9 @@ export default {
},
},
methods: {
// changeTabs(tab, event) {
// console.log(tab, event);
// // this.activeName = value;
// },
handleClick(value) {
this.activeName = value.name;
},
},
mounted() {},
};

59
ruoyi-ui/src/views/JiHeExpressway/utils/enum.js

@ -920,6 +920,17 @@ export const planDeviceOptions = [
},
];
// 非机预警事件主类
export const warningType = {
1: "交通拥堵",
2: "行人",
4: "停车",
5: "违规驾驶",
6: "路障",
7: "道路施工",
99: "其他",
};
export const WarningSubclassList = Object.keys(WarningSubclass).reduce(
(prev, key) => {
prev[key] = Object.keys(WarningSubclass[key]).map((subKey) => {
@ -1012,3 +1023,51 @@ export const gzztMap = {
"03": "闪烁",
"04": "关闭",
};
// 非机预警事件
export const manualEarlyWarning = [
{
value: "1",
label: "拥堵",
},
{
value: "2",
label: "行人",
},
{
value: "6",
label: "抛洒物",
},
{
value: "5",
label: "变道",
},
{
value: "99",
label: "机占非",
},
{
value: "6",
label: "路障",
},
{
value: "1",
label: "施工",
},
{
value: "2",
label: "停车",
},
{
value: "6",
label: "压线",
},
{
value: "1",
label: "掉头",
},
{
value: "2",
label: "逆行",
},
];

Loading…
Cancel
Save