This commit is contained in:
13684185576
2025-11-06 14:33:56 +08:00
parent 6538af0c59
commit b6dc821182
2 changed files with 39 additions and 22 deletions

View File

@ -2,14 +2,22 @@
<div class="info-container"> <div class="info-container">
<div class="title">时间轴</div> <div class="title">时间轴</div>
<template v-for="(item, index) in data" :key="index"> <template v-for="(item, index) in data" :key="index">
<div :class="['item', { 'disabled': !item?.dkKsSj }]"> <div :class="['item', { disabled: !item?.dkKsSj }]">
<div class="point"></div> <div class="point"></div>
<div class="info-right"> <div class="info-right">
<div class="name">{{ `${item?.count}次打卡 开始` }}</div> <div class="name">{{ `${item?.count}次打卡 开始` }}</div>
<div v-if="item?.dkKsSj" class="time">打卡时间<text>{{ handleTime(item?.dkKsSj) }}</text></div> <div v-if="item?.dkKsSj" class="time">
打卡时间<text>{{ handleTime(item?.dkKsSj) }}</text>
</div>
<div v-if="item?.imgUrlDkKsFj" class="image"> <div v-if="item?.imgUrlDkKsFj" class="image">
<van-image width="80px" height="95px" :src="item?.imgUrlDkKsFj" @click="onClickImg(item?.imgUrlDkKsFj)" style="flex: 1"> <van-image
width="80px"
height="90px"
:src="item?.imgUrlDkKsFj"
@click="onClickImg(item?.imgUrlDkKsFj)"
style="flex: 1"
>
<template v-slot:loading> <template v-slot:loading>
<van-loading type="spinner" size="20" /> <van-loading type="spinner" size="20" />
</template> </template>
@ -23,14 +31,22 @@
</div> </div>
</div> </div>
<div :class="['item', { 'disabled': !item?.dkJsSj }]"> <div :class="['item', { disabled: !item?.dkJsSj }]">
<div class="point"></div> <div class="point"></div>
<div class="info-right"> <div class="info-right">
<div class="name">{{ `${item?.count}次打卡 离开` }}</div> <div class="name">{{ `${item?.count}次打卡 离开` }}</div>
<div v-if="item?.dkJsSj" class="time">打卡时间<text>{{ handleTime(item?.dkJsSj) }}</text></div> <div v-if="item?.dkJsSj" class="time">
打卡时间<text>{{ handleTime(item?.dkJsSj) }}</text>
</div>
<div v-if="item?.imgUrlDkJsFj" class="image"> <div v-if="item?.imgUrlDkJsFj" class="image">
<van-image width="80px" height="95px" :src="item?.imgUrlDkJsFj" @click="onClickImg(item?.imgUrlDkJsFj)" style="flex: 1"> <van-image
width="80px"
height="95px"
:src="item?.imgUrlDkJsFj"
@click="onClickImg(item?.imgUrlDkJsFj)"
style="flex: 1"
>
<template v-slot:loading> <template v-slot:loading>
<van-loading type="spinner" size="20" /> <van-loading type="spinner" size="20" />
</template> </template>
@ -53,9 +69,9 @@ import {ImagePreview} from "vant";
const props = defineProps({ const props = defineProps({
data: { data: {
type: Array, type: Array,
default: [] default: [],
} },
}) });
//预览图片 //预览图片
function onClickImg(url) { function onClickImg(url) {
@ -63,8 +79,8 @@ function onClickImg(url) {
} }
const handleTime = (time) => { const handleTime = (time) => {
if (time) return time?.split(' ')[1] if (time) return time?.split(" ")[1];
} };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@ -84,15 +100,15 @@ const handleTime = (time) => {
align-content: center; align-content: center;
position: relative; position: relative;
height: auto; height: auto;
border-left: 0.53vw dashed #1DB1FF; border-left: 0.53vw dashed #1db1ff;
max-height: 46.93vw; max-height: 46.93vw;
padding-bottom: 8vw; padding-bottom: 4vw;
.point { .point {
position: absolute; position: absolute;
width: 3.2vw; width: 3.2vw;
height: 3.2vw; height: 3.2vw;
background: #1DB1FF; background: #1db1ff;
border-radius: 50%; border-radius: 50%;
flex-shrink: 0; flex-shrink: 0;
left: -1.665vw; left: -1.665vw;
@ -111,7 +127,7 @@ const handleTime = (time) => {
.image { .image {
margin-top: 2.13vw; margin-top: 2.13vw;
width: 33.87vw; width: 33.87vw;
height: 18.67vw; // height: 18.67vw;
} }
.time { .time {
@ -119,7 +135,7 @@ const handleTime = (time) => {
font-size: 3.73vw; font-size: 3.73vw;
text { text {
color: #0386FB; color: #0386fb;
} }
} }
@ -127,7 +143,7 @@ const handleTime = (time) => {
margin-top: 2.13vw; margin-top: 2.13vw;
display: flex; display: flex;
align-items: center; align-items: center;
color: #75787F; color: #75787f;
div { div {
font-size: 2.67vw; font-size: 2.67vw;
@ -141,10 +157,10 @@ const handleTime = (time) => {
} }
.disabled { .disabled {
border-left: 0.53vw dashed #EDEDED !important; border-left: 0.53vw dashed #ededed !important;
.point { .point {
background: #EDEDED !important; background: #ededed !important;
} }
} }
} }

View File

@ -184,10 +184,12 @@ const getChineseNumber = (num) => {
return num.toString(); // 超过99返回阿拉伯数字 return num.toString(); // 超过99返回阿拉伯数字
} }
}; };
// 切换tab
const onChange = (value) => { const onChange = (value) => {
active.value = value; active.value = value;
nextStep.value = 0; nextStep.value = 0;
baseUrl.value = "";
fileId.value = "";
getPatrolList(data?.query); getPatrolList(data?.query);
}; };
@ -462,7 +464,6 @@ onMounted(() => {
<template> <template>
<div> <div>
<top-nav navTitle="打卡" :showLeft="true" /> <top-nav navTitle="打卡" :showLeft="true" />
<div class="clockInWrapper"> <div class="clockInWrapper">
<van-tabs v-model:active="active" @click="onChange"> <van-tabs v-model:active="active" @click="onChange">
<template v-for="(item, index) in data.patroObj?.bddList" :key="index"> <template v-for="(item, index) in data.patroObj?.bddList" :key="index">