riku
2025-06-12 a3b2d94cbfb9bea819346a1b738237f72819a833
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
<template>
  <div :class="'wrapper' + (item._selected ? ' wrapper-select' : '')">
    <div v-if="item._type == '1'">
      <el-row justify="space-between">
        <el-space>
          <el-tag v-if="noWarn" type="info" effect="dark" size="small"
            >异常</el-tag
          >
          <el-tag v-else type="warning" effect="dark" size="small">异常</el-tag>
          <el-text type="primary">{{
            item.pollutedData.startTime + ' - ' + item.pollutedData.endTime
          }}</el-text>
        </el-space>
        <el-link type="primary" @click="emits('open', item)"> 详情 </el-link>
      </el-row>
      <el-col :span="24">
        <el-text type="primary">{{
          item.pollutedData.factorName +
          formatException(item.pollutedData.exceptionType) +
          ',' +
          formatDistanceType(item.pollutedArea.distanceType)
        }}</el-text>
        <el-text :type="noWarn ? 'primary' : 'warning'">
          {{
            item.pollutedSource.sceneList.length == 0
              ? '未找到可疑污染源'
              : '找到' + item.pollutedSource.sceneList.length + '个可疑污染源'
          }}
        </el-text>
      </el-col>
      <!-- <el-col :span="2"> </el-col> -->
    </div>
    <div v-else-if="item._type == '2'">
      <el-row justify="space-between">
        <el-tag type="danger" effect="dark" size="small">线索</el-tag>
        <el-link type="primary" @click="emits('open')"> 详情 </el-link>
      </el-row>
      <el-text type="danger">{{ item.advice }}</el-text>
    </div>
  </div>
</template>
<script setup>
import { computed } from 'vue';
 
const props = defineProps({
  item: Object
});
 
const emits = defineEmits(['open']);
 
const noWarn = computed(() => {
  return props.item && props.item.pollutedSource.sceneList.length == 0;
});
 
function formatException(value) {
  switch (value) {
    case 4:
      return '量级突变';
    case 9:
      return '快速上升';
    default:
      return '量级突变';
  }
}
 
function formatDistanceType(value) {
  switch (value) {
    case 'TYPE1':
      return '50米以内';
    case 'TYPE2':
      return '50米 - 500米以内';
    case 'TYPE3':
      return '50米 - 1公里以内';
    case 'TYPE4':
      return '50米 - 2公里以内';
 
    default:
      break;
  }
}
</script>
<style scoped>
.wrapper {
  margin-bottom: 8px;
  border-bottom: 1px dashed rgba(253, 253, 253, 0.651);
}
.wrapper-select {
  background: linear-gradient(
    rgba(228, 228, 228, 0.274),
    rgba(64, 165, 248, 0.089)
  );
}
.no-warning {
  color: var(--el-text-color-disabled) !important;
}
</style>