From 1e34ddcbe60b5b5456edc923e5e6c6fc2620d8db Mon Sep 17 00:00:00 2001 From: zhoule Date: Sun, 18 Feb 2024 10:51:36 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E6=84=9F=E7=9F=A5=E4=BA=8B=E4=BB=B6?= =?UTF-8?q?=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/dailyDisposal/assets/charts.js | 6 +++++- .../components/dailyDisposal/index.vue | 21 ++++++++++--------- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/ruoyi-ui/src/views/JiHeExpressway/pages/perception/eventDetection/components/dailyDisposal/assets/charts.js b/ruoyi-ui/src/views/JiHeExpressway/pages/perception/eventDetection/components/dailyDisposal/assets/charts.js index cf553c78..2fd64d5b 100644 --- a/ruoyi-ui/src/views/JiHeExpressway/pages/perception/eventDetection/components/dailyDisposal/assets/charts.js +++ b/ruoyi-ui/src/views/JiHeExpressway/pages/perception/eventDetection/components/dailyDisposal/assets/charts.js @@ -44,8 +44,12 @@ var options = { } }, formatter: (params) => { + let count = 0; + echartsData.forEach((it) => { + count += it.value; + }) 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), }, diff --git a/ruoyi-ui/src/views/JiHeExpressway/pages/perception/eventDetection/components/dailyDisposal/index.vue b/ruoyi-ui/src/views/JiHeExpressway/pages/perception/eventDetection/components/dailyDisposal/index.vue index e7552bb8..d3e46290 100644 --- a/ruoyi-ui/src/views/JiHeExpressway/pages/perception/eventDetection/components/dailyDisposal/index.vue +++ b/ruoyi-ui/src/views/JiHeExpressway/pages/perception/eventDetection/components/dailyDisposal/index.vue @@ -55,8 +55,14 @@ export default { getWarningStateDay().then(res => { if (res.code == 200) { let data = res.data; - if (data.lemgth > 0) { + if (data.length > 0) { window.echartsData = []; + + // let count = 0; + // data.forEach((it) => { + // count += it.number; + // }) + for (let i = 0; i < data.length; i++) { let it = data[i]; 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.series[0].data = echartsData.map((item, index) => { @@ -140,10 +141,10 @@ export default { context.lineWidth = 1; // 设置线段宽度 // 绘制圆角矩形 - drawRoundRect(context, 272, 50, 120, 24, 12, gr) - drawRoundRect(context, 272, 78, 120, 24, 12, gr) - drawRoundRect(context, 272, 106, 120, 24, 12, gr) - + drawRoundRect(context, 270, 36, 120, 24, 12, gr) + drawRoundRect(context, 270, 63, 120, 24, 12, gr) + drawRoundRect(context, 270, 90, 120, 24, 12, gr) + drawRoundRect(context, 270, 117, 120, 24, 12, gr) }); }); }, From 48558ab68d976c4cd05c000661dc6a902c4a5f9a Mon Sep 17 00:00:00 2001 From: zhoule Date: Sun, 18 Feb 2024 10:51:54 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E5=91=8A=E8=AD=A6=E4=BA=8B=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/RoadStateCard/index.vue | 26 ++++-- .../event/event/EventDetailDialog/data.js | 2 +- .../pages/control/event/event/data.js | 91 ++++++++++++++++++- .../pages/control/event/event/index.vue | 54 ++++++++--- 4 files changed, 148 insertions(+), 25 deletions(-) diff --git a/ruoyi-ui/src/views/JiHeExpressway/components/RoadStateCard/index.vue b/ruoyi-ui/src/views/JiHeExpressway/components/RoadStateCard/index.vue index 9529707f..4fd613a6 100644 --- a/ruoyi-ui/src/views/JiHeExpressway/components/RoadStateCard/index.vue +++ b/ruoyi-ui/src/views/JiHeExpressway/components/RoadStateCard/index.vue @@ -2,7 +2,8 @@
- + +
@@ -12,11 +13,13 @@

- - + +
@@ -69,7 +72,7 @@ export default { label: "位置" }, { - key: "direction", + key: "stringDirection", label: "方向" }, { @@ -79,6 +82,11 @@ export default { ]) } }, + data(){ + return { + picUrl: './test.png' + } + }, emit: ['firstBtnClick', "lastBtnClick"], components: { Button, @@ -123,11 +131,13 @@ export default { flex: 1; display: flex; flex-direction: column; + >p { font-size: 14px; color: #f4f4f4; line-height: 24px; - &:first-child{ + + &:first-child { color: #37E7FF; font-size: 18px; font-weight: bold; diff --git a/ruoyi-ui/src/views/JiHeExpressway/pages/control/event/event/EventDetailDialog/data.js b/ruoyi-ui/src/views/JiHeExpressway/pages/control/event/event/EventDetailDialog/data.js index 3d2c9ffd..81862ba7 100644 --- a/ruoyi-ui/src/views/JiHeExpressway/pages/control/event/event/EventDetailDialog/data.js +++ b/ruoyi-ui/src/views/JiHeExpressway/pages/control/event/event/EventDetailDialog/data.js @@ -82,7 +82,7 @@ export const formList = [ }, { label: "事件描述:", - key: "direction", + key: "remark", type: "input", gridColumn: 3, options: { diff --git a/ruoyi-ui/src/views/JiHeExpressway/pages/control/event/event/data.js b/ruoyi-ui/src/views/JiHeExpressway/pages/control/event/event/data.js index 7b4be9ea..0add8ac7 100644 --- a/ruoyi-ui/src/views/JiHeExpressway/pages/control/event/event/data.js +++ b/ruoyi-ui/src/views/JiHeExpressway/pages/control/event/event/data.js @@ -23,8 +23,90 @@ export const tabMap = { 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.eventType, { @@ -55,8 +137,8 @@ export const searchFormList = [ type: "datePicker", options: { type: "daterange", - format: 'yyyy-MM-dd HH:mm:ss', - valueFormat: 'yyyy-MM-dd HH:mm:ss' + format: "yyyy-MM-dd HH:mm:ss", + valueFormat: "yyyy-MM-dd HH:mm:ss", }, }, { @@ -77,6 +159,5 @@ export const searchFormList = [ }, label: "结束桩号:", required: false, - } - ) + }), ]; diff --git a/ruoyi-ui/src/views/JiHeExpressway/pages/control/event/event/index.vue b/ruoyi-ui/src/views/JiHeExpressway/pages/control/event/event/index.vue index 2181248f..9e9de4fb 100644 --- a/ruoyi-ui/src/views/JiHeExpressway/pages/control/event/event/index.vue +++ b/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 EventDetailDialog from "./EventDetailDialog/index"; import FormEvent from "./FormEvent/index"; -import { tabMap, searchFormList } from "./data"; +import { tabMap, gjSearchFormList, gzSearchFormList } from "./data"; import request from "@/utils/request"; import { Loading } from 'element-ui'; @@ -82,6 +82,30 @@ const warningSourceMapping = { 5: '扫码报警', 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 { name: "RoadNetworkMonitoring2", @@ -98,7 +122,7 @@ export default { return { data: [], total: 0, - searchFormList, + searchFormList: [], activeName: "-1", panels: [ { @@ -129,6 +153,7 @@ export default { }; }, created() { + this.searchFormList = gjSearchFormList; this.getData(); }, methods: { @@ -136,6 +161,7 @@ export default { this.activeName = activeName; this.searchData.eventState = activeName == "-1" ? null : activeName; + this.searchFormList = activeName == "-1" ? gjSearchFormList : gzSearchFormList; this.getData(activeName); }, @@ -160,6 +186,14 @@ export default { if (result.code != 200) return Message.error(result?.msg); result.rows.forEach(it => { 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; @@ -255,18 +289,16 @@ export default { data: { id } }).then((result) => { if (result.code != 200) return Message.error(result?.msg); - data = result.data; - const directionMapping = { - 1: '上行', - 2: '中', - 3: '下行' - } - data.stringEventSource = warningSourceMapping[data.warningSource]; - data.stringDirection = directionMapping[data.direction] || data.direction; + let data = result.data; + 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; - console.log('data', this.detailDialogFormData) + // console.log('data', this.detailDialogFormData) this.eventDetailDialogVisible = true; }); From 9cb5c0eeebca481a465854b2bc2f97d7e671fc5b Mon Sep 17 00:00:00 2001 From: zhoule Date: Sun, 18 Feb 2024 11:30:41 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E6=84=9F=E7=9F=A5=E4=BA=8B=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../JiHeExpressway/components/RoadStateCard/index.vue | 4 ++-- .../JiHeExpressway/pages/control/event/event/index.vue | 7 +++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/ruoyi-ui/src/views/JiHeExpressway/components/RoadStateCard/index.vue b/ruoyi-ui/src/views/JiHeExpressway/components/RoadStateCard/index.vue index 4fd613a6..430ec573 100644 --- a/ruoyi-ui/src/views/JiHeExpressway/components/RoadStateCard/index.vue +++ b/ruoyi-ui/src/views/JiHeExpressway/components/RoadStateCard/index.vue @@ -2,8 +2,8 @@
- - + +
diff --git a/ruoyi-ui/src/views/JiHeExpressway/pages/control/event/event/index.vue b/ruoyi-ui/src/views/JiHeExpressway/pages/control/event/event/index.vue index 9e9de4fb..1e17b4fc 100644 --- a/ruoyi-ui/src/views/JiHeExpressway/pages/control/event/event/index.vue +++ b/ruoyi-ui/src/views/JiHeExpressway/pages/control/event/event/index.vue @@ -175,8 +175,9 @@ export default { }; }, getData() { - - if (this.activeName == '-1') { + console.log('activeName', this.activeName) + if (this.activeName === '-1') { + console.log('activeName22', this.activeName) request({ url: `/perceivedEvents/warning/perceivedEventsList`, method: "post", @@ -335,6 +336,8 @@ export default { ...this.searchData, eventType: data.eventType, eventSources: data.eventSources, + warningSource: data.warningSource, + direction: data.direction, startTime: daterange && daterange.length > 0 ? daterange[0] : "", endTime: daterange && daterange.length > 0 ? daterange[1] : "", stakeMark: stakeMark, From af46cd2e97c3841c4640b65701e8514c245dc4fa Mon Sep 17 00:00:00 2001 From: zhoule Date: Sun, 18 Feb 2024 14:54:12 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E4=BA=8B=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../control/event/event/FormEvent/PresetFormItems.js | 2 +- .../pages/control/event/event/FormEvent/data.js | 2 +- .../pages/control/event/event/FormEvent/index.vue | 11 +++++++---- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/ruoyi-ui/src/views/JiHeExpressway/pages/control/event/event/FormEvent/PresetFormItems.js b/ruoyi-ui/src/views/JiHeExpressway/pages/control/event/event/FormEvent/PresetFormItems.js index d6bf0b22..89b43a73 100644 --- a/ruoyi-ui/src/views/JiHeExpressway/pages/control/event/event/FormEvent/PresetFormItems.js +++ b/ruoyi-ui/src/views/JiHeExpressway/pages/control/event/event/FormEvent/PresetFormItems.js @@ -714,7 +714,7 @@ export const route = { export const eventHappenTime = { label: "事件发生时间:", - key: "startTime", + key: "occurrenceTime", required: true, type: "datePicker", options:{ diff --git a/ruoyi-ui/src/views/JiHeExpressway/pages/control/event/event/FormEvent/data.js b/ruoyi-ui/src/views/JiHeExpressway/pages/control/event/event/FormEvent/data.js index dc0c69ef..929d287b 100644 --- a/ruoyi-ui/src/views/JiHeExpressway/pages/control/event/event/FormEvent/data.js +++ b/ruoyi-ui/src/views/JiHeExpressway/pages/control/event/event/FormEvent/data.js @@ -8,7 +8,7 @@ export const tabConfigList = [ list: [ { ...PresetFormItems.callPolicePersonName, key: 'dcEventAccident.reporterName' }, { ...PresetFormItems.callPolicePersonPhone, key: 'dcEventAccident.reporterPhoneNumber' }, - PresetFormItems.trafficAccidentType, + { ...PresetFormItems.trafficAccidentType, key: 'dcEventAccident.accidentType' }, PresetFormItems.eventLevel, { ...PresetFormItems.locationMode, key: 'dcEventAccident.locationType' }, PresetFormItems.freeway, diff --git a/ruoyi-ui/src/views/JiHeExpressway/pages/control/event/event/FormEvent/index.vue b/ruoyi-ui/src/views/JiHeExpressway/pages/control/event/event/FormEvent/index.vue index 8a5f74e2..8f219e30 100644 --- a/ruoyi-ui/src/views/JiHeExpressway/pages/control/event/event/FormEvent/index.vue +++ b/ruoyi-ui/src/views/JiHeExpressway/pages/control/event/event/FormEvent/index.vue @@ -154,10 +154,14 @@ export default { if (this.index == 1) { formData.dcEventVehicleAccident.laneOccupancy = formData.dcEventVehicleAccident.laneOccupancy.join(',') } - // console.log('formData',formData) - // return; + if (this.index == 8) { + 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; - let endStakeMark = formData.endStakeMark; + request({ url: `/dc/system/event`, method: "post", @@ -165,7 +169,6 @@ export default { ...formData, eventType: Number(this.index) + 1, stakeMark: (stakeMark && stakeMark.length > 0) ? ('K' + stakeMark[0] + '+' + stakeMark[1]) : '', - endStakeMark: (endStakeMark && endStakeMark.length > 0) ? ('K' + endStakeMark[0] + '+' + endStakeMark[1]) : '', } }) .then((result) => { From d43bea016b403258c3d3bba8d41d1b80a56d002e Mon Sep 17 00:00:00 2001 From: qingzhengli <1204552371@qq.com> Date: Sun, 18 Feb 2024 16:33:53 +0800 Subject: [PATCH 5/5] =?UTF-8?q?feat=20=20=E9=A6=96=E9=A1=B5=E7=AC=AC?= =?UTF-8?q?=E4=B8=80=E4=B8=AA=E4=B8=93=E9=A2=98=E9=BB=98=E8=AE=A4=E5=85=A8?= =?UTF-8?q?=E9=80=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/InputSearch/index.vue | 6 +- .../Home/components/AMapContainer/index.vue | 6 +- .../Home/components/RoadAndEvents/index.vue | 20 ++++- .../RoadAndEvents/utils/buttonEvent.js | 87 +++++++++++-------- .../views/JiHeExpressway/pages/Home/index.vue | 6 +- 5 files changed, 80 insertions(+), 45 deletions(-) diff --git a/ruoyi-ui/src/views/JiHeExpressway/components/InputSearch/index.vue b/ruoyi-ui/src/views/JiHeExpressway/components/InputSearch/index.vue index 134bea1e..5f402fb4 100644 --- a/ruoyi-ui/src/views/JiHeExpressway/components/InputSearch/index.vue +++ b/ruoyi-ui/src/views/JiHeExpressway/components/InputSearch/index.vue @@ -54,7 +54,11 @@ export default { data() { return { width: null, - popperOptions: {} + popperOptions: { + popHideCallBack: () => { + // console.log("---") + } + } } }, emit: [ diff --git a/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/AMapContainer/index.vue b/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/AMapContainer/index.vue index 5a6a046b..f703d2b2 100644 --- a/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/AMapContainer/index.vue +++ b/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/AMapContainer/index.vue @@ -30,7 +30,7 @@ export default { }, async mounted() { // console.log(this.$refs.mapContainerRef); - this.AMap = await loadAMap(); + this.AMap = await loadAMap();//高德map load if (!this.AMap) return; @@ -53,9 +53,9 @@ export default { Vue.prototype.mapIns = this.aMapIns; - this.aMapIns.on("complete", () => { + this.aMapIns.on("complete", () => { //map渲染完成 this.loading = false; - + this.$emit("update:isGisCompleted", true); // var polyline1 = new this.AMap.Polyline({ // path: [], // strokeColor: "#67EBF7", diff --git a/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/RoadAndEvents/index.vue b/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/RoadAndEvents/index.vue index 97c6a60e..11c84fbf 100644 --- a/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/RoadAndEvents/index.vue +++ b/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'], created() { const defaultActive = 0; @@ -169,7 +185,7 @@ export default { this.active = item.title; this.tabContentData = item.children; }, - handleDeviceImmediate(item) { + handleDeviceImmediate(item, isDefault) { const key = getHandleDeviceType(item) || `${this.active}/${item.title}`; const status = item.status; @@ -180,7 +196,7 @@ export default { 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) { this.handleDeviceImmediate(item); diff --git a/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/RoadAndEvents/utils/buttonEvent.js b/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/RoadAndEvents/utils/buttonEvent.js index 94154c38..9848e32f 100644 --- a/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/RoadAndEvents/utils/buttonEvent.js +++ b/ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/RoadAndEvents/utils/buttonEvent.js @@ -84,11 +84,11 @@ let debounceNoneLngLatMessage = debounce(() => { Message.warning("部分设备经纬度为空"); }); -function resolveDataOptions(data, config, component) { +function resolveDataOptions(data, config, component, isDefault) { let lnglat = data.longitude && data.latitude ? [data.longitude, data.latitude] : null; - if (!lnglat) debounceNoneLngLatMessage(); + if (!lnglat && !isDefault) debounceNoneLngLatMessage(); return { weight: 1, @@ -113,15 +113,17 @@ function resolveDataOptions(data, config, component) { export const eventMap = { // 设备 需要在地图显示的 - async "地图路测设备/map"(item, filterData) { + async "地图路测设备/map"(item, filterData, isDefault) { const config = DeviceForMap[item.title]; - - const loadingMessage = Message.info({ - message: `${item.title}设备加载中...`, - duration: 0, - customClass: "loading-message", - iconClass: "el-icon-loading", - }); + let loadingMessage; + if (!isDefault) { + loadingMessage = Message.info({ + message: `${item.title}设备加载中...`, + duration: 0, + customClass: "loading-message", + iconClass: "el-icon-loading", + }); + } const data = await getDeviceList(config.deviceType, filterData) .then(async (data) => { @@ -130,10 +132,11 @@ export const eventMap = { }) .catch(() => {}); - loadingMessage.close(); + loadingMessage?.close(); if (!data) return; - if (!data.length) return Message.warning(`没有${item.title}事件数据!`); + if (!data.length && !isDefault) + return Message.warning(`没有${item.title}事件数据!`); eventMap[`地图路测设备/map_close`](item); @@ -143,7 +146,7 @@ export const eventMap = { }; let removeData = data.map((item) => - resolveDataOptions.call(this, item, options, config.dialog) + resolveDataOptions.call(this, item, options, config.dialog, isDefault) ); console.log( "%c [ removeData ]-112-「buttonEvent.js」", @@ -161,14 +164,16 @@ export const eventMap = { }, // 事件 需要在地图显示的 - async "地图事件专题/map"(item) { - const loadingMessage = Message.info({ - message: `${item.title}事件位置加载中...`, - duration: 0, - customClass: "loading-message", - iconClass: "el-icon-loading", - }); - + async "地图事件专题/map"(item, filterData, isDefault) { + let loadingMessage; + if (!isDefault) { + loadingMessage = Message.info({ + message: `${item.title}事件位置加载中...`, + duration: 0, + customClass: "loading-message", + iconClass: "el-icon-loading", + }); + } const data = await getEventTopicList(EventTopics[item.title]) .then(async (data) => { await delay(600); @@ -176,11 +181,12 @@ export const eventMap = { }) .catch(() => {}); - loadingMessage.close(); + loadingMessage?.close(); if (!data) return; - if (!data.length) return Message.warning(`没有${item.title}事件数据!`); + if (!data.length && !isDefault) + return Message.warning(`没有${item.title}事件数据!`); eventMap[`地图事件专题/map_close`](item); @@ -190,7 +196,13 @@ export const eventMap = { }; let removeData = data.map((item) => - resolveDataOptions.call(this, item, options, "TrafficIncidents") + resolveDataOptions.call( + this, + item, + options, + "TrafficIncidents", + isDefault + ) ); markerClusterIns.addData(removeData); @@ -203,14 +215,16 @@ export const eventMap = { }, // 感知事件 - async "事件专题/感知事件"(item) { - const loadingMessage = Message.info({ - message: `${item.title}位置加载中...`, - duration: 0, - customClass: "loading-message", - iconClass: "el-icon-loading", - }); - + async "事件专题/感知事件"(item, filterData, isDefault) { + let loadingMessage; + if (!isDefault) { + loadingMessage = Message.info({ + message: `${item.title}位置加载中...`, + duration: 0, + customClass: "loading-message", + iconClass: "el-icon-loading", + }); + } const data = await getPerceiveEventList() .then(async (data) => { await delay(600); @@ -218,11 +232,12 @@ export const eventMap = { }) .catch(() => {}); - loadingMessage.close(); + loadingMessage?.close(); if (!data) return; - if (!data?.length) return Message.warning(`没有${item.title}数据!`); + if (!data?.length && !isDefault) + return Message.warning(`没有${item.title}数据!`); eventMap[`事件专题/感知事件_close`](item); @@ -232,12 +247,12 @@ export const eventMap = { }; let removeData = data.map((item) => - resolveDataOptions.call(this, item, options, "PerceiveEvent") + resolveDataOptions.call(this, item, options, "PerceiveEvent", isDefault) ); markerClusterIns.addData(removeData); - loadingMessage.close(); + loadingMessage?.close(); cacheRemoveFunc[`事件专题/${item.title}`] = () => markerClusterIns.removeData(removeData); diff --git a/ruoyi-ui/src/views/JiHeExpressway/pages/Home/index.vue b/ruoyi-ui/src/views/JiHeExpressway/pages/Home/index.vue index e5bb9117..8e380825 100644 --- a/ruoyi-ui/src/views/JiHeExpressway/pages/Home/index.vue +++ b/ruoyi-ui/src/views/JiHeExpressway/pages/Home/index.vue @@ -1,6 +1,6 @@