添加photolist

menu1.0
fanluyan 3 months ago
parent 1b7fa0fc83
commit 2ea14d17c7

@ -59,3 +59,13 @@ export function getActivityApi(data) {
params: data,
});
}
//图片统计结果
export function getPhotoStatApi(data) {
return request({
url: "/xymanager/getPhotoStat",
method: "post",
data,
});
}

@ -321,7 +321,7 @@ export default {
takePicShow: false,
takepicform: {
selectChannelValue: 1,
presetVal: 0,
presetVal: 1,
},
deviceTimer: null, //
deviceNum: 1, //
@ -718,8 +718,12 @@ export default {
const filteredChannelList = res.data.list.filter(
(channel) => channel.type === 1
);
console.log(this.channelListOption);
this.channelListOption = filteredChannelList;
this.ytChannel = filteredChannelList[0].channelid;
this.takepicform.selectChannelValue =
filteredChannelList[0].channelid;
//this.channelListOption = res.data.list;
})
.catch((err) => {

@ -29,6 +29,19 @@
:statusFlag="statusFlag"
></equipmentStatus
></el-tab-pane>
<!-- <el-tab-pane label="图片数量统计">
<span slot="label">
图片数量统计
<el-button
@click.stop="handlepicTotal"
v-if="pictotalFlag"
type="primary"
icon="el-icon-search"
></el-button>
</span>
<photoTotal ref="photoTotalRef"></photoTotal>
></el-tab-pane
> -->
</el-tabs>
</div>
</template>
@ -37,16 +50,19 @@ import {} from "@/utils/api/index";
import photostatis from "./photostatis/index";
import equipmentStatus from "./equipmentStatus/index";
import photoTotal from "./photoTotal/index";
export default {
name: "reportData",
components: {
photostatis,
equipmentStatus,
photoTotal,
},
data() {
return {
picSearchFlag: true,
statusFlag: false,
pictotalFlag: false,
};
},
created() {},
@ -60,6 +76,7 @@ export default {
if (tabName === "照片统计") {
this.picSearchFlag = true;
this.statusFlag = false;
this.pictotalFlag = false;
//
if (this.$refs.photoStatisRef) {
this.$refs.photoStatisRef.onSubmit(); // someMethod
@ -67,11 +84,20 @@ export default {
} else if (tabName === "设备状态列表") {
this.picSearchFlag = false;
this.statusFlag = true;
this.pictotalFlag = false;
//
if (this.$refs.equipmentStatusRef) {
this.$refs.equipmentStatusRef.initfn(); // someOtherMethod
//this.$refs.equipmentStatusRef.onSubmit(); // someOtherMethod
}
} else if (tabName === "图片数量统计") {
this.picSearchFlag = false;
this.statusFlag = false;
this.pictotalFlag = true;
if (this.$refs.photoTotalRef) {
this.$refs.photoTotalRef.initfn(); // someOtherMethod
//this.$refs.equipmentStatusRef.onSubmit(); // someOtherMethod
}
}
//
},
@ -83,6 +109,10 @@ export default {
console.log("bbbbbb");
this.$refs.equipmentStatusRef.showSearch();
},
handlepicTotal() {
console.log("ccc");
this.$refs.photoTotalRef.showSearch();
},
},
};
</script>

@ -0,0 +1,184 @@
<template>
<el-dialog
class="ipDialog"
title="历史IP信息"
:visible.sync="isShow"
:close-on-click-modal="false"
width="820px"
><div class="headInfo">
<span class="zzid">装置编号{{ rowData.cmdid }}</span>
<span class="pictotal">总数{{ total }}</span>
</div>
<div class="ipContain">
<el-table
v-loading="iploading"
ref="multipleTable"
:data="ipListData"
tooltip-effect="dark"
stripe
style="width: 100%"
height="calc(100% - 0px)"
fit
border
>
<template slot="empty">
<el-empty :image-size="160" description="暂无数据"></el-empty>
</template>
<el-table-column label="序号" width="50px">
<template slot-scope="scope">
{{ scope.$index + 1 }}
</template>
</el-table-column>
<el-table-column label="心跳服务器时间" prop="heartbeatTime">
<template slot-scope="scope">
{{
scope.row.createTime == null || scope.row.createTime == 0
? ""
: scope.row.createTime
}}
</template>
</el-table-column>
<el-table-column label="心跳报文时间" prop="heartbeatTime">
<template slot-scope="scope">
{{
scope.row.heartbeatTime == null || scope.row.heartbeatTime == 0
? ""
: $moment(scope.row.heartbeatTime * 1000).format(
"YYYY-MM-DD HH:mm:ss"
)
}}
</template>
</el-table-column>
<el-table-column label="IP" prop="heartbeatIp"> </el-table-column>
<el-table-column label="端口" prop="heartbeatPort"> </el-table-column>
</el-table>
</div>
<div class="pageNation">
<el-pagination
@current-change="handleCurrentChange"
@size-change="handleSizeChange"
:current-page="page"
:page-size="pageSize"
layout="sizes, prev, pager, next, jumper,total"
:total="total"
background
>
</el-pagination>
</div>
<div slot="footer" class="dialog-footer">
<el-button @click="isShow = false"> </el-button>
</div>
</el-dialog>
</template>
<script>
import { getIpList } from "@/utils/api/reportApi";
export default {
props: {},
data() {
return {
isShow: false,
rowData: "",
iploading: false,
ipListData: [],
page: 1, //
pageSize: 20, //
total: 0, //
};
},
methods: {
getIPList() {
this.iploading = true;
setTimeout(() => {
getIpList({
termId: this.rowData.id,
pageNum: this.page,
pageSize: this.pageSize,
})
.then((res) => {
console.log(res);
this.ipListData = res.data.list;
this.total = res.data.total;
this.iploading = false;
})
.catch((err) => {
this.iploading = false;
console.log(err);
});
}, 100);
},
display(row) {
this.isShow = true;
this.rowData = row;
this.getIPList();
},
hide() {
this.isShow = false;
},
//
handleCurrentChange(val) {
this.page = val;
this.getIPList();
},
//
handleSizeChange(val) {
this.pageSize = val;
this.getIPList();
},
},
created() {},
};
</script>
<style lang="less">
.ipDialog {
.el-dialog {
height: 70%;
.el-dialog__body {
height: calc(100% - 126px);
}
}
.el-table {
.cell {
text-align: center;
vertical-align: middle; /* 如果需要垂直居中 */
}
}
.ipContain {
height: calc(100% - 32px);
.el-table {
color: #000;
thead {
color: #000;
font-weight: bold;
}
th.el-table__cell {
background: #dcdcdc !important;
}
td.el-table__cell,
th.el-table__cell.is-leaf {
border-bottom: 1px solid #dcdcdc;
}
.el-table__cell {
border-right: 1px solid #dcdcdc;
}
}
}
.headInfo {
position: absolute;
top: 22px;
left: 154px;
display: flex;
align-items: center;
font-size: 14px;
.zzid {
color: #333;
}
.pictotal {
margin-left: 12px;
}
}
}
</style>

@ -0,0 +1,235 @@
<template>
<el-dialog
class="photoDialog"
title="图片历史数据"
:visible.sync="isShow"
:close-on-click-modal="false"
@close="hide"
width="100%"
>
<div class="headInfo">
<span class="zzid">装置编号{{ rowData.cmdid }}</span>
<span class="pictotal">图片总数{{ total }}</span>
<el-radio-group v-model="radio" @change="handleRadioChange">
<el-radio :label="-1">全部</el-radio>
<el-radio :label="1">通道1</el-radio>
<el-radio :label="2">通道2</el-radio>
<el-radio :label="3">通道3</el-radio>
<el-radio :label="4">通道4</el-radio>
<el-radio :label="5">通道5</el-radio>
<el-radio :label="6">通道6</el-radio>
<el-radio :label="7">通道7</el-radio>
<el-radio :label="8">通道8</el-radio>
</el-radio-group>
</div>
<div class="ipContain">
<el-table
v-loading="picloading"
ref="multipleTable"
:data="picListData"
stripe
tooltip-effect="dark"
style="width: 100%"
height="calc(100% - 0px)"
border
>
<template slot="empty">
<el-empty :image-size="160" description="暂无数据"></el-empty>
</template>
<el-table-column label="序号" width="50px">
<template slot-scope="scope">
{{ (page - 1) * pageSize + scope.$index + 1 }}
</template>
</el-table-column>
<!-- <el-table-column label="照片Id" prop="picid"> </el-table-column> -->
<el-table-column label="通道号" prop="channnelname"> </el-table-column>
<el-table-column label="预置位" prop="presetId"> </el-table-column>
<el-table-column label="收到时间" prop="recvTime"> </el-table-column>
<el-table-column label="拍照时间" prop="photoTime"> </el-table-column>
<el-table-column label="类型" prop="mediaType">
<template slot-scope="scope">
{{ scope.row.mediaType == 0 ? "图片" : "视频" }}
</template>
</el-table-column>
<el-table-column label="照片" prop="path">
<template slot-scope="scope">
<a :href="scope.row.path" target="_blank">
<el-image
style="width: 120px; height: 80px; cursor: pointer"
:src="scope.row.path"
>
</el-image>
{{ scope.row.picid }}
</a>
</template>
</el-table-column>
</el-table>
<div class="pageNation">
<el-pagination
@current-change="handleCurrentChange"
@size-change="handleSizeChange"
:current-page="page"
:page-size="pageSize"
layout="sizes, prev, pager, next, jumper,total"
:total="total"
background
>
</el-pagination>
</div>
</div>
<!-- <div slot="footer" class="dialog-footer">
<el-button @click="isShow = false"> </el-button>
</div> -->
</el-dialog>
</template>
<script>
import { getphotoApi } from "@/utils/api/reportApi";
export default {
props: {},
data() {
return {
isShow: false,
rowData: "",
paramsData: "",
picListData: [],
picloading: false,
radio: "-1",
page: 1, //
pageSize: 20, //
total: 0, //
};
},
created() {},
methods: {
//
display(row, params) {
this.isShow = true;
this.rowData = row;
this.paramsData = params; //
this.radio = this.paramsData.channelid;
console.log(this.radio);
console.log(row, params);
//localStorage.setItem("picflag", this.isShow);
this.getPhotoList();
},
hide() {
this.isShow = false;
// console.log(this.isShow);
// localStorage.setItem("picflag", this.isShow);
},
getPhotoList() {
this.picloading = true;
setTimeout(() => {
getphotoApi({
dyid: this.rowData.dyId,
lineid: this.rowData.lineId,
towerid: this.rowData.towerId,
channelid: this.radio,
termid: this.rowData.id,
starttime: this.paramsData.starttime,
endtime: this.paramsData.endtime,
pageindex: this.page,
pagesize: this.pageSize,
})
.then((res) => {
console.log(res);
this.picListData = res.data.list;
this.total = res.data.total;
this.picloading = false;
})
.catch((err) => {
this.picloading = false;
console.log(err);
});
}, 100);
},
//
handleCurrentChange(val) {
this.page = val;
this.getPhotoList();
},
//
handleSizeChange(val) {
this.pageSize = val;
this.getPhotoList();
},
handleRadioChange(value) {
// valuelabel
console.log("当前选中的label是:", value);
// value
this.radio = value;
this.getPhotoList();
},
},
created() {},
};
</script>
<style lang="less">
.photoDialog {
.el-dialog {
height: 100%;
margin: 0px;
.el-table {
.cell {
text-align: center;
vertical-align: middle; /* 如果需要垂直居中 */
}
}
.headInfo {
position: absolute;
top: 22px;
left: 154px;
display: flex;
align-items: center;
font-size: 14px;
.zzid {
color: #333;
}
.pictotal {
margin-left: 12px;
}
.el-radio-group {
margin-top: 4px;
margin-left: 24px;
}
}
.el-dialog__body {
height: calc(100% - 70px);
padding: 8px;
}
.ipContain {
height: calc(100% - 40px);
.el-table {
color: #000;
thead {
color: #000;
font-weight: bold;
}
th.el-table__cell {
background: #dcdcdc !important;
}
td.el-table__cell,
th.el-table__cell.is-leaf {
border-bottom: 1px solid #dcdcdc;
}
.el-table__cell {
border-right: 1px solid #dcdcdc;
}
}
}
}
.el-dialog__headerbtn {
top: 18px;
.el-dialog__close {
font-size: 26px;
&:hover {
background: #e2e2e2;
}
}
}
}
</style>

@ -0,0 +1,193 @@
<template>
<el-dialog
class="phototimeDialog"
title="当天图片统计"
:visible.sync="isShowTime"
:close-on-click-modal="false"
@close="hide"
width="100%"
>
<h3>{{ rowData.cmdid }}</h3>
<el-table :data="tableData" style="width: 100%" border>
<el-table-column
prop="channel"
label="通道"
width="120"
></el-table-column>
<el-table-column
prop="totalCount"
label="总数"
width="120"
></el-table-column>
<el-table-column
prop="presetId"
label="预置位"
width="120"
></el-table-column>
<el-table-column prop="anomalies" label="异常时间点"></el-table-column>
</el-table>
</el-dialog>
</template>
<script>
import { getphotoApi, getPhotoStatApi } from "@/utils/api/reportApi";
export default {
data() {
return {
isShowTime: false,
rowData: {},
paramsData: {},
picListData: [],
picloading: false,
radio: "-1",
page: 1,
pageSize: 400,
total: 0,
tableData: [],
};
},
methods: {
//
display(row, params) {
this.isShowTime = true;
this.rowData = row;
this.paramsData = params;
this.radio = params.channelid;
this.getPhotoList();
},
//
hide() {
this.isShowTime = false;
},
//
getPhotoList() {
this.picloading = true;
getphotoApi({
dyid: this.rowData.dyId,
lineid: this.rowData.lineId,
towerid: this.rowData.towerId,
channelid: this.radio,
termid: this.rowData.id,
starttime: this.paramsData.starttime,
endtime: this.paramsData.endtime,
pageindex: this.page,
pagesize: this.pageSize,
})
.then((res) => {
this.picListData = res.data.list;
this.total = res.data.total;
this.processData();
})
.catch((err) => {
console.error("获取图片数据失败:", err);
})
.finally(() => {
this.picloading = false;
});
},
//
processData() {
const channelPresetMap = {};
//
this.picListData.forEach((photo) => {
const channel = photo.channnelname;
const presetId = photo.presetId;
const hour = new Date(photo.photoTime).getHours();
console.log("我是时间", hour);
const key = `${channel}-${presetId}`;
if (!channelPresetMap[key]) {
channelPresetMap[key] = {
channel: channel,
presetId: presetId,
totalCount: 0,
hourlyData: new Array(24).fill(0),
};
}
channelPresetMap[key].totalCount++;
channelPresetMap[key].hourlyData[hour]++;
});
//
const groupedData = this.groupByChannel(channelPresetMap);
console.log(groupedData);
//
this.tableData = groupedData.flatMap((group) => {
return group.map((item) => {
const anomalies = this.detectAnomalies(item.hourlyData);
return {
channel: item.channel,
presetId: `预置位:${item.presetId}`,
totalCount: item.totalCount,
anomalies: anomalies.join(", "),
};
});
});
},
//
groupByChannel(channelPresetMap) {
const grouped = {};
Object.values(channelPresetMap).forEach((item) => {
const channel = item.channel;
if (!grouped[channel]) {
grouped[channel] = [];
}
grouped[channel].push(item);
});
return Object.keys(grouped)
.sort()
.map((channel) => grouped[channel]);
},
//
detectAnomalies(hourlyData) {
const anomalies = [];
const now = new Date(); //
const currentHour = now.getHours(); //
hourlyData.forEach((count, hour) => {
//
if (hour <= currentHour) {
if (count > 2) {
anomalies.push(`${hour}:00 - 多${count - 2}`);
} else if (count < 2) {
anomalies.push(`${hour}:00 - 少${2 - count}`);
}
}
});
return anomalies;
},
//
handleCurrentChange(val) {
this.page = val;
this.getPhotoList();
},
handleSizeChange(val) {
this.pageSize = val;
this.getPhotoList();
},
},
};
</script>
<style lang="less">
.phototimeDialog {
h3 {
margin-bottom: 20px;
}
.el-dialog {
height: 100%;
margin: 0px;
.el-dialog__body {
height: calc(100% - 70px);
padding: 8px;
}
}
}
</style>

@ -0,0 +1,526 @@
<template>
<div class="photoStatisBoxTotal" ref="totalRef">
<div class="searchBox" ref="searchref" v-if="drawerSearch">
<el-form :inline="true" :model="formdata" class="demo-form-inline">
<el-form-item label="电压等级" class="dyclass">
<el-select v-model="formdata.dyid" @change="getSearchxl">
<el-option
v-for="item in dyOptions"
:key="item.id"
:label="item.name"
:value="item.id"
>
{{ item.name }}
</el-option>
</el-select>
</el-form-item>
<el-form-item label="线路名称" class="xlclass">
<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>
</el-select>
</el-form-item>
<el-form-item label="杆塔名称" class="gtclass">
<el-select v-model="formdata.towerid" filterable>
<el-option
v-for="item in gtOptions"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="通道" class="tdclass">
<el-select v-model="formdata.channelid">
<el-option
v-for="item in tdOptions"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item
label="活动"
class="activitybox"
v-if="roleName === 'superadmin' || roleName === 'Matthew'"
>
<el-select
@keyup.enter.native="onSubmit()"
v-model="formdata.activityId"
filterable
@change="changeActive"
>
<el-option
v-for="item in activityOptions"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="开始日期" class="dateclass">
<el-date-picker
v-model="formdata.starttime"
type="datetime"
placeholder="开始日期"
value-format="timestamp"
:picker-options="pickerOptions"
>
</el-date-picker>
</el-form-item>
<el-form-item label="结束日期" class="dateclass">
<el-date-picker
v-model="formdata.endtime"
type="datetime"
placeholder="结束日期"
value-format="timestamp"
:picker-options="pickerOptions"
>
</el-date-picker>
</el-form-item>
<el-form-item label="装置查询" class="schclass">
<el-input
v-model="formdata.search"
placeholder="请输入线路/杆塔/设备名称"
clearable
></el-input>
</el-form-item>
<el-form-item class="onsubBtn">
<el-button type="primary" @click="onSubmit"></el-button>
</el-form-item>
</el-form>
</div>
<div class="deviceTable">
<el-table
v-loading="photoLoading"
ref="multipleTable"
:data="photoList"
tooltip-effect="dark"
stripe
style="width: 100%"
:height="tableheight"
fit
:default-sort="{ order: 'descending' }"
>
<template slot="empty">
<el-empty :image-size="160" description="暂无数据"></el-empty>
</template>
<el-table-column label="序号" width="50px">
<template slot-scope="scope">
{{ (page - 1) * pageSize + scope.$index + 1 }}
</template>
</el-table-column>
<!-- <el-table-column prop="id" label="ID" width="80px"> </el-table-column> -->
<el-table-column prop="cmdid" label="装置编号"> </el-table-column>
<el-table-column
prop="total"
label="图片总数"
show-overflow-tooltip
sortable
>
</el-table-column>
<el-table-column
prop="wrongCount"
label="错误数量"
min-width="180"
show-overflow-tooltip
sortable
>
</el-table-column>
</el-table>
<div class="pageNation">
<el-pagination
@current-change="handleCurrentChange"
@size-change="handleSizeChange"
:current-page="page"
:page-size="pageSize"
:page-sizes="[20, 50, 100, 500, 1000]"
layout="sizes, prev, pager, next, jumper,total"
:total="total"
background
>
</el-pagination>
</div>
</div>
<!-- <ipDialog ref="ipDialogref"></ipDialog>
<photoDialog ref="photoDialogref"></photoDialog>
<photoTimeList ref="phototimeDialogref"></photoTimeList> -->
</div>
</template>
<script>
import {
getSearchInfo,
getActivityApi,
getPhotoStatApi,
} from "@/utils/api/reportApi";
// import ipDialog from "./components/ipDialog";
// import photoDialog from "./components/photoList";
// import photoTimeList from "./components/photoTimeList";
export default {
name: "photoStatisBoxTotal",
components: {},
data() {
return {
pickerOptions: {
disabledDate(date) {
return date.getTime() > Date.now(); //
},
},
photoList: [],
dyOptions: [{ id: -1, name: "全部" }], //
xlOptions: [{ id: -1, name: "全部" }], //线
gtOptions: [{ id: -1, name: "全部" }], //
activityOptions: [{ id: -1, name: "全部" }], //
tdOptions: [
{ id: -1, name: "全部" },
{ id: 1, name: "通道1" },
{ id: 2, name: "通道2" },
{ id: 3, name: "通道3" },
{ id: 4, name: "通道4" },
{ id: 5, name: "通道5" },
{ id: 6, name: "通道6" },
{ id: 7, name: "通道7" },
{ id: 8, name: "通道8" },
], //
formdata: {
dyid: -1,
lineid: -1,
towerid: -1,
channelid: -1,
activityId: -1,
starttime: new Date(new Date().setHours(0, 0, 0, 0)).getTime(), // 00:00:00
endtime: new Date(new Date().setHours(23, 59, 59, 0)).getTime(), // 23:59:59
search: "",
},
page: 1, //
pageSize: 20, //
total: 0, //
photoLoading: false,
drawerSearch: false,
tableheight: "100%",
roleName: "",
picflag: false,
};
},
created() {
this.roleName = localStorage.getItem("userName");
let pageSizeFromStorage = localStorage.getItem("photoPageSize");
// 使this.pageSize
this.pageSize =
pageSizeFromStorage !== null && pageSizeFromStorage !== ""
? parseInt(pageSizeFromStorage, 10)
: 20;
// this.picflag = localStorage.getItem("picflag");
// const backButtonRouteGuard = this.$router.beforeEach((to, from, next) => {
// if (from.name == "reportData" && this.picflag == "true") {
// console.log(from.name == "reportData" && this.picflag);
// /* Blocking back button in menu route */
// console.log(from.name);
// next(false);
// // this.hide();
// this.$refs.photoDialogref.hide();
// } else {
// /* allowing all other routes*/
// next(true);
// }
// });
// this.$once("hook:destroyed", () => {
// backButtonRouteGuard();
// });
},
mounted() {
this.getSearchdy();
this.getactiveList();
},
watch: {},
methods: {
//pic
picSort(a, b) {
// a b mntnStatus.reportMap
const aPic = (a.photoInfo.photoCount && a.photoInfo.photoCount) || 0;
const bPic = (b.photoInfo.photoCount && b.photoInfo.photoCount) || 0;
// pic
const numA = Number(aPic);
const numB = Number(bPic);
//
//
return numA - numB;
// numB - numA
},
formatLastHeartbeat(timestamp) {
return this.$moment(timestamp * 1000).format("YYYY-MM-DD HH:mm:ss");
},
sortRecvTime(a, b) {
// null
const dateA = a.photoInfo.lastRecvTime
? new Date(a.photoInfo.lastRecvTime)
: new Date(0);
const dateB = b.photoInfo.lastRecvTime
? new Date(b.photoInfo.lastRecvTime)
: new Date(0);
//
if (dateA < dateB) return -1;
if (dateA > dateB) return 1;
return 0;
},
sortlastPhotoTime(a, b) {
// null
const dateA = a.photoInfo.lastPhotoTime
? new Date(a.photoInfo.lastPhotoTime)
: new Date(0);
const dateB = b.photoInfo.lastPhotoTime
? new Date(b.photoInfo.lastPhotoTime)
: new Date(0);
//
if (dateA < dateB) return -1;
if (dateA > dateB) return 1;
return 0;
},
sortfirstTime(a, b) {
// null
const dateA = a.photoInfo.firstPhotoTime
? new Date(a.photoInfo.firstPhotoTime)
: new Date(0);
const dateB = b.photoInfo.firstPhotoTime
? new Date(b.photoInfo.firstPhotoTime)
: new Date(0);
//
if (dateA < dateB) return -1;
if (dateA > dateB) return 1;
return 0;
},
//
getSearchdy() {
getSearchInfo({ type: 1 })
.then((res) => {
this.dyOptions = this.dyOptions.concat(res.data.list);
console.log(this.dyOptions);
this.getSearchxl();
})
.catch((err) => {});
},
//线
getSearchxl() {
getSearchInfo({ type: 2, id: this.formdata.dyid })
.then((res) => {
this.xlOptions = this.xlOptions.concat(res.data.list);
this.getSearchgt();
})
.catch((err) => {});
},
//
getSearchgt() {
getSearchInfo({ type: 3, id: this.formdata.lineid })
.then((res) => {
this.gtOptions = this.gtOptions.concat(res.data.list);
this.onSubmit();
})
.catch((err) => {});
},
//
getactiveList() {
getActivityApi()
.then((res) => {
console.log(res);
// this.activityOptions = this.activityOptions.concat(res.data.list);
let activeArr = res.data.map((item) => ({
id: item.id,
name: item.title,
}));
this.activityOptions = this.activityOptions.concat(activeArr);
this.formdata.activityId = this.activityOptions[0].id;
// this.formdata.activityId =
// JSON.parse(localStorage.getItem("activeId")) !== null
// ? JSON.parse(localStorage.getItem("activeId"))
// : this.activityOptions[0].id;
})
.catch((err) => {});
},
changeActive(val) {
// localStorage.setItem("activeId", JSON.stringify(val));
},
onSubmit() {
if (this.formdata.starttime > this.formdata.endtime) {
return this.$message({
duration: 1500,
showClose: true,
message: "开始日期不能大于结束日期",
type: "warning",
});
}
this.page = 1;
this.getPhotoFun();
},
//
getPhotoFun() {
console.log(this.formdata);
this.photoLoading = true;
let params = {
starttime: this.formdata.starttime,
endtime: this.formdata.endtime,
pageindex: this.page,
pagesize: this.pageSize,
dyid: this.formdata.dyid,
lineid: this.formdata.lineid,
towerid: this.formdata.towerid,
channelid: this.formdata.channelid,
};
//
// if (this.formdata.dyid !== -1) {
// params.dyid = this.formdata.dyid;
// }
// if (this.formdata.lineid !== -1) {
// params.lineid = this.formdata.lineid;
// }
// if (this.formdata.towerid !== -1) {
// params.towerid = this.formdata.towerid;
// }
// if (this.formdata.channelid !== -1) {
// params.channelid = this.formdata.channelid;
// }
// if (this.formdata.activityId !== -1) {
// params.activityId = this.formdata.activityId;
// }
// if (this.formdata.search !== "") {
// params.cmdid = this.formdata.search;
// }
setTimeout(() => {
getPhotoStatApi(params)
.then((res) => {
console.log(res);
this.photoList = res.data;
this.photoLoading = false;
})
.catch((err) => {
this.photoLoading = false;
});
}, 100);
},
//
handleCurrentChange(val) {
this.page = val;
this.getPhotoFun();
},
//
handleSizeChange(val) {
this.pageSize = val;
localStorage.setItem("photoPageSize", this.pageSize);
//this.getPhotoFun();
},
//
handleShowPhoto(row) {
let params = this.formdata;
this.$refs.photoDialogref.display(row, params);
},
handleShowtime(row) {
let params = this.formdata;
this.$refs.phototimeDialogref.display(row, params);
},
// ip
handleShowIp(row) {
this.$refs.ipDialogref.display(row);
},
showSearch() {
this.drawerSearch = !this.drawerSearch;
console.log(this.drawerSearch);
this.$nextTick(() => {
if (this.drawerSearch) {
//
console.log(this.$refs.totalRef.offsetHeight);
const searchBoxHeight = this.$refs.searchref.offsetHeight;
console.log("搜索框的高度:", searchBoxHeight);
this.tableheight =
this.$refs.totalRef.offsetHeight - searchBoxHeight - 36;
console.log(this.tableheight);
} else {
this.tableheight = "100%";
}
});
},
},
};
</script>
<style lang="less">
.photoStatisBoxTotal {
height: 100%;
//background-color: #fcc;
.searchBox {
.el-form {
.el-form-item--small.el-form-item {
margin-bottom: 8px;
}
}
.dyclass {
.el-select {
width: 120px;
}
}
.xlclass {
.el-select {
width: 150px;
}
}
.gtclass {
.el-select {
width: 180px;
}
}
.tdclass {
.el-select {
width: 80px;
}
}
.dateclass {
.el-date-editor.el-input,
.el-date-editor.el-input__inner {
width: 190px;
}
}
}
.deviceTable {
height: calc(100% - 32px);
//background: #fcc;
.el-table {
.cell {
text-align: center;
vertical-align: middle; /* 如果需要垂直居中 */
}
}
.el-table {
color: #000;
thead {
color: #000;
font-weight: bold;
}
th.el-table__cell {
background: #dcdcdc !important;
}
td.el-table__cell,
th.el-table__cell.is-leaf {
border-bottom: 1px solid #dcdcdc;
}
.el-table__cell {
border-right: 1px solid #dcdcdc;
}
}
}
}
</style>

@ -31,7 +31,7 @@
</template>
<script>
import { getphotoApi } from "@/utils/api/reportApi";
import { getphotoApi, getPhotoStatApi } from "@/utils/api/reportApi";
export default {
data() {

Loading…
Cancel
Save