add 设备相关

This commit is contained in:
lb 2023-08-10 16:52:47 +08:00
parent 8f61e9a9d9
commit 3900dcfbd8
30 changed files with 4527 additions and 0 deletions

54
src/api/base/equipment.js Normal file
View File

@ -0,0 +1,54 @@
import request from '@/utils/request'
// 创建设备
export function createEquipment(data) {
return request({
url: '/base/equipment/create',
method: 'post',
data: data
})
}
// 更新设备
export function updateEquipment(data) {
return request({
url: '/base/equipment/update',
method: 'put',
data: data
})
}
// 删除设备
export function deleteEquipment(id) {
return request({
url: '/base/equipment/delete?id=' + id,
method: 'delete'
})
}
// 获得设备
export function getEquipment(id) {
return request({
url: '/base/equipment/get?id=' + id,
method: 'get'
})
}
// 获得设备分页
export function getEquipmentPage(query) {
return request({
url: '/base/equipment/page',
method: 'get',
params: query
})
}
// 导出设备 Excel
export function exportEquipmentExcel(query) {
return request({
url: '/base/equipment/export-excel',
method: 'get',
params: query,
responseType: 'blob'
})
}

View File

@ -0,0 +1,54 @@
import request from '@/utils/request'
// 创建设备属性
export function createEquipmentAttr(data) {
return request({
url: '/base/equipment-attr/create',
method: 'post',
data: data
})
}
// 更新设备属性
export function updateEquipmentAttr(data) {
return request({
url: '/base/equipment-attr/update',
method: 'put',
data: data
})
}
// 删除设备属性
export function deleteEquipmentAttr(id) {
return request({
url: '/base/equipment-attr/delete?id=' + id,
method: 'delete'
})
}
// 获得设备属性
export function getEquipmentAttr(id) {
return request({
url: '/base/equipment-attr/get?id=' + id,
method: 'get'
})
}
// 获得设备属性分页
export function getEquipmentAttrPage(query) {
return request({
url: '/base/equipment-attr/page',
method: 'get',
params: query
})
}
// 导出设备属性 Excel
export function exportEquipmentAttrExcel(query) {
return request({
url: '/base/equipment-attr/export-excel',
method: 'get',
params: query,
responseType: 'blob'
})
}

View File

@ -0,0 +1,54 @@
import request from '@/utils/request'
// 创建工段设备绑定
export function createEquipmentBindSection(data) {
return request({
url: '/base/equipment-bind-section/create',
method: 'post',
data: data
})
}
// 更新工段设备绑定
export function updateEquipmentBindSection(data) {
return request({
url: '/base/equipment-bind-section/update',
method: 'put',
data: data
})
}
// 删除工段设备绑定
export function deleteEquipmentBindSection(id) {
return request({
url: '/base/equipment-bind-section/delete?id=' + id,
method: 'delete'
})
}
// 获得工段设备绑定
export function getEquipmentBindSection(id) {
return request({
url: '/base/equipment-bind-section/get?id=' + id,
method: 'get'
})
}
// 获得工段设备绑定分页
export function getEquipmentBindSectionPage(query) {
return request({
url: '/base/equipment-bind-section/page',
method: 'get',
params: query
})
}
// 导出工段设备绑定 Excel
export function exportEquipmentBindSectionExcel(query) {
return request({
url: '/base/equipment-bind-section/export-excel',
method: 'get',
params: query,
responseType: 'blob'
})
}

View File

@ -0,0 +1,54 @@
import request from '@/utils/request'
// 创建设备文件对应
export function createEquipmentFile(data) {
return request({
url: '/base/equipment-file/create',
method: 'post',
data: data
})
}
// 更新设备文件对应
export function updateEquipmentFile(data) {
return request({
url: '/base/equipment-file/update',
method: 'put',
data: data
})
}
// 删除设备文件对应
export function deleteEquipmentFile(id) {
return request({
url: '/base/equipment-file/delete?id=' + id,
method: 'delete'
})
}
// 获得设备文件对应
export function getEquipmentFile(id) {
return request({
url: '/base/equipment-file/get?id=' + id,
method: 'get'
})
}
// 获得设备文件对应分页
export function getEquipmentFilePage(query) {
return request({
url: '/base/equipment-file/page',
method: 'get',
params: query
})
}
// 导出设备文件对应 Excel
export function exportEquipmentFileExcel(query) {
return request({
url: '/base/equipment-file/export-excel',
method: 'get',
params: query,
responseType: 'blob'
})
}

View File

@ -0,0 +1,54 @@
import request from '@/utils/request'
// 创建设备分组(用于同类型不同厂家的设备区分)
export function createEquipmentGroup(data) {
return request({
url: '/base/equipment-group/create',
method: 'post',
data: data
})
}
// 更新设备分组(用于同类型不同厂家的设备区分)
export function updateEquipmentGroup(data) {
return request({
url: '/base/equipment-group/update',
method: 'put',
data: data
})
}
// 删除设备分组(用于同类型不同厂家的设备区分)
export function deleteEquipmentGroup(id) {
return request({
url: '/base/equipment-group/delete?id=' + id,
method: 'delete'
})
}
// 获得设备分组(用于同类型不同厂家的设备区分)
export function getEquipmentGroup(id) {
return request({
url: '/base/equipment-group/get?id=' + id,
method: 'get'
})
}
// 获得设备分组(用于同类型不同厂家的设备区分)分页
export function getEquipmentGroupPage(query) {
return request({
url: '/base/equipment-group/page',
method: 'get',
params: query
})
}
// 导出设备分组(用于同类型不同厂家的设备区分) Excel
export function exportEquipmentGroupExcel(query) {
return request({
url: '/base/equipment-group/export-excel',
method: 'get',
params: query,
responseType: 'blob'
})
}

View File

@ -0,0 +1,54 @@
import request from '@/utils/request'
// 创建设备分组报警明细
export function createEquipmentGroupAlarm(data) {
return request({
url: '/base/equipment-group-alarm/create',
method: 'post',
data: data
})
}
// 更新设备分组报警明细
export function updateEquipmentGroupAlarm(data) {
return request({
url: '/base/equipment-group-alarm/update',
method: 'put',
data: data
})
}
// 删除设备分组报警明细
export function deleteEquipmentGroupAlarm(id) {
return request({
url: '/base/equipment-group-alarm/delete?id=' + id,
method: 'delete'
})
}
// 获得设备分组报警明细
export function getEquipmentGroupAlarm(id) {
return request({
url: '/base/equipment-group-alarm/get?id=' + id,
method: 'get'
})
}
// 获得设备分组报警明细分页
export function getEquipmentGroupAlarmPage(query) {
return request({
url: '/base/equipment-group-alarm/page',
method: 'get',
params: query
})
}
// 导出设备分组报警明细 Excel
export function exportEquipmentGroupAlarmExcel(query) {
return request({
url: '/base/equipment-group-alarm/export-excel',
method: 'get',
params: query,
responseType: 'blob'
})
}

View File

@ -0,0 +1,54 @@
import request from '@/utils/request'
// 创建实时数据采集配置
export function createEquipmentPlc(data) {
return request({
url: '/base/equipment-plc/create',
method: 'post',
data: data
})
}
// 更新实时数据采集配置
export function updateEquipmentPlc(data) {
return request({
url: '/base/equipment-plc/update',
method: 'put',
data: data
})
}
// 删除实时数据采集配置
export function deleteEquipmentPlc(id) {
return request({
url: '/base/equipment-plc/delete?id=' + id,
method: 'delete'
})
}
// 获得实时数据采集配置
export function getEquipmentPlc(id) {
return request({
url: '/base/equipment-plc/get?id=' + id,
method: 'get'
})
}
// 获得实时数据采集配置分页
export function getEquipmentPlcPage(query) {
return request({
url: '/base/equipment-plc/page',
method: 'get',
params: query
})
}
// 导出实时数据采集配置 Excel
export function exportEquipmentPlcExcel(query) {
return request({
url: '/base/equipment-plc/export-excel',
method: 'get',
params: query,
responseType: 'blob'
})
}

View File

@ -0,0 +1,54 @@
import request from '@/utils/request'
// 创建设备与实时采集关系表(一对多)
export function createEquipmentPlcConnect(data) {
return request({
url: '/base/equipment-plc-connect/create',
method: 'post',
data: data
})
}
// 更新设备与实时采集关系表(一对多)
export function updateEquipmentPlcConnect(data) {
return request({
url: '/base/equipment-plc-connect/update',
method: 'put',
data: data
})
}
// 删除设备与实时采集关系表(一对多)
export function deleteEquipmentPlcConnect(id) {
return request({
url: '/base/equipment-plc-connect/delete?id=' + id,
method: 'delete'
})
}
// 获得设备与实时采集关系表(一对多)
export function getEquipmentPlcConnect(id) {
return request({
url: '/base/equipment-plc-connect/get?id=' + id,
method: 'get'
})
}
// 获得设备与实时采集关系表(一对多)分页
export function getEquipmentPlcConnectPage(query) {
return request({
url: '/base/equipment-plc-connect/page',
method: 'get',
params: query
})
}
// 导出设备与实时采集关系表(一对多) Excel
export function exportEquipmentPlcConnectExcel(query) {
return request({
url: '/base/equipment-plc-connect/export-excel',
method: 'get',
params: query,
responseType: 'blob'
})
}

View File

@ -0,0 +1,54 @@
import request from '@/utils/request'
// 创建设备数采详情
export function createEquipmentPlcParam(data) {
return request({
url: '/base/equipment-plc-param/create',
method: 'post',
data: data
})
}
// 更新设备数采详情
export function updateEquipmentPlcParam(data) {
return request({
url: '/base/equipment-plc-param/update',
method: 'put',
data: data
})
}
// 删除设备数采详情
export function deleteEquipmentPlcParam(id) {
return request({
url: '/base/equipment-plc-param/delete?id=' + id,
method: 'delete'
})
}
// 获得设备数采详情
export function getEquipmentPlcParam(id) {
return request({
url: '/base/equipment-plc-param/get?id=' + id,
method: 'get'
})
}
// 获得设备数采详情分页
export function getEquipmentPlcParamPage(query) {
return request({
url: '/base/equipment-plc-param/page',
method: 'get',
params: query
})
}
// 导出设备数采详情 Excel
export function exportEquipmentPlcParamExcel(query) {
return request({
url: '/base/equipment-plc-param/export-excel',
method: 'get',
params: query,
responseType: 'blob'
})
}

View File

@ -0,0 +1,54 @@
import request from '@/utils/request'
// 创建后端用 设备生产数量统计表(按一定时间段写入)
export function createEquipmentQuantityLog(data) {
return request({
url: '/base/equipment-quantity-log/create',
method: 'post',
data: data
})
}
// 更新后端用 设备生产数量统计表(按一定时间段写入)
export function updateEquipmentQuantityLog(data) {
return request({
url: '/base/equipment-quantity-log/update',
method: 'put',
data: data
})
}
// 删除后端用 设备生产数量统计表(按一定时间段写入)
export function deleteEquipmentQuantityLog(id) {
return request({
url: '/base/equipment-quantity-log/delete?id=' + id,
method: 'delete'
})
}
// 获得后端用 设备生产数量统计表(按一定时间段写入)
export function getEquipmentQuantityLog(id) {
return request({
url: '/base/equipment-quantity-log/get?id=' + id,
method: 'get'
})
}
// 获得后端用 设备生产数量统计表(按一定时间段写入)分页
export function getEquipmentQuantityLogPage(query) {
return request({
url: '/base/equipment-quantity-log/page',
method: 'get',
params: query
})
}
// 导出后端用 设备生产数量统计表(按一定时间段写入) Excel
export function exportEquipmentQuantityLogExcel(query) {
return request({
url: '/base/equipment-quantity-log/export-excel',
method: 'get',
params: query,
responseType: 'blob'
})
}

