fix: BUG修改

This commit is contained in:
kun 2024-03-18 19:27:25 +08:00
parent 502fd719e1
commit abed7685a7
3 changed files with 137 additions and 115 deletions

View File

@ -46,14 +46,13 @@ const deviceStatusOptions = ref([
{ label: "心跳", value: 2 }, { label: "心跳", value: 2 },
]) as any; ]) as any;
let list = ref([]); let list = ref([] as any);
const refScrollbar = ref(null as any); // const refScrollbar = ref(null as any); //
const ScrollbarTop = ref(0);
let moreScroll = ref(true as any); let moreScroll = ref(true as any);
let pageNo = ref(1 as any); let pageNo = ref(1 as any);
let pageSize = ref(20 as any); let pageSize = ref(30 as any);
// //
const getSmokeAlarmRecordList = async () => { const getSmokeAlarmRecordList = async () => {
@ -96,7 +95,6 @@ onMounted(() => {
getMoreSmokeRecordList(); getMoreSmokeRecordList();
} }
} }
ScrollbarTop.value = scrollTop;
}); });
getSmokeAlarmRecordList(); getSmokeAlarmRecordList();
}); });
@ -124,7 +122,7 @@ onMounted(() => {
padding: 2%; padding: 2%;
position: relative; position: relative;
.list-content { .list-content {
height: 95%; height: 100%;
width: 100%; width: 100%;
// background: url("@/assets/images/cardImg.png") no-repeat; // background: url("@/assets/images/cardImg.png") no-repeat;
// background-size: 100% 100%; // background-size: 100% 100%;
@ -148,7 +146,7 @@ onMounted(() => {
} }
} }
.list-box { .list-box {
height: 100%; height: 92%;
.list-style:nth-child(even) { .list-style:nth-child(even) {
background: rgba(39, 88, 192, 0.06); background: rgba(39, 88, 192, 0.06);
} }

View File

@ -23,7 +23,7 @@ const store = GlobalStore();
const realCountTotal = ref({} as any); const realCountTotal = ref({} as any);
// //
const getMemberCareList = async () => { const getMemberCareList = async () => {
const res: any = await getEntryAndExitCountApi({ projectSn: store.sn, isOpen: 1 }); const res: any = await getEntryAndExitCountApi({ projectSn: store.sn });
console.log("获取出入场车辆统计", res); console.log("获取出入场车辆统计", res);
if (res.success) { if (res.success) {
realCountTotal.value = res.result; realCountTotal.value = res.result;

View File

@ -17,22 +17,22 @@
<div>进出场图片</div> <div>进出场图片</div>
<div>全景图照片</div> <div>全景图照片</div>
</div> </div>
<el-scrollbar class="listBox" ref="refScrollbar">
<div class="listBox"> <template v-if="vehicleData.length > 0">
<div v-for="(item, index) in vehicleData" class="listStyle" :key="item.id"> <div v-for="(item, index) in vehicleData" class="listStyle" :key="item.id">
<div>{{ index + 1 }}</div> <div>{{ index + 1 }}</div>
<div>{{ item.carNumber }}</div> <div>{{ item.carNumber }}</div>
<div>{{ item.passTime }}</div> <div>{{ item.passTime }}</div>
<div>{{ item.type==1?'出':'进' }}</div> <div>{{ item.type == 1 ? "出" : "进" }}</div>
<div>{{ item.location }}</div> <div>{{ item.location }}</div>
<div>{{ item.carColor }}</div> <div>{{ item.carColor }}</div>
<div>{{ item.carType ? carTypeList[item.carType-1].name:''}}</div> <div>{{ item.carType ? carTypeList[item.carType - 1].name : "" }}</div>
<div class="list-img"> <div class="list-img">
<el-image <el-image
fit="contain" fit="contain"
class="el-img" class="el-img"
:src="item.imageUrl" :src="BASEURL + '/image/' + item.imageUrl"
:preview-src-list="[item.imageUrl]" :preview-src-list="[BASEURL + '/image/' + item.imageUrl]"
> >
</el-image> </el-image>
</div> </div>
@ -40,17 +40,18 @@
<el-image <el-image
fit="contain" fit="contain"
class="el-img" class="el-img"
:src="item.panoramaUrl" :src="BASEURL + '/image/' + item.panoramaUrl"
:preview-src-list="[item.panoramaUrl]" :preview-src-list="[BASEURL + '/image/' + item.panoramaUrl]"
> >
</el-image> </el-image>
</div> </div>
</div> </div>
</template>
<div class="notoDta" v-if="vehicleData.length == 0"> <div class="notoDta" v-if="vehicleData.length == 0">
<img src="@/assets/images/noData.png" alt="" /> <img src="@/assets/images/noData.png" alt="" />
<p>暂无数据</p> <p>暂无数据</p>
</div> </div>
</div> </el-scrollbar>
</div> </div>
</div> </div>
</template> </template>
@ -61,41 +62,71 @@ import { getEntryAndExitListApi } from "@/api/modules/vehicle";
import { GlobalStore } from "@/stores"; import { GlobalStore } from "@/stores";
const store = GlobalStore(); const store = GlobalStore();
const BASEURL = import.meta.env.VITE_API_URL; const BASEURL = import.meta.env.VITE_API_URL;
const carTypeList = ref([{ const pageNo = ref(1 as any);
value: '1', const pageSize = ref(10 as any);
name: '白名单', const moreScroll = ref(true as any);
},{ const refScrollbar = ref(null as any); //
value: '2', const carTypeList = ref([
name: '黑名单', {
},{ value: "1",
value: '3', name: "白名单"
name: '临时车', },
}]) {
value: "2",
name: "黑名单"
},
{
value: "3",
name: "临时车"
}
]);
const vehicleData = ref([] as any); const vehicleData = ref([] as any);
// //
const checked = ref(1); const checked = ref(1);
const getDateData = (type: any) => { const getDateData = (type: any) => {
checked.value = type; checked.value = type;
getVehicleList(); pageNo.value = 1;
} moreScroll.value = true;
const getVehicleList = async () => { refScrollbar.value.wrapRef.scrollTop = 0; //
getVehicleList("search");
};
const getVehicleList = async (tip: any) => {
const res: any = await getEntryAndExitListApi({ const res: any = await getEntryAndExitListApi({
projectSn: store.sn, projectSn: store.sn,
type: checked.value timeType: checked.value,
pageNo: pageNo.value,
pageSize: pageSize.value
}); });
if (res.result) { if (res.result) {
vehicleData.value = res.result.records if (tip == "more") {
if(vehicleData.value && vehicleData.value.length > 0){ vehicleData.value = vehicleData.value.concat(res.result.records);
vehicleData.value.map((item:any) => { } else {
item.imageUrl = BASEURL + '/' + item.imageUrl vehicleData.value = res.result.records;
item.panoramaUrl = BASEURL + '/' + item.panoramaUrl }
}) if (res.result.pages == pageNo.value) {
moreScroll.value = false;
} else {
pageNo.value = pageNo.value + 1;
} }
} }
}; };
onMounted(async () => { onMounted(async () => {
await getVehicleList(); // console.log("", refScrollbar.value);
refScrollbar.value.wrapRef.addEventListener("scroll", (e: any) => {
const scrollTop = e.target.scrollTop;
const scrollHeight = e.target.scrollHeight;
const clientHeight = e.target.clientHeight;
// console.log("", scrollTop, scrollHeight, clientHeight);
//
if (scrollTop >= scrollHeight - clientHeight) {
// console.log("");
if (moreScroll.value) {
getVehicleList("more");
}
}
});
await getVehicleList("search");
}); });
</script> </script>
@ -178,24 +209,17 @@ onMounted(async () => {
} }
} }
.listBox { .listBox {
height: 300px; height: 80%;
overflow-y: scroll;
.listStyle { .listStyle {
display: flex; display: flex;
justify-content: space-around; justify-content: space-around;
color: #fff; color: #fff;
height: 10%;
line-height: 25px; line-height: 25px;
font-size: calc(100vw * 12 / 1920); font-size: calc(100vw * 12 / 1920);
.list-img { .list-img {
.el-img { .el-img {
width: 35%; width: 50px;
img { height: 25px;
display: flex;
align-items: center;
width: 100%;
height: 100%;
}
} }
} }
div { div {
@ -224,5 +248,5 @@ onMounted(async () => {
margin: -6% 37%; margin: -6% 37%;
text-align: center; text-align: center;
} }
} }
</style> </style>