| | |
| | | <template> |
| | | <el-row> |
| | | <el-col v-if="direction == 'right'" span="2" class="flex-col"> |
| | | <el-row justify="end"> |
| | | <el-row |
| | | :style=" |
| | | direction == 'left' |
| | | ? 'flex-direction: row;' |
| | | : 'flex-direction: row-reverse' |
| | | " |
| | | > |
| | | <el-col span="2" class="flex-col"> |
| | | <el-row :justify="direction == 'left' ? 'end' : 'start'"> |
| | | <CardButton |
| | | direction="left" |
| | | :direction="direction" |
| | | name="动态溯源" |
| | | @click="handleDisplayChange" |
| | | ></CardButton> |
| | | </el-row> |
| | | <el-row class="flex-col"> |
| | | <PollutedWarnItem |
| | | :item="selectedWarning" |
| | | @showMarksAndPolygon="showMarksAndPolygon" |
| | | ></PollutedWarnItem> |
| | | <PollutedExceptionItem |
| | | :item="selectedException" |
| | | @showMarksAndPolygon="showMarksAndPolygon" |
| | | ></PollutedExceptionItem> |
| | | <PollutedClueItem |
| | | v-model="clueDialog" |
| | | :item="selectedClue" |
| | | ></PollutedClueItem> |
| | | </el-row> |
| | | </el-col> |
| | | <el-col v-show="show" span="10"> |
| | |
| | | <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> --> |
| | | <!-- 数据切片统计 --> |
| | | <div style="border-left: 1px solid white" class="p-l-8"> |
| | | <el-space direction="vertical"> |
| | | <el-text type="primary">溯源:{{ countMsg1.type1 }}条</el-text> |
| | | <el-text type="primary">线索:{{ countMsg1.type2 }}条</el-text> |
| | | <el-text type="primary">提醒:{{ countMsg1.type3 }}条</el-text> |
| | | <el-text type="info">溯源:{{ countMsg1.type1 }}条</el-text> |
| | | <el-text type="info">线索:{{ countMsg1.type2 }}条</el-text> |
| | | <el-text type="info">提醒:{{ countMsg1.type3 }}条</el-text> |
| | | </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" |
| | |
| | | </template> |
| | | </BaseCard> |
| | | </el-col> |
| | | <el-col v-if="direction == 'left'" span="2" class="flex-col"> |
| | | <!-- <el-col v-if="direction == 'left'" span="2" class="flex-col"> |
| | | <el-row justify="start"> |
| | | <CardButton |
| | | direction="right" |
| | |
| | | :item="selectedException" |
| | | @showMarksAndPolygon="showMarksAndPolygon" |
| | | ></PollutedExceptionItem> |
| | | <PollutedClueItem |
| | | v-model="clueDialog" |
| | | :item="selectedClue" |
| | | ></PollutedClueItem> |
| | | </el-row> |
| | | </el-col> |
| | | <PollutedClueItem |
| | | v-model="clueDialog" |
| | | :item="selectedClue" |
| | | ></PollutedClueItem> |
| | | </el-col> --> |
| | | </el-row> |
| | | </template> |
| | | <script setup> |
| | |
| | | import ClueRecordItem from './component/ClueRecordItem.vue'; |
| | | import PollutedClueItem from '@/views/sourcetrace/component/PollutedClueItem.vue'; |
| | | import SourceTraceFilter from '@/views/sourcetrace/component/SourceTraceFilter.vue'; |
| | | import PollutedWarnItem from './component/PollutedWarnItem.vue'; |
| | | |
| | | const NO_SCENE = 'no_scene'; |
| | | |
| | |
| | | const props = defineProps({ |
| | | direction: { |
| | | type: String, |
| | | default: 'left' |
| | | default: 'right' |
| | | }, |
| | | factorType: String, |
| | | // 模式,realtime:实时模式;history:历史数据模式 |
| | |
| | | const emits = defineEmits(['update:factorType']); |
| | | |
| | | const show = ref(false); |
| | | const clueDialog = ref(false); |
| | | const scrollContentRef = ref(); |
| | | const scrollbarRef = ref(); |
| | | |
| | | const selectedWarning = ref(); |
| | | const selectedException = ref(); |
| | | const selectedClue = ref(); |
| | | const clueDialog = ref(false); |
| | | |
| | | const selectedMsgTypes = ref(['1', '2', '3']); |
| | | const selectedFactorTypes = ref([]); |
| | | const factorOptions = ref([]); |
| | | const selectedSceneTypes = ref([]); |
| | | const sceneOptions = ref([]); |
| | | |
| | | const loading = ref(false); |
| | | |
| | | function handleDisplayChange() { |
| | | show.value = !show.value; |
| | |
| | | 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) { |
| | | if ( |
| | | v.pollutedSource == undefined || |
| | | v.pollutedSource.sceneList.length == 0 |
| | | ) { |
| | | b3 = selectedSceneTypes.value.indexOf(NO_SCENE) != -1; |
| | | } else { |
| | | b3 = |
| | |
| | | case '1': |
| | | case '3': |
| | | // 筛选监测因子类型 |
| | | if ( |
| | | factorOptions.value.findIndex( |
| | | (v) => v.value == objData.pollutedData.factorId |
| | | ) == -1 |
| | | ) { |
| | | factorOptions.value.push({ |
| | | label: objData.pollutedData.factorName, |
| | | value: objData.pollutedData.factorId |
| | | }); |
| | | selectedFactorTypes.value.push(objData.pollutedData.factorId); |
| | | } |
| | | // 筛选场景类型 |
| | | if (objData.pollutedSource.sceneList.length == 0) { |
| | | // 若没有找到风险源时,将该分类设定为null |
| | | if (sceneOptions.value.findIndex((v) => v.value == NO_SCENE) == -1) { |
| | | sceneOptions.value.push({ |
| | | label: '无', |
| | | value: NO_SCENE |
| | | for (const key in objData.pollutedData.statisticMap) { |
| | | const value = objData.pollutedData.statisticMap[key]; |
| | | if ( |
| | | factorOptions.value.findIndex((v) => v.value == value.factorId) == -1 |
| | | ) { |
| | | factorOptions.value.push({ |
| | | label: value.factorName, |
| | | value: value.factorId |
| | | }); |
| | | selectedSceneTypes.value.push(NO_SCENE); |
| | | selectedFactorTypes.value.push(value.factorId); |
| | | } |
| | | } else { |
| | | objData.pollutedSource.sceneList.forEach((s) => { |
| | | if (sceneOptions.value.findIndex((v) => v.value == s.typeId) == -1) { |
| | | } |
| | | |
| | | // 筛选场景类型 |
| | | if (objData.pollutedSource != undefined) { |
| | | if (objData.pollutedSource.sceneList.length == 0) { |
| | | // 若没有找到风险源时,将该分类设定为null |
| | | if (sceneOptions.value.findIndex((v) => v.value == NO_SCENE) == -1) { |
| | | sceneOptions.value.push({ |
| | | label: s.type, |
| | | value: s.typeId |
| | | label: '未知', |
| | | value: NO_SCENE |
| | | }); |
| | | selectedSceneTypes.value.push(s.typeId); |
| | | selectedSceneTypes.value.push(NO_SCENE); |
| | | } |
| | | }); |
| | | } else { |
| | | objData.pollutedSource.sceneList.forEach((s) => { |
| | | if ( |
| | | sceneOptions.value.findIndex((v) => v.value == s.typeId) == -1 |
| | | ) { |
| | | sceneOptions.value.push({ |
| | | label: s.type, |
| | | value: s.typeId |
| | | }); |
| | | selectedSceneTypes.value.push(s.typeId); |
| | | } |
| | | }); |
| | | } |
| | | } |
| | | // case '2': |
| | | // break; |
| | |
| | | } |
| | | |
| | | function fetchPollutionTraceHistory() { |
| | | dataAnalysisApi.fetchPollutionTraceHistory(props.missionCode).then((res) => { |
| | | const objList = JSON.parse(res.data); |
| | | objList.forEach((obj) => { |
| | | obj._type = obj.msgType + ''; |
| | | if (obj._type == '1') { |
| | | obj.showMore = false; |
| | | show.value = true; |
| | | parseChartData(obj); |
| | | } else if (obj._type == '2') { |
| | | obj._timestr = timeFormatter(obj.time); |
| | | } else if (obj._type == '3') { |
| | | parseChartData(obj); |
| | | } |
| | | optionsFilte(obj); |
| | | }); |
| | | streams.value = objList; |
| | | }); |
| | | loading.value = true; |
| | | dataAnalysisApi |
| | | .fetchPollutionTraceHistory(props.missionCode) |
| | | .then((res) => { |
| | | factorOptions.value = []; |
| | | selectedFactorTypes.value = []; |
| | | sceneOptions.value = []; |
| | | selectedSceneTypes.value = []; |
| | | const objList = JSON.parse(res.data); |
| | | objList.forEach((obj) => { |
| | | obj._type = obj.msgType + ''; |
| | | if (obj._type == '1') { |
| | | obj.showMore = false; |
| | | show.value = true; |
| | | parseChartData(obj); |
| | | } else if (obj._type == '2') { |
| | | obj._timestr = timeFormatter(obj.time); |
| | | } else if (obj._type == '3') { |
| | | parseChartData(obj); |
| | | } |
| | | optionsFilte(obj); |
| | | }); |
| | | streams.value = objList; |
| | | }) |
| | | .finally(() => (loading.value = false)); |
| | | } |
| | | |
| | | onMounted(() => { |
| | |
| | | ); |
| | | |
| | | function handleOpen(item) { |
| | | // 去除上一个“溯源”和“提醒”消息的选中标志 |
| | | if (selectedWarning.value && selectedWarning.value._selected) { |
| | | selectedWarning.value._selected = false; |
| | | showMarksAndPolygon(selectedWarning.value); |
| | | } |
| | | if (selectedException.value && selectedException.value._selected) { |
| | | selectedException.value._selected = false; |
| | | showMarksAndPolygon(selectedException.value); |
| | | } |
| | | if (selectedClue.value && selectedClue.value._selected) { |
| | | selectedClue.value._selected = false; |
| | | clueDialog.value = false; |
| | | } |
| | | switch (item._type) { |
| | | case '1': |
| | | case '3': |
| | | if (selectedException.value) { |
| | | selectedException.value._selected = false; |
| | | } |
| | | // 显示当前选中的相关地图标记 |
| | | showMarksAndPolygon(item); |
| | | // 更新选中的对象 |
| | | selectedException.value = item; |
| | | break; |
| | | case '2': |
| | | if (selectedClue.value) { |
| | | selectedClue.value._selected = false; |
| | | } |
| | | selectedClue.value = item; |
| | | clueDialog.value = true; |
| | | break; |
| | | case '3': |
| | | showMarksAndPolygon(item); |
| | | selectedWarning.value = item; |
| | | break; |
| | | } |
| | | item._selected = true; |
| | |
| | | } else { |
| | | if (polygonMap.has(item.guid)) { |
| | | map.remove(polygonMap.get(item.guid)); |
| | | selectedException.value._selected = false; |
| | | item._selected = false; |
| | | } |
| | | } |
| | | } |
| | |
| | | ); |
| | | const factorDatas = new FactorDatas(); |
| | | factorDatas.setData(obj.pollutedData.historyDataList, 0, () => { |
| | | obj._chartOptions = factorDataParser.parseData(factorDatas, [ |
| | | { |
| | | label: obj.pollutedData.factorName, |
| | | name: obj.pollutedData.factorName, |
| | | value: obj.pollutedData.factorId + '' |
| | | } |
| | | ]); |
| | | for (const key in obj.pollutedData.statisticMap) { |
| | | const value = obj.pollutedData.statisticMap[key]; |
| | | value._chartOptions = factorDataParser.parseData(factorDatas, [ |
| | | { |
| | | 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-statistic-content-color: white; |
| | | } |
| | | |
| | | :deep(.el-text.el-text--primary) { |
| | | :deep(.el-text.el-text--info) { |
| | | --el-text-color: white; |
| | | } |
| | | |