Browse Source

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

wangqin
hui 9 months ago
parent
commit
03f8cac458
  1. 6
      ruoyi-ui/src/views/JiHeExpressway/components/InputSearch/index.vue
  2. 20
      ruoyi-ui/src/views/JiHeExpressway/components/RoadStateCard/index.vue
  3. 6
      ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/AMapContainer/index.vue
  4. 20
      ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/RoadAndEvents/index.vue
  5. 57
      ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/RoadAndEvents/utils/buttonEvent.js
  6. 6
      ruoyi-ui/src/views/JiHeExpressway/pages/Home/index.vue
  7. 2
      ruoyi-ui/src/views/JiHeExpressway/pages/control/event/event/EventDetailDialog/data.js
  8. 2
      ruoyi-ui/src/views/JiHeExpressway/pages/control/event/event/FormEvent/PresetFormItems.js
  9. 2
      ruoyi-ui/src/views/JiHeExpressway/pages/control/event/event/FormEvent/data.js
  10. 11
      ruoyi-ui/src/views/JiHeExpressway/pages/control/event/event/FormEvent/index.vue
  11. 91
      ruoyi-ui/src/views/JiHeExpressway/pages/control/event/event/data.js
  12. 61
      ruoyi-ui/src/views/JiHeExpressway/pages/control/event/event/index.vue
  13. 6
      ruoyi-ui/src/views/JiHeExpressway/pages/perception/eventDetection/components/dailyDisposal/assets/charts.js
  14. 21
      ruoyi-ui/src/views/JiHeExpressway/pages/perception/eventDetection/components/dailyDisposal/index.vue

6
ruoyi-ui/src/views/JiHeExpressway/components/InputSearch/index.vue

