feat: 完成点击切换

main
shengwen.chen 3 months ago
parent 7bb947a04c
commit 4c01e6e272

@ -41,7 +41,7 @@
<template v-if="patientList['length']">
<el-carousel direction="vertical" :autoplay="true" indicatorPosition="none" ref="carousel" :interval="0"
@change="onCarouselChange">
<el-carousel-item v-for="(item, index) in patientList" :key="index">
<el-carousel-item v-for="(item, index) in patientList" :key="index" :name="String(index)">
<section class="carouselItemBox">
<div v-for="(subItem, index) in item" :key="index" :style="carouselItemStyle">
<div class="flex text-center">
@ -57,8 +57,7 @@
<div class="border-r text-[#333] font-semibold truncate px-3"
:style="item['width'] ? `flex-basis:${item['width']}px` : `flex-grow: 1;`"
:key="item['columnCode']" v-if="item['isShow']">
<marquee scrollamount="3" class="text-[#333]" :style="carouselItemStyle">{{
subItem['IntendedOperationName'] }}</marquee>
<p class="text-left" :style="carouselItemStyle">{{ subItem['IntendedOperationName'] }}</p>
</div>
</template>
<template v-else>
@ -81,7 +80,7 @@
<div class="absolute bottom-4 left-1/2 -translate-x-1/2 flex">
<template v-for="(item, index) in patientList">
<div class="w-3 h-3 rounded-full bg-[#D8D8D8] mx-1" :class="{ '!bg-[#8C8D92]': index == activeIndex }"
:key="index" />
:key="index" @click="toIndex(index)" />
</template>
</div>
</main>
@ -290,6 +289,14 @@ export default {
rowData['depFilter'] = false
}
this.onGetPageData()
},
toIndex(index) {
this.$refs.carousel.setActiveItem(index);
if (this.carouselTimer) {
clearInterval(this.carouselTimer);
this.carouselCountDown = 20;
this.onCarouselTimer()
}
}
},
mounted() {

Loading…
Cancel
Save