Commit 8cd4d727 authored by sxl's avatar sxl 💬

add:空风机接口对接

parent f3e7f6c7
...@@ -105,4 +105,12 @@ export function fanDeviceName(query) { ...@@ -105,4 +105,12 @@ export function fanDeviceName(query) {
method: 'get', method: 'get',
params: query params: query
}) })
} }
\ No newline at end of file //空压机名称下拉
export function kongDeviceName(query) {
return request({
url: '/business/fan/device/kongya/query',
method: 'get',
params: query
})
}
...@@ -43,4 +43,4 @@ export function listFanSwitchHis(query) { ...@@ -43,4 +43,4 @@ export function listFanSwitchHis(query) {
method: 'get', method: 'get',
params: query params: query
}) })
} }
\ No newline at end of file
import request from '@/utils/request'
// 查询空风机历史基本信息列表
export function listKongHis(query) {
return request({
url: '/business/fan/kongya/history/query',
method: 'get',
params: query
})
}
import request from '@/utils/request' import request from '@/utils/request'
// 查询机设备基本信息列表 // 查询空压机设备基本信息列表
export function listFanInfo(query) { export function listKongInfo(query) {
return request({ return request({
url: '/business/fan/real/kongya/query', url: '/business/fan/device/kongya/query',
method: 'get', method: 'get',
params: query params: query
}) })
} }
// 查询风机设备基本信息详细
export function getFanInfo(id) {
return request({
url: '/business/fan/info/getInfo/' + id,
method: 'get'
})
}
// 新增风机设备基本信息
export function addFanInfo(data) {
return request({
url: '/business/fan/info/add',
method: 'post',
data: data
})
}
// 修改风机设备基本信息
export function updateFanInfo(data) {
return request({
url: '/business/fan/info/edit',
method: 'post',
data: data
})
}
// 删除风机设备基本信息
export function delFanInfo(id) {
return request({
url: '/business/fan/info/remove/' + id,
method: 'get'
})
}
import request from '@/utils/request' import request from '@/utils/request'
// 查询风机设备基本信息列表 // 查询风机设备基本信息列表
export function listFanHis(query) { export function listrealKong(query) {
return request({ return request({
url: '/business/fan/history/list', url: '/business/fan/real/kongya/query',
method: 'get', method: 'get',
params: query params: query
}) })
} }
// 查询风机运行报警列表
export function listalarmFan(query) {
return request({
url: '/business/fan/alarm/list',
method: 'get',
params: query
})
}
// 修改风机运行报警列表
export function alarmFanEdit(query) {
return request({
url: '/business/fan/alarm/edit',
method: 'post',
data: query
})
}
//风机运行实时数据
export function listrealFan(query) {
return request({
url: '/business/fan/real/list',
method: 'get',
params: query
})
}
// 查询风机设备基本信息列表
export function listFanSwitchHis(query) {
return request({
url: '/business/log/list',
method: 'get',
params: query
})
}
\ No newline at end of file
...@@ -57,10 +57,10 @@ ...@@ -57,10 +57,10 @@
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
<script> <script>
import { listLog, getLog, delLog, addLog, updateLog } from '@/api/patrol/patrolLocation' import { listLog, getLog, delLog, addLog, updateLog } from '@/api/patrol/patrolLocation';
import request from '@/utils/request' import request from '@/utils/request';
export default { export default {
name: 'Device', name: 'Device',
...@@ -114,55 +114,55 @@ export default { ...@@ -114,55 +114,55 @@ export default {
{ required: true, message: '信息不能为空', trigger: 'blur' }, { required: true, message: '信息不能为空', trigger: 'blur' },
], ],
}, },
} };
}, },
created() { created() {
this.getPlaceList() this.getList();
this.getList()
}, },
methods: { methods: {
// 下载在线图片的函数 // 下载在线图片的函数
downloadOnlineImage(imageUrl, fileName) { downloadOnlineImage(imageUrl, fileName) {
fetch(imageUrl) fetch(imageUrl)
.then((response) => response.blob()) .then(response => response.blob())
.then((blob) => { .then(blob => {
const tempUrl = URL.createObjectURL(blob) const tempUrl = URL.createObjectURL(blob);
const link = document.createElement('a') const link = document.createElement('a');
link.href = tempUrl link.href = tempUrl;
link.download = fileName || 'downloaded_image.png' link.download = fileName || 'downloaded_image.png';
document.body.appendChild(link) document.body.appendChild(link);
link.click() link.click();
// 清理资源 // 清理资源
setTimeout(() => { setTimeout(() => {
URL.revokeObjectURL(tempUrl) URL.revokeObjectURL(tempUrl);
document.body.removeChild(link) document.body.removeChild(link);
}, 100) }, 100);
}) })
.catch((error) => console.error('下载失败:', error)) .catch(error => console.error('下载失败:', error));
}, },
// 新增下载二维码方法 // 新增下载二维码方法
async handleDownloadQrCode(row) { async handleDownloadQrCode(row) {
// 使用示例 // 使用示例
const fileurl = this.baseUrl + row.qrCode const fileurl = this.baseUrl + row.qrCode;
this.downloadOnlineImage(fileurl, 'qr_code.png') this.downloadOnlineImage(fileurl, 'qr_code.png');
},
getPlaceList() {
listLog(this.queryParams).then((response) => {
this.placeList = response.rows
this.total = response.total
this.loading = false
})
}, },
/** 查询巡检点列表 */
/** 查询设备类型列表 */
getList() { getList() {
this.loading = true this.loading = true;
listLog(this.queryParams)
.then(response => {
this.placeList = response.rows;
this.total = response.total;
this.loading = false;
})
.catch(() => {
this.loading = false;
});
}, },
// 取消按钮 // 取消按钮
cancel() { cancel() {
this.open = false this.open = false;
this.reset() this.reset();
}, },
// 表单重置 // 表单重置
reset() { reset() {
...@@ -170,71 +170,71 @@ export default { ...@@ -170,71 +170,71 @@ export default {
placeName: null, placeName: null,
location: null, location: null,
information: null, information: null,
} };
this.resetForm('form') this.resetForm('form');
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */
handleQuery() { handleQuery() {
this.queryParams.pageNum = 1 this.queryParams.pageNum = 1;
this.getPlaceList() this.getList();
}, },
/** 重置按钮操作 */ /** 重置按钮操作 */
resetQuery() { resetQuery() {
this.resetForm('queryForm') this.resetForm('queryForm');
this.handleQuery() this.handleQuery();
}, },
// 多选框选中数据 // 多选框选中数据
handleSelectionChange(selection) { handleSelectionChange(selection) {
this.ids = selection.map((item) => item.id) this.ids = selection.map(item => item.id);
this.single = selection.length !== 1 this.single = selection.length !== 1;
this.multiple = !selection.length this.multiple = !selection.length;
}, },
/** 新增按钮操作 */ /** 新增按钮操作 */
handleAdd() { handleAdd() {
this.reset() this.reset();
this.open = true this.open = true;
this.title = '添加巡检点' this.title = '添加巡检点';
}, },
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(row) { handleUpdate(row) {
this.reset() this.reset();
this.open = true this.open = true;
this.title = '修改巡检点' this.title = '修改巡检点';
this.form = JSON.parse(JSON.stringify(row)) this.form = JSON.parse(JSON.stringify(row));
}, },
/** 提交按钮 */ /** 提交按钮 */
submitForm() { submitForm() {
this.$refs['form'].validate((valid) => { this.$refs['form'].validate(valid => {
if (valid) { if (valid) {
if (this.form.id != null) { if (this.form.id != null) {
updateLog(this.form).then((response) => { updateLog(this.form).then(response => {
this.$modal.msgSuccess('修改成功') this.$modal.msgSuccess('修改成功');
this.open = false this.open = false;
this.getPlaceList() this.getList();
}) });
} else { } else {
addLog(this.form).then((response) => { addLog(this.form).then(response => {
this.$modal.msgSuccess('新增成功') this.$modal.msgSuccess('新增成功');
this.open = false this.open = false;
this.getPlaceList() this.getList();
}) });
} }
} }
}) });
}, },
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete(row) { handleDelete(row) {
const ids = row.id || this.ids const ids = row.id || this.ids;
this.$modal this.$modal
.confirm('是否确认删除?') .confirm('是否确认删除?')
.then(function () { .then(function () {
return delLog(ids) return delLog(ids);
}) })
.then(() => { .then(() => {
this.getPlaceList() this.getList();
this.$modal.msgSuccess('删除成功') this.$modal.msgSuccess('删除成功');
}) })
.catch(() => {}) .catch(() => {});
}, },
handleExport() { handleExport() {
request({ request({
...@@ -242,25 +242,24 @@ export default { ...@@ -242,25 +242,24 @@ export default {
params: this.queryParams, params: this.queryParams,
method: 'get', method: 'get',
responseType: 'blob', // 关键:指定接收二进制流 responseType: 'blob', // 关键:指定接收二进制流
}).then((response) => { }).then(response => {
// 创建Blob对象并生成临时URL // 创建Blob对象并生成临时URL
const blob = new Blob([response], { type: 'application/zip' }) // 根据实际图片类型调整 const blob = new Blob([response], { type: 'application/zip' }); // 根据实际图片类型调整
const url = window.URL.createObjectURL(blob) const url = window.URL.createObjectURL(blob);
// 创建并触发下载链接 // 创建并触发下载链接
const a = document.createElement('a') const a = document.createElement('a');
a.href = url a.href = url;
a.download = `二维码.zip` // 文件名使用设备编号+二维码 a.download = `二维码.zip`; // 文件名使用设备编号+二维码
document.body.appendChild(a) document.body.appendChild(a);
a.click() a.click();
// 清理资源 // 清理资源
document.body.removeChild(a) document.body.removeChild(a);
window.URL.revokeObjectURL(url) window.URL.revokeObjectURL(url);
this.$message.success('二维码下载成功') this.$message.success('二维码下载成功');
}) });
}, },
}, },
} };
</script> </script>
\ No newline at end of file
<template> <template>
<div class="app-container"> <div class="app-container">
<el-form <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" label-width="68px">
:model="queryParams"
ref="queryForm"
size="small"
:inline="true"
v-show="showSearch"
label-width="68px"
>
<el-form-item label="" prop="deviceName"> <el-form-item label="" prop="deviceName">
<el-select <el-select v-model="queryParams.deviceName" placeholder="空压机名称" clearable>
v-model="queryParams.deviceName" <el-option v-for="dict in deviceName" :key="dict.id" :label="dict.deviceName" :value="dict.id" />
placeholder="风机名称"
clearable
>
<el-option
v-for="dict in deviceName"
:key="dict.value"
:label="dict.name"
:value="dict.name"
/>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label=""> <el-form-item label="">
...@@ -34,163 +18,53 @@ ...@@ -34,163 +18,53 @@
></el-date-picker> ></el-date-picker>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
type="primary" <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
icon="el-icon-search" <!-- <el-button icon="el-icon-download" size="mini" type="primary" plain @click="exportData">导出</el-button> -->
size="mini"
@click="handleQuery"
>搜索</el-button
>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
>重置</el-button
>
<el-button
icon="el-icon-download"
size="mini"
type="primary"
plain
@click="exportData"
>导出</el-button
>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-table <el-table v-loading="loading" :data="infoList">
v-loading="loading" <el-table-column label="空压机名称" align="center" prop="deviceName" width="120" />
:data="infoList" <el-table-column label="空压机编号" align="center" prop="deviceId" width="120" />
@selection-change="handleSelectionChange" <el-table-column label="监测时间" align="center" prop="time" width="160" />
> <el-table-column label="管道压力(Kpa)" align="center" prop="pipelinePressure" width="140" />
<el-table-column type="selection" width="55" align="center" /> <el-table-column label="瞬时流量(m³)" align="center" prop="flowRate" width="140" />
<el-table-column <el-table-column label="瞬时流速(m³/s)" align="center" prop="velocity" width="140" />
label="风机名称" <el-table-column label="气体温度(℃)" align="center" prop="gasTemperature" width="120" />
align="center" <el-table-column label="管道压力(假)(Kpa)" align="center" prop="pipelinePressureFalse" />
prop="deviceName" <el-table-column label="瞬时流量(假)(m³)" align="center" prop="flowRateFalse" />
width="120" <el-table-column label="瞬时流速(假)(m³/s)" align="center" prop="velocityFalse" />
/> <el-table-column label="气体温度(假)(℃)" align="center" prop="gasTemperatureFalse" />
<el-table-column <el-table-column label="状态" align="center" prop="fanRunStatus" width="140">
label="风机编号" <template slot-scope="{ row }">
align="center" <el-tag v-if="row.fanRunStatus == 1" type="success" size="mini">启动</el-tag>
prop="deviceId" <el-tag v-else-if="row.fanRunStatus == 2" type="danger" size="mini">停止</el-tag>
width="120" <el-tag v-else-if="fanRunStatus == 3" size="mini">复位</el-tag>
/> </template>
<el-table-column </el-table-column>
label="监测时间"
align="center"
prop="time"
width="160"
/>
<el-table-column
label="电压(V)"
align="center"
prop="powerSupplyVoltage"
width="140"
/>
<el-table-column
label="电机电流(A)"
align="center"
prop="motorCurrent"
width="140"
/>
<el-table-column
label="运行频率(HZ)"
align="center"
prop="operatingFrequency"
width="140"
/>
<el-table-column
label="设定频率(HZ)"
align="center"
prop="setFrequency"
width="140"
/>
<el-table-column
label="风压(Kpa)"
align="center"
prop="windPressure"
width="120"
/>
<el-table-column
label="风速(m/s)"
align="center"
prop="windSpeed"
width="120"
/>
<el-table-column
label="风量(m³/s)"
align="center"
prop="airVolume"
width="140"
/>
<el-table-column
label="前轴温(℃)"
align="center"
prop="frontAxisTemperature"
width="120"
/>
<el-table-column
label="后轴温(℃)"
align="center"
prop="rearAxisTemperature"
width="120"
/>
<el-table-column
label="电机温度(℃)"
align="center"
prop="motorTemperature"
width="140"
/>
<el-table-column
label="前振动(mm/s)"
align="center"
prop="frontVibration"
width="150"
/>
<el-table-column
label="后振动(mm/s)"
align="center"
prop="rearVibration"
width="150"
/>
</el-table> </el-table>
<pagination <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList" />
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</div> </div>
</template> </template>
<script> <script>
import { listFanHis } from "@/api/tyler/fan"; import { listKongHis } from '@/api/tyler/kong';
import { fanDeviceName } from "@/api/tyler/common"; import { kongDeviceName } from '@/api/tyler/common';
export default { export default {
name: "Info", name: 'Info',
data() { data() {
return { return {
// 根路径 // 根路径
baseURL: process.env.VUE_APP_BASE_API, baseURL: process.env.VUE_APP_BASE_API,
// 遮罩层 // 遮罩层
loading: true, loading: true,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数 // 总条数
total: 0, total: 0,
// 机基本信息表格数据 // 空压机基本信息表格数据
infoList: [], infoList: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
// 查询参数 // 查询参数
queryParams: { queryParams: {
pageNum: 1, pageNum: 1,
...@@ -198,74 +72,29 @@ export default { ...@@ -198,74 +72,29 @@ export default {
deviceName: null, deviceName: null,
deviceId: null, deviceId: null,
}, },
// 表单参数
form: {},
// 表单校验
rules: {
id: [{ required: true, message: "id不能为空", trigger: "blur" }],
deviceName: [
{ required: true, message: "风机名称不能为空", trigger: "blur" },
],
deviceId: [
{ required: true, message: "风机编号不能为空", trigger: "blur" },
],
},
deviceName: [], deviceName: [],
dateRange: [], dateRange: [],
}; };
}, },
created() { created() {
fanDeviceName().then((res) => { kongDeviceName().then(res => {
this.deviceName = res.data; this.deviceName = res.rows;
}); });
this.getList(); this.getList();
}, },
methods: { methods: {
/** 导出按钮操作 */ /** 导出按钮操作 */
exportData() { exportData() {
this.download( this.download('/business/pump/history/export ', {}, `空压机运行历史数据_${new Date().getTime()}.xlsx`);
"/business/pump/history/export ",
{},
`风机运行历史数据_${new Date().getTime()}.xlsx`
);
}, },
/** 查询机基本信息列表 */ /** 查询空压机基本信息列表 */
getList() { getList() {
this.loading = true; this.loading = true;
listFanHis(this.addDateRange(this.queryParams, this.dateRange)).then( listKongHis(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
(response) => { this.infoList = response.rows;
this.infoList = response.rows; this.total = response.total;
this.total = response.total; this.loading = false;
this.loading = false; });
}
);
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
},
// 表单重置
reset() {
this.form = {
id: null,
deviceName: null,
deviceId: null,
installationLocation: null,
powerSupplyVoltage: null,
motorCurrent: null,
operatingFrequency: null,
setFrequency: null,
windPressure: null,
windSpeed: null,
airVolume: null,
frontAxisTemperature: null,
rearAxisTemperature: null,
motorTemperature: null,
frontVibration: null,
rearVibration: null,
};
this.resetForm("form");
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */
handleQuery() { handleQuery() {
...@@ -275,7 +104,7 @@ export default { ...@@ -275,7 +104,7 @@ export default {
/** 重置按钮操作 */ /** 重置按钮操作 */
resetQuery() { resetQuery() {
this.dateRange = []; this.dateRange = [];
this.resetForm("queryForm"); this.resetForm('queryForm');
this.handleQuery(); this.handleQuery();
}, },
}, },
......
<template> <template>
<div class="app-container"> <div class="app-container">
<el-form <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
:model="queryParams" <el-form-item label="" prop="deviceId">
ref="queryForm" <el-select v-model="queryParams.deviceId" placeholder="空压机名称" clearable>
size="small" <el-option v-for="dict in deviceName" :key="dict.id" :label="dict.deviceName" :value="dict.id" />
:inline="true"
v-show="showSearch"
label-width="68px"
>
<el-form-item label="" prop="deviceName">
<el-select
v-model="queryParams.deviceName"
placeholder="空压机名称"
clearable
>
<el-option
v-for="dict in deviceName"
:key="dict.value"
:label="dict.name"
:value="dict.name"
/>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label=""> <el-form-item label="">
...@@ -34,180 +18,75 @@ ...@@ -34,180 +18,75 @@
></el-date-picker> ></el-date-picker>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
type="primary" <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
icon="el-icon-search"
size="mini"
@click="handleQuery"
>搜索</el-button
>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
>重置</el-button
>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-table <el-table v-loading="loading" :data="infoList">
v-loading="loading" <el-table-column label="空压机名称" align="center" prop="deviceName" width="120" />
:data="infoList" <el-table-column label="空压机编号" align="center" prop="deviceId" width="120" />
@selection-change="handleSelectionChange" <el-table-column label="监测时间" align="center" prop="time" width="160" />
> <el-table-column label="管道压力(Kpa)" align="center" prop="pipelinePressure" width="140" />
<el-table-column <el-table-column label="瞬时流量(m³)" align="center" prop="flowRate" width="140" />
label="空压机名称" <el-table-column label="瞬时流速(m³/s)" align="center" prop="velocity" width="140" />
align="center" <el-table-column label="气体温度(℃)" align="center" prop="gasTemperature" width="120" />
prop="deviceName" <el-table-column label="管道压力(假)(Kpa)" align="center" prop="pipelinePressureFalse" />
width="120" <el-table-column label="瞬时流量(假)(m³)" align="center" prop="flowRateFalse" width="140" />
/> <el-table-column label="瞬时流速(假)(m³/s)" align="center" prop="velocityFalse" />
<el-table-column <el-table-column label="气体温度(假)(℃)" align="center" prop="gasTemperatureFalse" />
label="空压机编号" <el-table-column label="状态" align="center" prop="fanRunStatus" width="140">
align="center" <template slot-scope="{ row }">
prop="deviceId" <el-tag v-if="row.fanRunStatus == 1" type="success" size="mini">启动</el-tag>
width="120" <el-tag v-else-if="row.fanRunStatus == 2" type="danger" size="mini">停止</el-tag>
/> <el-tag v-else-if="fanRunStatus == 3" size="mini">复位</el-tag>
<el-table-column </template>
label="监测时间" </el-table-column>
align="center"
prop="time"
width="160"
/>
<el-table-column
label="电压(V)"
align="center"
prop="powerSupplyVoltage"
width="140"
/>
<el-table-column
label="电机电流(A)"
align="center"
prop="motorCurrent"
width="140"
/>
<el-table-column
label="运行频率(HZ)"
align="center"
prop="operatingFrequency"
width="140"
/>
<el-table-column
label="设定频率(HZ)"
align="center"
prop="setFrequency"
width="140"
/>
<el-table-column
label="风压(Kpa)"
align="center"
prop="windPressure"
width="120"
/>
<el-table-column
label="风速(m/s)"
align="center"
prop="windSpeed"
width="120"
/>
<el-table-column
label="风量(m³/s)"
align="center"
prop="airVolume"
width="140"
/>
<el-table-column
label="前轴温(℃)"
align="center"
prop="frontAxisTemperature"
width="120"
/>
<el-table-column
label="后轴温(℃)"
align="center"
prop="rearAxisTemperature"
width="120"
/>
<el-table-column
label="电机温度(℃)"
align="center"
prop="motorTemperature"
width="140"
/>
<el-table-column
label="前振动(mm/s)"
align="center"
prop="frontVibration"
width="150"
/>
<el-table-column
label="后振动(mm/s)"
align="center"
prop="rearVibration"
width="150"
/>
</el-table> </el-table>
<pagination <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList" />
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</div> </div>
</template> </template>
<script> <script>
import { listrealFan } from "@/api/tyler/kongReal"; import { listrealKong } from '@/api/tyler/kongReal';
import { fanDeviceName } from "@/api/tyler/common"; import { kongDeviceName } from '@/api/tyler/common';
export default { export default {
name: "Info", name: 'Info',
data() { data() {
return { return {
// 根路径 // 根路径
baseURL: process.env.VUE_APP_BASE_API, baseURL: process.env.VUE_APP_BASE_API,
// 遮罩层 // 遮罩层
loading: true, loading: true,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件 // 显示搜索条件
showSearch: true, showSearch: true,
// 总条数 // 总条数
total: 0, total: 0,
// 空压机基本信息表格数据 // 空压机基本信息表格数据
infoList: [], infoList: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
// 查询参数 // 查询参数
queryParams: { queryParams: {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
deviceName: null,
deviceId: null, deviceId: null,
}, },
// 表单参数 // 表单参数
form: {}, form: {},
// 表单校验 // 表单校验
rules: { rules: {
id: [{ required: true, message: "id不能为空", trigger: "blur" }], id: [{ required: true, message: 'id不能为空', trigger: 'blur' }],
deviceName: [ deviceName: [{ required: true, message: '空压机名称不能为空', trigger: 'blur' }],
{ required: true, message: "空压机名称不能为空", trigger: "blur" }, deviceId: [{ required: true, message: '空压机编号不能为空', trigger: 'blur' }],
],
deviceId: [
{ required: true, message: "空压机编号不能为空", trigger: "blur" },
],
}, },
deviceName: [], deviceName: [],
dateRange: [], dateRange: [],
}; };
}, },
created() { created() {
fanDeviceName().then((res) => { kongDeviceName().then(res => {
this.deviceName = res.data; this.deviceName = res.rows;
}); });
this.getList(); this.getList();
}, },
...@@ -215,40 +94,11 @@ export default { ...@@ -215,40 +94,11 @@ export default {
/** 查询空压机基本信息列表 */ /** 查询空压机基本信息列表 */
getList() { getList() {
this.loading = true; this.loading = true;
listrealFan(this.addDateRange(this.queryParams, this.dateRange)).then( listrealKong(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
(response) => { this.infoList = response.rows;
this.infoList = response.rows; this.total = response.total;
this.total = response.total; this.loading = false;
this.loading = false; });
}
);
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
},
// 表单重置
reset() {
this.form = {
id: null,
deviceName: null,
deviceId: null,
installationLocation: null,
powerSupplyVoltage: null,
motorCurrent: null,
operatingFrequency: null,
setFrequency: null,
windPressure: null,
windSpeed: null,
airVolume: null,
frontAxisTemperature: null,
rearAxisTemperature: null,
motorTemperature: null,
frontVibration: null,
rearVibration: null,
};
this.resetForm("form");
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */
handleQuery() { handleQuery() {
...@@ -258,7 +108,7 @@ export default { ...@@ -258,7 +108,7 @@ export default {
/** 重置按钮操作 */ /** 重置按钮操作 */
resetQuery() { resetQuery() {
this.dateRange = []; this.dateRange = [];
this.resetForm("queryForm"); this.resetForm('queryForm');
this.handleQuery(); this.handleQuery();
}, },
}, },
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment