role1.0
fanluyan 1 year ago
parent e1dcadd102
commit 283df218bb

@ -802,3 +802,11 @@ export function getWorkingStatusHistoryApi(data) {
data,
});
}
//导出工作状态报
export function getWorkingStatusHistoryExcel(data) {
return request({
url: "/xymanager/getWorkingStatusHistoryExcel",
method: "get",
responseType: "blob",
});
}

@ -127,7 +127,7 @@ export default {
created() {
getdyListJoggle().then((res) => {
console.log(res);
this.dyOptions = res.data.list;
this.dyOptions = res.data;
console.log(this.dyOptions);
});
},

@ -88,7 +88,7 @@
</el-dialog>
</template>
<script>
import { getTermFaultsApi, getTermFaultsExcelApi } from "@/utils/api/index";
import { getTermFaultsApi, getTermFaultsExcel } from "@/utils/api/index";
export default {
data() {
return {
@ -126,17 +126,22 @@ export default {
thirtyDaysAgo.setHours(0); // 23
thirtyDaysAgo.setMinutes(0); // 59
thirtyDaysAgo.setSeconds(0); // 59
this.$set(
this.formdata,
"starttime",
console.log(
new Date(thirtyDaysAgo.setDate(thirtyDaysAgo.getDate() - 30))
);
console.log(this.formdata.starttime);
const startTimeNew = new Date(
thirtyDaysAgo.setDate(thirtyDaysAgo.getDate())
).getTime();
this.$set(this.formdata, "starttime", startTimeNew);
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.$set(this.formdata, "endtime", currentDate.getTime());
console.log("结束时间", this.formdata.endtime);
this.getfaultinfo();
},
changestartdate(val) {
@ -164,9 +169,6 @@ export default {
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);
}

@ -4,13 +4,15 @@
title="GPS位置数据"
: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
@ -98,36 +101,96 @@
</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 { getTermFaultsApi, 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
console.log(
new Date(thirtyDaysAgo.setDate(thirtyDaysAgo.getDate() - 30))
);
const startTimeNew = new Date(
thirtyDaysAgo.setDate(thirtyDaysAgo.getDate())
);
this.$set(this.formdata, "starttime", startTimeNew);
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.getTime());
console.log("结束时间", this.formdata.endtime);
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 {
this.formdata.endtime = val;
console.log(val);
}
},
//
onSubmit() {
if (this.formdata.starttime > this.formdata.endtime) {
@ -138,38 +201,49 @@ 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({
getTermFaultsApi({
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 = {};
},
},
};

@ -1,10 +1,10 @@
<template>
<el-dialog
class="workStatusBox"
title="故障信息报"
title="工作状态报"
:visible.sync="isShow"
:close-on-click-modal="false"
width="1000px"
width="1360px"
>
<el-form :inline="true" :model="formdata" class="demo-form-inline">
<el-form-item label="开始日期">
@ -54,19 +54,61 @@
<el-table-column
prop="cmdid"
label="装置编号"
min-width="120"
min-width="160"
show-overflow-tooltip
></el-table-column>
<el-table-column prop="wsUpdateTimeStr" label="采集时间" min-width="140">
</el-table-column>
<el-table-column
prop="batteryVoltage"
label="电池电压(V)"
show-overflow-tooltip
></el-table-column>
<el-table-column
prop="opTemperature"
label="工作温度(℃)"
show-overflow-tooltip
></el-table-column>
<el-table-column
prop="batteryCapacity"
label="电池电量mA"
show-overflow-tooltip
></el-table-column>
<el-table-column
prop="floatingChargeStr"
label="浮充状态"
show-overflow-tooltip
></el-table-column>
<el-table-column
prop="totalWorkingTime"
label="工作总时间(小时)"
show-overflow-tooltip
></el-table-column>
<el-table-column
prop="workingTime"
label="本次连续工作时间(小时)"
show-overflow-tooltip
></el-table-column>
<el-table-column
prop="connectionStr"
label="网络连接状态"
show-overflow-tooltip
></el-table-column>
<el-table-column
prop="recvFlowStr"
label="当月发送流量(M)"
show-overflow-tooltip
></el-table-column>
<el-table-column
prop="faultTime"
label="采集时间"
min-width="120"
prop="sendFlowStr"
label="当月接收流量M"
show-overflow-tooltip
></el-table-column>
<el-table-column
prop="msg"
label="故障信息"
min-width="120"
prop="protocolVersion"
label="通信协议版本"
show-overflow-tooltip
></el-table-column>
</el-table>
@ -90,7 +132,7 @@
<script>
import {
getWorkingStatusHistoryApi,
getTermFaultsExcelApi,
getWorkingStatusHistoryExcel,
} from "@/utils/api/index";
export default {
data() {
@ -129,17 +171,20 @@ export default {
thirtyDaysAgo.setHours(0); // 23
thirtyDaysAgo.setMinutes(0); // 59
thirtyDaysAgo.setSeconds(0); // 59
this.$set(
this.formdata,
"starttime",
console.log(
new Date(thirtyDaysAgo.setDate(thirtyDaysAgo.getDate() - 30))
);
console.log(this.formdata.starttime);
const startTimeNew = new Date(
thirtyDaysAgo.setDate(thirtyDaysAgo.getDate())
).getTime();
this.$set(this.formdata, "starttime", startTimeNew);
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.$set(this.formdata, "endtime", currentDate.getTime());
console.log("结束时间", this.formdata.endtime);
this.getfaultinfo();
},
changestartdate(val) {
@ -167,9 +212,6 @@ export default {
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);
}
@ -189,7 +231,7 @@ export default {
//
exportFault() {
window.location.href =
"/api/getTermFaultsExcel?termid=" + this.rowInfo.id;
"/api/getWorkingStatusHistoryExcel?termid=" + this.rowInfo.id;
},
//
getfaultinfo() {

@ -554,16 +554,16 @@ export default {
console.log(command, row);
switch (command) {
case "info":
this.$refs.baseInfor_ref.display();
this.$refs.baseInfor_ref.display(row);
break;
case "workStatus":
this.$refs.workStatus_ref.display();
this.$refs.workStatus_ref.display(row);
break;
case "runStatus":
this.$refs.runStatus_ref.display();
this.$refs.runStatus_ref.display(row);
break;
case "GPS":
this.$refs.gpsSite_ref.display();
this.$refs.gpsSite_ref.display(row);
break;
case "faultInfo":
this.$refs.fultInfo_ref.display(row);

@ -185,7 +185,7 @@ export default {
default: () => [],
},
protocolInfo: {
type: String,
type: Number,
},
},
data() {

Loading…
Cancel
Save