riku
2025-06-05 16eb4bd55a4fd61ddd7a171b1a07378c45d1665b
src/views/sourcetrace/SourceTrace.vue
@@ -18,14 +18,17 @@
          <!-- <div>
            <el-text type="primary" size="large" tag="b">动态溯源</el-text>
          </div> -->
          <el-scrollbar ref="scrollbarRef" :height="height" class="scrollbar">
            <el-row ref="scrollContentRef">
              <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>
                <el-row justify="space-between">
                  <!-- <el-tag v-if="index == 0" type="danger">最新</el-tag> -->
                  <el-text type="primary">{{
                    '线索时间:' +
@@ -33,6 +36,13 @@
                    ' - ' +
                    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">
@@ -46,7 +56,7 @@
                    }}
                  </el-text>
                </div>
                <el-row>
                <el-row style="border-top: 1px solid white">
                  <el-col :span="6">
                    <el-statistic
                      title="突变因子"
@@ -86,13 +96,6 @@
                      ')'
                    }}
                  </el-link> -->
                  <el-link
                    type="primary"
                    underline
                    @click="showMarksAndPolygon(item)"
                  >
                    {{ item.showMore ? '收起异常' : '定位异常' }}
                  </el-link>
                </el-row>
                <div style="width: 320px; height: 140px">
                  <RealTimeLineChart
@@ -100,6 +103,11 @@
                    :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"
@@ -156,8 +164,8 @@
                  :scene-list="item.relatedSceneList"
                ></SceneTable>
                <el-divider /> -->
              </div>
            </el-row>
              </el-scrollbar>
            </div>
          </el-scrollbar>
        </template>
      </BaseCard>
@@ -178,9 +186,7 @@
import { map, onMapMounted } from '@/utils/map/index_old';
import { FactorDatas } from '@/model/FactorDatas';
import factorDataParser from '@/utils/chart/factor-data-parser';
import websocketMsgParser from "@/views/sourcetrace/websocketMsgParser.js";
import websocketMsgParser from '@/views/sourcetrace/websocketMsgParser.js';
const props = defineProps({
  factorType: String
@@ -188,7 +194,7 @@
const emits = defineEmits(['update:factorType']);
const height = `48vh`;
const height = `30vh`;
const width = `60vh`;
const show = ref(false);
@@ -217,7 +223,7 @@
let showFirstClueTask;
function dealMsg(data) {
  const {type, content} = websocketMsgParser.parseMsg(data)
  const { type, content } = websocketMsgParser.parseMsg(data);
  // 污染线索 PollutedClue
  if (type == '1') {
@@ -229,12 +235,13 @@
    if (streams.length == 0) {
      streams.push(obj);
    } else {
      streams.forEach((s) => {
        s.showMore = false;
      });
      // streams.forEach((s) => {
      //   showMarksAndPolygon(s);
      // });
      hideAll();
      streams.unshift(obj);
      show.value = true;
    }
    show.value = true;
    // scrollToBottom();
    scrollToTop();
@@ -263,9 +270,20 @@
  // }
});
function hideAll() {
  streams.forEach((s) => {
    if (polygonMap.has(s.guid)) {
      s.showMore = false;
      map.remove(polygonMap.get(s.guid));
    }
  });
}
function showMarksAndPolygon(item) {
  item.showMore = !item.showMore;
  if (item.showMore) {
    hideAll();
    item.showMore = true;
    drawPolygon(item);
  } else {
    if (polygonMap.has(item.guid)) {
@@ -296,11 +314,11 @@
    });
    polygonMap.set(item.guid, pollutedAreaPolygon);
  }
  map.setFitView(polygonMap.get(item.guid));
  // map.setFitView(polygonMap.get(item.guid));
}
function parseChartData(obj) {
  console.log('折线图:start');
  // console.log('折线图:start');
  const factorDatas = new FactorDatas();
  factorDatas.setData(obj.pollutedData.dataVoList, 0, () => {
    obj._chartOptions = factorDataParser.parseData(factorDatas, [
@@ -310,7 +328,7 @@
        value: obj.pollutedData.factorId + ''
      }
    ]);
    console.log('折线图:', obj._chartOptions);
    // console.log('折线图:', obj._chartOptions);
  });
}
@@ -435,7 +453,7 @@
  --el-statistic-content-color: white;
}
:deep(.el-text) {
:deep(.el-text.el-text--primary) {
  --el-text-color: white;
}
@@ -446,14 +464,23 @@
.scrollbar {
  min-width: 300px;
  max-width: 60vw;
  /* height: 35vh; */
  /* color: #02ffea; */
}
.clue-card {
  padding: 0 4px;
  margin-right: 2px;
  width: 320px;
  border: 1px solid white;
  /* 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>