Merge branch 'fly' into xy-ly

master
fanluyan 2 years ago
commit 00dbfeebd5

@ -109,11 +109,11 @@ export default {
index: "devicePhotoSchedule", index: "devicePhotoSchedule",
title: "拍照时间表设置", title: "拍照时间表设置",
}, },
{ // {
icon: "el-icon-picture-outline", // icon: "el-icon-picture-outline",
index: "imageSettings", // index: "imageSettings",
title: "图像采集参数设置", // title: "",
}, // },
], ],
}, },
// { // {

@ -1,57 +1,41 @@
<template> <template>
<div class="thumb-example"> <div class="thumb-example">
<!-- swiper1 --> <div class="picTop">
<swiper <viewer
class="swiper gallery-top" class="bigimg"
:options="swiperOptionTop" :style="{ backgroundImage: 'url(' + bigPicPath + '!180x160)' }"
ref="swiperTop" v-if="bigPicPath.indexOf('nopic') == -1"
> >
<!-- --> <img class="animImg" :src="bigPicPath + '!1280x720'" />
<!-- <p class="mark">
<div {{ bigPicPath }}
class="swiper-button-next swiper-button-white" <span>{{ this.activeSmall }}</span>
slot="button-next" </p> -->
></div> </viewer>
<div class="bigimg" v-else>
<img class="animImg" :src="bigPicPath" />
</div>
<div class="arrow leftArrow" v-if="this.bigNum != 0" @click="leftClick">
<i class="el-icon-arrow-left"></i>
</div>
<div <div
class="swiper-button-prev swiper-button-white" class="arrow rightArrow"
slot="button-prev" v-if="this.bigNum < this.terminalPhoto.length - 1"
></div> @click="rightClick"
</swiper>
<!-- swiper2 Thumbs -->
<swiper
class="swiper gallery-thumbs"
:options="swiperOptionThumbs"
ref="swiperThumbs"
>
<swiper-slide
class="slide"
v-for="(item, index) in terminalPhoto"
:key="item.id"
> >
<div class="bigimg" v-if="item.path.indexOf('nopic') == -1"> <i class="el-icon-arrow-right"></i>
<!-- <img :src="item.path + '!1280x720'" alt="" /> -->
<img v-if="index == 0" :src="item.path + '!260x160'" />
<img
v-else
src="../../assets/img/loading.jpg"
:data-src="item.path + '!260x160'"
class="swiper-lazy"
/>
</div> </div>
<div class="bigimg" v-else>
<img :src="item.path" alt="" />
</div> </div>
<!-- <img v-if="index == 0" :src="item.path + '!1280x720'" /> <div class="picBottom">
<ul class="smallPicBox">
<img <li
src="item.path + '!260x160'" v-for="(item, index) in fiveList"
alt="" @click="handleBigpic(item, index)"
:data-src="item.path + '!260x160'" :class="activeSmall === index ? 'borderActive' : ''"
class="swiper-lazy" >
v-else-if="item.path.indexOf('nopic') == -1" <div class="smallhavePic" v-if="item.path.indexOf('nopic') == -1">
/> <img :src="item.path + '!260x160'" />
<img :src="item.path" alt="" v-else /> --> <p class="timeInfo">
<p class="timeInfo" v-if="item.path.indexOf('nopic') == -1">
<el-tooltip <el-tooltip
class="item" class="item"
effect="dark" effect="dark"
@ -73,19 +57,33 @@
) )
<span>--通道{{ item.channelId }}</span> <span>--通道{{ item.channelId }}</span>
</p> </p>
</swiper-slide> </div>
</swiper> <div class="smallnoPic" v-else>
<img :src="item.path" />
</div>
</li>
</ul>
<div
class="arrow leftArrow"
v-if="this.page != 1"
@click="smallLeftClick"
>
<i class="el-icon-arrow-left"></i>
</div>
<div
class="arrow rightArrow"
v-if="this.page < this.total"
@click="smallRightClick"
>
<i class="el-icon-arrow-right"></i>
</div>
</div>
</div> </div>
</template> </template>
<script> <script>
import { Swiper, SwiperSlide } from "vue-awesome-swiper";
import "swiper/css/swiper.css";
export default { export default {
components: { components: {},
Swiper,
SwiperSlide,
},
props: { props: {
terminalPhoto: { terminalPhoto: {
type: Array, type: Array,
@ -94,61 +92,86 @@ export default {
}, },
data() { data() {
return { return {
swiperOptionTop: { isshowArrow: true, //
lazy: { bigPicPath: "", //
loadPrevNext: true, smallPicPath: "", //
loadPrevNextAmount: 1, bigNum: 0, //
loadOnTransitionStart: true, fiveList: [], //list
activeSmall: 0, //,
page: 1, //
pagesize: 5, //
total: 0, //
};
}, },
navigation: { mounted() {
nextEl: ".swiper-button-next", console.log(this.terminalPhoto);
prevEl: ".swiper-button-prev", this.bigPicPath = this.terminalPhoto[0].path;
this.fiveList = this.terminalPhoto.slice(this.page - 1, this.pagesize);
this.total = this.terminalPhoto.length / this.pagesize;
}, },
virtual: { methods: {
slides: [], getphotoList() {
renderSlide: function (slide, index) { this.fiveList = this.terminalPhoto.slice(
console.log(index); (this.page - 1) * this.pagesize,
if (slide.path.indexOf("nopic") != -1) { this.page * this.pagesize
return ` <div class="swiper-slide" ><div class="bigimg"><img src="static/img/nopic.0e9cfc7c.jpg" alt="" /></div></div>`; );
} else { this.bigPicPath = this.fiveList[this.activeSmall].path;
return `<div class="swiper-slide"><div class="bigimg"><img src=" ${
slide.path + "!1280x720"
} " /></div></div>`;
}
},
},
},
swiperOptionThumbs: {
spaceBetween: 10,
centeredSlides: true,
slidesPerView: "auto",
slideToClickedSlide: true,
lazy: {
loadPrevNext: true,
loadPrevNextAmount: 5,
loadOnTransitionStart: true,
}, },
//
leftClick() {
this.bigNum--; //
this.bigPicPath = this.terminalPhoto[this.bigNum].path;
this.activeSmall--;
console.log("activeSmall", this.activeSmall, "bigNum", this.bigNum);
console.log(this.page);
if (this.activeSmall < 0) {
this.activeSmall = 4;
this.smallLeftClick();
}
}, },
}; //
rightClick() {
this.bigNum++; //
this.bigPicPath = this.terminalPhoto[this.bigNum].path;
this.activeSmall++;
console.log("activeSmall", this.activeSmall, "bigNum", this.bigNum);
if (this.activeSmall > 4) {
this.activeSmall = 0;
console.log(this.activeSmall);
this.smallRightClick();
}
}, },
mounted() { //
this.$nextTick(() => { handleBigpic(row, index) {
const swiperTop = this.$refs.swiperTop.$swiper; console.log(row);
const swiperThumbs = this.$refs.swiperThumbs.$swiper; console.log();
swiperTop.controller.control = swiperThumbs; this.activeSmall = index;
swiperThumbs.controller.control = swiperTop; this.bigPicPath = row.path;
});
}, },
methods: {}, //
watch: { smallLeftClick() {
terminalPhoto: function (newVal, oldVal) { this.activeSmall = 0;
this.swiperOptionTop.virtual.slides = newVal; console.log("点击了左侧");
this.page--;
if (this.page < 1) {
this.isshowArrow = false;
} else {
this.getphotoList();
}
console.log(this.page);
console.log(this.fiveList);
}, },
//
smallRightClick() {
this.activeSmall = 0;
console.log("点击了右侧");
console.log(this.page);
this.page++;
this.getphotoList();
console.log(this.fiveList);
}, },
created() {
console.log(this.swiperOptionTop.virtual.slides);
this.swiperOptionTop.virtual.slides = this.terminalPhoto;
}, },
}; };
</script> </script>
@ -157,65 +180,122 @@ export default {
width: 100%; width: 100%;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
height: calc(100% - 26px); height: calc(100% - 24px);
box-sizing: border-box; box-sizing: border-box;
.gallery-top { .picTop {
//background: #fcc;
width: 100%; width: 100%;
height: 80%; height: 80%;
overflow: hidden; overflow: hidden;
margin-bottom: 4px; margin-bottom: 4px;
//border: 3px solid transparent; position: relative;
.swiper-slide { &:hover {
width: 100%; .arrow {
overflow: hidden; opacity: 1;
transition: all 0.5s ease-in;
}
}
.bigimg { .bigimg {
width: 100%; width: 100%;
height: 100%; height: 100%;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
position: relative;
background-size: 100% 100%;
.mark {
position: absolute;
bottom: 12px;
color: #fff;
background-color: rgba(0, 0, 0, 0.5);
left: 16px;
font-size: 14px;
line-height: 24px;
//opacity: 0;
transition: bottom 2s ease 0s;
}
} }
img { img {
width: 100%; width: 100%;
height: 100%; height: 100%;
object-fit: fill; object-fit: fill;
cursor: pointer;
}
.arrow {
opacity: 0;
position: absolute;
cursor: pointer;
color: #fff;
font-size: 60px;
border-radius: 30px;
position: absolute;
top: 50%;
transform: translateY(-50%);
background-color: rgba(0, 0, 0, 0.5);
display: flex;
justify-content: center;
align-items: center;
color: #fff;
text-align: center;
line-height: 60px;
&:hover {
color: #409eff;
}
} }
.leftArrow {
left: 16px;
} }
.swiper-button-prev.swiper-button-disabled, .rightArrow {
.swiper-button-next.swiper-button-disabled { right: 16px;
opacity: 0.35;
cursor: auto;
pointer-events: none;
display: none !important;
} }
} }
.gallery-thumbs { .picBottom {
width: 100%; width: 100%;
height: 18%; height: 18%;
.slide { position: relative;
.smallPicBox {
width: 100%;
height: 100%;
display: flex;
justify-content: center;
li {
width: 20%; width: 20%;
border: 3px solid transparent; border: 3px solid transparent;
overflow: hidden; // overflow: hidden;
box-sizing: border-box; box-sizing: border-box;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
position: relative;
.bigimg { img {
width: 100%; width: 100%;
height: 100%; height: 100%;
display: flex; object-fit: fill;
align-items: center; cursor: pointer;
justify-content: center;
} }
img { .smallhavePic {
//width: 100%; width: 100%;
height: 100%; height: 100%;
object-fit: fill; }
.smallnoPic {
width: 100%;
height: 100%;
}
}
.borderActive {
border: 3px solid #409eff;
&::after {
content: "";
position: absolute;
width: 0;
height: 0;
left: 50%;
top: -16px;
margin-left: -8px;
border-bottom: 13px solid #409eff;
border-left: 8px solid transparent;
border-right: 8px solid transparent;
} }
} }
.timeInfo { .timeInfo {
position: absolute; position: absolute;
bottom: 0px; bottom: 0px;
@ -227,31 +307,29 @@ export default {
color: #333; color: #333;
} }
} }
.arrow {
.swiper-button-next.swiper-button-white, position: absolute;
.swiper-container-rtl .swiper-button-prev.swiper-button-white, cursor: pointer;
.swiper-button-prev.swiper-button-white, color: #fff;
.swiper-container-rtl .swiper-button-next.swiper-button-white { font-size: 30px;
width: 40px;
height: 40px;
border-radius: 30px; border-radius: 30px;
position: absolute; position: absolute;
top: 50%; top: 45%;
transform: translateY(-50%); transform: translateY(-50%);
background-color: rgba(0, 0, 0, 0.5); background-color: rgba(0, 0, 0, 0.5);
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
font-size: 30px;
color: #fff; color: #fff;
text-align: center; text-align: center;
line-height: 60px; line-height: 60px;
} }
.swiper-button-next:after, .leftArrow {
.swiper-container-rtl .swiper-button-prev:after, left: 16px;
.swiper-button-prev:after, }
.swiper-container-rtl .swiper-button-next:after { .rightArrow {
transform: scale(0.5); right: 16px;
}
} }
} }
// https://v1.github.surmon.me/vue-awesome-swiper/ // https://v1.github.surmon.me/vue-awesome-swiper/

@ -1,30 +1,20 @@
<template> <template>
<div class="thumb-example"> <div class="thumb-example">
<!-- swiper1 --> <!-- swiper1 -->
<swiper <swiper
class="swiper gallery-top" class="swiper gallery-top"
:options="swiperOptionTop" :options="swiperOptionTop"
ref="swiperTop" ref="swiperTop"
> >
<swiper-slide <!-- -->
class="slide-1" <!-- <viewer class="swiper-slide">
v-for="(item, index) in terminalPhoto"
:key="item.id" </viewer> -->
> <!-- <viewer class="swiper-slide">
<viewer class="bigimg" v-if="item.path.indexOf('nopic') == -1">
<!-- <img :src="item.path + '!1280x720'" alt="" /> --> </viewer> -->
<img v-if="index == 0" :src="item.path + '!1280x720'" />
<img
v-else
src="../../assets/img/loading.jpg"
:data-src="item.path + '!1280x720'"
class="swiper-lazy"
/>
</viewer>
<div class="bigimg" v-else>
<img :src="item.path" alt="" />
</div>
</swiper-slide>
<div <div
class="swiper-button-next swiper-button-white" class="swiper-button-next swiper-button-white"
slot="button-next" slot="button-next"
@ -34,6 +24,7 @@
slot="button-prev" slot="button-prev"
></div> ></div>
</swiper> </swiper>
<!-- swiper2 Thumbs --> <!-- swiper2 Thumbs -->
<swiper <swiper
class="swiper gallery-thumbs" class="swiper gallery-thumbs"
@ -46,6 +37,7 @@
:key="item.id" :key="item.id"
> >
<div class="bigimg" v-if="item.path.indexOf('nopic') == -1"> <div class="bigimg" v-if="item.path.indexOf('nopic') == -1">
<!-- <img :src="item.path + '!1280x720'" alt="" /> -->
<img v-if="index == 0" :src="item.path + '!260x160'" /> <img v-if="index == 0" :src="item.path + '!260x160'" />
<img <img
v-else v-else
@ -109,48 +101,47 @@ export default {
}, },
}, },
data() { data() {
let a = "1111111111111";
return { return {
imgflag: false,
swiperOptionTop: { swiperOptionTop: {
spaceBetween: 10,
//loop: true,
freeMode: true,
// loopedSlides: 1,
lazy: { lazy: {
loadPrevNext: true, loadPrevNext: true,
loadPrevNextAmount: 1, loadPrevNextAmount: 1,
loadOnTransitionStart: true, loadOnTransitionStart: true,
}, },
// lazyLoading: true, //
navigation: { navigation: {
nextEl: ".swiper-button-next", nextEl: ".swiper-button-next",
prevEl: ".swiper-button-prev", prevEl: ".swiper-button-prev",
}, },
observer: true, //swiperswiper virtual: {
observeParents: true, //swiperswiper slides: [],
onSlideChangeEnd: function (swiper) { renderSlide: function (slide, index) {
swiper.update(); if (slide.path.indexOf("nopic") != -1) {
return `<div class="swiper-slide"><div class="bigimg"><img src="static/img/nopic.0e9cfc7c.jpg" alt="" /></div></div>`;
} else {
return (
`<view class="swiper-slide">` +
`<div class="bigimg" id="imgView" style="background:url(${
slide.path + "!80x720"
});background-size:100% 100%">` +
`<img id="imgid" src=" ${slide.path + "!1280x720"} " />
</view>`
);
}
},
}, },
}, },
swiperOptionThumbs: { swiperOptionThumbs: {
spaceBetween: 10, spaceBetween: 10,
centeredSlides: true, centeredSlides: true,
slidesPerView: "auto", slidesPerView: "auto",
touchRatio: 0.2,
lazyLoading: true, //
slideToClickedSlide: true, slideToClickedSlide: true,
lazy: { lazy: {
loadPrevNext: true, loadPrevNext: true,
loadPrevNextAmount: 5, loadPrevNextAmount: 5,
loadOnTransitionStart: true, loadOnTransitionStart: true,
//loadOnTransitionStart: true,
},
observer: true, //swiperswiper
observeParents: true, //swiperswiper
onSlideChangeEnd: function (swiper) {
swiper.update();
}, },
//loop: true,
//loopedSlides: 4,
}, },
}; };
}, },
@ -162,8 +153,16 @@ export default {
swiperThumbs.controller.control = swiperTop; swiperThumbs.controller.control = swiperTop;
}); });
}, },
methods: {}, methods: {},
watch: {
terminalPhoto: function (newVal, oldVal) {
this.swiperOptionTop.virtual.slides = newVal;
},
},
created() {
console.log(this.swiperOptionTop.virtual.slides);
this.swiperOptionTop.virtual.slides = this.terminalPhoto;
},
}; };
</script> </script>
<style lang="less"> <style lang="less">
@ -180,7 +179,7 @@ export default {
overflow: hidden; overflow: hidden;
margin-bottom: 4px; margin-bottom: 4px;
//border: 3px solid transparent; //border: 3px solid transparent;
.slide-1 { .swiper-slide {
width: 100%; width: 100%;
overflow: hidden; overflow: hidden;
.bigimg { .bigimg {
@ -267,6 +266,15 @@ export default {
.swiper-container-rtl .swiper-button-next:after { .swiper-container-rtl .swiper-button-next:after {
transform: scale(0.5); transform: scale(0.5);
} }
.pismask {
width: 100%;
height: 100%;
position: fixed;
background: rgba(0, 0, 0, 0.5);
z-index: 99999;
top: 0px;
left: 0px;
}
} }
// https://v1.github.surmon.me/vue-awesome-swiper/ // https://v1.github.surmon.me/vue-awesome-swiper/
</style> </style>

@ -34,7 +34,11 @@
</div> </div>
<div class="imageCenter" v-loading="loading"> <div class="imageCenter" v-loading="loading">
<div class="imgList" v-for="(item, index) in picList" :key="index"> <div class="imgList" v-for="(item, index) in picList" :key="index">
<viewer class="bigpic" v-if="!item.path.includes('mp4')"> <viewer
class="bigpic"
v-if="!item.path.includes('mp4')"
:style="{ backgroundImage: 'url(' + item.path + '!180x160)' }"
>
<img :src="item.path + '!1280x720'" /> <img :src="item.path + '!1280x720'" />
<!-- <el-image :src="item.path + '!1280x720'" lazy></el-image> --> <!-- <el-image :src="item.path + '!1280x720'" lazy></el-image> -->
</viewer> </viewer>
@ -306,6 +310,7 @@ export default {
.bigpic { .bigpic {
width: 100%; width: 100%;
height: 100%; height: 100%;
background-size: 100% 100%;
} }
img { img {
width: 100%; width: 100%;

@ -37,7 +37,6 @@
<carouselChart <carouselChart
:terminalPhoto="terminalPhoto" :terminalPhoto="terminalPhoto"
v-if="terminalPhoto.length > 0" v-if="terminalPhoto.length > 0"
ref="a"
></carouselChart> ></carouselChart>
<div class="totalPic" v-if="totalPic !== 0"> <div class="totalPic" v-if="totalPic !== 0">
图片总数{{ totalPic }} 图片总数{{ totalPic }}
@ -489,9 +488,9 @@ export default {
<style lang="less"> <style lang="less">
.monitorBox { .monitorBox {
width: calc(100% - 32px); width: calc(100% - 0px);
height: calc(100% - 32px); height: calc(100% - 32px);
padding: 16px 16px; padding: 16px 0px 8px 0px;
background: #ffffff; background: #ffffff;
.monitor-container { .monitor-container {
display: flex; display: flex;
@ -547,13 +546,13 @@ export default {
} }
.totalPic { .totalPic {
width: 100%; width: 100%;
height: 24px; height: 16px;
margin-bottom: 8px; margin-bottom: 8px;
text-align: center; text-align: right;
font-size: 12px; font-size: 12px;
color: #2d8cf0; color: #2d8cf0;
font-weight: bold; font-weight: bold;
line-height: 24px; line-height: 16px;
} }
} }
.parameterArea { .parameterArea {

Loading…
Cancel
Save