View File

@ -0,0 +1,54 @@
import request from '@/utils/request'
// 创建后端用 设备生产数量实时
export function createEquipmentQuantityRealtime(data) {
return request({
url: '/base/equipment-quantity-realtime/create',
method: 'post',
data: data
})
}
// 更新后端用 设备生产数量实时
export function updateEquipmentQuantityRealtime(data) {
return request({
url: '/base/equipment-quantity-realtime/update',
method: 'put',
data: data
})
}
// 删除后端用 设备生产数量实时
export function deleteEquipmentQuantityRealtime(id) {
return request({
url: '/base/equipment-quantity-realtime/delete?id=' + id,
method: 'delete'
})
}
// 获得后端用 设备生产数量实时
export function getEquipmentQuantityRealtime(id) {
return request({
url: '/base/equipment-quantity-realtime/get?id=' + id,
method: 'get'
})
}
// 获得后端用 设备生产数量实时分页
export function getEquipmentQuantityRealtimePage(query) {
return request({
url: '/base/equipment-quantity-realtime/page',
method: 'get',
params: query
})
}
// 导出后端用 设备生产数量实时 Excel
export function exportEquipmentQuantityRealtimeExcel(query) {
return request({
url: '/base/equipment-quantity-realtime/export-excel',
method: 'get',
params: query,
responseType: 'blob'
})
}

View File

@ -0,0 +1,54 @@
import request from '@/utils/request'
// 创建后端用 设备工作状态
export function createEquipmentStatusLog(data) {
return request({
url: '/base/equipment-status-log/create',
method: 'post',
data: data
})
}
// 更新后端用 设备工作状态
export function updateEquipmentStatusLog(data) {
return request({
url: '/base/equipment-status-log/update',
method: 'put',
data: data
})
}
// 删除后端用 设备工作状态
export function deleteEquipmentStatusLog(id) {
return request({
url: '/base/equipment-status-log/delete?id=' + id,
method: 'delete'
})
}
// 获得后端用 设备工作状态
export function getEquipmentStatusLog(id) {
return request({
url: '/base/equipment-status-log/get?id=' + id,
method: 'get'
})
}
// 获得后端用 设备工作状态分页
export function getEquipmentStatusLogPage(query) {
return request({
url: '/base/equipment-status-log/page',
method: 'get',
params: query
})
}
// 导出后端用 设备工作状态 Excel
export function exportEquipmentStatusLogExcel(query) {
return request({
url: '/base/equipment-status-log/export-excel',
method: 'get',
params: query,
responseType: 'blob'
})
}

View File

@ -0,0 +1,54 @@
import request from '@/utils/request'
// 创建后端用 设备状态实时
export function createEquipmentStatusRealtime(data) {
return request({
url: '/base/equipment-status-realtime/create',
method: 'post',
data: data
})
}
// 更新后端用 设备状态实时
export function updateEquipmentStatusRealtime(data) {
return request({
url: '/base/equipment-status-realtime/update',
method: 'put',
data: data
})
}
// 删除后端用 设备状态实时
export function deleteEquipmentStatusRealtime(id) {
return request({
url: '/base/equipment-status-realtime/delete?id=' + id,
method: 'delete'
})
}
// 获得后端用 设备状态实时
export function getEquipmentStatusRealtime(id) {
return request({
url: '/base/equipment-status-realtime/get?id=' + id,
method: 'get'
})
}
// 获得后端用 设备状态实时分页
export function getEquipmentStatusRealtimePage(query) {
return request({
url: '/base/equipment-status-realtime/page',
method: 'get',
params: query
})
}
// 导出后端用 设备状态实时 Excel
export function exportEquipmentStatusRealtimeExcel(query) {
return request({
url: '/base/equipment-status-realtime/export-excel',
method: 'get',
params: query,
responseType: 'blob'
})
}

View File

@ -0,0 +1,54 @@
import request from '@/utils/request'
// 创建设备类型
export function createEquipmentType(data) {
return request({
url: '/base/equipment-type/create',
method: 'post',
data: data
})
}
// 更新设备类型
export function updateEquipmentType(data) {
return request({
url: '/base/equipment-type/update',
method: 'put',
data: data
})
}
// 删除设备类型
export function deleteEquipmentType(id) {
return request({
url: '/base/equipment-type/delete?id=' + id,
method: 'delete'
})
}
// 获得设备类型
export function getEquipmentType(id) {
return request({
url: '/base/equipment-type/get?id=' + id,
method: 'get'
})
}
// 获得设备类型分页
export function getEquipmentTypePage(query) {
return request({
url: '/base/equipment-type/page',
method: 'get',
params: query
})
}
// 导出设备类型 Excel
export function exportEquipmentTypeExcel(query) {
return request({
url: '/base/equipment-type/export-excel',
method: 'get',
params: query,
responseType: 'blob'
})
}

View File

@ -0,0 +1,54 @@
import request from '@/utils/request'
// 创建设备类型文件关联
export function createEquipmentTypeFile(data) {
return request({
url: '/base/equipment-type-file/create',
method: 'post',
data: data
})
}
// 更新设备类型文件关联
export function updateEquipmentTypeFile(data) {
return request({
url: '/base/equipment-type-file/update',
method: 'put',
data: data
})
}
// 删除设备类型文件关联
export function deleteEquipmentTypeFile(id) {
return request({
url: '/base/equipment-type-file/delete?id=' + id,
method: 'delete'
})
}
// 获得设备类型文件关联
export function getEquipmentTypeFile(id) {
return request({
url: '/base/equipment-type-file/get?id=' + id,
method: 'get'
})
}
// 获得设备类型文件关联分页
export function getEquipmentTypeFilePage(query) {
return request({
url: '/base/equipment-type-file/page',
method: 'get',
params: query
})
}
// 导出设备类型文件关联 Excel
export function exportEquipmentTypeFileExcel(query) {
return request({
url: '/base/equipment-type-file/export-excel',
method: 'get',
params: query,
responseType: 'blob'
})
}

View File

