Browse Source

Merge branch 'develop' of http://39.106.31.193:9211/mengff/jihe-hs into develop

wangqin
刘朋 8 months ago
parent
commit
b743124178
  1. 6
      ruoyi-ui/package.json
  2. 10
      ruoyi-ui/src/assets/styles/JiHeExpressway.scss
  3. 34
      ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/PerceiveEvent/index.vue
  4. 21
      ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/InfoBoard/index.vue
  5. 18
      ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/RoadAndEvents/index.vue
  6. 4
      ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/RoadAndEvents/utils/buttonEvent.js
  7. 17
      ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/RoadAndEvents/utils/map.js
  8. 12
      ruoyi-ui/src/views/JiHeExpressway/pages/control/event/event/data.js
  9. 8
      ruoyi-ui/src/views/JiHeExpressway/pages/control/event/event/index.vue
  10. 2
      ruoyi-ui/src/views/JiHeExpressway/pages/perception/eventDetection/components/eventQuery/assets/charts.js
  11. 35
      ruoyi-ui/src/views/JiHeExpressway/pages/perception/eventDetection/components/eventQuery/index.vue
  12. 14
      ruoyi-ui/src/views/JiHeExpressway/pages/perception/eventDetection/components/typeAnalysis/assets/charts.js
  13. 323
      ruoyi-ui/src/views/JiHeExpressway/pages/perception/eventDetection/components/typeAnalysis/index.vue
  14. 2
      ruoyi-ui/src/views/JiHeExpressway/pages/perception/trafficFlow/components/flowstate/index.vue

6
ruoyi-ui/package.json

@ -74,6 +74,7 @@
"less-loader": "^7.2.1", "less-loader": "^7.2.1",
"lodash": "^4.17.21", "lodash": "^4.17.21",
"mathjs": "^11.7.0", "mathjs": "^11.7.0",
"mitt": "^3.0.1",
"moment": "^2.29.1", "moment": "^2.29.1",
"mpegts.js": "^1.7.3", "mpegts.js": "^1.7.3",
"normalize.css": "7.0.0", "normalize.css": "7.0.0",
@ -104,11 +105,10 @@
"vue-slick-carousel": "^1.0.6", "vue-slick-carousel": "^1.0.6",
"vue-splitpane": "1.0.4", "vue-splitpane": "1.0.4",
"vue-video-player": "^5.0.2", "vue-video-player": "^5.0.2",
"vuedraggable": "2.24.3", "vuedraggable": "^2.24.3",
"vuescroll": "^4.18.1", "vuescroll": "^4.18.1",
"vuex": "3.6.0", "vuex": "3.6.0",
"zrender": "^5.4.4", "zrender": "^5.4.4"
"mitt": "^3.0.1"
}, },
"devDependencies": { "devDependencies": {
"@vue/cli-plugin-babel": "4.4.6", "@vue/cli-plugin-babel": "4.4.6",

10
ruoyi-ui/src/assets/styles/JiHeExpressway.scss

@ -277,4 +277,14 @@
.el-time-spinner__item.active{ color: #fff !important;} .el-time-spinner__item.active{ color: #fff !important;}
} }
.el-picker-panel{
.today div a,.today div span{
color: #ff0 !important;
font-weight: bold !important;
}
.current div a.cell {
// background-color: #000 !important;
}
}
} }

34
ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/Dialogs/PerceiveEvent/index.vue

