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

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

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

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

@ -4,13 +4,15 @@
title="GPS位置数据" title="GPS位置数据"
: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
@ -98,36 +101,96 @@
</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 { getTermFaultsApi, 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
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() { onSubmit() {
if (this.formdata.starttime > this.formdata.endtime) { if (this.formdata.starttime > this.formdata.endtime) {
@ -138,38 +201,49 @@ 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({ getTermFaultsApi({
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 = {};
}, },
}, },
}; };

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

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

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

Loading…
Cancel
Save