Commit 8cd4d727 authored by sxl's avatar sxl 💬

add:空风机接口对接

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