修改图片轮播

master
fanluyan 2 years ago
parent 7bf6a3e8b0
commit 98e915aa7c

@ -264,7 +264,7 @@
> .el-tree-node__content { > .el-tree-node__content {
// 设置颜色 // 设置颜色
color: #fff; color: #fff;
background: @orange-color !important; background: #f39b33 !important;
} }
.el-menu--horizontal .el-menu-item.is-active i { .el-menu--horizontal .el-menu-item.is-active i {
color: @orange-color; color: @orange-color;
@ -276,7 +276,7 @@
.el-tree-node.is-current .el-tree-node.is-current
> .el-tree-node__content { > .el-tree-node__content {
color: #fff; color: #fff;
background: @orange-color; background: #f39b33 !important;
} }
.gallery-thumbs .swiper-slide-active { .gallery-thumbs .swiper-slide-active {

@ -1,36 +1,36 @@
import axios from "axios"; import axios from "axios";
// import { Loading } from "element-ui"; //项目已经全局引入element的话可以不单独引入 import { Loading } from "element-ui"; //项目已经全局引入element的话可以不单独引入
// let loading; //定义loading变量 let loading; //定义loading变量
// function startLoading() { function startLoading() {
// //使用Element loading-start 方法 //使用Element loading-start 方法
// loading = Loading.service({ loading = Loading.service({
// lock: true, lock: true,
// text: "加载中……", text: "加载中……",
// background: "rgba(255, 255, 255, 0.7)", background: "rgba(255, 255, 255, 0.7)",
// }); });
// } }
// function endLoading() { function endLoading() {
// //使用Element loading-close 方法 //使用Element loading-close 方法
// loading.close(); loading.close();
// } }
//那么 showFullScreenLoading() tryHideFullScreenLoading() 要干的事儿就是将同一时刻的请求合并。 // 那么 showFullScreenLoading() tryHideFullScreenLoading() 要干的事儿就是将同一时刻的请求合并。
//声明一个变量 needLoadingRequestCount每次调用showFullScreenLoading方法 needLoadingRequestCount + 1。 // 声明一个变量 needLoadingRequestCount每次调用showFullScreenLoading方法 needLoadingRequestCount + 1。
//调用tryHideFullScreenLoading()方法needLoadingRequestCount - 1。needLoadingRequestCount为 0 时,结束 loading。 // 调用tryHideFullScreenLoading()方法needLoadingRequestCount - 1。needLoadingRequestCount为 0 时,结束 loading。
// let needLoadingRequestCount = 0; let needLoadingRequestCount = 0;
// export function showFullScreenLoading() { export function showFullScreenLoading() {
// if (needLoadingRequestCount === 0) { if (needLoadingRequestCount === 0) {
// startLoading(); startLoading();
// } }
// needLoadingRequestCount++; needLoadingRequestCount++;
// } }
// export function tryHideFullScreenLoading() { export function tryHideFullScreenLoading() {
// if (needLoadingRequestCount <= 0) return; if (needLoadingRequestCount <= 0) return;
// needLoadingRequestCount--; needLoadingRequestCount--;
// if (needLoadingRequestCount === 0) { if (needLoadingRequestCount === 0) {
// endLoading(); endLoading();
// } }
// } }
const service = axios.create({ const service = axios.create({
// process.env.NODE_ENV === 'development' 来判断是否开发环境 // process.env.NODE_ENV === 'development' 来判断是否开发环境
@ -43,7 +43,7 @@ const service = axios.create({
service.interceptors.request.use( service.interceptors.request.use(
(config) => { (config) => {
//showFullScreenLoading(); showFullScreenLoading();
return config; return config;
}, },
(error) => { (error) => {
@ -55,7 +55,7 @@ service.interceptors.request.use(
service.interceptors.response.use( service.interceptors.response.use(
(response) => { (response) => {
if (response.status === 200) { if (response.status === 200) {
// tryHideFullScreenLoading(); tryHideFullScreenLoading();
return response.data; return response.data;
} else { } else {
Promise.reject(); Promise.reject();

@ -11,7 +11,7 @@
v-for="item in terminalPhoto" v-for="item in terminalPhoto"
:key="item.id" :key="item.id"
> >
<img :src="item.path" style="width: 100%" alt="" /> <img :src="item.path" alt="" />
</swiper-slide> </swiper-slide>
<div <div
class="swiper-button-next swiper-button-white" class="swiper-button-next swiper-button-white"
@ -33,7 +33,7 @@
v-for="(item, index) in terminalPhoto" v-for="(item, index) in terminalPhoto"
:key="item.id" :key="item.id"
> >
<img style="width: 100%" :src="item.path" alt="" /> <img :src="item.path" alt="" />
<p class="timeInfo"> <p class="timeInfo">
{{ $moment(item.photoTime).format("YYYY-MM-DD HH:mm:ss") }} {{ $moment(item.photoTime).format("YYYY-MM-DD HH:mm:ss") }}
</p> </p>
@ -111,55 +111,59 @@ export default {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
height: 100%; height: 100%;
.slide { box-sizing: border-box;
width: 20%;
}
.gallery-top { .gallery-top {
// height: 80% !important; //background: #fcc;
height: 80% !important; width: calc(100% - 6px);
width: 100%; height: 80%;
overflow: hidden;
border: 3px solid transparent;
.slide-1 {
width: 100%;
overflow: hidden;
img {
width: 1360px;
height: auto;
object-fit: cover;
}
}
} }
.gallery-thumbs { .gallery-thumbs {
height: 20% !important;
box-sizing: border-box;
padding: 10px 0px;
width: 100%; width: 100%;
margin-left: 2px; height: 18%;
background-color: #f0f0f8; .slide {
width: 20%;
.swiper-button-next { border: 3px solid transparent;
right: 0px; overflow: hidden;
} box-sizing: border-box;
.swiper-button-prev { img {
left: 0px; width: 320px;
height: auto;
object-fit: cover;
}
} }
.timeInfo { .timeInfo {
position: absolute; position: absolute;
bottom: 0; bottom: 0px;
width: 100%; width: 100%;
background: #f0f0f0; background: #f0f0f0;
padding: 4px 0px; padding: 8px 0px;
font-size: 14px; font-size: 14px;
text-align: center; text-align: center;
color: @color-text-primary; color: @color-text-primary;
} }
} }
.swiper-slide { .nopic {
background-size: cover; display: flex;
background-position: center; align-items: center;
//border: 3px solid transparent; justify-content: center;
} img {
object-fit: fill;
.gallery-thumbs .swiper-slide { width: 100% !important;
// width: 20%; height: 100% !important;
// height: 80px; }
// opacity: 0.4;
}
.slide {
border: 3px solid transparent;
}
.gallery-thumbs .swiper-slide-active {
border: 3px solid @color-primary;
} }
} }
</style> </style>

@ -1,69 +1,70 @@
<template> <template>
<div class="monitor-container"> <div class="monitorBox">
<!-- 左侧数据列表树 --> <div class="monitor-container">
<div class="sideBar"> <!-- 左侧数据列表树 -->
<!-- <treeSide></treeSide> --> <div class="sideBar">
<!-- <el-tree ref="tree" :data="barData" @node-click="handleNodeClick" :props="defaultProps"></el-tree> --> <!-- <treeSide></treeSide> -->
<el-tree <!-- <el-tree ref="tree" :data="barData" @node-click="handleNodeClick" :props="defaultProps"></el-tree> -->
:data="lineTreeData" <el-tree
:props="defaultProps" :data="lineTreeData"
ref="tree" :props="defaultProps"
node-key="id" ref="tree"
highlight-current node-key="id"
:default-expand-all="true" highlight-current
@node-click="handleNodeClick" :default-expand-all="true"
:current-node-key="currentNodekey" @node-click="handleNodeClick"
> :current-node-key="currentNodekey"
<span class="custom-tree-node" slot-scope="{ node, data }"> >
<span v-if="data.list" class="iconfont icon-dianli"> </span> <span class="custom-tree-node" slot-scope="{ node, data }">
<span <span v-if="data.list" class="iconfont icon-dianli"> </span>
v-else <span
class="iconfont icon-dianlihangye" v-else
style="margin-right: 3px" class="iconfont icon-dianlihangye"
></span> style="margin-right: 3px"
<span>{{ node.label }}</span> ></span>
</span> <span>{{ node.label }}</span>
</el-tree> </span>
</div> </el-tree>
<!-- <router-view></router-view> -->
<!-- 中心内容 -->
<!-- <picturemain :photoData="photoData" v-if="showBigPic"></picturemain> -->
<!-- 带参数的中心内容右侧参数区 -->
<div class="picSetBox">
<div class="swiperBox">
<carouselChart :terminalPhoto="terminalPhoto"></carouselChart>
</div> </div>
<div class="parameterArea"> <!-- <router-view></router-view> -->
<div class="paramsDate"> <!-- 中心内容 -->
<h3>日期选择</h3> <!-- <picturemain :photoData="photoData" v-if="showBigPic"></picturemain> -->
<el-date-picker <!-- 带参数的中心内容右侧参数区 -->
v-model="dateValue" <div class="picSetBox">
type="date" <div class="swiperBox">
placeholder="选择日期" <carouselChart :terminalPhoto="terminalPhoto"></carouselChart>
value-format="timestamp"
@change="changedate"
>
</el-date-picker>
</div> </div>
<div class="monitorItemBox"> <div class="parameterArea">
<h3>通道</h3> <div class="paramsDate">
<el-select <h3>日期选择</h3>
v-model="channelValue" <el-date-picker
placeholder="请选择" v-model="dateValue"
@change="changeChannelId" type="date"
> placeholder="选择日期"
<el-option value-format="timestamp"
v-for="item in channelOption" @change="changedate"
:key="item.value"
:label="item.label"
:value="item.value"
> >
</el-option> </el-date-picker>
</el-select> </div>
<div class="monitorItemBox">
<h3>通道</h3>
<el-select
v-model="channelValue"
placeholder="请选择"
@change="changeChannelId"
>
<el-option
v-for="item in channelOption"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
</div>
</div> </div>
<!-- <paramArea></paramArea> -->
</div> </div>
<!-- <paramArea></paramArea> -->
</div> </div>
</div> </div>
</template> </template>
@ -143,13 +144,13 @@ export default {
console.log(this.currentNodekey); console.log(this.currentNodekey);
this.channelId = this.currentNodekey; this.channelId = this.currentNodekey;
console.log(this.channelId); console.log(this.channelId);
this.getChannelList(this.channelId); //id
}); });
} }
}) })
.catch((err) => { .catch((err) => {
console.log(err); // console.log(err); //
}); });
this.getChannelList(this.channelId); //id
}, },
//tree //tree
handleNodeClick(data, node) { handleNodeClick(data, node) {
@ -190,6 +191,7 @@ export default {
}, },
// //
getTerminalPhotoList(id, date, termId) { getTerminalPhotoList(id, date, termId) {
this.terminalPhoto = [];
console.log(id, date, termId); console.log(id, date, termId);
getTerminalPhotoListJoggle({ getTerminalPhotoListJoggle({
channelid: id, channelid: id,
@ -198,6 +200,7 @@ export default {
}) })
.then((res) => { .then((res) => {
console.log(res); console.log(res);
this.terminalPhoto = res.data.list; this.terminalPhoto = res.data.list;
console.log(this.terminalPhoto); console.log(this.terminalPhoto);
}) })
@ -213,6 +216,7 @@ export default {
return i.value === val; return i.value === val;
}); });
console.log(channelObj); console.log(channelObj);
this.getTerminalPhotoList(val, this.dateValue, channelObj.termid); this.getTerminalPhotoList(val, this.dateValue, channelObj.termid);
}, },
}, },
@ -220,59 +224,67 @@ export default {
</script> </script>
<style lang="less"> <style lang="less">
.monitor-container { .monitorBox {
display: flex; width: calc(100% - 16px);
height: 100%; height: calc(100% - 32px);
border: 1px solid @border-color-base; padding: 16px 8px;
box-sizing: border-box; background: #ffffff;
background: @color-white; .monitor-container {
.sideBar {
width: 300px;
border-right: 1px solid @border-color-base;
overflow: auto;
.el-tree {
.el-tree-node__content {
height: 40px;
}
}
.el-tree--highlight-current
.el-tree-node.is-current
> .el-tree-node__content {
//
color: #fff;
background: #2d8cf0;
}
}
.picSetBox {
display: flex; display: flex;
width: 100%;
height: 100%; height: 100%;
//background: #fcc; box-sizing: border-box;
flex: 1; background: @color-white;
overflow: hidden; border: 1px solid #dddddd;
.swiperBox { border-radius: 4px;
-webkit-box-flex: 1; .sideBar {
-ms-flex: 1; width: 300px;
border-right: 1px solid @border-color-base;
overflow: auto;
padding: 16px 0px;
.el-tree {
.el-tree-node__content {
height: 40px;
}
}
.el-tree--highlight-current
.el-tree-node.is-current
> .el-tree-node__content {
//
color: #fff;
background: #2d8cf0;
}
}
.picSetBox {
display: flex;
width: 100%;
height: 100%;
//background: #fcc;
flex: 1; flex: 1;
width: auto;
overflow: hidden; overflow: hidden;
} .swiperBox {
} -webkit-box-flex: 1;
.parameterArea { -ms-flex: 1;
width: 300px; flex: 1;
padding: 16px 16px; width: auto;
border-left: 1px solid #dcdfe6; overflow: hidden;
.monitorItemBox,
.paramsDate {
margin-bottom: 16px;
h3 {
font-size: 16px;
font-weight: normal;
color: @color-text-primary;
margin-bottom: 8px;
} }
.el-date-editor.el-input { }
width: 215px; .parameterArea {
width: 220px;
padding: 16px 16px;
border-left: 1px solid #dcdfe6;
.monitorItemBox,
.paramsDate {
margin-bottom: 16px;
h3 {
font-size: 16px;
font-weight: normal;
color: @color-text-primary;
margin-bottom: 8px;
}
.el-date-editor.el-input {
width: 215px;
}
} }
} }
} }

Loading…
Cancel
Save