| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191 | <template>  <el-dialog    v-model="dialogVisible"    width="60%"    class="picture-preview-wrap v-dialog"    :show-close="false"    top="10vh"    append-to-body  >    <div class="dialog-body">      <div ref="imageRef" v-if="isArray">        <el-carousel          ref="carouselRef"          height="80vh"          :initial-index="curIndex"          :autoplay="false"          indicator-position="none"        >        <template v-for="item in imageUrl" :key="item">          <template v-for="ele in ['07','08','09','10','11','12','13']" :key="ele">             <el-carousel-item >            <!-- <img              class="image no-events"              :src="item.imgPath"              alt=""              fit="cover"            /> -->              <img                class="image no-events"                :src="require(`@/assets/images/home/HB-ws0y1menggxv/HB-ws0y1menggxv2025-01-${ele}.jpg`)"                alt=""                fit="cover"              />            <div class="watermark-style">              <div class="left">                <div class="region">2区</div>                <div class="date">{{ item.uploadDate }}</div>                <div class="whq">                  {{ item.bigPeriodName                  }}<span v-show="item.bigPeriodName && item.smallPeriodName"                    >-</span                  >{{ item.smallPeriodName }}                </div>                <div class="code">                  <div class="code-txt">生长正常</div>                </div>                <div class="weather">                  <div class="temperature">                    <img src="@/assets/img/sun_icon.png" alt="" />                    <div class="num">                      <div>26-32℃</div>                    </div>                  </div>                  <div class="temperature">                    <img src="@/assets/img/rain_icon.png" alt="" />                    <div class="num">                      <div>60% 0.34ml</div>                    </div>                  </div>                </div>              </div>            </div>              </el-carousel-item>          </template>        </template>        </el-carousel>      </div>      <div style="height: 100%" v-else>        <img          class="image no-events"          :src="imageUrl.filename + '?x-oss-process=image/resize,w_2000'"          alt=""          fit="cover"          ref="imageRef"        />        <div class="watermark-style">          <div class="left">            <div class="region">2区</div>            <div class="date">{{ imageUrl.uploadDate }}</div>            <div class="whq">              {{ imageUrl.bigPeriodName              }}<span                v-show="imageUrl.bigPeriodName && imageUrl.smallPeriodName"                >-</span              >{{ imageUrl.smallPeriodName }}            </div>            <div class="code">              <div class="code-txt">生长正常</div>            </div>            <div class="weather">              <div class="temperature">                <img src="@/assets/img/sun_icon.png" alt="" />                <div class="num">                  <div>26-32℃</div>                </div>              </div>              <div class="temperature">                <img src="@/assets/img/rain_icon.png" alt="" />                <div class="num">                  <div>60% 0.34ml</div>                </div>              </div>            </div>          </div>        </div>      </div>      <!-- 自定义水印内容 -->      <!-- <slot v-else></slot> -->    </div>  </el-dialog></template><script setup>import eventBus from "@/api/eventBus";import { ref, watch, computed } from "vue";const props = defineProps({  imageUrl: {    type: [Object, Array],    default: () => {},  },  switchValue: {    type: Boolean,    default: false,  },  customWatermark: {    type: Boolean,    default: false,  },  curIndex: {    type: Number,    default: 0,  },});const curDate = new Date();const curYear = curDate.getFullYear();const curMonth = curDate.getMonth() + 1;const curDay = curDate.getDate();const isArray = computed(() => Array.isArray(props.imageUrl));const dialogVisible = ref(false);eventBus.on('dialog:show',(e)=>{  dialogVisible.value = e})const carouselRef = ref(null);const imageRef = ref(null);const caruuselItem = ref(null);</script><style lang="scss">.picture-preview-wrap {  padding: 0;  .el-dialog__header{    padding-bottom: 0 !important;  }  .dialog-body {    position: relative;    width: 100%;    height: 100%;    box-sizing: border-box;    .image {      width: 100%;      height: 100%;    }  }}::v-deep {  .el-carousel__arrow {    background: rgba(0, 0, 0, 0.4);    width: 50px;    height: 50px;    font-size: 28px;  }}</style><style lang="scss">.picture-preview {  height: 89%;  box-sizing: border-box;  .el-dialog__body {    height: 100%;    box-sizing: border-box;  }}</style>
 |