|
|
|
@ -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;
|
|
|
|
|