工作状态报

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

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

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

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

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

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

Loading…
Cancel
Save