Files
sgxt_web/src/views/home/components/yjItem.vue

99 lines
2.5 KiB
Vue
Raw Normal View History

2025-04-15 14:38:12 +08:00
<template>
<div class="warning-card flex align-center" :class="changeBG(item.yjjb)">
<div class="warning-image">
2025-07-14 18:15:09 +08:00
<img :src="item.yjTp" width="80" height="120" alt="" />
2025-04-15 14:38:12 +08:00
</div>
<div class="warning-info">
<div class="flex just-between align-center">
<div class="flex align-center mt4">
2025-07-14 14:21:12 +08:00
<span>{{ item.yjRyxm }}</span>
2025-04-15 14:38:12 +08:00
<span class="gapline mr10 ml10"></span>
2025-07-14 14:21:12 +08:00
<span>{{ IdCard(item.yjRysfzh,2) }}</span>
2025-04-15 14:38:12 +08:00
<span class="gapline mr10 ml10"></span>
2025-07-14 14:21:12 +08:00
<span>{{ IdCard(item.yjRysfzh,3) }}</span>
2025-04-15 14:38:12 +08:00
</div>
2025-07-14 14:21:12 +08:00
<span class="tag" v-if="item.yjbqmc">{{ item.yjbqmc }}</span>
2025-04-15 14:38:12 +08:00
</div>
2025-07-14 14:21:12 +08:00
<div class="mt4">身份证{{ item.yjRysfzh }}</div>
<div class="mt4 one_text_detail">预警地址{{ item.yjDz }}</div>
<div class="mt4 two_text_detail">预警内容{{ item.yjNr }}</div>
2025-04-15 14:38:12 +08:00
</div>
</div>
</template>
<script setup>
2025-07-14 14:21:12 +08:00
import { IdCard } from '@/utils/validate.js'
2025-04-15 14:38:12 +08:00
import { reactive, ref } from "vue";
const props = defineProps({
item: {
type: Object,
default: {}
}
});
const changeBG = (str) => {
switch(str){
case "10":
return "red";
case "20":
return "orange";
case "30":
return "yellow";
default:
return "blue";
}
};
</script>
<style lang="scss" scoped>
.warning-card {
background: url("~@/assets/images/GroupBlue.png") no-repeat center center;
background-size: 100% 100%;
gap: 12px;
margin-bottom: 4px;
padding: 10px;
box-sizing: border-box;
.warning-image {
width: 80px;
height: 100px;
img {
width: 100%;
height: 100%;
object-fit: cover;
}
}
.warning-info {
flex: 1;
.tag{
padding: 1px 6px;
background: #0072FF;
border-radius: 2px 2px 2px 2px;
font-size: 12px;
}
.gapline{
width: 2px;
height: 14px;
background: #e9e9e9;
}
}
}
.red {
background: url("~@/assets/images/GroupRed.png") no-repeat center center;
background-size: 100% 100%;
}
.orange {
background: url("~@/assets/images/GroupOrange.png") no-repeat center center;
background-size: 100% 100%;
}
.yellow {
background: url("~@/assets/images/GroupYellow.png") no-repeat center center;
background-size: 100% 100%;
}
.blue {
background: url("~@/assets/images/GroupBlue.png") no-repeat center center;
background-size: 100% 100%;
}
</style>