riku
2025-11-05 08ffcf9d7ffafaa82d8de7f9b5fcfdb49e9c3688
动态溯源
1. 修复CO因子文本没有正常显示的问题;
已修改8个文件
已添加2个文件
288 ■■■■ 文件已修改
public/underway_mission_report - 副本.docx 补丁 | 查看 | 原始文档 | blame | 历史
public/underway_season_report - 副本.docx 补丁 | 查看 | 原始文档 | blame | 历史
public/underway_season_report.docx 补丁 | 查看 | 原始文档 | blame | 历史
src/api/index.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components.d.ts 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/mission/missionReportDownload.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/historymode/component/MissionReport.vue 240 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/realtimemode/RealtimeMode.vue 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/sourcetrace/SourceTrace.vue 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/sourcetrace/component/ClueRecordItem.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
public/underway_mission_report - ¸±±¾.docx
Binary files differ
public/underway_season_report - ¸±±¾.docx
Binary files differ
public/underway_season_report.docx
Binary files differ
src/api/index.js
@@ -2,7 +2,7 @@
import { ElMessage } from 'element-plus';
const openLog = true;
const debug = true;
const debug = false;
let ip1 = 'http://47.100.191.150:9029/';
let ws = `47.100.191.150:9031`;
src/components.d.ts
@@ -31,6 +31,7 @@
    ElConfigProvider: typeof import('element-plus/es')['ElConfigProvider']
    ElDatePicker: typeof import('element-plus/es')['ElDatePicker']
    ElDialog: typeof import('element-plus/es')['ElDialog']
    ElDivider: typeof import('element-plus/es')['ElDivider']
    ElDropdown: typeof import('element-plus/es')['ElDropdown']
    ElDropdownItem: typeof import('element-plus/es')['ElDropdownItem']
    ElDropdownMenu: typeof import('element-plus/es')['ElDropdownMenu']
@@ -39,6 +40,7 @@
    ElIcon: typeof import('element-plus/es')['ElIcon']
    ElImage: typeof import('element-plus/es')['ElImage']
    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']
src/components/mission/missionReportDownload.js
@@ -107,7 +107,7 @@
  } else {
    param.missionPeriod = '深夜';
  }
  param.region = mission.region;
  param.region = mission.region ?? '';
  param.radius = mission.radius ? `${mission.radius}公里` : '';
  // èµ°èˆªå½“日天气状况
src/views/historymode/component/MissionReport.vue
@@ -198,6 +198,19 @@
            }
          ]
        }
      ],
      clueList: [
        {
          _factorNames: 'PM2.5',
          _time: '10:22:28 - 10:22:34',
          _riskRegion: '长宁区清溪路可乐东路',
          _exceptionType: '快速上升',
          _chart: '',
          _conclusion:
            '在10:22:28至10:22:34之间,出现快速上升,VOC最低值为135.95μg/m³,最高值为135.95μg/m³,均值为135.95μg/m³,发现3个风险源,包含2个加油站,1个汽修。',
          _scenes:
            '1.上海依德汽车维修有限公司,汽修企业,位于上海市长宁区北虹路1079号,距仙霞站1887米。\r\n……'
        }
      ]
    }
  ],
