|
@@ -9,20 +9,20 @@
|
|
|
<div class="alert-boxes">
|
|
|
<div class="section-title">生效预警</div>
|
|
|
<div class="alert-items">
|
|
|
- <div class="data-box1">
|
|
|
- <img src="@/assets/images/map/warningInfo/ic_ty.png" alt="台风图标" class="alert-icon" />
|
|
|
+ <div v-if="activeAlerts.some((alert) => alert.type === '台风')" class="data-box1">
|
|
|
+ <img src="@/assets/images/map/warningInfo/by_1.png" alt="台风图标" class="alert-icon" />
|
|
|
<div class="box-text1">台风</div>
|
|
|
</div>
|
|
|
- <div class="data-box2">
|
|
|
- <img src="@/assets/images/map/warningInfo/ic_tr.png" alt="暴雨图标" class="alert-icon" />
|
|
|
+ <div v-if="activeAlerts.some((alert) => alert.type === '暴雨预警')" class="data-box2">
|
|
|
+ <img src="@/assets/images/map/warningInfo/by_2.png" alt="暴雨图标" class="alert-icon" />
|
|
|
<div class="box-text1">暴雨</div>
|
|
|
</div>
|
|
|
- <div class="data-box3">
|
|
|
- <img src="@/assets/images/map/warningInfo/ic_tstorm.png" alt="雷雨大风图标" class="alert-icon" />
|
|
|
+ <div v-if="activeAlerts.some((alert) => alert.type === '雷雨大风')" class="data-box3">
|
|
|
+ <img src="@/assets/images/map/warningInfo/by_3.png" alt="雷雨大风图标" class="alert-icon" />
|
|
|
<div class="box-text1">雷雨大风</div>
|
|
|
</div>
|
|
|
- <div class="data-box4">
|
|
|
- <img src="@/assets/images/map/warningInfo/ic_ht.png" alt="高温图标" class="alert-icon" />
|
|
|
+ <div v-if="activeAlerts.some((alert) => alert.type === '高温')" class="data-box4">
|
|
|
+ <img src="@/assets/images/map/warningInfo/by_4.png" alt="高温图标" class="alert-icon" />
|
|
|
<div class="box-text1">高温</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -36,7 +36,12 @@
|
|
|
<div v-for="(count, index) in alertCounts" :key="index" class="count-item">
|
|
|
<span class="count-num">{{ count.num }}</span>
|
|
|
<img :src="getLevelImage(count.level)" :alt="`${getLevelName(count.level)}预警图标`" class="count-icon" />
|
|
|
- <span :class="['count-level', `level-${getLevelName(count.level).toLowerCase()}`]">{{ getLevelName(count.level) }}预警</span>
|
|
|
+ <span
|
|
|
+ :class="['count-level', `level-${getLevelName(count.level).toLowerCase()}`]"
|
|
|
+ :style="{ color: index === alertCounts.length - 1 ? 'blue' : '#fdfcfc' }"
|
|
|
+ >
|
|
|
+ {{ getLevelName(count.level) }}预警
|
|
|
+ </span>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -45,56 +50,46 @@
|
|
|
<div class="alert-details">
|
|
|
<table class="alert-table">
|
|
|
<thead>
|
|
|
- <tr>
|
|
|
- <th>
|
|
|
- 类型
|
|
|
- <span @click="toggleTypeDropdown" class="dropdown-trigger">
|
|
|
- <img src="@/assets/images/map/warningInfo/ic_triangle_table.png" alt="类型选择" class="dropdown-icon" />
|
|
|
- </span>
|
|
|
- <div v-if="showTypeDropdown" class="dropdown-menu">
|
|
|
- <div class="dropdown-item" :class="{ selected: selectedType === '' }" @click="selectType('')">全部</div>
|
|
|
- <div
|
|
|
- v-for="type in alertTypes"
|
|
|
- :key="type"
|
|
|
- class="dropdown-item"
|
|
|
- :class="{ selected: selectedType === type }"
|
|
|
- @click="selectType(type)"
|
|
|
+ <tr>
|
|
|
+ <th class="dropdown-trigger">
|
|
|
+ <el-select
|
|
|
+ v-model="selectedType"
|
|
|
+ placeholder="类型"
|
|
|
+ size="large"
|
|
|
+ class="custom-select2"
|
|
|
+ popper-class="custom-select-popper2"
|
|
|
+ :teleported="false"
|
|
|
>
|
|
|
- {{ type }}
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </th>
|
|
|
- <th>
|
|
|
- 等级
|
|
|
- <span @click="toggleLevelDropdown" class="dropdown-trigger">
|
|
|
- <img src="@/assets/images/map/warningInfo/ic_triangle_table.png" alt="等级选择" class="dropdown-icon" />
|
|
|
- </span>
|
|
|
- <div v-if="showLevelDropdown" class="dropdown-menu">
|
|
|
- <div class="dropdown-item" :class="{ selected: selectedLevel === '' }" @click="selectLevel('')">全部</div>
|
|
|
- <div
|
|
|
- v-for="level in alertLevels"
|
|
|
- :key="{ level }"
|
|
|
- class="dropdown-item"
|
|
|
- :class="{ selected: selectedLevel === level }"
|
|
|
- @click="selectLevel(level)"
|
|
|
+ <el-option label="全部" value="" />
|
|
|
+ <el-option v-for="type in alertTypes" :key="type" :label="type" :value="type" />
|
|
|
+ </el-select>
|
|
|
+ </th>
|
|
|
+ <th>
|
|
|
+ <el-select
|
|
|
+ v-model="selectedLevel"
|
|
|
+ placeholder="等级"
|
|
|
+ size="large"
|
|
|
+ class="custom-select2"
|
|
|
+ popper-class="custom-select-popper2"
|
|
|
+ :teleported="false"
|
|
|
>
|
|
|
- {{ level }}
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </th>
|
|
|
- <th>区域</th>
|
|
|
- <th>发布时间</th>
|
|
|
- </tr>
|
|
|
+ <el-option label="全部" value="" />
|
|
|
+ <el-option v-for="level in alertLevels" :key="level" :label="level" :value="level" />
|
|
|
+ </el-select>
|
|
|
+ </th>
|
|
|
+ <th>区域</th>
|
|
|
+ <th>发布时间</th>
|
|
|
+ </tr>
|
|
|
</thead>
|
|
|
<tbody>
|
|
|
- <tr v-for="(alert, index) in alertDetails" :key="index" class="alert-row">
|
|
|
- <td>{{ alert.type }}</td>
|
|
|
- <td>
|
|
|
- <div :class="['level-icon', alert.level.toLowerCase()]">{{ alert.level }}</div>
|
|
|
- </td>
|
|
|
- <td>{{ alert.area }}</td>
|
|
|
- <td>{{ alert.release_time }}</td>
|
|
|
- </tr>
|
|
|
+ <tr v-for="(alert, index) in alertDetails" :key="index" class="alert-row">
|
|
|
+ <td>{{ alert.type }}</td>
|
|
|
+ <td>
|
|
|
+ <div :class="['level-icon', alert.level.toLowerCase()]">{{ alert.level }}</div>
|
|
|
+ </td>
|
|
|
+ <td>{{ alert.area }}</td>
|
|
|
+ <td>{{ alert.release_time }}</td>
|
|
|
+ </tr>
|
|
|
</tbody>
|
|
|
</table>
|
|
|
</div>
|
|
@@ -298,7 +293,7 @@ export default defineComponent({
|
|
|
});
|
|
|
</script>
|
|
|
|
|
|
-<style scoped>
|
|
|
+<style lang="scss" scoped>
|
|
|
.menu-content {
|
|
|
width: 1579px;
|
|
|
height: 1394px;
|
|
@@ -356,33 +351,53 @@ export default defineComponent({
|
|
|
}
|
|
|
|
|
|
.alert-items {
|
|
|
- display: flex; /* 水平排列预警图标 */
|
|
|
- gap: 20px; /* 可选:添加间距 */
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between; /* 水平排列 */
|
|
|
+ align-items: flex-start; /* 图标与格子对齐顶部 */
|
|
|
+ flex-wrap: wrap; /* 如果内容超出宽度,则换行 */
|
|
|
+ margin-top: 20px;
|
|
|
}
|
|
|
|
|
|
.data-box1,
|
|
|
.data-box2,
|
|
|
.data-box3,
|
|
|
.data-box4 {
|
|
|
- background: url('@/assets/images/map/warningInfo/bg_选中.png') no-repeat;
|
|
|
- flex: 1; /* 让每个盒子平分父容器的宽度 */
|
|
|
- height: 180px; /* 根据需要调整高度 */
|
|
|
+ width: 350px; /* 每个盒子的宽度 */
|
|
|
+ height: 260px; /* 每个盒子的高度 */
|
|
|
+ background:
|
|
|
+ url('@/assets/images/map/warningInfo/bg_未选中.png') no-repeat,
|
|
|
+ url('@/assets/images/map/warningInfo/ic_未选中.png') no-repeat;
|
|
|
+
|
|
|
+ /* 第一个背景自适应,第二个背景设置为特定大小 */
|
|
|
+ background-size:
|
|
|
+ contain,
|
|
|
+ 40px 40px; /* 第一个背景自适应,第二个为40x40像素 */
|
|
|
+ background-position:
|
|
|
+ center,
|
|
|
+ calc(100% - 20px) calc(100% - 20px); /* 第一个背景居中,第二个背景向左下偏移10px */
|
|
|
+
|
|
|
display: flex;
|
|
|
- flex-direction: column; /* 子元素垂直排列 */
|
|
|
- align-items: center; /* 水平居中 */
|
|
|
- justify-content: center; /* 垂直居中 */
|
|
|
+ flex-direction: column;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: flex-start; /* 图标与文字对齐顶部 */
|
|
|
+ margin-right: 10px; /* 添加间距 */
|
|
|
+ position: relative; /* 为内部定位做准备 */
|
|
|
}
|
|
|
|
|
|
+
|
|
|
.alert-icon {
|
|
|
- width: 90px; /* 图标的宽度 */
|
|
|
- height: 90px; /* 图标的高度 */
|
|
|
- margin-bottom: 10px; /* 图标和文字之间的间距 */
|
|
|
+ // 向左偏移 50% 的宽度,使图标居中
|
|
|
+ margin-left: -50px;
|
|
|
+ margin-top: 30px; /* 根据需要调整位置 */
|
|
|
}
|
|
|
|
|
|
.box-text1 {
|
|
|
color: #fff;
|
|
|
font-size: 36px;
|
|
|
- text-align: center;
|
|
|
+ // 向左偏移 50% 的宽度,使文字居中
|
|
|
+ margin-left: -50px;
|
|
|
+ margin-top: auto; /* 将文字推到图片下方 */
|
|
|
+ margin-bottom: 50px; /* 根据需要调整文字与底部的间距 */
|
|
|
}
|
|
|
|
|
|
.alert-count {
|
|
@@ -417,7 +432,6 @@ export default defineComponent({
|
|
|
|
|
|
.count-num {
|
|
|
font-size: 40px; /* 根据需要调整字体大小 */
|
|
|
- top: 30px;
|
|
|
color: #fdfcfc;
|
|
|
position: absolute; /* 相对于父元素定位 */
|
|
|
}
|