From 30cf71affd5149a1310d84f658b028d267beee8b Mon Sep 17 00:00:00 2001
From: riku <risaku@163.com>
Date: 星期三, 11 六月 2025 17:30:22 +0800
Subject: [PATCH] 动态溯源(编写中)
---
src/components/map/MapScene.vue | 7
src/views/sourcetrace/SourceTrace.vue | 157 ---------------------
src/api/index.js | 4
src/views/underwaymix/UnderwayMixMode.vue | 2
src/views/sourcetrace/component/PollutedClueItem.vue | 186 ++++++++++++++++++++++++++
src/components.d.ts | 1
src/components/chart/RealTimeLineChart.vue | 12 +
src/utils/map/marks.js | 4
8 files changed, 214 insertions(+), 159 deletions(-)
diff --git a/src/api/index.js b/src/api/index.js
index c83bec6..efcd5a1 100644
--- a/src/api/index.js
+++ b/src/api/index.js
@@ -13,9 +13,9 @@
}
if (debug) {
- ip1 = 'http://192.168.0.110:8084/';
+ ip1 = 'http://192.168.0.103:8084/';
// ip1 = 'http://localhost:8084/';
- ws = `192.168.0.110:9031`;
+ ws = `192.168.0.103:9031`;
// ws = `localhost:9031`;
}
diff --git a/src/components.d.ts b/src/components.d.ts
index aefd8b5..12774c6 100644
--- a/src/components.d.ts
+++ b/src/components.d.ts
@@ -39,6 +39,7 @@
ElFormItem: typeof import('element-plus/es')['ElFormItem']
ElIcon: typeof import('element-plus/es')['ElIcon']
ElInput: typeof import('element-plus/es')['ElInput']
+ ElInputNumber: typeof import('element-plus/es')['ElInputNumber']
ElLink: typeof import('element-plus/es')['ElLink']
ElOption: typeof import('element-plus/es')['ElOption']
ElPagination: typeof import('element-plus/es')['ElPagination']
diff --git a/src/components/chart/RealTimeLineChart.vue b/src/components/chart/RealTimeLineChart.vue
index 7a2ea1d..a66e2ac 100644
--- a/src/components/chart/RealTimeLineChart.vue
+++ b/src/components/chart/RealTimeLineChart.vue
@@ -1,6 +1,10 @@
<template>
<div class="chart-wrap">
- <div ref="lineChart" class="line-chart"></div>
+ <div
+ ref="lineChart"
+ class="line-chart"
+ :style="'height:' + chartHeight + ';'"
+ ></div>
</div>
</template>
<script>
@@ -17,6 +21,10 @@
// series: []
// };
// }
+ },
+ chartHeight: {
+ type: String,
+ default: '140px'
}
},
data() {
@@ -72,7 +80,7 @@
}
.line-chart {
width: 318px;
- height: 140px;
+ /* height: 140px; */
/* border-bottom: 1px solid rgba(255, 255, 255, 0.329); */
}
</style>
diff --git a/src/components/map/MapScene.vue b/src/components/map/MapScene.vue
index f062b19..4482623 100644
--- a/src/components/map/MapScene.vue
+++ b/src/components/map/MapScene.vue
@@ -101,7 +101,12 @@
const key = this.districtCode + t;
if (!lableMarkMap.has(key)) {
this.fetchScene(t).then((res) => {
- const layer = marks.createLabelMarks(sceneIcon(t), res, false);
+ const layer = marks.createLabelMarks(
+ sceneIcon(t),
+ res,
+ false,
+ false
+ );
lableMarkMap.set(key, { show: true, layer });
});
} else {
diff --git a/src/utils/map/marks.js b/src/utils/map/marks.js
index 03ebbc5..0b1ccce 100644
--- a/src/utils/map/marks.js
+++ b/src/utils/map/marks.js
@@ -86,7 +86,7 @@
* @param {boolean} collision 鏍囨敞閬胯
* @returns
*/
- createLabelMarks(img, dataList, collision = true) {
+ createLabelMarks(img, dataList, collision = true, showTxt = true) {
// eslint-disable-next-line no-undef
const layer = new AMap.LabelsLayer({
zooms: [3, 20],
@@ -119,7 +119,7 @@
retina: true
},
text: {
- content: data.name,
+ content: showTxt ? data.name : '',
direction: 'top',
offset: [0, -5],
style: {
diff --git a/src/views/sourcetrace/SourceTrace.vue b/src/views/sourcetrace/SourceTrace.vue
index 725f2d6..5286e19 100644
--- a/src/views/sourcetrace/SourceTrace.vue
+++ b/src/views/sourcetrace/SourceTrace.vue
@@ -10,161 +10,14 @@
<el-col v-show="show" span="10">
<BaseCard>
<template #content>
- <!-- <div>
- <el-input type="text" v-model="inputVal" />
- <button @click="handleSend">send</button>
- <button @click="handleLink">link</button>
- </div> -->
- <!-- <div>
- <el-text type="primary" size="large" tag="b">鍔ㄦ�佹函婧�</el-text>
- </div> -->
<el-scrollbar ref="scrollbarRef" class="scrollbar">
<div
ref="scrollContentRef"
style="display: flex; width: fit-content"
>
- <el-scrollbar
- v-for="(item, index) in streams"
- :key="index"
- class="clue-card"
- >
- <el-row justify="space-between">
- <!-- <el-tag v-if="index == 0" type="danger">鏈�鏂�</el-tag> -->
- <el-text type="primary">{{
- '绾跨储鏃堕棿锛�' +
- item.pollutedData.startTime +
- ' - ' +
- item.pollutedData.endTime
- }}</el-text>
- <el-link
- type="primary"
- :underline="true"
- @click="showMarksAndPolygon(item)"
- >
- {{ item.showMore ? '鏀惰捣寮傚父' : '瀹氫綅寮傚父' }}
- </el-link>
- </el-row>
- <div>
- <el-text type="primary">
- 姹℃煋鍖哄煙锛歿{ item.pollutedArea.address }}
- </el-text>
- </div>
- <div>
- <el-text type="primary">
- 婧簮璺濈锛歿{
- formatDistanceType(item.pollutedArea.distanceType)
- }}
- </el-text>
- </div>
- <el-row style="border-top: 1px solid white">
- <el-col :span="6">
- <el-statistic
- title="绐佸彉鍥犲瓙"
- :value="item.pollutedData.factorName"
- />
- </el-col>
- <el-col :span="6">
- <el-statistic
- title="鍙樺寲骞呭害"
- :value="formatPercentage(item.pollutedData.avgPer)"
- />
- </el-col>
- <el-col :span="6">
- <el-statistic
- title="鍙戠敓娆℃暟"
- :value="item.pollutedData.times"
- />
- </el-col>
- <el-col :span="6">
- <el-statistic
- title="骞冲潎椋庨��"
- :value="item.pollutedData.windSpeed"
- suffix="m/s"
- />
- </el-col>
- </el-row>
- <el-row justify="space-between">
- <!-- <el-link
- type="primary"
- underline
- @click="showMarksAndPolygon(item)"
- >
- {{
- (item.showMore ? '鏀惰捣婧簮鍦烘櫙' : '鏌ョ湅婧簮鍦烘櫙') +
- '锛�' +
- item.pollutedSource.sceneList.length +
- '锛�'
- }}
- </el-link> -->
- </el-row>
- <div style="width: 320px; height: 140px">
- <RealTimeLineChart
- v-for="(item1, index1) in item._chartOptions"
- :key="index1"
- :model-value="item1"
- ></RealTimeLineChart>
- </div>
- <div class="border-dashed">
- <el-text type="" tag="mark">
- {{ item.pollutedSource.conclusion }}
- </el-text>
- </div>
- <SceneTable
- :show-marks="item.showMore"
- :scene-list="item.pollutedSource.sceneList"
- ></SceneTable>
-
- <!-- <el-space gap="4">
- <el-tag :type="item.status == 1 ? 'danger' : 'info'">{{
- item._statusStr
- }}</el-tag>
- <el-text type="default">{{ item.exception }}</el-text>
- </el-space>
- <el-row gap="4">
- <el-text type="primary">鍙戠敓鏃堕棿锛�</el-text>
- <el-text type="primary">{{
- item.startTime + ' 鑷� '
- }}</el-text>
- <el-text type="primary">{{
- item.status == 1 ? '褰撳墠' : item.endTime
- }}</el-text>
- </el-row>
- <el-row>
- <el-col :span="6">
- <el-statistic title="鍥犲瓙" :value="item.factorName" />
- </el-col>
- <el-col :span="6">
- <el-statistic title="鍧囧��" :value="item.avg" />
- </el-col>
- <el-col :span="6">
- <el-statistic title="宄板��" :value="item.max" />
- </el-col>
- <el-col :span="6">
- <el-statistic title="璋峰��" :value="item.min" />
- </el-col>
- </el-row>
- <el-row justify="space-between">
- <el-link
- type="primary"
- @click="item.showMore = !item.showMore"
- >
- {{
- (item.showMore ? '鏀惰捣婧簮鍦烘櫙' : '鏌ョ湅婧簮鍦烘櫙') +
- '锛�' +
- item.relatedSceneList.length +
- '锛�'
- }}
- </el-link>
- <el-link type="primary" @click="drawSector(item)">
- 鏌ョ湅寮傚父
- </el-link>
- </el-row>
- <SceneTable
- v-show="item.showMore"
- :scene-list="item.relatedSceneList"
- ></SceneTable>
- <el-divider /> -->
- </el-scrollbar>
+ <template v-for="(item, index) in streams" :key="index">
+ <PollutedClueItem :item="item"></PollutedClueItem>
+ </template>
</div>
</el-scrollbar>
</template>
@@ -187,6 +40,8 @@
import { FactorDatas } from '@/model/FactorDatas';
import factorDataParser from '@/utils/chart/factor-data-parser';
import websocketMsgParser from '@/views/sourcetrace/websocketMsgParser.js';
+
+import PollutedClueItem from './component/PollutedClueItem.vue';
const props = defineProps({
factorType: String
@@ -320,7 +175,7 @@
function parseChartData(obj) {
// console.log('鎶樼嚎鍥撅細start');
const factorDatas = new FactorDatas();
- factorDatas.setData(obj.pollutedData.dataVoList, 0, () => {
+ factorDatas.setData(obj.pollutedData.historyDataList, 0, () => {
obj._chartOptions = factorDataParser.parseData(factorDatas, [
{
label: obj.pollutedData.factorName,
diff --git a/src/views/sourcetrace/component/PollutedClueItem.vue b/src/views/sourcetrace/component/PollutedClueItem.vue
new file mode 100644
index 0000000..392d271
--- /dev/null
+++ b/src/views/sourcetrace/component/PollutedClueItem.vue
@@ -0,0 +1,186 @@
+<template>
+ <!-- <BaseCard>
+ <template #content> -->
+ <el-scrollbar class="clue-card">
+ <el-row justify="space-between">
+ <!-- <el-tag v-if="index == 0" type="danger">鏈�鏂�</el-tag> -->
+ <el-text type="primary">{{
+ '绾跨储鏃堕棿锛�' +
+ item.pollutedData.startTime +
+ ' - ' +
+ item.pollutedData.endTime
+ }}</el-text>
+ <el-link
+ type="primary"
+ :underline="true"
+ @click="showMarksAndPolygon(item)"
+ >
+ {{ item.showMore ? '鏀惰捣寮傚父' : '瀹氫綅寮傚父' }}
+ </el-link>
+ </el-row>
+ <div>
+ <el-text type="primary">
+ 姹℃煋鍖哄煙锛歿{ item.pollutedArea.address }}
+ </el-text>
+ </div>
+ <div>
+ <el-text type="primary">
+ 婧簮璺濈锛歿{ formatDistanceType(item.pollutedArea.distanceType) }}
+ </el-text>
+ </div>
+ <div>
+ <el-text type="primary">
+ 寮傚父绫诲瀷锛歿{ item.pollutedData.exception }}
+ </el-text>
+ </div>
+ <el-row style="border-top: 1px solid white">
+ <el-col :span="6">
+ <el-statistic title="绐佸彉鍥犲瓙" :value="item.pollutedData.factorName" />
+ </el-col>
+ <el-col :span="6">
+ <el-statistic
+ title="鍙樺寲骞呭害"
+ :value="formatPercentage(item.pollutedData.avgPer)"
+ />
+ </el-col>
+ <el-col :span="6">
+ <el-statistic title="鍙戠敓娆℃暟" :value="item.pollutedData.times" />
+ </el-col>
+ <el-col :span="6">
+ <el-statistic
+ title="骞冲潎椋庨��"
+ :value="item.pollutedData.windSpeed"
+ suffix="m/s"
+ />
+ </el-col>
+ </el-row>
+ <el-row justify="space-between">
+ <!-- <el-link
+ type="primary"
+ underline
+ @click="showMarksAndPolygon(item)"
+ >
+ {{
+ (item.showMore ? '鏀惰捣婧簮鍦烘櫙' : '鏌ョ湅婧簮鍦烘櫙') +
+ '锛�' +
+ item.pollutedSource.sceneList.length +
+ '锛�'
+ }}
+ </el-link> -->
+ </el-row>
+ <!-- <div style="width: 320px; height: 80px"> -->
+ <RealTimeLineChart
+ v-for="(item1, index1) in item._chartOptions"
+ :key="index1"
+ :model-value="item1"
+ chart-height="80px"
+ ></RealTimeLineChart>
+ <!-- </div> -->
+ <div class="border-dashed">
+ <el-text type="" tag="mark">
+ {{ item.pollutedSource.conclusion }}
+ </el-text>
+ </div>
+ <SceneTable
+ :show-marks="item.showMore"
+ :scene-list="item.pollutedSource.sceneList"
+ ></SceneTable>
+
+ <!-- <el-space gap="4">
+ <el-tag :type="item.status == 1 ? 'danger' : 'info'">{{
+ item._statusStr
+ }}</el-tag>
+ <el-text type="default">{{ item.exception }}</el-text>
+ </el-space>
+ <el-row gap="4">
+ <el-text type="primary">鍙戠敓鏃堕棿锛�</el-text>
+ <el-text type="primary">{{
+ item.startTime + ' 鑷� '
+ }}</el-text>
+ <el-text type="primary">{{
+ item.status == 1 ? '褰撳墠' : item.endTime
+ }}</el-text>
+ </el-row>
+ <el-row>
+ <el-col :span="6">
+ <el-statistic title="鍥犲瓙" :value="item.factorName" />
+ </el-col>
+ <el-col :span="6">
+ <el-statistic title="鍧囧��" :value="item.avg" />
+ </el-col>
+ <el-col :span="6">
+ <el-statistic title="宄板��" :value="item.max" />
+ </el-col>
+ <el-col :span="6">
+ <el-statistic title="璋峰��" :value="item.min" />
+ </el-col>
+ </el-row>
+ <el-row justify="space-between">
+ <el-link
+ type="primary"
+ @click="item.showMore = !item.showMore"
+ >
+ {{
+ (item.showMore ? '鏀惰捣婧簮鍦烘櫙' : '鏌ョ湅婧簮鍦烘櫙') +
+ '锛�' +
+ item.relatedSceneList.length +
+ '锛�'
+ }}
+ </el-link>
+ <el-link type="primary" @click="drawSector(item)">
+ 鏌ョ湅寮傚父
+ </el-link>
+ </el-row>
+ <SceneTable
+ v-show="item.showMore"
+ :scene-list="item.relatedSceneList"
+ ></SceneTable>
+ <el-divider /> -->
+ </el-scrollbar>
+ <!-- </template>
+ </BaseCard> -->
+</template>
+<script setup>
+import { ref } from 'vue';
+
+const props = defineProps({
+ item: Object
+});
+</script>
+<style scoped>
+:deep(.el-statistic) {
+ --el-statistic-title-color: rgb(215, 215, 215);
+ --el-statistic-content-color: white;
+}
+
+:deep(.el-text.el-text--primary) {
+ --el-text-color: white;
+}
+
+:deep(.el-link) {
+ --el-link-text-color: #23dad1;
+}
+
+.scrollbar {
+ min-width: 300px;
+ max-width: 60vw;
+ /* height: 35vh; */
+ /* color: #02ffea; */
+}
+
+.clue-card {
+ padding: 0 4px;
+ /* margin-right: 2px; */
+ width: 340px;
+ height: 35vh;
+ border-right: 1px solid white;
+ border-radius: 2px;
+}
+
+.border-dashed {
+ /* border: 1px dashed white; */
+ border: 1px dashed #ffbc58;
+ padding: 0px 1px;
+ margin-bottom: 4px;
+}
+</style>
diff --git a/src/views/underwaymix/UnderwayMixMode.vue b/src/views/underwaymix/UnderwayMixMode.vue
index 0fae038..eefbb4c 100644
--- a/src/views/underwaymix/UnderwayMixMode.vue
+++ b/src/views/underwaymix/UnderwayMixMode.vue
@@ -229,7 +229,7 @@
const props = defineProps({
groupId: {
type: Number,
- default: 2
+ default: 3
}
});
const show = ref(true);
--
Gitblit v1.9.3