You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

435 lines
12 KiB
Vue

2 years ago
<template>
<div class="realTimeSearch">
2 years ago
<div class="searchMain">
<div class="searchBox" ref="searchref">
<el-form :inline="true" :model="formdata" class="demo-form-inline">
<el-form-item label="电压等级">
<el-select v-model="formdata.dyid" @change="getSearchxl">
<el-option
v-for="item in dyOptions"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
2 years ago
<el-form-item label="线路名称">
<el-select
v-model="formdata.lineid"
@change="getSearchgt"
filterable
>
<el-option
v-for="item in xlOptions"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
2 years ago
</el-select>
</el-form-item>
<el-form-item label="杆塔名称">
<el-select
v-model="formdata.towerid"
@change="getSearchzz"
filterable
>
<el-option
v-for="item in gtOptions"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
2 years ago
</el-select>
</el-form-item>
<el-form-item label="装置名称">
<el-select
v-model="formdata.termid"
@change="getSearchtd"
filterable
>
2 years ago
<el-option
v-for="item in zzOptions"
:key="item.id"
:label="item.name"
:value="item.id"
>
</el-option>
</el-select>
</el-form-item>
2 years ago
<el-form-item label="通道">
<el-select v-model="formdata.channelid">
<el-option
v-for="item in tdOptions"
:key="item.id"
2 years ago
:label="item.name"
:value="item.id"
2 years ago
></el-option>
2 years ago
</el-select>
</el-form-item>
<el-form-item label="开始日期">
2 years ago
<!-- <el-date-picker
v-model="formdata.timeVal"
type="datetimerange"
start-placeholder="开始日期"
end-placeholder="结束日期"
value-format="timestamp"
2 years ago
></el-date-picker> -->
<el-date-picker
v-model="formdata.starttime"
type="datetime"
placeholder="开始日期"
value-format="timestamp"
>
2 years ago
</el-date-picker>
</el-form-item>
<el-form-item label="结束日期">
2 years ago
<el-date-picker
v-model="formdata.endtime"
type="datetime"
2 years ago
default-time="23:59:59"
2 years ago
placeholder="结束日期"
value-format="timestamp"
class="ml10"
>
2 years ago
</el-date-picker>
2 years ago
</el-form-item>
<el-form-item>
<el-button type="primary" @click="onSubmit"></el-button>
</el-form-item>
</el-form>
</div>
<div class="pictureBox" v-loading="loading">
<div v-if="picList.length !== 0">
<el-card
class="box-card imgList"
v-for="(item, index) in picList"
:key="index"
>
2 years ago
<viewer
:options="OptionssalseImg"
class="bigpic"
v-if="item.path.indexOf('videos') == -1"
>
<img :src="item.path + '!1280x720'" />
<!-- <el-image :src="item.path" lazy></el-image> -->
<div class="caption">
<p class="infoTop">
2 years ago
{{ item.linename }} /
{{
item.displayname !== null && item.displayname !== ""
? item.displayname
: item.cmdid
}}
</p>
<p class="infoBottom">
拍照时间{{ $moment(item.photoTime).format("MM-DD HH:mm") }}
2 years ago
/
2 years ago
{{
item.alias !== null && item.alias !== ""
? item.alias
: item.channnelname
}}
2 years ago
<!-- 上传时间{{
$moment(item.recvTime).format("YYYY-MM-DD HH:mm:ss")
2 years ago
}} -->
</p>
</div>
</viewer>
<div class="bigpic" v-else>
<!-- <el-image :src="item.path" lazy></el-image> -->
<video
width="100%"
height="250px"
:src="item.path"
controls="controls"
></video>
<div class="caption">
<p class="infoTop">
2 years ago
{{ item.linename }} /
{{
item.displayname !== null && item.displayname !== ""
? item.displayname
: item.cmdid
}}
</p>
<p class="infoBottom">
拍照时间{{ $moment(item.photoTime).format("MM-DD HH:mm") }}
2 years ago
/
{{
item.alias !== null && item.alias !== ""
? item.alias
: item.channnelname
2 years ago
}}
2 years ago
<!-- 上传时间{{
$moment(item.recvTime).format("YYYY-MM-DD HH:mm:ss")
2 years ago
}} -->
</p>
</div>
</div>
</el-card>
</div>
<div class="noPicBox" v-else>
<el-empty description="暂无图片"></el-empty>
</div>
2 years ago
</div>
<div class="pageNation" v-if="picList.length !== 0">
2 years ago
<el-pagination
@current-change="handleCurrentChange"
@size-change="handleSizeChange"
2 years ago
:current-page="page"
:page-size="pageSize"
layout="sizes, prev, pager, next, jumper,total"
2 years ago
:total="total"
background
>
</el-pagination>
</div>
</div>
</div>
2 years ago
</template>
<script>
import { getSearchInfo, getRealtimePhoto } from "@/utils/api/index";
2 years ago
export default {
data() {
return {
2 years ago
OptionssalseImg: {
inline: false,
button: true,
navbar: false,
title: false,
toolbar: false,
tooltip: false,
zoomable: true,
url: "src",
},
2 years ago
dyOptions: [{ id: 0, name: "全部" }], //电压数据
xlOptions: [{ id: 0, name: "全部" }], //线路数据
gtOptions: [{ id: 0, name: "全部" }], //杆塔数据
zzOptions: [{ id: 0, name: "全部" }], //装置数据
2 years ago
tdOptions: [{ id: 0, name: "全部" }], //通道数据
formdata: {
2 years ago
dyid: "",
lineid: "",
towerid: "",
channelid: "",
2 years ago
termid: "",
2 years ago
// timeVal: "",
},
picList: [],
2 years ago
page: 1, // 当前页数
2 years ago
pageSize: 20, // 每页数量
2 years ago
total: 0, //总条数
loading: false,
2 years ago
signtype: 0, //0第一次查询
};
},
mounted() {
2 years ago
// this.$set(this.formdata, "timeVal", [
// new Date(new Date().toLocaleDateString()).getTime(),
// new Date().getTime(),
// ]);
this.$set(
this.formdata,
"starttime",
new Date(new Date().toLocaleDateString()).getTime()
);
2 years ago
this.$set(this.formdata, "endtime", new Date().getTime());
this.getSearchdy();
},
methods: {
//获取电压信息
2 years ago
getSearchdy() {
getSearchInfo({ type: 1 })
.then((res) => {
// if (res.data.list.length == 0) {
// this.dyOptions = [];
// this.formdata.dyid = "";
// } else {
// this.dyOptions = res.data.list;
// this.formdata.dyid = res.data.list[0].id;
// }
this.dyOptions = this.dyOptions.concat(res.data.list);
this.formdata.dyid = this.dyOptions[0].id;
2 years ago
// this.$set(this.formdata, 'dyid', this.dyOptions[0].id)
this.getSearchxl();
})
.catch((err) => {});
},
//获取线路数据
2 years ago
getSearchxl() {
2 years ago
getSearchInfo({ type: 2, id: this.formdata.dyid })
.then((res) => {
2 years ago
this.xlOptions = [{ id: 0, name: "全部" }];
this.xlOptions = this.xlOptions.concat(res.data.list);
this.formdata.lineid = this.xlOptions[0].id;
this.getSearchgt();
})
.catch((err) => {});
},
//获取杆塔数据
2 years ago
getSearchgt() {
2 years ago
getSearchInfo({ type: 3, id: this.formdata.lineid })
.then((res) => {
2 years ago
this.gtOptions = [{ id: 0, name: "全部" }];
this.gtOptions = this.gtOptions.concat(res.data.list);
this.formdata.towerid = this.gtOptions[0].id;
2 years ago
this.getSearchzz();
})
.catch((err) => {});
},
//获取装置数据
getSearchzz() {
getSearchInfo({ type: 4, id: this.formdata.towerid })
.then((res) => {
2 years ago
this.zzOptions = [{ id: 0, name: "全部" }];
this.zzOptions = this.zzOptions.concat(res.data.list);
2 years ago
this.formdata.termid = this.zzOptions[0].id;
this.getSearchtd();
})
.catch((err) => {});
},
//获取通道数据
2 years ago
getSearchtd() {
2 years ago
getSearchInfo({ type: 5, id: this.formdata.termid })
.then((res) => {
2 years ago
this.tdOptions = [{ id: 0, name: "全部" }];
this.tdOptions = this.tdOptions.concat(res.data.list);
this.formdata.channelid = this.tdOptions[0].id;
2 years ago
// if (this.signtype == 0) {
// this.getPicData();
// }
// this.signtype = 1;
})
.catch((err) => {});
},
//获取图片列表
getPicData() {
this.loading = true;
this.$set(this.formdata, "pageindex", this.page);
this.$set(this.formdata, "pagesize", this.pageSize);
2 years ago
// this.$set(this.formdata, "starttime", this.formdata.timeVal[0]);
// this.$set(this.formdata, "endtime", this.formdata.timeVal[1]);
getRealtimePhoto(this.formdata)
.then((res) => {
this.picList = res.data.list;
this.total = res.data.total;
this.loading = false;
})
.catch((err) => {
this.loading = false;
console.log(err);
});
},
//查询
onSubmit() {
2 years ago
if (this.formdata.starttime > this.formdata.endtime) {
return this.$message({
duration: 1500,
showClose: true,
message: "开始日期不能大于结束日期",
type: "warning",
});
2 years ago
}
this.getPicData();
},
2 years ago
//点击分页
handleCurrentChange(val) {
this.page = val;
this.getPicData();
2 years ago
},
//每页条数
handleSizeChange(val) {
this.pageSize = val;
this.getPicData();
},
2 years ago
},
};
</script>
2 years ago
<style lang="less">
2 years ago
.realTimeSearch {
width: calc(100% - 32px);
height: calc(100% - 32px);
padding: 16px 16px;
2 years ago
background: #fff;
.searchMain {
border: 1px solid #dddddd;
height: calc(100% - 32px);
padding: 16px;
border-radius: 4px;
.ml10 {
2 years ago
margin-left: 10px;
}
2 years ago
}
.pictureBox {
display: flex;
// justify-content: space-around;
flex-wrap: wrap;
height: calc(100% - 135px);
max-height: calc(100% - 135px);
overflow: auto;
2 years ago
border: 1px solid #eee;
.imgList {
2 years ago
width: calc((100% - 104px) / 4);
position: relative;
display: inline-block;
margin: 8px;
position: relative;
padding: 4px;
border-radius: 3px;
background: #fff;
height: fit-content;
height: 320px;
2 years ago
.el-card__body {
padding: 0px;
}
2 years ago
.bigpic {
width: 100%;
height: 100%;
background-size: 100% 100%;
}
img {
2 years ago
cursor: pointer;
width: 100%;
height: 250px;
object-fit: fill;
}
2 years ago
.caption {
padding: 9px;
color: #333;
.infoTop {
font-size: 16px;
color: #000;
font-weight: normal;
margin-top: 2px;
padding-left: 5px;
padding-right: 5px;
}
.infoBottom {
color: #000;
font-size: 12px;
font-weight: normal;
margin-top: 6px;
padding-left: 5px;
padding-right: 5px;
}
}
}
.noPicBox {
display: flex;
width: 100%;
height: calc(100% - 86px);
overflow: auto;
.el-empty {
margin: auto;
}
}
}
2 years ago
}
</style>