添加数据报表

jc
fanluyan 1 year ago
parent cea121f20a
commit e3e0b966c0

@ -119,6 +119,10 @@ export default {
index: "/devicePhotoSchedule",
title: "拍照时间表设置",
},
{
index: "/reportData",
title: "数据报表",
},
],
},
{

@ -187,6 +187,18 @@ const routes = [
requiresAuth: true,
},
},
{
path: "/reportData",
component: () => import("../views/reportData/index.vue"),
name: "reportData",
meta: {
title: "数据报表",
icon: "",
keepAlive: true,
requiresAuth: true,
},
},
{
path: "/echarts",
component: () => import("../echartsDemo.vue"),

@ -0,0 +1,27 @@
import request from "../request";
//照片统计
export function getphotoList(data) {
return request({
url: "/xymanager/terminal/listWithPhoto",
method: "get",
params: data,
});
}
//获取电压-线路-杆塔等信息
export function getSearchInfo(data) {
return request({
url: "/xymanager/getLineAndGt",
method: "post",
data,
});
}
//获取实时图片数据
export function getphotoApi(data) {
return request({
url: "/xymanager/getPhotoList",
method: "post",
data,
});
}

@ -166,10 +166,15 @@
>
<template slot-scope="scope">
<!-- {{ scope.row.onlinestatus ? "在线" : "离线" }} -->
<span style="color: #169e8c" v-if="scope.row.onlinestatus"
<span style="color: #169e8c" v-if="scope.row.onlinestatus == 1"
>在线</span
>
<span style="color: #f56c6c" v-else>线</span>
<span
style="color: #f56c6c"
v-else-if="scope.row.onlinestatus == 0"
>离线</span
>
<span style="color: #e6a23c" v-else></span>
</template>
</el-table-column>
<el-table-column
@ -229,7 +234,7 @@
<el-table-column
fixed="right"
label="操作"
width="340"
width="420"
v-if="roleUser != 2"
>
<template slot-scope="scope">
@ -259,6 +264,22 @@
>
</el-dropdown-menu>
</el-dropdown>
<el-button
:disabled="
scope.row.onlinestatus == 0 || scope.row.onlinestatus != 1
"
@click.native.stop="handlexmSet(scope.row)"
type="text"
>休眠</el-button
>
<el-button
:disabled="
scope.row.onlinestatus == 0 || scope.row.onlinestatus != -1
"
@click.native.stop="handlehqSet(scope.row)"
type="text"
>唤起</el-button
>
<el-button
@click.native.stop="handleParameterSet(scope.row)"
type="text"
@ -435,6 +456,31 @@ export default {
this.terminalList();
},
methods: {
//
handlexmSet(row) {
console.log(row);
this.$message({
duration: 1000,
type: "success",
message: "休眠命令已下发...",
showClose: true,
});
setTimeout(() => {
row.onlinestatus = -1;
}, 1500);
},
//
handlehqSet(row) {
this.$message({
duration: 1000,
type: "success",
message: "唤起命令已下发...",
showClose: true,
});
setTimeout(() => {
row.onlinestatus = 1;
}, 1500);
},
getRowKeys(row) {
return row.id;
},

@ -0,0 +1,47 @@
<template>
<div class="reportDataBox">
<!-- <div class="reoprtContain"></div> -->
<el-tabs type="border-card">
<el-tab-pane label="照片统计"> <photostatis></photostatis> </el-tab-pane>
<el-tab-pane label="设备状态列表">设备状态查询</el-tab-pane>
<!-- <el-tab-pane label="角色管理">角色管理</el-tab-pane>
<el-tab-pane label="定时任务补偿">定时任务补偿</el-tab-pane> -->
</el-tabs>
</div>
</template>
<script>
import {} from "@/utils/api/index";
import photostatis from "./photostatis/index";
export default {
name: "reportData",
components: {
photostatis,
},
data() {
return {};
},
created() {},
mounted() {},
watch: {},
methods: {},
};
</script>
<style lang="less">
.reportDataBox {
width: calc(100% - 24px);
height: calc(100% - 24px);
padding: 12px 12px;
.el-tabs {
height: 100%;
.el-tabs__content {
height: calc(100% - 69px);
overflow: auto;
.el-tab-pane {
height: 100%;
}
}
}
}
</style>

@ -0,0 +1,45 @@
<template>
<el-dialog
class="ipDialog"
title="历史IP信息"
:visible.sync="isShow"
:close-on-click-modal="false"
width="420px"
>
<div class="ipContain">这里时ip</div>
<div slot="footer" class="dialog-footer">
<el-button @click="isShow = false"> </el-button>
</div>
</el-dialog>
</template>
<script>
import {} from "@/utils/api/index";
export default {
props: {},
data() {
return {
isShow: false,
rowData: "",
};
},
methods: {
//
display(row) {
this.isShow = true;
this.rowData = row;
},
hide() {
this.isShow = false;
},
},
created() {},
};
</script>
<style lang="less">
.ipDialog {
}
</style>

@ -0,0 +1,200 @@
<template>
<el-dialog
class="photoDialog"
title="图片历史数据"
:visible.sync="isShow"
:close-on-click-modal="false"
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-group>
</div>
<div class="ipContain">
<el-table
v-loading="picloading"
ref="multipleTable"
:data="picListData"
tooltip-effect="dark"
stripe
style="width: 100%"
height="calc(100% - 0px)"
fit
>
<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>
</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, //
};
},
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);
this.getPhotoList();
},
hide() {
this.isShow = false;
},
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;
.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-dialog__headerbtn {
top: 18px;
.el-dialog__close {
font-size: 26px;
&:hover {
background: #e2e2e2;
}
}
}
}
</style>

