| | |
| | | import { ElMessage } from 'element-plus'; |
| | | |
| | | const openLog = false; |
| | | const debug = true; |
| | | const debug = false; |
| | | |
| | | let ip1 = 'http://47.100.191.150:9029/'; |
| | | let ws = `47.100.191.150:9030`; |
| | |
| | | i.interceptors.request.use( |
| | | function (config) { |
| | | // 在发送请求之前做些什么 |
| | | if (import.meta.env.DEV && openLog) { |
| | | console.log('==>请求开始'); |
| | | console.log(`${config.baseURL}${config.url}`); |
| | | if (config.data) { |
| | | console.log('==>请求数据', config.data); |
| | | } |
| | | } |
| | | // if (import.meta.env.DEV && openLog) { |
| | | // console.log('==>请求开始'); |
| | | // console.log(`${config.baseURL}${config.url}`); |
| | | // if (config.data) { |
| | | // console.log('==>请求数据', config.data); |
| | | // } |
| | | // } |
| | | return config; |
| | | }, |
| | | function (error) { |
| | |
| | | // 2xx 范围内的状态码都会触发该函数。 |
| | | // 对响应数据做点什么 |
| | | if (import.meta.env.DEV && openLog) { |
| | | console.log(response); |
| | | console.log('==>请求结束'); |
| | | console.log('|------------------------------------------'); |
| | | console.log('|--请求: ', `${response.request.responseURL}`); |
| | | if (response.config.data) { |
| | | console.log('|--数据: ', response.config.data); |
| | | } |
| | | console.log('|--结果: ', response.data); |
| | | } |
| | | if (response.status == 200) { |
| | | if ( |
| | |
| | | 'CardDialog copy': typeof import('./components/CardDialog copy.vue')['default'] |
| | | CheckButton: typeof import('./components/common/CheckButton.vue')['default'] |
| | | ConfigManage: typeof import('./components/map/ConfigManage.vue')['default'] |
| | | copy: typeof import('./components/CardDialog copy.vue')['default'] |
| | | CoreHeader: typeof import('./components/core/CoreHeader.vue')['default'] |
| | | CoreMenu: typeof import('./components/core/CoreMenu.vue')['default'] |
| | | DataSummary: typeof import('./components/monitor/DataSummary.vue')['default'] |
| | |
| | | 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'] |
| | |
| | | </template> |
| | | <script> |
| | | import * as echarts from 'echarts'; |
| | | import { smallLineOption } from '@/utils/chart/chart-option'; |
| | | import { smallLineOption, baseVisualMap } from '@/utils/chart/chart-option'; |
| | | |
| | | export default { |
| | | props: { |
| | |
| | | yMinInterval: { |
| | | type: Number, |
| | | default: 1 |
| | | } |
| | | }, |
| | | // 异常数据索引范围集合,[[i1,i2], [i3,i4],...] |
| | | exceptionIndexArr: Array |
| | | }, |
| | | data() { |
| | | return { |
| | |
| | | const { xAxis, series } = this.modelValue; |
| | | if (!this.option) { |
| | | this.option = smallLineOption(xAxis, series, this.yMinInterval); |
| | | if (this.exceptionIndexArr) { |
| | | const visualMap = baseVisualMap(this.exceptionIndexArr); |
| | | this.option.visualMap = visualMap; |
| | | } |
| | | } else { |
| | | this.option.xAxis[0].data = xAxis; |
| | | this.option.series = series; |
| | |
| | | return fontSize; |
| | | } |
| | | |
| | | function baseVisualMap(area) { |
| | | const _pieces = []; |
| | | area.forEach((v, i) => { |
| | | // if (i == 0) { |
| | | // _pieces.push({ |
| | | // lt: v[0], |
| | | // color: 'green' |
| | | // }); |
| | | // } |
| | | _pieces.push({ |
| | | gte: v[0], |
| | | lte: v[1], |
| | | color: 'red' |
| | | }); |
| | | }); |
| | | // const lastOne = area[area.length - 1]; |
| | | // _pieces.push({ |
| | | // gt: lastOne[1], |
| | | // color: 'green' |
| | | // }); |
| | | return { |
| | | type: 'piecewise', |
| | | // type: 'continuous', |
| | | show: false, |
| | | dimension: 0, |
| | | pieces: _pieces, |
| | | outOfRange: { |
| | | color: ['#5470c6'] |
| | | } |
| | | }; |
| | | } |
| | | |
| | | // 折线图 |
| | | function factorLineOption(_xAxis, _series) { |
| | | var fontSize = fGetChartFontSize(); |
| | |
| | | return option; |
| | | } |
| | | |
| | | export { factorLineOption, smallLineOption, gaugeOption }; |
| | | export { factorLineOption, smallLineOption, gaugeOption, baseVisualMap }; |
| | |
| | | factorType(nValue, oValue) { |
| | | if (nValue != oValue && this.status == 0) { |
| | | Layer.clear(); |
| | | this.draw(); |
| | | this.draw(true); |
| | | // this.drawHighlightPollution(); |
| | | } |
| | | } |
| | |
| | | done(); |
| | | this.draw(); |
| | | }, |
| | | draw() { |
| | | draw(notSetBound) { |
| | | // 刷新图例 |
| | | const factor = this.factorDatas.factor[this.factorType]; |
| | | sector.clearSector(); |
| | | // this.drawRoadLine(factor); |
| | | this.drawRoadMap(factor); |
| | | this.drawMassMarks(factor); |
| | | // 调整地图视角 |
| | | if (!notSetBound) { |
| | | mapUtil.setBound(this.factorDatas.lnglats_GD); |
| | | } |
| | | }, |
| | | // 绘制3D走行路线图 |
| | | drawRoadMap(e) { |
| | |
| | | marks.drawMassMarks(this.factorDatas, e, (index) => { |
| | | this.handelIndexChange(index); |
| | | }); |
| | | // 调整地图视角 |
| | | mapUtil.setBound(this.factorDatas.lnglats_GD); |
| | | }, |
| | | drawSector(index) { |
| | | // 1. 绘制新扇形区域 |
| | |
| | | <SourceTraceFilter |
| | | v-model:data-slice="selectedMsgTypes" |
| | | v-model:factor-type="selectedFactorTypes" |
| | | :factor-options="factorOptions" |
| | | v-model:scene-type="selectedSceneTypes" |
| | | :factor-options="factorOptions" |
| | | :scene-options="sceneOptions" |
| | | ></SourceTraceFilter> |
| | | <!-- <el-divider direction="vertical"></el-divider> --> |
| | |
| | | </el-space> |
| | | </div> |
| | | </el-row> |
| | | <el-scrollbar ref="scrollbarRef" class="scrollbar"> |
| | | <el-scrollbar |
| | | ref="scrollbarRef" |
| | | class="scrollbar" |
| | | v-loading="loading" |
| | | > |
| | | <TransitionGroup name="list"> |
| | | <div |
| | | v-for="item in filterStreams" |
| | |
| | | const selectedSceneTypes = ref([]); |
| | | const sceneOptions = ref([]); |
| | | |
| | | const loading = ref(false); |
| | | |
| | | function handleDisplayChange() { |
| | | show.value = !show.value; |
| | | if ( |
| | |
| | | case '1': |
| | | case '3': |
| | | // 判断监测因子类型是否选中 |
| | | b2 = selectedFactorTypes.value.indexOf(v.pollutedData.factorId) != -1; |
| | | for (const key in v.pollutedData.statisticMap) { |
| | | const value = v.pollutedData.statisticMap[key]; |
| | | b2 = b2 || selectedFactorTypes.value.indexOf(value.factorId) != -1; |
| | | } |
| | | |
| | | // 判断场景类型是否选中 |
| | | if (v.pollutedSource.sceneList.length == 0) { |
| | | b3 = selectedSceneTypes.value.indexOf(NO_SCENE) != -1; |
| | |
| | | case '1': |
| | | case '3': |
| | | // 筛选监测因子类型 |
| | | for (const key in objData.pollutedData.statisticMap) { |
| | | const value = objData.pollutedData.statisticMap[key]; |
| | | if ( |
| | | factorOptions.value.findIndex( |
| | | (v) => v.value == objData.pollutedData.factorId |
| | | ) == -1 |
| | | factorOptions.value.findIndex((v) => v.value == value.factorId) == -1 |
| | | ) { |
| | | factorOptions.value.push({ |
| | | label: objData.pollutedData.factorName, |
| | | value: objData.pollutedData.factorId |
| | | label: value.factorName, |
| | | value: value.factorId |
| | | }); |
| | | selectedFactorTypes.value.push(objData.pollutedData.factorId); |
| | | selectedFactorTypes.value.push(value.factorId); |
| | | } |
| | | } |
| | | |
| | | // 筛选场景类型 |
| | | if (objData.pollutedSource.sceneList.length == 0) { |
| | | // 若没有找到风险源时,将该分类设定为null |
| | |
| | | } |
| | | |
| | | function fetchPollutionTraceHistory() { |
| | | dataAnalysisApi.fetchPollutionTraceHistory(props.missionCode).then((res) => { |
| | | loading.value = true; |
| | | dataAnalysisApi |
| | | .fetchPollutionTraceHistory(props.missionCode) |
| | | .then((res) => { |
| | | const objList = JSON.parse(res.data); |
| | | objList.forEach((obj) => { |
| | | obj._type = obj.msgType + ''; |
| | |
| | | optionsFilte(obj); |
| | | }); |
| | | streams.value = objList; |
| | | }); |
| | | }) |
| | | .finally(() => (loading.value = false)); |
| | | } |
| | | |
| | | onMounted(() => { |
| | |
| | | ); |
| | | const factorDatas = new FactorDatas(); |
| | | factorDatas.setData(obj.pollutedData.historyDataList, 0, () => { |
| | | obj._chartOptions = factorDataParser.parseData(factorDatas, [ |
| | | for (const key in obj.pollutedData.statisticMap) { |
| | | const value = obj.pollutedData.statisticMap[key]; |
| | | value._chartOptions = factorDataParser.parseData(factorDatas, [ |
| | | { |
| | | label: obj.pollutedData.factorName, |
| | | name: obj.pollutedData.factorName, |
| | | value: obj.pollutedData.factorId + '' |
| | | label: value.factorName, |
| | | name: value.factorName, |
| | | value: value.factorId + '' |
| | | } |
| | | ]); |
| | | } |
| | | // obj._chartOptions = factorDataParser.parseData(factorDatas, [ |
| | | // { |
| | | // label: obj.pollutedData.factorName, |
| | | // name: obj.pollutedData.factorName, |
| | | // value: obj.pollutedData.factorId + '' |
| | | // } |
| | | // ]); |
| | | // console.log('折线图:', obj._chartOptions); |
| | | }); |
| | | } |
| | |
| | | </el-tag> |
| | | <el-text type="info">{{ item.pollutedData.exception }}</el-text> |
| | | </div> |
| | | <div v-if="item.pollutedSource.sceneList.length > 0"> |
| | | <!-- <div v-if="item.pollutedSource.sceneList.length > 0"> |
| | | <div v-for="s in item.pollutedSource.sceneList" :key="s.guid"> |
| | | <img style="width: 24px" :src="sceneIcon(s.typeId)" :alt="s.type" /> |
| | | <el-text |
| | |
| | | {{ s.name }} |
| | | </el-text> |
| | | </div> |
| | | </div> |
| | | </div> --> |
| | | </el-col> |
| | | </el-row> |
| | | </div> |
| | |
| | | <div> |
| | | <el-text type="info"> |
| | | <el-icon><MapLocation /></el-icon> |
| | | {{ '风险区域:' + item.pollutedArea.address }} |
| | | {{ |
| | | '风险区域:' + |
| | | (item.pollutedArea.address ? item.pollutedArea.address : '') |
| | | }} |
| | | </el-text> |
| | | </div> |
| | | <!-- <div> |
| | |
| | | 异常类型:{{ item.pollutedData.exception }} |
| | | </el-text> |
| | | </div> |
| | | <div v-for="s in item.pollutedData.statisticMap" :key="s"> |
| | | <div v-for="s in item.pollutedData.statisticMap" :key="s.factorId"> |
| | | <el-row style="border-top: 1px solid white"> |
| | | <el-col :span="6"> |
| | | <el-statistic title="突变因子" :value="s.factorName" /> |
| | |
| | | <el-statistic |
| | | title="平均风速" |
| | | :value="item.pollutedData.windSpeed" |
| | | :precision="1" |
| | | suffix="m/s" |
| | | /> |
| | | </el-col> |
| | | </el-row> |
| | | <RealTimeLineChart |
| | | v-for="(item1, index1) in s._chartOptions" |
| | | :key="index1" |
| | | :model-value="item1" |
| | | chart-height="80px" |
| | | :y-min-interval="20" |
| | | :exception-index-arr="exceptionIndexArr" |
| | | ></RealTimeLineChart> |
| | | </div> |
| | | <el-row justify="space-between"> |
| | | <!-- <el-link |
| | |
| | | </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" |
| | | :y-min-interval="20" |
| | | ></RealTimeLineChart> |
| | | <!-- </div> --> |
| | | <div class="border-dashed"> |
| | | <el-icon color="#ffbc58" size="20"><WarningFilled /></el-icon> |
| | |
| | | </CardDialog> --> |
| | | </template> |
| | | <script setup> |
| | | import { ref } from 'vue'; |
| | | import { ref, computed } from 'vue'; |
| | | |
| | | const props = defineProps({ |
| | | modelValue: Boolean, |
| | | item: Object |
| | | }); |
| | | |
| | | const exceptionIndexArr = computed(() => { |
| | | const indexArr = []; |
| | | props.item.pollutedData.dataVoList.forEach((e) => { |
| | | const i = props.item.pollutedData.historyDataList.findIndex( |
| | | (v) => v.time == e.time |
| | | ); |
| | | indexArr.push([i - 1 < 0 ? 0 : i - 1, i]); |
| | | }); |
| | | return indexArr; |
| | | }); |
| | | |
| | | const emits = defineEmits(['showMarksAndPolygon', 'update:modelValue']); |
| | | |
| | | function showMarksAndPolygon(item) { |
| | |
| | | <div> |
| | | <el-text type="info"> |
| | | <el-icon><MapLocation /></el-icon> |
| | | {{ '所在区域:' + item.pollutedArea.address }} |
| | | {{ |
| | | '所在区域:' + |
| | | (item.pollutedArea.address ? item.pollutedArea.address : '') |
| | | }} |
| | | </el-text> |
| | | </div> |
| | | <!-- <div> |
| | |
| | | </el-text> |
| | | </div> |
| | | <el-row style="border-top: 1px solid white"> </el-row> |
| | | <div v-for="s in item.pollutedData.statisticMap" :key="s.factorId"> |
| | | <el-row justify="space-between" class="wrap"> |
| | | <div class="flex-col m-r-4"> |
| | | <div class="factor-name">{{ s.factorName }}</div> |
| | | </div> |
| | | <RealTimeLineChart |
| | | v-for="(item1, index1) in item._chartOptions" |
| | | v-for="(item1, index1) in s._chartOptions" |
| | | :key="index1" |
| | | :model-value="item1" |
| | | ></RealTimeLineChart> |
| | | </el-row> |
| | | </div> |
| | | <!-- <RealTimeLineChart |
| | | v-for="(item1, index1) in item._chartOptions" |
| | | :key="index1" |
| | | :model-value="item1" |
| | | ></RealTimeLineChart> --> |
| | | </el-scrollbar> |
| | | </template> |
| | | </BaseCard> |
| | |
| | | padding: 0 4px; |
| | | /* margin-right: 2px; */ |
| | | width: 340px; |
| | | height: 240px; |
| | | height: 260px; |
| | | /* border-right: 1px solid white; */ |
| | | border-radius: 2px; |
| | | } |
| | |
| | | padding: 0px 1px; |
| | | margin-bottom: 4px; |
| | | } |
| | | |
| | | .wrap { |
| | | border-bottom: 1px solid rgba(255, 255, 255, 0.329); |
| | | } |
| | | |
| | | .flex-col { |
| | | display: flex; |
| | | flex-direction: column; |
| | | } |
| | | |
| | | .factor-value { |
| | | font-weight: 600; |
| | | font-size: 20px; |
| | | } |
| | | |
| | | .factor-name { |
| | | color: #23dad1; |
| | | } |
| | | </style> |