4 changed files with 669 additions and 26 deletions
@ -0,0 +1,27 @@
|
||||
import request from "@/utils/request"; |
||||
|
||||
// 查询运行记录
|
||||
export function boilerSysList(data) { |
||||
return request({ |
||||
url: "/reportHeating/list", |
||||
method: "post", |
||||
data, |
||||
}); |
||||
} |
||||
// 编辑运行记录
|
||||
export function boilerSysEdit(data) { |
||||
return request({ |
||||
url: "/reportHeating/edit", |
||||
method: "put", |
||||
data, |
||||
}); |
||||
} |
||||
// 导出
|
||||
export function boilerSysExport(data) { |
||||
return request({ |
||||
url: "/reportHeating/export", |
||||
method: "post", |
||||
data, |
||||
responseType: "blob", |
||||
}); |
||||
} |
||||
@ -0,0 +1,626 @@
|
||||
<template> |
||||
<div class="app-container"> |
||||
<div class="btn-condition"> |
||||
<div class="condition-left" v-show="showSearch"> |
||||
<el-form |
||||
:model="queryParams" |
||||
ref="queryForm" |
||||
size="small" |
||||
:inline="true" |
||||
> |
||||
<el-form-item label="日期" prop="msgCode"> |
||||
<el-date-picker |
||||
v-model="dayDate" |
||||
type="daterange" |
||||
range-separator="至" |
||||
value-format="yyyy-MM-dd" |
||||
start-placeholder="开始日期" |
||||
end-placeholder="结束日期" |
||||
@change="dateChange" |
||||
> |
||||
</el-date-picker> |
||||
</el-form-item> |
||||
</el-form> |
||||
<div class="primary-btn"> |
||||
<el-button |
||||
type="primary" |
||||
icon="el-icon-search" |
||||
size="mini" |
||||
@click="handleQuery" |
||||
>搜索</el-button |
||||
> |
||||
</div> |
||||
<div class="warning-btn"> |
||||
<el-button |
||||
type="warning" |
||||
icon="el-icon-download" |
||||
size="mini" |
||||
@click="handleExport" |
||||
>导出</el-button |
||||
> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
<el-table |
||||
:data="tableData" |
||||
border |
||||
style="width: 100%" |
||||
v-loading="loading" |
||||
:cell-style="tableRowStyle" |
||||
class="log_table" |
||||
> |
||||
<el-table-column prop="curTime" label="记录时间" width="110"> |
||||
</el-table-column> |
||||
|
||||
<el-table-column prop="" label="1号采暖设备"> |
||||
<el-table-column |
||||
prop="runStatusBoilerOne" |
||||
label="运行状态" |
||||
></el-table-column> |
||||
<el-table-column |
||||
prop="tempOutBoilerOne" |
||||
label="出水温度(℃)" |
||||
></el-table-column> |
||||
<el-table-column |
||||
prop="tempInBoilerOne" |
||||
label="回水温度(℃)" |
||||
></el-table-column> |
||||
<el-table-column |
||||
prop="tempWaterBoilerOne" |
||||
label="炉水温度(℃)" |
||||
></el-table-column> |
||||
<el-table-column |
||||
prop="tempFlueGasBoilerOne" |
||||
label="烟道温度(℃)" |
||||
></el-table-column> |
||||
</el-table-column> |
||||
<el-table-column prop="" label="2号采暖设备"> |
||||
<el-table-column |
||||
prop="runStatusBoilerTwo" |
||||
label="运行状态" |
||||
></el-table-column> |
||||
<el-table-column |
||||
prop="tempOutBoilerTwo" |
||||
label="出水温度(℃)" |
||||
></el-table-column> |
||||
<el-table-column |
||||
prop="tempInBoilerTwo" |
||||
label="回水温度(℃)" |
||||
></el-table-column> |
||||
<el-table-column |
||||
prop="tempWaterBoilerTwo" |
||||
label="炉水温度(℃)" |
||||
></el-table-column> |
||||
<el-table-column |
||||
prop="tempFlueGasBoilerTwo" |
||||
label="烟道温度(℃)" |
||||
></el-table-column> |
||||
</el-table-column> |
||||
<el-table-column prop="" label="1号采暖泵"> |
||||
<el-table-column |
||||
prop="runStatusPumpOne" |
||||
label="运行状态" |
||||
></el-table-column> |
||||
<el-table-column |
||||
prop="frequencyPumpOne" |
||||
label="频率(Hz)" |
||||
></el-table-column> |
||||
</el-table-column> |
||||
<el-table-column prop="" label="2号采暖泵"> |
||||
<el-table-column |
||||
prop="runStatusPumpTwo" |
||||
label="运行状态" |
||||
></el-table-column> |
||||
<el-table-column |
||||
prop="frequencyPumpTwo" |
||||
label="频率(Hz)" |
||||
></el-table-column> |
||||
</el-table-column> |
||||
<el-table-column prop="" label="3号采暖泵"> |
||||
<el-table-column |
||||
prop="runStatusPumpThree" |
||||
label="运行状态" |
||||
></el-table-column> |
||||
<el-table-column |
||||
prop="frequencyPumpThree" |
||||
label="频率(Hz)" |
||||
></el-table-column> |
||||
</el-table-column> |
||||
<el-table-column prop="recorder" label="巡查记录人"> </el-table-column> |
||||
<el-table-column prop="remark" label="备注"> </el-table-column> |
||||
<el-table-column |
||||
label="操作" |
||||
align="center" |
||||
class-name="small-padding fixed-width" |
||||
> |
||||
<template slot-scope="scope"> |
||||
<el-button |
||||
size="mini" |
||||
type="text" |
||||
icon="el-icon-edit" |
||||
@click="handleUpdate(scope.row)" |
||||
>修改</el-button |
||||
> |
||||
</template> |
||||
</el-table-column> |
||||
</el-table> |
||||
|
||||
<pagination |
||||
v-show="total > 0" |
||||
:total="total" |
||||
:page.sync="queryParams.pageNum" |
||||
:limit.sync="queryParams.pageSize" |
||||
@pagination="getList" |
||||
/> |
||||
<!-- 添加或修改设备台账对话框 --> |
||||
<el-dialog :title="title" :visible.sync="open" append-to-body> |
||||
<el-form ref="form" :model="form" :rules="rules"> |
||||
<el-row type="flex" justify="felx-start"> |
||||
<el-col :span="12"> |
||||
<el-form-item label="记录时间" prop="curTime"> |
||||
<el-input |
||||
v-model="form.curTime" |
||||
disabled |
||||
placeholder="" |
||||
/> </el-form-item |
||||
></el-col> |
||||
</el-row> |
||||
<el-row type="flex" justify="center"> |
||||
<el-col :span="24" class="oneRowLabel">1号采暖设备</el-col> |
||||
</el-row> |
||||
<el-row type="flex" justify="center"> |
||||
<el-col :span="24"> |
||||
<el-form-item label="运行状态" prop="runStatusBoilerOne"> |
||||
<el-input |
||||
disabled |
||||
v-model="form.runStatusBoilerOne" |
||||
placeholder="" |
||||
/> </el-form-item |
||||
></el-col> |
||||
</el-row> |
||||
<el-row type="flex" justify="center"> |
||||
<el-col :span="12"> |
||||
<el-form-item label="出水温度℃" prop="tempOutBoilerOne"> |
||||
<el-input |
||||
clearable |
||||
v-model="form.tempOutBoilerOne" |
||||
placeholder="请输入温度℃" |
||||
/> </el-form-item |
||||
></el-col> |
||||
<el-col :span="12"> |
||||
<el-form-item label="回水温度℃" prop="tempInBoilerOne"> |
||||
<el-input |
||||
clearable |
||||
v-model="form.tempInBoilerOne" |
||||
placeholder="请输入温度℃" |
||||
/> </el-form-item |
||||
></el-col> |
||||
</el-row> |
||||
<el-row type="flex" justify="center"> |
||||
<el-col :span="12"> |
||||
<el-form-item label="炉水温度℃" prop="tempWaterBoilerOne"> |
||||
<el-input |
||||
clearable |
||||
v-model="form.tempWaterBoilerOne" |
||||
placeholder="请输入温度℃" |
||||
/> </el-form-item |
||||
></el-col> |
||||
<el-col :span="12"> |
||||
<el-form-item label="烟道温度℃" prop="tempFlueGasBoilerOne"> |
||||
<el-input |
||||
clearable |
||||
v-model="form.tempFlueGasBoilerOne" |
||||
placeholder="请输入温度℃" |
||||
/> </el-form-item |
||||
></el-col> |
||||
</el-row> |
||||
<el-row type="flex" justify="center"> |
||||
<el-col :span="24" class="oneRowLabel">2号采暖设备</el-col> |
||||
</el-row> |
||||
<el-row type="flex" justify="center"> |
||||
<el-col :span="24"> |
||||
<el-form-item label="运行状态" prop="runStatusBoilerTwo"> |
||||
<el-input |
||||
disabled |
||||
v-model="form.runStatusBoilerTwo" |
||||
placeholder="" |
||||
/> </el-form-item |
||||
></el-col> |
||||
</el-row> |
||||
<el-row type="flex" justify="center"> |
||||
<el-col :span="12"> |
||||
<el-form-item label="出水温度℃" prop="tempOutBoilerTwo"> |
||||
<el-input |
||||
clearable |
||||
v-model="form.tempOutBoilerTwo" |
||||
placeholder="请输入温度℃" |
||||
/> </el-form-item |
||||
></el-col> |
||||
<el-col :span="12"> |
||||
<el-form-item label="回水温度℃" prop="tempInBoilerTwo"> |
||||
<el-input |
||||
clearable |
||||
v-model="form.tempInBoilerTwo" |
||||
placeholder="请输入温度℃" |
||||
/> </el-form-item |
||||
></el-col> |
||||
</el-row> |
||||
<el-row type="flex" justify="center"> |
||||
<el-col :span="12"> |
||||
<el-form-item label="炉水温度℃" prop="tempWaterBoilerTwo"> |
||||
<el-input |
||||
clearable |
||||
v-model="form.tempWaterBoilerTwo" |
||||
placeholder="请输入温度℃" |
||||
/> </el-form-item |
||||
></el-col> |
||||
<el-col :span="12"> |
||||
<el-form-item label="烟道温度℃" prop="tempFlueGasBoilerTwo"> |
||||
<el-input |
||||
clearable |
||||
v-model="form.tempFlueGasBoilerTwo" |
||||
placeholder="请输入温度℃" |
||||
/> </el-form-item |
||||
></el-col> |
||||
</el-row> |
||||
<el-row type="flex" justify="center"> |
||||
<el-col :span="24" class="oneRowLabel">1号采暖泵</el-col> |
||||
</el-row> |
||||
<el-row type="flex" justify="center"> |
||||
<el-col :span="12"> |
||||
<el-form-item label="运行状态" prop="runStatusPumpOne"> |
||||
<el-input |
||||
disabled |
||||
v-model="form.runStatusPumpOne" |
||||
placeholder="" |
||||
/> </el-form-item |
||||
></el-col> |
||||
<el-col :span="12"> |
||||
<el-form-item label="频率" prop="frequencyPumpOne"> |
||||
<el-input |
||||
clearable |
||||
v-model="form.frequencyPumpOne" |
||||
placeholder="请输入频率Hz" |
||||
/> </el-form-item |
||||
></el-col> |
||||
</el-row> |
||||
<el-row type="flex" justify="felx-start"> |
||||
<el-col :span="24" class="oneRowLabel">2号采暖泵</el-col> |
||||
</el-row> |
||||
<el-row type="flex" justify="center"> |
||||
<el-col :span="12"> |
||||
<el-form-item label="运行状态" prop="runStatusPumpTwo"> |
||||
<el-input |
||||
disabled |
||||
v-model="form.runStatusPumpTwo" |
||||
placeholder="" |
||||
/> </el-form-item |
||||
></el-col> |
||||
<el-col :span="12"> |
||||
<el-form-item label="频率" prop="frequencyPumpTwo"> |
||||
<el-input |
||||
clearable |
||||
v-model="form.frequencyPumpTwo" |
||||
placeholder="请输入频率Hz" |
||||
/> </el-form-item |
||||
></el-col> |
||||
</el-row> |
||||
<el-row type="flex" justify="felx-start"> |
||||
<el-col :span="24" class="oneRowLabel">3号采暖泵</el-col> |
||||
</el-row> |
||||
<el-row type="flex" justify="center"> |
||||
<el-col :span="12"> |
||||
<el-form-item label="运行状态" prop="runStatusPumpThree"> |
||||
<el-input |
||||
disabled |
||||
v-model="form.runStatusPumpThree" |
||||
placeholder="" |
||||
/> </el-form-item |
||||
></el-col> |
||||
<el-col :span="12"> |
||||
<el-form-item label="频率" prop="frequencyPumpThree"> |
||||
<el-input |
||||
clearable |
||||
v-model="form.frequencyPumpThree" |
||||
placeholder="请输入频率Hz" |
||||
/> </el-form-item |
||||
></el-col> |
||||
</el-row> |
||||
<el-row type="flex" justify="center"> |
||||
<el-col :span="12"> |
||||
<el-form-item label="巡查记录人" prop="recorder"> |
||||
<el-input |
||||
clearable |
||||
v-model="form.recorder" |
||||
placeholder="请输入" |
||||
/> </el-form-item |
||||
></el-col> |
||||
<el-col :span="12"> |
||||
<el-form-item label="备注" prop="remark"> |
||||
<el-input |
||||
clearable |
||||
v-model="form.remark" |
||||
placeholder="请输入备注" |
||||
/> |
||||
</el-form-item> |
||||
</el-col> |
||||
</el-row> |
||||
</el-form> |
||||
<div slot="footer" class="dialog-footer"> |
||||
<el-button @click="cancel">取 消</el-button> |
||||
<el-button type="primary" @click="submitForm">确 定</el-button> |
||||
</div> |
||||
</el-dialog> |
||||
</div> |
||||
</template> |
||||
|
||||
<script> |
||||
import { |
||||
boilerSysList, |
||||
boilerSysEdit, |
||||
boilerSysExport, |
||||
} from "@/api/boiler/heatingRunPeport"; |
||||
export default { |
||||
data() { |
||||
return { |
||||
// 遮罩层 |
||||
loading: true, |
||||
// 选中数组 |
||||
ids: [], |
||||
// 非单个禁用 |
||||
single: true, |
||||
// 非多个禁用 |
||||
multiple: true, |
||||
// 显示搜索条件 |
||||
showSearch: true, |
||||
// 总条数 |
||||
total: 0, |
||||
// 表格数据 |
||||
postList: [], |
||||
// 弹出层标题 |
||||
title: "", |
||||
// 是否显示弹出层 |
||||
open: false, |
||||
// 查询参数 |
||||
queryParams: { |
||||
pageNum: 1, |
||||
pageSize: 10, |
||||
params: {}, |
||||
}, |
||||
dayDate: "", |
||||
tableData: [], |
||||
// 表单参数 |
||||
form: {}, |
||||
// 表单校验 |
||||
rules: { |
||||
deviceName: [ |
||||
{ required: true, message: "设备名称不能为空", trigger: "blur" }, |
||||
], |
||||
}, |
||||
deviceRun: [ |
||||
{ |
||||
label: "不运行", |
||||
value: 0, |
||||
}, |
||||
{ |
||||
label: "运行", |
||||
value: 1, |
||||
}, |
||||
], |
||||
}; |
||||
}, |
||||
mounted() { |
||||
this.initializeTimeDate(); |
||||
this.getList(); |
||||
}, |
||||
methods: { |
||||
// 初始化时间 |
||||
initializeTimeDate() { |
||||
let date = new Date(); //获取新的时间 |
||||
//获取当前年份,并且转为字符串 |
||||
let year = date.getFullYear().toString(); |
||||
//获取当前月份,因为月份是要从0开始,此处要加1, |
||||
//使用三元表达式,判断是否小于10,如果是的话,就在字符串前面拼接'0' |
||||
let month = |
||||
date.getMonth() + 1 < 10 |
||||
? "0" + (date.getMonth() + 1).toString() |
||||
: (date.getMonth() + 1).toString(); |
||||
//获取天,判断是否小于10,如果是的话,就在在字符串前面拼接'0' |
||||
let day = |
||||
date.getDate() < 10 |
||||
? "0" + date.getDate().toString() |
||||
: date.getDate().toString(); |
||||
//字符串拼接,将开始时间和结束时间进行拼接 |
||||
let start1 = year + "-" + month + "-01"; //当月第一天 |
||||
let end1 = year + "-" + month + "-" + day; //当天 |
||||
this.dayDate = [start1, end1]; // 更新 |
||||
}, |
||||
tableRowStyle({ row, column, rowIndex, columnIndex }) { |
||||
// 只处理第 2、6、13 列(索引从 0 开始) |
||||
if ([1, 6, 11, 13, 15].includes(columnIndex)) { |
||||
const value = row[column.property]; // 获取当前单元格的值 |
||||
if (value === "停止") { |
||||
return { |
||||
color: "#fd1e00", |
||||
textAlign: "center", |
||||
fontWeight: "bold", |
||||
}; |
||||
} else if (value === "运行") { |
||||
return { |
||||
color: "#00c250", |
||||
textAlign: "center", |
||||
fontWeight: "bold", |
||||
}; |
||||
} |
||||
} |
||||
return {}; |
||||
}, |
||||
// 选中日期事件 |
||||
dateChange() { |
||||
// console.log("打印时间", this.timeform.time1); |
||||
if (!this.dayDate) { |
||||
this.$nextTick(() => { |
||||
this.dayDate = []; |
||||
}); |
||||
} |
||||
}, |
||||
|
||||
/** 查询表格数据 */ |
||||
getList() { |
||||
this.loading = true; |
||||
this.queryParams.params.startTime = |
||||
this.dayDate.length > 0 ? this.dayDate[0] : ""; |
||||
this.queryParams.params.endTime = |
||||
this.dayDate.length > 0 ? this.dayDate[1] : ""; |
||||
boilerSysList(this.queryParams).then((res) => { |
||||
console.log("列表返回", res); |
||||
if (res.code == 200 && res.rows) { |
||||
this.tableData = res.rows; |
||||
this.total = res.total; |
||||
this.loading = false; |
||||
} else { |
||||
this.tableData = []; |
||||
this.total = 0; |
||||
this.loading = false; |
||||
} |
||||
}); |
||||
// 处理表格数据 |
||||
this.loading = false; |
||||
}, |
||||
/** 搜索按钮操作 */ |
||||
handleQuery() { |
||||
this.queryParams.pageNum = 1; |
||||
this.getList(); |
||||
}, |
||||
/** 导出按钮操作 */ |
||||
handleExport() { |
||||
this.queryParams.params.startTime = |
||||
this.dayDate.length > 0 ? this.dayDate[0] : ""; |
||||
this.queryParams.params.endTime = |
||||
this.dayDate.length > 0 ? this.dayDate[1] : ""; |
||||
boilerSysExport(this.queryParams).then((res) => { |
||||
console.log("导出返回", res); |
||||
if (res) { |
||||
// 请求的结果就是文件 |
||||
// 创建一个blob URL,用于生成下载链接 |
||||
const url = window.URL.createObjectURL(new Blob([res])); |
||||
// 创建一个<a>元素,并设置其href和download属性 |
||||
const link = document.createElement("a"); |
||||
link.href = url; |
||||
link.setAttribute("download", "采暖系统运行记录.xls"); // 设置下载的文件名 |
||||
// 模拟点击下载链接 |
||||
document.body.appendChild(link); |
||||
link.click(); |
||||
document.body.removeChild(link); |
||||
// 释放blob URL资源 |
||||
window.URL.revokeObjectURL(url); |
||||
this.$message({ |
||||
type: "success", |
||||
message: "导出成功!", |
||||
}); |
||||
} else { |
||||
this.$message.error("导出失败!"); |
||||
} |
||||
}); |
||||
// .catch((err) => { |
||||
// this.$message.error('导出失败!'); |
||||
// }) |
||||
}, |
||||
// 取消按钮 |
||||
cancel() { |
||||
this.open = false; |
||||
this.reset(); |
||||
this.form.id = ""; |
||||
}, |
||||
// 表单重置 |
||||
reset() { |
||||
this.form = { |
||||
id: "", |
||||
curTime: "", |
||||
runStatusBoilerOne: "", |
||||
tempOutBoilerOne: "", |
||||
tempInBoilerOne: "", |
||||
tempWaterBoilerOne: "", |
||||
tempFlueGasBoilerOne: "", |
||||
runStatusBoilerTwo: "", |
||||
tempOutBoilerTwo: "", |
||||
tempInBoilerTwo: "", |
||||
tempWaterBoilerTwo: "", |
||||
tempFlueGasBoilerTwo: "", |
||||
runStatusPumpOne: "", |
||||
frequencyPumpOne: "", |
||||
runStatusPumpTwo: "", |
||||
frequencyPumpTwo: "", |
||||
runStatusPumpThree: "", |
||||
frequencyPumpThree: "", |
||||
recorder: "", |
||||
remark: "", |
||||
}; |
||||
}, |
||||
/** 修改按钮操作 */ |
||||
handleUpdate(row) { |
||||
this.reset(); |
||||
this.form = Object.assign({}, row); |
||||
this.open = true; |
||||
this.title = "修改采暖系统运行记录"; |
||||
}, |
||||
/** 提交按钮 */ |
||||
submitForm: function () { |
||||
this.$refs["form"].validate((valid) => { |
||||
if (valid) { |
||||
if (this.form.id != undefined) { |
||||
boilerSysEdit(this.form).then((response) => { |
||||
this.$modal.msgSuccess("修改成功"); |
||||
this.open = false; |
||||
this.getList(); |
||||
}); |
||||
} else { |
||||
console.log("新增参数", this.form); |
||||
} |
||||
} |
||||
}); |
||||
}, |
||||
}, |
||||
}; |
||||
</script> |
||||
<style scoped lang="scss"> |
||||
.oneRowLabel { |
||||
margin-left: 40px; |
||||
font-size: 15px; |
||||
font-weight: bold; |
||||
color: #02ce0d; |
||||
display: flex; |
||||
flex-direction: row; |
||||
align-items: center; |
||||
} |
||||
.oneRowLabel::before { |
||||
content: ""; |
||||
display: inline-block; |
||||
width: 8px; /* 圆的直径 */ |
||||
height: 8px; |
||||
border-radius: 50%; /* 使元素变成圆形 */ |
||||
background-color: #02ce0d; /* 圆的颜色,这里和文字颜色保持一致 */ |
||||
margin-right: 10px; /* 圆和文字之间的间距 */ |
||||
vertical-align: middle; /* 使圆在垂直方向上与文字居中对齐 */ |
||||
} |
||||
/* 媒体查询,适配大于2000px分辨率的大屏样式 - element样式 */ |
||||
@media (max-width: 2000px) { |
||||
::v-deep .el-dialog { |
||||
width: 800px !important; |
||||
} |
||||
::v-deep .print-dialog .el-dialog { |
||||
width: 1200px !important; |
||||
} |
||||
::v-deep .el-dialog .el-form-item__label { |
||||
width: 130px !important; |
||||
} |
||||
::v-deep .el-dialog .el-form-item { |
||||
display: flex; |
||||
flex-direction: row; |
||||
align-items: center; |
||||
} |
||||
::v-deep .el-dialog .el-form-item__content { |
||||
width: 220px !important; |
||||
} |
||||
} |
||||
</style> |
||||
Loading…
Reference in new issue