Browse Source

提交最新修改

wangqin
yyl 1 year ago
parent
commit
b3d2194dac
  1. 10
      ruoyi-ui/src/api/equipment/phone/phone.js
  2. 209
      ruoyi-ui/src/views/JiHeExpressway/pages/perception/trafficFlow/components/classification/assets/charts.js
  3. 24
      ruoyi-ui/src/views/JiHeExpressway/pages/perception/trafficFlow/components/classification/index.vue
  4. 6
      ruoyi-ui/src/views/JiHeExpressway/pages/perception/trafficFlow/components/congestion/assets/charts.js
  5. 4
      ruoyi-ui/src/views/JiHeExpressway/pages/perception/trafficFlow/components/congestion/index.vue
  6. 7
      ruoyi-ui/src/views/JiHeExpressway/pages/perception/trafficFlow/index.vue

10
ruoyi-ui/src/api/equipment/phone/phone.js

@ -1,10 +0,0 @@
import request from '@/utils/request'
export function onMessage(data) {
return request({
url: '/phoneSpk/onMessage',
method: 'post',
data: data
})
}

209
ruoyi-ui/src/views/JiHeExpressway/pages/perception/trafficFlow/components/classification/assets/charts.js

@ -1,144 +1,105 @@
import * as echarts from "echarts";
let color = ['#4278F8F9', 'transparent','#5372C4F9', 'transparent', '#0046FFF9', 'transparent','#FB9434F9', 'transparent','#854101F9', 'transparent', '#05E599F9', 'transparent','#219F73F9', 'transparent','#7CEDD5F9', 'transparent',];
let colorend = ['#4278F800', 'transparent', '#5372C400', 'transparent','#0046FF00', 'transparent', '#FB943400', 'transparent','#85410100', 'transparent','#05E59900', 'transparent','#219F7300', 'transparent','#7CEDD500', 'transparent',];
var options = {
title: {
x: "center",
top: 10,
},
tooltip: {
formatter: "{a} <br/>{b} : {c}%",
show:false,
trigger: 'item',
formatter: '{a} <br/>{b}: {c} ({d}%)'
},
legend: {
orient: 'vertical',
right: 10,
itemStyle:{
color:"#fff",
},
data: ['客1', '18-22℃', '18℃以下', '数据异常',
'阀开', '强开', '阀关', '强关', '损坏']
},
series: [
// 内圆
{
type: "pie",
radius: ["0", "40%"],
center: ["50%", "50%"],
hoverAnimation: false,
z: 3,
data: [
{
value: [20],
itemStyle: {
normal: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: "#205b78",
},
{
offset: 1,
color: "#205b7800",
},
]),
opacity: 1,
},
},
label: {
show: false,
},
},
],
labelLine: {
show: false,
name: '温度区间',
type: 'pie',
selectedMode: 'single',
radius: [0, '50%'],
label: {
normal: {
position: 'inner',
show: true,
color:'#fff',
fontSize:14,
formatter: '{b}\n{c}辆',
}
},
},
{
type: "pie",
radius: ["0", "2%"],
center: ["50%", "50%"],
hoverAnimation: false,
z: 7,
data: [
{
value: [20],
itemStyle: {
color:'#fff'
},
label: {
show: false,
},
},
{value: 2290, name: '客车\n'},
{value: 1020, name: '货车\n'},
{value: 3000, name: '专项车\n'},
],
labelLine: {
show: false,
},
color:['#708FFF','#FB9434','#219F73']
},
{
name: "wrap",
type: "gauge",
min: 0,
max: 100,
z:5,
splitNumber: 5,
axisLine: {
show: true,
lineStyle: {
width: 10,
shadowBlur: 0,
color: [
[0.6, "#FF5A62"],
[0.8, "#23E7B2"],
[1, "#0294FF"],
],
},
},
axisLabel: {
distance: -40,
textStyle: {
color: "#d0d0d0",
},
},
axisTick: {
show: true,
splitNumber: 1,
length: 3,
distance: 4,
lineStyle: {
color: "#d0d0d0",
},
},
splitLine: {
show: false,
name: '',
type: 'pie',
radius: ['60%', '70%'],
label: {
position: 'inner',
show: false
},
data: [
{value: 13456, name: '客1'},
{value: 2000, name: ''},
{value: 13456, name: '客2'},
{value: 2000, name: ''},
{value: 13456, name: '客3'},
{value: 2000, name: ''},
{value: 13456, name: '货1'},
{value: 2000, name: ''},
{value: 13456, name: '货2'},
{value: 2000, name: ''},
{value: 13456, name: '专1'},
{value: 2000, name: ''},
{value: 13456, name: '专2'},
{value: 2000, name: ''},
{value: 13456, name: '专3'},
{value: 2000, name: ''},
],
itemStyle: {
normal: {
color: "#24D8E7", //指针颜色
borderRadius: "5",
borderWidth:0,
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: color[params.dataIndex] // 0% 处的颜色
},
{
offset: 1,
color: colorend[params.dataIndex] // 100% 处的颜色
}
],
globalCoord: false // 缺省为 false
}
}
},
},
pointer: {
width: 4,
length: "80%",
color:['#009688','#63BA79','#FFB800','#F7ED46','#666666']
}
]
}
},data: [{
value: 63,
}],
detail: {
formatter: function (params) {
return (
"{number|" +
params +
"}{unit|" +
"辆}");
},
rich:{
number:{
fontSize: 20,
padding: 5,
},unit:{
fontSize: 12,
}
},
color: "#1de8af",
offsetCenter: ["0%", "100%"],
}
},
],
};
export default options;