@ -0,0 +1,279 @@
<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="code">
<el-input v-model="queryParams.code" placeholder="请输入编码" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="设备名称" prop="name">
<el-input v-model="queryParams.name" placeholder="请输入设备名称" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="创建时间" prop="createTime">
<el-date-picker v-model="queryParams.createTime" style="width: 240px" value-format="yyyy-MM-dd HH:mm:ss" type="daterange"
range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" :default-time="['00:00:00', '23:59:59']" />
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" @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="['base:equipment:create']">新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" :loading="exportLoading"
v-hasPermi="['base:equipment:export']">导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<!-- 列表 -->
<el-table v-loading="loading" :data="list">
<el-table-column label="id" align="center" prop="id" />
<el-table-column label="编码" align="center" prop="code" />
<el-table-column label="设备名称" align="center" prop="name" />
<el-table-column label="英文名称" align="center" prop="enName" />
<el-table-column label="缩写" align="center" prop="abbr" />
<el-table-column label="设备类型,关联设备类型表" align="center" prop="equipmentTypeId" />
<el-table-column label="分组id (关联 base_equipment_GROUP" align="center" prop="groupId" />
<el-table-column label="备注" align="center" prop="remark" />
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
<template v-slot="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template v-slot="scope">
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
v-hasPermi="['base:equipment:update']">修改</el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
v-hasPermi="['base:equipment:delete']">删除</el-button>
</template>
</el-table-column>
</el-table>
<!-- 分页组件 -->
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
@pagination="getList"/>
<!-- 对话框(添加 / 修改) -->
<el-dialog :title="title" :visible.sync="open" width="500px" v-dialogDrag append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="编码" prop="code">
<el-input v-model="form.code" placeholder="请输入编码" />
</el-form-item>
<el-form-item label="设备名称" prop="name">
<el-input v-model="form.name" placeholder="请输入设备名称" />
</el-form-item>
<el-form-item label="英文名称" prop="enName">
<el-input v-model="form.enName" placeholder="请输入英文名称" />
</el-form-item>
<el-form-item label="缩写" prop="abbr">
<el-input v-model="form.abbr" placeholder="请输入缩写" />
</el-form-item>
<el-form-item label="进厂日期" prop="enterTime">
<el-date-picker clearable v-model="form.enterTime" type="date" value-format="timestamp" placeholder="选择进厂日期" />
</el-form-item>
<el-form-item label="生产日期" prop="productionTime">
<el-date-picker clearable v-model="form.productionTime" type="date" value-format="timestamp" placeholder="选择生产日期" />
</el-form-item>
<el-form-item label="设备类型,关联设备类型表" prop="equipmentTypeId">
<el-select v-model="form.equipmentTypeId" placeholder="请选择设备类型,关联设备类型表">
<el-option label="请选择字典生成" value="" />
</el-select>
</el-form-item>
<el-form-item label="分组id (关联 base_equipment_GROUP" prop="groupId">
<el-select v-model="form.groupId" placeholder="请选择分组id (关联 base_equipment_GROUP">
<el-option label="请选择字典生成" value="" />
</el-select>
</el-form-item>
<el-form-item label="每小时生产数量" prop="tvalue">
<el-input v-model="form.tvalue" placeholder="请输入每小时生产数量" />
</el-form-item>
<el-form-item label="单件加工时间 s/件" prop="processingTime">
<el-input v-model="form.processingTime" placeholder="请输入单件加工时间 s/件" />
</el-form-item>
<el-form-item label="制造商" prop="manufacturer">
<el-input v-model="form.manufacturer" placeholder="请输入制造商" />
</el-form-item>
<el-form-item label="规格" prop="spec">
<el-input v-model="form.spec" placeholder="请输入规格" />
</el-form-item>
<el-form-item label="功能描述">
<editor v-model="form.description" :min-height="192"/>
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" 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 { createEquipment, updateEquipment, deleteEquipment, getEquipment, getEquipmentPage, exportEquipmentExcel } from "@/api/base/equipment";
import Editor from '@/components/Editor';
export default {
name: "Equipment",
components: {
Editor
},
data() {
return {
//
loading: true,
//
exportLoading: false,
//
showSearch: true,
//
total: 0,
//
list: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNo: 1,
pageSize: 10,
code: null,
name: null,
createTime: [],
},
//
form: {},
//
rules: {
code: [{ required: true, message: "编码不能为空", trigger: "blur" }],
name: [{ required: true, message: "设备名称不能为空", trigger: "blur" }],
groupId: [{ required: true, message: "分组id (关联 base_equipment_GROUP不能为空", trigger: "change" }],
}
};
},
created() {
this.getList();
},
methods: {
/** 查询列表 */
getList() {
this.loading = true;
//
getEquipmentPage(this.queryParams).then(response => {
this.list = response.data.list;
this.total = response.data.total;
this.loading = false;
});
},
/** 取消按钮 */
cancel() {
this.open = false;
this.reset();
},
/** 表单重置 */
reset() {
this.form = {
id: undefined,
code: undefined,
name: undefined,
enName: undefined,
abbr: undefined,
enterTime: undefined,
productionTime: undefined,
equipmentTypeId: undefined,
groupId: undefined,
tvalue: undefined,
processingTime: undefined,
manufacturer: undefined,
spec: undefined,
description: undefined,
remark: undefined,
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNo = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加设备";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id;
getEquipment(id).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改设备";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (!valid) {
return;
}
//
if (this.form.id != null) {
updateEquipment(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
return;
}
//
createEquipment(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
});
},
/** 删除按钮操作 */
handleDelete(row) {
const id = row.id;
this.$modal.confirm('是否确认删除设备编号为"' + id + '"的数据项?').then(function() {
return deleteEquipment(id);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
//
let params = {...this.queryParams};
params.pageNo = undefined;
params.pageSize = undefined;
this.$modal.confirm('是否确认导出所有设备数据项?').then(() => {
this.exportLoading = true;
return exportEquipmentExcel(params);
}).then(response => {
this.$download.excel(response, '设备.xls');
this.exportLoading = false;
}).catch(() => {});
}
}
};
</script>

View File

@ -0,0 +1,214 @@
<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="设备id" prop="equipmentId">
<el-input v-model="queryParams.equipmentId" placeholder="请输入设备id" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" @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="['base:equipment-attr:create']">新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" :loading="exportLoading"
v-hasPermi="['base:equipment-attr:export']">导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<!-- 列表 -->
<el-table v-loading="loading" :data="list">
<el-table-column label="ID" align="center" prop="id" />
<el-table-column label="设备id" align="center" prop="equipmentId" />
<el-table-column label="属性名称" align="center" prop="name" />
<el-table-column label="属性值" align="center" prop="value" />
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
<template v-slot="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template v-slot="scope">
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
v-hasPermi="['base:equipment-attr:update']">修改</el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
v-hasPermi="['base:equipment-attr:delete']">删除</el-button>
</template>
</el-table-column>
</el-table>
<!-- 分页组件 -->
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
@pagination="getList"/>
<!-- 对话框(添加 / 修改) -->
<el-dialog :title="title" :visible.sync="open" width="500px" v-dialogDrag append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="设备id" prop="equipmentId">
<el-input v-model="form.equipmentId" placeholder="请输入设备id" />
</el-form-item>
<el-form-item label="属性名称" prop="name">
<el-input v-model="form.name" placeholder="请输入属性名称" />
</el-form-item>
<el-form-item label="属性值" prop="value">
<el-input v-model="form.value" 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 { createEquipmentAttr, updateEquipmentAttr, deleteEquipmentAttr, getEquipmentAttr, getEquipmentAttrPage, exportEquipmentAttrExcel } from "@/api/base/equipmentAttr";
export default {
name: "EquipmentAttr",
components: {
},
data() {
return {
//
loading: true,
//
exportLoading: false,
//
showSearch: true,
//
total: 0,
//
list: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNo: 1,
pageSize: 10,
equipmentId: null,
},
//
form: {},
//
rules: {
equipmentId: [{ required: true, message: "设备id不能为空", trigger: "blur" }],
}
};
},
created() {
this.getList();
},
methods: {
/** 查询列表 */
getList() {
this.loading = true;
//
getEquipmentAttrPage(this.queryParams).then(response => {
this.list = response.data.list;
this.total = response.data.total;
this.loading = false;
});
},
/** 取消按钮 */
cancel() {
this.open = false;
this.reset();
},
/** 表单重置 */
reset() {
this.form = {
id: undefined,
equipmentId: undefined,
name: undefined,
value: undefined,
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNo = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加设备属性";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id;
getEquipmentAttr(id).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改设备属性";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (!valid) {
return;
}
//
if (this.form.id != null) {
updateEquipmentAttr(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
return;
}
//
createEquipmentAttr(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
});
},
/** 删除按钮操作 */
handleDelete(row) {
const id = row.id;
this.$modal.confirm('是否确认删除设备属性编号为"' + id + '"的数据项?').then(function() {
return deleteEquipmentAttr(id);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
//
let params = {...this.queryParams};
params.pageNo = undefined;
params.pageSize = undefined;
this.$modal.confirm('是否确认导出所有设备属性数据项?').then(() => {
this.exportLoading = true;
return exportEquipmentAttrExcel(params);
}).then(response => {
this.$download.excel(response, '设备属性.xls');
this.exportLoading = false;
}).catch(() => {});
}
}
};
</script>

View File

@ -0,0 +1,253 @@
<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="工段ID" prop="workshopSectionId">
<el-input v-model="queryParams.workshopSectionId" placeholder="请输入工段ID" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="设备ID" prop="equipmentId">
<el-input v-model="queryParams.equipmentId" placeholder="请输入设备ID" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" @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="['base:equipment-bind-section:create']">新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" :loading="exportLoading"
v-hasPermi="['base:equipment-bind-section:export']">导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<!-- 列表 -->
<el-table v-loading="loading" :data="list">
<el-table-column label="ID" align="center" prop="id" />
<el-table-column label="工段ID" align="center" prop="workshopSectionId" />
<el-table-column label="设备ID" align="center" prop="equipmentId" />
<el-table-column label="排序" align="center" prop="sort" />
<el-table-column label="产线数据类型 0.无类型 1.进口计数 2.出口计数" align="center" prop="lineDataType">
<template v-slot="scope">
<dict-tag :type="DICT_TYPE.EQU_DATA_TYPE" :value="scope.row.lineDataType" />
</template>
</el-table-column>
<el-table-column label="工段数据类型 0.无类型 1.进口计数 2.出口计数" align="center" prop="sectionDataType">
<template v-slot="scope">
<dict-tag :type="DICT_TYPE.EQU_DATA_TYPE" :value="scope.row.sectionDataType" />
</template>
</el-table-column>
<el-table-column label="备注" align="center" prop="remark" />
<el-table-column label="版本号" align="center" prop="version" />
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
<template v-slot="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template v-slot="scope">
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
v-hasPermi="['base:equipment-bind-section:update']">修改</el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
v-hasPermi="['base:equipment-bind-section:delete']">删除</el-button>
</template>
</el-table-column>
</el-table>
<!-- 分页组件 -->
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
@pagination="getList"/>
<!-- 对话框(添加 / 修改) -->
<el-dialog :title="title" :visible.sync="open" width="500px" v-dialogDrag append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="工段ID" prop="workshopSectionId">
<el-input v-model="form.workshopSectionId" placeholder="请输入工段ID" />
</el-form-item>
<el-form-item label="设备ID" prop="equipmentId">
<el-input v-model="form.equipmentId" placeholder="请输入设备ID" />
</el-form-item>
<el-form-item label="排序" prop="sort">
<el-input v-model="form.sort" placeholder="请输入排序" />
</el-form-item>
<el-form-item label="产线数据类型 0.无类型 1.进口计数 2.出口计数" prop="lineDataType">
<el-select v-model="form.lineDataType" placeholder="请选择产线数据类型 0.无类型 1.进口计数 2.出口计数">
<el-option v-for="dict in this.getDictDatas(DICT_TYPE.EQU_DATA_TYPE)"
:key="dict.value" :label="dict.label" :value="dict.value" />
</el-select>
</el-form-item>
<el-form-item label="工段数据类型 0.无类型 1.进口计数 2.出口计数" prop="sectionDataType">
<el-select v-model="form.sectionDataType" placeholder="请选择工段数据类型 0.无类型 1.进口计数 2.出口计数">
<el-option v-for="dict in this.getDictDatas(DICT_TYPE.EQU_DATA_TYPE)"
:key="dict.value" :label="dict.label" :value="dict.value" />
</el-select>
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" placeholder="请输入备注" />
</el-form-item>
<el-form-item label="版本号" prop="version">
<el-input v-model="form.version" 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 { createEquipmentBindSection, updateEquipmentBindSection, deleteEquipmentBindSection, getEquipmentBindSection, getEquipmentBindSectionPage, exportEquipmentBindSectionExcel } from "@/api/base/equipmentBindSection";
export default {
name: "EquipmentBindSection",
components: {
},
data() {
return {
//
loading: true,
//
exportLoading: false,
//
showSearch: true,
//
total: 0,
//
list: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNo: 1,
pageSize: 10,
workshopSectionId: null,
equipmentId: null,
},
//
form: {},
//
rules: {
workshopSectionId: [{ required: true, message: "工段ID不能为空", trigger: "blur" }],
equipmentId: [{ required: true, message: "设备ID不能为空", trigger: "blur" }],
}
};
},
created() {
this.getList();
},
methods: {
/** 查询列表 */
getList() {
this.loading = true;
//
getEquipmentBindSectionPage(this.queryParams).then(response => {
this.list = response.data.list;
this.total = response.data.total;
this.loading = false;
});
},
/** 取消按钮 */
cancel() {
this.open = false;
this.reset();
},
/** 表单重置 */
reset() {
this.form = {
id: undefined,
workshopSectionId: undefined,
equipmentId: undefined,
sort: undefined,
lineDataType: undefined,
sectionDataType: undefined,
remark: undefined,
version: undefined,
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNo = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加工段设备绑定";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id;
getEquipmentBindSection(id).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改工段设备绑定";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (!valid) {
return;
}
//
if (this.form.id != null) {
updateEquipmentBindSection(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
return;
}
//
createEquipmentBindSection(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
});
},
/** 删除按钮操作 */
handleDelete(row) {
const id = row.id;
this.$modal.confirm('是否确认删除工段设备绑定编号为"' + id + '"的数据项?').then(function() {
return deleteEquipmentBindSection(id);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
//
let params = {...this.queryParams};
params.pageNo = undefined;
params.pageSize = undefined;
this.$modal.confirm('是否确认导出所有工段设备绑定数据项?').then(() => {
this.exportLoading = true;
return exportEquipmentBindSectionExcel(params);
}).then(response => {
this.$download.excel(response, '工段设备绑定.xls');
this.exportLoading = false;
}).catch(() => {});
}
}
};
</script>

View File

@ -0,0 +1,225 @@
<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="设备ID" prop="equipmentId">
<el-input v-model="queryParams.equipmentId" placeholder="请输入设备ID" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" @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="['base:equipment-file:create']">新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" :loading="exportLoading"
v-hasPermi="['base:equipment-file:export']">导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<!-- 列表 -->
<el-table v-loading="loading" :data="list">
<el-table-column label="id" align="center" prop="id" />
<el-table-column label="设备ID" align="center" prop="equipmentId" />
<el-table-column label="文件类型 1.图片 2.设备资料" align="center" prop="fileType">
<template v-slot="scope">
<dict-tag :type="DICT_TYPE.EQU_FILE_TYPE" :value="scope.row.fileType" />
</template>
</el-table-column>
<el-table-column label="原始文件名" align="center" prop="fileName" />
<el-table-column label="文件url" align="center" prop="fileUrl" />
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
<template v-slot="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template v-slot="scope">
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
v-hasPermi="['base:equipment-file:update']">修改</el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
v-hasPermi="['base:equipment-file:delete']">删除</el-button>
</template>
</el-table-column>
</el-table>
<!-- 分页组件 -->
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
@pagination="getList"/>
<!-- 对话框(添加 / 修改) -->
<el-dialog :title="title" :visible.sync="open" width="500px" v-dialogDrag append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="设备ID" prop="equipmentId">
<el-input v-model="form.equipmentId" placeholder="请输入设备ID" />
</el-form-item>
<el-form-item label="文件类型 1.图片 2.设备资料" prop="fileType">
<el-select v-model="form.fileType" placeholder="请选择文件类型 1.图片 2.设备资料">
<el-option v-for="dict in this.getDictDatas(DICT_TYPE.EQU_FILE_TYPE)"
:key="dict.value" :label="dict.label" :value="dict.value" />
</el-select>
</el-form-item>
<el-form-item label="原始文件名" prop="fileName">
<el-input v-model="form.fileName" placeholder="请输入原始文件名" />
</el-form-item>
<el-form-item label="文件url" prop="fileUrl">
<el-input v-model="form.fileUrl" placeholder="请输入文件url" />
</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 { createEquipmentFile, updateEquipmentFile, deleteEquipmentFile, getEquipmentFile, getEquipmentFilePage, exportEquipmentFileExcel } from "@/api/base/equipmentFile";
export default {
name: "EquipmentFile",
components: {
},
data() {
return {
//
loading: true,
//
exportLoading: false,
//
showSearch: true,
//
total: 0,
//
list: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNo: 1,
pageSize: 10,
equipmentId: null,
},
//
form: {},
//
rules: {
}
};
},
created() {
this.getList();
},
methods: {
/** 查询列表 */
getList() {
this.loading = true;
//
getEquipmentFilePage(this.queryParams).then(response => {
this.list = response.data.list;
this.total = response.data.total;
this.loading = false;
});
},
/** 取消按钮 */
cancel() {
this.open = false;
this.reset();
},
/** 表单重置 */
reset() {
this.form = {
id: undefined,
equipmentId: undefined,
fileType: undefined,
fileName: undefined,
fileUrl: undefined,
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNo = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加设备文件对应";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id;
getEquipmentFile(id).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改设备文件对应";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (!valid) {
return;
}
//
if (this.form.id != null) {
updateEquipmentFile(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
return;
}
//
createEquipmentFile(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
});
},
/** 删除按钮操作 */
handleDelete(row) {
const id = row.id;
this.$modal.confirm('是否确认删除设备文件对应编号为"' + id + '"的数据项?').then(function() {
return deleteEquipmentFile(id);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
//
let params = {...this.queryParams};
params.pageNo = undefined;
params.pageSize = undefined;
this.$modal.confirm('是否确认导出所有设备文件对应数据项?').then(() => {
this.exportLoading = true;
return exportEquipmentFileExcel(params);
}).then(response => {
this.$download.excel(response, '设备文件对应.xls');
this.exportLoading = false;
}).catch(() => {});
}
}
};
</script>

View File

@ -0,0 +1,217 @@
<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="code">
<el-input v-model="queryParams.code" placeholder="请输入分组编码" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="分组名字" prop="name">
<el-input v-model="queryParams.name" placeholder="请输入分组名字" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" @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="['base:equipment-group:create']">新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" :loading="exportLoading"
v-hasPermi="['base:equipment-group:export']">导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<!-- 列表 -->
<el-table v-loading="loading" :data="list">
<el-table-column label="ID" align="center" prop="id" />
<el-table-column label="分组编码" align="center" prop="code" />
<el-table-column label="分组名字" align="center" prop="name" />
<el-table-column label="备注" align="center" prop="remark" />
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
<template v-slot="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template v-slot="scope">
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
v-hasPermi="['base:equipment-group:update']">修改</el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
v-hasPermi="['base:equipment-group:delete']">删除</el-button>
</template>
</el-table-column>
</el-table>
<!-- 分页组件 -->
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
@pagination="getList"/>
<!-- 对话框(添加 / 修改) -->
<el-dialog :title="title" :visible.sync="open" width="500px" v-dialogDrag append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="分组编码" prop="code">
<el-input v-model="form.code" placeholder="请输入分组编码" />
</el-form-item>
<el-form-item label="分组名字" prop="name">
<el-input v-model="form.name" placeholder="请输入分组名字" />
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" 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 { createEquipmentGroup, updateEquipmentGroup, deleteEquipmentGroup, getEquipmentGroup, getEquipmentGroupPage, exportEquipmentGroupExcel } from "@/api/base/equipmentGroup";
export default {
name: "EquipmentGroup",
components: {
},
data() {
return {
//
loading: true,
//
exportLoading: false,
//
showSearch: true,
//
total: 0,
//
list: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNo: 1,
pageSize: 10,
code: null,
name: null,
},
//
form: {},
//
rules: {
}
};
},
created() {
this.getList();
},
methods: {
/** 查询列表 */
getList() {
this.loading = true;
//
getEquipmentGroupPage(this.queryParams).then(response => {
this.list = response.data.list;
this.total = response.data.total;
this.loading = false;
});
},
/** 取消按钮 */
cancel() {
this.open = false;
this.reset();
},
/** 表单重置 */
reset() {
this.form = {
id: undefined,
code: undefined,
name: undefined,
remark: undefined,
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNo = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加设备分组(用于同类型不同厂家的设备区分)";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id;
getEquipmentGroup(id).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改设备分组(用于同类型不同厂家的设备区分)";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (!valid) {
return;
}
//
if (this.form.id != null) {
updateEquipmentGroup(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
return;
}
//
createEquipmentGroup(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
});
},
/** 删除按钮操作 */
handleDelete(row) {
const id = row.id;
this.$modal.confirm('是否确认删除设备分组(用于同类型不同厂家的设备区分)编号为"' + id + '"的数据项?').then(function() {
return deleteEquipmentGroup(id);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
//
let params = {...this.queryParams};
params.pageNo = undefined;
params.pageSize = undefined;
this.$modal.confirm('是否确认导出所有设备分组(用于同类型不同厂家的设备区分)数据项?').then(() => {
this.exportLoading = true;
return exportEquipmentGroupExcel(params);
}).then(response => {
this.$download.excel(response, '设备分组(用于同类型不同厂家的设备区分).xls');
this.exportLoading = false;
}).catch(() => {});
}
}
};
</script>

View File

@ -0,0 +1,246 @@
<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="设备分组ID关联base_equipment_group" prop="equipmentGroupId">
<el-input v-model="queryParams.equipmentGroupId" placeholder="请输入设备分组ID关联base_equipment_group" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" @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="['base:equipment-group-alarm:create']">新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" :loading="exportLoading"
v-hasPermi="['base:equipment-group-alarm:export']">导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<!-- 列表 -->
<el-table v-loading="loading" :data="list">
<el-table-column label="ID" align="center" prop="id" />
<el-table-column label="设备分组ID关联base_equipment_group" align="center" prop="equipmentGroupId" />
<el-table-column label="编码" align="center" prop="code" />
<el-table-column label="报警类型:1.字符型2.布尔型" align="center" prop="type" />
<el-table-column label="报警级别 字典表关联label_value" align="center" prop="grade">
<template v-slot="scope">
<dict-tag :type="DICT_TYPE.EQU_ALARM_LEVEL" :value="scope.row.grade" />
</template>
</el-table-column>
<el-table-column label="字符型用 对应到设备实际的报警编码 布尔型不用填写" align="center" prop="alarmCode" />
<el-table-column label="报警内容 该条报警具体的解释" align="center" prop="alarmContent" />
<el-table-column label="关联编码对应到plc_param_name的编码用于链接数采" align="center" prop="plcParamName" />
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
<template v-slot="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template v-slot="scope">
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
v-hasPermi="['base:equipment-group-alarm:update']">修改</el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
v-hasPermi="['base:equipment-group-alarm:delete']">删除</el-button>
</template>
</el-table-column>
</el-table>
<!-- 分页组件 -->
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
@pagination="getList"/>
<!-- 对话框(添加 / 修改) -->
<el-dialog :title="title" :visible.sync="open" width="500px" v-dialogDrag append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="设备分组ID关联base_equipment_group" prop="equipmentGroupId">
<el-input v-model="form.equipmentGroupId" placeholder="请输入设备分组ID关联base_equipment_group" />
</el-form-item>
<el-form-item label="编码" prop="code">
<el-input v-model="form.code" placeholder="请输入编码" />
</el-form-item>
<el-form-item label="报警类型:1.字符型2.布尔型" prop="type">
<el-select v-model="form.type" placeholder="请选择报警类型:1.字符型2.布尔型">
<el-option label="请选择字典生成" value="" />
</el-select>
</el-form-item>
<el-form-item label="报警级别 字典表关联label_value" prop="grade">
<el-select v-model="form.grade" placeholder="请选择报警级别 字典表关联label_value">
<el-option v-for="dict in this.getDictDatas(DICT_TYPE.EQU_ALARM_LEVEL)"
:key="dict.value" :label="dict.label" :value="dict.value" />
</el-select>
</el-form-item>
<el-form-item label="字符型用 对应到设备实际的报警编码 布尔型不用填写" prop="alarmCode">
<el-input v-model="form.alarmCode" placeholder="请输入字符型用 对应到设备实际的报警编码 布尔型不用填写" />
</el-form-item>
<el-form-item label="报警内容 该条报警具体的解释" prop="alarmContent">
<el-input v-model="form.alarmContent" placeholder="请输入报警内容 该条报警具体的解释" />
</el-form-item>
<el-form-item label="关联编码对应到plc_param_name的编码用于链接数采" prop="plcParamName">
<el-input v-model="form.plcParamName" placeholder="请输入关联编码对应到plc_param_name的编码用于链接数采" />
</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 { createEquipmentGroupAlarm, updateEquipmentGroupAlarm, deleteEquipmentGroupAlarm, getEquipmentGroupAlarm, getEquipmentGroupAlarmPage, exportEquipmentGroupAlarmExcel } from "@/api/base/equipmentGroupAlarm";
export default {
name: "EquipmentGroupAlarm",
components: {
},
data() {
return {
//
loading: true,
//
exportLoading: false,
//
showSearch: true,
//
total: 0,
//
list: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNo: 1,
pageSize: 10,
equipmentGroupId: null,
},
//
form: {},
//
rules: {
equipmentGroupId: [{ required: true, message: "设备分组ID关联base_equipment_group不能为空", trigger: "blur" }],
type: [{ required: true, message: "报警类型:1.字符型2.布尔型不能为空", trigger: "change" }],
alarmContent: [{ required: true, message: "报警内容 该条报警具体的解释不能为空", trigger: "blur" }],
plcParamName: [{ required: true, message: "关联编码对应到plc_param_name的编码用于链接数采不能为空", trigger: "blur" }],
}
};
},
created() {
this.getList();
},
methods: {
/** 查询列表 */
getList() {
this.loading = true;
//
getEquipmentGroupAlarmPage(this.queryParams).then(response => {
this.list = response.data.list;
this.total = response.data.total;
this.loading = false;
});
},
/** 取消按钮 */
cancel() {
this.open = false;
this.reset();
},
/** 表单重置 */
reset() {
this.form = {
id: undefined,
equipmentGroupId: undefined,
code: undefined,
type: undefined,
grade: undefined,
alarmCode: undefined,
alarmContent: undefined,
plcParamName: undefined,
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNo = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加设备分组报警明细";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id;
getEquipmentGroupAlarm(id).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改设备分组报警明细";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (!valid) {
return;
}
//
if (this.form.id != null) {
updateEquipmentGroupAlarm(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
return;
}
//
createEquipmentGroupAlarm(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
});
},
/** 删除按钮操作 */
handleDelete(row) {
const id = row.id;
this.$modal.confirm('是否确认删除设备分组报警明细编号为"' + id + '"的数据项?').then(function() {
return deleteEquipmentGroupAlarm(id);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
//
let params = {...this.queryParams};
params.pageNo = undefined;
params.pageSize = undefined;
this.$modal.confirm('是否确认导出所有设备分组报警明细数据项?').then(() => {
this.exportLoading = true;
return exportEquipmentGroupAlarmExcel(params);
}).then(response => {
this.$download.excel(response, '设备分组报警明细.xls');
this.exportLoading = false;
}).catch(() => {});
}
}
};
</script>

View File

@ -0,0 +1,233 @@
<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="plcTableName">
<el-input v-model="queryParams.plcTableName" placeholder="请输入实时关联表实际名称" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="标识名称" prop="name">
<el-input v-model="queryParams.name" placeholder="请输入标识名称" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" @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="['base:equipment-plc:create']">新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" :loading="exportLoading"
v-hasPermi="['base:equipment-plc:export']">导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<!-- 列表 -->
<el-table v-loading="loading" :data="list">
<el-table-column label="id" align="center" prop="id" />
<el-table-column label="实时关联表实际名称" align="center" prop="plcTableName" />
<el-table-column label="关联表编码" align="center" prop="code" />
<el-table-column label="标识名称" align="center" prop="name" />
<el-table-column label="英文标识名称" align="center" prop="enName" />
<el-table-column label="描述" align="center" prop="description" />
<el-table-column label="是否采集 0 代表不采集, 1 代表采集" align="center" prop="collection" />
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
<template v-slot="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template v-slot="scope">
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
v-hasPermi="['base:equipment-plc:update']">修改</el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
v-hasPermi="['base:equipment-plc:delete']">删除</el-button>
</template>
</el-table-column>
</el-table>
<!-- 分页组件 -->
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
@pagination="getList"/>
<!-- 对话框(添加 / 修改) -->
<el-dialog :title="title" :visible.sync="open" width="500px" v-dialogDrag append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="实时关联表实际名称" prop="plcTableName">
<el-input v-model="form.plcTableName" placeholder="请输入实时关联表实际名称" />
</el-form-item>
<el-form-item label="关联表编码" prop="code">
<el-input v-model="form.code" placeholder="请输入关联表编码" />
</el-form-item>
<el-form-item label="标识名称" prop="name">
<el-input v-model="form.name" placeholder="请输入标识名称" />
</el-form-item>
<el-form-item label="英文标识名称" prop="enName">
<el-input v-model="form.enName" placeholder="请输入英文标识名称" />
</el-form-item>
<el-form-item label="描述" prop="description">
<el-input v-model="form.description" placeholder="请输入描述" />
</el-form-item>
<el-form-item label="是否采集 0 代表不采集, 1 代表采集" prop="collection">
<el-input v-model="form.collection" placeholder="请输入是否采集 0 代表不采集, 1 代表采集" />
</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 { createEquipmentPlc, updateEquipmentPlc, deleteEquipmentPlc, getEquipmentPlc, getEquipmentPlcPage, exportEquipmentPlcExcel } from "@/api/base/equipmentPlc";
export default {
name: "EquipmentPlc",
components: {
},
data() {
return {
//
loading: true,
//
exportLoading: false,
//
showSearch: true,
//
total: 0,
//
list: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNo: 1,
pageSize: 10,
plcTableName: null,
name: null,
},
//
form: {},
//
rules: {
plcTableName: [{ required: true, message: "实时关联表实际名称不能为空", trigger: "blur" }],
}
};
},
created() {
this.getList();
},
methods: {
/** 查询列表 */
getList() {
this.loading = true;
//
getEquipmentPlcPage(this.queryParams).then(response => {
this.list = response.data.list;
this.total = response.data.total;
this.loading = false;
});
},
/** 取消按钮 */
cancel() {
this.open = false;
this.reset();
},
/** 表单重置 */
reset() {
this.form = {
id: undefined,
plcTableName: undefined,
code: undefined,
name: undefined,
enName: undefined,
description: undefined,
collection: undefined,
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNo = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加实时数据采集配置";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id;
getEquipmentPlc(id).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改实时数据采集配置";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (!valid) {
return;
}
//
if (this.form.id != null) {
updateEquipmentPlc(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
return;
}
//
createEquipmentPlc(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
});
},
/** 删除按钮操作 */
handleDelete(row) {
const id = row.id;
this.$modal.confirm('是否确认删除实时数据采集配置编号为"' + id + '"的数据项?').then(function() {
return deleteEquipmentPlc(id);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
//
let params = {...this.queryParams};
params.pageNo = undefined;
params.pageSize = undefined;
this.$modal.confirm('是否确认导出所有实时数据采集配置数据项?').then(() => {
this.exportLoading = true;
return exportEquipmentPlcExcel(params);
}).then(response => {
this.$download.excel(response, '实时数据采集配置.xls');
this.exportLoading = false;
}).catch(() => {});
}
}
};
</script>

View File

@ -0,0 +1,209 @@
<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="plc表iD" prop="plcId">
<el-input v-model="queryParams.plcId" placeholder="请输入plc表iD" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="设备表id" prop="equipmentId">
<el-input v-model="queryParams.equipmentId" placeholder="请输入设备表id" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" @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="['base:equipment-plc-connect:create']">新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" :loading="exportLoading"
v-hasPermi="['base:equipment-plc-connect:export']">导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<!-- 列表 -->
<el-table v-loading="loading" :data="list">
<el-table-column label="id" align="center" prop="id" />
<el-table-column label="plc表iD" align="center" prop="plcId" />
<el-table-column label="设备表id" align="center" prop="equipmentId" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template v-slot="scope">
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
v-hasPermi="['base:equipment-plc-connect:update']">修改</el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
v-hasPermi="['base:equipment-plc-connect:delete']">删除</el-button>
</template>
</el-table-column>
</el-table>
<!-- 分页组件 -->
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
@pagination="getList"/>
<!-- 对话框(添加 / 修改) -->
<el-dialog :title="title" :visible.sync="open" width="500px" v-dialogDrag append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="plc表iD" prop="plcId">
<el-input v-model="form.plcId" placeholder="请输入plc表iD" />
</el-form-item>
<el-form-item label="设备表id" prop="equipmentId">
<el-input v-model="form.equipmentId" placeholder="请输入设备表id" />
</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 { createEquipmentPlcConnect, updateEquipmentPlcConnect, deleteEquipmentPlcConnect, getEquipmentPlcConnect, getEquipmentPlcConnectPage, exportEquipmentPlcConnectExcel } from "@/api/base/equipmentPlcConnect";
export default {
name: "EquipmentPlcConnect",
components: {
},
data() {
return {
//
loading: true,
//
exportLoading: false,
//
showSearch: true,
//
total: 0,
//
list: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNo: 1,
pageSize: 10,
plcId: null,
equipmentId: null,
},
//
form: {},
//
rules: {
plcId: [{ required: true, message: "plc表iD不能为空", trigger: "blur" }],
equipmentId: [{ required: true, message: "设备表id不能为空", trigger: "blur" }],
}
};
},
created() {
this.getList();
},
methods: {
/** 查询列表 */
getList() {
this.loading = true;
//
getEquipmentPlcConnectPage(this.queryParams).then(response => {
this.list = response.data.list;
this.total = response.data.total;
this.loading = false;
});
},
/** 取消按钮 */
cancel() {
this.open = false;
this.reset();
},
/** 表单重置 */
reset() {
this.form = {
id: undefined,
plcId: undefined,
equipmentId: undefined,
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNo = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加设备与实时采集关系表(一对多)";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id;
getEquipmentPlcConnect(id).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改设备与实时采集关系表(一对多)";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (!valid) {
return;
}
//
if (this.form.id != null) {
updateEquipmentPlcConnect(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
return;
}
//
createEquipmentPlcConnect(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
});
},
/** 删除按钮操作 */
handleDelete(row) {
const id = row.id;
this.$modal.confirm('是否确认删除设备与实时采集关系表(一对多)编号为"' + id + '"的数据项?').then(function() {
return deleteEquipmentPlcConnect(id);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
//
let params = {...this.queryParams};
params.pageNo = undefined;
params.pageSize = undefined;
this.$modal.confirm('是否确认导出所有设备与实时采集关系表(一对多)数据项?').then(() => {
this.exportLoading = true;
return exportEquipmentPlcConnectExcel(params);
}).then(response => {
this.$download.excel(response, '设备与实时采集关系表(一对多).xls');
this.exportLoading = false;
}).catch(() => {});
}
}
};
</script>

View File

@ -0,0 +1,255 @@
<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="实时数采表id" prop="connectId">
<el-input v-model="queryParams.connectId" placeholder="请输入实时数采表id" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" @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="['base:equipment-plc-param:create']">新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" :loading="exportLoading"
v-hasPermi="['base:equipment-plc-param:export']">导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<!-- 列表 -->
<el-table v-loading="loading" :data="list">
<el-table-column label="ID" align="center" prop="id" />
<el-table-column label="实时数采表id" align="center" prop="connectId" />
<el-table-column label="plc实际的列名参数列名" align="center" prop="plcParamName" />
<el-table-column label="参数名称" align="center" prop="name" />
<el-table-column label="单位 关联数据字典表label_value" align="center" prop="unit">
<template v-slot="scope">
<dict-tag :type="DICT_TYPE.UNIT_DICT" :value="scope.row.unit" />
</template>
</el-table-column>
<el-table-column label="最小值 数值型可用" align="center" prop="minValue" />
<el-table-column label="最大值 数值型可用" align="center" prop="maxValue" />
<el-table-column label="参数设定标准值" align="center" prop="defaultValue" />
<el-table-column label="0 代表不采集, 1 代表采集" align="center" prop="collection" />
<el-table-column label="描述" align="center" prop="description" />
<el-table-column label="备注" align="center" prop="remark" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template v-slot="scope">
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
v-hasPermi="['base:equipment-plc-param:update']">修改</el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
v-hasPermi="['base:equipment-plc-param:delete']">删除</el-button>
</template>
</el-table-column>
</el-table>
<!-- 分页组件 -->
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
@pagination="getList"/>
<!-- 对话框(添加 / 修改) -->
<el-dialog :title="title" :visible.sync="open" width="500px" v-dialogDrag append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="实时数采表id" prop="connectId">
<el-input v-model="form.connectId" placeholder="请输入实时数采表id" />
</el-form-item>
<el-form-item label="plc实际的列名参数列名" prop="plcParamName">
<el-input v-model="form.plcParamName" placeholder="请输入plc实际的列名参数列名" />
</el-form-item>
<el-form-item label="参数名称" prop="name">
<el-input v-model="form.name" placeholder="请输入参数名称" />
</el-form-item>
<el-form-item label="单位 关联数据字典表label_value" prop="unit">
<el-select v-model="form.unit" placeholder="请选择单位 关联数据字典表label_value">
<el-option v-for="dict in this.getDictDatas(DICT_TYPE.UNIT_DICT)"
:key="dict.value" :label="dict.label" :value="dict.value" />
</el-select>
</el-form-item>
<el-form-item label="最小值 数值型可用" prop="minValue">
<el-input v-model="form.minValue" placeholder="请输入最小值 数值型可用" />
</el-form-item>
<el-form-item label="最大值 数值型可用" prop="maxValue">
<el-input v-model="form.maxValue" placeholder="请输入最大值 数值型可用" />
</el-form-item>
<el-form-item label="参数设定标准值" prop="defaultValue">
<el-input v-model="form.defaultValue" placeholder="请输入参数设定标准值" />
</el-form-item>
<el-form-item label="0 代表不采集, 1 代表采集" prop="collection">
<el-input v-model="form.collection" placeholder="请输入0 代表不采集, 1 代表采集" />
</el-form-item>
<el-form-item label="描述">
<editor v-model="form.description" :min-height="192"/>
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" 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 { createEquipmentPlcParam, updateEquipmentPlcParam, deleteEquipmentPlcParam, getEquipmentPlcParam, getEquipmentPlcParamPage, exportEquipmentPlcParamExcel } from "@/api/base/equipmentPlcParam";
import Editor from '@/components/Editor';
export default {
name: "EquipmentPlcParam",
components: {
Editor
},
data() {
return {
//
loading: true,
//
exportLoading: false,
//
showSearch: true,
//
total: 0,
//
list: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNo: 1,
pageSize: 10,
connectId: null,
},
//
form: {},
//
rules: {
connectId: [{ required: true, message: "实时数采表id不能为空", trigger: "blur" }],
plcParamName: [{ required: true, message: "plc实际的列名参数列名不能为空", trigger: "blur" }],
name: [{ required: true, message: "参数名称不能为空", trigger: "blur" }],
}
};
},
created() {
this.getList();
},
methods: {
/** 查询列表 */
getList() {
this.loading = true;
//
getEquipmentPlcParamPage(this.queryParams).then(response => {
this.list = response.data.list;
this.total = response.data.total;
this.loading = false;
});
},
/** 取消按钮 */
cancel() {
this.open = false;
this.reset();
},
/** 表单重置 */
reset() {
this.form = {
id: undefined,
connectId: undefined,
plcParamName: undefined,
name: undefined,
unit: undefined,
minValue: undefined,
maxValue: undefined,
defaultValue: undefined,
collection: undefined,
description: undefined,
remark: undefined,
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNo = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加设备数采详情";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id;
getEquipmentPlcParam(id).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改设备数采详情";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (!valid) {
return;
}
//
if (this.form.id != null) {
updateEquipmentPlcParam(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
return;
}
//
createEquipmentPlcParam(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
});
},
/** 删除按钮操作 */
handleDelete(row) {
const id = row.id;
this.$modal.confirm('是否确认删除设备数采详情编号为"' + id + '"的数据项?').then(function() {
return deleteEquipmentPlcParam(id);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
//
let params = {...this.queryParams};
params.pageNo = undefined;
params.pageSize = undefined;
this.$modal.confirm('是否确认导出所有设备数采详情数据项?').then(() => {
this.exportLoading = true;
return exportEquipmentPlcParamExcel(params);
}).then(response => {
this.$download.excel(response, '设备数采详情.xls');
this.exportLoading = false;
}).catch(() => {});
}
}
};
</script>

View File

@ -0,0 +1,277 @@
<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="设备id" prop="equipmentId">
<el-input v-model="queryParams.equipmentId" placeholder="请输入设备id" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="设备名称" prop="equipmentName">
<el-input v-model="queryParams.equipmentName" placeholder="请输入设备名称" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="进入设备的数量" prop="inQuantity">
<el-input v-model="queryParams.inQuantity" placeholder="请输入进入设备的数量" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="离开设备的数量若plc只记录一个生产数量也写入该字段" prop="outQuantity">
<el-input v-model="queryParams.outQuantity" placeholder="请输入离开设备的数量若plc只记录一个生产数量也写入该字段" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="正常生产量" prop="okQuantity">
<el-input v-model="queryParams.okQuantity" placeholder="请输入正常生产量" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="设备上报的报废数量" prop="nokQuantity">
<el-input v-model="queryParams.nokQuantity" placeholder="请输入设备上报的报废数量" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="生产数量的记录时间" prop="recordTime">
<el-date-picker v-model="queryParams.recordTime" style="width: 240px" value-format="yyyy-MM-dd HH:mm:ss" type="daterange"
range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" :default-time="['00:00:00', '23:59:59']" />
</el-form-item>
<el-form-item label="版本号" prop="version">
<el-input v-model="queryParams.version" placeholder="请输入版本号" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="创建时间" prop="createTime">
<el-date-picker v-model="queryParams.createTime" style="width: 240px" value-format="yyyy-MM-dd HH:mm:ss" type="daterange"
range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" :default-time="['00:00:00', '23:59:59']" />
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" @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="['base:equipment-quantity-log:create']">新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" :loading="exportLoading"
v-hasPermi="['base:equipment-quantity-log:export']">导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<!-- 列表 -->
<el-table v-loading="loading" :data="list">
<el-table-column label="id" align="center" prop="id" />
<el-table-column label="设备id" align="center" prop="equipmentId" />
<el-table-column label="设备名称" align="center" prop="equipmentName" />
<el-table-column label="进入设备的数量" align="center" prop="inQuantity" />
<el-table-column label="离开设备的数量若plc只记录一个生产数量也写入该字段" align="center" prop="outQuantity" />
<el-table-column label="正常生产量" align="center" prop="okQuantity" />
<el-table-column label="设备上报的报废数量" align="center" prop="nokQuantity" />
<el-table-column label="生产数量的记录时间" align="center" prop="recordTime" width="180">
<template v-slot="scope">
<span>{{ parseTime(scope.row.recordTime) }}</span>
</template>
</el-table-column>
<el-table-column label="版本号" align="center" prop="version" />
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
<template v-slot="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template v-slot="scope">
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
v-hasPermi="['base:equipment-quantity-log:update']">修改</el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
v-hasPermi="['base:equipment-quantity-log:delete']">删除</el-button>
</template>
</el-table-column>
</el-table>
<!-- 分页组件 -->
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
@pagination="getList"/>
<!-- 对话框(添加 / 修改) -->
<el-dialog :title="title" :visible.sync="open" width="500px" v-dialogDrag append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="设备id" prop="equipmentId">
<el-input v-model="form.equipmentId" placeholder="请输入设备id" />
</el-form-item>
<el-form-item label="设备名称" prop="equipmentName">
<el-input v-model="form.equipmentName" placeholder="请输入设备名称" />
</el-form-item>
<el-form-item label="进入设备的数量" prop="inQuantity">
<el-input v-model="form.inQuantity" placeholder="请输入进入设备的数量" />
</el-form-item>
<el-form-item label="离开设备的数量若plc只记录一个生产数量也写入该字段" prop="outQuantity">
<el-input v-model="form.outQuantity" placeholder="请输入离开设备的数量若plc只记录一个生产数量也写入该字段" />
</el-form-item>
<el-form-item label="正常生产量" prop="okQuantity">
<el-input v-model="form.okQuantity" placeholder="请输入正常生产量" />
</el-form-item>
<el-form-item label="设备上报的报废数量" prop="nokQuantity">
<el-input v-model="form.nokQuantity" placeholder="请输入设备上报的报废数量" />
</el-form-item>
<el-form-item label="生产数量的记录时间" prop="recordTime">
<el-date-picker clearable v-model="form.recordTime" type="date" value-format="timestamp" placeholder="选择生产数量的记录时间" />
</el-form-item>
<el-form-item label="版本号" prop="version">
<el-input v-model="form.version" 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 { createEquipmentQuantityLog, updateEquipmentQuantityLog, deleteEquipmentQuantityLog, getEquipmentQuantityLog, getEquipmentQuantityLogPage, exportEquipmentQuantityLogExcel } from "@/api/base/equipmentQuantityLog";
export default {
name: "EquipmentQuantityLog",
components: {
},
data() {
return {
//
loading: true,
//
exportLoading: false,
//
showSearch: true,
//
total: 0,
//
list: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNo: 1,
pageSize: 10,
equipmentId: null,
equipmentName: null,
inQuantity: null,
outQuantity: null,
okQuantity: null,
nokQuantity: null,
recordTime: [],
version: null,
createTime: [],
},
//
form: {},
//
rules: {
equipmentName: [{ required: true, message: "设备名称不能为空", trigger: "blur" }],
}
};
},
created() {
this.getList();
},
methods: {
/** 查询列表 */
getList() {
this.loading = true;
//
getEquipmentQuantityLogPage(this.queryParams).then(response => {
this.list = response.data.list;
this.total = response.data.total;
this.loading = false;
});
},
/** 取消按钮 */
cancel() {
this.open = false;
this.reset();
},
/** 表单重置 */
reset() {
this.form = {
id: undefined,
equipmentId: undefined,
equipmentName: undefined,
inQuantity: undefined,
outQuantity: undefined,
okQuantity: undefined,
nokQuantity: undefined,
recordTime: undefined,
version: undefined,
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNo = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加后端用 设备生产数量统计表(按一定时间段写入)";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id;
getEquipmentQuantityLog(id).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改后端用 设备生产数量统计表(按一定时间段写入)";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (!valid) {
return;
}
//
if (this.form.id != null) {
updateEquipmentQuantityLog(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
return;
}
//
createEquipmentQuantityLog(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
});
},
/** 删除按钮操作 */
handleDelete(row) {
const id = row.id;
this.$modal.confirm('是否确认删除后端用 设备生产数量统计表(按一定时间段写入)编号为"' + id + '"的数据项?').then(function() {
return deleteEquipmentQuantityLog(id);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
//
let params = {...this.queryParams};
params.pageNo = undefined;
params.pageSize = undefined;
this.$modal.confirm('是否确认导出所有后端用 设备生产数量统计表(按一定时间段写入)数据项?').then(() => {
this.exportLoading = true;
return exportEquipmentQuantityLogExcel(params);
}).then(response => {
this.$download.excel(response, '后端用 设备生产数量统计表(按一定时间段写入).xls');
this.exportLoading = false;
}).catch(() => {});
}
}
};
</script>

View File

@ -0,0 +1,276 @@
<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="设备id" prop="equipmentId">
<el-input v-model="queryParams.equipmentId" placeholder="请输入设备id" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="设备名称" prop="equipmentName">
<el-input v-model="queryParams.equipmentName" placeholder="请输入设备名称" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="进入设备的基板数量" prop="inQuantity">
<el-input v-model="queryParams.inQuantity" placeholder="请输入进入设备的基板数量" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="离开设备的基板数量若plc只记录一个生产数量也写入该字段" prop="outQuantity">
<el-input v-model="queryParams.outQuantity" placeholder="请输入离开设备的基板数量若plc只记录一个生产数量也写入该字段" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="正常生产量" prop="okQuantity">
<el-input v-model="queryParams.okQuantity" placeholder="请输入正常生产量" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="设备上报的报废数量" prop="nokQuantity">
<el-input v-model="queryParams.nokQuantity" placeholder="请输入设备上报的报废数量" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="记录时间" prop="recordTime">
<el-date-picker v-model="queryParams.recordTime" style="width: 240px" value-format="yyyy-MM-dd HH:mm:ss" type="daterange"
range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" :default-time="['00:00:00', '23:59:59']" />
</el-form-item>
<el-form-item label="版本号" prop="version">
<el-input v-model="queryParams.version" placeholder="请输入版本号" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="创建时间" prop="createTime">
<el-date-picker v-model="queryParams.createTime" style="width: 240px" value-format="yyyy-MM-dd HH:mm:ss" type="daterange"
range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" :default-time="['00:00:00', '23:59:59']" />
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" @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="['base:equipment-quantity-realtime:create']">新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" :loading="exportLoading"
v-hasPermi="['base:equipment-quantity-realtime:export']">导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<!-- 列表 -->
<el-table v-loading="loading" :data="list">
<el-table-column label="id" align="center" prop="id" />
<el-table-column label="设备id" align="center" prop="equipmentId" />
<el-table-column label="设备名称" align="center" prop="equipmentName" />
<el-table-column label="进入设备的基板数量" align="center" prop="inQuantity" />
<el-table-column label="离开设备的基板数量若plc只记录一个生产数量也写入该字段" align="center" prop="outQuantity" />
<el-table-column label="正常生产量" align="center" prop="okQuantity" />
<el-table-column label="设备上报的报废数量" align="center" prop="nokQuantity" />
<el-table-column label="记录时间" align="center" prop="recordTime" width="180">
<template v-slot="scope">
<span>{{ parseTime(scope.row.recordTime) }}</span>
</template>
</el-table-column>
<el-table-column label="版本号" align="center" prop="version" />
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
<template v-slot="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template v-slot="scope">
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
v-hasPermi="['base:equipment-quantity-realtime:update']">修改</el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
v-hasPermi="['base:equipment-quantity-realtime:delete']">删除</el-button>
</template>
</el-table-column>
</el-table>
<!-- 分页组件 -->
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
@pagination="getList"/>
<!-- 对话框(添加 / 修改) -->
<el-dialog :title="title" :visible.sync="open" width="500px" v-dialogDrag append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="设备id" prop="equipmentId">
<el-input v-model="form.equipmentId" placeholder="请输入设备id" />
</el-form-item>
<el-form-item label="设备名称" prop="equipmentName">
<el-input v-model="form.equipmentName" placeholder="请输入设备名称" />
</el-form-item>
<el-form-item label="进入设备的基板数量" prop="inQuantity">
<el-input v-model="form.inQuantity" placeholder="请输入进入设备的基板数量" />
</el-form-item>
<el-form-item label="离开设备的基板数量若plc只记录一个生产数量也写入该字段" prop="outQuantity">
<el-input v-model="form.outQuantity" placeholder="请输入离开设备的基板数量若plc只记录一个生产数量也写入该字段" />
</el-form-item>
<el-form-item label="正常生产量" prop="okQuantity">
<el-input v-model="form.okQuantity" placeholder="请输入正常生产量" />
</el-form-item>
<el-form-item label="设备上报的报废数量" prop="nokQuantity">
<el-input v-model="form.nokQuantity" placeholder="请输入设备上报的报废数量" />
</el-form-item>
<el-form-item label="记录时间" prop="recordTime">
<el-date-picker clearable v-model="form.recordTime" type="date" value-format="timestamp" placeholder="选择记录时间" />
</el-form-item>
<el-form-item label="版本号" prop="version">
<el-input v-model="form.version" 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 { createEquipmentQuantityRealtime, updateEquipmentQuantityRealtime, deleteEquipmentQuantityRealtime, getEquipmentQuantityRealtime, getEquipmentQuantityRealtimePage, exportEquipmentQuantityRealtimeExcel } from "@/api/base/equipmentQuantityRealtime";
export default {
name: "EquipmentQuantityRealtime",
components: {
},
data() {
return {
//
loading: true,
//
exportLoading: false,
//
showSearch: true,
//
total: 0,
//
list: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNo: 1,
pageSize: 10,
equipmentId: null,
equipmentName: null,
inQuantity: null,
outQuantity: null,
okQuantity: null,
nokQuantity: null,
recordTime: [],
version: null,
createTime: [],
},
//
form: {},
//
rules: {
}
};
},
created() {
this.getList();
},
methods: {
/** 查询列表 */
getList() {
this.loading = true;
//
getEquipmentQuantityRealtimePage(this.queryParams).then(response => {
this.list = response.data.list;
this.total = response.data.total;
this.loading = false;
});
},
/** 取消按钮 */
cancel() {
this.open = false;
this.reset();
},
/** 表单重置 */
reset() {
this.form = {
id: undefined,
equipmentId: undefined,
equipmentName: undefined,
inQuantity: undefined,
outQuantity: undefined,
okQuantity: undefined,
nokQuantity: undefined,
recordTime: undefined,
version: undefined,
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNo = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加后端用 设备生产数量实时";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id;
getEquipmentQuantityRealtime(id).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改后端用 设备生产数量实时";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (!valid) {
return;
}
//
if (this.form.id != null) {
updateEquipmentQuantityRealtime(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
return;
}
//
createEquipmentQuantityRealtime(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
});
},
/** 删除按钮操作 */
handleDelete(row) {
const id = row.id;
this.$modal.confirm('是否确认删除后端用 设备生产数量实时编号为"' + id + '"的数据项?').then(function() {
return deleteEquipmentQuantityRealtime(id);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
//
let params = {...this.queryParams};
params.pageNo = undefined;
params.pageSize = undefined;
this.$modal.confirm('是否确认导出所有后端用 设备生产数量实时数据项?').then(() => {
this.exportLoading = true;
return exportEquipmentQuantityRealtimeExcel(params);
}).then(response => {
this.$download.excel(response, '后端用 设备生产数量实时.xls');
this.exportLoading = false;
}).catch(() => {});
}
}
};
</script>

View File

@ -0,0 +1,289 @@
<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="设备id" prop="equipmentId">
<el-input v-model="queryParams.equipmentId" placeholder="请输入设备id" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="设备名称" prop="equipmentName">
<el-input v-model="queryParams.equipmentName" placeholder="请输入设备名称" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="plc id" prop="plcId">
<el-input v-model="queryParams.plcId" placeholder="请输入plc id" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="plc" prop="plc">
<el-input v-model="queryParams.plc" placeholder="请输入plc" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="状态0正常 1计划停机 2故障" prop="status">
<el-select v-model="queryParams.status" placeholder="请选择状态0正常 1计划停机 2故障" clearable size="small">
<el-option label="请选择字典生成" value="" />
</el-select>
</el-form-item>
<el-form-item label="记录时间" prop="recordTime">
<el-date-picker v-model="queryParams.recordTime" style="width: 240px" value-format="yyyy-MM-dd HH:mm:ss" type="daterange"
range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" :default-time="['00:00:00', '23:59:59']" />
</el-form-item>
<el-form-item label="持续时间(分钟),状态变动时记录并更新" prop="duration">
<el-input v-model="queryParams.duration" placeholder="请输入持续时间(分钟),状态变动时记录并更新" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="queryParams.remark" placeholder="请输入备注" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="版本号" prop="version">
<el-input v-model="queryParams.version" placeholder="请输入版本号" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="创建时间" prop="createTime">
<el-date-picker v-model="queryParams.createTime" style="width: 240px" value-format="yyyy-MM-dd HH:mm:ss" type="daterange"
range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" :default-time="['00:00:00', '23:59:59']" />
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" @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="['base:equipment-status-log:create']">新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" :loading="exportLoading"
v-hasPermi="['base:equipment-status-log:export']">导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<!-- 列表 -->
<el-table v-loading="loading" :data="list">
<el-table-column label="id" align="center" prop="id" />
<el-table-column label="设备id" align="center" prop="equipmentId" />
<el-table-column label="设备名称" align="center" prop="equipmentName" />
<el-table-column label="plc id" align="center" prop="plcId" />
<el-table-column label="plc" align="center" prop="plc" />
<el-table-column label="状态0正常 1计划停机 2故障" align="center" prop="status" />
<el-table-column label="记录时间" align="center" prop="recordTime" width="180">
<template v-slot="scope">
<span>{{ parseTime(scope.row.recordTime) }}</span>
</template>
</el-table-column>
<el-table-column label="持续时间(分钟),状态变动时记录并更新" align="center" prop="duration" />
<el-table-column label="备注" align="center" prop="remark" />
<el-table-column label="版本号" align="center" prop="version" />
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
<template v-slot="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template v-slot="scope">
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
v-hasPermi="['base:equipment-status-log:update']">修改</el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
v-hasPermi="['base:equipment-status-log:delete']">删除</el-button>
</template>
</el-table-column>
</el-table>
<!-- 分页组件 -->
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
@pagination="getList"/>
<!-- 对话框(添加 / 修改) -->
<el-dialog :title="title" :visible.sync="open" width="500px" v-dialogDrag append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="设备id" prop="equipmentId">
<el-input v-model="form.equipmentId" placeholder="请输入设备id" />
</el-form-item>
<el-form-item label="设备名称" prop="equipmentName">
<el-input v-model="form.equipmentName" placeholder="请输入设备名称" />
</el-form-item>
<el-form-item label="plc id" prop="plcId">
<el-input v-model="form.plcId" placeholder="请输入plc id" />
</el-form-item>
<el-form-item label="plc" prop="plc">
<el-input v-model="form.plc" placeholder="请输入plc" />
</el-form-item>
<el-form-item label="状态0正常 1计划停机 2故障" prop="status">
<el-radio-group v-model="form.status">
<el-radio label="1">请选择字典生成</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="记录时间" prop="recordTime">
<el-date-picker clearable v-model="form.recordTime" type="date" value-format="timestamp" placeholder="选择记录时间" />
</el-form-item>
<el-form-item label="持续时间(分钟),状态变动时记录并更新" prop="duration">
<el-input v-model="form.duration" placeholder="请输入持续时间(分钟),状态变动时记录并更新" />
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" placeholder="请输入备注" />
</el-form-item>
<el-form-item label="版本号" prop="version">
<el-input v-model="form.version" 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 { createEquipmentStatusLog, updateEquipmentStatusLog, deleteEquipmentStatusLog, getEquipmentStatusLog, getEquipmentStatusLogPage, exportEquipmentStatusLogExcel } from "@/api/base/equipmentStatusLog";
export default {
name: "EquipmentStatusLog",
components: {
},
data() {
return {
//
loading: true,
//
exportLoading: false,
//
showSearch: true,
//
total: 0,
//
list: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNo: 1,
pageSize: 10,
equipmentId: null,
equipmentName: null,
plcId: null,
plc: null,
status: null,
recordTime: [],
duration: null,
remark: null,
version: null,
createTime: [],
},
//
form: {},
//
rules: {
}
};
},
created() {
this.getList();
},
methods: {
/** 查询列表 */
getList() {
this.loading = true;
//
getEquipmentStatusLogPage(this.queryParams).then(response => {
this.list = response.data.list;
this.total = response.data.total;
this.loading = false;
});
},
/** 取消按钮 */
cancel() {
this.open = false;
this.reset();
},
/** 表单重置 */
reset() {
this.form = {
id: undefined,
equipmentId: undefined,
equipmentName: undefined,
plcId: undefined,
plc: undefined,
status: undefined,
recordTime: undefined,
duration: undefined,
remark: undefined,
version: undefined,
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNo = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加后端用 设备工作状态";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id;
getEquipmentStatusLog(id).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改后端用 设备工作状态";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (!valid) {
return;
}
//
if (this.form.id != null) {
updateEquipmentStatusLog(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
return;
}
//
createEquipmentStatusLog(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
});
},
/** 删除按钮操作 */
handleDelete(row) {
const id = row.id;
this.$modal.confirm('是否确认删除后端用 设备工作状态编号为"' + id + '"的数据项?').then(function() {
return deleteEquipmentStatusLog(id);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
//
let params = {...this.queryParams};
params.pageNo = undefined;
params.pageSize = undefined;
this.$modal.confirm('是否确认导出所有后端用 设备工作状态数据项?').then(() => {
this.exportLoading = true;
return exportEquipmentStatusLogExcel(params);
}).then(response => {
this.$download.excel(response, '后端用 设备工作状态.xls');
this.exportLoading = false;
}).catch(() => {});
}
}
};
</script>

View File

@ -0,0 +1,296 @@
<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="设备id" prop="equipmentId">
<el-input v-model="queryParams.equipmentId" placeholder="请输入设备id" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="设备名称" prop="equipmentName">
<el-input v-model="queryParams.equipmentName" placeholder="请输入设备名称" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="状态0正常 1计划停机 2故障" prop="status">
<el-select v-model="queryParams.status" placeholder="请选择状态0正常 1计划停机 2故障" clearable size="small">
<el-option label="请选择字典生成" value="" />
</el-select>
</el-form-item>
<el-form-item label="是否运行中" prop="run">
<el-select v-model="queryParams.run" placeholder="请选择是否运行中" clearable size="small">
<el-option label="请选择字典生成" value="" />
</el-select>
</el-form-item>
<el-form-item label="是否发生运行错误" prop="error">
<el-select v-model="queryParams.error" placeholder="请选择是否发生运行错误" clearable size="small">
<el-option label="请选择字典生成" value="" />
</el-select>
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="queryParams.remark" placeholder="请输入备注" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="记录时间" prop="recordTime">
<el-date-picker v-model="queryParams.recordTime" style="width: 240px" value-format="yyyy-MM-dd HH:mm:ss" type="daterange"
range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" :default-time="['00:00:00', '23:59:59']" />
</el-form-item>
<el-form-item label="版本号" prop="version">
<el-input v-model="queryParams.version" placeholder="请输入版本号" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="创建时间" prop="createTime">
<el-date-picker v-model="queryParams.createTime" style="width: 240px" value-format="yyyy-MM-dd HH:mm:ss" type="daterange"
range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" :default-time="['00:00:00', '23:59:59']" />
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" @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="['base:equipment-status-realtime:create']">新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" :loading="exportLoading"
v-hasPermi="['base:equipment-status-realtime:export']">导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<!-- 列表 -->
<el-table v-loading="loading" :data="list">
<el-table-column label="id" align="center" prop="id" />
<el-table-column label="设备id" align="center" prop="equipmentId" />
<el-table-column label="设备名称" align="center" prop="equipmentName" />
<el-table-column label="状态0正常 1计划停机 2故障" align="center" prop="status" />
<el-table-column label="是否运行中" align="center" prop="run" />
<el-table-column label="是否发生运行错误" align="center" prop="error" />
<el-table-column label="描述" align="center" prop="description" />
<el-table-column label="备注" align="center" prop="remark" />
<el-table-column label="记录时间" align="center" prop="recordTime" width="180">
<template v-slot="scope">
<span>{{ parseTime(scope.row.recordTime) }}</span>
</template>
</el-table-column>
<el-table-column label="版本号" align="center" prop="version" />
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
<template v-slot="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template v-slot="scope">
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
v-hasPermi="['base:equipment-status-realtime:update']">修改</el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
v-hasPermi="['base:equipment-status-realtime:delete']">删除</el-button>
</template>
</el-table-column>
</el-table>
<!-- 分页组件 -->
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
@pagination="getList"/>
<!-- 对话框(添加 / 修改) -->
<el-dialog :title="title" :visible.sync="open" width="500px" v-dialogDrag append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="设备id" prop="equipmentId">
<el-input v-model="form.equipmentId" placeholder="请输入设备id" />
</el-form-item>
<el-form-item label="设备名称" prop="equipmentName">
<el-input v-model="form.equipmentName" placeholder="请输入设备名称" />
</el-form-item>
<el-form-item label="状态0正常 1计划停机 2故障" prop="status">
<el-radio-group v-model="form.status">
<el-radio label="1">请选择字典生成</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="是否运行中" prop="run">
<el-radio-group v-model="form.run">
<el-radio label="1">请选择字典生成</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="是否发生运行错误" prop="error">
<el-radio-group v-model="form.error">
<el-radio label="1">请选择字典生成</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="描述">
<editor v-model="form.description" :min-height="192"/>
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" placeholder="请输入备注" />
</el-form-item>
<el-form-item label="记录时间" prop="recordTime">
<el-date-picker clearable v-model="form.recordTime" type="date" value-format="timestamp" placeholder="选择记录时间" />
</el-form-item>
<el-form-item label="版本号" prop="version">
<el-input v-model="form.version" 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 { createEquipmentStatusRealtime, updateEquipmentStatusRealtime, deleteEquipmentStatusRealtime, getEquipmentStatusRealtime, getEquipmentStatusRealtimePage, exportEquipmentStatusRealtimeExcel } from "@/api/base/equipmentStatusRealtime";
import Editor from '@/components/Editor';
export default {
name: "EquipmentStatusRealtime",
components: {
Editor
},
data() {
return {
//
loading: true,
//
exportLoading: false,
//
showSearch: true,
//
total: 0,
//
list: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNo: 1,
pageSize: 10,
equipmentId: null,
equipmentName: null,
status: null,
run: null,
error: null,
description: null,
remark: null,
recordTime: [],
version: null,
createTime: [],
},
//
form: {},
//
rules: {
}
};
},
created() {
this.getList();
},
methods: {
/** 查询列表 */
getList() {
this.loading = true;
//
getEquipmentStatusRealtimePage(this.queryParams).then(response => {
this.list = response.data.list;
this.total = response.data.total;
this.loading = false;
});
},
/** 取消按钮 */
cancel() {
this.open = false;
this.reset();
},
/** 表单重置 */
reset() {
this.form = {
id: undefined,
equipmentId: undefined,
equipmentName: undefined,
status: undefined,
run: undefined,
error: undefined,
description: undefined,
remark: undefined,
recordTime: undefined,
version: undefined,
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNo = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加后端用 设备状态实时";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id;
getEquipmentStatusRealtime(id).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改后端用 设备状态实时";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (!valid) {
return;
}
//
if (this.form.id != null) {
updateEquipmentStatusRealtime(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
return;
}
//
createEquipmentStatusRealtime(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
});
},
/** 删除按钮操作 */
handleDelete(row) {
const id = row.id;
this.$modal.confirm('是否确认删除后端用 设备状态实时编号为"' + id + '"的数据项?').then(function() {
return deleteEquipmentStatusRealtime(id);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
//
let params = {...this.queryParams};
params.pageNo = undefined;
params.pageSize = undefined;
this.$modal.confirm('是否确认导出所有后端用 设备状态实时数据项?').then(() => {
this.exportLoading = true;
return exportEquipmentStatusRealtimeExcel(params);
}).then(response => {
this.$download.excel(response, '后端用 设备状态实时.xls');
this.exportLoading = false;
}).catch(() => {});
}
}
};
</script>

View File

@ -0,0 +1,219 @@
<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="name">
<el-input v-model="queryParams.name" placeholder="请输入名称" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" @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="['base:equipment-type:create']">新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" :loading="exportLoading"
v-hasPermi="['base:equipment-type:export']">导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<!-- 列表 -->
<el-table v-loading="loading" :data="list">
<el-table-column label="ID" align="center" prop="id" />
<el-table-column label="编码" align="center" prop="code" />
<el-table-column label="名称" align="center" prop="name" />
<el-table-column label="备注" align="center" prop="remark" />
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
<template v-slot="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template v-slot="scope">
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
v-hasPermi="['base:equipment-type:update']">修改</el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
v-hasPermi="['base:equipment-type:delete']">删除</el-button>
</template>
</el-table-column>
</el-table>
<!-- 分页组件 -->
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
@pagination="getList"/>
<!-- 对话框(添加 / 修改) -->
<el-dialog :title="title" :visible.sync="open" width="500px" v-dialogDrag append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="编码" prop="code">
<el-input v-model="form.code" placeholder="请输入编码" />
</el-form-item>
<el-form-item label="名称" prop="name">
<el-input v-model="form.name" placeholder="请输入名称" />
</el-form-item>
<el-form-item label="父类ID最上层为0" prop="parentId">
<el-input v-model="form.parentId" placeholder="请输入父类ID最上层为0" />
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" 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 { createEquipmentType, updateEquipmentType, deleteEquipmentType, getEquipmentType, getEquipmentTypePage, exportEquipmentTypeExcel } from "@/api/base/equipmentType";
export default {
name: "EquipmentType",
components: {
},
data() {
return {
//
loading: true,
//
exportLoading: false,
//
showSearch: true,
//
total: 0,
//
list: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNo: 1,
pageSize: 10,
name: null,
},
//
form: {},
//
rules: {
code: [{ required: true, message: "编码不能为空", trigger: "blur" }],
name: [{ required: true, message: "名称不能为空", trigger: "blur" }],
}
};
},
created() {
this.getList();
},
methods: {
/** 查询列表 */
getList() {
this.loading = true;
//
getEquipmentTypePage(this.queryParams).then(response => {
this.list = response.data.list;
this.total = response.data.total;
this.loading = false;
});
},
/** 取消按钮 */
cancel() {
this.open = false;
this.reset();
},
/** 表单重置 */
reset() {
this.form = {
id: undefined,
code: undefined,
name: undefined,
parentId: undefined,
remark: undefined,
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNo = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加设备类型";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id;
getEquipmentType(id).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改设备类型";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (!valid) {
return;
}
//
if (this.form.id != null) {
updateEquipmentType(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
return;
}
//
createEquipmentType(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
});
},
/** 删除按钮操作 */
handleDelete(row) {
const id = row.id;
this.$modal.confirm('是否确认删除设备类型编号为"' + id + '"的数据项?').then(function() {
return deleteEquipmentType(id);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
//
let params = {...this.queryParams};
params.pageNo = undefined;
params.pageSize = undefined;
this.$modal.confirm('是否确认导出所有设备类型数据项?').then(() => {
this.exportLoading = true;
return exportEquipmentTypeExcel(params);
}).then(response => {
this.$download.excel(response, '设备类型.xls');
this.exportLoading = false;
}).catch(() => {});
}
}
};
</script>

View File

@ -0,0 +1,229 @@
<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="设备类型ID" prop="equipmentTypeId">
<el-input v-model="queryParams.equipmentTypeId" placeholder="请输入设备类型ID" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="原始名称" prop="fileName">
<el-input v-model="queryParams.fileName" placeholder="请输入原始名称" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="下载地址" prop="fileUrl">
<el-input v-model="queryParams.fileUrl" placeholder="请输入下载地址" clearable @keyup.enter.native="handleQuery"/>
</el-form-item>
<el-form-item label="创建时间" prop="createTime">
<el-date-picker v-model="queryParams.createTime" style="width: 240px" value-format="yyyy-MM-dd HH:mm:ss" type="daterange"
range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" :default-time="['00:00:00', '23:59:59']" />
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" @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="['base:equipment-type-file:create']">新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" :loading="exportLoading"
v-hasPermi="['base:equipment-type-file:export']">导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<!-- 列表 -->
<el-table v-loading="loading" :data="list">
<el-table-column label="ID" align="center" prop="id" />
<el-table-column label="设备类型ID" align="center" prop="equipmentTypeId" />
<el-table-column label="原始名称" align="center" prop="fileName" />
<el-table-column label="下载地址" align="center" prop="fileUrl" />
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
<template v-slot="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template v-slot="scope">
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
v-hasPermi="['base:equipment-type-file:update']">修改</el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
v-hasPermi="['base:equipment-type-file:delete']">删除</el-button>
</template>
</el-table-column>
</el-table>
<!-- 分页组件 -->
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
@pagination="getList"/>
<!-- 对话框(添加 / 修改) -->
<el-dialog :title="title" :visible.sync="open" width="500px" v-dialogDrag append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="设备类型ID" prop="equipmentTypeId">
<el-input v-model="form.equipmentTypeId" placeholder="请输入设备类型ID" />
</el-form-item>
<el-form-item label="原始名称" prop="fileName">
<el-input v-model="form.fileName" placeholder="请输入原始名称" />
</el-form-item>
<el-form-item label="下载地址" prop="fileUrl">
<el-input v-model="form.fileUrl" 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 { createEquipmentTypeFile, updateEquipmentTypeFile, deleteEquipmentTypeFile, getEquipmentTypeFile, getEquipmentTypeFilePage, exportEquipmentTypeFileExcel } from "@/api/base/equipmentTypeFile";
export default {
name: "EquipmentTypeFile",
components: {
},
data() {
return {
//
loading: true,
//
exportLoading: false,
//
showSearch: true,
//
total: 0,
//
list: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNo: 1,
pageSize: 10,
equipmentTypeId: null,
fileName: null,
fileUrl: null,
createTime: [],
},
//
form: {},
//
rules: {
equipmentTypeId: [{ required: true, message: "设备类型ID不能为空", trigger: "blur" }],
fileName: [{ required: true, message: "原始名称不能为空", trigger: "blur" }],
fileUrl: [{ required: true, message: "下载地址不能为空", trigger: "blur" }],
}
};
},
created() {
this.getList();
},
methods: {
/** 查询列表 */
getList() {
this.loading = true;
//
getEquipmentTypeFilePage(this.queryParams).then(response => {
this.list = response.data.list;
this.total = response.data.total;
this.loading = false;
});
},
/** 取消按钮 */
cancel() {
this.open = false;
this.reset();
},
/** 表单重置 */
reset() {
this.form = {
id: undefined,
equipmentTypeId: undefined,
fileName: undefined,
fileUrl: undefined,
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNo = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加设备类型文件关联";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id;
getEquipmentTypeFile(id).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改设备类型文件关联";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (!valid) {
return;
}
//
if (this.form.id != null) {
updateEquipmentTypeFile(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
return;
}
//
createEquipmentTypeFile(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
});
},
/** 删除按钮操作 */
handleDelete(row) {
const id = row.id;
this.$modal.confirm('是否确认删除设备类型文件关联编号为"' + id + '"的数据项?').then(function() {
return deleteEquipmentTypeFile(id);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
//
let params = {...this.queryParams};
params.pageNo = undefined;
params.pageSize = undefined;
this.$modal.confirm('是否确认导出所有设备类型文件关联数据项?').then(() => {
this.exportLoading = true;
return exportEquipmentTypeFileExcel(params);
}).then(response => {
this.$download.excel(response, '设备类型文件关联.xls');
this.exportLoading = false;
}).catch(() => {});
}
}
};
</script>