@@ -341,6 +354,34 @@
}
function generateClueByRiskArea(param) {
  const indexArr = [
    'A',
    'B',
    'C',
    'D',
    'E',
    'F',
    'G',
    'H',
    'I',
    'J',
    'K',
    'L',
    'M',
    'N',
    'O',
    'P',
    'Q',
    'R',
    'S',
    'T',
    'U',
    'V',
    'W',
    'X',
    'Y',
    'Z'
  ];
  const _param = {
    area: param.area,
    startTime: param.startTime,
@@ -354,77 +395,144 @@
      .groupBy((e) => e.township)
      .map((item, index) => {
        const { key: township, values: clues } = item;
        let typeCount = {};
        let lastSceneType;
        let sceneIndex = 0;
        const _scenes = clues.flatMap((e) =>
          e.clue.pollutedSource.sceneList.map((s, index) => {
            const i = lastSceneType == s.type ? ++sceneIndex : 0;
            typeCount[s.type] = typeCount[s.type] ? typeCount[s.type] + 1 : 1;
            lastSceneType = s.type;
            return {
              des: `${s.type}${i + 1}:${s.name},位于${s.location},距${s.closestStation.name}${parseInt(s.length)}米;`
            };
          })
        );
        let _sceneDes = `走航过程中溯源到${_scenes.length}个风险源`;
        if (_scenes.length > 0) {
          _sceneDes += ',其类型是';
          _sceneDes += Object.keys(typeCount)
            .map((e) => `${e}(${typeCount[e]}个)`)
            .join('、');
          _sceneDes += ':';
        } else {
          _sceneDes = '走航过程中未溯源到风险源。';
        }
        return {
          _index: index + 1,
          // _area: `${item.sceneInfo.type}${item.sceneInfo.name}周边`,
          _area: `${township}`,
          clueByFactorList: clues
            .groupBy((e) => e.factorTag)
            .map((item2, index2) => {
              const { key: factorTag, values: clues2 } = item2;
              const factorNames = [...new Set(clues2.flatMap((e) => e.factors))]
          _sceneDes,
          _scenes,
          clueList: clues.map((item3, index3) => {
            const clue = item3.clue;
            let _riskRegion = '';
            if (
              clue.pollutedArea.address.indexOf(
                clue.pollutedArea.streetNumber
              ) == -1
            ) {
              // _riskRegion +=
              //   (clue.pollutedArea.address ?? '') +
              //   '(' +
              //   (clue.pollutedArea.street ?? '') +
              //   (clue.pollutedArea.streetNumber ?? '') +
              //   (clue.pollutedArea.direction ?? '') +
              //   ')';
              _riskRegion = clue.pollutedArea.address;
            } else {
              _riskRegion = clue.pollutedArea.address;
            }
            return {
              index: indexArr[index3],
              showPollutedArea: formObj.value.showPollutedArea,
              _title: _riskRegion,
              _factorNames: Object.keys(clue.pollutedData.statisticMap)
                .map((e) => factorName[e])
                .join('、');
              return {
                index: index2 + 1,
                factor: factorNames,
                clues: clues2.map((item3, index3) => {
                  const clue = item3.clue;
                  let _riskRegion = '';
                  if (
                    clue.pollutedArea.address.indexOf(
                      clue.pollutedArea.streetNumber
                    ) == -1
                  ) {
                    _riskRegion +=
                      (clue.pollutedArea.address ?? '') +
                      '(' +
                      (clue.pollutedArea.street ?? '') +
                      (clue.pollutedArea.streetNumber ?? '') +
                      (clue.pollutedArea.direction ?? '') +
                      ')';
                  } else {
                    _riskRegion = clue.pollutedArea.address;
                  }
                  return {
                    index: index3 + 1 + '',
                    showPollutedArea: formObj.value.showPollutedArea,
                    _title:
                      (clue.pollutedArea.street ?? '') +
                      (clue.pollutedArea.streetNumber ?? '') +
                      (clue.pollutedArea.direction ?? ''),
                    _factorNames: Object.keys(clue.pollutedData.statisticMap)
                      .map((e) => factorName[e])
                      .join('、'),
                    _time:
                      moment(clue.pollutedData.startTime).format(
                        'YYYY-MM-DD HH:mm:ss'
                      ) +
                      ' - ' +
                      moment(clue.pollutedData.endTime).format('HH:mm:ss'),
                    _riskRegion: _riskRegion,
                    _exceptionType: clue.pollutedData.exception,
                    _images: generateChartImg(clue.pollutedData),
                    _conclusion: clue.pollutedSource.conclusion,
                    _hasScene: clue.pollutedSource.sceneList.length > 0,
                    // _scenes:
                    //   clue.pollutedSource.sceneList.length > 0
                    //     ? clue.pollutedSource.sceneList
                    //         .map(
                    //           (s, index) =>
                    //             `${index + 1}. ${s.name},${s.type},位于${s.location},距${s.closestStation.name}${parseInt(s.length)}米;`
                    //         )
                    //         .join('\r\n')
                    //     : '无',
                    _scenes: clue.pollutedSource.sceneList.map((s, index) => {
                      return {
                        des: `${index + 1}. ${s.name},${s.type},位于${s.location},距${s.closestStation.name}${parseInt(s.length)}米;`
                      };
                    })
                  };
                })
              };
            })
                .join('、'),
              _date: moment(clue.pollutedData.startTime).format('YYYY-MM-DD'),
              _time:
                moment(clue.pollutedData.startTime).format('HH:mm:ss') +
                ' - ' +
                moment(clue.pollutedData.endTime).format('HH:mm:ss'),
              _riskRegion: _riskRegion,
              _exceptionType: clue.pollutedData.exception,
              _images: generateChartImg(clue.pollutedData),
              _conclusion: clue.pollutedSource.conclusion.replace(
                /,发现[0-9]*个风险源,包含[0-9]*个.*。/,
                '。'
              ),
              _hasScene: clue.pollutedSource.sceneList.length > 0
            };
          })
          // clueByFactorList: clues
          //   .groupBy((e) => e.factorTag)
          //   .map((item2, index2) => {
          //     const { key: factorTag, values: clues2 } = item2;
          //     const factorNames = [...new Set(clues2.flatMap((e) => e.factors))]
          //       .map((e) => factorName[e])
          //       .join('、');
          //     return {
          //       index: index2 + 1,
          //       factor: factorNames,
          //       clues: clues2.map((item3, index3) => {
          //         const clue = item3.clue;
          //         let _riskRegion = '';
          //         if (
          //           clue.pollutedArea.address.indexOf(
          //             clue.pollutedArea.streetNumber
          //           ) == -1
          //         ) {
          //           _riskRegion +=
          //             (clue.pollutedArea.address ?? '') +
          //             '(' +
          //             (clue.pollutedArea.street ?? '') +
          //             (clue.pollutedArea.streetNumber ?? '') +
          //             (clue.pollutedArea.direction ?? '') +
          //             ')';
          //         } else {
          //           _riskRegion = clue.pollutedArea.address;
          //         }
          //         return {
          //           index: index3 + 1 + '',
          //           showPollutedArea: formObj.value.showPollutedArea,
          //           _title:
          //             (clue.pollutedArea.street ?? '') +
          //             (clue.pollutedArea.streetNumber ?? '') +
          //             (clue.pollutedArea.direction ?? ''),
          //           _factorNames: Object.keys(clue.pollutedData.statisticMap)
          //             .map((e) => factorName[e])
          //             .join('、'),
          //           _time:
          //             moment(clue.pollutedData.startTime).format(
          //               'YYYY-MM-DD HH:mm:ss'
          //             ) +
          //             ' - ' +
          //             moment(clue.pollutedData.endTime).format('HH:mm:ss'),
          //           _riskRegion: _riskRegion,
          //           _exceptionType: clue.pollutedData.exception,
          //           _images: generateChartImg(clue.pollutedData),
          //           _conclusion: clue.pollutedSource.conclusion,
          //           _hasScene: clue.pollutedSource.sceneList.length > 0,
          //           // _scenes:
          //           //   clue.pollutedSource.sceneList.length > 0
          //           //     ? clue.pollutedSource.sceneList
          //           //         .map(
          //           //           (s, index) =>
          //           //             `${index + 1}. ${s.name},${s.type},位于${s.location},距${s.closestStation.name}${parseInt(s.length)}米;`
          //           //         )
          //           //         .join('\r\n')
          //           //     : '无',
          //           _scenes: clue.pollutedSource.sceneList.map((s, index) => {
          //             return {
          //               des: `${index + 1}. ${s.name},${s.type},位于${s.location},距${s.closestStation.name}${parseInt(s.length)}米;`
          //             };
          //           })
          //         };
          //       })
          //     };
          //   })
        };
      });
  });
