装置故障报
parent
2326f8d7c7
commit
656a3daa8d
@ -0,0 +1,165 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
class="faultInfo"
|
||||
title="故障信息报"
|
||||
:visible.sync="isShow"
|
||||
:close-on-click-modal="false"
|
||||
width="1000px"
|
||||
>
|
||||
<el-form :inline="true" :model="formdata" class="demo-form-inline">
|
||||
<el-form-item label="开始日期">
|
||||
<el-date-picker
|
||||
v-model="formdata.starttime"
|
||||
type="datetime"
|
||||
placeholder="开始日期"
|
||||
value-format="timestamp"
|
||||
>
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="结束日期">
|
||||
<el-date-picker
|
||||
v-model="formdata.endtime"
|
||||
type="datetime"
|
||||
default-time="23:59:59"
|
||||
placeholder="结束日期"
|
||||
value-format="timestamp"
|
||||
class="ml10"
|
||||
>
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="onSubmit">查询</el-button>
|
||||
<el-button type="primary">导出</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-table
|
||||
ref="multipleTable"
|
||||
:data="listData"
|
||||
stripe
|
||||
tooltip-effect="dark"
|
||||
style="width: 100%"
|
||||
v-loading="loading"
|
||||
>
|
||||
<template slot="empty">
|
||||
<el-empty :image-size="160" description="暂无数据"></el-empty>
|
||||
</template>
|
||||
<el-table-column min-width="45" label="序号">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ (page - 1) * pageSize + scope.$index + 1 }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="fault_time"
|
||||
label="采集时间"
|
||||
min-width="120"
|
||||
show-overflow-tooltip
|
||||
></el-table-column>
|
||||
<el-table-column
|
||||
prop="msg"
|
||||
label="故障信息"
|
||||
min-width="120"
|
||||
show-overflow-tooltip
|
||||
></el-table-column>
|
||||
</el-table>
|
||||
<div class="pageNation">
|
||||
<el-pagination
|
||||
@current-change="handleCurrentChange"
|
||||
@size-change="handleSizeChange"
|
||||
:current-page="page"
|
||||
:page-size="pageSize"
|
||||
layout="sizes, prev, pager, next, jumper,total"
|
||||
:total="total"
|
||||
background
|
||||
>
|
||||
</el-pagination>
|
||||
</div>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="isShow = false">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script>
|
||||
import { getTermFaultsApi } from "@/utils/api/index";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
isShow: false,
|
||||
formdata: {},
|
||||
rowInfo: "",
|
||||
listData: [],
|
||||
loading: false,
|
||||
page: 1, // 当前页数
|
||||
pageSize: 10, // 每页数量
|
||||
total: 0, //总条数
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.$set(
|
||||
this.formdata,
|
||||
"starttime",
|
||||
new Date(new Date().toLocaleDateString()).getTime()
|
||||
);
|
||||
this.$set(this.formdata, "endtime", new Date().getTime());
|
||||
},
|
||||
methods: {
|
||||
//查询
|
||||
onSubmit() {
|
||||
if (this.formdata.starttime > this.formdata.endtime) {
|
||||
return this.$message({
|
||||
duration: 1500,
|
||||
showClose: true,
|
||||
message: "开始日期不能大于结束日期",
|
||||
type: "warning",
|
||||
});
|
||||
}
|
||||
this.getfaultinfo();
|
||||
},
|
||||
//获取数据
|
||||
getfaultinfo() {
|
||||
this.loading = true;
|
||||
getTermFaultsApi({
|
||||
termid: this.rowInfo.id,
|
||||
pageindex: this.page,
|
||||
pagesize: this.pageSize,
|
||||
}).then((res) => {
|
||||
this.listData = res.data.list;
|
||||
this.total = res.data.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
//点击分页
|
||||
handleCurrentChange(val) {
|
||||
this.page = val;
|
||||
this.getfaultinfo();
|
||||
},
|
||||
//每页条数
|
||||
handleSizeChange(val) {
|
||||
this.pageSize = val;
|
||||
this.getfaultinfo();
|
||||
},
|
||||
display(row) {
|
||||
console.log(row);
|
||||
this.rowInfo = row;
|
||||
this.isShow = true;
|
||||
this.getfaultinfo();
|
||||
},
|
||||
hide() {
|
||||
this.isShow = false;
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style lang="less">
|
||||
.faultInfo {
|
||||
.pageNation {
|
||||
justify-content: flex-start;
|
||||
margin-top: 16px;
|
||||
.el-pagination {
|
||||
padding: 0px;
|
||||
.el-select .el-input {
|
||||
margin-left: 0px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
Loading…
Reference in New Issue