Compare commits

...

2 Commits

Author SHA1 Message Date
fanluyan 6598cab93e 鹤壁 2 months ago
fanluyan 5de657f529 a 2 months ago

@ -130,7 +130,7 @@ export default {
{ {
index: "/statisticalReport", index: "/statisticalReport",
title: "统计报表", title: "统计报表",
} },
], ],
}, },
{ {

@ -220,6 +220,17 @@ const routes = [
requiresAuth: true, requiresAuth: true,
}, },
}, },
{
path: "/photoTotal",
component: () => import("../views/photoTotal/index.vue"),
name: "photoTotal",
meta: {
title: "图片数据统计",
icon: "",
keepAlive: true,
requiresAuth: true,
},
},
{ {
path: "/aiwork", path: "/aiwork",
component: () => import("../views/system/drawPic.vue"), component: () => import("../views/system/drawPic.vue"),

@ -1053,10 +1053,10 @@ export function deletePresetApi(data) {
} }
//统计报表查询 //统计报表查询
export function getStatisticalReport(data){ export function getStatisticalReport(data) {
return request({ return request({
url: "/xymanager/getPhotoStat", url: "/xymanager/getPhotoStat",
method: "post", method: "post",
data data,
}); });
} }

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

@ -0,0 +1,547 @@
<template>
<div class="realTimeSearchTotal">
<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"
>
{{ item.name }}
</el-option>
</el-select>
</el-form-item>
<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>
</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>
</el-select>
</el-form-item>
<el-form-item label="装置名称">
<el-select
v-model="formdata.termid"
@change="getSearchtd"
filterable
>
<el-option
v-for="item in zzOptions"
:key="item.id"
:label="item.name"
:value="item.id"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="通道">
<el-select v-model="formdata.channelid">
<el-option
v-for="item in tdOptions"
:key="item.id"
:label="
item.alias !== null && item.alias !== ''
? item.alias
: item.name
"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="开始日期">
<el-date-picker
v-model="formdata.starttime"
type="datetime"
placeholder="开始日期"
value-format="timestamp"
:picker-options="pickerOptions"
default-time="00:00:00"
>
</el-date-picker>
</el-form-item>
<el-form-item label="结束日期">
<el-date-picker
v-model="formdata.endtime"
type="datetime"
default-time="23:59:59"
placeholder="结束日期"
value-format="timestamp"
:picker-options="pickerOptions"
class="ml10"
>
</el-date-picker>
</el-form-item>
<el-form-item>
<el-input
v-model="formdata.search"
placeholder="请输入线路/杆塔/设备名称"
clearable
></el-input>
</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">
<el-table :data="picList" style="width: 100%" height="calc(100% - 0px)">
<el-table-column prop="cmdid" label="装置编号" width="180">
</el-table-column>
<el-table-column prop="total" label="图片总数" width="180">
</el-table-column>
<el-table-column prop="wrongCount" label="异常时间点" width="180">
</el-table-column>
<el-table-column prop="channels" label="异常数据列表">
<template slot-scope="scope">
<div v-for="channelItem in scope.row.channels">
<span v-for="presetItem in channelItem.presets">
<p
v-for="wrongHour in presetItem.hours"
v-if="wrongHour.wrong == true"
>
通道{{ channelItem.channelId }}-预置位{{
presetItem.presetId
}}
-<span>
{{ wrongHour.hour }}-<span v-if="wrongHour.total > 2"
>{{ wrongHour.total - 2 }}</span
><span v-else="wrongHour.total < 2"
>{{ 2 - wrongHour.total }}</span
></span
>
</p>
</span>
</div>
</template>
</el-table-column>
</el-table>
</div>
<div class="pageNation" v-if="picList.length !== 0">
<el-pagination
@current-change="handleCurrentChange"
@size-change="handleSizeChange"
:current-page="page"
:page-size="pageSize"
:page-sizes="[20, 50, 100, 200]"
layout="sizes, prev, pager, next, jumper,total"
:total="total"
background
>
</el-pagination>
</div>
</div>
</div>
</template>
<script>
import { getSearchInfo, getPhotoStatApi } from "@/utils/api/index";
import defaultImage from "../../assets/img/nodatapic2.jpg";
export default {
name: "realTimeSearch",
data() {
return {
pickerOptions: {
disabledDate(date) {
return date.getTime() > Date.now(); //
},
},
picList: [],
dyOptions: [{ id: -1, name: "全部" }], //
xlOptions: [{ id: -1, name: "全部" }], //线
gtOptions: [{ id: -1, name: "全部" }], //
zzOptions: [{ id: -1, name: "全部" }], //
tdOptions: [{ id: -1, name: "全部", alias: null }], //
formdata: {
dyid: -1,
lineid: -1,
towerid: -1,
channelid: -1,
termid: -1,
search: "",
},
tdTermid: "",
page: 1, //
pageSize: 20, //
total: 0, //
loading: false,
signtype: 0, //0
channels: [
{ id: 1, name: "通道 1" },
{ id: 5, name: "通道 5" },
{ id: 7, name: "通道 7" },
],
presets: [
{ id: 1, name: "预置位1" },
{ id: 255, name: "默认预置位" },
],
};
},
created() {
var that = this;
document.onkeydown = function (e) {
var key = window.event.keyCode;
if (key === 13) {
that.onSubmit(); //
}
};
},
mounted() {
this.$set(this.formdata, "endtime", new Date().getTime());
if (JSON.stringify(this.$route.query) === "{}") {
this.$set(
this.formdata,
"starttime",
new Date(new Date().toLocaleDateString()).getTime()
);
this.getSearchdy();
} else {
this.getSearchdy();
this.formdata.dyid = this.$route.query.dyId;
this.formdata.lineid = this.$route.query.lineId;
this.formdata.towerid = this.$route.query.towerId;
this.formdata.channelid = this.$route.query.channelId;
this.formdata.termid = this.$route.query.termId;
this.$set(this.formdata, "starttime", Number(this.$route.query.date));
this.getPicData();
}
},
methods: {
setDefaultImage(e) {
e.target.src = defaultImage;
},
//
getSearchdy() {
getSearchInfo({ type: 1 })
.then((res) => {
this.dyOptions = this.dyOptions.concat(res.data.list);
console.log(this.dyOptions);
if (JSON.stringify(this.$route.query) === "{}") {
this.formdata.dyid = this.dyOptions[0].id;
} else {
this.formdata.dyid = Number(this.$route.query.dyId);
}
this.getSearchxl();
})
.catch((err) => {});
},
//线
getSearchxl() {
getSearchInfo({ type: 2, id: this.formdata.dyid })
.then((res) => {
this.xlOptions = [{ id: -1, name: "全部" }];
this.xlOptions = this.xlOptions.concat(res.data.list);
if (JSON.stringify(this.$route.query) === "{}") {
this.formdata.lineid = this.xlOptions[0].id;
} else {
this.formdata.lineid = Number(this.$route.query.lineId);
}
this.getSearchgt();
})
.catch((err) => {});
},
//
getSearchgt() {
getSearchInfo({ type: 3, id: this.formdata.lineid })
.then((res) => {
this.gtOptions = [{ id: -1, name: "全部" }];
this.gtOptions = this.gtOptions.concat(res.data.list);
// this.formdata.towerid = this.gtOptions[0].id;
if (JSON.stringify(this.$route.query) === "{}") {
this.formdata.towerid = this.gtOptions[0].id;
} else {
this.formdata.towerid = Number(this.$route.query.towerId);
}
this.getSearchzz();
})
.catch((err) => {});
},
//
getSearchzz() {
getSearchInfo({ type: 4, id: this.formdata.towerid })
.then((res) => {
this.zzOptions = [{ id: -1, name: "全部" }];
this.zzOptions = this.zzOptions.concat(res.data.list);
// this.formdata.termid = this.zzOptions[0].id;
console.log("切换了杆塔");
// console.log(this.formdata.termid);
// console.log(this.zzOptions[0].id);
// this.formdata.termid = this.zzOptions[0].id;
// console.log(this.formdata.termid);
if (JSON.stringify(this.$route.query) === "{}") {
this.formdata.termid = this.zzOptions[0].id;
} else {
this.formdata.termid = Number(this.$route.query.termId);
}
this.getSearchtd();
})
.catch((err) => {});
},
//
getSearchtd() {
getSearchInfo({ type: 5, id: this.formdata.termid })
.then((res) => {
this.tdOptions = [{ id: -1, name: "全部", alias: null }];
this.tdOptions = this.tdOptions.concat(res.data.list);
if (JSON.stringify(this.$route.query) === "{}") {
this.formdata.channelid = this.tdOptions[0].id;
} else {
this.formdata.channelid = Number(this.$route.query.channelId);
}
//this.getPicData();
})
.catch((err) => {});
},
getSearchtdAlone() {
getSearchInfo({ type: 5, id: this.tdTermid })
.then((res) => {
this.tdOptions = [{ id: -1, name: "全部", alias: null }];
this.tdOptions = this.tdOptions.concat(res.data.list);
})
.catch((err) => {});
},
//
getPicData() {
this.loading = true;
this.$set(this.formdata, "pageindex", this.page);
this.$set(this.formdata, "pagesize", this.pageSize);
console.log(this.formdata);
getPhotoStatApi(this.formdata)
.then((res) => {
// this.picList = [];
this.picList = res.data;
// this.total = res.data.total;
// this.tdTermid = res.data.list[0].termid;
// this.getSearchtdAlone();
// console.log(this.$route.query);
this.loading = false;
})
.catch((err) => {
this.loading = false;
console.log(err);
});
},
//
onSubmit() {
if (this.formdata.starttime > this.formdata.endtime) {
return this.$message({
duration: 1500,
showClose: true,
message: "开始日期不能大于结束日期",
type: "warning",
});
}
this.page = 1;
this.getPicData();
},
processData() {
this.picList = this.rawData.map((device) => {
const abnormalInfo = [];
device.channels.forEach((channel) => {
channel.presets.forEach((preset) => {
preset.hours.forEach((hour) => {
if (hour.wrong) {
const time = hour.hour.split(" ")[1] + ":00";
const expected = hour.base;
const actual = hour.timeList.length;
if (actual > expected) {
abnormalInfo.push(
`通道${channel.channelId}${time}${
actual - expected
}条数据共${actual}预期${expected}`
);
} else if (actual < expected) {
abnormalInfo.push(
`通道${channel.channelId}${time}${
expected - actual
}条数据共${actual}预期${expected}`
);
}
}
});
});
});
return {
cmdid: device.cmdid,
abnormalInfo,
};
});
},
//
handleCurrentChange(val) {
this.page = val;
//this.picList = [];
this.getPicData();
},
//
handleSizeChange(val) {
this.pageSize = val;
this.getPicData();
},
},
};
</script>
<style lang="less">
.realTimeSearchTotal {
width: calc(100% - 24px);
height: calc(100% - 24px);
padding: 12px 12px;
background: #fff;
.searchMain {
border: 1px solid #dddddd;
height: calc(100% - 22px);
padding: 12px;
border-radius: 4px;
.ml10 {
margin-left: 10px;
}
}
.pictureBox {
display: flex;
// justify-content: space-around;
flex-wrap: wrap;
height: calc(100% - 138px);
max-height: calc(100% - 138px);
border: 1px solid #eee;
.picShowBox {
height: 100%;
overflow: auto;
}
.imgList {
width: calc((100% - 104px) / 4);
position: relative;
display: inline-block;
margin: 8px;
position: relative;
padding: 4px;
border-radius: 3px;
background: #fff;
height: 200px;
.el-card__body {
padding: 0px;
height: 100%;
}
.bigpic {
width: 100%;
height: 100%;
//background-size: 100% 100%;
position: relative;
.el-image {
width: 100%;
height: 100%;
.el-image__placeholder {
background: url(../../assets/img/nopicbg.png) no-repeat center;
background-size: 20% 20%;
}
img {
cursor: pointer;
width: 100%;
height: 200px;
}
}
&:hover {
.deleteBox {
display: block;
}
}
}
.caption {
position: absolute;
bottom: 0px;
background: #169e8ca1;
width: calc(100% - 8px);
padding: 4px;
color: #333;
.infoTop {
font-size: 16px;
color: #fff;
font-weight: normal;
margin-top: 2px;
padding-left: 5px;
padding-right: 5px;
}
.infoBottom {
color: #fff;
font-size: 12px;
font-weight: normal;
margin-top: 6px;
padding-left: 5px;
padding-right: 5px;
}
}
.deleteBox {
position: absolute;
right: 4px;
top: 4px;
z-index: 2;
display: none;
.el-button {
width: auto;
background: rgba(0, 0, 0, 0.5);
border: 1px solid transparent;
color: #fff;
font-size: 16px;
padding: 3px;
}
&:hover {
.el-button {
background: #f56c6c;
//color: #f56c6c;
}
}
}
}
.el-loading-mask {
background-color: rgba(255, 255, 255, 0.4);
}
.noPicBox {
display: flex;
width: 100%;
height: calc(100% - 86px);
overflow: auto;
.el-empty {
margin: auto;
}
}
}
}
</style>

@ -105,6 +105,9 @@
<el-form-item> <el-form-item>
<el-button type="primary" @click="onSubmit"></el-button> <el-button type="primary" @click="onSubmit"></el-button>
</el-form-item> </el-form-item>
<el-form-item>
<el-button type="primary" @click="exportData"></el-button>
</el-form-item>
</el-form> </el-form>
</div> </div>
<div class="pictureBox" v-loading="loading"> <div class="pictureBox" v-loading="loading">
@ -216,6 +219,7 @@ import {
getSearchInfo, getSearchInfo,
getRealtimePhoto, getRealtimePhoto,
deletePicList, deletePicList,
exportPhotoJoggle,
} from "@/utils/api/index"; } from "@/utils/api/index";
import defaultImage from "../../assets/img/nodatapic2.jpg"; import defaultImage from "../../assets/img/nodatapic2.jpg";
export default { export default {
@ -413,7 +417,21 @@ export default {
this.page = 1; this.page = 1;
this.getPicData(); this.getPicData();
}, },
exportData() {
console.log(this.formdata);
exportPhotoJoggle(this.formdata)
.then((res) => {
console.log(res);
const now = this.$moment(new Date());
const formattedTime = now.format("YYYY年MM月DD日HH时mm分"); // "2023-04-01_15_30_00"
const blob = new Blob([res]);
const link = document.createElement("a");
link.href = window.URL.createObjectURL(blob);
link.download = `运维数据报表_${formattedTime}.xls`;
link.click();
})
.catch((err) => {});
},
// //
handleCurrentChange(val) { handleCurrentChange(val) {
this.page = val; this.page = val;

@ -29,19 +29,6 @@
:statusFlag="statusFlag" :statusFlag="statusFlag"
></equipmentStatus ></equipmentStatus
></el-tab-pane> ></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> </el-tabs>
</div> </div>
</template> </template>
@ -50,13 +37,11 @@ import {} from "@/utils/api/index";
import photostatis from "./photostatis/index"; import photostatis from "./photostatis/index";
import equipmentStatus from "./equipmentStatus/index"; import equipmentStatus from "./equipmentStatus/index";
import photoTotal from "./photoTotal/index";
export default { export default {
name: "reportData", name: "reportData",
components: { components: {
photostatis, photostatis,
equipmentStatus, equipmentStatus,
photoTotal,
}, },
data() { data() {
return { return {
@ -90,14 +75,6 @@ export default {
this.$refs.equipmentStatusRef.initfn(); // someOtherMethod this.$refs.equipmentStatusRef.initfn(); // someOtherMethod
//this.$refs.equipmentStatusRef.onSubmit(); // 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
}
} }
// //
}, },
@ -109,10 +86,6 @@ export default {
console.log("bbbbbb"); console.log("bbbbbb");
this.$refs.equipmentStatusRef.showSearch(); this.$refs.equipmentStatusRef.showSearch();
}, },
handlepicTotal() {
console.log("ccc");
this.$refs.photoTotalRef.showSearch();
},
}, },
}; };
</script> </script>

@ -1,184 +0,0 @@
<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>

@ -1,235 +0,0 @@
<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>

@ -1,193 +0,0 @@
<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>

@ -1,526 +0,0 @@
<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>

@ -152,7 +152,7 @@ export default {
for (let j = 0; j < this.checkList.length; j++) { for (let j = 0; j < this.checkList.length; j++) {
for (let i = 0; i < this.cmdidArr.length; i++) { for (let i = 0; i < this.cmdidArr.length; i++) {
var command = var command =
".\\bin\\xympadmn.exe --server=61.169.135.150 --port=6891 --act=osd --cmdid=" + ".\\bin\\xympadmn.exe --server=61.169.135.150 --port=6891 --udp=1 --showTime=1 --showText=0 --text= --act=osd --cmdid=" +
this.cmdidArr[i] + this.cmdidArr[i] +
" --flag=1 --channel=" + " --flag=1 --channel=" +
this.checkList[j] + this.checkList[j] +

Loading…
Cancel
Save