Files
xzlz_JczWeb/src/views/home/components/PeoWarning.vue

159 lines
3.3 KiB
Vue
Raw Normal View History

2025-06-02 20:25:19 +08:00
<template>
<div
class="waning-cards noScollLine"
v-infinite-scroll="rollingLoading"
v-loading="loading"
>
<div
class="warning-card"
v-for="(item, index) in warningList.data"
:key="index"
>
<div class="warning-image">
<img :src="item.yjTp" alt="预警图片" />
</div>
<div class="warning-info">
<div class="info-item">
<span class="label">姓名</span>
<span>{{ item.yjRyxm }}</span>
<span class="tag">{{ item.yjBt }}</span>
</div>
<div class="info-item flex">
<span class="label">性别</span>
<dict-tag
:options="D_BZ_XB"
:value="IdCard(item.yjRysfzh, 3)"
:tag="false"
></dict-tag>
</div>
<div class="info-item">
<span class="label">相似度</span>
<span class="highlight">{{ item.xsd }}%</span>
</div>
<div class="info-item">
<span class="label">预警时间</span>
<span>{{ item.yjSj }}</span>
</div>
<div class="info-item flex align-center">
<span class="label nowrap">抓拍地址</span>
<span class="one_text_detail">{{ item.yjDz }}</span>
</div>
</div>
</div>
<Empty :show="warningList.data.length == 0" :imgSize="100" />
</div>
</template>
<script setup>
import { reactive, ref, getCurrentInstance } from "vue";
import { jczgetPageList } from "@/api/mosty-jcz.js";
import { IdCard } from "@/utils/dict.js";
import Empty from "@/components/MyComponents/Empty/index.vue";
const props = defineProps({
jczId: {
type: String,
default: ""
}
});
const warningList = reactive({
data: [],
total: 0
});
const loading = ref(false);
const linkQuery = ref({
yjLx: 1,
pageNum: 1,
pageSize: 10,
jczid: props.jczId
});
// 获取预警数据
const getPageList = () => {
loading.value = true;
jczgetPageList(linkQuery.value)
.then((res) => {
warningList.data =
linkQuery.value.pageNum == 1
? res.records
: warningList.data.concat(res.records);
warningList.total = res.total;
})
.catch((err) => {
console.log("预警数据请求错误", err);
})
.finally(() => {
loading.value = false;
});
};
//滚动
const rollingLoading = () => {
if (warningList.data.length < warningList.total) {
linkQuery.value.pageNum++;
getPageList();
}
};
getPageList();
</script>
<style lang="scss" scoped>
.waning-cards {
height: 100%;
overflow: hidden;
overflow-y: auto;
}
.warning-card {
background: url("~@/assets/images/bg_10.png") no-repeat center center;
background-size: 100% 100%;
display: flex;
align-items: center;
gap: 20px;
margin-bottom: 4px;
padding: 4px 4px 4px 10px;
box-sizing: border-box;
}
.warning-image {
width: 100px;
height: 80px;
img {
width: 100%;
height: 100%;
}
}
.warning-image img {
width: 100%;
height: 100%;
object-fit: cover;
}
.warning-info {
flex: 1;
}
.info-item {
margin-bottom: 4px;
color: #fff;
font-size: 14px;
}
.label {
color: rgba(255, 255, 255, 0.7);
}
.highlight {
color: #00f0ff;
}
.tag {
background: rgba(250, 177, 21, 0.2);
border-radius: 8px;
border: 1px solid #ffac26;
color: #fff;
padding: 2px 8px;
border-radius: 10px;
font-size: 12px;
margin-left: 10px;
}
</style>