src/views/realtimemode/RealtimeMode.vue
@@ -145,9 +145,10 @@
                // startTime: '2024-12-13 16:35:00',
                // startTime: '2024-11-27 11:50:41', // Pm, ä¸­è·ç¦»å·¥åœ°
                // startTime: '2024-08-30 15:27:00', // voc è¿‘距离汽修
                startTime: '2024-07-23 15:21:30',
                // startTime: '2024-07-23 15:21:30',
                // startTime: '2024-07-23 14:39:00',
                endTime: '2025-01-16 11:51:41',
                startTime: '2025-11-04 14:30:00',
                endTime: '2025-12-31 11:51:41',
                page,
                perPage: 10
              }
src/views/sourcetrace/SourceTrace.vue
@@ -232,15 +232,44 @@
    type3: 0
  };
  streams.value.forEach((v) => {
    let b2, b3;
    // åˆ¤æ–­ç›‘测因子类型是否选中
    for (const key in v.pollutedData.statisticMap) {
      const value = v.pollutedData.statisticMap[key];
      b2 = b2 || selectedFactorTypes.value.indexOf(value.factorId) != -1;
    }
    // åˆ¤æ–­åœºæ™¯ç±»åž‹æ˜¯å¦é€‰ä¸­
    if (
      v.pollutedSource == undefined ||
      v.pollutedSource.sceneList.length == 0
    ) {
      b3 = selectedSceneTypes.value.indexOf(NO_SCENE) != -1;
    } else {
      b3 =
        v.pollutedSource.sceneList.findIndex(
          (v) => selectedSceneTypes.value.indexOf(v.typeId) != -1
        ) != -1;
    }
    switch (v._type) {
      case '1':
        count.type1++;
        if (b2 && b3) {
          count.type1++;
        }
        break;
      case '2':
        count.type2++;
        b3 =
          v.sortedSceneList.findIndex(
            (v) => selectedSceneTypes.value.indexOf(v.first.typeId) != -1
          ) != -1;
        if (b3) {
          count.type2++;
        }
        break;
      case '3':
        count.type3++;
        if (b2 && b3) {
          count.type3++;
        }
        break;
    }
  });
src/views/sourcetrace/component/ClueRecordItem.vue
@@ -186,7 +186,7 @@
      case 'VOC':
        return 'VOC<sub>s</sub>';
      default:
        return '';
        return n;
    }
  };
  let name = [];