@ -0,0 +1,359 @@
<template>
<div class="photoStatisBox">
<div class="searchBox" ref="searchref">
<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="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>
<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="deviceTable">
<el-table
v-loading="photoLoading"
ref="multipleTable"
:data="photoList"
tooltip-effect="dark"
stripe
style="width: 100%"
height="calc(100% - 0px)"
fit
>
<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="dyName" label="电压等级"> </el-table-column>
<el-table-column prop="lineName" label="线路名称"> </el-table-column>
<el-table-column prop="towerName" label="杆塔名称"> </el-table-column>
<el-table-column prop="cmdid" label="装置id">
<template slot-scope="scope">
<el-link
type="primary"
@click.native.stop="handleShowPhoto(scope.row)"
>
{{ scope.row.cmdid }}</el-link
></template
>
</el-table-column>
<el-table-column prop="protocolName" label="规约"> </el-table-column>
<el-table-column prop="lastHeartbeat" label="最后心跳时间">
<template slot-scope="scope">
<el-link
type="primary"
@click.native.stop="handleShowIp(scope.row)"
>
{{
scope.row.lastHeartbeat == 0 || scope.row.lastHeartbeat == null
? ""
: $moment(scope.row.lastHeartbeat * 1000).format(
"YYYY-MM-DD HH:mm:ss"
)
}}</el-link
></template
>
</el-table-column>
<el-table-column prop="firstPhotoTime" label="当天第一张照片时间">
<template slot-scope="scope">
{{ scope.row.photoInfo.firstPhotoTime }}
</template>
</el-table-column>
<el-table-column prop="lastRecvTime" label="照片最后接收时间">
<template slot-scope="scope">
{{ scope.row.photoInfo.lastRecvTime }}
</template>
</el-table-column>
<el-table-column prop="" label="重启次数"> </el-table-column>
<el-table-column prop="" label="最后重启时间"> </el-table-column>
<el-table-column prop="photoCount" label="照片数量">
<template slot-scope="scope">
{{ scope.row.photoInfo.photoCount }}
</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>
<ipDialog ref="ipDialogref"></ipDialog>
<photoDialog ref="photoDialogref"></photoDialog>
</div>
</template>
<script>
import { getphotoList, getSearchInfo } from "@/utils/api/reportApi";
import ipDialog from "./components/ipDialog";
import photoDialog from "./components/photoList";
export default {
name: "photoStatisBox",
components: {
ipDialog,
photoDialog,
},
data() {
return {
pickerOptions: {
disabledDate(date) {
return date.getTime() > Date.now(); //
},
},
photoList: [],
dyOptions: [{ id: -1, name: "全部" }], //
xlOptions: [{ id: -1, name: "全部" }], //线
gtOptions: [{ id: -1, name: "全部" }], //
tdOptions: [
{ id: -1, name: "全部" },
{ id: 1, name: "通道1" },
{ id: 2, name: "通道2" },
{ id: 3, name: "通道3" },
{ id: 4, name: "通道4" },
], //
formdata: {
dyid: -1,
lineid: -1,
towerid: -1,
channelid: -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,
};
},
created() {},
mounted() {
this.getSearchdy();
},
watch: {},
methods: {
//
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) => {});
},
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 = {
start: this.formdata.starttime / 1000,
end: this.formdata.endtime / 1000,
pageNum: this.page,
pageSize: this.pageSize,
};
//
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.search !== "") {
params.search = this.formdata.search;
}
setTimeout(() => {
getphotoList(params)
.then((res) => {
console.log(res);
this.photoList = res.data.list;
this.total = res.data.total;
this.photoLoading = false;
})
.catch((err) => {
this.photoLoading = false;
});
}, 100);
},
//
handleCurrentChange(val) {
this.page = val;
this.getPhotoFun();
},
//
handleSizeChange(val) {
this.pageSize = val;
this.getPhotoFun();
},
//
handleShowPhoto(row) {
let params = this.formdata;
this.$refs.photoDialogref.display(row, params);
},
// ip
handleShowIp(row) {
this.$refs.ipDialogref.display(row);
},
},
};
</script>
<style lang="less">
.photoStatisBox {
height: 100%;
.searchBox {
.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% - 94px);
//background: #fcc;
.el-table {
.cell {
text-align: center;
vertical-align: middle; /* 如果需要垂直居中 */
}
}
}
}
</style>

@ -22,12 +22,12 @@ module.exports = defineConfig({
"/api": {
//表示拦截以/api开头的请求路径
//target: "http://180.166.218.222:40080", //dell
// target: "http://192.168.1.190:8080", //liu 本机ip 需要去掉/Api
target: "http://192.168.1.190:8080", //liu 本机ip 需要去掉/Api
//target: "http://192.168.50.7:8093", //liu 本机ip 需要去掉/Api
target: "http://192.168.111.211:80", //东视
//target: "http://192.168.111.211:80", //东视
changOrigin: true, //是否开启跨域
pathRewrite: {
"^/api": "/api", //重写api把api变成空字符因为我们真正请求的路径是没有api的
"^/api": "", //重写api把api变成空字符因为我们真正请求的路径是没有api的
},
},
},

Loading…
Cancel
Save