riku
2025-07-18 306ef09707d6bcf9ffa67de55f86ab6f4362deee
src/views/sourcetrace/component/PollutedExceptionItem.vue
@@ -38,7 +38,10 @@
        <div>
          <el-text type="info">
            <el-icon><MapLocation /></el-icon>
            {{ '风险区域:' + item.pollutedArea.address }}
            {{
              '风险区域:' +
              (item.pollutedArea.address ? item.pollutedArea.address : '')
            }}
          </el-text>
        </div>
        <!-- <div>
@@ -52,37 +55,45 @@
            异常类型:{{ 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
              v-if="item.pollutedData.exceptionType == 4"
              title="变化幅度"
              :value="formatPercentage(item.pollutedData.avgPer)"
            />
            <el-statistic
              v-else-if="item.pollutedData.exceptionType == 9"
              title="变化速率"
              :value="formatChangeRate(item.pollutedData.avgRate)"
              suffix=""
            />
          </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>
        <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-col>
            <el-col :span="6">
              <el-statistic
                v-if="item.pollutedData.exceptionType == 4"
                title="变化幅度"
                :value="formatPercentage(s.avgPer)"
              />
              <el-statistic
                v-else-if="item.pollutedData.exceptionType == 9"
                title="变化速率"
                :value="formatChangeRate(s.avgRate)"
                suffix=""
              />
            </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"
                :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
                    type="info"
@@ -98,13 +109,6 @@
                  </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>
@@ -123,13 +127,24 @@
  </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) {