24
ruoyi-ui/src/views/JiHeExpressway/pages/perception/trafficFlow/components/classification/index.vue

@ -2,7 +2,7 @@
<div class='classification'>
<WgtTitle :title="require('../../../widgets/title/assets/title10.png')"></WgtTitle>
<div class="board">
<div v-for="(item, index) in list" class="list">
<!-- <div v-for="(item, index) in list" class="list">
<div class="title">{{ item.label }}</div>
<div class="charts" :id="'busEchartBox'+index"></div>
<div class="detail">
@ -13,6 +13,9 @@
<div><span>{{ itm.perce }}</span>%</div>
</div>
</div>
</div> -->
<div id="classification" >
</div>
</div>
</div>
@ -53,12 +56,12 @@ export default {
mounted() {
setTimeout(() => {
this.$nextTick(() => {
var myChart0 = echarts.init(document.getElementById('busEchartBox0'));
var myChart0 = echarts.init(document.getElementById('classification'));
myChart0.setOption(chartsStatistics);
var myChart1 = echarts.init(document.getElementById('busEchartBox1'));
myChart1.setOption(chartsStatistics);
var myChart2 = echarts.init(document.getElementById('busEchartBox2'));
myChart2.setOption(chartsStatistics);
// var myChart1 = echarts.init(document.getElementById('busEchartBox1'));
// myChart1.setOption(chartsStatistics);
// var myChart2 = echarts.init(document.getElementById('busEchartBox2'));
// myChart2.setOption(chartsStatistics);
});
});
@ -78,7 +81,7 @@ export default {
height: 100%;
.board {
height: 300px;
height: 400px;
width: 100%;
padding: 0px 30px;
background: linear-gradient(180deg, rgba(6,66,88,0.2) 0%, #064258 100%);
@ -90,6 +93,13 @@ export default {
justify-content: space-between;
align-items: center;
#classification {
display: inline-flex;
width:100%;
height:350px;
}
.title {
background:url('./assets/bg.png') no-repeat;
background-size: 100% 100%;

6
ruoyi-ui/src/views/JiHeExpressway/pages/perception/trafficFlow/components/congestion/assets/charts.js

@ -2,7 +2,7 @@
/* 数据 */
let nameList = ["数据1", "数据2", "数据3", "数据4", "数据5", "数据6", "数据7", "数据8", "数据9", "数据10"]; // 类别
let valueList = [26, 62, 38, 26, 85, 46, 12, 12, 33, 60 ]; // 人数
var yList = [ "严重拥堵","中度拥堵","轻度拥堵","基本畅通","畅通"]
var yList = ["畅通","基本畅通","轻度拥堵","中度拥堵", "严重拥堵"]
/* 数据整合 */
let dataList = [];
nameList.map((item, index) => {
@ -119,14 +119,14 @@ var options = {
},
borderRadius: [4, 4, 0, 0]
},
barWidth: 15,
barWidth: 10,
label: {show:false,
}
},
{
name: "背景",
type: "bar",
barWidth: 15,
barWidth: 10,
barGap: "-100%",
data: [120,120,120,120,120,120,120,120,120,120],
itemStyle: {

4
ruoyi-ui/src/views/JiHeExpressway/pages/perception/trafficFlow/components/congestion/index.vue

@ -44,7 +44,7 @@ export default {
.congestion {
width: 100%;
.board{
height: 400px;
height: 300px;
width: 100%;
padding: 0px 70px;
background: linear-gradient(180deg, rgba(6,66,88,0.2) 0%, #064258 100%);
@ -59,7 +59,7 @@ export default {
}
}
.charts {
height: 330px;
height: 230px;
width: 100%;
}

7
ruoyi-ui/src/views/JiHeExpressway/pages/perception/trafficFlow/index.vue

@ -4,7 +4,9 @@
<Traffic class="head" />
<section class="content">
<!-- 在途车流量车型分类 -->
<Classification class="content-l" />
<!-- 全路段拥堵状况 -->
<Congestion class="content-l"></Congestion>
<!-- 畅通率 -->
<!-- <Unblocked class="content-m" /> -->
<!-- 全路车流量状况 -->
@ -14,8 +16,7 @@
<section class="foot">
<!-- 交通路段状态 -->
<Heightway class="foot-l" />
<!-- 全路段拥堵状况 -->
<Congestion class="foot-m"></Congestion>
<Classification class="foot-m" />
<!-- 路段交通量情况 -->
<Situation class="foot-r" />
</section>

Loading…
Cancel
Save