@ -3,35 +3,17 @@
<div class="PerceiveEvent"> <div class="PerceiveEvent">
<!-- <Video class="item-video" /> --> <!-- <Video class="item-video" /> -->
<div class="video-pic"> <div class="video-pic">
<Video <Video style="height: 100%; flex: 1" :showHeader="false" :url="dialogData.formData.videoList[0]"
style="height: 100%; flex: 1" videoType="mp4" />
:showHeader="false" <Carousel style="flex: 1; height: 100%" :pictures="dialogData.formData.pictures" />
:url="dialogData.formData.videoList[0]"
videoType="mp4"
/>
<Carousel
style="flex: 1; height: 100%"
:pictures="dialogData.formData.pictures"
/>
</div> </div>
<LineChart class="chart" /> <LineChart class="chart" />
<Form <Form class="form" v-loading="loading" v-model="data" ref="FormConfigRef" :formList="formList" column="1" />
class="form"
v-loading="loading"
v-model="data"
ref="FormConfigRef"
:formList="formList"
column="1"
/>
</div> </div>
<template #footer> <template #footer>
<Button>误报</Button> <Button @click.native="onDelete">误报</Button>
<Button <Button style="background-color: rgba(0, 179, 204, 0.3)" @click.native="obverseVisible = false">取消</Button>
style="background-color: rgba(0, 179, 204, 0.3)"
@click.native="obverseVisible = false"
>取消</Button
>
<Button @click.native="updateEvent" :loading="btnLoading">确定</Button> <Button @click.native="updateEvent" :loading="btnLoading">确定</Button>
</template> </template>
</Dialog> </Dialog>
@ -203,7 +185,7 @@ export default {
this.getDetails(); this.getDetails();
this.getVehicleTypeList(); this.getVehicleTypeList();
}, },
async mounted() {}, async mounted() { },
beforeDestroy() { beforeDestroy() {
clearInterval(this.interval); clearInterval(this.interval);
}, },
@ -255,7 +237,7 @@ export default {
}) })
); );
}) })
.catch((err) => {}); .catch((err) => { });
}, },
convertSecToHHmmss(sec) { convertSecToHHmmss(sec) {
let currentTime = moment.duration(sec, "seconds"); let currentTime = moment.duration(sec, "seconds");

21
ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/InfoBoard/index.vue

@ -61,20 +61,20 @@
<el-tabs v-model="activeTab" @tab-click="tabClickFn"> <el-tabs v-model="activeTab" @tab-click="tabClickFn">
<el-tab-pane label="详情信息" name="first"> <el-tab-pane label="详情信息" name="first">
<div class="show_bottom_tab_box"> <div class="show_bottom_tab_box">
<div class="deviceInfo"> <div class="deviceInfo title">
<div class="deviceInfo_l">设备名称</div> <div class="deviceInfo_l">设备名称:</div>
<div class="deviceInfo_r"> <div class="deviceInfo_r">
{{ selectedDevice.deviceName }} {{ selectedDevice.deviceName }}
</div> </div>
</div> </div>
<div class="deviceInfo"> <div class="deviceInfo">
<div class="deviceInfo_l">设备桩号</div> <div class="deviceInfo_l">设备桩号:</div>
<div class="deviceInfo_r"> <div class="deviceInfo_r">
{{ selectedDevice.stakeMark }} {{ selectedDevice.stakeMark }}
</div> </div>
</div> </div>
<div class="deviceInfo"> <div class="deviceInfo">
<div class="deviceInfo_l">屏幕像素</div> <div class="deviceInfo_l">屏幕像素:</div>
<div class="deviceInfo_r"> <div class="deviceInfo_r">
{{ {{
JSON.parse(selectedDevice.otherConfig).screenSize JSON.parse(selectedDevice.otherConfig).screenSize
@ -82,6 +82,12 @@
px px
</div> </div>
</div> </div>
<div class="deviceInfo">
<div class="deviceInfo_l">设备状态</div>
<div class="deviceInfo_r">
{{ selectedDevice.deviceState == 1 ? "在线" : "离线" }}
</div>
</div>
<!-- <div class="deviceInfo" v-for="item in tabDataInfoList" :key="item.id"> <!-- <div class="deviceInfo" v-for="item in tabDataInfoList" :key="item.id">
<div class="deviceInfo_l">{{ item.tit }}: </div> <div class="deviceInfo_l">{{ item.tit }}: </div>
<div class="deviceInfo_r" :style="{ 'color': item.col }"> {{ item.txt }}</div> <div class="deviceInfo_r" :style="{ 'color': item.col }"> {{ item.txt }}</div>
@ -763,11 +769,12 @@ export default {
} }
.deviceInfo { .deviceInfo {
width: 50%; width: 33.333%;
padding: 10px 0; padding: 10px 0;
display: flex; display: flex;
// flex-wrap: wrap; // flex-wrap: wrap;
align-items: stretch; align-items: center;
&.title{ width: 100%;}
} }
.show_bottom_tab_box { .show_bottom_tab_box {
@ -780,7 +787,7 @@ export default {
.deviceInfo_l { .deviceInfo_l {
color: #3de8ff; color: #3de8ff;
font-size: 14px; font-size: 14px;
width: 70px; width: 60px;
display: flex; display: flex;
flex-direction: row; flex-direction: row;
align-items: center; align-items: center;

18
ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/RoadAndEvents/index.vue

@ -96,7 +96,8 @@ export default {
layerData: [], layerData: [],
active: "事件专题", active: "事件专题",
tabContentData: [], tabContentData: [],
nowSelected: null, // title
nowSelectedCompleted: true, //
// - // -
dialogConfig: { dialogConfig: {
// 0 ControlCamera | 1 Camera // 0 ControlCamera | 1 Camera
@ -161,6 +162,7 @@ export default {
this.active = layerData[defaultActive].title; this.active = layerData[defaultActive].title;
this.minLayers = 3; this.minLayers = 3;
this.emitter.on("selectedCompleted", this.selectedCompletedHandle);
}, },
mounted() { mounted() {
// Layer // Layer
@ -176,7 +178,13 @@ export default {
getMinMapLayers(); getMinMapLayers();
}, },
beforeDestroy() {
this.emitter.off("selectedCompleted", this.selectedCompletedHandle);
},
methods: { methods: {
selectedCompletedHandle(item) {
if (this.nowSelected === item.title) this.nowSelectedCompleted = true;
},
setFilterDataNoAction(data) { //data setFilterDataNoAction(data) { //data
this.filterData = data; this.filterData = data;
}, },
@ -219,6 +227,10 @@ export default {
const status = item.status; const status = item.status;
console.log(item, "item");
if (!status) { this.nowSelected = item.title; this.nowSelectedCompleted = false; }
else if (this.nowSelected === item.title && this.nowSelectedCompleted === false) return;
item.status = item.status ? "" : "_active"; item.status = item.status ? "" : "_active";
console.log("%c [ key ]-102-「index.vue」", "font-size:15px; background:#9d63e9; color:#e1a7ff;", key); console.log("%c [ key ]-102-「index.vue」", "font-size:15px; background:#9d63e9; color:#e1a7ff;", key);
@ -228,8 +240,8 @@ export default {
await eventMap[`${key}${status ? "_close" : ""}`]?.call(this, item, this.filterData, isDefault, this.cb); await eventMap[`${key}${status ? "_close" : ""}`]?.call(this, item, this.filterData, isDefault, this.cb);
}, },
handleDevice: debounce(function (item) { handleDevice: debounce(async function (item) {
this.handleDeviceImmediate(item); await this.handleDeviceImmediate(item);
}, 360), }, 360),
handleCleared() { handleCleared() {
const { mapIns } = this.getMap(); const { mapIns } = this.getMap();

4
ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/RoadAndEvents/utils/buttonEvent.js

@ -166,8 +166,8 @@ export const eventMap = {
removeData removeData
); );
addDataPreHandle(removeData); addDataPreHandle(removeData);
markerClusterIns.addData(removeData, isDefault); markerClusterIns.addData(removeData, isDefault);
this.emitter.emit("selectedCompleted", item);
cacheRemoveFunc[`地图路测设备/${item.title}`] = () => { cacheRemoveFunc[`地图路测设备/${item.title}`] = () => {
cbCall(); cbCall();
@ -225,6 +225,7 @@ export const eventMap = {
); );
addDataPreHandle(removeData); addDataPreHandle(removeData);
markerClusterIns.addData(removeData, isDefault); markerClusterIns.addData(removeData, isDefault);
this.emitter.emit("selectedCompleted", item);
cacheRemoveFunc[`地图事件专题/${item.title}`] = () => { cacheRemoveFunc[`地图事件专题/${item.title}`] = () => {
cbCall(); cbCall();
@ -275,6 +276,7 @@ export const eventMap = {
); );
addDataPreHandle(removeData); addDataPreHandle(removeData);
markerClusterIns.addData(removeData, isDefault); markerClusterIns.addData(removeData, isDefault);
this.emitter.emit("selectedCompleted", item);
loadingMessage?.close(); loadingMessage?.close();

17
ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/RoadAndEvents/utils/map.js

@ -343,9 +343,10 @@ export class MarkerCluster {
const findIndex = this.data.findIndex( const findIndex = this.data.findIndex(
(removeData) => removeData === item (removeData) => removeData === item
); );
let { stakeMark } = item.extData; let { stakeMark, direction } = item.extData;
stakeMark = upperFirst(stakeMark); //统一格式 大写K stakeMark = upperFirst(stakeMark); //统一格式 大写K
const existNode = graphInstance.getCellById(stakeMark); const id = `${stakeMark}_${direction || ""}`;
const existNode = graphInstance.getCellById(id);
const lnglat = item.lnglat; const lnglat = item.lnglat;
if (lnglat) { if (lnglat) {
const { lat, lng } = getLatAndLng(lnglat); const { lat, lng } = getLatAndLng(lnglat);
@ -357,10 +358,10 @@ export class MarkerCluster {
window.graphInstance.removeNode(existNode.id); window.graphInstance.removeNode(existNode.id);
else { else {
//更新节点 //更新节点
const updateNode = graphInstance.getCellById(stakeMark); const updateNode = graphInstance.getCellById(id);
updateNode.updateData(getDataConf(lngLatArr, item.extData)); updateNode.updateData(getDataConf(lngLatArr, item.extData));
} }
} else window.graphInstance.removeNode(stakeMark); } else window.graphInstance.removeNode(id);
} }
} }
if (findIndex > -1) this.data.splice(findIndex, 1); if (findIndex > -1) this.data.splice(findIndex, 1);
@ -482,9 +483,10 @@ export function marksAddInGraph(data) {
export function addInGraphHandle(data) { export function addInGraphHandle(data) {
const graphInstance = window.graphInstance; const graphInstance = window.graphInstance;
const extData = data[0].extData; const extData = data[0].extData;
console.log(extData, "extData");
const { item: eventItem } = data[0].config; const { item: eventItem } = data[0].config;
if (eventItem.id.match("./事件专题")) { if (eventItem.id.match("./事件专题")) {
let { stakeMark, lang } = extData; let { stakeMark, lang, direction } = extData;
stakeMark = upperFirst(stakeMark); //统一格式 大写K stakeMark = upperFirst(stakeMark); //统一格式 大写K
const distance = const distance =
(Number( (Number(
@ -496,7 +498,8 @@ export function addInGraphHandle(data) {
const node = { shape: "custom-html", effect: ["data"] }; const node = { shape: "custom-html", effect: ["data"] };
node.data = getDataConf(data, extData); node.data = getDataConf(data, extData);
const existNode = graphInstance.getCellById(stakeMark); const id = `${stakeMark}_${direction || ""}`;
const existNode = graphInstance.getCellById(id);
if (existNode) { if (existNode) {
existNode.updateData(node.data); existNode.updateData(node.data);
} else { } else {
@ -508,7 +511,7 @@ export function addInGraphHandle(data) {
height: 20, height: 20,
...node, ...node,
zIndex: 1, zIndex: 1,
id: stakeMark, id: id,
}); });
// }, 0); // }, 0);
} }

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

@ -80,14 +80,14 @@ export const gjSearchFormList = [
key: "5", key: "5",
label: "扫码报警", label: "扫码报警",
}, },
{
key: "6",
label: "非机预警",
},
// { // {
// key: "7", // key: "6",
// label: "气象监测器", // label: "非机预警",
// }, // },
{
key: "7",
label: "气象监测器",
},
], ],
}, },
}, },

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

@ -238,7 +238,13 @@ export default {
background: "#00000052", background: "#00000052",
text: "文件正在下载...", text: "文件正在下载...",
}); });
request.post(url, {}, { headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, responseType: 'blob' }) // request.post(url, {}, { headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, responseType: 'blob' })
request({
url: url,//
method: "post",
data: { ...this.searchData, warningState: 1 },
responseType: 'blob'
})
.then((res) => { .then((res) => {
console.log(res); console.log(res);
const url = window.URL.createObjectURL(new Blob([res])); const url = window.URL.createObjectURL(new Blob([res]));

2
ruoyi-ui/src/views/JiHeExpressway/pages/perception/eventDetection/components/eventQuery/assets/charts.js

@ -62,7 +62,7 @@ var options = {
grid: { grid: {
top: "15%", //上边距 top: "15%", //上边距
right: "5px", //右边距 right: "5px", //右边距
left: "0", //左边距 left: "10px", //左边距
bottom: "2%", //下边距 bottom: "2%", //下边距
containLabel: true, containLabel: true,
}, },

35
ruoyi-ui/src/views/JiHeExpressway/pages/perception/eventDetection/components/eventQuery/index.vue

@ -88,7 +88,7 @@
<div class="comp_body"> <div class="comp_body">
<div> <div>
<WgtTitle :title="'感知事件趋势分析'"></WgtTitle> <WgtTitle :title="'感知事件趋势分析'"></WgtTitle>
<div class="unit_con"> <div class="unit_con unit_con_01">
<Empty <Empty
v-if="!chart1List || chart1List.length <= 0" v-if="!chart1List || chart1List.length <= 0"
text="暂无数据..." text="暂无数据..."
@ -108,15 +108,14 @@
></Empty> ></Empty>
<div <div
ref="chart2" ref="chart2"
class="chart_div" class="chart_div keep-ratio"
style="width: 540px; height: 270px"
></div> ></div>
</div> </div>
</div> </div>
<div> <div>
<WgtTitle :title="'桩号范围内事件分析趋势'"></WgtTitle> <WgtTitle :title="'桩号范围内事件分析趋势'"></WgtTitle>
<div class="unit_con"> <div class="unit_con unit_con_03">
<Empty <Empty
v-show="!chart3List || chart3List.length <= 0" v-show="!chart3List || chart3List.length <= 0"
text="暂无数据..." text="暂无数据..."
@ -695,21 +694,35 @@ export default {
flex: 1; flex: 1;
height: 0; height: 0;
padding: 0; padding: 0;
margin: 95px 20px 30px;
position: relative; position: relative;
// &.unit_con_02{ margin: 105px 0px 20px; }
display: flex; display: flex;
align-items: center; align-items: center;
&.unit_con_01{
margin: 100px 20px 0;
.chart_div {
width: 100%;
height: 240px;
}
}
&.unit_con_02{
margin: 70px 20px 0;
.chart_div {
width: 100%;
height: 290px;
}
}
&.unit_con_03{
margin: 70px 20px 0;
.chart_div {
width: 100%;
height: 280px;
}
}
} }
.empty { .empty {
position: absolute; position: absolute;
} }
.chart_div {
width: 100%;
height: 200px;
}
} }
.condition { .condition {

14
ruoyi-ui/src/views/JiHeExpressway/pages/perception/eventDetection/components/typeAnalysis/assets/charts.js

@ -14,13 +14,18 @@ window.colorList = [
"#FFDD69", "#FFDD69",
"#F6A73C", "#F6A73C",
"#7390FD", "#7390FD",
"#2967EA",
"#1DA7FF",
"#219f73",
"#7cedd5",
]; ];
window.colorList1 = ["#61D8FF", "#FFB905", "#6AE0BC"]; // window.colorList1 = ["#61D8FF", "#FFB905", "#6AE0BC"];
var options = { var options = {
color: colorList, color: colorList,
legend: { legend: {
show: false,
width: "500px", width: "500px",
height: "160px", height: "160px",
orient: "vertical", orient: "vertical",
@ -87,8 +92,10 @@ var options = {
{ {
name: "", name: "",
type: "pie", type: "pie",
// radius: "70%",
// center: ["30%", "50%"],
radius: "70%", radius: "70%",
center: ["30%", "50%"], center: ["40%", "50%"],
clockwise: false, clockwise: false,
// roseType: "area", // roseType: "area",
startAngle1: 180, startAngle1: 180,
@ -133,7 +140,8 @@ var options = {
hoverAnimation: false, hoverAnimation: false,
emphasis: { scale: false }, emphasis: { scale: false },
clockwise: false, clockwise: false,
center: ["30%", "50%"], // center: ["30%", "50%"],
center: ["40%", "50%"],
// roseType: "area", // roseType: "area",
label: { label: {
show: false, show: false,

323
ruoyi-ui/src/views/JiHeExpressway/pages/perception/eventDetection/components/typeAnalysis/index.vue

@ -3,6 +3,21 @@
<WgtTitle :title="'感知事件类型分析'"></WgtTitle> <WgtTitle :title="'感知事件类型分析'"></WgtTitle>
<div class="board fl-1"> <div class="board fl-1">
<div class="charts keep-ratio" id="typeAnalysis"></div> <div class="charts keep-ratio" id="typeAnalysis"></div>
<div class="legend-box">
<el-carousel height="200px" direction="vertical">
<el-carousel-item
v-for="(item, index) in dataList"
:key="index"
class="legend-item"
>
<div v-for="(items, index) in item" class="legend-items">
<span class="legend-name">{{ items.name }}</span>
<span class="legend-num">{{ items.value }} </span>
<span class="legend-percert">{{ items.percert }}%</span>
</div>
</el-carousel-item>
</el-carousel>
</div>
</div> </div>
</div> </div>
</template> </template>
@ -13,33 +28,33 @@ import * as echarts from "echarts";
import chartsStatistics from "./assets/charts"; import chartsStatistics from "./assets/charts";
import { getWarningTypeDay } from "../../../../../../../api/event/perceiveEvent"; import { getWarningTypeDay } from "../../../../../../../api/event/perceiveEvent";
const drawRoundRect = (ctx, x, y, width, height, radius, gr) => { // const drawRoundRect = (ctx, x, y, width, height, radius, gr) => {
// ctx, x, y, , , // // ctx, x, y, , ,
ctx.beginPath(); // ctx.beginPath();
ctx.fillStyle = gr; // ctx.fillStyle = gr;
ctx.arc(x + radius, y + radius, radius, Math.PI, (Math.PI * 3) / 2); // ctx.arc(x + radius, y + radius, radius, Math.PI, (Math.PI * 3) / 2);
ctx.lineTo(width - radius + x, y); // ctx.lineTo(width - radius + x, y);
ctx.arc( // ctx.arc(
width - radius + x, // width - radius + x,
radius + y, // radius + y,
radius, // radius,
(Math.PI * 3) / 2, // (Math.PI * 3) / 2,
Math.PI * 2 // Math.PI * 2
); // );
ctx.lineTo(width + x, height + y - radius); // ctx.lineTo(width + x, height + y - radius);
ctx.arc( // ctx.arc(
width - radius + x, // width - radius + x,
height - radius + y, // height - radius + y,
radius, // radius,
0, // 0,
(Math.PI * 1) / 2 // (Math.PI * 1) / 2
); // );
ctx.lineTo(radius + x, height + y); // ctx.lineTo(radius + x, height + y);
ctx.arc(radius + x, height - radius + y, radius, (Math.PI * 1) / 2, Math.PI); // ctx.arc(radius + x, height - radius + y, radius, (Math.PI * 1) / 2, Math.PI);
ctx.closePath(); // ctx.closePath();
//ctx.stroke(); // //ctx.stroke();
ctx.fill(); // ctx.fill();
}; // };
export default { export default {
name: "TypeAnalysis", name: "TypeAnalysis",
@ -47,9 +62,9 @@ export default {
WgtTitle, WgtTitle,
}, },
data() { data() {
return {}; return { dataList: [] };
}, },
created() { }, created() {},
methods: {}, methods: {},
mounted() { mounted() {
setTimeout(() => { setTimeout(() => {
@ -57,10 +72,8 @@ export default {
var myChart = echarts.init(document.getElementById("typeAnalysis")); var myChart = echarts.init(document.getElementById("typeAnalysis"));
getWarningTypeDay().then((res) => { getWarningTypeDay().then((res) => {
console.log(res);
if (res.code == 200) { if (res.code == 200) {
let data = res.data; let data = res.data;
console.log("===================22", data);
typeAnalysisData = [ typeAnalysisData = [
{ {
name: "交通拥堵", name: "交通拥堵",
@ -123,15 +136,31 @@ export default {
value: 0, value: 0,
}, },
]; ];
let total = null;
data.forEach((item, index) => {
total += item.number;
});
data.forEach((item, index) => { data.forEach((item, index) => {
typeAnalysisData.forEach((r) => { typeAnalysisData.forEach((r) => {
if (item.warningType == r.warningType) { if (item.warningType == r.warningType) {
r.value += item.number; r.value = item.number;
this.dataList.push({
name: r.name,
value: r.value,
percert:
total == 0 ? 0 : ((r.value / total) * 100).toFixed(2),
});
} }
}); });
// drawRoundRect(context, 250, 8 + index * 28, 120, 24, 12, gr); // drawRoundRect(context, 250, 8 + index * 28, 120, 24, 12, gr);
}); });
const list = this.dataList.reduce((acc, curr, index) => {
if (index % 6 === 0) acc.push([]);
acc[Math.floor(index / 6)].push(curr);
return acc;
}, []);
this.dataList = list;
chartsStatistics.legend.data = typeAnalysisData?.map((x) => x.name); chartsStatistics.legend.data = typeAnalysisData?.map((x) => x.name);
chartsStatistics.series[0].data = typeAnalysisData.map( chartsStatistics.series[0].data = typeAnalysisData.map(
(item, index) => { (item, index) => {
@ -158,29 +187,29 @@ export default {
myChart.setOption(chartsStatistics); myChart.setOption(chartsStatistics);
}); });
const domMap = document.getElementById("typeAnalysis"); // const domMap = document.getElementById("typeAnalysis");
let parentDiv = domMap.firstChild; // let parentDiv = domMap.firstChild;
// canvas // // canvas
let canvas = document.createElement("canvas"); // let canvas = document.createElement("canvas");
canvas.width = parentDiv.offsetWidth; // canvas.width = parentDiv.offsetWidth;
canvas.height = parentDiv.offsetHeight; // canvas.height = parentDiv.offsetHeight;
parentDiv.appendChild(canvas); // parentDiv.appendChild(canvas);
const context = canvas.getContext("2d"); // const context = canvas.getContext("2d");
// // //
var gr = context.createLinearGradient(230, 0, 360, 0); // var gr = context.createLinearGradient(230, 0, 360, 0);
// // //
gr.addColorStop(1, "rgba(92,197,255,0)"); // gr.addColorStop(1, "rgba(92,197,255,0)");
gr.addColorStop(0, "rgba(92,197,255,0.5)"); // gr.addColorStop(0, "rgba(92,197,255,0.5)");
context.lineWidth = 1; // 线 // context.lineWidth = 1; // 线
// // //
drawRoundRect(context, 228, 8, 280, 24, 12, gr); // drawRoundRect(context, 228, 8, 280, 24, 12, gr);
drawRoundRect(context, 228, 36, 280, 24, 12, gr); // drawRoundRect(context, 228, 36, 280, 24, 12, gr);
drawRoundRect(context, 228, 64, 280, 24, 12, gr); // drawRoundRect(context, 228, 64, 280, 24, 12, gr);
drawRoundRect(context, 228, 92, 280, 24, 12, gr); // drawRoundRect(context, 228, 92, 280, 24, 12, gr);
drawRoundRect(context, 228, 120, 280, 24, 12, gr); // drawRoundRect(context, 228, 120, 280, 24, 12, gr);
}); });
}); });
}, },
@ -191,23 +220,199 @@ export default {
.congestion { .congestion {
.board { .board {
padding: 0px 20px; padding: 0px 20px;
background: linear-gradient(180deg, background: linear-gradient(
rgba(6, 66, 88, 0.2) 0%, 180deg,
#06425888 100%); rgba(6, 66, 88, 0.2) 0%,
#06425888 100%
);
border-radius: 5px 5px 5px 5px; border-radius: 5px 5px 5px 5px;
opacity: 1; opacity: 1;
border: 1px solid; border: 1px solid;
border-image: linear-gradient(360deg, border-image: linear-gradient(
360deg,
rgba(55, 231, 255, 0.1), rgba(55, 231, 255, 0.1),
rgba(55, 231, 255, 0)) 1 1; rgba(55, 231, 255, 0)
)
1 1;
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
.legend-box {
width: 60%;
margin: auto;
margin-top: 20px;
height: 185px;
overflow: hidden;
.legend-item {
width: 100%;
/**
单个动画循环样式 勿删
*/
// height: 30px;
// display: flex;
// justify-content: space-between;
// align-items: center;
// animation: 5s infinite roll;
// position: relative;
// &::before {
// // position: absolute;
// content: "";
// width: 8px;
// height: 8px;
// left: 0px;
// border-radius: 50%;
// background: #37e7ff;
// }
.legend-items {
width: 100%;
height: 24px;
display: flex;
justify-content: space-between;
align-items: center;
padding-left: 20px;
background: linear-gradient(to right, #327799 0%, #0d3443 60%);
border-top-left-radius: 25px;
border-bottom-left-radius: 25px;
margin-bottom: 5px;
&::before {
// position: absolute;
content: "";
width: 8px;
height: 8px;
left: 0px;
border-radius: 50%;
background: #37e7ff;
}
}
.legend-name {
width: 60px;
margin-left: 10px;
font-size: 12px;
}
.legend-num,
.legend-percert {
width: 50px;
display: flex;
justify-content: center;
align-items: center;
font-size: 12px;
color: #37e7ff;
font-weight: bold;
}
}
.legend-item:nth-child(1) {
.legend-items:nth-child(1) {
&::before {
background: #019aff;
}
}
.legend-items:nth-child(2) {
&::before {
background: #3cc3f0;
}
}
.legend-items:nth-child(3) {
&::before {
background: #51d5ad;
}
}
.legend-items:nth-child(4) {
&::before {
background: #ffdd69;
}
}
.legend-items:nth-child(5) {
&::before {
background: #f6a73c;
}
}
.legend-items:nth-child(6) {
&::before {
background: #7390fd;
}
}
}
.legend-item:nth-child(2) {
.legend-items:nth-child(1) {
&::before {
background: #2967ea;
}
}
.legend-items:nth-child(2) {
&::before {
background: #1da7ff;
}
}
.legend-items:nth-child(3) {
&::before {
background: #219f73;
}
}
.legend-items:nth-child(4) {
&::before {
background: #7cedd5;
}
}
}
/**
单个动画循环样式 勿删
*/
// .legend-item:nth-child(1) {
// &::before {
// background: #68f4dd;
// }
// }
// .legend-item:nth-child(2) {
// &::before {
// background: #1785c0;
// }
// }
// .legend-item:nth-child(3) {
// &::before {
// background: #476dbc;
// }
// }
// .legend-item:nth-child(4) {
// &::before {
// background: #b55233;
// }
// }
// .legend-item:nth-child(5) {
// &::before {
// background: #b0862c;
// }
// }
// .legend-item:nth-child(6) {
// &::before {
// background: #35ad6b;
// }
// }
// .legend-item:nth-child(7) {
// &::before {
// background: #219f73;
// }
// }
// .legend-item:nth-child(8) {
// &::before {
// background: #7cedd5;
// }
// }
// .legend-item:nth-child(9) {
// &::before {
// background: #68f4dd;
// }
// }
}
} }
} }
::v-deep .el-carousel__indicators--vertical {
display: none;
}
.charts { .charts {
height: 180px; height: 180px;
width: 100%; width: 50%;
} }
</style> </style>

2
ruoyi-ui/src/views/JiHeExpressway/pages/perception/trafficFlow/components/flowstate/index.vue

@ -67,7 +67,7 @@ export default {
.tag1 { .tag1 {
position: absolute; position: absolute;
margin-top: -174px; margin-top: -174px;
margin-left: 80px; margin-left: 120px;
font-size: 12px; font-size: 12px;
} }

Loading…
Cancel
Save