@ -54,7 +54,11 @@ export default {
data() { data() {
return { return {
width: null, width: null,
popperOptions: {} popperOptions: {
popHideCallBack: () => {
// console.log("---")
}
}
} }
}, },
emit: [ emit: [

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

@ -2,7 +2,8 @@
<BorderRadiusImage class='RoadStateCard' borderRadius="2px" <BorderRadiusImage class='RoadStateCard' borderRadius="2px"
borderColor="linear-gradient(360deg, rgba(55, 231, 255, 0.3), rgba(55, 231, 255, 0))" borderWidth="2px"> borderColor="linear-gradient(360deg, rgba(55, 231, 255, 0.3), rgba(55, 231, 255, 0))" borderWidth="2px">
<div class="left"> <div class="left">
<img src="./test.png"> <img :src="(cardData.pictures ? cardData.pictures[0] : null) || require(`./test.png` )">
<!-- <img :src="require(`./test.png`)"> -->
</div> </div>
<div class="right"> <div class="right">
<div class="info"> <div class="info">
@ -12,10 +13,12 @@
</p> </p>
</div> </div>
<div class="controls"> <div class="controls">
<Button :style="{ background: firstBtnColor,width: '50%' }" @click.native="$emit('firstBtnClick', cardData.id)">{{ <Button :style="{ background: firstBtnColor, width: '50%' }"
@click.native="$emit('firstBtnClick', cardData.id)">{{
firstBtnText firstBtnText
}}</Button> }}</Button>
<Button v-if="cardData.state != 3" :style="{ background: lastBtnColor,width: '50%' }" @click.native="$emit('lastBtnClick', cardData.id)">{{ lastBtnText <Button v-if="cardData.state != 3" :style="{ background: lastBtnColor, width: '50%' }"
@click.native="$emit('lastBtnClick', cardData.id)">{{ lastBtnText
}}</Button> }}</Button>
</div> </div>
</div> </div>
@ -69,7 +72,7 @@ export default {
label: "位置" label: "位置"
}, },
{ {
key: "direction", key: "stringDirection",
label: "方向" label: "方向"
}, },
{ {
@ -79,6 +82,11 @@ export default {
]) ])
} }
}, },
data(){
return {
picUrl: './test.png'
}
},
emit: ['firstBtnClick', "lastBtnClick"], emit: ['firstBtnClick', "lastBtnClick"],
components: { components: {
Button, Button,
@ -123,11 +131,13 @@ export default {
flex: 1; flex: 1;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
>p { >p {
font-size: 14px; font-size: 14px;
color: #f4f4f4; color: #f4f4f4;
line-height: 24px; line-height: 24px;
&:first-child{
&:first-child {
color: #37E7FF; color: #37E7FF;
font-size: 18px; font-size: 18px;
font-weight: bold; font-weight: bold;

6
ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/AMapContainer/index.vue

@ -30,7 +30,7 @@ export default {
}, },
async mounted() { async mounted() {
// console.log(this.$refs.mapContainerRef); // console.log(this.$refs.mapContainerRef);
this.AMap = await loadAMap(); this.AMap = await loadAMap();//map load
if (!this.AMap) return; if (!this.AMap) return;
@ -53,9 +53,9 @@ export default {
Vue.prototype.mapIns = this.aMapIns; Vue.prototype.mapIns = this.aMapIns;
this.aMapIns.on("complete", () => { this.aMapIns.on("complete", () => { //map
this.loading = false; this.loading = false;
this.$emit("update:isGisCompleted", true);
// var polyline1 = new this.AMap.Polyline({ // var polyline1 = new this.AMap.Polyline({
// path: [], // path: [],
// strokeColor: "#67EBF7", // strokeColor: "#67EBF7",

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

@ -129,6 +129,22 @@ export default {
} }
} }
}, },
props: {
isGisCompleted: {
type: Boolean,
default: () => false
}
},
watch: {
isGisCompleted: {
handler(bool) {
if (!bool) return;
this.tabContentData.forEach(item => {
this.handleDeviceImmediate(item, true);
});
}
}
},
inject: ['getMap'], inject: ['getMap'],
created() { created() {
const defaultActive = 0; const defaultActive = 0;
@ -169,7 +185,7 @@ export default {
this.active = item.title; this.active = item.title;
this.tabContentData = item.children; this.tabContentData = item.children;
}, },
handleDeviceImmediate(item) { handleDeviceImmediate(item, isDefault) {
const key = getHandleDeviceType(item) || `${this.active}/${item.title}`; const key = getHandleDeviceType(item) || `${this.active}/${item.title}`;
const status = item.status; const status = item.status;
@ -180,7 +196,7 @@ export default {
if (!eventMap[`${key}${status ? "_close" : ""}`]) return this.$emit("onClickItem", item); if (!eventMap[`${key}${status ? "_close" : ""}`]) return this.$emit("onClickItem", item);
eventMap[`${key}${status ? "_close" : ""}`]?.call(this, item, this.filterData); eventMap[`${key}${status ? "_close" : ""}`]?.call(this, item, this.filterData, isDefault);
}, },
handleDevice: debounce(function (item) { handleDevice: debounce(function (item) {
this.handleDeviceImmediate(item); this.handleDeviceImmediate(item);

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

@ -84,11 +84,11 @@ let debounceNoneLngLatMessage = debounce(() => {
Message.warning("部分设备经纬度为空"); Message.warning("部分设备经纬度为空");
}); });
function resolveDataOptions(data, config, component) { function resolveDataOptions(data, config, component, isDefault) {
let lnglat = let lnglat =
data.longitude && data.latitude ? [data.longitude, data.latitude] : null; data.longitude && data.latitude ? [data.longitude, data.latitude] : null;
if (!lnglat) debounceNoneLngLatMessage(); if (!lnglat && !isDefault) debounceNoneLngLatMessage();
return { return {
weight: 1, weight: 1,
@ -113,15 +113,17 @@ function resolveDataOptions(data, config, component) {
export const eventMap = { export const eventMap = {
// 设备 需要在地图显示的 // 设备 需要在地图显示的
async "地图路测设备/map"(item, filterData) { async "地图路测设备/map"(item, filterData, isDefault) {
const config = DeviceForMap[item.title]; const config = DeviceForMap[item.title];
let loadingMessage;
const loadingMessage = Message.info({ if (!isDefault) {
loadingMessage = Message.info({
message: `${item.title}设备加载中...`, message: `${item.title}设备加载中...`,
duration: 0, duration: 0,
customClass: "loading-message", customClass: "loading-message",
iconClass: "el-icon-loading", iconClass: "el-icon-loading",
}); });
}
const data = await getDeviceList(config.deviceType, filterData) const data = await getDeviceList(config.deviceType, filterData)
.then(async (data) => { .then(async (data) => {
@ -130,10 +132,11 @@ export const eventMap = {
}) })
.catch(() => {}); .catch(() => {});
loadingMessage.close(); loadingMessage?.close();
if (!data) return; if (!data) return;
if (!data.length) return Message.warning(`没有${item.title}事件数据!`); if (!data.length && !isDefault)
return Message.warning(`没有${item.title}事件数据!`);
eventMap[`地图路测设备/map_close`](item); eventMap[`地图路测设备/map_close`](item);
@ -143,7 +146,7 @@ export const eventMap = {
}; };
let removeData = data.map((item) => let removeData = data.map((item) =>
resolveDataOptions.call(this, item, options, config.dialog) resolveDataOptions.call(this, item, options, config.dialog, isDefault)
); );
console.log( console.log(
"%c [ removeData ]-112-「buttonEvent.js」", "%c [ removeData ]-112-「buttonEvent.js」",
@ -161,14 +164,16 @@ export const eventMap = {
}, },
// 事件 需要在地图显示的 // 事件 需要在地图显示的
async "地图事件专题/map"(item) { async "地图事件专题/map"(item, filterData, isDefault) {
const loadingMessage = Message.info({ let loadingMessage;
if (!isDefault) {
loadingMessage = Message.info({
message: `${item.title}事件位置加载中...`, message: `${item.title}事件位置加载中...`,
duration: 0, duration: 0,
customClass: "loading-message", customClass: "loading-message",
iconClass: "el-icon-loading", iconClass: "el-icon-loading",
}); });
}
const data = await getEventTopicList(EventTopics[item.title]) const data = await getEventTopicList(EventTopics[item.title])
.then(async (data) => { .then(async (data) => {
await delay(600); await delay(600);
@ -176,11 +181,12 @@ export const eventMap = {
}) })
.catch(() => {}); .catch(() => {});
loadingMessage.close(); loadingMessage?.close();
if (!data) return; if (!data) return;
if (!data.length) return Message.warning(`没有${item.title}事件数据!`); if (!data.length && !isDefault)
return Message.warning(`没有${item.title}事件数据!`);
eventMap[`地图事件专题/map_close`](item); eventMap[`地图事件专题/map_close`](item);
@ -190,7 +196,13 @@ export const eventMap = {
}; };
let removeData = data.map((item) => let removeData = data.map((item) =>
resolveDataOptions.call(this, item, options, "TrafficIncidents") resolveDataOptions.call(
this,
item,
options,
"TrafficIncidents",
isDefault
)
); );
markerClusterIns.addData(removeData); markerClusterIns.addData(removeData);
@ -203,14 +215,16 @@ export const eventMap = {
}, },
// 感知事件 // 感知事件
async "事件专题/感知事件"(item) { async "事件专题/感知事件"(item, filterData, isDefault) {
const loadingMessage = Message.info({ let loadingMessage;
if (!isDefault) {
loadingMessage = Message.info({
message: `${item.title}位置加载中...`, message: `${item.title}位置加载中...`,
duration: 0, duration: 0,
customClass: "loading-message", customClass: "loading-message",
iconClass: "el-icon-loading", iconClass: "el-icon-loading",
}); });
}
const data = await getPerceiveEventList() const data = await getPerceiveEventList()
.then(async (data) => { .then(async (data) => {
await delay(600); await delay(600);
@ -218,11 +232,12 @@ export const eventMap = {
}) })
.catch(() => {}); .catch(() => {});
loadingMessage.close(); loadingMessage?.close();
if (!data) return; if (!data) return;
if (!data?.length) return Message.warning(`没有${item.title}数据!`); if (!data?.length && !isDefault)
return Message.warning(`没有${item.title}数据!`);
eventMap[`事件专题/感知事件_close`](item); eventMap[`事件专题/感知事件_close`](item);
@ -232,12 +247,12 @@ export const eventMap = {
}; };
let removeData = data.map((item) => let removeData = data.map((item) =>
resolveDataOptions.call(this, item, options, "PerceiveEvent") resolveDataOptions.call(this, item, options, "PerceiveEvent", isDefault)
); );
markerClusterIns.addData(removeData); markerClusterIns.addData(removeData);
loadingMessage.close(); loadingMessage?.close();
cacheRemoveFunc[`事件专题/${item.title}`] = () => cacheRemoveFunc[`事件专题/${item.title}`] = () =>
markerClusterIns.removeData(removeData); markerClusterIns.removeData(removeData);

6
ruoyi-ui/src/views/JiHeExpressway/pages/Home/index.vue

@ -1,6 +1,6 @@
<template> <template>
<div class='Home'> <div class='Home'>
<AMapContainer ref="AMapContainerRef" /> <AMapContainer ref="AMapContainerRef" @update:isGisCompleted="(data) => { this.isGisCompleted = data; }" />
<section class="content"> <section class="content">
<!-- 左侧 --> <!-- 左侧 -->
<div class="content-l"> <div class="content-l">
@ -8,7 +8,7 @@
<FocusedMonitoring class="card-menu" /> <FocusedMonitoring class="card-menu" />
<!-- --> <!-- -->
<RoadAndEvents ref="RoadAndEventsRef" class="content-l-b card-menu" /> <RoadAndEvents ref="RoadAndEventsRef" :isGisCompleted="isGisCompleted" class="content-l-b card-menu" />
</div> </div>
<!-- 右侧 --> <!-- 右侧 -->
@ -57,7 +57,7 @@ export default {
return { return {
isShowInfoBoard: false, isShowInfoBoard: false,
selectedDevice: null, selectedDevice: null,
isGisCompleted: false,
} }
}, },
provide() { provide() {

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

@ -82,7 +82,7 @@ export const formList = [
}, },
{ {
label: "事件描述:", label: "事件描述:",
key: "direction", key: "remark",
type: "input", type: "input",
gridColumn: 3, gridColumn: 3,
options: { options: {

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

@ -714,7 +714,7 @@ export const route = {
export const eventHappenTime = { export const eventHappenTime = {
label: "事件发生时间:", label: "事件发生时间:",
key: "startTime", key: "occurrenceTime",
required: true, required: true,
type: "datePicker", type: "datePicker",
options:{ options:{

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

@ -8,7 +8,7 @@ export const tabConfigList = [
list: [ list: [
{ ...PresetFormItems.callPolicePersonName, key: 'dcEventAccident.reporterName' }, { ...PresetFormItems.callPolicePersonName, key: 'dcEventAccident.reporterName' },
{ ...PresetFormItems.callPolicePersonPhone, key: 'dcEventAccident.reporterPhoneNumber' }, { ...PresetFormItems.callPolicePersonPhone, key: 'dcEventAccident.reporterPhoneNumber' },
PresetFormItems.trafficAccidentType, { ...PresetFormItems.trafficAccidentType, key: 'dcEventAccident.accidentType' },
PresetFormItems.eventLevel, PresetFormItems.eventLevel,
{ ...PresetFormItems.locationMode, key: 'dcEventAccident.locationType' }, { ...PresetFormItems.locationMode, key: 'dcEventAccident.locationType' },
PresetFormItems.freeway, PresetFormItems.freeway,

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

@ -154,10 +154,14 @@ export default {
if (this.index == 1) { if (this.index == 1) {
formData.dcEventVehicleAccident.laneOccupancy = formData.dcEventVehicleAccident.laneOccupancy.join(',') formData.dcEventVehicleAccident.laneOccupancy = formData.dcEventVehicleAccident.laneOccupancy.join(',')
} }
// console.log('formData',formData) if (this.index == 8) {
// return;
let stakeMark = formData.stakeMark;
let endStakeMark = formData.endStakeMark; let endStakeMark = formData.endStakeMark;
formData.dcEventAbnormalWeather.endStakeMark = (endStakeMark && endStakeMark.length > 0) ? ('K' + endStakeMark[0] + '+' + endStakeMark[1]) : '';
}
console.log('formData',formData)
return;
let stakeMark = formData.stakeMark;
request({ request({
url: `/dc/system/event`, url: `/dc/system/event`,
method: "post", method: "post",
@ -165,7 +169,6 @@ export default {
...formData, ...formData,
eventType: Number(this.index) + 1, eventType: Number(this.index) + 1,
stakeMark: (stakeMark && stakeMark.length > 0) ? ('K' + stakeMark[0] + '+' + stakeMark[1]) : '', stakeMark: (stakeMark && stakeMark.length > 0) ? ('K' + stakeMark[0] + '+' + stakeMark[1]) : '',
endStakeMark: (endStakeMark && endStakeMark.length > 0) ? ('K' + endStakeMark[0] + '+' + endStakeMark[1]) : '',
} }
}) })
.then((result) => { .then((result) => {

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

@ -23,8 +23,90 @@ export const tabMap = {
text: "处置记录", text: "处置记录",
}, },
}; };
export const gjSearchFormList = [
{
label: "事件来源:",
key: "warningSource",
type: "select",
options: {
options: [
{
key: "1",
label: "视频AI",
},
{
key: "2",
label: "雷达识别",
},
{
key: "3",
label: "锥桶",
},
{
key: "4",
label: "护栏碰撞",
},
{
key: "5",
label: "扫码报警",
},
{
key: "6",
label: "非机预警",
},
],
},
},
{
label: "方向:",
key: "direction",
type: "RadioGroup",
options: {
options: [
{
key: "1",
label: "上行",
},
{
key: "3",
label: "下行",
},
],
},
},
{
label: "时间范围:",
key: "daterange",
required: false,
type: "datePicker",
options: {
type: "daterange",
format: "yyyy-MM-dd HH:mm:ss",
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,
}),
];
export const searchFormList = [ export const gzSearchFormList = [
PresetFormItems.eventSources, PresetFormItems.eventSources,
PresetFormItems.eventType, PresetFormItems.eventType,
{ {
@ -55,8 +137,8 @@ export const searchFormList = [
type: "datePicker", type: "datePicker",
options: { options: {
type: "daterange", type: "daterange",
format: 'yyyy-MM-dd HH:mm:ss', format: "yyyy-MM-dd HH:mm:ss",
valueFormat: 'yyyy-MM-dd HH:mm:ss' valueFormat: "yyyy-MM-dd HH:mm:ss",
}, },
}, },
{ {
@ -77,6 +159,5 @@ export const searchFormList = [
}, },
label: "结束桩号:", label: "结束桩号:",
required: false, required: false,
} }),
)
]; ];

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

@ -57,7 +57,7 @@ import Pagination from "@screen/components/Pagination.vue";
import InputSearch from "@screen/components/InputSearch/index.vue"; import InputSearch from "@screen/components/InputSearch/index.vue";
import EventDetailDialog from "./EventDetailDialog/index"; import EventDetailDialog from "./EventDetailDialog/index";
import FormEvent from "./FormEvent/index"; import FormEvent from "./FormEvent/index";
import { tabMap, searchFormList } from "./data"; import { tabMap, gjSearchFormList, gzSearchFormList } from "./data";
import request from "@/utils/request"; import request from "@/utils/request";
import { Loading } from 'element-ui'; import { Loading } from 'element-ui';
@ -82,6 +82,30 @@ const warningSourceMapping = {
5: '扫码报警', 5: '扫码报警',
6: '非机预警', 6: '非机预警',
} }
const directionMapping = {
'1': '上行',
'2': '中',
'3': '下行'
}
const warningStateMapping = {
1: '上报',
2: '已完成',
3: '已终止',
4: '自动结束'
}
const warningTypeMapping = {
1: '交通拥堵',
2: '行人',
3: '非机动车',
4: '停车',
5: '倒车/逆行',
6: '烟火',
7: '撒落物8异常天气',
9: '护栏碰撞',
10: '交通事故',
11: '车辆故障',
99: '其它',
}
export default { export default {
name: "RoadNetworkMonitoring2", name: "RoadNetworkMonitoring2",
@ -98,7 +122,7 @@ export default {
return { return {
data: [], data: [],
total: 0, total: 0,
searchFormList, searchFormList: [],
activeName: "-1", activeName: "-1",
panels: [ panels: [
{ {
@ -129,6 +153,7 @@ export default {
}; };
}, },
created() { created() {
this.searchFormList = gjSearchFormList;
this.getData(); this.getData();
}, },
methods: { methods: {
@ -136,6 +161,7 @@ export default {
this.activeName = activeName; this.activeName = activeName;
this.searchData.eventState = activeName == "-1" ? null : activeName; this.searchData.eventState = activeName == "-1" ? null : activeName;
this.searchFormList = activeName == "-1" ? gjSearchFormList : gzSearchFormList;
this.getData(activeName); this.getData(activeName);
}, },
@ -149,8 +175,9 @@ export default {
}; };
}, },
getData() { getData() {
console.log('activeName', this.activeName)
if (this.activeName == '-1') { if (this.activeName === '-1') {
console.log('activeName22', this.activeName)
request({ request({
url: `/perceivedEvents/warning/perceivedEventsList`, url: `/perceivedEvents/warning/perceivedEventsList`,
method: "post", method: "post",
@ -160,6 +187,14 @@ export default {
if (result.code != 200) return Message.error(result?.msg); if (result.code != 200) return Message.error(result?.msg);
result.rows.forEach(it => { result.rows.forEach(it => {
it.stringEventSource = warningSourceMapping[it.warningSource]; it.stringEventSource = warningSourceMapping[it.warningSource];
it.stringDirection = directionMapping[it.direction] || it.direction;
it.startTime = it.warningTime;
if (it.otherConfig) {
let otherConfig = JSON.parse(it.otherConfig);
it.pictures = otherConfig.pictures || [];
}
}) })
this.data = result.rows; this.data = result.rows;
@ -255,18 +290,16 @@ export default {
data: { id } data: { id }
}).then((result) => { }).then((result) => {
if (result.code != 200) return Message.error(result?.msg); if (result.code != 200) return Message.error(result?.msg);
data = result.data; let data = result.data;
const directionMapping = {
1: '上行',
2: '中',
3: '下行'
}
data.stringEventSource = warningSourceMapping[data.warningSource];
data.stringDirection = directionMapping[data.direction] || data.direction;
data.stringEventSource = warningSourceMapping[data.warningSource];
data.direction = directionMapping[data.direction] || data.direction;
data.startTime = data.warningTime;
data.stringEventState = warningStateMapping[data.warningState];
data.stringEventType = warningTypeMapping[data.warningType];
this.detailDialogFormData = data; this.detailDialogFormData = data;
console.log('data', this.detailDialogFormData) // console.log('data', this.detailDialogFormData)
this.eventDetailDialogVisible = true; this.eventDetailDialogVisible = true;
}); });
@ -303,6 +336,8 @@ export default {
...this.searchData, ...this.searchData,
eventType: data.eventType, eventType: data.eventType,
eventSources: data.eventSources, eventSources: data.eventSources,
warningSource: data.warningSource,
direction: data.direction,
startTime: daterange && daterange.length > 0 ? daterange[0] : "", startTime: daterange && daterange.length > 0 ? daterange[0] : "",
endTime: daterange && daterange.length > 0 ? daterange[1] : "", endTime: daterange && daterange.length > 0 ? daterange[1] : "",
stakeMark: stakeMark, stakeMark: stakeMark,

6
ruoyi-ui/src/views/JiHeExpressway/pages/perception/eventDetection/components/dailyDisposal/assets/charts.js

@ -44,8 +44,12 @@ var options = {
} }
}, },
formatter: (params) => { formatter: (params) => {
let count = 0;
echartsData.forEach((it) => {
count += it.value;
})
let obj = echartsData.filter(it => { return it.name == params }) let obj = echartsData.filter(it => { return it.name == params })
return `{ast|${obj[0].name}} {bst|${Math.round(obj[0].value)}%}` return `{ast|${obj[0].name}} {bst|${Math.round(obj[0].value / count * 100)}%}`
}, },
data: echartsData?.map(x => x), data: echartsData?.map(x => x),
}, },

21
ruoyi-ui/src/views/JiHeExpressway/pages/perception/eventDetection/components/dailyDisposal/index.vue

@ -55,8 +55,14 @@ export default {
getWarningStateDay().then(res => { getWarningStateDay().then(res => {
if (res.code == 200) { if (res.code == 200) {
let data = res.data; let data = res.data;
if (data.lemgth > 0) { if (data.length > 0) {
window.echartsData = []; window.echartsData = [];
// let count = 0;
// data.forEach((it) => {
// count += it.number;
// })
for (let i = 0; i < data.length; i++) { for (let i = 0; i < data.length; i++) {
let it = data[i]; let it = data[i];
if (it.warningState == 1) { if (it.warningState == 1) {
@ -89,11 +95,6 @@ export default {
} }
let count = 0;
echartsData.forEach((it) => {
count += it.value;
})
chartsStatistics.legend.data = window.echartsData?.map(x => x); chartsStatistics.legend.data = window.echartsData?.map(x => x);
chartsStatistics.series[0].data = echartsData.map((item, index) => { chartsStatistics.series[0].data = echartsData.map((item, index) => {
@ -140,10 +141,10 @@ export default {
context.lineWidth = 1; // 线 context.lineWidth = 1; // 线
// //
drawRoundRect(context, 272, 50, 120, 24, 12, gr) drawRoundRect(context, 270, 36, 120, 24, 12, gr)
drawRoundRect(context, 272, 78, 120, 24, 12, gr) drawRoundRect(context, 270, 63, 120, 24, 12, gr)
drawRoundRect(context, 272, 106, 120, 24, 12, gr) drawRoundRect(context, 270, 90, 120, 24, 12, gr)
drawRoundRect(context, 270, 117, 120, 24, 12, gr)
}); });
}); });
}, },

Loading…
Cancel
Save