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

165 lines
4.3 KiB
Vue
Raw Normal View History

2025-08-01 17:16:03 +08:00
<template>
2025-10-26 12:25:50 +08:00
<div class="warning-card" :style="{'border':`1px solid ${changeBG(item.yjJb)}`}" >
2025-08-01 17:16:03 +08:00
<div class="warning-image flex">
2025-10-26 12:25:50 +08:00
<!-- -->
<template v-if="!item.yjTp || item.yjTp.includes('baidu')">
<img src="@/assets/images/car.png" width="65" height="70" v-if="item.yjLx == 2" />
<img src="@/assets/images/default_male.png" width="65" height="70" v-else />
2025-10-09 21:33:58 +08:00
</template>
2025-10-26 12:25:50 +08:00
<el-image v-else style="width: 65px; height: 70px" :src="item.yjTp" :preview-src-list="[item.yjTp]" show-progress>
<template #error>
<div class="image-slot error">
<img src="@/assets/images/car.png" width="65" height="70" v-if="item.yjLx == 2" />
<img src="@/assets/images/default_male.png" width="65" height="70" v-else />
</div>
</template>
</el-image>
2025-10-09 21:33:58 +08:00
2025-08-01 17:16:03 +08:00
<div class="ml10 warning-info">
<div class="flex just-between align-center">
<div class="flex align-center mt4" v-if="item.yjLx == 2">
2025-10-26 12:25:50 +08:00
<span>{{ item.yjClcph }}</span>
</div>
2025-08-01 17:16:03 +08:00
<div class="flex align-center mt4" v-else>
<span>{{ item.yjRyxm }}</span>
<span class="gapline mr10 ml10"></span>
<span>{{ IdCard(item.yjRysfzh, 2) }}</span>
<span class="gapline mr10 ml10"></span>
<span>{{ IdCard(item.yjRysfzh, 3) }}</span>
</div>
2025-10-26 12:25:50 +08:00
<span class="tag" v-if="item.yjbqmc" :style="{'background':`${changeBG(item.yjJb)}`}">{{ item.yjbqmc }}</span>
</div>
<div v-if="item.yjLx == 2" class="flex">车牌类型
<DictTag :tag="false" :value="item.yjHplx" color="#fff" :options="dict.D_BZ_HPZL" />
2025-08-01 17:16:03 +08:00
</div>
<div class="mt4" v-else>身份证{{ item.yjRysfzh }}</div>
<div class="mt4 two_text_detail">预警时间{{ item.yjSj }}</div>
</div>
</div>
<div class="warning-info warning-boder pb5">
<div class="mt4 two_text_detail">预警内容{{ item.yjNr }}</div>
</div>
<div class="warning-info pt5 pb5 warning-boder">
<div class="mt4 two_text_detail">处置结果{{ item.yjNr }}</div>
</div>
<div class="warning-info pt5 ">
2025-10-26 12:25:50 +08:00
<div class="two_text_detail flex lh25"><img src="@/assets/images/ddtb.png" width="20" height="25" alt=""
srcset="">{{
item.yjNr }}</div>
2025-08-01 17:16:03 +08:00
</div>
</div>
</template>
<script setup>
import { IdCard } from '@/utils/validate.js'
import { reactive, ref } from "vue";
const props = defineProps({
item: {
type: Object,
default: {}
}, dict: {
tupe: Object,
default: {}
}
});
const changeBG = (str) => {
switch (str) {
case "10":
return "red";
case "20":
return "orange";
case "30":
2025-10-26 12:25:50 +08:00
return "#b5b522";
2025-08-01 17:16:03 +08:00
default: return "blue";
}
};
</script>
<style lang="scss" scoped>
.warning-card {
2025-10-26 12:25:50 +08:00
// background: url("~@/assets/images/xxxxxx.png") no-repeat center center;
2025-08-01 17:16:03 +08:00
background-size: 100% 100%;
2025-10-26 12:25:50 +08:00
2025-08-01 17:16:03 +08:00
gap: 12px;
margin-bottom: 4px;
padding: 10px;
box-sizing: border-box;
.warning-image {
2025-10-09 21:33:58 +08:00
//
2025-08-01 17:16:03 +08:00
// width: 80px;
// height: 100px;
// img {
// width: 100%;
// height: 100%;
// object-fit: cover;
// }
}
.warning-info {
flex: 1;
2025-10-09 21:33:58 +08:00
2025-08-01 17:16:03 +08:00
.tag {
padding: 1px 6px;
background: #0072FF;
border-radius: 2px 2px 2px 2px;
font-size: 12px;
}
.gapline {
width: 2px;
height: 14px;
background: #e9e9e9;
}
}
2025-10-09 21:33:58 +08:00
// 图片错误状态样式
.image-slot {
display: flex;
align-items: center;
justify-content: center;
width: 100%;
height: 100%;
background-color: #f5f5f5;
border-radius: 4px;
}
// 主图错误和预览图错误的样式
.image-slot.error,
.image-slot.viewer-error {
display: flex;
align-items: center;
justify-content: center;
width: 100%;
height: 100%;
}
2025-10-26 12:25:50 +08:00
.warning-boder {
border-bottom: 2px dashed #0958b2;
2025-08-01 17:16:03 +08:00
}
}
.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>