工作状态报

role1.0
fanluyan 1 year ago
parent 2ab38f7a9f
commit e1dcadd102

@ -793,3 +793,12 @@ export function getTermFaultsExcel() {
responseType: "blob",
});
}
//工作状态报
export function getWorkingStatusHistoryApi(data) {
return request({
url: "/xymanager/getWorkingStatusHistory",
method: "post",
data,
});
}

@ -1,16 +1,18 @@
<template>
<el-dialog
class="workStatus"
title="工作状态"
class="workStatusBox"
title="故障信息报"
:visible.sync="isShow"
:close-on-click-modal="false"
width="1280px"
width="1000px"
>
<el-form :inline="true" :model="formdata" class="demo-form-inline">
<el-form-item label="开始日期">
<el-date-picker
@change="changestartdate"
v-model="formdata.starttime"
type="datetime"
:picker-options="pickerOptions"
placeholder="开始日期"
value-format="timestamp"
>
@ -18,9 +20,10 @@
</el-form-item>
<el-form-item label="结束日期">
<el-date-picker
@change="changeenddate"
v-model="formdata.endtime"
type="datetime"
default-time="23:59:59"
:picker-options="pickerOptions"
placeholder="结束日期"
value-format="timestamp"
class="ml10"
@ -29,7 +32,7 @@
</el-form-item>
<el-form-item>
<el-button type="primary" @click="onSubmit"></el-button>
<el-button type="primary">导出</el-button>
<el-button type="primary" @click="exportFault"></el-button>
</el-form-item>
</el-form>
<el-table
@ -49,73 +52,23 @@
</template>
</el-table-column>
<el-table-column
prop="name"
label="采集时间"
prop="cmdid"
label="装置编号"
min-width="120"
show-overflow-tooltip
></el-table-column>
<el-table-column
prop="name"
label="设备名称"
min-width="80"
show-overflow-tooltip
></el-table-column>
<el-table-column
prop="name"
label="设备编号"
prop="faultTime"
label="采集时间"
min-width="120"
show-overflow-tooltip
></el-table-column>
<el-table-column
prop="name"
label="电源电压"
min-width="80"
show-overflow-tooltip
></el-table-column>
<el-table-column
prop="name"
label="工作温度"
min-width="80"
show-overflow-tooltip
></el-table-column>
<el-table-column
prop="name"
label="电池电量"
min-width="80"
show-overflow-tooltip
></el-table-column>
<el-table-column
prop="name"
label="浮充状态"
min-width="100"
show-overflow-tooltip
>
<template slot-scope="scope">{{
scope.row.name == 0 ? "充电" : "放电"
}}</template>
</el-table-column>
<el-table-column
prop="name"
label="工作总时间"
prop="msg"
label="故障信息"
min-width="120"
show-overflow-tooltip
></el-table-column>
<el-table-column
prop="name"
label="连续工作时间"
min-width="100"
show-overflow-tooltip
></el-table-column>
<el-table-column
prop="name"
label="网络连接状态"
min-width="100"
show-overflow-tooltip
>
<template slot-scope="scope">{{
scope.row.name == 0 ? "已连接" : "未连接"
}}</template>
</el-table-column>
</el-table>
<div class="pageNation">
<el-pagination
@ -130,36 +83,97 @@
</el-pagination>
</div>
<div slot="footer" class="dialog-footer">
<el-button @click="isShow = false"> </el-button>
<el-button @click="hide"> </el-button>
</div>
</el-dialog>
</template>
<script>
import { getLineListJoggle } from "@/utils/api/index";
import {
getWorkingStatusHistoryApi,
getTermFaultsExcelApi,
} from "@/utils/api/index";
export default {
data() {
return {
isShow: false,
formdata: {},
listData: [
{
name: "测试",
},
{
name: "测试2",
},
],
rowInfo: "",
listData: [],
loading: false,
seltermid: "", //id
selcmdId: "", //cmdId
requestId: "",
page: 1, //
pageSize: 20, //
pageSize: 10, //
total: 0, //
pickerOptions: {
disabledDate(date) {
return date.getTime() > Date.now(); //
},
},
};
},
watch: {
endtime(newVal) {
if (newVal) {
const date = new Date(newVal);
date.setHours(23);
date.setMinutes(59);
date.setSeconds(59);
this.formdata.endtime = date;
}
},
},
created() {},
mounted() {},
methods: {
getTime() {
const thirtyDaysAgo = new Date();
thirtyDaysAgo.setHours(0); // 23
thirtyDaysAgo.setMinutes(0); // 59
thirtyDaysAgo.setSeconds(0); // 59
this.$set(
this.formdata,
"starttime",
new Date(thirtyDaysAgo.setDate(thirtyDaysAgo.getDate() - 30))
);
console.log(this.formdata.starttime);
const currentDate = new Date(); //
currentDate.setHours(23); // 23
currentDate.setMinutes(59); // 59
currentDate.setSeconds(59); // 59
this.$set(this.formdata, "endtime", currentDate);
this.getfaultinfo();
},
changestartdate(val) {
console.log(val);
if (val == null) {
console.log(new Date());
const startDate = new Date();
startDate.setHours(0); // 23
startDate.setMinutes(0); // 59
startDate.setSeconds(0); // 59
this.formdata.starttime = startDate;
console.log(this.formdata.starttime);
} else {
this.formdata.starttime = val;
}
},
//
changeenddate(val) {
if (val == null) {
console.log(new Date());
const endDate = new Date();
endDate.setHours(23); // 23
endDate.setMinutes(59); // 59
endDate.setSeconds(59); // 59
this.formdata.endtime = endDate;
console.log(this.formdata.endtime);
} else {
val.setHours(23); // 23
val.setMinutes(59); // 59
val.setSeconds(59); // 59
this.formdata.endtime = val;
console.log(val);
}
},
//
onSubmit() {
if (this.formdata.starttime > this.formdata.endtime) {
@ -170,44 +184,55 @@ export default {
type: "warning",
});
}
this.getlistnr();
this.getfaultinfo();
},
//
exportFault() {
window.location.href =
"/api/getTermFaultsExcel?termid=" + this.rowInfo.id;
},
//
getlistnr(val) {
console.log(val);
this.seltermid = val.id;
this.selcmdId = val.cmdid;
getfaultinfo() {
this.loading = true;
getLineListJoggle({
getWorkingStatusHistoryApi({
termid: this.rowInfo.id,
starttime: this.formdata.starttime,
endtime: this.formdata.endtime,
pageindex: this.page,
pagesize: this.pageSize,
}).then((res) => {
this.listData = res.data.list;
this.total = res.data.total;
this.loading = false;
this.$nextTick(() => {
this.loading = false;
});
});
},
//
handleCurrentChange(val) {
this.page = val;
this.getlistnr();
this.getfaultinfo();
},
//
handleSizeChange(val) {
this.pageSize = val;
this.getlistnr();
this.getfaultinfo();
},
display() {
display(row) {
console.log(row);
this.rowInfo = row;
this.isShow = true;
this.getTime();
},
hide() {
this.isShow = false;
this.formdata = {};
},
},
};
</script>
<style lang="less">
.workStatus {
.workStatusBox {
.pageNation {
justify-content: flex-start;
margin-top: 16px;

@ -2,6 +2,14 @@
<div class="thumb-example">
<div class="radioBox" v-if="roleUser == 1 || roleUser == 0">
{{ radioPx }} <span v-if="fileSize">({{ fileSize.toFixed(2) }}M)</span>
<span v-if="protocolInfo == '65280'"> I1 </span>
<span v-if="protocolInfo == '65296'"> 西 </span>
<span v-if="protocolInfo == '65281'"> </span>
<span v-if="protocolInfo == '65282'"> </span>
<span v-if="protocolInfo == '65283'"> </span>
<span v-if="protocolInfo == '65284'"> </span>
<span v-if="protocolInfo == '65285'"> </span>
<span v-if="protocolInfo == '65286'"> </span>
<!-- <span>({{ terminalPhoto.length }})</span> -->
</div>
<div class="topPic">
@ -176,6 +184,9 @@ export default {
type: Number,
default: () => [],
},
protocolInfo: {
type: String,
},
},
data() {
return {
@ -366,7 +377,6 @@ export default {
},
//
changeBigPic(data, i) {
// //console.log(data, i);
// //console.log("222222222", this.currentPage, this.activeSmall);
this.srcList = [];
this.localPoints = [];

@ -5,6 +5,7 @@
placeholder="输入关键字进行过滤"
v-model="filterText"
prefix-icon="el-icon-search"
clearable
>
</el-input>
</div>

@ -18,6 +18,7 @@
ref="carouselpic"
:terminalPhoto="terminalPhoto"
:photoNum="photoNum"
:protocolInfo="protocolInfo"
v-if="terminalPhoto.length !== 0"
></carouselChart>
</div>
@ -53,6 +54,7 @@ export default {
terminalPhoto: [], //
photoNum: 5,
dateValue: "", //
protocolInfo: "",
nopicPath: require("@/assets/img/nopic.jpg"),
};
},
@ -120,6 +122,8 @@ export default {
this.towerFlag = true;
this.terminalPhoto = [];
this.protocolInfo = this.treeSelectData.protocol;
console.log("asddddddddddddddddddddd", this.treeSelectData);
this.towertitle = this.treeSelectData.name;
this.$nextTick(() => {
this.$refs.areaRef.getChannelList();

Loading…
Cancel
Save