Compare commits

..

2 Commits

2 changed files with 776 additions and 0 deletions

View File

@ -0,0 +1,388 @@
<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="equipName">
<el-input
v-model="queryParams.equipName"
placeholder="请输入设备名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="设备型号" prop="equipModel">
<el-input
v-model="queryParams.equipModel"
placeholder="请输入设备型号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="出厂日期">
<el-date-picker
v-model="daterangeProductTime"
style="width: 240px"
value-format="yyyy-MM-dd"
type="daterange"
range-separator="-"
start-placeholder="开始日期"
end-placeholder="结束日期"
></el-date-picker>
</el-form-item>
<el-form-item label="参数" prop="param">
<el-input
v-model="queryParams.param"
placeholder="请输入参数"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="参数值" prop="paramValue">
<el-input
v-model="queryParams.paramValue"
placeholder="请输入参数值"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="单位" prop="unit">
<el-input
v-model="queryParams.unit"
placeholder="请输入单位"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="采集时间">
<el-date-picker
v-model="daterangeAddTime"
style="width: 240px"
value-format="yyyy-MM-dd"
type="daterange"
range-separator="-"
start-placeholder="开始日期"
end-placeholder="结束日期"
></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-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['hlsnManage:param:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['hlsnManage:param:edit']"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['hlsnManage:param:remove']"
>删除</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="paramList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="设备名称" align="center" prop="equipName" />
<el-table-column label="设备型号" align="center" prop="equipModel" />
<el-table-column label="出厂日期" align="center" prop="productTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.productTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="功率" align="center" prop="takeEquip" />
<el-table-column label="参数" align="center" prop="param" />
<el-table-column label="参数值" align="center" prop="paramValue" />
<el-table-column label="单位" align="center" prop="unit" />
<el-table-column label="采集时间" align="center" prop="addTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.addTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
<el-table-column label="备注" align="center" prop="remark" :show-overflow-tooltip="true"/>
<!-- <el-table-column label="数据类型" align="center" prop="dataType" />-->
<!-- <el-table-column label="其他" align="center" prop="equipType" />-->
<!-- <el-table-column label="设备状态" align="center" prop="equipStatus" />-->
<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)"
v-hasPermi="['hlsnManage:param:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['hlsnManage:param:remove']"
>删除</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" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="设备名称" prop="equipName">
<el-input v-model="form.equipName" placeholder="请输入设备名称" />
</el-form-item>
<el-form-item label="设备型号" prop="equipModel">
<el-input v-model="form.equipModel" placeholder="请输入设备型号" />
</el-form-item>
<el-form-item label="出厂日期" prop="productTime">
<el-date-picker clearable
v-model="form.productTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择出厂日期">
</el-date-picker>
</el-form-item>
<el-form-item label="功率" prop="takeEquip">
<el-input v-model="form.takeEquip" placeholder="请输入功率" />
</el-form-item>
<el-form-item label="参数" prop="param">
<el-input v-model="form.param" placeholder="请输入参数" />
</el-form-item>
<el-form-item label="参数值" prop="paramValue">
<el-input v-model="form.paramValue" placeholder="请输入参数值" />
</el-form-item>
<el-form-item label="单位" prop="unit">
<el-input v-model="form.unit" placeholder="请输入单位" />
</el-form-item>
<el-form-item label="采集时间" prop="addTime">
<el-date-picker clearable
v-model="form.addTime"
type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
placeholder="请选择采集时间">
</el-date-picker>
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
</el-form-item>
<!-- <el-form-item label="数据类型" prop="dataType">-->
<!-- <el-input v-model="form.dataType" placeholder="请输入数据类型" />-->
<!-- </el-form-item>-->
<el-form-item label="其他" prop="equipType">
<el-input v-model="form.equipType" placeholder="请输入其他" />
</el-form-item>
<el-form-item label="设备状态" prop="equipStatus">
<el-input v-model="form.equipStatus" placeholder="请输入设备状态" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listParam, getParam, delParam, addParam, updateParam } from "@/api/hlsnManage/param";
export default {
//
name: "Belt",
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
paramList: [],
//
title: "",
//
open: false,
//
daterangeProductTime: [],
//
daterangeAddTime: [],
//
queryParams: {
pageNum: 1,
pageSize: 10,
equipName: null,
equipModel: null,
productTime: null,
takeEquip: null,
param: null,
paramValue: null,
unit: null,
addTime: null,
dataType: "入料皮带机",
equipType: null,
equipStatus: null
},
//
form: {},
//
rules: {
}
};
},
created() {
this.getList();
},
methods: {
/** 查询设备运行参数列表 */
getList() {
this.loading = true;
this.queryParams.params = {};
if (null != this.daterangeProductTime && '' != this.daterangeProductTime) {
this.queryParams.params["beginProductTime"] = this.daterangeProductTime[0];
this.queryParams.params["endProductTime"] = this.daterangeProductTime[1];
}
if (null != this.daterangeAddTime && '' != this.daterangeAddTime) {
this.queryParams.params["beginAddTime"] = this.daterangeAddTime[0];
this.queryParams.params["endAddTime"] = this.daterangeAddTime[1];
}
listParam(this.queryParams).then(response => {
this.paramList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
id: null,
equipName: null,
equipModel: null,
productTime: null,
takeEquip: null,
param: null,
paramValue: null,
unit: null,
addTime: null,
remark: null,
dataType: null,
equipType: null,
equipStatus: null
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.daterangeProductTime = [];
this.daterangeAddTime = [];
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
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.form.dataType = "入料皮带机";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id || this.ids
getParam(id).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改二筛入料皮带机接口参数";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.id != null) {
updateParam(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addParam(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal.confirm('是否确认删除二筛入料皮带机接口参数编号为"' + ids + '"的数据项?').then(function() {
return delParam(ids);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download('hlsnManage/param/export', {
...this.queryParams
}, `param_${new Date().getTime()}.xlsx`)
}
}
};
</script>

View File

@ -0,0 +1,388 @@
<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="equipName">
<el-input
v-model="queryParams.equipName"
placeholder="请输入设备名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="设备型号" prop="equipModel">
<el-input
v-model="queryParams.equipModel"
placeholder="请输入设备型号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="出厂日期">
<el-date-picker
v-model="daterangeProductTime"
style="width: 240px"
value-format="yyyy-MM-dd"
type="daterange"
range-separator="-"
start-placeholder="开始日期"
end-placeholder="结束日期"
></el-date-picker>
</el-form-item>
<el-form-item label="参数" prop="param">
<el-input
v-model="queryParams.param"
placeholder="请输入参数"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="参数值" prop="paramValue">
<el-input
v-model="queryParams.paramValue"
placeholder="请输入参数值"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="单位" prop="unit">
<el-input
v-model="queryParams.unit"
placeholder="请输入单位"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="采集时间">
<el-date-picker
v-model="daterangeAddTime"
style="width: 240px"
value-format="yyyy-MM-dd"
type="daterange"
range-separator="-"
start-placeholder="开始日期"
end-placeholder="结束日期"
></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-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['hlsnManage:param:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['hlsnManage:param:edit']"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['hlsnManage:param:remove']"
>删除</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="paramList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="设备名称" align="center" prop="equipName" />
<el-table-column label="设备型号" align="center" prop="equipModel" />
<el-table-column label="出厂日期" align="center" prop="productTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.productTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="功率" align="center" prop="takeEquip" />
<el-table-column label="参数" align="center" prop="param" />
<el-table-column label="参数值" align="center" prop="paramValue" />
<el-table-column label="单位" align="center" prop="unit" />
<el-table-column label="采集时间" align="center" prop="addTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.addTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
<el-table-column label="备注" align="center" prop="remark" :show-overflow-tooltip="true"/>
<!-- <el-table-column label="数据类型" align="center" prop="dataType" />-->
<!-- <el-table-column label="其他" align="center" prop="equipType" />-->
<!-- <el-table-column label="设备状态" align="center" prop="equipStatus" />-->
<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)"
v-hasPermi="['hlsnManage:param:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['hlsnManage:param:remove']"
>删除</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" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="设备名称" prop="equipName">
<el-input v-model="form.equipName" placeholder="请输入设备名称" />
</el-form-item>
<el-form-item label="设备型号" prop="equipModel">
<el-input v-model="form.equipModel" placeholder="请输入设备型号" />
</el-form-item>
<el-form-item label="出厂日期" prop="productTime">
<el-date-picker clearable
v-model="form.productTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择出厂日期">
</el-date-picker>
</el-form-item>
<el-form-item label="功率" prop="takeEquip">
<el-input v-model="form.takeEquip" placeholder="请输入功率" />
</el-form-item>
<el-form-item label="参数" prop="param">
<el-input v-model="form.param" placeholder="请输入参数" />
</el-form-item>
<el-form-item label="参数值" prop="paramValue">
<el-input v-model="form.paramValue" placeholder="请输入参数值" />
</el-form-item>
<el-form-item label="单位" prop="unit">
<el-input v-model="form.unit" placeholder="请输入单位" />
</el-form-item>
<el-form-item label="采集时间" prop="addTime">
<el-date-picker clearable
v-model="form.addTime"
type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
placeholder="请选择采集时间">
</el-date-picker>
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
</el-form-item>
<!-- <el-form-item label="数据类型" prop="dataType">-->
<!-- <el-input v-model="form.dataType" placeholder="请输入数据类型" />-->
<!-- </el-form-item>-->
<el-form-item label="其他" prop="equipType">
<el-input v-model="form.equipType" placeholder="请输入其他" />
</el-form-item>
<el-form-item label="设备状态" prop="equipStatus">
<el-input v-model="form.equipStatus" placeholder="请输入设备状态" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listParam, getParam, delParam, addParam, updateParam } from "@/api/hlsnManage/param";
export default {
//
name: "CirculationFan",
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
paramList: [],
//
title: "",
//
open: false,
//
daterangeProductTime: [],
//
daterangeAddTime: [],
//
queryParams: {
pageNum: 1,
pageSize: 10,
equipName: null,
equipModel: null,
productTime: null,
takeEquip: null,
param: null,
paramValue: null,
unit: null,
addTime: null,
dataType: "循环风机",
equipType: null,
equipStatus: null
},
//
form: {},
//
rules: {
}
};
},
created() {
this.getList();
},
methods: {
/** 查询设备运行参数列表 */
getList() {
this.loading = true;
this.queryParams.params = {};
if (null != this.daterangeProductTime && '' != this.daterangeProductTime) {
this.queryParams.params["beginProductTime"] = this.daterangeProductTime[0];
this.queryParams.params["endProductTime"] = this.daterangeProductTime[1];
}
if (null != this.daterangeAddTime && '' != this.daterangeAddTime) {
this.queryParams.params["beginAddTime"] = this.daterangeAddTime[0];
this.queryParams.params["endAddTime"] = this.daterangeAddTime[1];
}
listParam(this.queryParams).then(response => {
this.paramList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
id: null,
equipName: null,
equipModel: null,
productTime: null,
takeEquip: null,
param: null,
paramValue: null,
unit: null,
addTime: null,
remark: null,
dataType: null,
equipType: null,
equipStatus: null
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.daterangeProductTime = [];
this.daterangeAddTime = [];
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
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.form.dataType = "循环风机";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id || this.ids
getParam(id).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改选粉循环风机接口参数";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.id != null) {
updateParam(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addParam(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal.confirm('是否确认删除选粉循环风机接口参数编号为"' + ids + '"的数据项?').then(function() {
return delParam(ids);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download('hlsnManage/param/export', {
...this.queryParams
}, `param_${new Date().getTime()}.xlsx`)
}
}
};
</script>