Compare commits
23 Commits
0e76fe7dbf
...
projects/s
| Author | SHA1 | Date | |
|---|---|---|---|
| 4a12457a10 | |||
| 8ceecde31a | |||
| 015d7c4266 | |||
| bfd8e04780 | |||
| 471245d5b6 | |||
| 8226b45a03 | |||
| dde04cf93f | |||
| 63a67e58de | |||
| 48e9f70625 | |||
| f5f250cb16 | |||
| b6241fe7c4 | |||
| 94edd04a08 | |||
| b926559a7d | |||
| b2984ed4cf | |||
|
|
4ade2dfcdc | ||
|
|
852a3f17a0 | ||
| cba14b1f61 | |||
|
|
33c00785df | ||
|
|
d8acff21e3 | ||
|
|
c0a38c568f | ||
| be86cbd9b3 | |||
| 6a8a9ed28d | |||
| a2213f4f7e |
8
.env.dev
@@ -9,11 +9,13 @@
|
|||||||
ENV = 'development'
|
ENV = 'development'
|
||||||
|
|
||||||
# 页面标题
|
# 页面标题
|
||||||
VUE_APP_TITLE = 智能监控分析系统
|
VUE_APP_TITLE = 上上电缆
|
||||||
|
|
||||||
# 芋道管理系统/开发环境
|
# 芋道管理系统/开发环境
|
||||||
# VUE_APP_BASE_API = 'http://192.168.8.22:48080'
|
|
||||||
VUE_APP_BASE_API = 'http://172.16.33.65:48082'
|
# VUE_APP_BASE_API = 'http://192.168.0.31:48080'
|
||||||
|
VUE_APP_BASE_API = 'http://172.16.32.236:48080'
|
||||||
|
# VUE_APP_BASE_API = 'http://line.kszny.picaiba.com'
|
||||||
|
|
||||||
# 路由懒加载
|
# 路由懒加载
|
||||||
VUE_CLI_BABEL_TRANSPILE_MODULES = true
|
VUE_CLI_BABEL_TRANSPILE_MODULES = true
|
||||||
|
|||||||
@@ -2,14 +2,14 @@
|
|||||||
# @Author: zwq
|
# @Author: zwq
|
||||||
# @Date: 2024-03-27 15:49:55
|
# @Date: 2024-03-27 15:49:55
|
||||||
# @LastEditors: zwq
|
# @LastEditors: zwq
|
||||||
# @LastEditTime: 2024-10-30 11:08:47
|
# @LastEditTime: 2025-10-31 09:58:40
|
||||||
# @Description:
|
# @Description:
|
||||||
###
|
###
|
||||||
# 生产环境配置
|
# 生产环境配置
|
||||||
ENV = 'production'
|
ENV = 'production'
|
||||||
|
|
||||||
# 页面标题
|
# 页面标题
|
||||||
VUE_APP_TITLE = 智能监控分析系统
|
VUE_APP_TITLE = 上上电缆
|
||||||
|
|
||||||
# 芋道管理系统/生产环境
|
# 芋道管理系统/生产环境
|
||||||
# VUE_APP_BASE_API = '/prod-api'
|
# VUE_APP_BASE_API = '/prod-api'
|
||||||
|
|||||||
@@ -45,7 +45,6 @@
|
|||||||
"@jiaminghi/data-view": "^2.10.0",
|
"@jiaminghi/data-view": "^2.10.0",
|
||||||
"@riophae/vue-treeselect": "0.4.0",
|
"@riophae/vue-treeselect": "0.4.0",
|
||||||
"axios": "0.27.2",
|
"axios": "0.27.2",
|
||||||
"benz-amr-recorder": "^1.1.5",
|
|
||||||
"bpmn-js-token-simulation": "0.10.0",
|
"bpmn-js-token-simulation": "0.10.0",
|
||||||
"chinese-lunar": "^0.1.4",
|
"chinese-lunar": "^0.1.4",
|
||||||
"clipboard": "2.0.8",
|
"clipboard": "2.0.8",
|
||||||
|
|||||||
49
src/api/areavisual/lane.js
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
/*
|
||||||
|
* @Author: zwq
|
||||||
|
* @Date: 2025-11-17 09:25:12
|
||||||
|
* @LastEditors: zwq
|
||||||
|
* @LastEditTime: 2026-01-14 13:53:22
|
||||||
|
* @Description:
|
||||||
|
*/
|
||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
|
||||||
|
// 获得巷道分页
|
||||||
|
export function getLanePage(query) {
|
||||||
|
return request({
|
||||||
|
url: '/wms/lane/page',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 获得巷道
|
||||||
|
export function getLane(id) {
|
||||||
|
return request({
|
||||||
|
url: '/wms/lane/get?id=' + id,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 删除巷道
|
||||||
|
export function deleteLane(id) {
|
||||||
|
return request({
|
||||||
|
url: '/wms/lane/delete?id=' + id,
|
||||||
|
method: 'delete'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 更新
|
||||||
|
export function updateLane(data) {
|
||||||
|
return request({
|
||||||
|
url: '/wms/lane/update',
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 创建
|
||||||
|
export function createLane(data) {
|
||||||
|
return request({
|
||||||
|
url: '/wms/lane/create',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
74
src/api/areavisual/lineEdgeLibrary.js
Normal file
@@ -0,0 +1,74 @@
|
|||||||
|
/*
|
||||||
|
* @Author: zwq
|
||||||
|
* @Date: 2025-11-17 09:25:12
|
||||||
|
* @LastEditors: zwq
|
||||||
|
* @LastEditTime: 2026-01-23 13:42:52
|
||||||
|
* @Description:
|
||||||
|
*/
|
||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
|
||||||
|
// 获得线边库分页
|
||||||
|
export function getLineEdgeLibraryPage(query) {
|
||||||
|
return request({
|
||||||
|
url: '/wms/line-edge-library/page',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 获得线边库
|
||||||
|
export function getLineEdgeLibrary(id) {
|
||||||
|
return request({
|
||||||
|
url: '/wms/line-edge-library/get?id=' + id,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 删除线边库
|
||||||
|
export function deleteLineEdgeLibrary(id) {
|
||||||
|
return request({
|
||||||
|
url: '/wms/line-edge-library/delete?id=' + id,
|
||||||
|
method: 'delete'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 更新
|
||||||
|
export function updateLineEdgeLibrary(data) {
|
||||||
|
return request({
|
||||||
|
url: '/wms/line-edge-library/update',
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 更新线边库实时pc --一键清空
|
||||||
|
export function AllQKLineEdgeLibrary(data) {
|
||||||
|
return request({
|
||||||
|
url: '/wms/line-edge-library/lane/cancel/pc',
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 更新线边库实时pc --清空操作
|
||||||
|
export function QKLineEdgeLibrary(data) {
|
||||||
|
return request({
|
||||||
|
url: '/wms/line-edge-library/update/pc',
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 创建
|
||||||
|
export function createLineEdgeLibrary(data) {
|
||||||
|
return request({
|
||||||
|
url: '/wms/line-edge-library/create',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获得设备分页
|
||||||
|
export function getEquipmentPage(query) {
|
||||||
|
return request({
|
||||||
|
url: '/wms/equipment/page',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
79
src/api/areavisual/overview.js
Normal file
@@ -0,0 +1,79 @@
|
|||||||
|
/*
|
||||||
|
* @Author: zwq
|
||||||
|
* @Date: 2026-01-06 15:18:38
|
||||||
|
* @LastEditors: zwq
|
||||||
|
* @LastEditTime: 2026-01-15 15:02:04
|
||||||
|
* @Description:
|
||||||
|
*/
|
||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
// 获取区域列表
|
||||||
|
export function getAreaList(params) {
|
||||||
|
return request({
|
||||||
|
url: '/wms/region/page',
|
||||||
|
method: 'get',
|
||||||
|
params
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取区域空满数量
|
||||||
|
export function postAllAreaInfo(data) {
|
||||||
|
return request({
|
||||||
|
url: '/wms/region/lsit/count',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取指定库区库位信息
|
||||||
|
export function postAreaInfo(params) {
|
||||||
|
return request({
|
||||||
|
url: '/wms/line-edge-library/list/region',
|
||||||
|
method: 'get',
|
||||||
|
params
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取区域总览
|
||||||
|
export function postAllAreaOverview(data) {
|
||||||
|
return request({
|
||||||
|
url: '/wms/line-edge-library/line/count',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除能源实时数据库plc相关
|
||||||
|
export function deleteEnergyPlc(id) {
|
||||||
|
return request({
|
||||||
|
url: '/base/energy-plc/delete?id=' + id,
|
||||||
|
method: 'delete'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取关联表编码
|
||||||
|
export function getCode() {
|
||||||
|
return request({
|
||||||
|
url: '/base/energy-plc/getCode',
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获得能源实时数据库plc相关分页
|
||||||
|
export function getEnergyPlcPage(data) {
|
||||||
|
return request({
|
||||||
|
url: '/base/energy-plc/page',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 导出能源实时数据库plc相关 Excel
|
||||||
|
export function exportEnergyPlcExcel(query) {
|
||||||
|
return request({
|
||||||
|
url: '/base/energy-plc/export-excel',
|
||||||
|
method: 'get',
|
||||||
|
params: query,
|
||||||
|
responseType: 'blob'
|
||||||
|
})
|
||||||
|
}
|
||||||
63
src/api/areavisual/record.js
Normal file
@@ -0,0 +1,63 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
// 获取出入库历史任务分页
|
||||||
|
export function getRecordPage(params) {
|
||||||
|
return request({
|
||||||
|
url: '/wms/job-main-task-history/page',
|
||||||
|
method: 'get',
|
||||||
|
params
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取巷道列表
|
||||||
|
export function getLaneList(params) {
|
||||||
|
return request({
|
||||||
|
url: '/wms/lane/page',
|
||||||
|
method: 'get',
|
||||||
|
params
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 更新能源实时数据库plc相关
|
||||||
|
export function updateEnergyPlc(data) {
|
||||||
|
return request({
|
||||||
|
url: '/base/energy-plc/update',
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除能源实时数据库plc相关
|
||||||
|
export function deleteEnergyPlc(id) {
|
||||||
|
return request({
|
||||||
|
url: '/base/energy-plc/delete?id=' + id,
|
||||||
|
method: 'delete'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取关联表编码
|
||||||
|
export function getCode() {
|
||||||
|
return request({
|
||||||
|
url: '/base/energy-plc/getCode',
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获得能源实时数据库plc相关分页
|
||||||
|
export function getEnergyPlcPage(data) {
|
||||||
|
return request({
|
||||||
|
url: '/base/energy-plc/page',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 导出能源实时数据库plc相关 Excel
|
||||||
|
export function exportEnergyPlcExcel(query) {
|
||||||
|
return request({
|
||||||
|
url: '/base/energy-plc/export-excel',
|
||||||
|
method: 'get',
|
||||||
|
params: query,
|
||||||
|
responseType: 'blob'
|
||||||
|
})
|
||||||
|
}
|
||||||
49
src/api/areavisual/region.js
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
/*
|
||||||
|
* @Author: zwq
|
||||||
|
* @Date: 2025-11-17 09:25:12
|
||||||
|
* @LastEditors: zwq
|
||||||
|
* @LastEditTime: 2026-01-14 13:35:11
|
||||||
|
* @Description:
|
||||||
|
*/
|
||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
|
||||||
|
// 获得区域分页
|
||||||
|
export function getRegionPage(query) {
|
||||||
|
return request({
|
||||||
|
url: '/wms/region/page',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 获得区域
|
||||||
|
export function getRegion(id) {
|
||||||
|
return request({
|
||||||
|
url: '/wms/region/get?id=' + id,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 删除区域
|
||||||
|
export function deleteRegion(id) {
|
||||||
|
return request({
|
||||||
|
url: '/wms/region/delete?id=' + id,
|
||||||
|
method: 'delete'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 更新
|
||||||
|
export function updateRegion(data) {
|
||||||
|
return request({
|
||||||
|
url: '/wms/region/update',
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 创建
|
||||||
|
export function createRegion(data) {
|
||||||
|
return request({
|
||||||
|
url: '/wms/region/create',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
@@ -141,13 +141,3 @@ export function getPerView(data) {
|
|||||||
data:data
|
data:data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 导出 Excel
|
|
||||||
export function exportExcel(query) {
|
|
||||||
return request({
|
|
||||||
url: '/base/group-scheduling-plan/export-excel',
|
|
||||||
method: 'get',
|
|
||||||
params: query,
|
|
||||||
responseType: 'blob'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -90,29 +90,3 @@ export function getEnableData() {
|
|||||||
method: 'get',
|
method: 'get',
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 解除继承节假日
|
|
||||||
export function disExtends(data) {
|
|
||||||
return request({
|
|
||||||
url: '/base/group-holiday/disExtends',
|
|
||||||
method: 'post',
|
|
||||||
data: data
|
|
||||||
})
|
|
||||||
}
|
|
||||||
// 恢复继承节假日
|
|
||||||
export function reExtends(data) {
|
|
||||||
return request({
|
|
||||||
url: '/base/group-holiday/reExtends',
|
|
||||||
method: 'post',
|
|
||||||
data: data
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// 获得部门节假日继承设置信息设置
|
|
||||||
export function getSet(query) {
|
|
||||||
return request({
|
|
||||||
url: '/base/group-holiday-dept-set/getSet',
|
|
||||||
method: 'get',
|
|
||||||
params: query
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|||||||
162
src/api/ssdl/product&recipe.js
Normal file
@@ -0,0 +1,162 @@
|
|||||||
|
/*
|
||||||
|
* @Author: zwq
|
||||||
|
* @Date: 2025-11-17 09:25:12
|
||||||
|
* @LastEditors: zwq
|
||||||
|
* @LastEditTime: 2026-01-13 16:13:53
|
||||||
|
* @Description:
|
||||||
|
*/
|
||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
|
||||||
|
// 获得原料分页
|
||||||
|
export function getProductPage(query) {
|
||||||
|
return request({
|
||||||
|
url: '/wms/material/page',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 获得所有原料
|
||||||
|
export function getAllProductPage(query) {
|
||||||
|
return request({
|
||||||
|
url: '/wms/material/list/all/code',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 获得原料
|
||||||
|
export function getProduct(id) {
|
||||||
|
return request({
|
||||||
|
url: '/wms/material/get?id=' + id,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 删除原料
|
||||||
|
export function deleteProduct(id) {
|
||||||
|
return request({
|
||||||
|
url: '/wms/material/delete?id=' + id,
|
||||||
|
method: 'delete'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 更新
|
||||||
|
export function updateProduct(data) {
|
||||||
|
return request({
|
||||||
|
url: '/wms/material/update',
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 创建
|
||||||
|
export function createProduct(data) {
|
||||||
|
return request({
|
||||||
|
url: '/wms/material/create',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 获得工艺分页
|
||||||
|
export function getProcessPage(query) {
|
||||||
|
return request({
|
||||||
|
url: '/wms/process/page/group/by',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 获得工艺点击展开表格
|
||||||
|
export function getProcessDetailPage(query) {
|
||||||
|
return request({
|
||||||
|
url: '/wms/process/page/group/by/detail',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 删除工艺
|
||||||
|
export function deleteProcess(id) {
|
||||||
|
return request({
|
||||||
|
url: '/wms/process/delete?id=' + id,
|
||||||
|
method: 'delete'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 批量删除工艺
|
||||||
|
export function deleteProcessList(ids) {
|
||||||
|
return request({
|
||||||
|
url: '/wms/process/delete-list?ids=' + ids,
|
||||||
|
method: 'delete'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 更新
|
||||||
|
export function updateProcess(data) {
|
||||||
|
return request({
|
||||||
|
url: '/wms/process/update',
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 创建
|
||||||
|
export function createProcess(data) {
|
||||||
|
return request({
|
||||||
|
url: '/wms/process/create',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 获得工艺
|
||||||
|
export function getProcess(id) {
|
||||||
|
return request({
|
||||||
|
url: '/wms/process/get?id=' + id,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 工艺设备原料分页
|
||||||
|
export function getProcessMaterialPage(query) {
|
||||||
|
return request({
|
||||||
|
url: '/wms/process-equipment-material/page',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 删除工艺设备原料
|
||||||
|
export function deleteProcessMaterial(id) {
|
||||||
|
return request({
|
||||||
|
url: '/wms/process-equipment-material/delete?id=' + id,
|
||||||
|
method: 'delete'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 更新
|
||||||
|
export function updateProcessMaterial(data) {
|
||||||
|
return request({
|
||||||
|
url: '/wms/process-equipment-material/update',
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 创建
|
||||||
|
export function createProcessMaterial(data) {
|
||||||
|
return request({
|
||||||
|
url: '/wms/process-equipment-material/create',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 获得工艺
|
||||||
|
export function getProcessMaterial(id) {
|
||||||
|
return request({
|
||||||
|
url: '/wms/process-equipment-material/get?id=' + id,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获得设备分页
|
||||||
|
export function getEquipmentPage(query) {
|
||||||
|
return request({
|
||||||
|
url: '/wms/equipment/page',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
60
src/api/ssdl/taskList.js
Normal file
@@ -0,0 +1,60 @@
|
|||||||
|
/*
|
||||||
|
* @Author: zwq
|
||||||
|
* @Date: 2025-11-17 09:25:12
|
||||||
|
* @LastEditors: zwq
|
||||||
|
* @LastEditTime: 2025-11-18 15:42:19
|
||||||
|
* @Description:
|
||||||
|
*/
|
||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
|
||||||
|
// 获得任务分页
|
||||||
|
export function getTaskPage(query) {
|
||||||
|
return request({
|
||||||
|
url: '/wms/job-main-task/page',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 获得任务
|
||||||
|
export function getTask(id) {
|
||||||
|
return request({
|
||||||
|
url: '/wms/job-main-task/get?id=' + id,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获得任务日志分页
|
||||||
|
export function getTaskLogPage(query) {
|
||||||
|
return request({
|
||||||
|
url: '/wms/job-main-task-log/page',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 更新
|
||||||
|
export function updateTask(data) {
|
||||||
|
return request({
|
||||||
|
url: '/wms/job-main-task/update',
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 根据区域id获取该区域下的库位信息
|
||||||
|
export function getRegion(id) {
|
||||||
|
return request({
|
||||||
|
url: '/wms/line-edge-library/get-by-region-id?regionId=' + id,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 创建
|
||||||
|
export function createPCTask(data) {
|
||||||
|
return request({
|
||||||
|
url: '/wms/job-main-task/pc-create-task',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
9
src/api/visualization/visualization.js
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
export function getLineEdgeLibraryList(data) {
|
||||||
|
return request({
|
||||||
|
url: '/wms/line-edge-library/list',
|
||||||
|
method: 'get',
|
||||||
|
params: data,
|
||||||
|
});
|
||||||
|
}
|
||||||
BIN
src/assets/img/ABN.png
Normal file
|
After Width: | Height: | Size: 461 B |
BIN
src/assets/img/ABNScale.png
Normal file
|
After Width: | Height: | Size: 321 B |
BIN
src/assets/img/DIS.png
Normal file
|
After Width: | Height: | Size: 312 B |
BIN
src/assets/img/DISScale.png
Normal file
|
After Width: | Height: | Size: 244 B |
BIN
src/assets/img/EP.png
Normal file
|
After Width: | Height: | Size: 137 B |
BIN
src/assets/img/EPScale.png
Normal file
|
After Width: | Height: | Size: 165 B |
BIN
src/assets/img/FP.png
Normal file
|
After Width: | Height: | Size: 139 B |
BIN
src/assets/img/FPScale.png
Normal file
|
After Width: | Height: | Size: 170 B |
BIN
src/assets/img/IDL.png
Normal file
|
After Width: | Height: | Size: 929 B |
BIN
src/assets/img/IDLScale.png
Normal file
|
After Width: | Height: | Size: 321 B |
BIN
src/assets/img/IT.png
Normal file
|
After Width: | Height: | Size: 320 B |
BIN
src/assets/img/ITScale.png
Normal file
|
After Width: | Height: | Size: 261 B |
BIN
src/assets/img/LCK.png
Normal file
|
After Width: | Height: | Size: 416 B |
BIN
src/assets/img/LCKScale.png
Normal file
|
After Width: | Height: | Size: 305 B |
BIN
src/assets/img/OCC.png
Normal file
|
After Width: | Height: | Size: 325 B |
BIN
src/assets/img/OCCScale.png
Normal file
|
After Width: | Height: | Size: 259 B |
BIN
src/assets/img/RES.png
Normal file
|
After Width: | Height: | Size: 420 B |
BIN
src/assets/img/RESScale.png
Normal file
|
After Width: | Height: | Size: 321 B |
BIN
src/assets/img/Top1.png
Normal file
|
After Width: | Height: | Size: 5.5 KiB |
BIN
src/assets/img/Top2.png
Normal file
|
After Width: | Height: | Size: 5.7 KiB |
BIN
src/assets/img/Top3.png
Normal file
|
After Width: | Height: | Size: 5.7 KiB |
BIN
src/assets/img/Top4.png
Normal file
|
After Width: | Height: | Size: 5.5 KiB |
BIN
src/assets/img/Top5.png
Normal file
|
After Width: | Height: | Size: 5.7 KiB |
BIN
src/assets/img/agvCar.png
Normal file
|
After Width: | Height: | Size: 2.1 KiB |
BIN
src/assets/img/agvItemBg.png
Normal file
|
After Width: | Height: | Size: 8.9 KiB |
BIN
src/assets/img/alarmItemBg.png
Normal file
|
After Width: | Height: | Size: 1.0 KiB |
BIN
src/assets/img/chargeBg.png
Normal file
|
After Width: | Height: | Size: 326 B |
BIN
src/assets/img/chargeCircle.png
Normal file
|
After Width: | Height: | Size: 622 B |
BIN
src/assets/img/leftTable.png
Normal file
|
After Width: | Height: | Size: 220 B |
BIN
src/assets/img/recycle.png
Normal file
|
After Width: | Height: | Size: 379 B |
BIN
src/assets/img/rightTable.png
Normal file
|
After Width: | Height: | Size: 355 B |
BIN
src/assets/img/runBg.png
Normal file
|
After Width: | Height: | Size: 325 B |
BIN
src/assets/img/runCircle.png
Normal file
|
After Width: | Height: | Size: 562 B |
BIN
src/assets/img/ssdlLeftTitle.png
Normal file
|
After Width: | Height: | Size: 12 KiB |
BIN
src/assets/img/ssdlTitle.png
Normal file
|
After Width: | Height: | Size: 5.3 KiB |
BIN
src/assets/img/standbyCircle.png
Normal file
|
After Width: | Height: | Size: 611 B |
BIN
src/assets/img/threeDimensionalChartBg.png
Normal file
|
After Width: | Height: | Size: 1.9 MiB |
@@ -14,7 +14,12 @@
|
|||||||
v-if="collapse"
|
v-if="collapse"
|
||||||
key="collapse"
|
key="collapse"
|
||||||
class="sidebar-logo-link"
|
class="sidebar-logo-link"
|
||||||
to="/">
|
:to="{
|
||||||
|
path: '/',
|
||||||
|
query: {
|
||||||
|
keyword: 'home',
|
||||||
|
},
|
||||||
|
}">
|
||||||
<img v-if="logo" :src="logo" class="sidebar-logo" />
|
<img v-if="logo" :src="logo" class="sidebar-logo" />
|
||||||
<h1
|
<h1
|
||||||
v-else
|
v-else
|
||||||
@@ -28,7 +33,16 @@
|
|||||||
{{ title }}
|
{{ title }}
|
||||||
</h1>
|
</h1>
|
||||||
</router-link>
|
</router-link>
|
||||||
<router-link v-else key="expand" class="sidebar-logo-link" to="/">
|
<router-link
|
||||||
|
v-else
|
||||||
|
key="expand"
|
||||||
|
class="sidebar-logo-link"
|
||||||
|
:to="{
|
||||||
|
path: '/',
|
||||||
|
query: {
|
||||||
|
keyword: 'home',
|
||||||
|
},
|
||||||
|
}">
|
||||||
<img v-if="logo" :src="logo" class="sidebar-logo" />
|
<img v-if="logo" :src="logo" class="sidebar-logo" />
|
||||||
<h1
|
<h1
|
||||||
class="sidebar-title"
|
class="sidebar-title"
|
||||||
|
|||||||
@@ -1,3 +1,10 @@
|
|||||||
|
<!--
|
||||||
|
* @Author: zwq
|
||||||
|
* @Date: 2026-01-06 15:18:41
|
||||||
|
* @LastEditors: zwq
|
||||||
|
* @LastEditTime: 2026-01-15 09:52:23
|
||||||
|
* @Description:
|
||||||
|
-->
|
||||||
<template>
|
<template>
|
||||||
<div v-if="!item.hidden">
|
<div v-if="!item.hidden">
|
||||||
<template v-if="hasOneShowingChild(item.children,item) && (!onlyOneChild.children||onlyOneChild.noShowingChildren)&&!item.alwaysShow">
|
<template v-if="hasOneShowingChild(item.children,item) && (!onlyOneChild.children||onlyOneChild.noShowingChildren)&&!item.alwaysShow">
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* @Author: zwq
|
* @Author: zwq
|
||||||
* @Date: 2022-08-24 11:19:43
|
* @Date: 2022-08-24 11:19:43
|
||||||
* @LastEditors: zwq
|
* @LastEditors: zwq
|
||||||
* @LastEditTime: 2024-04-02 09:33:29
|
* @LastEditTime: 2025-11-28 09:35:03
|
||||||
* @Description:
|
* @Description:
|
||||||
*/
|
*/
|
||||||
export default {
|
export default {
|
||||||
@@ -16,7 +16,7 @@ export default {
|
|||||||
},
|
},
|
||||||
tableData: [], //table数据
|
tableData: [], //table数据
|
||||||
listQuery: { //分页
|
listQuery: { //分页
|
||||||
pageSize: 10,
|
pageSize: 20,
|
||||||
pageNo: 1,
|
pageNo: 1,
|
||||||
total: 1,
|
total: 1,
|
||||||
},
|
},
|
||||||
@@ -69,7 +69,7 @@ export default {
|
|||||||
this.$refs.addOrUpdate.init(val.data.id);
|
this.$refs.addOrUpdate.init(val.data.id);
|
||||||
});
|
});
|
||||||
} else if (val.type === "delete") {
|
} else if (val.type === "delete") {
|
||||||
this.deleteHandle(val.data.id, val.data.name, val.data._pageIndex)
|
this.deleteHandle(val.data.id, val.data.name, val.data._pageIndex,val.data)
|
||||||
} else {
|
} else {
|
||||||
this.otherMethods(val)
|
this.otherMethods(val)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,10 @@
|
|||||||
|
/*
|
||||||
|
* @Author: zwq
|
||||||
|
* @Date: 2026-01-06 15:18:38
|
||||||
|
* @LastEditors: zwq
|
||||||
|
* @LastEditTime: 2026-01-15 09:54:44
|
||||||
|
* @Description:
|
||||||
|
*/
|
||||||
import router from './router'
|
import router from './router'
|
||||||
import store from './store'
|
import store from './store'
|
||||||
import { Message } from 'element-ui'
|
import { Message } from 'element-ui'
|
||||||
@@ -9,7 +16,7 @@ import { isRelogin } from '@/utils/request'
|
|||||||
NProgress.configure({ showSpinner: false })
|
NProgress.configure({ showSpinner: false })
|
||||||
|
|
||||||
// 增加三方登陆 update by 芋艿
|
// 增加三方登陆 update by 芋艿
|
||||||
const whiteList = ['/login', '/social-login', '/auth-redirect', '/bind', '/register', '/oauthLogin/gitee']
|
const whiteList = ['/login', '/social-login', 'screenbg', '/auth-redirect', '/bind', '/register', '/oauthLogin/gitee']
|
||||||
|
|
||||||
router.beforeEach((to, from, next) => {
|
router.beforeEach((to, from, next) => {
|
||||||
NProgress.start()
|
NProgress.start()
|
||||||
@@ -17,7 +24,12 @@ router.beforeEach((to, from, next) => {
|
|||||||
to.meta.title && store.dispatch('settings/setTitle', to.meta.title)
|
to.meta.title && store.dispatch('settings/setTitle', to.meta.title)
|
||||||
/* has token*/
|
/* has token*/
|
||||||
if (to.path === '/login') {
|
if (to.path === '/login') {
|
||||||
next({ path: '/' })
|
next({
|
||||||
|
path: '/',
|
||||||
|
query: {
|
||||||
|
keyword: 'home',
|
||||||
|
},
|
||||||
|
})
|
||||||
NProgress.done()
|
NProgress.done()
|
||||||
} else {
|
} else {
|
||||||
if (store.getters.roles.length === 0) {
|
if (store.getters.roles.length === 0) {
|
||||||
@@ -25,9 +37,9 @@ router.beforeEach((to, from, next) => {
|
|||||||
// 获取字典数据 add by 芋艿
|
// 获取字典数据 add by 芋艿
|
||||||
store.dispatch('dict/loadDictDatas')
|
store.dispatch('dict/loadDictDatas')
|
||||||
// 判断当前用户是否已拉取完 user_info 信息
|
// 判断当前用户是否已拉取完 user_info 信息
|
||||||
store.dispatch('GetInfo').then(() => {
|
store.dispatch('GetInfo').then(userInfo => {
|
||||||
isRelogin.show = false
|
isRelogin.show = false
|
||||||
store.dispatch('GenerateRoutes').then(accessRoutes => {
|
store.dispatch('GenerateRoutes', userInfo.menus).then(accessRoutes => {
|
||||||
// 根据 roles 权限生成可访问的路由表
|
// 根据 roles 权限生成可访问的路由表
|
||||||
router.addRoutes(accessRoutes) // 动态添加可访问路由表
|
router.addRoutes(accessRoutes) // 动态添加可访问路由表
|
||||||
next({ ...to, replace: true }) // hack方法 确保addRoutes已完成
|
next({ ...to, replace: true }) // hack方法 确保addRoutes已完成
|
||||||
@@ -35,7 +47,12 @@ router.beforeEach((to, from, next) => {
|
|||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
store.dispatch('LogOut').then(() => {
|
store.dispatch('LogOut').then(() => {
|
||||||
Message.error(err)
|
Message.error(err)
|
||||||
next({ path: '/' })
|
next({
|
||||||
|
path: '/',
|
||||||
|
query: {
|
||||||
|
keyword: 'home',
|
||||||
|
},
|
||||||
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -35,185 +35,239 @@ export const constantRoutes = [
|
|||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
path: '/redirect/:path(.*)',
|
path: '/redirect/:path(.*)',
|
||||||
component: (resolve) => require(['@/views/redirect'], resolve)
|
component: (resolve) => require(['@/views/redirect'], resolve),
|
||||||
}
|
},
|
||||||
]
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/login',
|
path: '/login',
|
||||||
component: (resolve) => require(['@/views/login'], resolve),
|
component: (resolve) => require(['@/views/login'], resolve),
|
||||||
hidden: true
|
// hidden: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
path: '/sso',
|
path: '/sso',
|
||||||
component: (resolve) => require(['@/views/sso'], resolve),
|
component: (resolve) => require(['@/views/sso'], resolve),
|
||||||
hidden: true
|
hidden: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/social-login',
|
path: '/social-login',
|
||||||
component: (resolve) => require(['@/views/socialLogin'], resolve),
|
component: (resolve) => require(['@/views/socialLogin'], resolve),
|
||||||
hidden: true
|
hidden: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/404',
|
path: '/404',
|
||||||
component: (resolve) => require(['@/views/error/404'], resolve),
|
component: (resolve) => require(['@/views/error/404'], resolve),
|
||||||
hidden: true
|
hidden: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/401',
|
path: '/401',
|
||||||
component: (resolve) => require(['@/views/error/401'], resolve),
|
component: (resolve) => require(['@/views/error/401'], resolve),
|
||||||
hidden: true
|
hidden: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/print-design',
|
path: '/print-design',
|
||||||
component: (resolve) => require(['@/views/print/design'], resolve),
|
component: (resolve) => require(['@/views/print/design'], resolve),
|
||||||
hidden: true
|
hidden: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "",
|
path: '',
|
||||||
component: Layout,
|
component: Layout,
|
||||||
redirect: "index",
|
redirect: 'index',
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
path: "index",
|
path: 'index',
|
||||||
component: (resolve) => require(["@/views/home/index"], resolve),
|
component: (resolve) => require(['@/views/productionVisualization/equipmentBoard'], resolve),
|
||||||
name: "首页",
|
name: '首页',
|
||||||
meta: { title: "首页", icon: "dashboard", affix: true },
|
meta: { title: '首页', icon: 'dashboard', affix: true },
|
||||||
hidden: true
|
hidden: true,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
props: (route) => ({
|
||||||
|
keyword: 'home',
|
||||||
|
})
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: '/screenbg',
|
||||||
|
component: () =>
|
||||||
|
import(
|
||||||
|
/* webpackChunkName: "about" */ '@/views/productionVisualization/equipmentBoard'
|
||||||
|
),
|
||||||
|
name: 'screenbg',
|
||||||
|
meta: { title: '大屏', icon: 'chart' },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/user',
|
path: '/user',
|
||||||
component: Layout,
|
component: Layout,
|
||||||
hidden: true,
|
hidden: true,
|
||||||
redirect: 'noredirect',
|
redirect: 'noredirect',
|
||||||
children: [{
|
children: [
|
||||||
|
{
|
||||||
path: 'profile',
|
path: 'profile',
|
||||||
component: (resolve) => require(['@/views/system/user/profile/index'], resolve),
|
component: (resolve) =>
|
||||||
|
require(['@/views/system/user/profile/index'], resolve),
|
||||||
name: 'Profile',
|
name: 'Profile',
|
||||||
meta: { title: '个人中心', icon: 'user' }
|
meta: { title: '个人中心', icon: 'user' },
|
||||||
}, {
|
},
|
||||||
|
{
|
||||||
path: 'notify-message',
|
path: 'notify-message',
|
||||||
component: (resolve) => require(['@/views/system/notify/my/index'], resolve),
|
component: (resolve) =>
|
||||||
|
require(['@/views/system/notify/my/index'], resolve),
|
||||||
name: 'MyNotifyMessage',
|
name: 'MyNotifyMessage',
|
||||||
meta: { title: '我的站内信', icon: 'message' },
|
meta: { title: '我的站内信', icon: 'message' },
|
||||||
}]
|
},
|
||||||
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/dict',
|
path: '/dict',
|
||||||
component: Layout,
|
component: Layout,
|
||||||
hidden: true,
|
hidden: true,
|
||||||
children: [{
|
children: [
|
||||||
|
{
|
||||||
path: 'type/data/:dictId(\\d+)',
|
path: 'type/data/:dictId(\\d+)',
|
||||||
component: (resolve) => require(['@/views/system/dict/data'], resolve),
|
component: (resolve) => require(['@/views/system/dict/data'], resolve),
|
||||||
name: 'SystemDictData',
|
name: 'SystemDictData',
|
||||||
meta: { title: '字典数据', icon: '', activeMenu: '/system/dict' }
|
meta: { title: '字典数据', icon: '', activeMenu: '/system/dict' },
|
||||||
}
|
},
|
||||||
]
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/job',
|
path: '/job',
|
||||||
component: Layout,
|
component: Layout,
|
||||||
hidden: true,
|
hidden: true,
|
||||||
children: [{
|
children: [
|
||||||
|
{
|
||||||
path: 'log',
|
path: 'log',
|
||||||
component: (resolve) => require(['@/views/infra/job/log'], resolve),
|
component: (resolve) => require(['@/views/infra/job/log'], resolve),
|
||||||
name: 'InfraJobLog',
|
name: 'InfraJobLog',
|
||||||
meta: { title: '调度日志', activeMenu: '/infra/job' }
|
meta: { title: '调度日志', activeMenu: '/infra/job' },
|
||||||
}
|
},
|
||||||
]
|
],
|
||||||
}, {
|
},
|
||||||
|
{
|
||||||
path: '/codegen',
|
path: '/codegen',
|
||||||
component: Layout,
|
component: Layout,
|
||||||
hidden: true,
|
hidden: true,
|
||||||
children: [{
|
children: [
|
||||||
|
{
|
||||||
path: 'edit/:tableId(\\d+)',
|
path: 'edit/:tableId(\\d+)',
|
||||||
component: (resolve) => require(['@/views/infra/codegen/editTable'], resolve),
|
component: (resolve) =>
|
||||||
|
require(['@/views/infra/codegen/editTable'], resolve),
|
||||||
name: 'InfraCodegenEditTable',
|
name: 'InfraCodegenEditTable',
|
||||||
meta: { title: '修改生成配置', activeMenu: '/infra/codegen' }
|
meta: { title: '修改生成配置', activeMenu: '/infra/codegen' },
|
||||||
}
|
},
|
||||||
]
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/bpm',
|
path: '/bpm',
|
||||||
component: Layout,
|
component: Layout,
|
||||||
hidden: true,
|
hidden: true,
|
||||||
redirect: 'noredirect',
|
redirect: 'noredirect',
|
||||||
children: [{
|
children: [
|
||||||
|
{
|
||||||
path: 'oa/leave/create',
|
path: 'oa/leave/create',
|
||||||
component: (resolve) => require(['@/views/bpm/oa/leave/create'], resolve),
|
component: (resolve) =>
|
||||||
|
require(['@/views/bpm/oa/leave/create'], resolve),
|
||||||
name: 'BpmOALeaveCreate',
|
name: 'BpmOALeaveCreate',
|
||||||
meta: { title: '发起 OA 请假', icon: 'form', activeMenu: '/bpm/oa/leave' }
|
meta: {
|
||||||
}, {
|
title: '发起 OA 请假',
|
||||||
|
icon: 'form',
|
||||||
|
activeMenu: '/bpm/oa/leave',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
path: 'oa/leave/detail',
|
path: 'oa/leave/detail',
|
||||||
component: (resolve) => require(['@/views/bpm/oa/leave/detail'], resolve),
|
component: (resolve) =>
|
||||||
|
require(['@/views/bpm/oa/leave/detail'], resolve),
|
||||||
name: 'BpmOALeaveDetail',
|
name: 'BpmOALeaveDetail',
|
||||||
meta: { title: '查看 OA 请假', icon: 'view', activeMenu: '/bpm/oa/leave' }
|
meta: {
|
||||||
}
|
title: '查看 OA 请假',
|
||||||
]
|
icon: 'view',
|
||||||
|
activeMenu: '/bpm/oa/leave',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/bpm',
|
path: '/bpm',
|
||||||
component: Layout,
|
component: Layout,
|
||||||
hidden: true,
|
hidden: true,
|
||||||
children: [{
|
children: [
|
||||||
|
{
|
||||||
path: 'manager/form/edit',
|
path: 'manager/form/edit',
|
||||||
component: (resolve) => require(['@/views/bpm/form/formEditor'], resolve),
|
component: (resolve) =>
|
||||||
|
require(['@/views/bpm/form/formEditor'], resolve),
|
||||||
name: 'BpmFormEditor',
|
name: 'BpmFormEditor',
|
||||||
meta: { title: '流程表单-编辑', activeMenu: '/bpm/manager/form' }
|
meta: { title: '流程表单-编辑', activeMenu: '/bpm/manager/form' },
|
||||||
}, {
|
},
|
||||||
|
{
|
||||||
path: 'manager/definition',
|
path: 'manager/definition',
|
||||||
component: (resolve) => require(['@/views/bpm/definition/index'], resolve),
|
component: (resolve) =>
|
||||||
|
require(['@/views/bpm/definition/index'], resolve),
|
||||||
name: 'BpmProcessDefinition',
|
name: 'BpmProcessDefinition',
|
||||||
meta: { title: '流程定义', activeMenu: '/bpm/manager/model' }
|
meta: { title: '流程定义', activeMenu: '/bpm/manager/model' },
|
||||||
}, {
|
},
|
||||||
|
{
|
||||||
path: 'manager/model/design',
|
path: 'manager/model/design',
|
||||||
component: (resolve) => require(['@/views/bpm/model/modelEditor'], resolve),
|
component: (resolve) =>
|
||||||
|
require(['@/views/bpm/model/modelEditor'], resolve),
|
||||||
name: 'BpmModelEditor',
|
name: 'BpmModelEditor',
|
||||||
meta: { title: '设计流程', activeMenu: '/bpm/manager/model' }
|
meta: { title: '设计流程', activeMenu: '/bpm/manager/model' },
|
||||||
}, {
|
},
|
||||||
|
{
|
||||||
path: 'process-instance/create',
|
path: 'process-instance/create',
|
||||||
component: (resolve) => require(['@/views/bpm/processInstance/create'], resolve),
|
component: (resolve) =>
|
||||||
|
require(['@/views/bpm/processInstance/create'], resolve),
|
||||||
name: 'BpmProcessInstanceCreate',
|
name: 'BpmProcessInstanceCreate',
|
||||||
meta: { title: '发起流程', activeMenu: '/bpm/task/my' }
|
meta: { title: '发起流程', activeMenu: '/bpm/task/my' },
|
||||||
}, {
|
},
|
||||||
|
{
|
||||||
path: 'process-instance/detail',
|
path: 'process-instance/detail',
|
||||||
component: (resolve) => require(['@/views/bpm/processInstance/detail'], resolve),
|
component: (resolve) =>
|
||||||
|
require(['@/views/bpm/processInstance/detail'], resolve),
|
||||||
name: 'BpmProcessInstanceDetail',
|
name: 'BpmProcessInstanceDetail',
|
||||||
meta: { title: '流程详情', activeMenu: '/bpm/task/my' }
|
meta: { title: '流程详情', activeMenu: '/bpm/task/my' },
|
||||||
}
|
},
|
||||||
]
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/property',
|
path: '/property',
|
||||||
component: Layout,
|
component: Layout,
|
||||||
hidden: true,
|
hidden: true,
|
||||||
children: [{
|
children: [
|
||||||
|
{
|
||||||
path: 'value/:propertyId(\\d+)',
|
path: 'value/:propertyId(\\d+)',
|
||||||
component: (resolve) => require(['@/views/mall/product/property/value'], resolve),
|
component: (resolve) =>
|
||||||
|
require(['@/views/mall/product/property/value'], resolve),
|
||||||
name: 'ProductPropertyValue',
|
name: 'ProductPropertyValue',
|
||||||
meta: { title: '商品属性值', icon: '', activeMenu: '/product/property' }
|
meta: {
|
||||||
}
|
title: '商品属性值',
|
||||||
]
|
icon: '',
|
||||||
|
activeMenu: '/product/property',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/spu',
|
path: '/spu',
|
||||||
component: Layout,
|
component: Layout,
|
||||||
hidden: true,
|
hidden: true,
|
||||||
children: [{
|
children: [
|
||||||
|
{
|
||||||
path: 'edit/:spuId(\\d+)',
|
path: 'edit/:spuId(\\d+)',
|
||||||
component: (resolve) => require(['@/views/mall/product/spu/save'], resolve),
|
component: (resolve) =>
|
||||||
|
require(['@/views/mall/product/spu/save'], resolve),
|
||||||
name: 'ProductSpuUpdate',
|
name: 'ProductSpuUpdate',
|
||||||
meta: { title: '修改商品', activeMenu: '/product/spu' }
|
meta: { title: '修改商品', activeMenu: '/product/spu' },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: 'add',
|
path: 'add',
|
||||||
component: (resolve) => require(['@/views/mall/product/spu/save'], resolve),
|
component: (resolve) =>
|
||||||
|
require(['@/views/mall/product/spu/save'], resolve),
|
||||||
name: 'ProductSpuCreate',
|
name: 'ProductSpuCreate',
|
||||||
meta: { title: '添加商品', activeMenu: '/product/spu' }
|
meta: { title: '添加商品', activeMenu: '/product/spu' },
|
||||||
}
|
},
|
||||||
]
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/trade/order',
|
path: '/trade/order',
|
||||||
@@ -225,26 +279,29 @@ export const constantRoutes = [
|
|||||||
name: 'TradeOrderDetail',
|
name: 'TradeOrderDetail',
|
||||||
hidden: true,
|
hidden: true,
|
||||||
meta: { title: '订单详情' },
|
meta: { title: '订单详情' },
|
||||||
component: (resolve) => require(['@/views/mall/trade/order/detail'], resolve)
|
component: (resolve) =>
|
||||||
}
|
require(['@/views/mall/trade/order/detail'], resolve),
|
||||||
]
|
},
|
||||||
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/pay',
|
path: '/pay',
|
||||||
component: Layout,
|
component: Layout,
|
||||||
hidden: true,
|
hidden: true,
|
||||||
children: [{
|
children: [
|
||||||
|
{
|
||||||
path: 'order/submit',
|
path: 'order/submit',
|
||||||
name: 'PayOrderSubmit',
|
name: 'PayOrderSubmit',
|
||||||
hidden: true,
|
hidden: true,
|
||||||
meta: {
|
meta: {
|
||||||
title: '收银台',
|
title: '收银台',
|
||||||
noCache: true
|
noCache: true,
|
||||||
},
|
},
|
||||||
component: (resolve) => require(['@/views/pay/order/submit'], resolve)
|
component: (resolve) => require(['@/views/pay/order/submit'], resolve),
|
||||||
}]
|
},
|
||||||
}
|
],
|
||||||
]
|
},
|
||||||
|
];
|
||||||
|
|
||||||
// 防止连续点击多次路由报错
|
// 防止连续点击多次路由报错
|
||||||
let routerPush = Router.prototype.push;
|
let routerPush = Router.prototype.push;
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
import {constantRoutes} from '@/router'
|
import {constantRoutes} from '@/router'
|
||||||
import {getRouters} from '@/api/menu'
|
|
||||||
import Layout from '@/layout/index'
|
import Layout from '@/layout/index'
|
||||||
import ParentView from '@/components/ParentView';
|
import ParentView from '@/components/ParentView';
|
||||||
import {toCamelCase} from "@/utils";
|
import {toCamelCase} from "@/utils";
|
||||||
@@ -27,13 +26,17 @@ const permission = {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
actions: {
|
actions: {
|
||||||
// 生成路由
|
/**
|
||||||
GenerateRoutes({commit}) {
|
* 生成路由
|
||||||
|
*
|
||||||
|
* @param commit commit 函数
|
||||||
|
* @param menus 路由参数
|
||||||
|
*/
|
||||||
|
GenerateRoutes({commit}, menus) {
|
||||||
return new Promise(resolve => {
|
return new Promise(resolve => {
|
||||||
// 向后端请求路由数据(菜单)
|
// 将 menus 菜单,转换为 route 路由数组
|
||||||
getRouters().then(res => {
|
const sdata = JSON.parse(JSON.stringify(menus)) // 【重要】用于菜单中的数据
|
||||||
const sdata = JSON.parse(JSON.stringify(res.data)) // 【重要】用于菜单中的数据
|
const rdata = JSON.parse(JSON.stringify(menus)) // 用于最后添加到 Router 中的数据
|
||||||
const rdata = JSON.parse(JSON.stringify(res.data)) // 用于最后添加到 Router 中的数据
|
|
||||||
const sidebarRoutes = filterAsyncRouter(sdata)
|
const sidebarRoutes = filterAsyncRouter(sdata)
|
||||||
const rewriteRoutes = filterAsyncRouter(rdata, false, true)
|
const rewriteRoutes = filterAsyncRouter(rdata, false, true)
|
||||||
rewriteRoutes.push({path: '*', redirect: '/404', hidden: true})
|
rewriteRoutes.push({path: '*', redirect: '/404', hidden: true})
|
||||||
@@ -43,7 +46,6 @@ const permission = {
|
|||||||
commit('SET_TOPBAR_ROUTES', sidebarRoutes)
|
commit('SET_TOPBAR_ROUTES', sidebarRoutes)
|
||||||
resolve(rewriteRoutes)
|
resolve(rewriteRoutes)
|
||||||
})
|
})
|
||||||
})
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
81
src/views/areavisual/lane/add-or-updata.vue
Normal file
@@ -0,0 +1,81 @@
|
|||||||
|
<!--
|
||||||
|
* @Author: zwq
|
||||||
|
* @Date: 2021-11-18 14:16:25
|
||||||
|
* @LastEditors: zwq
|
||||||
|
* @LastEditTime: 2025-11-28 14:38:31
|
||||||
|
* @Description:
|
||||||
|
-->
|
||||||
|
<template>
|
||||||
|
<el-form
|
||||||
|
:model="dataForm"
|
||||||
|
:rules="dataRule"
|
||||||
|
ref="dataForm"
|
||||||
|
@keyup.enter.native="dataFormSubmit()"
|
||||||
|
label-width="80px">
|
||||||
|
<el-row :gutter="20">
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="物料编码" prop="materialCode">
|
||||||
|
<el-input
|
||||||
|
v-model="dataForm.materialCode"
|
||||||
|
clearable
|
||||||
|
placeholder="请输入物料编码" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="物料型号" prop="materialName">
|
||||||
|
<el-input
|
||||||
|
v-model="dataForm.materialName"
|
||||||
|
clearable
|
||||||
|
placeholder="请输入物料型号" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row :gutter="20">
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="物料规格" prop="material">
|
||||||
|
<el-input
|
||||||
|
v-model="dataForm.material"
|
||||||
|
clearable
|
||||||
|
placeholder="请输入物料规格" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-form>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import basicAdd from '@/mixins/basic-add';
|
||||||
|
import { createProduct, updateProduct,getProduct } from '@/api/ssdl/product&recipe';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
mixins: [basicAdd],
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
urlOptions: {
|
||||||
|
createURL: createProduct,
|
||||||
|
updateURL: updateProduct,
|
||||||
|
infoURL: getProduct,
|
||||||
|
},
|
||||||
|
dataForm: {
|
||||||
|
id: undefined,
|
||||||
|
material: undefined,
|
||||||
|
materialName: undefined,
|
||||||
|
materialCode: undefined,
|
||||||
|
},
|
||||||
|
typeArr: [],
|
||||||
|
dataRule: {
|
||||||
|
materialCode: [
|
||||||
|
{ required: true, message: '物料编码不能为空', trigger: 'blur' },
|
||||||
|
],
|
||||||
|
materialName: [
|
||||||
|
{ required: true, message: '物料型号不能为空', trigger: 'blur' },
|
||||||
|
],
|
||||||
|
material: [
|
||||||
|
{ required: true, message: '规格不能为空', trigger: 'blur' },
|
||||||
|
],
|
||||||
|
},
|
||||||
|
};
|
||||||
|
},
|
||||||
|
methods: {},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
62
src/views/areavisual/lane/changeStatus.vue
Normal file
@@ -0,0 +1,62 @@
|
|||||||
|
<!--
|
||||||
|
* @Author: zwq
|
||||||
|
* @Date: 2025-10-11 14:41:12
|
||||||
|
* @LastEditors: zwq
|
||||||
|
* @LastEditTime: 2026-01-14 14:15:47
|
||||||
|
* @Description:
|
||||||
|
-->
|
||||||
|
<template>
|
||||||
|
<el-switch
|
||||||
|
@change="changeStatus"
|
||||||
|
size="small"
|
||||||
|
v-model="injectData.laneState"
|
||||||
|
:active-value="1"
|
||||||
|
:inactive-value="2"></el-switch>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { updateLane } from '@/api/areavisual/lane';
|
||||||
|
export default {
|
||||||
|
props: {
|
||||||
|
injectData: {
|
||||||
|
type: Object,
|
||||||
|
default: () => ({}),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {};
|
||||||
|
},
|
||||||
|
created() {},
|
||||||
|
methods: {
|
||||||
|
changeStatus(val) {
|
||||||
|
const pdata = { ...this.injectData, laneState: val };
|
||||||
|
this.$confirm(
|
||||||
|
`是否确认修改${'巷道 [ ' + this.injectData.laneName + ' ] '}的状态?`,
|
||||||
|
'更新状态',
|
||||||
|
{
|
||||||
|
confirmButtonText: '确认修改',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: 'warning',
|
||||||
|
}
|
||||||
|
)
|
||||||
|
.then(() => {
|
||||||
|
updateLane(pdata).then((res) => {
|
||||||
|
if (res.code === 0 || res.code === 200) {
|
||||||
|
this.$modal.msgSuccess('修改成功');
|
||||||
|
this.$emit('emitData');
|
||||||
|
} else {
|
||||||
|
this.$modal.msg(res.msg);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.catch((res) => {
|
||||||
|
this.$emit('emitData');
|
||||||
|
this.$message({
|
||||||
|
type: 'info',
|
||||||
|
message: '已取消',
|
||||||
|
});
|
||||||
|
});
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
@@ -1,40 +1,29 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<!-- 搜索工作栏 -->
|
|
||||||
<search-bar
|
<search-bar
|
||||||
:formConfigs="formConfig"
|
:formConfigs="formConfig"
|
||||||
ref="searchBarForm"
|
ref="searchBarForm"
|
||||||
@headBtnClick="buttonClick" />
|
@headBtnClick="buttonClick" />
|
||||||
|
|
||||||
<!-- 列表 -->
|
|
||||||
<base-table
|
<base-table
|
||||||
v-loading="dataListLoading"
|
v-loading="dataListLoading"
|
||||||
:table-props="tableProps"
|
:table-props="tableProps"
|
||||||
:page="listQuery.pageNo"
|
:page="listQuery.pageNo"
|
||||||
:limit="listQuery.pageSize"
|
:limit="listQuery.pageSize"
|
||||||
:table-data="tableData">
|
:table-data="tableData"
|
||||||
<method-btn
|
@emitFun="getDataList">
|
||||||
v-if="tableBtn.length"
|
|
||||||
slot="handleBtn"
|
|
||||||
:width="90"
|
|
||||||
label="操作"
|
|
||||||
:method-list="tableBtn"
|
|
||||||
@clickBtn="handleClick" />
|
|
||||||
</base-table>
|
</base-table>
|
||||||
<pagination
|
<pagination
|
||||||
:limit.sync="listQuery.pageSize"
|
:limit.sync="listQuery.pageSize"
|
||||||
:page.sync="listQuery.pageNo"
|
:page.sync="listQuery.pageNo"
|
||||||
:total="listQuery.total"
|
:total="listQuery.total"
|
||||||
@pagination="getDataList" />
|
@pagination="getDataList" />
|
||||||
|
|
||||||
<!-- 对话框(添加 / 修改) -->
|
|
||||||
<base-dialog
|
<base-dialog
|
||||||
:dialogTitle="addOrEditTitle"
|
:dialogTitle="addOrEditTitle"
|
||||||
:dialogVisible="addOrUpdateVisible"
|
:dialogVisible="addOrUpdateVisible"
|
||||||
@cancel="handleCancel"
|
@cancel="handleCancel"
|
||||||
@confirm="handleConfirm"
|
@confirm="handleConfirm"
|
||||||
:before-close="handleCancel"
|
:before-close="handleCancel"
|
||||||
width="40%">
|
width="50%">
|
||||||
<add-or-update
|
<add-or-update
|
||||||
ref="addOrUpdate"
|
ref="addOrUpdate"
|
||||||
@refreshDataList="successSubmit"></add-or-update>
|
@refreshDataList="successSubmit"></add-or-update>
|
||||||
@@ -44,39 +33,71 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import AddOrUpdate from './add-or-updata';
|
import AddOrUpdate from './add-or-updata';
|
||||||
import connectTime from './connectTime';
|
|
||||||
import basicPage from '@/mixins/basic-page';
|
import basicPage from '@/mixins/basic-page';
|
||||||
import { parseTime } from '@/filter/code-filter';
|
import { parseTime } from '@/filter/code-filter';
|
||||||
import {
|
import { deleteLane, getLanePage } from '@/api/areavisual/lane';
|
||||||
deleteMaterialPricing,
|
import changeStatus from './changeStatus.vue';
|
||||||
getMaterialPricingPage,
|
|
||||||
} from '@/api/base/materialPricing';
|
|
||||||
import { getMaterialPage } from '@/api/base/material';
|
|
||||||
|
|
||||||
|
const lane = [
|
||||||
|
{
|
||||||
|
id: '1',
|
||||||
|
name: 'A巷道',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: '2',
|
||||||
|
name: 'B巷道',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: '3',
|
||||||
|
name: 'C巷道',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: '4',
|
||||||
|
name: 'D巷道',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: '5',
|
||||||
|
name: 'E巷道',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: '6',
|
||||||
|
name: 'F巷道',
|
||||||
|
},
|
||||||
|
];
|
||||||
const tableProps = [
|
const tableProps = [
|
||||||
{
|
{
|
||||||
prop: 'name',
|
prop: 'laneCode',
|
||||||
label: '原料名称',
|
label: '巷道编码',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'code',
|
prop: 'laneName',
|
||||||
label: '原料编码',
|
label: '巷道名称',
|
||||||
width: 180,
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'price',
|
prop: 'lane',
|
||||||
label: '单价(元/吨)',
|
label: '巷道',
|
||||||
align: 'right',
|
filter: (val) => {
|
||||||
|
return lane.find((i) => i.id == val)
|
||||||
|
? lane.find((i) => i.id == val).name
|
||||||
|
: '-';
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'laneSort',
|
||||||
|
label: '巷道排序',
|
||||||
|
width:90,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'laneState',
|
||||||
|
label: '巷道状态',
|
||||||
|
width:90,
|
||||||
|
subcomponent: changeStatus,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'createTime',
|
prop: 'createTime',
|
||||||
label: '生效时间',
|
label: '创建时间',
|
||||||
width: 235,
|
filter: parseTime,
|
||||||
subcomponent: connectTime,
|
width: 150,
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: 'remark',
|
|
||||||
label: '备注',
|
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
@@ -85,75 +106,63 @@ export default {
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
urlOptions: {
|
urlOptions: {
|
||||||
getDataListURL: getMaterialPricingPage,
|
getDataListURL: getLanePage,
|
||||||
deleteURL: deleteMaterialPricing,
|
deleteURL: deleteLane,
|
||||||
},
|
},
|
||||||
tableProps,
|
tableProps,
|
||||||
tableBtn: [
|
tableBtn: [
|
||||||
this.$auth.hasPermi(`base:material-pricing:update`)
|
{
|
||||||
? {
|
|
||||||
type: 'edit',
|
type: 'edit',
|
||||||
btnName: '编辑',
|
btnName: '编辑',
|
||||||
}
|
},
|
||||||
: undefined,
|
{
|
||||||
this.$auth.hasPermi(`base:material-pricing:delete`)
|
|
||||||
? {
|
|
||||||
type: 'delete',
|
type: 'delete',
|
||||||
btnName: '删除',
|
btnName: '删除',
|
||||||
}
|
},
|
||||||
: undefined,
|
|
||||||
].filter((v) => v),
|
].filter((v) => v),
|
||||||
tableData: [],
|
tableData: [],
|
||||||
formConfig: [
|
formConfig: [
|
||||||
{
|
{
|
||||||
type: 'select',
|
type: 'input',
|
||||||
label: '原料名称',
|
label: '名称',
|
||||||
selectOptions: [],
|
placeholder: '名称',
|
||||||
param: 'name',
|
param: 'name',
|
||||||
filterable: true,
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: this.$auth.hasPermi('base:material-pricing:query')
|
type: 'input',
|
||||||
? 'button'
|
label: '编码',
|
||||||
: '',
|
placeholder: '编码',
|
||||||
btnName: '查询',
|
param: 'code',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'select',
|
||||||
|
label: '巷道',
|
||||||
|
selectOptions: lane,
|
||||||
|
placeholder: '请选择巷道',
|
||||||
|
param: 'lane',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'button',
|
||||||
|
btnName: '搜索',
|
||||||
name: 'search',
|
name: 'search',
|
||||||
color: 'primary',
|
color: 'primary',
|
||||||
},
|
},
|
||||||
{
|
|
||||||
type:
|
|
||||||
this.$auth.hasPermi('base:material-pricing:create') &&
|
|
||||||
this.$auth.hasPermi('base:material-pricing:query')
|
|
||||||
? 'separate'
|
|
||||||
: '',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: this.$auth.hasPermi('base:material-pricing:create')
|
|
||||||
? 'button'
|
|
||||||
: '',
|
|
||||||
btnName: '新增',
|
|
||||||
name: 'add',
|
|
||||||
color: 'success',
|
|
||||||
plain: true,
|
|
||||||
},
|
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
AddOrUpdate,
|
AddOrUpdate,
|
||||||
},
|
},
|
||||||
created() {
|
created() {},
|
||||||
getMaterialPage({ pageSize: 100, pageNo: 1 }).then((response) => {
|
|
||||||
this.formConfig[0].selectOptions = response.data.list;
|
|
||||||
});
|
|
||||||
},
|
|
||||||
methods: {
|
methods: {
|
||||||
buttonClick(val) {
|
buttonClick(val) {
|
||||||
switch (val.btnName) {
|
switch (val.btnName) {
|
||||||
case 'search':
|
case 'search':
|
||||||
this.listQuery.pageNo = 1;
|
this.listQuery.pageNo = 1;
|
||||||
this.listQuery.pageSize = 10;
|
this.listQuery.pageSize = 20;
|
||||||
this.listQuery.materialId = val.name;
|
this.listQuery.laneName = val.name;
|
||||||
|
this.listQuery.laneCode = val.code;
|
||||||
|
this.listQuery.lane = val.lane;
|
||||||
this.getDataList();
|
this.getDataList();
|
||||||
break;
|
break;
|
||||||
case 'reset':
|
case 'reset':
|
||||||
324
src/views/areavisual/lineEdgeLibrary/add-or-updata.vue
Normal file
@@ -0,0 +1,324 @@
|
|||||||
|
<!--
|
||||||
|
* @Author: zwq
|
||||||
|
* @Date: 2021-11-18 14:16:25
|
||||||
|
* @LastEditors: zwq
|
||||||
|
* @LastEditTime: 2026-01-15 09:16:36
|
||||||
|
* @Description:
|
||||||
|
-->
|
||||||
|
<template>
|
||||||
|
<el-form
|
||||||
|
:model="dataForm"
|
||||||
|
:rules="dataRule"
|
||||||
|
ref="dataForm"
|
||||||
|
@keyup.enter.native="dataFormSubmit()"
|
||||||
|
label-width="80px">
|
||||||
|
<div class="stat-card">
|
||||||
|
<div class="stat-icon">
|
||||||
|
<i class="el-icon-s-grid" style="color: #fff"></i>
|
||||||
|
</div>
|
||||||
|
<div class="stat-title">库位信息</div>
|
||||||
|
<div class="stat-content">
|
||||||
|
<div class="stat-value">{{ lineInfo.lineEdgeLibraryCode }}</div>
|
||||||
|
<div class="stat-label">{{ lineInfo.lineEdgeLibraryName }}</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<el-row :gutter="20">
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="物料" prop="materialId">
|
||||||
|
<el-select
|
||||||
|
style="width: 100%"
|
||||||
|
v-model="dataForm.materialId"
|
||||||
|
filterable
|
||||||
|
@change="setMaterial"
|
||||||
|
placeholder="请选择物料">
|
||||||
|
<el-option
|
||||||
|
v-for="item in productArr"
|
||||||
|
:key="item.id"
|
||||||
|
:label="
|
||||||
|
item.materialCode +
|
||||||
|
'-' +
|
||||||
|
item.materialName +
|
||||||
|
'-' +
|
||||||
|
item.material
|
||||||
|
"
|
||||||
|
:value="item.id"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="本盘长度" prop="cableLength">
|
||||||
|
<el-input-number
|
||||||
|
v-model="dataForm.cableLength"
|
||||||
|
:min="0"
|
||||||
|
:precision="2"></el-input-number>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="设备" prop="equipmentId">
|
||||||
|
<el-select
|
||||||
|
v-model="dataForm.equipmentId"
|
||||||
|
@change="setEquipment"
|
||||||
|
placeholder="请选择绞体">
|
||||||
|
<el-option
|
||||||
|
v-for="item in options1"
|
||||||
|
:key="item.id"
|
||||||
|
:label="item.equipmentName"
|
||||||
|
:value="item.id"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="应用套号" prop="suite">
|
||||||
|
<el-select v-model="dataForm.suite" placeholder="请选择应用套号">
|
||||||
|
<el-option
|
||||||
|
v-for="item in options2"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<span v-if="dataForm.suite == 2">
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="选择套号" prop="time">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="dataForm.time"
|
||||||
|
value-format="yyyy-MM-dd"
|
||||||
|
type="date"></el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="" prop="productionLine">
|
||||||
|
<el-select v-model="dataForm.productionLine">
|
||||||
|
<el-option
|
||||||
|
v-for="item in options3"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="" prop="numb">
|
||||||
|
<el-select v-model="dataForm.numb">
|
||||||
|
<el-option
|
||||||
|
v-for="item in options4"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</span>
|
||||||
|
</el-row>
|
||||||
|
</el-form>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import basicAdd from '@/mixins/basic-add';
|
||||||
|
import { getAllProductPage } from '@/api/ssdl/product&recipe';
|
||||||
|
import {
|
||||||
|
QKLineEdgeLibrary,
|
||||||
|
getEquipmentPage,
|
||||||
|
} from '@/api/areavisual/lineEdgeLibrary';
|
||||||
|
import { parseTime } from '@/filter/code-filter';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
mixins: [basicAdd],
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
urlOptions: {
|
||||||
|
createURL: QKLineEdgeLibrary,
|
||||||
|
},
|
||||||
|
dataForm: {
|
||||||
|
id: undefined,
|
||||||
|
materialId: undefined,
|
||||||
|
materialName: undefined,
|
||||||
|
materialCode: undefined,
|
||||||
|
material: undefined,
|
||||||
|
cableLength: undefined,
|
||||||
|
equipmentId: undefined,
|
||||||
|
equipmentName: undefined,
|
||||||
|
suite: undefined, //是否成套
|
||||||
|
suiteCode: undefined, //套号
|
||||||
|
time: this.parseTime(new Date(), '{y}-{m}-{d}'),
|
||||||
|
productionLine: undefined,
|
||||||
|
numb: undefined,
|
||||||
|
},
|
||||||
|
lineInfo: {},
|
||||||
|
productArr: [],
|
||||||
|
options1: [],
|
||||||
|
options2: [
|
||||||
|
{
|
||||||
|
value: 2,
|
||||||
|
label: '是',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: 1,
|
||||||
|
label: '否',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
options3: [
|
||||||
|
{
|
||||||
|
value: '6#',
|
||||||
|
label: '6#',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: '7#',
|
||||||
|
label: '7#',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: '8#',
|
||||||
|
label: '8#',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
options4: [
|
||||||
|
{
|
||||||
|
value: 0,
|
||||||
|
label: '0',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: 1,
|
||||||
|
label: '1',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: 2,
|
||||||
|
label: '2',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: 3,
|
||||||
|
label: '3',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: 4,
|
||||||
|
label: '4',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: 5,
|
||||||
|
label: '5',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: 6,
|
||||||
|
label: '6',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
dataRule: {
|
||||||
|
materialId: [
|
||||||
|
{ required: true, message: '物料不能为空', trigger: 'change' },
|
||||||
|
],
|
||||||
|
time: [{ required: true, message: '不能为空', trigger: 'change' }],
|
||||||
|
productionLine: [
|
||||||
|
{ required: true, message: '不能为空', trigger: 'change' },
|
||||||
|
],
|
||||||
|
numb: [{ required: true, message: '不能为空', trigger: 'change' }],
|
||||||
|
},
|
||||||
|
};
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
showLine(val) {
|
||||||
|
getAllProductPage().then((res) => {
|
||||||
|
this.productArr = res.data;
|
||||||
|
});
|
||||||
|
getEquipmentPage({ pageNo: 1, pageSize: 100, equipmentType: 2 }).then(
|
||||||
|
(res) => {
|
||||||
|
this.options1 = res.data.list;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
this.lineInfo = { ...val };
|
||||||
|
},
|
||||||
|
setMaterial() {
|
||||||
|
const data = this.productArr.find(
|
||||||
|
(i) => i.id === this.dataForm.materialId
|
||||||
|
);
|
||||||
|
this.dataForm.materialName = data.materialName;
|
||||||
|
this.dataForm.material = data.material;
|
||||||
|
this.dataForm.materialCode = data.materialCode;
|
||||||
|
},
|
||||||
|
setEquipment() {
|
||||||
|
const data = this.options1.find(
|
||||||
|
(i) => i.id === this.dataForm.equipmentId
|
||||||
|
);
|
||||||
|
this.dataForm.equipmentName = data.equipmentName;
|
||||||
|
},
|
||||||
|
// 表单提交
|
||||||
|
dataFormSubmit() {
|
||||||
|
this.$refs['dataForm'].validate((valid) => {
|
||||||
|
if (!valid) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (this.dataForm.suite == 2) {
|
||||||
|
this.dataForm.suiteCode =
|
||||||
|
this.dataForm.time +
|
||||||
|
'-' +
|
||||||
|
this.dataForm.productionLine +
|
||||||
|
'-' +
|
||||||
|
this.dataForm.numb;
|
||||||
|
}
|
||||||
|
QKLineEdgeLibrary({
|
||||||
|
...this.lineInfo,
|
||||||
|
...this.dataForm,
|
||||||
|
lineEdgeLibraryState: 1,
|
||||||
|
id: this.lineInfo.id,
|
||||||
|
}).then((response) => {
|
||||||
|
this.$modal.msgSuccess('操作成功');
|
||||||
|
this.visible = false;
|
||||||
|
this.$emit('refreshDataList');
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.stat-card {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
padding: 10px;
|
||||||
|
background: white;
|
||||||
|
border-radius: 12px;
|
||||||
|
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
|
||||||
|
transition: all 0.3s ease;
|
||||||
|
border-left: 4px solid;
|
||||||
|
border-color: #1a56db;
|
||||||
|
margin-bottom: 30px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* .stat-card:hover {
|
||||||
|
transform: translateY(-5px);
|
||||||
|
box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
|
||||||
|
} */
|
||||||
|
.stat-title {
|
||||||
|
margin: 0 10px;
|
||||||
|
color: #0051ff;
|
||||||
|
font-size: 20px;
|
||||||
|
}
|
||||||
|
.stat-icon {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
width: 60px;
|
||||||
|
height: 60px;
|
||||||
|
border-radius: 12px;
|
||||||
|
margin-right: 15px;
|
||||||
|
background: linear-gradient(to right, #1a56db, #0d47a1);
|
||||||
|
}
|
||||||
|
|
||||||
|
.stat-content {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
|
||||||
|
.stat-value {
|
||||||
|
font-size: 28px;
|
||||||
|
font-weight: 700;
|
||||||
|
line-height: 1.2;
|
||||||
|
color: #1a56db;
|
||||||
|
}
|
||||||
|
|
||||||
|
.stat-label {
|
||||||
|
font-size: 14px;
|
||||||
|
color: #64748b;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
318
src/views/areavisual/lineEdgeLibrary/index.vue
Normal file
@@ -0,0 +1,318 @@
|
|||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<search-bar
|
||||||
|
:formConfigs="formConfig"
|
||||||
|
ref="searchBarForm"
|
||||||
|
@headBtnClick="buttonClick" />
|
||||||
|
<base-table
|
||||||
|
v-loading="dataListLoading"
|
||||||
|
:table-props="tableProps"
|
||||||
|
:page="listQuery.pageNo"
|
||||||
|
:limit="listQuery.pageSize"
|
||||||
|
:table-data="tableData"
|
||||||
|
@emitFun="getDataList">
|
||||||
|
<method-btn
|
||||||
|
v-if="tableBtn.length"
|
||||||
|
slot="handleBtn"
|
||||||
|
:width="110"
|
||||||
|
label="操作"
|
||||||
|
:method-list="tableBtn"
|
||||||
|
@clickBtn="handleClick" />
|
||||||
|
</base-table>
|
||||||
|
<pagination
|
||||||
|
:limit.sync="listQuery.pageSize"
|
||||||
|
:page.sync="listQuery.pageNo"
|
||||||
|
:total="listQuery.total"
|
||||||
|
@pagination="getDataList" />
|
||||||
|
<base-dialog
|
||||||
|
:dialogTitle="addOrEditTitle"
|
||||||
|
:dialogVisible="addOrUpdateVisible"
|
||||||
|
@cancel="handleCancel"
|
||||||
|
@confirm="handleConfirm"
|
||||||
|
:before-close="handleCancel"
|
||||||
|
destroy-on-close
|
||||||
|
width="50%">
|
||||||
|
<add-or-update
|
||||||
|
ref="addOrUpdate"
|
||||||
|
@refreshDataList="successSubmit"></add-or-update>
|
||||||
|
</base-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import AddOrUpdate from './add-or-updata';
|
||||||
|
import basicPage from '@/mixins/basic-page';
|
||||||
|
import { parseTime } from '@/filter/code-filter';
|
||||||
|
import {
|
||||||
|
deleteLineEdgeLibrary,
|
||||||
|
getLineEdgeLibraryPage,
|
||||||
|
QKLineEdgeLibrary,
|
||||||
|
} from '@/api/areavisual/lineEdgeLibrary';
|
||||||
|
|
||||||
|
const laneRow = [
|
||||||
|
{
|
||||||
|
id: '1',
|
||||||
|
name: '第一排',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: '2',
|
||||||
|
name: '第二排',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: '3',
|
||||||
|
name: '第三排',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: '4',
|
||||||
|
name: '第四排',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: '5',
|
||||||
|
name: '第五排',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: '6',
|
||||||
|
name: '第六排',
|
||||||
|
},
|
||||||
|
];
|
||||||
|
const tableProps = [
|
||||||
|
{
|
||||||
|
prop: 'lineEdgeLibraryCode',
|
||||||
|
label: '线边库编码',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'lineEdgeLibraryName',
|
||||||
|
label: '线边库名称',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'agvGroundCode',
|
||||||
|
label: 'agv码',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'lineEdgeLibraryState',
|
||||||
|
label: '线边库状态',
|
||||||
|
width: 90,
|
||||||
|
filter: (val) => {
|
||||||
|
return val ? '满位' : '空闲';
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'usableState',
|
||||||
|
label: '是否可用',
|
||||||
|
width: 90,
|
||||||
|
filter: (val) => {
|
||||||
|
return ['', '可用', '不可用', '锁定'][val];
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'trayType',
|
||||||
|
label: '托盘类型',
|
||||||
|
width: 90,
|
||||||
|
filter: (val) => {
|
||||||
|
return val ? '笼式' : '盘式';
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'productionLine',
|
||||||
|
label: '产线',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'equipmentName',
|
||||||
|
label: '设备',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'suiteCode',
|
||||||
|
label: '套号',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'laneRow',
|
||||||
|
label: '巷道排',
|
||||||
|
filter: (val) => {
|
||||||
|
return laneRow.find((i) => i.id == val)
|
||||||
|
? laneRow.find((i) => i.id == val).name
|
||||||
|
: '-';
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'materialCode',
|
||||||
|
label: '物料',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'batch',
|
||||||
|
label: '批次',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'cableLength',
|
||||||
|
label: '线缆长度',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'createTime',
|
||||||
|
label: '创建时间',
|
||||||
|
filter: parseTime,
|
||||||
|
width: 150,
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
export default {
|
||||||
|
mixins: [basicPage],
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
urlOptions: {
|
||||||
|
getDataListURL: getLineEdgeLibraryPage,
|
||||||
|
deleteURL: deleteLineEdgeLibrary,
|
||||||
|
},
|
||||||
|
tableProps,
|
||||||
|
tableData: [],
|
||||||
|
tableBtn: [
|
||||||
|
{
|
||||||
|
type: 'clear',
|
||||||
|
btnName: '清空',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'add',
|
||||||
|
btnName: '添加',
|
||||||
|
},
|
||||||
|
].filter((v) => v),
|
||||||
|
formConfig: [
|
||||||
|
{
|
||||||
|
type: 'input',
|
||||||
|
label: '线边库名称',
|
||||||
|
placeholder: '线边库名称',
|
||||||
|
param: 'name',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'input',
|
||||||
|
label: '线边库编码',
|
||||||
|
placeholder: '线边库编码',
|
||||||
|
param: 'code',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'select',
|
||||||
|
label: '巷道排',
|
||||||
|
selectOptions: laneRow,
|
||||||
|
placeholder: '请选择巷道排',
|
||||||
|
param: 'laneRow',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'button',
|
||||||
|
btnName: '搜索',
|
||||||
|
name: 'search',
|
||||||
|
color: 'primary',
|
||||||
|
},
|
||||||
|
// {
|
||||||
|
// type: 'separate',
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// type: 'button',
|
||||||
|
// btnName: '重置',
|
||||||
|
// name: 'reset',
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// type: 'separate',
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// type: 'button',
|
||||||
|
// btnName: '新增',
|
||||||
|
// name: 'add',
|
||||||
|
// color: 'success',
|
||||||
|
// plain: true,
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// type: this.$auth.hasPermi('base:factory:create') ? 'separate' : '',
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// type: this.$auth.hasPermi('base:factory:export') ? 'button' : '',
|
||||||
|
// btnName: '导出',
|
||||||
|
// name: 'export',
|
||||||
|
// color: 'warning',
|
||||||
|
// },
|
||||||
|
],
|
||||||
|
};
|
||||||
|
},
|
||||||
|
components: {
|
||||||
|
AddOrUpdate,
|
||||||
|
},
|
||||||
|
created() {},
|
||||||
|
methods: {
|
||||||
|
buttonClick(val) {
|
||||||
|
switch (val.btnName) {
|
||||||
|
case 'search':
|
||||||
|
this.listQuery.pageNo = 1;
|
||||||
|
this.listQuery.pageSize = 20;
|
||||||
|
this.listQuery.lineEdgeLibraryName = val.name;
|
||||||
|
this.listQuery.lineEdgeLibraryCode = val.code;
|
||||||
|
this.listQuery.laneRow = val.laneRow;
|
||||||
|
this.getDataList();
|
||||||
|
break;
|
||||||
|
case 'reset':
|
||||||
|
this.$refs.searchBarForm.resetForm();
|
||||||
|
this.listQuery = {
|
||||||
|
pageSize: 20,
|
||||||
|
pageNo: 1,
|
||||||
|
total: 1,
|
||||||
|
};
|
||||||
|
this.getDataList();
|
||||||
|
break;
|
||||||
|
case 'add':
|
||||||
|
this.addOrEditTitle = '新增';
|
||||||
|
this.addOrUpdateVisible = true;
|
||||||
|
this.addOrUpdateHandle();
|
||||||
|
break;
|
||||||
|
case 'export':
|
||||||
|
this.handleExport();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
console.log(val);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
otherMethods(val) {
|
||||||
|
if (val.type == 'clear') {
|
||||||
|
if (val.data.usableState == 3) {
|
||||||
|
this.$confirm(
|
||||||
|
`当前库位为锁定状态,代表该库位有未完成的任务关联,是否确认清空${
|
||||||
|
'线边库名称为 ' + val.data.lineEdgeLibraryName + ' '
|
||||||
|
}的数据项?`,
|
||||||
|
'锁定库位清空提示',
|
||||||
|
{
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: 'warning',
|
||||||
|
}
|
||||||
|
)
|
||||||
|
.then(() => {
|
||||||
|
QKLineEdgeLibrary({...val.data,lineEdgeLibraryState:0,usableState:1 }).then(({ data }) => {
|
||||||
|
this.$message({
|
||||||
|
message: data,
|
||||||
|
type: 'success',
|
||||||
|
duration: 1500,
|
||||||
|
onClose: () => {
|
||||||
|
this.getDataList();
|
||||||
|
},
|
||||||
|
});
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.catch(() => {});
|
||||||
|
} else {
|
||||||
|
QKLineEdgeLibrary({...val.data,lineEdgeLibraryState:0,usableState:1 }).then(({ data }) => {
|
||||||
|
this.$message({
|
||||||
|
message: data,
|
||||||
|
type: 'success',
|
||||||
|
duration: 1500,
|
||||||
|
onClose: () => {
|
||||||
|
this.getDataList();
|
||||||
|
},
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} else if (val.type === 'add') {
|
||||||
|
this.addOrEditTitle = '添加货物';
|
||||||
|
this.addOrUpdateVisible = true;
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs.addOrUpdate.init();
|
||||||
|
this.$refs.addOrUpdate.showLine(val.data);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
326
src/views/areavisual/overview/components/add-or-updata.vue
Normal file
@@ -0,0 +1,326 @@
|
|||||||
|
<!--
|
||||||
|
* @Author: zwq
|
||||||
|
* @Date: 2021-11-18 14:16:25
|
||||||
|
* @LastEditors: zwq
|
||||||
|
* @LastEditTime: 2026-02-03 13:30:54
|
||||||
|
* @Description:
|
||||||
|
-->
|
||||||
|
<template>
|
||||||
|
<el-form
|
||||||
|
:model="dataForm"
|
||||||
|
:rules="dataRule"
|
||||||
|
ref="dataForm"
|
||||||
|
@keyup.enter.native="dataFormSubmit()"
|
||||||
|
label-width="80px">
|
||||||
|
<div class="stat-card">
|
||||||
|
<div class="stat-icon">
|
||||||
|
<i class="el-icon-s-grid" style="color: #fff"></i>
|
||||||
|
</div>
|
||||||
|
<div class="stat-title">库位信息</div>
|
||||||
|
<div class="stat-content">
|
||||||
|
<div class="stat-value">{{ lineInfo.lineEdgeLibraryCode }}</div>
|
||||||
|
<div class="stat-label">{{ lineInfo.lineEdgeLibraryName }}</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<el-row :gutter="20">
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="物料" prop="materialId">
|
||||||
|
<el-select
|
||||||
|
style="width: 100%"
|
||||||
|
v-model="dataForm.materialId"
|
||||||
|
filterable
|
||||||
|
@change="setMaterial"
|
||||||
|
placeholder="请选择物料">
|
||||||
|
<el-option
|
||||||
|
v-for="item in productArr"
|
||||||
|
:key="item.id"
|
||||||
|
:label="
|
||||||
|
item.materialCode +
|
||||||
|
'-' +
|
||||||
|
item.materialName +
|
||||||
|
'-' +
|
||||||
|
item.material
|
||||||
|
"
|
||||||
|
:value="item.id"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="本盘长度" prop="cableLength">
|
||||||
|
<el-input-number
|
||||||
|
v-model="dataForm.cableLength"
|
||||||
|
:min="0"
|
||||||
|
:precision="2"></el-input-number>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="设备" prop="equipmentId">
|
||||||
|
<el-select
|
||||||
|
v-model="dataForm.equipmentId"
|
||||||
|
@change="setEquipment"
|
||||||
|
placeholder="请选择绞体">
|
||||||
|
<el-option
|
||||||
|
v-for="item in options1"
|
||||||
|
:key="item.id"
|
||||||
|
:label="item.equipmentName"
|
||||||
|
:value="item.id"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="应用套号" prop="suite">
|
||||||
|
<el-select v-model="dataForm.suite" placeholder="请选择应用套号">
|
||||||
|
<el-option
|
||||||
|
v-for="item in options2"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<span v-if="dataForm.suite == 2">
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="选择套号" prop="time">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="dataForm.time"
|
||||||
|
value-format="yyyy-MM-dd"
|
||||||
|
type="date"></el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="" prop="productionLine">
|
||||||
|
<el-select v-model="dataForm.productionLine">
|
||||||
|
<el-option
|
||||||
|
v-for="item in options3"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="8">
|
||||||
|
<el-form-item label="" prop="numb">
|
||||||
|
<el-select v-model="dataForm.numb">
|
||||||
|
<el-option
|
||||||
|
v-for="item in options4"
|
||||||
|
:key="item.value"
|
||||||
|
:label="item.label"
|
||||||
|
:value="item.value"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</span>
|
||||||
|
</el-row>
|
||||||
|
</el-form>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import basicAdd from '@/mixins/basic-add';
|
||||||
|
import { getAllProductPage } from '@/api/ssdl/product&recipe';
|
||||||
|
import {
|
||||||
|
QKLineEdgeLibrary,
|
||||||
|
getEquipmentPage,
|
||||||
|
} from '@/api/areavisual/lineEdgeLibrary';
|
||||||
|
import { parseTime } from '@/filter/code-filter';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
mixins: [basicAdd],
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
urlOptions: {
|
||||||
|
createURL: QKLineEdgeLibrary,
|
||||||
|
},
|
||||||
|
dataForm: {
|
||||||
|
id: undefined,
|
||||||
|
materialId: undefined,
|
||||||
|
materialName: undefined,
|
||||||
|
materialCode: undefined,
|
||||||
|
material: undefined,
|
||||||
|
cableLength: undefined,
|
||||||
|
equipmentId: undefined,
|
||||||
|
equipmentName: undefined,
|
||||||
|
suite: undefined, //是否成套
|
||||||
|
suiteCode: undefined, //套号
|
||||||
|
time: this.parseTime(new Date(), '{y}-{m}-{d}'),
|
||||||
|
productionLine: undefined,
|
||||||
|
numb: undefined,
|
||||||
|
},
|
||||||
|
lineInfo: {},
|
||||||
|
productArr: [],
|
||||||
|
options1: [],
|
||||||
|
options2: [
|
||||||
|
{
|
||||||
|
value: 2,
|
||||||
|
label: '是',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: 1,
|
||||||
|
label: '否',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
options3: [
|
||||||
|
{
|
||||||
|
value: '6#',
|
||||||
|
label: '6#',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: '7#',
|
||||||
|
label: '7#',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: '8#',
|
||||||
|
label: '8#',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
options4: [
|
||||||
|
{
|
||||||
|
value: 0,
|
||||||
|
label: '0',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: 1,
|
||||||
|
label: '1',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: 2,
|
||||||
|
label: '2',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: 3,
|
||||||
|
label: '3',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: 4,
|
||||||
|
label: '4',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: 5,
|
||||||
|
label: '5',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
value: 6,
|
||||||
|
label: '6',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
dataRule: {
|
||||||
|
materialId: [
|
||||||
|
{ required: true, message: '物料不能为空', trigger: 'change' },
|
||||||
|
],
|
||||||
|
time: [{ required: true, message: '不能为空', trigger: 'change' }],
|
||||||
|
productionLine: [
|
||||||
|
{ required: true, message: '不能为空', trigger: 'change' },
|
||||||
|
],
|
||||||
|
numb: [{ required: true, message: '不能为空', trigger: 'change' }],
|
||||||
|
equipmentId: [{ required: true, message: '不能为空', trigger: 'change' }],
|
||||||
|
suite: [{ required: true, message: '不能为空', trigger: 'change' }],
|
||||||
|
},
|
||||||
|
};
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
showLine(val) {
|
||||||
|
getAllProductPage().then((res) => {
|
||||||
|
this.productArr = res.data;
|
||||||
|
});
|
||||||
|
getEquipmentPage({ pageNo: 1, pageSize: 100, equipmentType: 2 }).then(
|
||||||
|
(res) => {
|
||||||
|
this.options1 = res.data.list;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
this.lineInfo = { ...val };
|
||||||
|
},
|
||||||
|
setMaterial() {
|
||||||
|
const data = this.productArr.find(
|
||||||
|
(i) => i.id === this.dataForm.materialId
|
||||||
|
);
|
||||||
|
this.dataForm.materialName = data.materialName;
|
||||||
|
this.dataForm.material = data.material;
|
||||||
|
this.dataForm.materialCode = data.materialCode;
|
||||||
|
},
|
||||||
|
setEquipment() {
|
||||||
|
const data = this.options1.find(
|
||||||
|
(i) => i.id === this.dataForm.equipmentId
|
||||||
|
);
|
||||||
|
this.dataForm.equipmentName = data.equipmentName;
|
||||||
|
},
|
||||||
|
// 表单提交
|
||||||
|
dataFormSubmit() {
|
||||||
|
this.$refs['dataForm'].validate((valid) => {
|
||||||
|
if (!valid) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (this.dataForm.suite == 2) {
|
||||||
|
this.dataForm.suiteCode =
|
||||||
|
this.dataForm.time +
|
||||||
|
'-' +
|
||||||
|
this.dataForm.productionLine +
|
||||||
|
'-' +
|
||||||
|
this.dataForm.numb;
|
||||||
|
}
|
||||||
|
QKLineEdgeLibrary({
|
||||||
|
...this.lineInfo,
|
||||||
|
...this.dataForm,
|
||||||
|
lineEdgeLibraryState: 1,
|
||||||
|
id: this.lineInfo.id,
|
||||||
|
}).then((response) => {
|
||||||
|
this.$modal.msgSuccess('操作成功');
|
||||||
|
this.visible = false;
|
||||||
|
this.$emit('refreshDataList');
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.stat-card {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
padding: 10px;
|
||||||
|
background: white;
|
||||||
|
border-radius: 12px;
|
||||||
|
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
|
||||||
|
transition: all 0.3s ease;
|
||||||
|
border-left: 4px solid;
|
||||||
|
border-color: #1a56db;
|
||||||
|
margin-bottom: 30px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* .stat-card:hover {
|
||||||
|
transform: translateY(-5px);
|
||||||
|
box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
|
||||||
|
} */
|
||||||
|
.stat-title {
|
||||||
|
margin: 0 10px;
|
||||||
|
color: #0051ff;
|
||||||
|
font-size: 20px;
|
||||||
|
}
|
||||||
|
.stat-icon {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
width: 60px;
|
||||||
|
height: 60px;
|
||||||
|
border-radius: 12px;
|
||||||
|
margin-right: 15px;
|
||||||
|
background: linear-gradient(to right, #1a56db, #0d47a1);
|
||||||
|
}
|
||||||
|
|
||||||
|
.stat-content {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
|
||||||
|
.stat-value {
|
||||||
|
font-size: 28px;
|
||||||
|
font-weight: 700;
|
||||||
|
line-height: 1.2;
|
||||||
|
color: #1a56db;
|
||||||
|
}
|
||||||
|
|
||||||
|
.stat-label {
|
||||||
|
font-size: 14px;
|
||||||
|
color: #64748b;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -29,9 +29,9 @@ export default {
|
|||||||
type: String,
|
type: String,
|
||||||
default: '300px',
|
default: '300px',
|
||||||
},
|
},
|
||||||
barData: {
|
ringData: {
|
||||||
type: Array,
|
type: Object,
|
||||||
default: () => [],
|
default: () => {},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
@@ -74,7 +74,7 @@ export default {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
color: ['#288AFF', '#8EF0AB', '#FFDC94'],
|
color: ['#33B36B', '#3A8DFF', '#F59A23'],
|
||||||
tooltip: {
|
tooltip: {
|
||||||
trigger: 'axis',
|
trigger: 'axis',
|
||||||
axisPointer: {
|
axisPointer: {
|
||||||
@@ -85,83 +85,39 @@ export default {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
legend: {
|
legend: {
|
||||||
data: ['投入', '产出', '加工成品率'],
|
data: ['当前满位', '当前空位', '在途'],
|
||||||
},
|
},
|
||||||
grid: {
|
grid: {
|
||||||
containLabel: true,
|
containLabel: true,
|
||||||
},
|
},
|
||||||
xAxis: {
|
|
||||||
type: 'category',
|
|
||||||
data: this.barData.map((item) => {
|
|
||||||
return item.lineName;
|
|
||||||
}),
|
|
||||||
axisPointer: {
|
|
||||||
type: 'shadow',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
yAxis: [
|
|
||||||
{
|
|
||||||
type: 'value',
|
|
||||||
name: '投入/产出 片',
|
|
||||||
min: 0,
|
|
||||||
axisLabel: {
|
|
||||||
formatter: '{value}',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: 'value',
|
|
||||||
name: '加工成品率',
|
|
||||||
min: 0,
|
|
||||||
max: 100,
|
|
||||||
interval: 10,
|
|
||||||
axisLabel: {
|
|
||||||
formatter: '{value} %',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
|
||||||
series: [
|
series: [
|
||||||
{
|
{
|
||||||
name: '投入',
|
// name: '投入',
|
||||||
type: 'bar',
|
type: 'pie',
|
||||||
barWidth: '20',
|
radius: '50%',
|
||||||
data: this.barData.map((item) => {
|
data: [
|
||||||
return item.inputNum;
|
{
|
||||||
}),
|
name: '当前满位',
|
||||||
tooltip: {
|
value: this.ringData.occupiedQuantity
|
||||||
valueFormatter: function (value) {
|
|
||||||
return value + ' 片';
|
|
||||||
},
|
|
||||||
},
|
|
||||||
animationDuration,
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: '产出',
|
name: '当前空位',
|
||||||
type: 'bar',
|
value: this.ringData.idleQuantity
|
||||||
barWidth: '20',
|
|
||||||
data: this.barData.map((item) => {
|
|
||||||
return item.outputNum;
|
|
||||||
}),
|
|
||||||
tooltip: {
|
|
||||||
valueFormatter: function (value) {
|
|
||||||
return value + ' 片';
|
|
||||||
},
|
|
||||||
},
|
|
||||||
animationDuration,
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: '加工成品率',
|
name: '在途',
|
||||||
type: 'line',
|
value: this.ringData.transitQuantity
|
||||||
yAxisIndex: 1,
|
|
||||||
tooltip: {
|
|
||||||
valueFormatter: function (value) {
|
|
||||||
return value + ' %';
|
|
||||||
},
|
|
||||||
},
|
|
||||||
data: this.barData.map((item) => {
|
|
||||||
return item.processingRatio;
|
|
||||||
}),
|
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
emphasis: {
|
||||||
|
itemStyle: {
|
||||||
|
shadowBlur: 10,
|
||||||
|
shadowOffsetX: 0,
|
||||||
|
shadowColor: 'rgba(0, 0, 0, 0.5)'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
687
src/views/areavisual/overview/index.vue
Normal file
@@ -0,0 +1,687 @@
|
|||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<el-row class="overview-container">
|
||||||
|
<el-col :span="4" class="overview-container-left">
|
||||||
|
<el-row style="font-size: 18px; font-weight: bold; line-height: 36px">
|
||||||
|
库区选择
|
||||||
|
</el-row>
|
||||||
|
<el-input
|
||||||
|
v-model="areaSearchForm.regionName"
|
||||||
|
placeholder="库区名称"
|
||||||
|
@blur="getArea"
|
||||||
|
clearable />
|
||||||
|
<el-tree
|
||||||
|
:data="areaList"
|
||||||
|
:node-key="'id'"
|
||||||
|
:props="{ label: 'regionName' }"
|
||||||
|
@node-click="nodeClick" />
|
||||||
|
</el-col>
|
||||||
|
<el-col
|
||||||
|
:span="16"
|
||||||
|
v-if="changeType === 0"
|
||||||
|
class="overview-container-main">
|
||||||
|
<el-row>
|
||||||
|
<el-col
|
||||||
|
:span="8"
|
||||||
|
class="allarea-box"
|
||||||
|
v-for="item in allAreaList"
|
||||||
|
:key="item.id">
|
||||||
|
<div class="areainfo-box">
|
||||||
|
<div class="areainfo-box-header">
|
||||||
|
{{ item.regionName }}
|
||||||
|
</div>
|
||||||
|
<div class="areainfo-box-line">
|
||||||
|
<div
|
||||||
|
class="areainfo-box-line-item"
|
||||||
|
:style="{
|
||||||
|
width: `${(
|
||||||
|
(item.occupiedQuantity /
|
||||||
|
(item.totalInventory + item.transitQuantity)) *
|
||||||
|
100
|
||||||
|
).toFixed(2)}%`,
|
||||||
|
backgroundColor: '#33B36B',
|
||||||
|
}"></div>
|
||||||
|
<div
|
||||||
|
class="areainfo-box-line-item"
|
||||||
|
:style="{
|
||||||
|
width: `${(
|
||||||
|
(item.idleQuantity /
|
||||||
|
(item.totalInventory + item.transitQuantity)) *
|
||||||
|
100
|
||||||
|
).toFixed(2)}%`,
|
||||||
|
backgroundColor: '#3A8DFF',
|
||||||
|
}"></div>
|
||||||
|
<div
|
||||||
|
class="areainfo-box-line-item"
|
||||||
|
:style="{
|
||||||
|
width: `${(
|
||||||
|
(item.transitQuantity /
|
||||||
|
(item.totalInventory + item.transitQuantity)) *
|
||||||
|
100
|
||||||
|
).toFixed(2)}%`,
|
||||||
|
backgroundColor: '#F59A23',
|
||||||
|
}"></div>
|
||||||
|
</div>
|
||||||
|
<el-row class="areainfo-box-info">
|
||||||
|
<el-col class="areainfo-box-info-item" :span="6">
|
||||||
|
<p class="areainfo-box-info-item-count">
|
||||||
|
{{ item.totalInventory }}
|
||||||
|
</p>
|
||||||
|
<p class="areainfo-box-info-item-title">库位总数</p>
|
||||||
|
</el-col>
|
||||||
|
<el-col class="areainfo-box-info-item" :span="6">
|
||||||
|
<p
|
||||||
|
class="areainfo-box-info-item-count"
|
||||||
|
style="color: #33b36b">
|
||||||
|
{{ item.occupiedQuantity }}
|
||||||
|
</p>
|
||||||
|
<p class="areainfo-box-info-item-title">占</p>
|
||||||
|
</el-col>
|
||||||
|
<el-col class="areainfo-box-info-item" :span="6">
|
||||||
|
<p
|
||||||
|
class="areainfo-box-info-item-count"
|
||||||
|
style="color: #3a8dff">
|
||||||
|
{{ item.idleQuantity }}
|
||||||
|
</p>
|
||||||
|
<p class="areainfo-box-info-item-title">空</p>
|
||||||
|
</el-col>
|
||||||
|
<el-col class="areainfo-box-info-item" :span="6">
|
||||||
|
<p
|
||||||
|
class="areainfo-box-info-item-count"
|
||||||
|
style="color: #f59a23">
|
||||||
|
{{ item.transitQuantity }}
|
||||||
|
</p>
|
||||||
|
<p class="areainfo-box-info-item-title">在途</p>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</div>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-col>
|
||||||
|
<el-col
|
||||||
|
:span="4"
|
||||||
|
v-if="changeType === 0"
|
||||||
|
class="overview-container-right">
|
||||||
|
<el-tabs v-model="activeName" @tab-click="handleClickRight">
|
||||||
|
<el-tab-pane label="概览" name="first">
|
||||||
|
<el-row class="overview-container-right-alloverview">
|
||||||
|
<el-col
|
||||||
|
class="overview-container-right-alloverview-item"
|
||||||
|
:span="8">
|
||||||
|
<p class="overview-container-right-alloverview-item-count">
|
||||||
|
{{ allAreaInfo.totalInventory }}
|
||||||
|
</p>
|
||||||
|
<p class="overview-container-right-alloverview-item-title">
|
||||||
|
库位总数
|
||||||
|
</p>
|
||||||
|
</el-col>
|
||||||
|
<el-col
|
||||||
|
class="overview-container-right-alloverview-item"
|
||||||
|
:span="8">
|
||||||
|
<p class="overview-container-right-alloverview-item-count">
|
||||||
|
{{ allAreaInfo.occupiedQuantity }}
|
||||||
|
</p>
|
||||||
|
<p class="overview-container-right-alloverview-item-title">
|
||||||
|
当前满位
|
||||||
|
</p>
|
||||||
|
</el-col>
|
||||||
|
<el-col
|
||||||
|
class="overview-container-right-alloverview-item"
|
||||||
|
:span="8">
|
||||||
|
<p class="overview-container-right-alloverview-item-count">
|
||||||
|
{{ allAreaInfo.idleQuantity }}
|
||||||
|
</p>
|
||||||
|
<p class="overview-container-right-alloverview-item-title">
|
||||||
|
当前空位
|
||||||
|
</p>
|
||||||
|
</el-col>
|
||||||
|
<el-col
|
||||||
|
class="overview-container-right-alloverview-item"
|
||||||
|
:span="8">
|
||||||
|
<p class="overview-container-right-alloverview-item-count">
|
||||||
|
{{ allAreaInfo.transitQuantity }}
|
||||||
|
</p>
|
||||||
|
<p class="overview-container-right-alloverview-item-title">
|
||||||
|
在途
|
||||||
|
</p>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<ringChart :ring-data="allAreaInfo" ref="ringChart" />
|
||||||
|
</el-tab-pane>
|
||||||
|
<el-tab-pane label="在途任务" name="second">在途任务</el-tab-pane>
|
||||||
|
</el-tabs>
|
||||||
|
</el-col>
|
||||||
|
<el-col
|
||||||
|
:span="20"
|
||||||
|
v-if="changeType === 1"
|
||||||
|
class="overview-container-main">
|
||||||
|
<div class="stat-card">
|
||||||
|
<div class="stat-icon">
|
||||||
|
<i class="el-icon-s-grid" style="color: #fff"></i>
|
||||||
|
</div>
|
||||||
|
<div class="stat-title">库区信息</div>
|
||||||
|
<div class="stat-content">
|
||||||
|
<div class="stat-value">{{ getAreaInfoInfo.regionName }}</div>
|
||||||
|
<div class="stat-label">{{ getAreaInfoInfo.regionCode }}</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="area-body">
|
||||||
|
<div v-for="item in Object.keys(areaInfo)" :key="item">
|
||||||
|
<el-button size="mini" style="width:189px;" type="primary" @click="clearAll(item)">
|
||||||
|
一键清空
|
||||||
|
</el-button>
|
||||||
|
<div class="potTitle">{{ item }}</div>
|
||||||
|
<div class="potList">
|
||||||
|
<div v-for="sitem in areaInfo[item]" :key="sitem.id">
|
||||||
|
<div v-if="sitem.empty" class="area-div-empty" />
|
||||||
|
<div v-else class="area-div" :title="sitem.lineEdgeLibraryName">
|
||||||
|
<el-popover
|
||||||
|
placement="top-start"
|
||||||
|
:title="sitem.lineEdgeLibraryCode"
|
||||||
|
width="200"
|
||||||
|
trigger="hover">
|
||||||
|
<div class="point" />
|
||||||
|
<span style="font-weight: 600">名称:</span>
|
||||||
|
{{ sitem.lineEdgeLibraryName }}
|
||||||
|
<br />
|
||||||
|
<div class="point" />
|
||||||
|
<span style="font-weight: 600">状态:</span>
|
||||||
|
{{
|
||||||
|
sitem.usableState == 3
|
||||||
|
? '锁定'
|
||||||
|
: sitem.usableState == 2
|
||||||
|
? '不可用'
|
||||||
|
: sitem.lineEdgeLibraryState == 1
|
||||||
|
? '满位'
|
||||||
|
: '空闲'
|
||||||
|
}}
|
||||||
|
<br />
|
||||||
|
<span
|
||||||
|
v-if="sitem.usableState == 3 ||
|
||||||
|
(sitem.usableState == 1 &&
|
||||||
|
sitem.lineEdgeLibraryState == 1)
|
||||||
|
">
|
||||||
|
<span style="font-weight: 600">物料:</span>
|
||||||
|
{{ sitem.materialCode || '' }}
|
||||||
|
<br />
|
||||||
|
<span style="font-weight: 600">设备:</span>
|
||||||
|
{{ sitem.equipmentName || '' }}
|
||||||
|
<br />
|
||||||
|
<span style="font-weight: 600">套号:</span>
|
||||||
|
{{ sitem.suiteCode || '' }}
|
||||||
|
<br />
|
||||||
|
</span>
|
||||||
|
<el-button type="text" @click="clearLine(sitem)">
|
||||||
|
清空
|
||||||
|
</el-button>
|
||||||
|
<el-button type="text" @click="addLine(sitem)">
|
||||||
|
添加
|
||||||
|
</el-button>
|
||||||
|
<div
|
||||||
|
class="area-icon"
|
||||||
|
:style="{
|
||||||
|
backgroundColor:
|
||||||
|
sitem.usableState == 3
|
||||||
|
? '#E6A23C'
|
||||||
|
: sitem.usableState == 2
|
||||||
|
? 'gray'
|
||||||
|
: sitem.lineEdgeLibraryState == 1
|
||||||
|
? '#67C23A'
|
||||||
|
: '',
|
||||||
|
}"
|
||||||
|
slot="reference">
|
||||||
|
<i
|
||||||
|
:class="
|
||||||
|
sitem.usableState == 3
|
||||||
|
? 'el-icon-lock'
|
||||||
|
: 'el-icon-s-grid'
|
||||||
|
"
|
||||||
|
style="color: #fff"></i>
|
||||||
|
</div>
|
||||||
|
</el-popover>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<base-dialog
|
||||||
|
:dialogTitle="addOrEditTitle"
|
||||||
|
:dialogVisible="addOrUpdateVisible"
|
||||||
|
@cancel="handleCancel"
|
||||||
|
@confirm="handleConfirm"
|
||||||
|
:before-close="handleCancel"
|
||||||
|
destroy-on-close
|
||||||
|
width="50%">
|
||||||
|
<add-or-update
|
||||||
|
ref="addOrUpdate"
|
||||||
|
@refreshDataList="successSubmit"></add-or-update>
|
||||||
|
</base-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
// import basicPage from '@/mixins/basic-page';
|
||||||
|
import ringChart from './components/ringChart.vue';
|
||||||
|
import AddOrUpdate from './components/add-or-updata';
|
||||||
|
import basicPage from '@/mixins/basic-page';
|
||||||
|
import {
|
||||||
|
getAreaList,
|
||||||
|
postAllAreaInfo,
|
||||||
|
postAllAreaOverview,
|
||||||
|
postAreaInfo,
|
||||||
|
} from '@/api/areavisual/overview';
|
||||||
|
import { QKLineEdgeLibrary,AllQKLineEdgeLibrary } from '@/api/areavisual/lineEdgeLibrary';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'overview',
|
||||||
|
mixins: [basicPage],
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
areaList: [
|
||||||
|
{
|
||||||
|
id: 0,
|
||||||
|
regionName: '全部库区',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
areaSearchForm: {
|
||||||
|
pageNo: 1,
|
||||||
|
pageSize: 100,
|
||||||
|
regionName: '',
|
||||||
|
},
|
||||||
|
changeType: 0,
|
||||||
|
allAreaList: [],
|
||||||
|
allAreaInfo: {
|
||||||
|
totalInventory: 0,
|
||||||
|
occupiedQuantity: 0,
|
||||||
|
idleQuantity: 0,
|
||||||
|
transitQuantity: 0,
|
||||||
|
},
|
||||||
|
areaInfo: {},
|
||||||
|
activeName: 'first',
|
||||||
|
getAreaInfoInfo: {},
|
||||||
|
};
|
||||||
|
},
|
||||||
|
components: {
|
||||||
|
ringChart,
|
||||||
|
AddOrUpdate,
|
||||||
|
},
|
||||||
|
async created() {
|
||||||
|
this.getArea();
|
||||||
|
this.getAllAreaInfo();
|
||||||
|
this.getAllAreaOverview();
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
activeName: (val) => {
|
||||||
|
if (val === 'first') {
|
||||||
|
this.getAllAreaOverview();
|
||||||
|
} else if (val === 'second') {
|
||||||
|
this.getNowTaskList();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
// 获取库区列表
|
||||||
|
async getArea() {
|
||||||
|
const res = await getAreaList(this.areaSearchForm);
|
||||||
|
if (res.code === 0 && res.data) {
|
||||||
|
(this.areaList = [
|
||||||
|
{
|
||||||
|
id: 0,
|
||||||
|
regionName: '全部库区',
|
||||||
|
},
|
||||||
|
]),
|
||||||
|
this.areaList.push(...res.data.list);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 库区选择
|
||||||
|
nodeClick(data, node, components) {
|
||||||
|
if (data.id === 0) {
|
||||||
|
this.changeType = 0;
|
||||||
|
this.activeName = 'first';
|
||||||
|
this.getAllAreaInfo();
|
||||||
|
} else {
|
||||||
|
this.getAreaInfoInfo = data; //把库区存下,方便刷新
|
||||||
|
this.changeType = 1;
|
||||||
|
this.getAreaInfo(data.id);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 获取全部库区概览信息
|
||||||
|
async getAllAreaInfo() {
|
||||||
|
const res = await postAllAreaInfo([]);
|
||||||
|
console.log(res);
|
||||||
|
if (res.code === 0 && res.data) {
|
||||||
|
this.allAreaList = res.data;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 获取库区概览
|
||||||
|
async getAllAreaOverview() {
|
||||||
|
const res = await postAllAreaOverview([]);
|
||||||
|
console.log(res);
|
||||||
|
if (res.code === 0 && res.data) {
|
||||||
|
this.allAreaInfo = res.data;
|
||||||
|
this.$refs.ringChart.initChart();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 获取在途任务
|
||||||
|
async getNowTaskList() {},
|
||||||
|
// 获取单库区信息
|
||||||
|
async getAreaInfo(id) {
|
||||||
|
const res = await postAreaInfo({ id });
|
||||||
|
if (res.code === 0 && res.data) {
|
||||||
|
// 按巷道号分组
|
||||||
|
this.areaInfo = res.data.reduce((result, item) => {
|
||||||
|
// 提取巷道号
|
||||||
|
const laneNumber = item.lineEdgeLibraryCode.substring(3, 5) + ' 巷道';
|
||||||
|
|
||||||
|
// 如果该巷道还没有分组,创建一个空数组
|
||||||
|
if (!result[laneNumber]) {
|
||||||
|
result[laneNumber] = [];
|
||||||
|
}
|
||||||
|
|
||||||
|
// 将当前项添加到对应巷道的数组中
|
||||||
|
result[laneNumber].push(item);
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}, {});
|
||||||
|
Object.keys(this.areaInfo).forEach((key) => {
|
||||||
|
const arr = this.areaInfo[key];
|
||||||
|
let emptyNum = 0;
|
||||||
|
let insetEmpty = [];
|
||||||
|
arr.forEach((item, index) => {
|
||||||
|
if (
|
||||||
|
!item.empty &&
|
||||||
|
item.lineEdgeLibraryCode.substring(5, 7) !=
|
||||||
|
Math.floor(index / 2) + 1 + emptyNum &&
|
||||||
|
item.lineEdgeLibraryCode[item.lineEdgeLibraryCode.length - 1] ==
|
||||||
|
'L'
|
||||||
|
) {
|
||||||
|
let num =
|
||||||
|
Number(item.lineEdgeLibraryCode.substring(5, 7)) -
|
||||||
|
(Math.floor(index / 2) + 1 + emptyNum);
|
||||||
|
insetEmpty.push({
|
||||||
|
index,
|
||||||
|
num,
|
||||||
|
});
|
||||||
|
emptyNum += num;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
insetEmpty.forEach((item) => {
|
||||||
|
const arrEmpty = Array.from({ length: item.num * 2 }, () => ({
|
||||||
|
empty: true,
|
||||||
|
}));
|
||||||
|
arr.splice(item.index, 0, ...arrEmpty);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
getDataList() {},
|
||||||
|
// 全部库区右侧分页点击
|
||||||
|
handleClickRight(tab, event) {
|
||||||
|
console.log(tab, event);
|
||||||
|
},
|
||||||
|
clearLine(val) {
|
||||||
|
if (val.usableState == 3) {
|
||||||
|
this.$confirm(
|
||||||
|
`当前库位为锁定状态,代表该库位有未完成的任务关联,是否确认清空${
|
||||||
|
'线边库名称为 ' + val.lineEdgeLibraryName + ' '
|
||||||
|
}的数据项?`,
|
||||||
|
'锁定库位清空提示',
|
||||||
|
{
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: 'warning',
|
||||||
|
}
|
||||||
|
)
|
||||||
|
.then(() => {
|
||||||
|
QKLineEdgeLibrary({
|
||||||
|
...val,
|
||||||
|
lineEdgeLibraryState: 0,
|
||||||
|
usableState: 1,
|
||||||
|
}).then(({ data }) => {
|
||||||
|
this.$message({
|
||||||
|
message: data,
|
||||||
|
type: 'success',
|
||||||
|
duration: 1500,
|
||||||
|
onClose: () => {
|
||||||
|
this.getAreaInfo(this.getAreaInfoInfo.id);
|
||||||
|
},
|
||||||
|
});
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.catch(() => {});
|
||||||
|
} else {
|
||||||
|
QKLineEdgeLibrary({
|
||||||
|
...val,
|
||||||
|
lineEdgeLibraryState: 0,
|
||||||
|
usableState: 1,
|
||||||
|
}).then(({ data }) => {
|
||||||
|
this.$message({
|
||||||
|
message: data,
|
||||||
|
type: 'success',
|
||||||
|
duration: 1500,
|
||||||
|
onClose: () => {
|
||||||
|
this.getAreaInfo(this.getAreaInfoInfo.id);
|
||||||
|
},
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
addLine(val) {
|
||||||
|
this.addOrEditTitle = '添加货物';
|
||||||
|
this.addOrUpdateVisible = true;
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs.addOrUpdate.init();
|
||||||
|
this.$refs.addOrUpdate.showLine(val);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// dialog的父组件方法this.$emit("refreshDataList");
|
||||||
|
successSubmit() {
|
||||||
|
this.handleCancel();
|
||||||
|
this.getAreaInfo(this.getAreaInfoInfo.id);
|
||||||
|
},
|
||||||
|
clearAll(item) {
|
||||||
|
if (this.areaInfo[item].length > 0) {
|
||||||
|
AllQKLineEdgeLibrary({
|
||||||
|
...this.areaInfo[item][0],
|
||||||
|
lineEdgeLibraryState: 0,
|
||||||
|
usableState: 1,
|
||||||
|
}).then(({ data }) => {
|
||||||
|
this.$message({
|
||||||
|
message: data,
|
||||||
|
type: 'success',
|
||||||
|
duration: 1500,
|
||||||
|
onClose: () => {
|
||||||
|
this.getAreaInfo(this.getAreaInfoInfo.id);
|
||||||
|
},
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
.overview-container {
|
||||||
|
max-height: calc(100vh - 120px - 8px);
|
||||||
|
overflow: scroll;
|
||||||
|
.overview-container-left {
|
||||||
|
padding-right: 12px;
|
||||||
|
}
|
||||||
|
.overview-container-main {
|
||||||
|
.allarea-box {
|
||||||
|
padding: 10px;
|
||||||
|
.areainfo-box {
|
||||||
|
border: 1px solid #bbb;
|
||||||
|
border-radius: 5px;
|
||||||
|
padding: 10px;
|
||||||
|
.areainfo-box-header {
|
||||||
|
font-size: 16px;
|
||||||
|
font-weight: bold;
|
||||||
|
white-space: nowrap; /* 禁止换行 */
|
||||||
|
overflow: hidden; /* 隐藏溢出内容 */
|
||||||
|
text-overflow: ellipsis; /* 溢出部分显示省略号 */
|
||||||
|
}
|
||||||
|
.areainfo-box-line {
|
||||||
|
width: 100%;
|
||||||
|
.areainfo-box-line-item {
|
||||||
|
height: 5px;
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.areainfo-box-info {
|
||||||
|
.areainfo-box-info-item {
|
||||||
|
text-align: center;
|
||||||
|
font-size: 12px;
|
||||||
|
.areainfo-box-info-item-count {
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.overview-container-right {
|
||||||
|
.overview-container-right-alloverview {
|
||||||
|
.overview-container-right-alloverview-item {
|
||||||
|
text-align: center;
|
||||||
|
.overview-container-right-alloverview-item-count {
|
||||||
|
font-size: 14px;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<style lang="scss">
|
||||||
|
.el-tree-node__content {
|
||||||
|
height: 40px;
|
||||||
|
line-height: 40px;
|
||||||
|
}
|
||||||
|
.el-tree-node__label {
|
||||||
|
display: block;
|
||||||
|
width: calc(100% - 24px);
|
||||||
|
text-align: center;
|
||||||
|
white-space: nowrap; /* 禁止换行 */
|
||||||
|
overflow: hidden; /* 隐藏溢出内容 */
|
||||||
|
text-overflow: ellipsis; /* 溢出部分显示省略号 */
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.area-body {
|
||||||
|
margin-top: 10px;
|
||||||
|
margin-left: 10px;
|
||||||
|
overflow-x: auto;
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
.potTitle {
|
||||||
|
width: 190px;
|
||||||
|
background-color: rgb(169, 235, 249);
|
||||||
|
border-radius: 3px;
|
||||||
|
margin-right: 5px;
|
||||||
|
text-align: center;
|
||||||
|
color: #000000;
|
||||||
|
letter-spacing: 1px;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
font-size: 16px;
|
||||||
|
padding: 5px;
|
||||||
|
}
|
||||||
|
.potList {
|
||||||
|
width: 190px;
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: 90px 90px;
|
||||||
|
gap: 8px;
|
||||||
|
}
|
||||||
|
.area-div {
|
||||||
|
padding: 10px;
|
||||||
|
background: white;
|
||||||
|
border-radius: 12px;
|
||||||
|
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
|
||||||
|
transition: all 0.3s ease;
|
||||||
|
border: 4px solid #1a56db;
|
||||||
|
margin-bottom: 30px;
|
||||||
|
}
|
||||||
|
.area-div-empty {
|
||||||
|
background: white;
|
||||||
|
width: 90px;
|
||||||
|
height: 88px;
|
||||||
|
margin-bottom: 30px;
|
||||||
|
}
|
||||||
|
.point {
|
||||||
|
width: 5px;
|
||||||
|
height: 5px;
|
||||||
|
border-radius: 50%;
|
||||||
|
background-color: #409eff;
|
||||||
|
float: left;
|
||||||
|
margin-top: 7px;
|
||||||
|
margin-right: 5px;
|
||||||
|
}
|
||||||
|
.area-icon {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
margin: auto;
|
||||||
|
width: 60px;
|
||||||
|
height: 60px;
|
||||||
|
border-radius: 12px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.stat-card {
|
||||||
|
margin-top: 10px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
padding: 10px;
|
||||||
|
background: white;
|
||||||
|
border-radius: 12px;
|
||||||
|
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
|
||||||
|
transition: all 0.3s ease;
|
||||||
|
border-left: 4px solid;
|
||||||
|
border-color: #1a56db;
|
||||||
|
margin-bottom: 30px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* .stat-card:hover {
|
||||||
|
transform: translateY(-5px);
|
||||||
|
box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
|
||||||
|
} */
|
||||||
|
.stat-title {
|
||||||
|
margin: 0 10px;
|
||||||
|
color: #0051ff;
|
||||||
|
font-size: 20px;
|
||||||
|
}
|
||||||
|
.stat-icon {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
width: 60px;
|
||||||
|
height: 60px;
|
||||||
|
border-radius: 12px;
|
||||||
|
margin-right: 15px;
|
||||||
|
background: linear-gradient(to right, #1a56db, #0d47a1);
|
||||||
|
}
|
||||||
|
|
||||||
|
.stat-content {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
|
||||||
|
.stat-value {
|
||||||
|
font-size: 28px;
|
||||||
|
font-weight: 700;
|
||||||
|
line-height: 1.2;
|
||||||
|
color: #1a56db;
|
||||||
|
}
|
||||||
|
|
||||||
|
.stat-label {
|
||||||
|
font-size: 14px;
|
||||||
|
color: #64748b;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -34,12 +34,12 @@
|
|||||||
v-if="section.key == 'base'"
|
v-if="section.key == 'base'"
|
||||||
style="margin-bottom: 32px">
|
style="margin-bottom: 32px">
|
||||||
<el-skeleton v-if="!showForm" animated />
|
<el-skeleton v-if="!showForm" animated />
|
||||||
<EquipmentInfoForm
|
<!-- <EquipmentInfoForm
|
||||||
key="drawer-dialog-form"
|
key="drawer-dialog-form"
|
||||||
v-if="showForm"
|
v-if="showForm"
|
||||||
:disabled="mode.includes('detail')"
|
:disabled="mode.includes('detail')"
|
||||||
:sync-filelist="syncFileListFlag"
|
:sync-filelist="syncFileListFlag"
|
||||||
v-model="form" />
|
v-model="form" /> -->
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div v-if="section.key == 'attrs'" style="margin-top: 12px">
|
<div v-if="section.key == 'attrs'" style="margin-top: 12px">
|
||||||
@@ -86,30 +86,10 @@
|
|||||||
</el-button> -->
|
</el-button> -->
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 属性对话框 -->
|
|
||||||
<base-dialog
|
|
||||||
v-if="sections[1].allowAdd"
|
|
||||||
:dialogTitle="attrTitle"
|
|
||||||
:dialogVisible="attrFormVisible"
|
|
||||||
width="35%"
|
|
||||||
:append-to-body="true"
|
|
||||||
custom-class="baseDialog"
|
|
||||||
@close="closeAttrForm"
|
|
||||||
@cancel="closeAttrForm"
|
|
||||||
@confirm="submitAttrForm">
|
|
||||||
<DialogForm
|
|
||||||
v-if="attrFormVisible"
|
|
||||||
ref="attrForm"
|
|
||||||
:dataForm="attrForm"
|
|
||||||
:rows="attrRows" />
|
|
||||||
</base-dialog>
|
|
||||||
</el-drawer>
|
</el-drawer>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import DialogForm from './DialogForm';
|
|
||||||
import EquipmentInfoForm from './EquipmentInfoForm.vue';
|
|
||||||
|
|
||||||
const SmallTitle = {
|
const SmallTitle = {
|
||||||
name: 'SmallTitle',
|
name: 'SmallTitle',
|
||||||
@@ -138,7 +118,7 @@ const SmallTitle = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: { SmallTitle, DialogForm, EquipmentInfoForm },
|
components: { SmallTitle },
|
||||||
props: ['sections', 'mode', 'dataId'], // dataId 作为一个通用的存放id的字段
|
props: ['sections', 'mode', 'dataId'], // dataId 作为一个通用的存放id的字段
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
277
src/views/areavisual/record/index.vue
Normal file
@@ -0,0 +1,277 @@
|
|||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<!-- 搜索工作栏 -->
|
||||||
|
<SearchBar
|
||||||
|
:formConfigs="searchBarFormConfig"
|
||||||
|
ref="search-bar"
|
||||||
|
isFold
|
||||||
|
@headBtnClick="handleSearchBarBtnClick" />
|
||||||
|
|
||||||
|
<!-- 列表 -->
|
||||||
|
<base-table
|
||||||
|
:table-props="tableProps"
|
||||||
|
:page="queryParams.pageNo"
|
||||||
|
:limit="queryParams.pageSize"
|
||||||
|
:table-data="list"
|
||||||
|
@emitFun="handleEmitFun">
|
||||||
|
<method-btn
|
||||||
|
v-if="tableBtn.length"
|
||||||
|
slot="handleBtn"
|
||||||
|
:width="120"
|
||||||
|
label="操作"
|
||||||
|
:method-list="tableBtn"
|
||||||
|
@clickBtn="handleTableBtnClick" />
|
||||||
|
</base-table>
|
||||||
|
|
||||||
|
<!-- 分页组件 -->
|
||||||
|
<pagination
|
||||||
|
v-show="total > 0"
|
||||||
|
:total="total"
|
||||||
|
:page.sync="queryParams.pageNo"
|
||||||
|
:limit.sync="queryParams.pageSize"
|
||||||
|
@pagination="getList" />
|
||||||
|
|
||||||
|
<!-- 设备 详情 - 编辑 -->
|
||||||
|
<RecordDrawer
|
||||||
|
v-if="open"
|
||||||
|
ref="drawer"
|
||||||
|
:mode="editMode"
|
||||||
|
@update-mode="editMode = $event"
|
||||||
|
:data-id="form.id"
|
||||||
|
@refreshDataList="getList"
|
||||||
|
@cancel="cancelEdit"
|
||||||
|
@destroy="cancelEdit" />
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import moment from 'moment';
|
||||||
|
import basicPageMixin from '@/mixins/lb/basicPageMixin';
|
||||||
|
import RecordDrawer from './components/RecordDrawer';
|
||||||
|
import { getRecordPage, getLaneList } from '@/api/areavisual/record';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'Equipment',
|
||||||
|
components: {
|
||||||
|
RecordDrawer,
|
||||||
|
},
|
||||||
|
mixins: [basicPageMixin],
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
searchBarKeys: ['name', 'code'],
|
||||||
|
// this.$auth.hasPermi(`base:equipment:update`)
|
||||||
|
tableBtn: [
|
||||||
|
{
|
||||||
|
type: 'detail',
|
||||||
|
btnName: '详情'
|
||||||
|
}
|
||||||
|
].filter((v) => v),
|
||||||
|
tableProps: [
|
||||||
|
{
|
||||||
|
prop: 'recordCode',
|
||||||
|
label: '出/入库单编号',
|
||||||
|
fixed: true,
|
||||||
|
width: 180,
|
||||||
|
// filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'),
|
||||||
|
// showOverflowtooltip: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'type',
|
||||||
|
label: '业务类型',
|
||||||
|
filter: (val) => val === 1 ? '出库' : '入库',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
width: 180,
|
||||||
|
prop: 'recordTime',
|
||||||
|
label: '出/入库时间',
|
||||||
|
filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss')
|
||||||
|
},
|
||||||
|
{ prop: 'recordArea', label: '出/入库库区' },
|
||||||
|
{ prop: 'recordLane', label: '出/入库巷道' },
|
||||||
|
{ prop: 'recordRegion', label: '出/入库库位号' },
|
||||||
|
{ prop: 'target', label: '搬运对象' },
|
||||||
|
{ prop: 'productName', label: '产品名称' },
|
||||||
|
{ prop: 'specification', label: '型号规格' },
|
||||||
|
{ prop: 'recordMan', label: '出/入库人' },
|
||||||
|
{ prop: 'remark', label: '备注' }
|
||||||
|
],
|
||||||
|
searchBarFormConfig: [
|
||||||
|
{
|
||||||
|
type: 'input',
|
||||||
|
label: '关键字',
|
||||||
|
placeholder: '请输入出/入库编码、产品名称、规格型号、库位号',
|
||||||
|
param: 'query',
|
||||||
|
width: 350
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'select',
|
||||||
|
label: '业务类型',
|
||||||
|
selectOptions: [
|
||||||
|
{
|
||||||
|
id: '1',
|
||||||
|
name:'出库'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: '2',
|
||||||
|
name:'入库'
|
||||||
|
},
|
||||||
|
],
|
||||||
|
placeholder: '请选择业务类型',
|
||||||
|
param: 'type',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'select',
|
||||||
|
label: '出/入库巷道',
|
||||||
|
selectOptions: [],
|
||||||
|
placeholder: '请选择出/入库巷道',
|
||||||
|
param: 'recordLane',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'select',
|
||||||
|
label: '来源',
|
||||||
|
selectOptions: [
|
||||||
|
{
|
||||||
|
id: '1',
|
||||||
|
name:'WMS'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: '2',
|
||||||
|
name:'MES'
|
||||||
|
},
|
||||||
|
],
|
||||||
|
placeholder: '请选择来源',
|
||||||
|
param: 'source',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'select',
|
||||||
|
label: '出/入库人',
|
||||||
|
selectOptions: [],
|
||||||
|
placeholder: '请选择出/入库人',
|
||||||
|
param: 'recordMan',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'datePicker',
|
||||||
|
label: '出/入库时间',
|
||||||
|
placeholder: '请选择出/入库时间',
|
||||||
|
param: 'recordTime',
|
||||||
|
dateType: 'datetimerange',
|
||||||
|
rangeSeparator: '至'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'select',
|
||||||
|
label: '载具类型',
|
||||||
|
selectOptions: [
|
||||||
|
{
|
||||||
|
id: '1',
|
||||||
|
name:'AGV'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: '2',
|
||||||
|
name:'人工叉车'
|
||||||
|
},
|
||||||
|
],
|
||||||
|
placeholder: '请选择载具类型',
|
||||||
|
param: 'vehicleType',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'button',
|
||||||
|
btnName: '查询',
|
||||||
|
name: 'search',
|
||||||
|
color: 'primary',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'button',
|
||||||
|
btnName: '重置',
|
||||||
|
name: 'reset',
|
||||||
|
color: 'info',
|
||||||
|
}
|
||||||
|
],
|
||||||
|
editVisible: false,
|
||||||
|
editMode: 'detail', // 'edit', 'detail'
|
||||||
|
// 是否显示弹出层
|
||||||
|
open: false,
|
||||||
|
// 查询参数
|
||||||
|
queryParams: {
|
||||||
|
pageNo: 1,
|
||||||
|
pageSize: 20,
|
||||||
|
query: '',
|
||||||
|
type: '',
|
||||||
|
source: '',
|
||||||
|
recordLane: '',
|
||||||
|
recordMan: '',
|
||||||
|
recordTime: '',
|
||||||
|
vehicleType: ''
|
||||||
|
},
|
||||||
|
form: {}
|
||||||
|
};
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getLane()
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
computed: {},
|
||||||
|
methods: {
|
||||||
|
/** 查询列表 */
|
||||||
|
getList() {
|
||||||
|
this.loading = true;
|
||||||
|
// 执行查询
|
||||||
|
getRecordPage(this.queryParams).then((response) => {
|
||||||
|
console.log(response)
|
||||||
|
this.list = response.data.list;
|
||||||
|
this.total = response.data.total;
|
||||||
|
this.loading = false;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
async getLane() {
|
||||||
|
const res = await getLaneList({
|
||||||
|
pageNo: 1,
|
||||||
|
pageSize: 100
|
||||||
|
})
|
||||||
|
if (res.code === 0 && res.data) {
|
||||||
|
console.log(res.data)
|
||||||
|
this.searchBarFormConfig[2].selectOptions = res.data.list.map(item => {
|
||||||
|
return { id: item.id, name: item.lane }
|
||||||
|
})
|
||||||
|
console.log(this.searchBarFormConfig)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
/** 取消按钮 */
|
||||||
|
cancel() {
|
||||||
|
this.open = false;
|
||||||
|
},
|
||||||
|
// /** 导出按钮操作 */
|
||||||
|
// 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(() => {});
|
||||||
|
// },
|
||||||
|
handleTableBtnClick ({data, type}) {
|
||||||
|
switch (type) {
|
||||||
|
case 'detail':
|
||||||
|
this.viewDetail(data.id)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 查看详情
|
||||||
|
viewDetail(id) {
|
||||||
|
this.editMode = 'detail';
|
||||||
|
this.open = true;
|
||||||
|
this.form.id = id;
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs['drawer'].init();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
81
src/views/areavisual/region/add-or-updata.vue
Normal file
@@ -0,0 +1,81 @@
|
|||||||
|
<!--
|
||||||
|
* @Author: zwq
|
||||||
|
* @Date: 2021-11-18 14:16:25
|
||||||
|
* @LastEditors: zwq
|
||||||
|
* @LastEditTime: 2025-11-28 14:38:31
|
||||||
|
* @Description:
|
||||||
|
-->
|
||||||
|
<template>
|
||||||
|
<el-form
|
||||||
|
:model="dataForm"
|
||||||
|
:rules="dataRule"
|
||||||
|
ref="dataForm"
|
||||||
|
@keyup.enter.native="dataFormSubmit()"
|
||||||
|
label-width="80px">
|
||||||
|
<el-row :gutter="20">
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="物料编码" prop="materialCode">
|
||||||
|
<el-input
|
||||||
|
v-model="dataForm.materialCode"
|
||||||
|
clearable
|
||||||
|
placeholder="请输入物料编码" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="物料型号" prop="materialName">
|
||||||
|
<el-input
|
||||||
|
v-model="dataForm.materialName"
|
||||||
|
clearable
|
||||||
|
placeholder="请输入物料型号" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row :gutter="20">
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item label="物料规格" prop="material">
|
||||||
|
<el-input
|
||||||
|
v-model="dataForm.material"
|
||||||
|
clearable
|
||||||
|
placeholder="请输入物料规格" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-form>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import basicAdd from '@/mixins/basic-add';
|
||||||
|
import { createProduct, updateProduct,getProduct } from '@/api/ssdl/product&recipe';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
mixins: [basicAdd],
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
urlOptions: {
|
||||||
|
createURL: createProduct,
|
||||||
|
updateURL: updateProduct,
|
||||||
|
infoURL: getProduct,
|
||||||
|
},
|
||||||
|
dataForm: {
|
||||||
|
id: undefined,
|
||||||
|
material: undefined,
|
||||||
|
materialName: undefined,
|
||||||
|
materialCode: undefined,
|
||||||
|
},
|
||||||
|
typeArr: [],
|
||||||
|
dataRule: {
|
||||||
|
materialCode: [
|
||||||
|
{ required: true, message: '物料编码不能为空', trigger: 'blur' },
|
||||||
|
],
|
||||||
|
materialName: [
|
||||||
|
{ required: true, message: '物料型号不能为空', trigger: 'blur' },
|
||||||
|
],
|
||||||
|
material: [
|
||||||
|
{ required: true, message: '规格不能为空', trigger: 'blur' },
|
||||||
|
],
|
||||||
|
},
|
||||||
|
};
|
||||||
|
},
|
||||||
|
methods: {},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
62
src/views/areavisual/region/changeStatus.vue
Normal file
@@ -0,0 +1,62 @@
|
|||||||
|
<!--
|
||||||
|
* @Author: zwq
|
||||||
|
* @Date: 2025-10-11 14:41:12
|
||||||
|
* @LastEditors: zwq
|
||||||
|
* @LastEditTime: 2026-01-14 14:13:14
|
||||||
|
* @Description:
|
||||||
|
-->
|
||||||
|
<template>
|
||||||
|
<el-switch
|
||||||
|
@change="changeStatus"
|
||||||
|
size="small"
|
||||||
|
v-model="injectData.regionState"
|
||||||
|
:active-value="1"
|
||||||
|
:inactive-value="2"></el-switch>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { updateRegion } from '@/api/areavisual/region';
|
||||||
|
export default {
|
||||||
|
props: {
|
||||||
|
injectData: {
|
||||||
|
type: Object,
|
||||||
|
default: () => ({}),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {};
|
||||||
|
},
|
||||||
|
created() {},
|
||||||
|
methods: {
|
||||||
|
changeStatus(val) {
|
||||||
|
const pdata = { ...this.injectData, regionState: val };
|
||||||
|
this.$confirm(
|
||||||
|
`是否确认修改${'区域 [ ' + this.injectData.regionName + ' ] '}的状态?`,
|
||||||
|
'更新状态',
|
||||||
|
{
|
||||||
|
confirmButtonText: '确认修改',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: 'warning',
|
||||||
|
}
|
||||||
|
)
|
||||||
|
.then(() => {
|
||||||
|
updateRegion(pdata).then((res) => {
|
||||||
|
if (res.code === 0 || res.code === 200) {
|
||||||
|
this.$modal.msgSuccess('修改成功');
|
||||||
|
this.$emit('emitData');
|
||||||
|
} else {
|
||||||
|
this.$modal.msg(res.msg);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.catch((res) => {
|
||||||
|
this.$emit('emitData');
|
||||||
|
this.$message({
|
||||||
|
type: 'info',
|
||||||
|
message: '已取消',
|
||||||
|
});
|
||||||
|
});
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
221
src/views/areavisual/region/index.vue
Normal file
@@ -0,0 +1,221 @@
|
|||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<search-bar
|
||||||
|
:formConfigs="formConfig"
|
||||||
|
ref="searchBarForm"
|
||||||
|
@headBtnClick="buttonClick" />
|
||||||
|
<base-table
|
||||||
|
v-loading="dataListLoading"
|
||||||
|
:table-props="tableProps"
|
||||||
|
:page="listQuery.pageNo"
|
||||||
|
:limit="listQuery.pageSize"
|
||||||
|
:table-data="tableData"
|
||||||
|
@emitFun="getDataList">
|
||||||
|
</base-table>
|
||||||
|
<pagination
|
||||||
|
:limit.sync="listQuery.pageSize"
|
||||||
|
:page.sync="listQuery.pageNo"
|
||||||
|
:total="listQuery.total"
|
||||||
|
@pagination="getDataList" />
|
||||||
|
<base-dialog
|
||||||
|
:dialogTitle="addOrEditTitle"
|
||||||
|
:dialogVisible="addOrUpdateVisible"
|
||||||
|
@cancel="handleCancel"
|
||||||
|
@confirm="handleConfirm"
|
||||||
|
:before-close="handleCancel"
|
||||||
|
width="50%">
|
||||||
|
<add-or-update
|
||||||
|
ref="addOrUpdate"
|
||||||
|
@refreshDataList="successSubmit"></add-or-update>
|
||||||
|
</base-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import AddOrUpdate from './add-or-updata';
|
||||||
|
import basicPage from '@/mixins/basic-page';
|
||||||
|
import { parseTime } from '@/filter/code-filter';
|
||||||
|
import { deleteRegion, getRegionPage } from '@/api/areavisual/region';
|
||||||
|
import changeStatus from './changeStatus.vue';
|
||||||
|
|
||||||
|
const region = [
|
||||||
|
{
|
||||||
|
id: '1',
|
||||||
|
name: 'A区域',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: '2',
|
||||||
|
name: 'B区域',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: '3',
|
||||||
|
name: 'C区域',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: '4',
|
||||||
|
name: 'D区域',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: '5',
|
||||||
|
name: 'E区域',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: '6',
|
||||||
|
name: 'F区域',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: '7',
|
||||||
|
name: 'G区域',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: '8',
|
||||||
|
name: 'H区域',
|
||||||
|
},
|
||||||
|
];
|
||||||
|
const regionType = [
|
||||||
|
{
|
||||||
|
id: '1',
|
||||||
|
name: '拉丝缓存区',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: '2',
|
||||||
|
name: '满盘存储区',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: '3',
|
||||||
|
name: '空盘存储区',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: '4',
|
||||||
|
name: '复绕区',
|
||||||
|
},
|
||||||
|
];
|
||||||
|
const tableProps = [
|
||||||
|
{
|
||||||
|
prop: 'regionCode',
|
||||||
|
label: '区域编码',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'regionName',
|
||||||
|
label: '区域名称',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'region',
|
||||||
|
label: '区域',
|
||||||
|
filter: (val) => {
|
||||||
|
return region.find((i) => i.id == val)
|
||||||
|
? region.find((i) => i.id == val).name
|
||||||
|
: '-';
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'regionType',
|
||||||
|
label: '区域类型',
|
||||||
|
filter: (val) => {
|
||||||
|
return regionType.find((i) => i.id == val)
|
||||||
|
? regionType.find((i) => i.id == val).name
|
||||||
|
: '-';
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'rowNum',
|
||||||
|
label: '行数',
|
||||||
|
width:90,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'columnNum',
|
||||||
|
label: '列数',
|
||||||
|
width:90,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'regionState',
|
||||||
|
label: '区域状态',
|
||||||
|
width:90,
|
||||||
|
subcomponent: changeStatus,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'createTime',
|
||||||
|
label: '创建时间',
|
||||||
|
filter: parseTime,
|
||||||
|
width: 150,
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
export default {
|
||||||
|
mixins: [basicPage],
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
urlOptions: {
|
||||||
|
getDataListURL: getRegionPage,
|
||||||
|
deleteURL: deleteRegion,
|
||||||
|
},
|
||||||
|
tableProps,
|
||||||
|
tableData: [],
|
||||||
|
formConfig: [
|
||||||
|
{
|
||||||
|
type: 'input',
|
||||||
|
label: '名称',
|
||||||
|
placeholder: '名称',
|
||||||
|
param: 'name',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'input',
|
||||||
|
label: '编码',
|
||||||
|
placeholder: '编码',
|
||||||
|
param: 'code',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'select',
|
||||||
|
label: '区域',
|
||||||
|
selectOptions: region,
|
||||||
|
placeholder: '请选择区域',
|
||||||
|
param: 'region',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'button',
|
||||||
|
btnName: '搜索',
|
||||||
|
name: 'search',
|
||||||
|
color: 'primary',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
},
|
||||||
|
components: {
|
||||||
|
AddOrUpdate,
|
||||||
|
},
|
||||||
|
created() {},
|
||||||
|
methods: {
|
||||||
|
buttonClick(val) {
|
||||||
|
switch (val.btnName) {
|
||||||
|
case 'search':
|
||||||
|
this.listQuery.pageNo = 1;
|
||||||
|
this.listQuery.pageSize = 20;
|
||||||
|
this.listQuery.regionName = val.name;
|
||||||
|
this.listQuery.regionCode = val.code;
|
||||||
|
this.listQuery.region = val.region;
|
||||||
|
this.getDataList();
|
||||||
|
break;
|
||||||
|
case 'reset':
|
||||||
|
this.$refs.searchBarForm.resetForm();
|
||||||
|
this.listQuery = {
|
||||||
|
pageSize: 20,
|
||||||
|
pageNo: 1,
|
||||||
|
total: 1,
|
||||||
|
};
|
||||||
|
this.getDataList();
|
||||||
|
break;
|
||||||
|
case 'add':
|
||||||
|
this.addOrEditTitle = '新增';
|
||||||
|
this.addOrUpdateVisible = true;
|
||||||
|
this.addOrUpdateHandle();
|
||||||
|
break;
|
||||||
|
case 'export':
|
||||||
|
this.handleExport();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
console.log(val);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
@@ -1,100 +0,0 @@
|
|||||||
<!--
|
|
||||||
filename: index.vue
|
|
||||||
author: liubin
|
|
||||||
date: 2023-10-11 09:32:04
|
|
||||||
description: 设备看板
|
|
||||||
-->
|
|
||||||
|
|
||||||
<template>
|
|
||||||
<div ref="dataBoard" class="data-board">
|
|
||||||
<el-button type="text" @click="goback" class="go-back--btn">返回</el-button>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
export default {
|
|
||||||
name: 'DataBoard',
|
|
||||||
components: {},
|
|
||||||
props: {},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
appMain: null, // dom
|
|
||||||
parentStyle: {
|
|
||||||
margin: '8px 14px 0px 16px',
|
|
||||||
minHeight: 'calc(100vh - 120px - 8px)',
|
|
||||||
}, // object
|
|
||||||
mainFooter: null, // dom
|
|
||||||
};
|
|
||||||
},
|
|
||||||
// mounted() {
|
|
||||||
// this.$nextTick(() => {
|
|
||||||
// this.modify();
|
|
||||||
// });
|
|
||||||
// },
|
|
||||||
// activated() {
|
|
||||||
// this.modify();
|
|
||||||
// },
|
|
||||||
// deactivated() {
|
|
||||||
// this.recover();
|
|
||||||
// },
|
|
||||||
// beforeDestroy() {
|
|
||||||
// this.recover();
|
|
||||||
// },
|
|
||||||
methods: {
|
|
||||||
// modify() {
|
|
||||||
// // 在这个页面临时修改下父类的margin,结束时需还原
|
|
||||||
// this.appMain = document.querySelector('.app-main');
|
|
||||||
// // this.appMain.style.minHeight = 'calc(100vh - 90px)';
|
|
||||||
// this.appMain.style.margin = 0;
|
|
||||||
// // 在这个页面临时删除 main-footer 元素,结束时需还原
|
|
||||||
// // this.mainFooter = document.querySelector('.main-footer').cloneNode(true);
|
|
||||||
// // document.querySelector('.main-footer').remove();
|
|
||||||
// this.$refs.dataBoard.classList.add('data-board');
|
|
||||||
// },
|
|
||||||
// recover() {
|
|
||||||
// this.$refs.dataBoard.classList.remove('data-board');
|
|
||||||
// this.$nextTick(() => {
|
|
||||||
// this.appMain.style.margin = this.parentStyle.margin;
|
|
||||||
// // this.appMain.style.minHeight = this.parentStyle.minHeight;
|
|
||||||
// // this.appMain.insertAdjacentElement('afterend', this.mainFooter);
|
|
||||||
// });
|
|
||||||
// },
|
|
||||||
goback() {
|
|
||||||
this.$router.go(-1);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped lang="scss">
|
|
||||||
.data-board {
|
|
||||||
position: absolute;
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
background: url('../../../assets/images/DataBoard.png') 100% 100% / contain
|
|
||||||
no-repeat;
|
|
||||||
}
|
|
||||||
|
|
||||||
.go-back--btn {
|
|
||||||
position: fixed;
|
|
||||||
top: 28px;
|
|
||||||
left: 24px;
|
|
||||||
color: #fff;
|
|
||||||
font-size: 18px;
|
|
||||||
letter-spacing: 6px;
|
|
||||||
|
|
||||||
&:hover {
|
|
||||||
text-decoration: underline;
|
|
||||||
}
|
|
||||||
|
|
||||||
&::after {
|
|
||||||
content: "\2BAA";
|
|
||||||
position: absolute;
|
|
||||||
top: 6px;
|
|
||||||
right: -26px;
|
|
||||||
font-size: 24px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,214 +0,0 @@
|
|||||||
<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>
|
|
||||||
@@ -1,482 +0,0 @@
|
|||||||
<!--
|
|
||||||
filename: EquipmentDrawer.vue
|
|
||||||
author: liubin
|
|
||||||
date: 2023-08-22 14:38:56
|
|
||||||
description:
|
|
||||||
-->
|
|
||||||
|
|
||||||
<template>
|
|
||||||
<el-drawer
|
|
||||||
:visible="visible"
|
|
||||||
:show-close="false"
|
|
||||||
:wrapper-closable="false"
|
|
||||||
class="drawer"
|
|
||||||
custom-class="mes-drawer"
|
|
||||||
size="60%"
|
|
||||||
@closed="$emit('destroy')">
|
|
||||||
<SmallTitle slot="title">
|
|
||||||
{{
|
|
||||||
mode.includes('detail')
|
|
||||||
? '详情'
|
|
||||||
: mode.includes('edit')
|
|
||||||
? '编辑'
|
|
||||||
: '新增'
|
|
||||||
}}
|
|
||||||
</SmallTitle>
|
|
||||||
|
|
||||||
<div class="drawer-body flex">
|
|
||||||
<div class="drawer-body__content">
|
|
||||||
<section v-for="(section, index) in sections" :key="section.key">
|
|
||||||
<SmallTitle v-if="index != 0">{{ section.name }}</SmallTitle>
|
|
||||||
|
|
||||||
<div class="form-part" v-if="section.key == 'base'">
|
|
||||||
<el-skeleton v-if="!showForm" animated />
|
|
||||||
<BaseInfoForm
|
|
||||||
key="drawer-dialog-form"
|
|
||||||
v-if="showForm"
|
|
||||||
ref="form"
|
|
||||||
:disabled="true"
|
|
||||||
:dataForm="form"
|
|
||||||
:rows="formRows" />
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div v-if="section.key == 'attrs'" style="margin-top: 12px">
|
|
||||||
<base-table
|
|
||||||
v-loading="attrListLoading"
|
|
||||||
:table-props="section.props"
|
|
||||||
:page="attrQuery?.params.pageNo || 1"
|
|
||||||
:limit="attrQuery?.params.pageSize || 10"
|
|
||||||
:table-data="list"
|
|
||||||
:add-button-show="mode.includes('detail') ? null : '添加属性'"
|
|
||||||
@emitButtonClick="handleAddAttr"
|
|
||||||
@emitFun="handleEmitFun">
|
|
||||||
<method-btn
|
|
||||||
v-if="section.tableBtn"
|
|
||||||
slot="handleBtn"
|
|
||||||
label="操作"
|
|
||||||
:method-list="tableBtn"
|
|
||||||
@clickBtn="handleTableBtnClick" />
|
|
||||||
</base-table>
|
|
||||||
|
|
||||||
<!-- 分页组件 -->
|
|
||||||
<pagination
|
|
||||||
v-show="total > 0"
|
|
||||||
:total="total"
|
|
||||||
:page.sync="attrQuery.params.pageNo"
|
|
||||||
:limit.sync="attrQuery.params.pageSize"
|
|
||||||
@pagination="getAttrList" />
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="drawer-body__footer">
|
|
||||||
<el-button style="" @click="handleCancel">取消</el-button>
|
|
||||||
<el-button v-if="mode == 'detail'" type="primary" @click="toggleEdit">
|
|
||||||
编辑
|
|
||||||
</el-button>
|
|
||||||
<el-button v-else type="primary" @click="handleCancel">确定</el-button>
|
|
||||||
<!-- sections的第二项必须是 属性列表 -->
|
|
||||||
<!-- <el-button
|
|
||||||
v-if="sections[1].allowAdd"
|
|
||||||
type="primary"
|
|
||||||
@click="handleAddAttr">
|
|
||||||
添加属性
|
|
||||||
</el-button> -->
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- 属性对话框 -->
|
|
||||||
<base-dialog
|
|
||||||
v-if="sections[1].allowAdd"
|
|
||||||
:dialogTitle="attrTitle"
|
|
||||||
:dialogVisible="attrFormVisible"
|
|
||||||
width="45%"
|
|
||||||
:append-to-body="true"
|
|
||||||
custom-class="baseDialog"
|
|
||||||
@close="closeAttrForm"
|
|
||||||
@cancel="closeAttrForm"
|
|
||||||
@confirm="submitAttrForm">
|
|
||||||
<DialogForm
|
|
||||||
v-if="attrFormVisible"
|
|
||||||
ref="attrForm"
|
|
||||||
:disabled="mode.includes('detail')"
|
|
||||||
v-model="attrForm"
|
|
||||||
:rows="attrRows" />
|
|
||||||
</base-dialog>
|
|
||||||
</el-drawer>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import BaseInfoForm from '@/components/DialogForm';
|
|
||||||
import DialogForm from './dialogForm';
|
|
||||||
|
|
||||||
const SmallTitle = {
|
|
||||||
name: 'SmallTitle',
|
|
||||||
props: ['size'],
|
|
||||||
data() {
|
|
||||||
return {};
|
|
||||||
},
|
|
||||||
methods: {},
|
|
||||||
render: function (h) {
|
|
||||||
return h(
|
|
||||||
'span',
|
|
||||||
{
|
|
||||||
class: 'small-title',
|
|
||||||
style: {
|
|
||||||
fontSize: '18px',
|
|
||||||
lineHeight:
|
|
||||||
this.size == 'lg' ? '24px' : this.size == 'sm' ? '18px' : '20px',
|
|
||||||
fontWeight: 500,
|
|
||||||
fontFamily: '微软雅黑, Microsoft YaHei, Arial, Helvetica, sans-serif',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
this.$slots.default
|
|
||||||
);
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
export default {
|
|
||||||
components: { SmallTitle, DialogForm, BaseInfoForm },
|
|
||||||
props: ['sections', 'defaultMode', 'dataId'], // dataId 作为一个通用的存放id的字段
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
mode: '',
|
|
||||||
visible: false,
|
|
||||||
showForm: false,
|
|
||||||
total: 0,
|
|
||||||
form: {},
|
|
||||||
list: [],
|
|
||||||
attrTitle: '',
|
|
||||||
attrForm: {
|
|
||||||
id: null,
|
|
||||||
equipmentGroupId: '',
|
|
||||||
code: '',
|
|
||||||
type: '',
|
|
||||||
grade: '',
|
|
||||||
alarmCode: '',
|
|
||||||
alarmContent: '',
|
|
||||||
plcParamName: '',
|
|
||||||
},
|
|
||||||
attrFormVisible: false,
|
|
||||||
attrRows: [
|
|
||||||
[
|
|
||||||
{
|
|
||||||
input: true,
|
|
||||||
label: '报警编码', // 自动生成
|
|
||||||
prop: 'code',
|
|
||||||
url: '/base/equipment-group-alarm/getCode',
|
|
||||||
rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
select: true,
|
|
||||||
label: '报警类型', // 固定选项
|
|
||||||
prop: 'type',
|
|
||||||
options: [
|
|
||||||
{ label: '布尔型', value: 2 },
|
|
||||||
{ label: '字符型', value: 1 },
|
|
||||||
],
|
|
||||||
rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
|
||||||
},
|
|
||||||
],
|
|
||||||
[
|
|
||||||
{
|
|
||||||
select: true,
|
|
||||||
label: '报警级别', // 字典
|
|
||||||
prop: 'grade',
|
|
||||||
options: this.getDictDatas(this.DICT_TYPE.EQU_ALARM_LEVEL),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
input: true,
|
|
||||||
label: '设备报警编码', // 对应到设备实际的报警编码
|
|
||||||
prop: 'alarmCode',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
[
|
|
||||||
{
|
|
||||||
input: true,
|
|
||||||
label: '参数列名', // 在实时数据库的列名
|
|
||||||
prop: 'plcParamName',
|
|
||||||
rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
input: true,
|
|
||||||
label: '报警内容',
|
|
||||||
prop: 'alarmContent',
|
|
||||||
rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
|
||||||
},
|
|
||||||
],
|
|
||||||
],
|
|
||||||
attrQuery: {
|
|
||||||
params: {
|
|
||||||
pageNo: 1,
|
|
||||||
pageSize: 10,
|
|
||||||
},
|
|
||||||
}, // 属性列表的请求
|
|
||||||
infoQuery: null, // 基本信息的请求
|
|
||||||
attrFormSubmitting: false,
|
|
||||||
attrListLoading: false,
|
|
||||||
};
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
formRows() {
|
|
||||||
return this.sections[0].rows.map((row) => {
|
|
||||||
return row.map((col) => {
|
|
||||||
return {
|
|
||||||
...col,
|
|
||||||
bind: {
|
|
||||||
// 详情 模式下,禁用各种输入
|
|
||||||
// disabled: this.mode == 'detail',
|
|
||||||
disabled: true,
|
|
||||||
},
|
|
||||||
};
|
|
||||||
});
|
|
||||||
});
|
|
||||||
},
|
|
||||||
tableBtn() {
|
|
||||||
return this.mode == 'detail' ? [] : this.sections[1].tableBtn;
|
|
||||||
},
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
this.mode = this.defaultMode || 'detail';
|
|
||||||
for (const section of this.sections) {
|
|
||||||
// 请求具体信息
|
|
||||||
if ('url' in section) {
|
|
||||||
const query = {
|
|
||||||
url: section.url,
|
|
||||||
method: section.method || 'get',
|
|
||||||
params: section.queryParams || null,
|
|
||||||
data: section.data || null,
|
|
||||||
};
|
|
||||||
// debugger;
|
|
||||||
this.$axios(query).then(({ data }) => {
|
|
||||||
if (section.key == 'base') {
|
|
||||||
this.form = data;
|
|
||||||
this.showForm = true;
|
|
||||||
this.infoQuery = query;
|
|
||||||
} else if (section.key == 'attrs') {
|
|
||||||
this.attrQuery = query;
|
|
||||||
this.list = data.list;
|
|
||||||
this.total = data.total;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
handleTableBtnClick({ type, data }) {
|
|
||||||
switch (type) {
|
|
||||||
case 'edit':
|
|
||||||
this.handleEditAttr(data.id);
|
|
||||||
break;
|
|
||||||
case 'delete':
|
|
||||||
this.handleDeleteAttr(data.id);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
handleEmitFun(val) {
|
|
||||||
console.log('handleEmitFun', val);
|
|
||||||
},
|
|
||||||
|
|
||||||
init() {
|
|
||||||
this.visible = true;
|
|
||||||
},
|
|
||||||
|
|
||||||
async getAttrList() {
|
|
||||||
this.attrListLoading = true;
|
|
||||||
const res = await this.$axios(this.attrQuery);
|
|
||||||
if (res.code == 0) {
|
|
||||||
this.list = res.data.list;
|
|
||||||
this.total = res.data.total;
|
|
||||||
}
|
|
||||||
this.attrListLoading = false;
|
|
||||||
},
|
|
||||||
|
|
||||||
// 保存表单
|
|
||||||
handleSave() {
|
|
||||||
this.$refs['form'][0].validate(async (valid) => {
|
|
||||||
if (valid) {
|
|
||||||
const isEdit = this.mode == 'edit';
|
|
||||||
await this.$axios({
|
|
||||||
url: this.sections[0][isEdit ? 'urlUpdate' : 'urlCreate'],
|
|
||||||
method: isEdit ? 'put' : 'post',
|
|
||||||
data: this.form,
|
|
||||||
});
|
|
||||||
this.$modal.msgSuccess(`${isEdit ? '更新' : '创建'}成功`);
|
|
||||||
this.visible = false;
|
|
||||||
this.$emit('refreshDataList');
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
handleCancel() {
|
|
||||||
this.visible = false;
|
|
||||||
},
|
|
||||||
|
|
||||||
// 开启编辑
|
|
||||||
toggleEdit() {
|
|
||||||
this.mode = 'edit';
|
|
||||||
},
|
|
||||||
|
|
||||||
// 新增属性
|
|
||||||
handleAddAttr() {
|
|
||||||
if (!this.dataId) return this.$message.warning('请先创建设备分组信息');
|
|
||||||
this.attrForm = {
|
|
||||||
id: null,
|
|
||||||
equipmentGroupId: this.dataId,
|
|
||||||
code: '',
|
|
||||||
type: '',
|
|
||||||
grade: '',
|
|
||||||
alarmCode: '',
|
|
||||||
alarmContent: '',
|
|
||||||
plcParamName: '',
|
|
||||||
};
|
|
||||||
this.attrTitle = '添加设备分组报警';
|
|
||||||
this.attrFormVisible = true;
|
|
||||||
},
|
|
||||||
|
|
||||||
// 编辑属性
|
|
||||||
async handleEditAttr(attrId) {
|
|
||||||
const res = await this.$axios({
|
|
||||||
url: this.sections[1].urlDetail,
|
|
||||||
method: 'get',
|
|
||||||
params: { id: attrId },
|
|
||||||
});
|
|
||||||
if (res.code == 0) {
|
|
||||||
this.attrForm = res.data;
|
|
||||||
this.attrTitle = '编辑设备分组报警';
|
|
||||||
this.attrFormVisible = true;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
// 删除属性
|
|
||||||
handleDeleteAttr(attrId) {
|
|
||||||
this.$confirm('确定删除该分组报警?', '提示', {
|
|
||||||
confirmButtonText: '确定',
|
|
||||||
cancelButtonText: '取消',
|
|
||||||
type: 'warning',
|
|
||||||
})
|
|
||||||
.then(async () => {
|
|
||||||
const res = await this.$axios({
|
|
||||||
url: this.sections[1].urlDelete,
|
|
||||||
method: 'delete',
|
|
||||||
params: { id: attrId },
|
|
||||||
});
|
|
||||||
if (res.code == 0) {
|
|
||||||
this.$message({
|
|
||||||
message: '删除成功',
|
|
||||||
type: 'success',
|
|
||||||
duration: 1500,
|
|
||||||
onClose: () => {
|
|
||||||
this.getAttrList();
|
|
||||||
},
|
|
||||||
});
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.catch(() => {});
|
|
||||||
},
|
|
||||||
|
|
||||||
// 提交属性表
|
|
||||||
async submitAttrForm() {
|
|
||||||
this.$refs['attrForm'].validate((valid) => {
|
|
||||||
if (!valid) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
console.log('this.attrform', this.attrForm);
|
|
||||||
const isEdit = this.attrForm.id != null;
|
|
||||||
this.attrFormSubmitting = true;
|
|
||||||
const res = await this.$axios({
|
|
||||||
url: isEdit ? this.sections[1].urlUpdate : this.sections[1].urlCreate,
|
|
||||||
method: isEdit ? 'put' : 'post',
|
|
||||||
data: this.attrForm,
|
|
||||||
});
|
|
||||||
|
|
||||||
if (res.code == 0) {
|
|
||||||
this.closeAttrForm();
|
|
||||||
this.$message({
|
|
||||||
message: `${isEdit ? '更新' : '创建'}成功`,
|
|
||||||
type: 'success',
|
|
||||||
duration: 1500,
|
|
||||||
onClose: () => {
|
|
||||||
this.getAttrList();
|
|
||||||
},
|
|
||||||
});
|
|
||||||
}
|
|
||||||
this.attrFormSubmitting = false;
|
|
||||||
},
|
|
||||||
|
|
||||||
closeAttrForm() {
|
|
||||||
this.attrFormVisible = false;
|
|
||||||
},
|
|
||||||
|
|
||||||
handleClick(raw) {
|
|
||||||
if (raw.type === 'delete') {
|
|
||||||
this.$confirm(`确定删除该报警?`, '提示', {
|
|
||||||
confirmButtonText: '确定',
|
|
||||||
cancelButtonText: '取消',
|
|
||||||
type: 'warning',
|
|
||||||
})
|
|
||||||
.then(() => {
|
|
||||||
deleteProductAttr(raw.data.id).then(({ data }) => {
|
|
||||||
this.$message({
|
|
||||||
message: '操作成功',
|
|
||||||
type: 'success',
|
|
||||||
duration: 1500,
|
|
||||||
onClose: () => {
|
|
||||||
this.getList();
|
|
||||||
},
|
|
||||||
});
|
|
||||||
});
|
|
||||||
})
|
|
||||||
.catch(() => {});
|
|
||||||
} else {
|
|
||||||
this.addNew(raw.data.id);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped>
|
|
||||||
.drawer >>> .el-drawer {
|
|
||||||
border-radius: 8px 0 0 8px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.drawer >>> .el-drawer__header {
|
|
||||||
margin: 0;
|
|
||||||
padding: 32px 32px 24px;
|
|
||||||
border-bottom: 1px solid #dcdfe6;
|
|
||||||
margin-bottom: 0px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.small-title::before {
|
|
||||||
content: '';
|
|
||||||
display: inline-block;
|
|
||||||
vertical-align: top;
|
|
||||||
width: 4px;
|
|
||||||
height: 22px;
|
|
||||||
border-radius: 1px;
|
|
||||||
margin-right: 8px;
|
|
||||||
background-color: #0b58ff;
|
|
||||||
}
|
|
||||||
|
|
||||||
.drawer-body {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.drawer-body__content {
|
|
||||||
flex: 1;
|
|
||||||
/* background: #eee; */
|
|
||||||
padding: 20px 30px;
|
|
||||||
overflow-y: auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
.drawer-body__footer {
|
|
||||||
display: flex;
|
|
||||||
justify-content: flex-end;
|
|
||||||
padding: 18px;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,186 +0,0 @@
|
|||||||
<!--
|
|
||||||
filename: dialogForm.vue
|
|
||||||
author: liubin
|
|
||||||
date: 2023-09-11 15:55:13
|
|
||||||
description: DialogForm for equipmentBindSection only
|
|
||||||
-->
|
|
||||||
|
|
||||||
<template>
|
|
||||||
<el-form
|
|
||||||
ref="form"
|
|
||||||
:model="dataForm"
|
|
||||||
label-width="100px"
|
|
||||||
v-loading="formLoading">
|
|
||||||
<el-row :gutter="20">
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item
|
|
||||||
label="报警编码"
|
|
||||||
prop="code"
|
|
||||||
:rules="[{ required: true, message: '不能为空', trigger: 'blur' }]">
|
|
||||||
<el-input
|
|
||||||
:disabled="disabled"
|
|
||||||
v-model="dataForm.code"
|
|
||||||
@change="$emit('update', dataForm)"
|
|
||||||
placeholder="请输入工段排序" />
|
|
||||||
</el-form-item>
|
|
||||||
<!--
|
|
||||||
<el-form-item
|
|
||||||
label="报警编码"
|
|
||||||
prop="code"
|
|
||||||
:rules="[{ required: true, message: '不能为空', trigger: 'blur' }]">
|
|
||||||
<el-select
|
|
||||||
v-model="dataForm.code"
|
|
||||||
placeholder="请选择产线"
|
|
||||||
@change="handleProductlineChange">
|
|
||||||
<el-option
|
|
||||||
v-for="opt in productionLineList"
|
|
||||||
:key="opt.value"
|
|
||||||
:label="opt.label"
|
|
||||||
:value="opt.value" />
|
|
||||||
</el-select>
|
|
||||||
</el-form-item> -->
|
|
||||||
</el-col>
|
|
||||||
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item
|
|
||||||
label="报警类型"
|
|
||||||
prop="type"
|
|
||||||
:rules="[{ required: true, message: '不能为空', trigger: 'blur' }]">
|
|
||||||
<el-select
|
|
||||||
:disabled="disabled"
|
|
||||||
v-model="dataForm.type"
|
|
||||||
placeholder="请选择报警类型"
|
|
||||||
@change="handleTypeChange">
|
|
||||||
<el-option
|
|
||||||
v-for="opt in [
|
|
||||||
{ label: '布尔型', value: 2 },
|
|
||||||
{ label: '字符型', value: 1 },
|
|
||||||
]"
|
|
||||||
:key="opt.value"
|
|
||||||
:label="opt.label"
|
|
||||||
:value="opt.value" />
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row :gutter="20">
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item
|
|
||||||
label="报警级别"
|
|
||||||
prop="grade"
|
|
||||||
:rules="[{ required: true, message: '不能为空', trigger: 'blur' }]">
|
|
||||||
<el-select
|
|
||||||
:disabled="disabled"
|
|
||||||
v-model="dataForm.grade"
|
|
||||||
placeholder="请选择报警级别"
|
|
||||||
@change="$emit('update', dataForm)">
|
|
||||||
<el-option
|
|
||||||
v-for="opt in getDictDatas(DICT_TYPE.EQU_ALARM_LEVEL)"
|
|
||||||
:key="opt.value"
|
|
||||||
:label="opt.label"
|
|
||||||
:value="opt.value" />
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item
|
|
||||||
v-if="+dataForm.type == 1"
|
|
||||||
label="设备报警编码"
|
|
||||||
prop="alarmCode">
|
|
||||||
<el-input
|
|
||||||
:disabled="disabled"
|
|
||||||
v-model="dataForm.alarmCode"
|
|
||||||
@change="$emit('update', dataForm)"
|
|
||||||
placeholder="请输入设备报警编码" />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row :gutter="20">
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item
|
|
||||||
label="参数列名"
|
|
||||||
prop="plcParamName"
|
|
||||||
:rules="[{ required: true, message: '不能为空', trigger: 'blur' }]">
|
|
||||||
<el-input
|
|
||||||
:disabled="disabled"
|
|
||||||
v-model="dataForm.plcParamName"
|
|
||||||
placeholder="请输入参数列名"
|
|
||||||
@change="$emit('update', dataForm)"></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item
|
|
||||||
label="报警内容"
|
|
||||||
prop="alarmContent"
|
|
||||||
:rules="[{ required: true, message: '不能为空', trigger: 'blur' }]">
|
|
||||||
<el-input
|
|
||||||
:disabled="disabled"
|
|
||||||
v-model="dataForm.alarmContent"
|
|
||||||
placeholder="请输入报警内容"
|
|
||||||
@change="$emit('update', dataForm)"></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
</el-form>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
export default {
|
|
||||||
name: 'DialogForm',
|
|
||||||
model: {
|
|
||||||
prop: 'dataForm',
|
|
||||||
event: 'update',
|
|
||||||
},
|
|
||||||
emits: ['update'],
|
|
||||||
components: {},
|
|
||||||
props: {
|
|
||||||
dataForm: {
|
|
||||||
type: Object,
|
|
||||||
default: () => ({}),
|
|
||||||
},
|
|
||||||
disabled: {
|
|
||||||
type: Boolean,
|
|
||||||
default: false,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
formLoading: true,
|
|
||||||
};
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
this.getCode('/base/equipment-group-alarm/getCode').then((code) => {
|
|
||||||
this.formLoading = false;
|
|
||||||
this.$emit('update', {
|
|
||||||
...this.dataForm,
|
|
||||||
code,
|
|
||||||
});
|
|
||||||
});
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
/** 模拟透传 ref */
|
|
||||||
validate(cb) {
|
|
||||||
return this.$refs.form.validate(cb);
|
|
||||||
},
|
|
||||||
resetFields(args) {
|
|
||||||
return this.$refs.form.resetFields(args);
|
|
||||||
},
|
|
||||||
async handleTypeChange(id) {
|
|
||||||
this.dataForm.alarmCode = '';
|
|
||||||
this.$emit('update', this.dataForm);
|
|
||||||
},
|
|
||||||
async getCode(url) {
|
|
||||||
const response = await this.$axios(url);
|
|
||||||
return response.data;
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped lang="scss">
|
|
||||||
.el-date-editor,
|
|
||||||
.el-select {
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,461 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div class="app-container">
|
|
||||||
<!-- 搜索工作栏 -->
|
|
||||||
<SearchBar
|
|
||||||
:formConfigs="searchBarFormConfig"
|
|
||||||
ref="search-bar"
|
|
||||||
@headBtnClick="handleSearchBarBtnClick" />
|
|
||||||
|
|
||||||
<!-- 列表 -->
|
|
||||||
<base-table
|
|
||||||
:table-props="tableProps"
|
|
||||||
:page="queryParams.pageNo"
|
|
||||||
:limit="queryParams.pageSize"
|
|
||||||
:table-data="list"
|
|
||||||
@emitFun="handleEmitFun">
|
|
||||||
<method-btn
|
|
||||||
v-if="tableBtn.length"
|
|
||||||
slot="handleBtn"
|
|
||||||
label="操作"
|
|
||||||
:width="120"
|
|
||||||
:method-list="tableBtn"
|
|
||||||
@clickBtn="handleTableBtnClick" />
|
|
||||||
</base-table>
|
|
||||||
|
|
||||||
<!-- 分页组件 -->
|
|
||||||
<pagination
|
|
||||||
v-show="total > 0"
|
|
||||||
:total="total"
|
|
||||||
:page.sync="queryParams.pageNo"
|
|
||||||
:limit.sync="queryParams.pageSize"
|
|
||||||
@pagination="getList" />
|
|
||||||
|
|
||||||
<!-- 对话框(添加 / 修改) -->
|
|
||||||
<base-dialog
|
|
||||||
:dialogTitle="title"
|
|
||||||
:dialogVisible="open"
|
|
||||||
width="700px"
|
|
||||||
@close="cancel"
|
|
||||||
@cancel="cancel"
|
|
||||||
@confirm="submitForm">
|
|
||||||
<DialogForm v-if="open" ref="form" v-model="form" :rows="rows" />
|
|
||||||
</base-dialog>
|
|
||||||
|
|
||||||
<!-- 抽屉 详情 -->
|
|
||||||
<BasicDrawer
|
|
||||||
v-if="editVisible"
|
|
||||||
ref="drawer"
|
|
||||||
:default-mode="editMode"
|
|
||||||
:data-id="alarmForm.id"
|
|
||||||
:sections="[
|
|
||||||
{
|
|
||||||
name: '基本信息',
|
|
||||||
key: 'base',
|
|
||||||
rows: drawerBaseInfoRows,
|
|
||||||
url: '/base/equipment-group/get',
|
|
||||||
urlUpdate: '/base/equipment-group/update',
|
|
||||||
urlCreate: '/base/equipment-group/create',
|
|
||||||
queryParams: { id: alarmForm.id },
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: '属性列表',
|
|
||||||
key: 'attrs',
|
|
||||||
props: drawerListProps,
|
|
||||||
url: '/base/equipment-group-alarm/page',
|
|
||||||
urlCreate: '/base/equipment-group-alarm/create',
|
|
||||||
urlUpdate: '/base/equipment-group-alarm/update',
|
|
||||||
urlDelete: '/base/equipment-group-alarm/delete',
|
|
||||||
urlDetail: '/base/equipment-group-alarm/get',
|
|
||||||
queryParams: {
|
|
||||||
equipmentGroupId: alarmForm.id,
|
|
||||||
pageNo: 1,
|
|
||||||
pageSize: 10,
|
|
||||||
},
|
|
||||||
tableBtn: [
|
|
||||||
this.$auth.hasPermi('base:equipment-group:update')
|
|
||||||
? {
|
|
||||||
type: 'edit',
|
|
||||||
btnName: '修改',
|
|
||||||
}
|
|
||||||
: undefined,
|
|
||||||
this.$auth.hasPermi('base:equipment-group:delete')
|
|
||||||
? {
|
|
||||||
type: 'delete',
|
|
||||||
btnName: '删除',
|
|
||||||
}
|
|
||||||
: undefined,
|
|
||||||
].filter((v) => v),
|
|
||||||
allowAdd: true,
|
|
||||||
},
|
|
||||||
]"
|
|
||||||
@refreshDataList="getList"
|
|
||||||
@cancel="editVisible = false"
|
|
||||||
@destroy="editVisible = false" />
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import {
|
|
||||||
createEquipmentBindGroup,
|
|
||||||
updateEquipmentBindGroup,
|
|
||||||
deleteEquipmentBindGroup,
|
|
||||||
getEquipmentBindGroup,
|
|
||||||
getEquipmentBindGroupPage,
|
|
||||||
exportEquipmentBindGroupExcel,
|
|
||||||
} from '@/api/base/equipmentBindGroup';
|
|
||||||
|
|
||||||
import { getEquipmentGroupPage } from '@/api/base/equipmentGroup';
|
|
||||||
import moment from 'moment';
|
|
||||||
import { publicFormatter } from '@/utils/dict';
|
|
||||||
import basicPageMixin from '@/mixins/lb/basicPageMixin';
|
|
||||||
import BasicDrawer from './components/BasicDrawer.vue';
|
|
||||||
|
|
||||||
export default {
|
|
||||||
name: 'EquipmentBindGroup',
|
|
||||||
components: { BasicDrawer },
|
|
||||||
mixins: [basicPageMixin],
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
searchBarKeys: ['groupId', 'equipmentName'],
|
|
||||||
tableBtn: [
|
|
||||||
this.$auth.hasPermi('base:equipment-bind-group:update')
|
|
||||||
? {
|
|
||||||
type: 'detail',
|
|
||||||
btnName: '查看报警',
|
|
||||||
}
|
|
||||||
: undefined,
|
|
||||||
this.$auth.hasPermi('base:equipment-bind-group:update')
|
|
||||||
? {
|
|
||||||
type: 'edit',
|
|
||||||
btnName: '修改',
|
|
||||||
}
|
|
||||||
: undefined,
|
|
||||||
this.$auth.hasPermi('base:equipment-bind-group:delete')
|
|
||||||
? {
|
|
||||||
type: 'delete',
|
|
||||||
btnName: '删除',
|
|
||||||
}
|
|
||||||
: undefined,
|
|
||||||
].filter((v) => v),
|
|
||||||
tableProps: [
|
|
||||||
{
|
|
||||||
prop: 'createTime',
|
|
||||||
label: '添加时间',
|
|
||||||
fixed: true,
|
|
||||||
width: 180,
|
|
||||||
filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'),
|
|
||||||
},
|
|
||||||
{ prop: 'equipmentName', label: '设备' },
|
|
||||||
{ prop: 'groupName', label: '分组' },
|
|
||||||
// {
|
|
||||||
// _action: 'equipment-bind-group-show-alert',
|
|
||||||
// label: '分组报警',
|
|
||||||
// subcomponent: {
|
|
||||||
// props: ['injectData'],
|
|
||||||
// render: function (h) {
|
|
||||||
// const _this = this;
|
|
||||||
// return h(
|
|
||||||
// 'el-button',
|
|
||||||
// {
|
|
||||||
// props: { type: 'text' },
|
|
||||||
// on: {
|
|
||||||
// click: function () {
|
|
||||||
// console.log('inejctdata', _this.injectData);
|
|
||||||
// _this.$emit('emitData', {
|
|
||||||
// action: _this.injectData._action,
|
|
||||||
// value: _this.injectData,
|
|
||||||
// });
|
|
||||||
// },
|
|
||||||
// },
|
|
||||||
// },
|
|
||||||
// '查看报警'
|
|
||||||
// );
|
|
||||||
// },
|
|
||||||
// },
|
|
||||||
// },
|
|
||||||
],
|
|
||||||
searchBarFormConfig: [
|
|
||||||
{
|
|
||||||
type: 'select',
|
|
||||||
label: '分组',
|
|
||||||
placeholder: '请选择分组',
|
|
||||||
param: 'groupId',
|
|
||||||
filterable: true,
|
|
||||||
selectOptions: [],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: 'input',
|
|
||||||
label: '设备',
|
|
||||||
placeholder: '请输入设备',
|
|
||||||
param: 'equipmentName',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: 'button',
|
|
||||||
btnName: '查询',
|
|
||||||
name: 'search',
|
|
||||||
color: 'primary',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: 'separate',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: this.$auth.hasPermi('base:equipment-bind-group:create')
|
|
||||||
? 'button'
|
|
||||||
: '',
|
|
||||||
btnName: '新增',
|
|
||||||
name: 'add',
|
|
||||||
plain: true,
|
|
||||||
color: 'success',
|
|
||||||
},
|
|
||||||
// {
|
|
||||||
// type: this.$auth.hasPermi('base:equipment-group:export') ? 'button' : '',
|
|
||||||
// btnName: '导出',
|
|
||||||
// name: 'export',
|
|
||||||
// color: 'warning',
|
|
||||||
// },
|
|
||||||
],
|
|
||||||
rows: [
|
|
||||||
[
|
|
||||||
{
|
|
||||||
select: true,
|
|
||||||
label: '设备',
|
|
||||||
url: '/base/equipment/page?pageNo=1&pageSize=100',
|
|
||||||
prop: 'equipmentId',
|
|
||||||
bind: {
|
|
||||||
filterable: true,
|
|
||||||
},
|
|
||||||
rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
|
||||||
},
|
|
||||||
],
|
|
||||||
[
|
|
||||||
{
|
|
||||||
select: true,
|
|
||||||
label: '报警分组',
|
|
||||||
url: '/base/equipment-group/listAll', // 根据产线获取
|
|
||||||
// depends: '__product_line', // 依赖产线获取数据
|
|
||||||
// depends: 'productionLineId',
|
|
||||||
prop: 'groupId',
|
|
||||||
bind: {
|
|
||||||
filterable: true,
|
|
||||||
},
|
|
||||||
rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
|
||||||
},
|
|
||||||
],
|
|
||||||
],
|
|
||||||
// 是否显示弹出层
|
|
||||||
open: false,
|
|
||||||
// 查询参数
|
|
||||||
queryParams: {
|
|
||||||
pageNo: 1,
|
|
||||||
pageSize: 10,
|
|
||||||
equipmentName: null,
|
|
||||||
groupId: null,
|
|
||||||
},
|
|
||||||
// 表单参数
|
|
||||||
form: {},
|
|
||||||
// 表单校验
|
|
||||||
rules: {},
|
|
||||||
//
|
|
||||||
alarmForm: {
|
|
||||||
id: undefined,
|
|
||||||
equipmentGroupCode: undefined,
|
|
||||||
equipmentGroupName: undefined,
|
|
||||||
},
|
|
||||||
editVisible: false,
|
|
||||||
editMode: '',
|
|
||||||
drawerBaseInfoRows: [
|
|
||||||
[
|
|
||||||
{
|
|
||||||
input: true,
|
|
||||||
label: '设备分组名称',
|
|
||||||
prop: 'name',
|
|
||||||
rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
|
||||||
// bind: {
|
|
||||||
// disabled: this.editMode == 'detail', // some condition, like detail mode...
|
|
||||||
// }
|
|
||||||
},
|
|
||||||
{
|
|
||||||
input: true,
|
|
||||||
label: '设备分组编码',
|
|
||||||
prop: 'code',
|
|
||||||
// url: '/base/equipment/getCode',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
],
|
|
||||||
drawerListProps: [
|
|
||||||
{
|
|
||||||
prop: 'createTime',
|
|
||||||
label: '添加时间',
|
|
||||||
fixed: true,
|
|
||||||
width: 180,
|
|
||||||
filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'),
|
|
||||||
},
|
|
||||||
{ width: 240, prop: 'code', label: '报警编码' },
|
|
||||||
{
|
|
||||||
width: 100,
|
|
||||||
prop: 'type',
|
|
||||||
label: '报警类型',
|
|
||||||
filter: (val) =>
|
|
||||||
val != null ? ['-', '字符型', '布尔型', '-'][val] : '-',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
width: 90,
|
|
||||||
prop: 'grade',
|
|
||||||
label: '报警级别',
|
|
||||||
filter: publicFormatter(this.DICT_TYPE.EQU_ALARM_LEVEL),
|
|
||||||
},
|
|
||||||
{ width: 180, prop: 'alarmCode', label: '设备报警编码' },
|
|
||||||
{ width: 128, prop: 'plcParamName', label: '参数列名' },
|
|
||||||
{ width: 128, prop: 'alarmContent', label: '报警内容' },
|
|
||||||
],
|
|
||||||
};
|
|
||||||
},
|
|
||||||
created() {
|
|
||||||
this.getList();
|
|
||||||
getEquipmentGroupPage({ pageNo: 1, pageSize: 100 }).then((res) => {
|
|
||||||
this.searchBarFormConfig[0].selectOptions = res.data.list;
|
|
||||||
});
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
/** 覆盖 handleEmitFun 的默认实现 */
|
|
||||||
handleEmitFun({ action, value }) {
|
|
||||||
const {
|
|
||||||
groupId: equipmentGroupId,
|
|
||||||
groupName: equipmentGroupName,
|
|
||||||
groupCode: equipmentGroupCode,
|
|
||||||
} = value;
|
|
||||||
switch (action) {
|
|
||||||
case 'equipment-bind-group-show-alert':
|
|
||||||
// this.$router.push({ path: '/equipment/base/equipment-group-alarm' });
|
|
||||||
this.$router.push({
|
|
||||||
name: 'EquipmentGroupAlarm',
|
|
||||||
params: {
|
|
||||||
equipmentGroupId,
|
|
||||||
equipmentGroupCode,
|
|
||||||
equipmentGroupName,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
/** 查询列表 */
|
|
||||||
getList() {
|
|
||||||
this.loading = true;
|
|
||||||
getEquipmentBindGroupPage(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,
|
|
||||||
groupId: 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;
|
|
||||||
getEquipmentBindGroup(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) {
|
|
||||||
updateEquipmentBindGroup(this.form).then((response) => {
|
|
||||||
this.$modal.msgSuccess('修改成功');
|
|
||||||
this.open = false;
|
|
||||||
this.getList();
|
|
||||||
});
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
// 添加的提交
|
|
||||||
createEquipmentBindGroup(this.form).then((response) => {
|
|
||||||
this.$modal.msgSuccess('新增成功');
|
|
||||||
this.open = false;
|
|
||||||
this.getList();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
},
|
|
||||||
// 查看报警
|
|
||||||
handleDetail(row) {
|
|
||||||
const { equipmentId, equipmentName, groupCode, groupId, groupName, id } =
|
|
||||||
row;
|
|
||||||
// 打开抽屉
|
|
||||||
this.editMode = 'detail';
|
|
||||||
this.alarmForm.id = groupId;
|
|
||||||
this.alarmForm.equipmentGroupCode = groupCode;
|
|
||||||
this.alarmForm.equipmentGroupName = groupName;
|
|
||||||
this.editVisible = true;
|
|
||||||
this.$nextTick(() => {
|
|
||||||
this.$refs['drawer'].init();
|
|
||||||
});
|
|
||||||
},
|
|
||||||
/** 删除按钮操作 */
|
|
||||||
handleDelete(row) {
|
|
||||||
const id = row.id;
|
|
||||||
this.$modal
|
|
||||||
.confirm('是否确认删除该分组绑定?')
|
|
||||||
.then(function () {
|
|
||||||
return deleteEquipmentBindGroup(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 exportEquipmentBindGroupExcel(params);
|
|
||||||
})
|
|
||||||
.then((response) => {
|
|
||||||
this.$download.excel(response, '设备与分组绑定.xls');
|
|
||||||
this.exportLoading = false;
|
|
||||||
})
|
|
||||||
.catch(() => {});
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
@@ -1,226 +0,0 @@
|
|||||||
<!--
|
|
||||||
filename: dialogForm.vue
|
|
||||||
author: liubin
|
|
||||||
date: 2023-09-11 15:55:13
|
|
||||||
description: DialogForm for equipmentBindSection only
|
|
||||||
-->
|
|
||||||
|
|
||||||
<template>
|
|
||||||
<el-form
|
|
||||||
ref="form"
|
|
||||||
:model="dataForm"
|
|
||||||
label-width="100px"
|
|
||||||
v-loading="formLoading">
|
|
||||||
<el-row :gutter="20">
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item
|
|
||||||
label="产线"
|
|
||||||
prop="productionLineId"
|
|
||||||
:rules="[{ required: true, message: '不能为空', trigger: 'blur' }]">
|
|
||||||
<el-select
|
|
||||||
v-model="dataForm.productionLineId"
|
|
||||||
placeholder="请选择产线"
|
|
||||||
filterable
|
|
||||||
@change="handleProductlineChange">
|
|
||||||
<el-option
|
|
||||||
v-for="opt in productionLineList"
|
|
||||||
:key="opt.value"
|
|
||||||
:label="opt.label"
|
|
||||||
:value="opt.value" />
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item
|
|
||||||
label="工段"
|
|
||||||
prop="workshopSectionId"
|
|
||||||
:rules="[{ required: true, message: '不能为空', trigger: 'blur' }]">
|
|
||||||
<el-select
|
|
||||||
v-model="dataForm.workshopSectionId"
|
|
||||||
filterable
|
|
||||||
placeholder="请选择工段"
|
|
||||||
@change="$emit('update', dataForm)">
|
|
||||||
<el-option
|
|
||||||
v-for="opt in worksectionList"
|
|
||||||
:key="opt.value"
|
|
||||||
:label="opt.label"
|
|
||||||
:value="opt.value" />
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row :gutter="20">
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item
|
|
||||||
label="设备"
|
|
||||||
prop="equipmentId"
|
|
||||||
:rules="[{ required: true, message: '不能为空', trigger: 'blur' }]">
|
|
||||||
<el-select
|
|
||||||
v-model="dataForm.equipmentId"
|
|
||||||
filterable
|
|
||||||
placeholder="请选择设备"
|
|
||||||
@change="$emit('update', dataForm)">
|
|
||||||
<el-option
|
|
||||||
v-for="opt in equipmentList"
|
|
||||||
:key="opt.value"
|
|
||||||
:label="opt.label"
|
|
||||||
:value="opt.value" />
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="工段设备排序" prop="sort">
|
|
||||||
<el-input-number
|
|
||||||
v-model="dataForm.sort"
|
|
||||||
filterable
|
|
||||||
min="0"
|
|
||||||
max="100"
|
|
||||||
@change="$emit('update', dataForm)"
|
|
||||||
placeholder="请输入工段设备排序" />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row :gutter="20">
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="产线数据类型" prop="lineDataType">
|
|
||||||
<el-select
|
|
||||||
v-model="dataForm.lineDataType"
|
|
||||||
placeholder="请选择产线数据类型"
|
|
||||||
@change="$emit('update', dataForm)">
|
|
||||||
<el-option
|
|
||||||
v-for="opt in [
|
|
||||||
{ label: '无类型', value: 0 },
|
|
||||||
{ label: '进口统计', value: 1 },
|
|
||||||
{ label: '出口统计', value: 2 },
|
|
||||||
]"
|
|
||||||
:key="opt.value"
|
|
||||||
:label="opt.label"
|
|
||||||
:value="opt.value" />
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="工段数据类型" prop="sectionDataType">
|
|
||||||
<el-select
|
|
||||||
v-model="dataForm.sectionDataType"
|
|
||||||
placeholder="请选择工段数据类型"
|
|
||||||
@change="$emit('update', dataForm)">
|
|
||||||
<el-option
|
|
||||||
v-for="opt in [
|
|
||||||
{ label: '无类型', value: 0 },
|
|
||||||
{ label: '进口统计', value: 1 },
|
|
||||||
{ label: '出口统计', value: 2 },
|
|
||||||
{ label: '进出口计数', value: 3 },
|
|
||||||
]"
|
|
||||||
:key="opt.value"
|
|
||||||
:label="opt.label"
|
|
||||||
:value="opt.value" />
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
</el-form>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
export default {
|
|
||||||
name: 'DialogForm',
|
|
||||||
model: {
|
|
||||||
prop: 'dataForm',
|
|
||||||
event: 'update',
|
|
||||||
},
|
|
||||||
emits: ['update'],
|
|
||||||
components: {},
|
|
||||||
props: {
|
|
||||||
dataForm: {
|
|
||||||
type: Object,
|
|
||||||
default: () => ({}),
|
|
||||||
},
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
formLoading: true,
|
|
||||||
productionLineList: [],
|
|
||||||
equipmentList: [],
|
|
||||||
worksectionList: [],
|
|
||||||
dataFormCache: null,
|
|
||||||
};
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
Promise.all([this.getProductLineList(), this.getEquipmentList()]).then(
|
|
||||||
() => {
|
|
||||||
this.formLoading = false;
|
|
||||||
}
|
|
||||||
);
|
|
||||||
},
|
|
||||||
watch: {
|
|
||||||
'dataForm.productionLineId': {
|
|
||||||
handler: async function (plId) {
|
|
||||||
if (plId) await this.getWorksectionList(plId);
|
|
||||||
},
|
|
||||||
immediate: true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
/** 模拟透传 ref */
|
|
||||||
validate(cb) {
|
|
||||||
return this.$refs.form.validate(cb);
|
|
||||||
},
|
|
||||||
resetFields(args) {
|
|
||||||
return this.$refs.form.resetFields(args);
|
|
||||||
},
|
|
||||||
async handleProductlineChange(id) {
|
|
||||||
await this.getWorksectionList(id);
|
|
||||||
this.dataForm.workshopSectionId = null;
|
|
||||||
this.$emit('update', this.dataForm);
|
|
||||||
},
|
|
||||||
// getCode
|
|
||||||
async getCode(url) {
|
|
||||||
const response = await this.$axios(url);
|
|
||||||
return response.data;
|
|
||||||
},
|
|
||||||
// 获取产线列表
|
|
||||||
async getProductLineList() {
|
|
||||||
const response = await this.$axios('/base/production-line/listAll');
|
|
||||||
this.productionLineList = response.data.map((item) => ({
|
|
||||||
label: item.name,
|
|
||||||
value: item.id,
|
|
||||||
}));
|
|
||||||
},
|
|
||||||
// 获取设备列表
|
|
||||||
async getEquipmentList() {
|
|
||||||
const response = await this.$axios(
|
|
||||||
'/base/equipment/page?pageNo=1&pageSize=100'
|
|
||||||
);
|
|
||||||
this.equipmentList = response.data.list.map((item) => ({
|
|
||||||
label: item.name,
|
|
||||||
value: item.id,
|
|
||||||
}));
|
|
||||||
},
|
|
||||||
// 获取工段列表
|
|
||||||
async getWorksectionList(plId) {
|
|
||||||
const response = await this.$axios(
|
|
||||||
'/base/workshop-section/listByParentId',
|
|
||||||
{
|
|
||||||
params: {
|
|
||||||
id: plId,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
);
|
|
||||||
this.worksectionList = response.data.map((item) => ({
|
|
||||||
label: item.name,
|
|
||||||
value: item.id,
|
|
||||||
}));
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped lang="scss">
|
|
||||||
.el-date-editor,
|
|
||||||
.el-select {
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,442 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div class="app-container">
|
|
||||||
<!-- 搜索工作栏 -->
|
|
||||||
<SearchBar
|
|
||||||
:formConfigs="searchBarFormConfig"
|
|
||||||
ref="search-bar"
|
|
||||||
@select-changed="handleSearchBarChanged"
|
|
||||||
@headBtnClick="buttonClick" />
|
|
||||||
|
|
||||||
<!-- 列表 -->
|
|
||||||
<base-table
|
|
||||||
:table-props="tableProps"
|
|
||||||
:page="queryParams.pageNo"
|
|
||||||
:limit="queryParams.pageSize"
|
|
||||||
:table-data="list"
|
|
||||||
@emitFun="handleEmitFun">
|
|
||||||
<method-btn
|
|
||||||
v-if="tableBtn.length"
|
|
||||||
slot="handleBtn"
|
|
||||||
label="操作"
|
|
||||||
:width="120"
|
|
||||||
:method-list="tableBtn"
|
|
||||||
@clickBtn="handleTableBtnClick" />
|
|
||||||
</base-table>
|
|
||||||
|
|
||||||
<!-- 分页组件 -->
|
|
||||||
<pagination
|
|
||||||
v-show="total > 0"
|
|
||||||
:total="total"
|
|
||||||
:page.sync="queryParams.pageNo"
|
|
||||||
:limit.sync="queryParams.pageSize"
|
|
||||||
@pagination="getList" />
|
|
||||||
|
|
||||||
<!-- 对话框(添加 / 修改) -->
|
|
||||||
<base-dialog
|
|
||||||
:dialogTitle="title"
|
|
||||||
:dialogVisible="open"
|
|
||||||
width="700px"
|
|
||||||
@close="cancel"
|
|
||||||
@cancel="cancel"
|
|
||||||
@confirm="submitForm">
|
|
||||||
<DialogForm v-if="open" ref="form" v-model="form" :rows="rows" />
|
|
||||||
</base-dialog>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import {
|
|
||||||
createEquipmentBindSection,
|
|
||||||
updateEquipmentBindSection,
|
|
||||||
deleteEquipmentBindSection,
|
|
||||||
getEquipmentBindSection,
|
|
||||||
getEquipmentBindSectionPage,
|
|
||||||
exportEquipmentBindSectionExcel,
|
|
||||||
} from '@/api/base/equipmentBindSection';
|
|
||||||
import { getPdList } from '@/api/core/monitoring/auto';
|
|
||||||
import { getFactoryPage } from '@/api/core/base/factory';
|
|
||||||
import moment from 'moment';
|
|
||||||
import basicPageMixin from '@/mixins/lb/basicPageMixin';
|
|
||||||
import DialogForm from './dialogForm.vue';
|
|
||||||
export default {
|
|
||||||
name: 'EquipmentBindSection',
|
|
||||||
components: { DialogForm },
|
|
||||||
mixins: [basicPageMixin],
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
searchBarKeys: ['factoryId','productionLineId','workshopSectionId', 'equipmentName'],
|
|
||||||
tableBtn: [
|
|
||||||
this.$auth.hasPermi('base:equipment-bind-section:update')
|
|
||||||
? {
|
|
||||||
type: 'edit',
|
|
||||||
btnName: '修改',
|
|
||||||
}
|
|
||||||
: undefined,
|
|
||||||
this.$auth.hasPermi('base:equipment-bind-section:delete')
|
|
||||||
? {
|
|
||||||
type: 'delete',
|
|
||||||
btnName: '删除',
|
|
||||||
}
|
|
||||||
: undefined,
|
|
||||||
].filter((v) => v),
|
|
||||||
tableProps: [
|
|
||||||
{
|
|
||||||
prop: 'createTime',
|
|
||||||
label: '添加时间',
|
|
||||||
fixed: true,
|
|
||||||
width: 180,
|
|
||||||
filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'),
|
|
||||||
},
|
|
||||||
{ prop: 'factoryName', label: '工厂' },
|
|
||||||
{ prop: 'productionLine', label: '产线' },
|
|
||||||
{ prop: 'workshopSection', label: '工段' },
|
|
||||||
{ prop: 'equipment', label: '设备名称' },
|
|
||||||
{ prop: 'sort', label: '工段中排序' },
|
|
||||||
{
|
|
||||||
prop: 'lineDataType',
|
|
||||||
label: '产线数据类型',
|
|
||||||
filter: (val) =>
|
|
||||||
val != null ? ['无类型', '进口计数', '出口计数'][val] : '-',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: 'sectionDataType',
|
|
||||||
label: '工段数据类型',
|
|
||||||
filter: (val) =>
|
|
||||||
val != null ? ['无类型', '进口计数', '出口计数', '进出口计数'][val] : '-',
|
|
||||||
},
|
|
||||||
// {
|
|
||||||
// action: 'show-alert',
|
|
||||||
// label: '报警',
|
|
||||||
// ,
|
|
||||||
// subcomponent: {
|
|
||||||
// props: ['injectData'],
|
|
||||||
// render: function (h) {
|
|
||||||
// const _this = this;
|
|
||||||
// return h(
|
|
||||||
// 'el-button',
|
|
||||||
// {
|
|
||||||
// props: { type: 'text', size: 'mini' },
|
|
||||||
// on: {
|
|
||||||
// click: function () {
|
|
||||||
// console.log('inejctdata', _this.injectData);
|
|
||||||
// _this.$emit('emitData', {
|
|
||||||
// action: _this.injectData.action,
|
|
||||||
// value: _this.injectData.id,
|
|
||||||
// });
|
|
||||||
// },
|
|
||||||
// },
|
|
||||||
// },
|
|
||||||
// '查看报警'
|
|
||||||
// );
|
|
||||||
// },
|
|
||||||
// },
|
|
||||||
// },
|
|
||||||
],
|
|
||||||
searchBarFormConfig: [
|
|
||||||
{
|
|
||||||
type: 'select',
|
|
||||||
label: '工厂',
|
|
||||||
selectOptions: [],
|
|
||||||
param: 'factoryId',
|
|
||||||
onchange: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: 'select',
|
|
||||||
label: '产线',
|
|
||||||
selectOptions: [],
|
|
||||||
param: 'productionLineId',
|
|
||||||
multiple: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: 'select',
|
|
||||||
label: '工段',
|
|
||||||
placeholder: '请选择工段',
|
|
||||||
param: 'workshopSectionId',
|
|
||||||
selectOptions: [],
|
|
||||||
filterable: true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: 'input',
|
|
||||||
label: '设备',
|
|
||||||
placeholder: '请输入设备',
|
|
||||||
param: 'equipmentName',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: 'button',
|
|
||||||
btnName: '查询',
|
|
||||||
name: 'search',
|
|
||||||
color: 'primary',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: 'separate',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: this.$auth.hasPermi('base:equipment-bind-section:create')
|
|
||||||
? 'button'
|
|
||||||
: '',
|
|
||||||
btnName: '新增',
|
|
||||||
name: 'add',
|
|
||||||
plain: true,
|
|
||||||
color: 'success',
|
|
||||||
},
|
|
||||||
// {
|
|
||||||
// type: this.$auth.hasPermi('base:equipment-group:export') ? 'button' : '',
|
|
||||||
// btnName: '导出',
|
|
||||||
// name: 'export',
|
|
||||||
// color: 'warning',
|
|
||||||
// },
|
|
||||||
],
|
|
||||||
rows: [
|
|
||||||
[
|
|
||||||
{
|
|
||||||
select: true,
|
|
||||||
label: '产线',
|
|
||||||
url: '/base/production-line/listAll',
|
|
||||||
// prop: '__product_line', // __开头代表不传递给服务器
|
|
||||||
prop: 'productionLineId', // 编辑接口返回的产线id,所以不能使用上面那种形式
|
|
||||||
rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
select: true,
|
|
||||||
label: '工段',
|
|
||||||
url: '/base/workshop-section/listByParentId', // 根据产线获取
|
|
||||||
// depends: '__product_line', // 依赖产线获取数据
|
|
||||||
depends: 'productionLineId',
|
|
||||||
prop: 'workshopSectionId',
|
|
||||||
rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
|
||||||
},
|
|
||||||
],
|
|
||||||
[
|
|
||||||
{
|
|
||||||
select: true,
|
|
||||||
label: '设备',
|
|
||||||
url: '/base/equipment/page?pageNo=1&pageSize=100',
|
|
||||||
prop: 'equipmentId',
|
|
||||||
rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
input: true,
|
|
||||||
label: '工段排序',
|
|
||||||
prop: 'sort',
|
|
||||||
// url: '/base/equipment-group/getCode',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
[
|
|
||||||
{
|
|
||||||
select: true,
|
|
||||||
label: '产线数据类型',
|
|
||||||
options: [
|
|
||||||
{ label: '无类型', value: 0 },
|
|
||||||
{ label: '进口计数', value: 1 },
|
|
||||||
{ label: '出口计数', value: 2 },
|
|
||||||
],
|
|
||||||
prop: 'lineDataType',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
select: true,
|
|
||||||
label: '工段数据类型',
|
|
||||||
options: [
|
|
||||||
{ label: '无类型', value: 0 },
|
|
||||||
{ label: '进口计数', value: 1 },
|
|
||||||
{ label: '出口计数', value: 2 },
|
|
||||||
{ label: '进出口计数', value: 3 },
|
|
||||||
],
|
|
||||||
prop: 'sectionDataType',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
],
|
|
||||||
// 是否显示弹出层
|
|
||||||
open: false,
|
|
||||||
// 查询参数
|
|
||||||
queryParams: {
|
|
||||||
pageNo: 1,
|
|
||||||
pageSize: 10,
|
|
||||||
workshopSectionId: null,
|
|
||||||
equipmentId: null,
|
|
||||||
equipmentName: null,
|
|
||||||
factoryId: null,
|
|
||||||
productionLineId: [],
|
|
||||||
},
|
|
||||||
// 表单参数
|
|
||||||
form: {},
|
|
||||||
};
|
|
||||||
},
|
|
||||||
created() {
|
|
||||||
this.getList();
|
|
||||||
this.initWorksection();
|
|
||||||
this.getPdLineList();
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
/** 准备工段数据 */
|
|
||||||
async initWorksection() {
|
|
||||||
const { code, data } = await this.$axios({
|
|
||||||
url: '/base/workshop-section/listAll',
|
|
||||||
method: 'get',
|
|
||||||
});
|
|
||||||
if (code == 0) {
|
|
||||||
this.searchBarFormConfig[2].selectOptions = data.map((item) => {
|
|
||||||
return {
|
|
||||||
name: item.name,
|
|
||||||
id: item.id,
|
|
||||||
};
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
getPdLineList() {
|
|
||||||
getPdList().then((res) => {
|
|
||||||
this.searchBarFormConfig[1].selectOptions = res.data || [];
|
|
||||||
});
|
|
||||||
const params = {
|
|
||||||
pageSize: 100,
|
|
||||||
pageNo: 1,
|
|
||||||
};
|
|
||||||
getFactoryPage(params).then((res) => {
|
|
||||||
this.searchBarFormConfig[0].selectOptions = res.data.list || [];
|
|
||||||
});
|
|
||||||
},
|
|
||||||
handleSearchBarChanged({ param, value }) {
|
|
||||||
this.queryParams.productionLineId = [];
|
|
||||||
this.$refs['search-bar'].formInline.productionLineId = undefined;
|
|
||||||
getPdList(value).then((res) => {
|
|
||||||
this.searchBarFormConfig[1].selectOptions = res.data || [];
|
|
||||||
});
|
|
||||||
},
|
|
||||||
buttonClick(val) {
|
|
||||||
switch (val.btnName) {
|
|
||||||
case 'search':
|
|
||||||
this.queryParams.pageNo = 1;
|
|
||||||
this.queryParams.pageSize = 10;
|
|
||||||
this.queryParams.name = val.name;
|
|
||||||
this.queryParams.workshopSectionId = val.workshopSectionId || undefined;
|
|
||||||
this.queryParams.equipmentName = val.equipmentName || undefined;
|
|
||||||
this.queryParams.factoryId = val.factoryId || undefined;
|
|
||||||
this.queryParams.productionLineId = val.productionLineId || [];
|
|
||||||
this.handleQuery();
|
|
||||||
break;
|
|
||||||
case 'add':
|
|
||||||
this.handleAdd();
|
|
||||||
break;
|
|
||||||
case 'export':
|
|
||||||
this.handleExport();
|
|
||||||
break;
|
|
||||||
case 'reset':
|
|
||||||
this.$refs['search-bar'].resetForm();
|
|
||||||
this.resetQuery();
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
console.log(val);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
/** 查询列表 */
|
|
||||||
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('是否确认删除工段设备绑定设备名称为"' + row.equipment + '"的数据项?')
|
|
||||||
.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>
|
|
||||||
@@ -1,225 +0,0 @@
|
|||||||
<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>
|
|
||||||
@@ -1,481 +0,0 @@
|
|||||||
<!--
|
|
||||||
filename: EquipmentDrawer.vue
|
|
||||||
author: liubin
|
|
||||||
date: 2023-08-22 14:38:56
|
|
||||||
description:
|
|
||||||
-->
|
|
||||||
|
|
||||||
<template>
|
|
||||||
<el-drawer
|
|
||||||
:visible="visible"
|
|
||||||
:show-close="false"
|
|
||||||
:wrapper-closable="false"
|
|
||||||
class="drawer"
|
|
||||||
custom-class="mes-drawer"
|
|
||||||
size="60%"
|
|
||||||
@closed="$emit('destroy')">
|
|
||||||
<SmallTitle slot="title">
|
|
||||||
{{
|
|
||||||
mode.includes('detail')
|
|
||||||
? '详情'
|
|
||||||
: mode.includes('edit')
|
|
||||||
? '编辑'
|
|
||||||
: '新增'
|
|
||||||
}}
|
|
||||||
</SmallTitle>
|
|
||||||
|
|
||||||
<div class="drawer-body flex">
|
|
||||||
<div class="drawer-body__content">
|
|
||||||
<section v-for="(section, index) in sections" :key="section.key">
|
|
||||||
<SmallTitle v-if="index != 0">{{ section.name }}</SmallTitle>
|
|
||||||
|
|
||||||
<div class="form-part" v-if="section.key == 'base'">
|
|
||||||
<el-skeleton v-if="!showForm" animated />
|
|
||||||
<BaseInfoForm
|
|
||||||
key="drawer-dialog-form"
|
|
||||||
v-if="showForm"
|
|
||||||
ref="form"
|
|
||||||
:disabled="mode.includes('detail')"
|
|
||||||
v-model="form"
|
|
||||||
:rows="formRows" />
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div v-if="section.key == 'attrs'" style="margin-top: 12px">
|
|
||||||
<base-table
|
|
||||||
v-loading="attrListLoading"
|
|
||||||
:table-props="section.props"
|
|
||||||
:page="attrQuery?.params.pageNo || 1"
|
|
||||||
:limit="attrQuery?.params.pageSize || 10"
|
|
||||||
:table-data="list"
|
|
||||||
:add-button-show="mode.includes('detail') ? null : '添加属性'"
|
|
||||||
@emitButtonClick="handleAddAttr"
|
|
||||||
@emitFun="handleEmitFun">
|
|
||||||
<method-btn
|
|
||||||
v-if="section.tableBtn"
|
|
||||||
slot="handleBtn"
|
|
||||||
label="操作"
|
|
||||||
:method-list="tableBtn"
|
|
||||||
@clickBtn="handleTableBtnClick" />
|
|
||||||
</base-table>
|
|
||||||
|
|
||||||
<!-- 分页组件 -->
|
|
||||||
<pagination
|
|
||||||
v-show="total > 0"
|
|
||||||
:total="total"
|
|
||||||
:page.sync="attrQuery.params.pageNo"
|
|
||||||
:limit.sync="attrQuery.params.pageSize"
|
|
||||||
@pagination="getAttrList" />
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="drawer-body__footer">
|
|
||||||
<el-button style="" @click="handleCancel">取消</el-button>
|
|
||||||
<el-button v-if="mode == 'detail'" type="primary" @click="toggleEdit">
|
|
||||||
编辑
|
|
||||||
</el-button>
|
|
||||||
<el-button v-else type="primary" @click="handleCancel">确定</el-button>
|
|
||||||
<!-- sections的第二项必须是 属性列表 -->
|
|
||||||
<!-- <el-button
|
|
||||||
v-if="sections[1].allowAdd"
|
|
||||||
type="primary"
|
|
||||||
@click="handleAddAttr">
|
|
||||||
添加属性
|
|
||||||
</el-button> -->
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- 属性对话框 -->
|
|
||||||
<base-dialog
|
|
||||||
v-if="sections[1].allowAdd"
|
|
||||||
:dialogTitle="attrTitle"
|
|
||||||
:dialogVisible="attrFormVisible"
|
|
||||||
width="45%"
|
|
||||||
:append-to-body="true"
|
|
||||||
custom-class="baseDialog"
|
|
||||||
@close="closeAttrForm"
|
|
||||||
@cancel="closeAttrForm"
|
|
||||||
@confirm="submitAttrForm">
|
|
||||||
<DialogForm
|
|
||||||
v-if="attrFormVisible"
|
|
||||||
ref="attrForm"
|
|
||||||
:disabled="mode.includes('detail')"
|
|
||||||
v-model="attrForm"
|
|
||||||
:rows="attrRows" />
|
|
||||||
</base-dialog>
|
|
||||||
</el-drawer>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import BaseInfoForm from '@/components/DialogForm';
|
|
||||||
import DialogForm from './dialogForm';
|
|
||||||
|
|
||||||
const SmallTitle = {
|
|
||||||
name: 'SmallTitle',
|
|
||||||
props: ['size'],
|
|
||||||
data() {
|
|
||||||
return {};
|
|
||||||
},
|
|
||||||
methods: {},
|
|
||||||
render: function (h) {
|
|
||||||
return h(
|
|
||||||
'span',
|
|
||||||
{
|
|
||||||
class: 'small-title',
|
|
||||||
style: {
|
|
||||||
fontSize: '18px',
|
|
||||||
lineHeight:
|
|
||||||
this.size == 'lg' ? '24px' : this.size == 'sm' ? '18px' : '20px',
|
|
||||||
fontWeight: 500,
|
|
||||||
fontFamily: '微软雅黑, Microsoft YaHei, Arial, Helvetica, sans-serif',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
this.$slots.default
|
|
||||||
);
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
export default {
|
|
||||||
components: { SmallTitle, DialogForm, BaseInfoForm },
|
|
||||||
props: ['sections', 'defaultMode', 'dataId'], // dataId 作为一个通用的存放id的字段
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
mode: '',
|
|
||||||
visible: false,
|
|
||||||
showForm: false,
|
|
||||||
total: 0,
|
|
||||||
form: {},
|
|
||||||
list: [],
|
|
||||||
attrTitle: '',
|
|
||||||
attrForm: {
|
|
||||||
id: null,
|
|
||||||
equipmentGroupId: '',
|
|
||||||
code: '',
|
|
||||||
type: '',
|
|
||||||
grade: '',
|
|
||||||
alarmCode: '',
|
|
||||||
alarmContent: '',
|
|
||||||
plcParamName: '',
|
|
||||||
},
|
|
||||||
attrFormVisible: false,
|
|
||||||
attrRows: [
|
|
||||||
[
|
|
||||||
{
|
|
||||||
input: true,
|
|
||||||
label: '报警编码', // 自动生成
|
|
||||||
prop: 'code',
|
|
||||||
url: '/base/equipment-group-alarm/getCode',
|
|
||||||
rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
select: true,
|
|
||||||
label: '报警类型', // 固定选项
|
|
||||||
prop: 'type',
|
|
||||||
options: [
|
|
||||||
{ label: '布尔型', value: 2 },
|
|
||||||
{ label: '字符型', value: 1 },
|
|
||||||
],
|
|
||||||
rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
|
||||||
},
|
|
||||||
],
|
|
||||||
[
|
|
||||||
{
|
|
||||||
select: true,
|
|
||||||
label: '报警级别', // 字典
|
|
||||||
prop: 'grade',
|
|
||||||
options: this.getDictDatas(this.DICT_TYPE.EQU_ALARM_LEVEL),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
input: true,
|
|
||||||
label: '设备报警编码', // 对应到设备实际的报警编码
|
|
||||||
prop: 'alarmCode',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
[
|
|
||||||
{
|
|
||||||
input: true,
|
|
||||||
label: '参数列名', // 在实时数据库的列名
|
|
||||||
prop: 'plcParamName',
|
|
||||||
rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
input: true,
|
|
||||||
label: '报警内容',
|
|
||||||
prop: 'alarmContent',
|
|
||||||
rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
|
||||||
},
|
|
||||||
],
|
|
||||||
],
|
|
||||||
attrQuery: {
|
|
||||||
params: {
|
|
||||||
pageNo: 1,
|
|
||||||
pageSize: 10,
|
|
||||||
},
|
|
||||||
}, // 属性列表的请求
|
|
||||||
infoQuery: null, // 基本信息的请求
|
|
||||||
attrFormSubmitting: false,
|
|
||||||
attrListLoading: false,
|
|
||||||
};
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
formRows() {
|
|
||||||
return this.sections[0].rows.map((row) => {
|
|
||||||
return row.map((col) => {
|
|
||||||
return {
|
|
||||||
...col,
|
|
||||||
bind: {
|
|
||||||
// 详情 模式下,禁用各种输入
|
|
||||||
// disabled: this.mode == 'detail',
|
|
||||||
disabled: true
|
|
||||||
},
|
|
||||||
};
|
|
||||||
});
|
|
||||||
});
|
|
||||||
},
|
|
||||||
tableBtn() {
|
|
||||||
return this.mode == 'detail' ? [] : this.sections[1].tableBtn;
|
|
||||||
},
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
this.mode = this.defaultMode || 'detail';
|
|
||||||
for (const section of this.sections) {
|
|
||||||
// 请求具体信息
|
|
||||||
if ('url' in section) {
|
|
||||||
const query = {
|
|
||||||
url: section.url,
|
|
||||||
method: section.method || 'get',
|
|
||||||
params: section.queryParams || null,
|
|
||||||
data: section.data || null,
|
|
||||||
};
|
|
||||||
// debugger;
|
|
||||||
this.$axios(query).then(({ data }) => {
|
|
||||||
if (section.key == 'base') {
|
|
||||||
this.form = data;
|
|
||||||
this.showForm = true;
|
|
||||||
this.infoQuery = query;
|
|
||||||
} else if (section.key == 'attrs') {
|
|
||||||
this.attrQuery = query;
|
|
||||||
this.list = data.list;
|
|
||||||
this.total = data.total;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
handleTableBtnClick({ type, data }) {
|
|
||||||
switch (type) {
|
|
||||||
case 'edit':
|
|
||||||
this.handleEditAttr(data.id);
|
|
||||||
break;
|
|
||||||
case 'delete':
|
|
||||||
this.handleDeleteAttr(data.id);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
handleEmitFun(val) {
|
|
||||||
console.log('handleEmitFun', val);
|
|
||||||
},
|
|
||||||
|
|
||||||
init() {
|
|
||||||
this.visible = true;
|
|
||||||
},
|
|
||||||
|
|
||||||
async getAttrList() {
|
|
||||||
this.attrListLoading = true;
|
|
||||||
const res = await this.$axios(this.attrQuery);
|
|
||||||
if (res.code == 0) {
|
|
||||||
this.list = res.data.list;
|
|
||||||
this.total = res.data.total;
|
|
||||||
}
|
|
||||||
this.attrListLoading = false;
|
|
||||||
},
|
|
||||||
|
|
||||||
// 保存表单
|
|
||||||
handleSave() {
|
|
||||||
this.$refs['form'][0].validate(async (valid) => {
|
|
||||||
if (valid) {
|
|
||||||
const isEdit = this.mode == 'edit';
|
|
||||||
await this.$axios({
|
|
||||||
url: this.sections[0][isEdit ? 'urlUpdate' : 'urlCreate'],
|
|
||||||
method: isEdit ? 'put' : 'post',
|
|
||||||
data: this.form,
|
|
||||||
});
|
|
||||||
this.$modal.msgSuccess(`${isEdit ? '更新' : '创建'}成功`);
|
|
||||||
this.visible = false;
|
|
||||||
this.$emit('refreshDataList');
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
handleCancel() {
|
|
||||||
this.visible = false;
|
|
||||||
},
|
|
||||||
|
|
||||||
// 开启编辑
|
|
||||||
toggleEdit() {
|
|
||||||
this.mode = 'edit';
|
|
||||||
},
|
|
||||||
|
|
||||||
// 新增属性
|
|
||||||
handleAddAttr() {
|
|
||||||
if (!this.dataId) return this.$message.warning('请先创建设备分组信息');
|
|
||||||
this.attrForm = {
|
|
||||||
id: null,
|
|
||||||
equipmentGroupId: this.dataId,
|
|
||||||
code: '',
|
|
||||||
type: '',
|
|
||||||
grade: '',
|
|
||||||
alarmCode: '',
|
|
||||||
alarmContent: '',
|
|
||||||
plcParamName: '',
|
|
||||||
};
|
|
||||||
this.attrTitle = '添加设备分组报警';
|
|
||||||
this.attrFormVisible = true;
|
|
||||||
},
|
|
||||||
|
|
||||||
// 编辑属性
|
|
||||||
async handleEditAttr(attrId) {
|
|
||||||
const res = await this.$axios({
|
|
||||||
url: this.sections[1].urlDetail,
|
|
||||||
method: 'get',
|
|
||||||
params: { id: attrId },
|
|
||||||
});
|
|
||||||
if (res.code == 0) {
|
|
||||||
this.attrForm = res.data;
|
|
||||||
this.attrTitle = '编辑设备分组报警';
|
|
||||||
this.attrFormVisible = true;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
// 删除属性
|
|
||||||
handleDeleteAttr(attrId) {
|
|
||||||
this.$confirm('确定删除该分组报警?', '提示', {
|
|
||||||
confirmButtonText: '确定',
|
|
||||||
cancelButtonText: '取消',
|
|
||||||
type: 'warning',
|
|
||||||
})
|
|
||||||
.then(async () => {
|
|
||||||
const res = await this.$axios({
|
|
||||||
url: this.sections[1].urlDelete,
|
|
||||||
method: 'delete',
|
|
||||||
params: { id: attrId },
|
|
||||||
});
|
|
||||||
if (res.code == 0) {
|
|
||||||
this.$message({
|
|
||||||
message: '删除成功',
|
|
||||||
type: 'success',
|
|
||||||
duration: 1500,
|
|
||||||
onClose: () => {
|
|
||||||
this.getAttrList();
|
|
||||||
},
|
|
||||||
});
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.catch(() => {});
|
|
||||||
},
|
|
||||||
|
|
||||||
// 提交属性表
|
|
||||||
async submitAttrForm() {
|
|
||||||
this.$refs['attrForm'].validate((valid) => {
|
|
||||||
if (!valid) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
const isEdit = this.attrForm.id != null;
|
|
||||||
this.attrFormSubmitting = true;
|
|
||||||
const res = await this.$axios({
|
|
||||||
url: isEdit ? this.sections[1].urlUpdate : this.sections[1].urlCreate,
|
|
||||||
method: isEdit ? 'put' : 'post',
|
|
||||||
data: this.attrForm,
|
|
||||||
});
|
|
||||||
|
|
||||||
if (res.code == 0) {
|
|
||||||
this.closeAttrForm();
|
|
||||||
this.$message({
|
|
||||||
message: `${isEdit ? '更新' : '创建'}成功`,
|
|
||||||
type: 'success',
|
|
||||||
duration: 1500,
|
|
||||||
onClose: () => {
|
|
||||||
this.getAttrList();
|
|
||||||
},
|
|
||||||
});
|
|
||||||
}
|
|
||||||
this.attrFormSubmitting = false;
|
|
||||||
},
|
|
||||||
|
|
||||||
closeAttrForm() {
|
|
||||||
this.attrFormVisible = false;
|
|
||||||
},
|
|
||||||
|
|
||||||
handleClick(raw) {
|
|
||||||
if (raw.type === 'delete') {
|
|
||||||
this.$confirm(`确定删除该报警?`, '提示', {
|
|
||||||
confirmButtonText: '确定',
|
|
||||||
cancelButtonText: '取消',
|
|
||||||
type: 'warning',
|
|
||||||
})
|
|
||||||
.then(() => {
|
|
||||||
deleteProductAttr(raw.data.id).then(({ data }) => {
|
|
||||||
this.$message({
|
|
||||||
message: '操作成功',
|
|
||||||
type: 'success',
|
|
||||||
duration: 1500,
|
|
||||||
onClose: () => {
|
|
||||||
this.getList();
|
|
||||||
},
|
|
||||||
});
|
|
||||||
});
|
|
||||||
})
|
|
||||||
.catch(() => {});
|
|
||||||
} else {
|
|
||||||
this.addNew(raw.data.id);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped>
|
|
||||||
.drawer >>> .el-drawer {
|
|
||||||
border-radius: 8px 0 0 8px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.drawer >>> .el-drawer__header {
|
|
||||||
margin: 0;
|
|
||||||
padding: 32px 32px 24px;
|
|
||||||
border-bottom: 1px solid #dcdfe6;
|
|
||||||
margin-bottom: 0px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.small-title::before {
|
|
||||||
content: '';
|
|
||||||
display: inline-block;
|
|
||||||
vertical-align: top;
|
|
||||||
width: 4px;
|
|
||||||
height: 22px;
|
|
||||||
border-radius: 1px;
|
|
||||||
margin-right: 8px;
|
|
||||||
background-color: #0b58ff;
|
|
||||||
}
|
|
||||||
|
|
||||||
.drawer-body {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.drawer-body__content {
|
|
||||||
flex: 1;
|
|
||||||
/* background: #eee; */
|
|
||||||
padding: 20px 30px;
|
|
||||||
overflow-y: auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
.drawer-body__footer {
|
|
||||||
display: flex;
|
|
||||||
justify-content: flex-end;
|
|
||||||
padding: 18px;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,187 +0,0 @@
|
|||||||
<!--
|
|
||||||
filename: dialogForm.vue
|
|
||||||
author: liubin
|
|
||||||
date: 2023-09-11 15:55:13
|
|
||||||
description: DialogForm for equipmentBindSection only
|
|
||||||
-->
|
|
||||||
|
|
||||||
<template>
|
|
||||||
<el-form
|
|
||||||
ref="form"
|
|
||||||
:model="dataForm"
|
|
||||||
label-width="100px"
|
|
||||||
v-loading="formLoading">
|
|
||||||
<el-row :gutter="20">
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item
|
|
||||||
label="报警编码"
|
|
||||||
prop="code"
|
|
||||||
:rules="[{ required: true, message: '不能为空', trigger: 'blur' }]">
|
|
||||||
<el-input
|
|
||||||
:disabled="disabled"
|
|
||||||
v-model="dataForm.code"
|
|
||||||
@change="$emit('update', dataForm)"
|
|
||||||
placeholder="请输入工段排序" />
|
|
||||||
</el-form-item>
|
|
||||||
<!--
|
|
||||||
<el-form-item
|
|
||||||
label="报警编码"
|
|
||||||
prop="code"
|
|
||||||
:rules="[{ required: true, message: '不能为空', trigger: 'blur' }]">
|
|
||||||
<el-select
|
|
||||||
v-model="dataForm.code"
|
|
||||||
placeholder="请选择产线"
|
|
||||||
@change="handleProductlineChange">
|
|
||||||
<el-option
|
|
||||||
v-for="opt in productionLineList"
|
|
||||||
:key="opt.value"
|
|
||||||
:label="opt.label"
|
|
||||||
:value="opt.value" />
|
|
||||||
</el-select>
|
|
||||||
</el-form-item> -->
|
|
||||||
</el-col>
|
|
||||||
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item
|
|
||||||
label="报警类型"
|
|
||||||
prop="type"
|
|
||||||
:rules="[{ required: true, message: '不能为空', trigger: 'blur' }]">
|
|
||||||
<el-select
|
|
||||||
:disabled="disabled"
|
|
||||||
v-model="dataForm.type"
|
|
||||||
placeholder="请选择报警类型"
|
|
||||||
@change="handleTypeChange">
|
|
||||||
<el-option
|
|
||||||
v-for="opt in [
|
|
||||||
{ label: '布尔型', value: 2 },
|
|
||||||
{ label: '字符型', value: 1 },
|
|
||||||
]"
|
|
||||||
:key="opt.value"
|
|
||||||
:label="opt.label"
|
|
||||||
:value="opt.value" />
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row :gutter="20">
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item
|
|
||||||
label="报警级别"
|
|
||||||
prop="grade"
|
|
||||||
:rules="[{ required: true, message: '不能为空', trigger: 'blur' }]">
|
|
||||||
<el-select
|
|
||||||
:disabled="disabled"
|
|
||||||
v-model="dataForm.grade"
|
|
||||||
placeholder="请选择报警级别"
|
|
||||||
@change="$emit('update', dataForm)">
|
|
||||||
<el-option
|
|
||||||
v-for="opt in getDictDatas(DICT_TYPE.EQU_ALARM_LEVEL)"
|
|
||||||
:key="opt.value"
|
|
||||||
:label="opt.label"
|
|
||||||
:value="opt.value" />
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item
|
|
||||||
v-if="+dataForm.type == 1"
|
|
||||||
label="设备报警编码"
|
|
||||||
prop="alarmCode">
|
|
||||||
<el-input
|
|
||||||
:disabled="disabled"
|
|
||||||
v-model="dataForm.alarmCode"
|
|
||||||
@change="$emit('update', dataForm)"
|
|
||||||
placeholder="请输入设备报警编码" />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row :gutter="20">
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item
|
|
||||||
label="参数列名"
|
|
||||||
prop="plcParamName"
|
|
||||||
:rules="[{ required: true, message: '不能为空', trigger: 'blur' }]">
|
|
||||||
<el-input
|
|
||||||
:disabled="disabled"
|
|
||||||
v-model="dataForm.plcParamName"
|
|
||||||
placeholder="请输入参数列名"
|
|
||||||
@change="$emit('update', dataForm)"></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item
|
|
||||||
label="报警内容"
|
|
||||||
prop="alarmContent"
|
|
||||||
:rules="[{ required: true, message: '不能为空', trigger: 'blur' }]">
|
|
||||||
<el-input
|
|
||||||
:disabled="disabled"
|
|
||||||
v-model="dataForm.alarmContent"
|
|
||||||
placeholder="请输入报警内容"
|
|
||||||
@change="$emit('update', dataForm)"></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
</el-form>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
export default {
|
|
||||||
name: 'DialogForm',
|
|
||||||
model: {
|
|
||||||
prop: 'dataForm',
|
|
||||||
event: 'update',
|
|
||||||
},
|
|
||||||
emits: ['update'],
|
|
||||||
components: {},
|
|
||||||
props: {
|
|
||||||
dataForm: {
|
|
||||||
type: Object,
|
|
||||||
default: () => ({}),
|
|
||||||
},
|
|
||||||
disabled: {
|
|
||||||
type: Boolean,
|
|
||||||
default: false,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
formLoading: true,
|
|
||||||
};
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
this.getCode('/base/equipment-group-alarm/getCode').then((code) => {
|
|
||||||
this.formLoading = false;
|
|
||||||
this.$emit('update', {
|
|
||||||
...this.dataForm,
|
|
||||||
code,
|
|
||||||
});
|
|
||||||
});
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
/** 模拟透传 ref */
|
|
||||||
validate(cb) {
|
|
||||||
return this.$refs.form.validate(cb);
|
|
||||||
},
|
|
||||||
resetFields(args) {
|
|
||||||
return this.$refs.form.resetFields(args);
|
|
||||||
},
|
|
||||||
async handleTypeChange(id) {
|
|
||||||
// debugger;
|
|
||||||
this.dataForm.alarmCode = '';
|
|
||||||
this.$emit('update', this.dataForm);
|
|
||||||
},
|
|
||||||
async getCode(url) {
|
|
||||||
const response = await this.$axios(url);
|
|
||||||
return response.data;
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped lang="scss">
|
|
||||||
.el-date-editor,
|
|
||||||
.el-select {
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,466 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div class="app-container">
|
|
||||||
<!-- 搜索工作栏 -->
|
|
||||||
<SearchBar
|
|
||||||
:formConfigs="searchBarFormConfig"
|
|
||||||
ref="search-bar"
|
|
||||||
@headBtnClick="handleSearchBarBtnClick" />
|
|
||||||
|
|
||||||
<!-- 列表 -->
|
|
||||||
<base-table
|
|
||||||
:table-props="tableProps"
|
|
||||||
:page="queryParams.pageNo"
|
|
||||||
:limit="queryParams.pageSize"
|
|
||||||
:table-data="list"
|
|
||||||
@emitFun="handleEmitFun">
|
|
||||||
<method-btn
|
|
||||||
v-if="tableBtn.length"
|
|
||||||
slot="handleBtn"
|
|
||||||
label="操作"
|
|
||||||
:width="120"
|
|
||||||
:method-list="tableBtn"
|
|
||||||
@clickBtn="handleTableBtnClick" />
|
|
||||||
</base-table>
|
|
||||||
|
|
||||||
<!-- 分页组件 -->
|
|
||||||
<pagination
|
|
||||||
v-show="total > 0"
|
|
||||||
:total="total"
|
|
||||||
:page.sync="queryParams.pageNo"
|
|
||||||
:limit.sync="queryParams.pageSize"
|
|
||||||
@pagination="getList" />
|
|
||||||
|
|
||||||
<!-- 对话框(添加 / 修改) -->
|
|
||||||
<base-dialog
|
|
||||||
:dialogTitle="title"
|
|
||||||
:dialogVisible="open"
|
|
||||||
width="500px"
|
|
||||||
@close="cancel"
|
|
||||||
@cancel="cancel"
|
|
||||||
@confirm="submitForm">
|
|
||||||
<DialogForm v-if="open" ref="form" v-model="form" :rows="rows"/>
|
|
||||||
</base-dialog>
|
|
||||||
|
|
||||||
<!-- 抽屉 详情 -->
|
|
||||||
<BasicDrawer
|
|
||||||
v-if="editVisible"
|
|
||||||
ref="drawer"
|
|
||||||
:default-mode="editMode"
|
|
||||||
:data-id="alarmForm.id"
|
|
||||||
:sections="[
|
|
||||||
{
|
|
||||||
name: '基本信息',
|
|
||||||
key: 'base',
|
|
||||||
rows: drawerBaseInfoRows,
|
|
||||||
url: '/base/equipment-group/get',
|
|
||||||
urlUpdate: '/base/equipment-group/update',
|
|
||||||
urlCreate: '/base/equipment-group/create',
|
|
||||||
queryParams: { id: alarmForm.id },
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: '属性列表',
|
|
||||||
key: 'attrs',
|
|
||||||
props: drawerListProps,
|
|
||||||
url: '/base/equipment-group-alarm/page',
|
|
||||||
urlCreate: '/base/equipment-group-alarm/create',
|
|
||||||
urlUpdate: '/base/equipment-group-alarm/update',
|
|
||||||
urlDelete: '/base/equipment-group-alarm/delete',
|
|
||||||
urlDetail: '/base/equipment-group-alarm/get',
|
|
||||||
queryParams: {
|
|
||||||
equipmentGroupId: alarmForm.id,
|
|
||||||
pageNo: 1,
|
|
||||||
pageSize: 10,
|
|
||||||
},
|
|
||||||
tableBtn: [
|
|
||||||
this.$auth.hasPermi('base:equipment-group:update')
|
|
||||||
? {
|
|
||||||
type: 'edit',
|
|
||||||
btnName: '修改',
|
|
||||||
}
|
|
||||||
: undefined,
|
|
||||||
this.$auth.hasPermi('base:equipment-group:delete')
|
|
||||||
? {
|
|
||||||
type: 'delete',
|
|
||||||
btnName: '删除',
|
|
||||||
}
|
|
||||||
: undefined,
|
|
||||||
].filter((v) => v),
|
|
||||||
allowAdd: true,
|
|
||||||
},
|
|
||||||
]"
|
|
||||||
@refreshDataList="getList"
|
|
||||||
@cancel="editVisible = false"
|
|
||||||
@destroy="editVisible = false" />
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import {
|
|
||||||
createEquipmentGroup,
|
|
||||||
updateEquipmentGroup,
|
|
||||||
deleteEquipmentGroup,
|
|
||||||
getEquipmentGroup,
|
|
||||||
getEquipmentGroupPage,
|
|
||||||
exportEquipmentGroupExcel,
|
|
||||||
} from '@/api/base/equipmentGroup';
|
|
||||||
import moment from 'moment';
|
|
||||||
import { publicFormatter } from '@/utils/dict';
|
|
||||||
import basicPageMixin from '@/mixins/lb/basicPageMixin';
|
|
||||||
// import { getAccessToken } from '@/utils/auth';
|
|
||||||
import BasicDrawer from './components/BasicDrawer.vue';
|
|
||||||
|
|
||||||
export default {
|
|
||||||
name: 'EquipmentGroup',
|
|
||||||
mixins: [basicPageMixin],
|
|
||||||
components: { BasicDrawer },
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
editVisible: false,
|
|
||||||
editMode: '',
|
|
||||||
searchBarKeys: ['name', 'code'],
|
|
||||||
tableBtn: [
|
|
||||||
this.$auth.hasPermi('base:equipment-group:update')
|
|
||||||
? {
|
|
||||||
type: 'detail',
|
|
||||||
btnName: '查看报警',
|
|
||||||
}
|
|
||||||
: undefined,
|
|
||||||
this.$auth.hasPermi('base:equipment-group:update')
|
|
||||||
? {
|
|
||||||
type: 'edit',
|
|
||||||
btnName: '修改',
|
|
||||||
}
|
|
||||||
: undefined,
|
|
||||||
this.$auth.hasPermi('base:equipment-group:delete')
|
|
||||||
? {
|
|
||||||
type: 'delete',
|
|
||||||
btnName: '删除',
|
|
||||||
}
|
|
||||||
: undefined,
|
|
||||||
].filter((v) => v),
|
|
||||||
tableProps: [
|
|
||||||
{
|
|
||||||
prop: 'createTime',
|
|
||||||
label: '添加时间',
|
|
||||||
fixed: true,
|
|
||||||
width: 180,
|
|
||||||
filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'),
|
|
||||||
},
|
|
||||||
{ prop: 'name', label: '设备分组名称' },
|
|
||||||
{ prop: 'code', label: '设备分组编码' },
|
|
||||||
{ prop: 'remark', label: '备注' },
|
|
||||||
// {
|
|
||||||
// _action: 'equipment-group-show-alert',
|
|
||||||
// label: '报警',
|
|
||||||
// subcomponent: {
|
|
||||||
// props: ['injectData'],
|
|
||||||
// render: function (h) {
|
|
||||||
// const _this = this;
|
|
||||||
// return h(
|
|
||||||
// 'el-button',
|
|
||||||
// {
|
|
||||||
// props: { type: 'text' },
|
|
||||||
// on: {
|
|
||||||
// click: function () {
|
|
||||||
// console.log('inejctdata', _this.injectData);
|
|
||||||
// _this.$emit('emitData', {
|
|
||||||
// action: _this.injectData._action,
|
|
||||||
// // value: _this.injectData.id,
|
|
||||||
// value: _this.injectData,
|
|
||||||
// });
|
|
||||||
// },
|
|
||||||
// },
|
|
||||||
// },
|
|
||||||
// '查看报警'
|
|
||||||
// );
|
|
||||||
// },
|
|
||||||
// },
|
|
||||||
// },
|
|
||||||
],
|
|
||||||
drawerBaseInfoRows: [
|
|
||||||
[
|
|
||||||
{
|
|
||||||
input: true,
|
|
||||||
label: '设备分组名称',
|
|
||||||
prop: 'name',
|
|
||||||
rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
|
||||||
// bind: {
|
|
||||||
// disabled: this.editMode == 'detail', // some condition, like detail mode...
|
|
||||||
// }
|
|
||||||
},
|
|
||||||
{
|
|
||||||
input: true,
|
|
||||||
label: '设备分组编码',
|
|
||||||
prop: 'code',
|
|
||||||
// url: '/base/equipment/getCode',
|
|
||||||
}
|
|
||||||
]
|
|
||||||
],
|
|
||||||
drawerListProps: [
|
|
||||||
{
|
|
||||||
prop: 'createTime',
|
|
||||||
label: '添加时间',
|
|
||||||
fixed: true,
|
|
||||||
width: 180,
|
|
||||||
filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'),
|
|
||||||
},
|
|
||||||
{ width: 240, prop: 'code', label: '报警编码' },
|
|
||||||
{
|
|
||||||
width: 100,
|
|
||||||
prop: 'type',
|
|
||||||
label: '报警类型',
|
|
||||||
filter: (val) =>
|
|
||||||
val != null ? ['-', '字符型', '布尔型', '-'][val] : '-',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
width: 90,
|
|
||||||
prop: 'grade',
|
|
||||||
label: '报警级别',
|
|
||||||
filter: publicFormatter(this.DICT_TYPE.EQU_ALARM_LEVEL),
|
|
||||||
},
|
|
||||||
{ width: 180, prop: 'alarmCode', label: '设备报警编码' },
|
|
||||||
{ width: 128, prop: 'plcParamName', label: '参数列名' },
|
|
||||||
{ width: 128, prop: 'alarmContent', label: '报警内容' },
|
|
||||||
],
|
|
||||||
alarmForm: {
|
|
||||||
id: undefined,
|
|
||||||
equipmentGroupCode: undefined,
|
|
||||||
equipmentGroupName: undefined,
|
|
||||||
},
|
|
||||||
searchBarFormConfig: [
|
|
||||||
{
|
|
||||||
type: 'input',
|
|
||||||
label: '分组名称',
|
|
||||||
placeholder: '请输入设备分组名称',
|
|
||||||
param: 'name',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: 'input',
|
|
||||||
label: '分组编码',
|
|
||||||
placeholder: '请输入设备分组编码',
|
|
||||||
param: 'code',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: 'button',
|
|
||||||
btnName: '查询',
|
|
||||||
name: 'search',
|
|
||||||
color: 'primary',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: 'separate',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: this.$auth.hasPermi('base:equipment-group:create')
|
|
||||||
? 'button'
|
|
||||||
: '',
|
|
||||||
btnName: '新增',
|
|
||||||
name: 'add',
|
|
||||||
plain: true,
|
|
||||||
color: 'success',
|
|
||||||
},
|
|
||||||
// {
|
|
||||||
// type: this.$auth.hasPermi('base:equipment-group:export') ? 'button' : '',
|
|
||||||
// btnName: '导出',
|
|
||||||
// name: 'export',
|
|
||||||
// color: 'warning',
|
|
||||||
// },
|
|
||||||
],
|
|
||||||
rows: [
|
|
||||||
[
|
|
||||||
{
|
|
||||||
input: true,
|
|
||||||
label: '分组名称',
|
|
||||||
prop: 'name',
|
|
||||||
rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
|
||||||
// bind: {
|
|
||||||
// disabled: true, // some condition, like detail mode...
|
|
||||||
// }
|
|
||||||
},
|
|
||||||
],
|
|
||||||
[
|
|
||||||
{
|
|
||||||
input: true,
|
|
||||||
label: '分组编码',
|
|
||||||
prop: 'code',
|
|
||||||
url: '/base/equipment-group/getCode',
|
|
||||||
rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
|
||||||
},
|
|
||||||
],
|
|
||||||
[
|
|
||||||
{
|
|
||||||
input: true,
|
|
||||||
label: '备注',
|
|
||||||
prop: 'remark',
|
|
||||||
// rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
|
||||||
bind: {
|
|
||||||
placeholder: '请输入备注',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
|
||||||
],
|
|
||||||
// 是否显示弹出层
|
|
||||||
open: false,
|
|
||||||
// 查询参数
|
|
||||||
queryParams: {
|
|
||||||
pageNo: 1,
|
|
||||||
pageSize: 10,
|
|
||||||
code: null,
|
|
||||||
name: null,
|
|
||||||
},
|
|
||||||
// 表单参数
|
|
||||||
form: {},
|
|
||||||
};
|
|
||||||
},
|
|
||||||
created() {
|
|
||||||
this.getList();
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
/** 覆盖 handleEmitFun 的默认实现 */
|
|
||||||
handleEmitFun({ action, value }) {
|
|
||||||
const {
|
|
||||||
id: equipmentGroupId,
|
|
||||||
name: equipmentGroupName,
|
|
||||||
code: equipmentGroupCode,
|
|
||||||
} = value;
|
|
||||||
switch (action) {
|
|
||||||
case 'equipment-group-show-alert':
|
|
||||||
// this.$router.push({ path: '/equipment/base/equipment-group-alarm' });
|
|
||||||
this.$router.push({
|
|
||||||
name: 'EquipmentGroupAlarm',
|
|
||||||
params: {
|
|
||||||
equipmentGroupId,
|
|
||||||
equipmentGroupCode,
|
|
||||||
equipmentGroupName,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
/** 查询列表 */
|
|
||||||
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();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
},
|
|
||||||
// 查看报警
|
|
||||||
handleDetail(row) {
|
|
||||||
// debugger;
|
|
||||||
const { id, code, name, createTime } = row;
|
|
||||||
// 打开抽屉
|
|
||||||
this.editMode = 'detail';
|
|
||||||
this.alarmForm.id = id;
|
|
||||||
this.alarmForm.equipmentGroupCode = code;
|
|
||||||
this.alarmForm.equipmentGroupName = name;
|
|
||||||
this.editVisible = true;
|
|
||||||
this.$nextTick(() => {
|
|
||||||
this.$refs['drawer'].init();
|
|
||||||
});
|
|
||||||
},
|
|
||||||
/** 删除按钮操作 */
|
|
||||||
handleDelete(row) {
|
|
||||||
const id = row.id;
|
|
||||||
this.$modal
|
|
||||||
.confirm('是否确认删除设备分组 "' + row.name + '"?')
|
|
||||||
.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>
|
|
||||||
@@ -1,187 +0,0 @@
|
|||||||
<!--
|
|
||||||
filename: dialogForm.vue
|
|
||||||
author: liubin
|
|
||||||
date: 2023-09-11 15:55:13
|
|
||||||
description: DialogForm for equipmentBindSection only
|
|
||||||
-->
|
|
||||||
|
|
||||||
<template>
|
|
||||||
<el-form
|
|
||||||
ref="form"
|
|
||||||
:model="dataForm"
|
|
||||||
label-width="100px"
|
|
||||||
v-loading="formLoading">
|
|
||||||
<el-row :gutter="20">
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item
|
|
||||||
label="报警编码"
|
|
||||||
prop="code"
|
|
||||||
:rules="[{ required: true, message: '不能为空', trigger: 'blur' }]">
|
|
||||||
<el-input
|
|
||||||
:disabled="disabled"
|
|
||||||
v-model="dataForm.code"
|
|
||||||
@change="$emit('update', dataForm)"
|
|
||||||
placeholder="请输入工段排序" />
|
|
||||||
</el-form-item>
|
|
||||||
<!--
|
|
||||||
<el-form-item
|
|
||||||
label="报警编码"
|
|
||||||
prop="code"
|
|
||||||
:rules="[{ required: true, message: '不能为空', trigger: 'blur' }]">
|
|
||||||
<el-select
|
|
||||||
v-model="dataForm.code"
|
|
||||||
placeholder="请选择产线"
|
|
||||||
@change="handleProductlineChange">
|
|
||||||
<el-option
|
|
||||||
v-for="opt in productionLineList"
|
|
||||||
:key="opt.value"
|
|
||||||
:label="opt.label"
|
|
||||||
:value="opt.value" />
|
|
||||||
</el-select>
|
|
||||||
</el-form-item> -->
|
|
||||||
</el-col>
|
|
||||||
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item
|
|
||||||
label="报警类型"
|
|
||||||
prop="type"
|
|
||||||
:rules="[{ required: true, message: '不能为空', trigger: 'blur' }]">
|
|
||||||
<el-select
|
|
||||||
v-model="dataForm.type"
|
|
||||||
:disabled="disabled"
|
|
||||||
placeholder="请选择报警类型"
|
|
||||||
@change="$emit('update', dataForm)">
|
|
||||||
<el-option
|
|
||||||
v-for="opt in [
|
|
||||||
{ label: '布尔型', value: 2 },
|
|
||||||
{ label: '字符型', value: 1 },
|
|
||||||
]"
|
|
||||||
:key="opt.value"
|
|
||||||
:label="opt.label"
|
|
||||||
:value="opt.value" />
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row :gutter="20">
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item
|
|
||||||
label="报警级别"
|
|
||||||
prop="grade"
|
|
||||||
:rules="[{ required: true, message: '不能为空', trigger: 'blur' }]">
|
|
||||||
<el-select
|
|
||||||
:disabled="disabled"
|
|
||||||
v-model="dataForm.grade"
|
|
||||||
placeholder="请选择报警级别"
|
|
||||||
@change="$emit('update', dataForm)">
|
|
||||||
<el-option
|
|
||||||
v-for="opt in getDictDatas(DICT_TYPE.EQU_ALARM_LEVEL)"
|
|
||||||
:key="opt.value"
|
|
||||||
:label="opt.label"
|
|
||||||
:value="opt.value" />
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item
|
|
||||||
v-if="+dataForm.type == 1"
|
|
||||||
label="设备报警编码"
|
|
||||||
prop="alarmCode">
|
|
||||||
<el-input
|
|
||||||
:disabled="disabled"
|
|
||||||
v-model="dataForm.alarmCode"
|
|
||||||
@change="$emit('update', dataForm)"
|
|
||||||
placeholder="请输入设备报警编码" />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<el-row :gutter="20">
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item
|
|
||||||
label="参数列名"
|
|
||||||
prop="plcParamName"
|
|
||||||
:rules="[{ required: true, message: '不能为空', trigger: 'blur' }]">
|
|
||||||
<el-input
|
|
||||||
:disabled="disabled"
|
|
||||||
v-model="dataForm.plcParamName"
|
|
||||||
placeholder="请输入参数列名"
|
|
||||||
@change="$emit('update', dataForm)"></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item
|
|
||||||
label="报警内容"
|
|
||||||
prop="alarmContent"
|
|
||||||
:rules="[{ required: true, message: '不能为空', trigger: 'blur' }]">
|
|
||||||
<el-input
|
|
||||||
:disabled="disabled"
|
|
||||||
v-model="dataForm.alarmContent"
|
|
||||||
placeholder="请输入报警内容"
|
|
||||||
@change="$emit('update', dataForm)"></el-input>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
</el-form>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
export default {
|
|
||||||
name: 'DialogForm',
|
|
||||||
model: {
|
|
||||||
prop: 'dataForm',
|
|
||||||
event: 'update',
|
|
||||||
},
|
|
||||||
emits: ['update'],
|
|
||||||
components: {},
|
|
||||||
props: {
|
|
||||||
dataForm: {
|
|
||||||
type: Object,
|
|
||||||
default: () => ({}),
|
|
||||||
},
|
|
||||||
disabled: {
|
|
||||||
type: Boolean,
|
|
||||||
default: false,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
formLoading: true,
|
|
||||||
};
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
this.getCode('/base/equipment-group-alarm/getCode').then((code) => {
|
|
||||||
this.formLoading = false;
|
|
||||||
this.$emit('update', {
|
|
||||||
...this.dataForm,
|
|
||||||
code,
|
|
||||||
});
|
|
||||||
});
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
/** 模拟透传 ref */
|
|
||||||
validate(cb) {
|
|
||||||
return this.$refs.form.validate(cb);
|
|
||||||
},
|
|
||||||
resetFields(args) {
|
|
||||||
return this.$refs.form.resetFields(args);
|
|
||||||
},
|
|
||||||
async handleProductlineChange(id) {
|
|
||||||
await this.getWorksectionList(id);
|
|
||||||
this.dataForm.workshopSectionId = null;
|
|
||||||
this.$emit('update', this.dataForm);
|
|
||||||
},
|
|
||||||
async getCode(url) {
|
|
||||||
const response = await this.$axios(url);
|
|
||||||
return response.data;
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped lang="scss">
|
|
||||||
.el-date-editor,
|
|
||||||
.el-select {
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,361 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div class="app-container">
|
|
||||||
<!-- 搜索工作栏 -->
|
|
||||||
<SearchBar
|
|
||||||
:formConfigs="searchBarFormConfig"
|
|
||||||
ref="search-bar"
|
|
||||||
@headBtnClick="handleSearchBarBtnClick" />
|
|
||||||
|
|
||||||
<!-- 列表 -->
|
|
||||||
<base-table
|
|
||||||
:table-props="tableProps"
|
|
||||||
:page="queryParams.pageNo"
|
|
||||||
:limit="queryParams.pageSize"
|
|
||||||
:table-data="list"
|
|
||||||
@emitFun="handleEmitFun">
|
|
||||||
<method-btn
|
|
||||||
v-if="tableBtn.length"
|
|
||||||
slot="handleBtn"
|
|
||||||
label="操作"
|
|
||||||
:width="120"
|
|
||||||
:method-list="tableBtn"
|
|
||||||
@clickBtn="handleTableBtnClick" />
|
|
||||||
</base-table>
|
|
||||||
|
|
||||||
<!-- 分页组件 -->
|
|
||||||
<pagination
|
|
||||||
v-show="total > 0"
|
|
||||||
:total="total"
|
|
||||||
:page.sync="queryParams.pageNo"
|
|
||||||
:limit.sync="queryParams.pageSize"
|
|
||||||
@pagination="getList" />
|
|
||||||
|
|
||||||
<!-- 对话框(添加 / 修改) -->
|
|
||||||
<base-dialog
|
|
||||||
:dialogTitle="title"
|
|
||||||
:dialogVisible="open"
|
|
||||||
width="736px"
|
|
||||||
@close="cancel"
|
|
||||||
@cancel="cancel"
|
|
||||||
@confirm="submitForm">
|
|
||||||
<DialogForm v-if="open" ref="form" v-model="form" :rows="rows" />
|
|
||||||
</base-dialog>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import {
|
|
||||||
createEquipmentGroupAlarm,
|
|
||||||
updateEquipmentGroupAlarm,
|
|
||||||
deleteEquipmentGroupAlarm,
|
|
||||||
getEquipmentGroupAlarm,
|
|
||||||
getEquipmentGroupAlarmPage,
|
|
||||||
exportEquipmentGroupAlarmExcel,
|
|
||||||
} from '@/api/base/equipmentGroupAlarm';
|
|
||||||
import basicPageMixin from '@/mixins/lb/basicPageMixin';
|
|
||||||
import moment from 'moment';
|
|
||||||
import { publicFormatter } from '@/utils/dict';
|
|
||||||
import DialogForm from './dialogForm.vue';
|
|
||||||
|
|
||||||
export default {
|
|
||||||
name: 'EquipmentGroupAlarm',
|
|
||||||
components: { DialogForm },
|
|
||||||
mixins: [basicPageMixin],
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
searchBarKeys: [''],
|
|
||||||
tableBtn: [
|
|
||||||
this.$auth.hasPermi('base:equipment-group-alarm:update')
|
|
||||||
? {
|
|
||||||
type: 'edit',
|
|
||||||
btnName: '修改',
|
|
||||||
}
|
|
||||||
: undefined,
|
|
||||||
this.$auth.hasPermi('base:equipment-group-alarm:delete')
|
|
||||||
? {
|
|
||||||
type: 'delete',
|
|
||||||
btnName: '删除',
|
|
||||||
}
|
|
||||||
: undefined,
|
|
||||||
].filter((v) => v),
|
|
||||||
tableProps: [
|
|
||||||
{
|
|
||||||
prop: 'createTime',
|
|
||||||
label: '添加时间',
|
|
||||||
fixed: true,
|
|
||||||
width: 180,
|
|
||||||
filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'),
|
|
||||||
},
|
|
||||||
{ width: 240, prop: 'code', label: '报警编码' },
|
|
||||||
{
|
|
||||||
prop: 'type',
|
|
||||||
label: '报警类型',
|
|
||||||
filter: (val) =>
|
|
||||||
val != null ? ['-', '字符型', '布尔型', '-'][val] : '-',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: 'grade',
|
|
||||||
label: '报警级别',
|
|
||||||
filter: publicFormatter(this.DICT_TYPE.EQU_ALARM_LEVEL),
|
|
||||||
},
|
|
||||||
{ prop: 'alarmCode', label: '设备报警编码' },
|
|
||||||
{ prop: 'plcParamName', label: '参数列名' },
|
|
||||||
{ prop: 'alarmContent', label: '报警内容' },
|
|
||||||
],
|
|
||||||
searchBarFormConfig: [
|
|
||||||
{
|
|
||||||
type: 'input',
|
|
||||||
label: '设备分组编码',
|
|
||||||
width: '220',
|
|
||||||
placeholder: '/',
|
|
||||||
param: 'equipmentGroupCode',
|
|
||||||
defaultSelect: null,
|
|
||||||
disabled: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: 'input',
|
|
||||||
label: '设备分组名称',
|
|
||||||
placeholder: '/',
|
|
||||||
param: 'equipmentGroupName',
|
|
||||||
defaultSelect: null,
|
|
||||||
disabled: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: this.$auth.hasPermi('base:equipment-group-alarm:create')
|
|
||||||
? 'button'
|
|
||||||
: '',
|
|
||||||
btnName: '新增',
|
|
||||||
name: 'add',
|
|
||||||
plain: true,
|
|
||||||
color: 'success',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
rows: [
|
|
||||||
[
|
|
||||||
{
|
|
||||||
input: true,
|
|
||||||
label: '报警编码', // 自动生成
|
|
||||||
prop: 'code',
|
|
||||||
url: '/base/equipment-group-alarm/getCode',
|
|
||||||
rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
select: true,
|
|
||||||
label: '报警类型', // 固定选项
|
|
||||||
prop: 'type',
|
|
||||||
options: [
|
|
||||||
{ label: '布尔型', value: 2 },
|
|
||||||
{ label: '字符型', value: 1 },
|
|
||||||
],
|
|
||||||
rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
|
||||||
},
|
|
||||||
],
|
|
||||||
[
|
|
||||||
{
|
|
||||||
select: true,
|
|
||||||
label: '报警级别', // 字典
|
|
||||||
prop: 'grade',
|
|
||||||
options: this.getDictDatas(this.DICT_TYPE.EQU_ALARM_LEVEL),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
input: true,
|
|
||||||
label: '设备报警编码', // 对应到设备实际的报警编码
|
|
||||||
prop: 'alarmCode',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
[
|
|
||||||
{
|
|
||||||
input: true,
|
|
||||||
label: '参数列名', // 在实时数据库的列名
|
|
||||||
prop: 'plcParamName',
|
|
||||||
rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
input: true,
|
|
||||||
label: '报警内容',
|
|
||||||
prop: 'alarmContent',
|
|
||||||
rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
|
||||||
},
|
|
||||||
],
|
|
||||||
],
|
|
||||||
// 是否显示弹出层
|
|
||||||
open: false,
|
|
||||||
// 查询参数
|
|
||||||
queryParams: {
|
|
||||||
pageNo: 1,
|
|
||||||
pageSize: 10,
|
|
||||||
equipmentGroupId: null,
|
|
||||||
},
|
|
||||||
// 表单参数
|
|
||||||
form: {
|
|
||||||
id: null,
|
|
||||||
equipmentGroupId: null,
|
|
||||||
code: null,
|
|
||||||
type: null,
|
|
||||||
grade: null,
|
|
||||||
alarmCode: null,
|
|
||||||
alarmContent: null,
|
|
||||||
plcParamName: null,
|
|
||||||
},
|
|
||||||
// // 表单校验
|
|
||||||
// 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" }],
|
|
||||||
// }
|
|
||||||
};
|
|
||||||
},
|
|
||||||
// watch: {
|
|
||||||
// $route(value) {
|
|
||||||
// console.log('new route info', value)
|
|
||||||
// }
|
|
||||||
// },
|
|
||||||
// created() {
|
|
||||||
// this.getList();
|
|
||||||
// },
|
|
||||||
activated() {
|
|
||||||
// 设置顶部搜索栏信息
|
|
||||||
const { equipmentGroupName, equipmentGroupCode, equipmentGroupId } =
|
|
||||||
this.$route.params;
|
|
||||||
this.setSearchBarFormValue('equipmentGroupName', equipmentGroupName);
|
|
||||||
this.setSearchBarFormValue('equipmentGroupCode', equipmentGroupCode);
|
|
||||||
this.queryParams.equipmentGroupId = equipmentGroupId;
|
|
||||||
// if (!equipmentGroupId) this.getList(); // 拦截
|
|
||||||
this.getList();
|
|
||||||
},
|
|
||||||
deactivated() {
|
|
||||||
this.setSearchBarFormValue('equipmentGroupName', null);
|
|
||||||
this.setSearchBarFormValue('equipmentGroupCode', null);
|
|
||||||
this.queryParams.equipmentGroupId = null;
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
/** 设置 searchBarForm 的默认值 - 用得比较少 */
|
|
||||||
setSearchBarFormValue(param, value) {
|
|
||||||
this.searchBarFormConfig.forEach((config) => {
|
|
||||||
if (config.param == param) {
|
|
||||||
config.defaultSelect = value;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
/** 查询列表 */
|
|
||||||
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: null,
|
|
||||||
equipmentGroupId: null,
|
|
||||||
code: null,
|
|
||||||
type: null,
|
|
||||||
grade: null,
|
|
||||||
alarmCode: null,
|
|
||||||
alarmContent: null,
|
|
||||||
plcParamName: null,
|
|
||||||
};
|
|
||||||
this.resetForm('form');
|
|
||||||
},
|
|
||||||
/** 搜索按钮操作 */
|
|
||||||
handleQuery() {
|
|
||||||
this.queryParams.pageNo = 1;
|
|
||||||
this.getList();
|
|
||||||
},
|
|
||||||
/** 重置按钮操作 */
|
|
||||||
resetQuery() {
|
|
||||||
this.resetForm('queryForm');
|
|
||||||
this.handleQuery();
|
|
||||||
},
|
|
||||||
/** 新增按钮操作 */
|
|
||||||
handleAdd() {
|
|
||||||
if (this.queryParams.equipmentGroupId == null)
|
|
||||||
return this.$message.warning('没有检测到设备分组信息');
|
|
||||||
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,
|
|
||||||
equipmentGroupId: this.queryParams.equipmentGroupId,
|
|
||||||
}).then((response) => {
|
|
||||||
this.$modal.msgSuccess('修改成功');
|
|
||||||
this.open = false;
|
|
||||||
this.getList();
|
|
||||||
});
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
// 添加的提交
|
|
||||||
createEquipmentGroupAlarm({
|
|
||||||
...this.form,
|
|
||||||
equipmentGroupId: this.queryParams.equipmentGroupId,
|
|
||||||
}).then((response) => {
|
|
||||||
this.$modal.msgSuccess('新增成功');
|
|
||||||
this.open = false;
|
|
||||||
this.getList();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
},
|
|
||||||
/** 删除按钮操作 */
|
|
||||||
handleDelete(row) {
|
|
||||||
const id = row.id;
|
|
||||||
this.$modal
|
|
||||||
.confirm('是否确认删除该报警?')
|
|
||||||
.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>
|
|
||||||
@@ -1,109 +0,0 @@
|
|||||||
<!--
|
|
||||||
* @Author: zwq
|
|
||||||
* @Date: 2021-11-18 14:16:25
|
|
||||||
* @LastEditors: zwq
|
|
||||||
* @LastEditTime: 2025-02-26 16:37:29
|
|
||||||
* @Description:
|
|
||||||
-->
|
|
||||||
<template>
|
|
||||||
<el-row :gutter="20">
|
|
||||||
<el-form
|
|
||||||
:model="dataForm"
|
|
||||||
:rules="dataRule"
|
|
||||||
ref="dataForm"
|
|
||||||
@keyup.enter.native="dataFormSubmit()"
|
|
||||||
label-width="80px">
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="关联表名" prop="plcTableName">
|
|
||||||
<el-input
|
|
||||||
v-model="dataForm.plcTableName"
|
|
||||||
clearable
|
|
||||||
placeholder="请输入关联表名" />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="编码" prop="code">
|
|
||||||
<el-input
|
|
||||||
v-model="dataForm.code"
|
|
||||||
clearable
|
|
||||||
placeholder="请输入编码" />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="标识" prop="name">
|
|
||||||
<el-input
|
|
||||||
v-model="dataForm.name"
|
|
||||||
clearable
|
|
||||||
placeholder="请输入标识" />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="英文名" prop="enName">
|
|
||||||
<el-input
|
|
||||||
v-model="dataForm.enName"
|
|
||||||
clearable
|
|
||||||
placeholder="请输入英文名" />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="是否采集" prop="collection">
|
|
||||||
<el-switch
|
|
||||||
v-model="dataForm.collection"
|
|
||||||
:active-value="1"
|
|
||||||
:inactive-value="0"></el-switch>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="描述" prop="description">
|
|
||||||
<el-input
|
|
||||||
v-model="dataForm.description"
|
|
||||||
clearable
|
|
||||||
placeholder="请输入描述" />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-form>
|
|
||||||
</el-row>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import basicAdd from '@/mixins/basic-add';
|
|
||||||
|
|
||||||
import {
|
|
||||||
createEquipmentPlc,
|
|
||||||
updateEquipmentPlc,
|
|
||||||
getEquipmentPlc,
|
|
||||||
getCode,
|
|
||||||
} from '@/api/base/equipmentPlc';
|
|
||||||
|
|
||||||
export default {
|
|
||||||
mixins: [basicAdd],
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
urlOptions: {
|
|
||||||
isGetCode: true,
|
|
||||||
codeURL: getCode,
|
|
||||||
createURL: createEquipmentPlc,
|
|
||||||
updateURL: updateEquipmentPlc,
|
|
||||||
infoURL: getEquipmentPlc,
|
|
||||||
},
|
|
||||||
dataForm: {
|
|
||||||
id: undefined,
|
|
||||||
plcTableName: undefined,
|
|
||||||
code: undefined,
|
|
||||||
name: undefined,
|
|
||||||
enName: undefined,
|
|
||||||
collection: 1,
|
|
||||||
description: undefined,
|
|
||||||
},
|
|
||||||
dataRule: {
|
|
||||||
plcTableName: [
|
|
||||||
{ required: true, message: '关联表名不能为空', trigger: 'blur' },
|
|
||||||
],
|
|
||||||
code: [{ required: true, message: '编码不能为空', trigger: 'blur' }],
|
|
||||||
name: [{ required: true, message: '标识不能为空', trigger: 'blur' }],
|
|
||||||
},
|
|
||||||
};
|
|
||||||
},
|
|
||||||
methods: {},
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
@@ -1,223 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div class="app-container">
|
|
||||||
<search-bar
|
|
||||||
:formConfigs="formConfig"
|
|
||||||
ref="searchBarForm"
|
|
||||||
@headBtnClick="buttonClick" />
|
|
||||||
<base-table
|
|
||||||
v-loading="dataListLoading"
|
|
||||||
:table-props="tableProps"
|
|
||||||
:page="listQuery.pageNo"
|
|
||||||
:limit="listQuery.pageSize"
|
|
||||||
:table-data="tableData"
|
|
||||||
@emitFun="handleEmitFun">
|
|
||||||
<method-btn
|
|
||||||
v-if="tableBtn.length"
|
|
||||||
slot="handleBtn"
|
|
||||||
:width="120"
|
|
||||||
label="操作"
|
|
||||||
:method-list="tableBtn"
|
|
||||||
@clickBtn="handleClick" />
|
|
||||||
</base-table>
|
|
||||||
<pagination
|
|
||||||
:limit.sync="listQuery.pageSize"
|
|
||||||
:page.sync="listQuery.pageNo"
|
|
||||||
:total="listQuery.total"
|
|
||||||
@pagination="getDataList" />
|
|
||||||
<base-dialog
|
|
||||||
:dialogTitle="addOrEditTitle"
|
|
||||||
:dialogVisible="addOrUpdateVisible"
|
|
||||||
@cancel="handleCancel"
|
|
||||||
@confirm="handleConfirm"
|
|
||||||
:before-close="handleCancel"
|
|
||||||
width="50%">
|
|
||||||
<add-or-update
|
|
||||||
ref="addOrUpdate"
|
|
||||||
@refreshDataList="successSubmit"></add-or-update>
|
|
||||||
</base-dialog>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import AddOrUpdate from './add-or-updata';
|
|
||||||
import basicPage from '@/mixins/basic-page';
|
|
||||||
import { parseTime } from '@/filter/code-filter';
|
|
||||||
import {
|
|
||||||
deleteEquipmentPlc,
|
|
||||||
getEquipmentPlcPage,
|
|
||||||
exportEquipmentPlcExcel,
|
|
||||||
updateEquipmentPlc,
|
|
||||||
} from '@/api/base/equipmentPlc';
|
|
||||||
|
|
||||||
const switchBtn = {
|
|
||||||
name: 'SwitchBtn',
|
|
||||||
props: ['injectData'],
|
|
||||||
data() {
|
|
||||||
return {};
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
active() {
|
|
||||||
return +this.injectData[this.injectData.prop] == 1 ? true : false;
|
|
||||||
},
|
|
||||||
},
|
|
||||||
methods: {},
|
|
||||||
render: function (h) {
|
|
||||||
return h(
|
|
||||||
'el-switch',
|
|
||||||
{
|
|
||||||
props: {
|
|
||||||
value: this.active,
|
|
||||||
},
|
|
||||||
on: {
|
|
||||||
change: (newVal) => {
|
|
||||||
this.$emit('emitData', {
|
|
||||||
action: 'update-collect',
|
|
||||||
payload: {
|
|
||||||
...this.injectData,
|
|
||||||
collection: newVal ? 1 : 0,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
null
|
|
||||||
);
|
|
||||||
},
|
|
||||||
};
|
|
||||||
const tableProps = [
|
|
||||||
{ prop: 'code', label: '编码', width: 220 },
|
|
||||||
{ prop: 'plcTableName', label: '关联表名' },
|
|
||||||
{ prop: 'name', label: '标识名称' },
|
|
||||||
{ prop: 'enName', label: '英文名称' },
|
|
||||||
{
|
|
||||||
prop: 'collection',
|
|
||||||
label: '是否采集',
|
|
||||||
subcomponent: switchBtn,
|
|
||||||
},
|
|
||||||
{ prop: 'description', label: '描述' },
|
|
||||||
];
|
|
||||||
|
|
||||||
export default {
|
|
||||||
mixins: [basicPage],
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
urlOptions: {
|
|
||||||
getDataListURL: getEquipmentPlcPage,
|
|
||||||
deleteURL: deleteEquipmentPlc,
|
|
||||||
exportURL: exportEquipmentPlcExcel,
|
|
||||||
},
|
|
||||||
tableProps,
|
|
||||||
tableBtn: [
|
|
||||||
this.$auth.hasPermi(`base:equipment-plc:update`)
|
|
||||||
? {
|
|
||||||
type: 'edit',
|
|
||||||
btnName: '编辑',
|
|
||||||
}
|
|
||||||
: undefined,
|
|
||||||
this.$auth.hasPermi(`base:equipment-plc:delete`)
|
|
||||||
? {
|
|
||||||
type: 'delete',
|
|
||||||
btnName: '删除',
|
|
||||||
}
|
|
||||||
: undefined,
|
|
||||||
].filter((v) => v),
|
|
||||||
tableData: [],
|
|
||||||
formConfig: [
|
|
||||||
{
|
|
||||||
type: 'input',
|
|
||||||
label: '表名',
|
|
||||||
placeholder: '请输入表名',
|
|
||||||
param: 'plcTableName',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: 'input',
|
|
||||||
label: '标识',
|
|
||||||
placeholder: '请输入标识',
|
|
||||||
param: 'name',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: 'button',
|
|
||||||
btnName: '搜索',
|
|
||||||
name: 'search',
|
|
||||||
color: 'primary',
|
|
||||||
},
|
|
||||||
// {
|
|
||||||
// type: 'separate',
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// type: 'button',
|
|
||||||
// btnName: '重置',
|
|
||||||
// name: 'reset',
|
|
||||||
// },
|
|
||||||
{
|
|
||||||
type: 'separate',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: this.$auth.hasPermi('base:factory:create') ? 'button' : '',
|
|
||||||
btnName: '新增',
|
|
||||||
name: 'add',
|
|
||||||
color: 'success',
|
|
||||||
plain: true,
|
|
||||||
},
|
|
||||||
// {
|
|
||||||
// type: this.$auth.hasPermi('base:factory:create') ? 'separate' : '',
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// type: this.$auth.hasPermi('base:factory:export') ? 'button' : '',
|
|
||||||
// btnName: '导出',
|
|
||||||
// name: 'export',
|
|
||||||
// color: 'warning',
|
|
||||||
// },
|
|
||||||
],
|
|
||||||
};
|
|
||||||
},
|
|
||||||
components: {
|
|
||||||
AddOrUpdate,
|
|
||||||
},
|
|
||||||
created() {},
|
|
||||||
methods: {
|
|
||||||
/** 覆盖 handleEmitFun 的默认实现 */
|
|
||||||
handleEmitFun({ action, payload }) {
|
|
||||||
console.log(payload)
|
|
||||||
switch (action) {
|
|
||||||
case 'update-collect':
|
|
||||||
updateEquipmentPlc(payload).then((response) => {
|
|
||||||
this.$modal.msgSuccess('修改成功');
|
|
||||||
this.getDataList();
|
|
||||||
});
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
buttonClick(val) {
|
|
||||||
switch (val.btnName) {
|
|
||||||
case 'search':
|
|
||||||
this.listQuery.pageNo = 1;
|
|
||||||
this.listQuery.pageSize = 10;
|
|
||||||
this.listQuery.name = val.name;
|
|
||||||
this.listQuery.plcTableName = val.plcTableName;
|
|
||||||
this.getDataList();
|
|
||||||
break;
|
|
||||||
case 'reset':
|
|
||||||
this.$refs.searchBarForm.resetForm();
|
|
||||||
this.listQuery = {
|
|
||||||
pageSize: 10,
|
|
||||||
pageNo: 1,
|
|
||||||
total: 1,
|
|
||||||
};
|
|
||||||
this.getDataList();
|
|
||||||
break;
|
|
||||||
case 'add':
|
|
||||||
this.addOrEditTitle = '新增';
|
|
||||||
this.addOrUpdateVisible = true;
|
|
||||||
this.addOrUpdateHandle();
|
|
||||||
break;
|
|
||||||
case 'export':
|
|
||||||
this.handleExport();
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
console.log(val);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
@@ -1,388 +0,0 @@
|
|||||||
<!--
|
|
||||||
filename: TableConfig.vue
|
|
||||||
author: liubin
|
|
||||||
date: 2023-10-30 10:09:03
|
|
||||||
description:
|
|
||||||
-->
|
|
||||||
|
|
||||||
<template>
|
|
||||||
<div class="app-container">
|
|
||||||
<!-- 搜索工作栏 -->
|
|
||||||
<SearchBar
|
|
||||||
:formConfigs="searchBarFormConfig"
|
|
||||||
ref="search-bar"
|
|
||||||
@headBtnClick="handleSearchBarBtnClick" />
|
|
||||||
|
|
||||||
<!-- 列表 -->
|
|
||||||
<base-table
|
|
||||||
:table-props="tableProps"
|
|
||||||
:page="queryParams.pageNo"
|
|
||||||
:limit="queryParams.pageSize"
|
|
||||||
:table-data="list"
|
|
||||||
ref="pageTable"
|
|
||||||
@emitFun="handleEmitFun"
|
|
||||||
:max-height="tableH">
|
|
||||||
<method-btn
|
|
||||||
v-if="tableBtn.length"
|
|
||||||
slot="handleBtn"
|
|
||||||
label="操作"
|
|
||||||
:method-list="tableBtn"
|
|
||||||
@clickBtn="handleTableBtnClick" />
|
|
||||||
</base-table>
|
|
||||||
|
|
||||||
<!-- 分页组件 -->
|
|
||||||
<pagination
|
|
||||||
v-show="total > 0"
|
|
||||||
:total="total"
|
|
||||||
:page.sync="queryParams.pageNo"
|
|
||||||
:limit.sync="queryParams.pageSize"
|
|
||||||
@pagination="getList" />
|
|
||||||
|
|
||||||
<!-- 对话框(添加 / 修改) -->
|
|
||||||
<base-dialog
|
|
||||||
:dialogTitle="title"
|
|
||||||
:dialogVisible="open"
|
|
||||||
width="700px"
|
|
||||||
@close="cancel"
|
|
||||||
@cancel="cancel"
|
|
||||||
@confirm="submitForm">
|
|
||||||
<DialogForm v-if="open" ref="form" v-model="form" :rows="rows" />
|
|
||||||
</base-dialog>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import {
|
|
||||||
createEquipmentPlc,
|
|
||||||
updateEquipmentPlc,
|
|
||||||
deleteEquipmentPlc,
|
|
||||||
getEquipmentPlc,
|
|
||||||
getEquipmentPlcPage,
|
|
||||||
exportEquipmentPlcExcel,
|
|
||||||
} from '@/api/base/equipmentPlc';
|
|
||||||
import basicPageMixin from '@/mixins/lb/basicPageMixin';
|
|
||||||
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
|
|
||||||
|
|
||||||
const switchBtn = {
|
|
||||||
name: 'SwitchBtn',
|
|
||||||
props: ['injectData'],
|
|
||||||
data() {
|
|
||||||
return {};
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
active() {
|
|
||||||
return +this.injectData[this.injectData.prop] == 1 ? true : false;
|
|
||||||
},
|
|
||||||
},
|
|
||||||
methods: {},
|
|
||||||
render: function (h) {
|
|
||||||
return h(
|
|
||||||
'el-switch',
|
|
||||||
{
|
|
||||||
props: {
|
|
||||||
value: this.active,
|
|
||||||
},
|
|
||||||
on: {
|
|
||||||
change: (newVal) => {
|
|
||||||
this.$emit('emitData', {
|
|
||||||
action: 'update-collect',
|
|
||||||
payload: {
|
|
||||||
...this.injectData,
|
|
||||||
collection: newVal ? 1 : 0,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
null
|
|
||||||
);
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
export default {
|
|
||||||
name: 'EquipmentPlc',
|
|
||||||
mixins: [basicPageMixin, tableHeightMixin],
|
|
||||||
components: {},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
tableKey: Math.random(),
|
|
||||||
searchBarKeys: ['name', 'plcTableName'],
|
|
||||||
tableBtn: [
|
|
||||||
this.$auth.hasPermiAnd([
|
|
||||||
'base:equipment-plc:update',
|
|
||||||
'base:equipment-plc:query'
|
|
||||||
])
|
|
||||||
? {
|
|
||||||
type: 'edit',
|
|
||||||
btnName: '修改',
|
|
||||||
}
|
|
||||||
: undefined,
|
|
||||||
this.$auth.hasPermi('base:equipment-plc:delete')
|
|
||||||
? {
|
|
||||||
type: 'delete',
|
|
||||||
btnName: '删除',
|
|
||||||
}
|
|
||||||
: undefined,
|
|
||||||
].filter((v) => v),
|
|
||||||
tableProps: [
|
|
||||||
// {
|
|
||||||
// prop: 'createTime',
|
|
||||||
// label: '添加时间',
|
|
||||||
// fixed: true,
|
|
||||||
// width: 180,
|
|
||||||
// filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'),
|
|
||||||
// },
|
|
||||||
{ prop: 'code', label: '编码', width: 180, showOverflowtooltip: true },
|
|
||||||
{ prop: 'plcTableName', label: '关联表名', width: 150, showOverflowtooltip: true },
|
|
||||||
{ prop: 'name', label: '标识名称', width: 150, showOverflowtooltip: true },
|
|
||||||
{ prop: 'enName', label: '英文名称', width: 150, showOverflowtooltip: true },
|
|
||||||
{
|
|
||||||
prop: 'collection',
|
|
||||||
label: '是否采集',
|
|
||||||
subcomponent: switchBtn,
|
|
||||||
},
|
|
||||||
{ prop: 'description', label: '描述', minWidth: 150, showOverflowtooltip: true },
|
|
||||||
],
|
|
||||||
searchBarFormConfig: [
|
|
||||||
{
|
|
||||||
type: 'input',
|
|
||||||
label: '表名',
|
|
||||||
placeholder: '请输入表名',
|
|
||||||
param: 'plcTableName',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: 'input',
|
|
||||||
label: '标识',
|
|
||||||
placeholder: '请输入标识',
|
|
||||||
param: 'name',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: 'button',
|
|
||||||
btnName: '查询',
|
|
||||||
name: 'search',
|
|
||||||
color: 'primary',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: this.$auth.hasPermi('base:equipment-plc:create')
|
|
||||||
? 'separate' : '',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: this.$auth.hasPermi('base:equipment-plc:create')
|
|
||||||
? 'button' : '',
|
|
||||||
btnName: '新增',
|
|
||||||
name: 'add',
|
|
||||||
plain: true,
|
|
||||||
color: 'success',
|
|
||||||
},
|
|
||||||
// {
|
|
||||||
// type: this.$auth.hasPermi('equipment:realtime-table-config:export') ? 'button' : '',
|
|
||||||
// btnName: '导出',
|
|
||||||
// name: 'export',
|
|
||||||
// color: 'warning',
|
|
||||||
// },
|
|
||||||
],
|
|
||||||
rows: [
|
|
||||||
[
|
|
||||||
{
|
|
||||||
input: true,
|
|
||||||
label: '关联表名',
|
|
||||||
prop: 'plcTableName',
|
|
||||||
rules: [{ required: true, message: '关联表名不能为空', trigger: 'blur' }],
|
|
||||||
// bind: {
|
|
||||||
// disabled: true, // some condition, like detail mode...
|
|
||||||
// }
|
|
||||||
},
|
|
||||||
{
|
|
||||||
input: true,
|
|
||||||
label: '编码',
|
|
||||||
prop: 'code',
|
|
||||||
url: '/base/energy-plc/getCode',
|
|
||||||
rules: [{ required: true, message: '编码不能为空', trigger: 'blur' }],
|
|
||||||
},
|
|
||||||
],
|
|
||||||
[
|
|
||||||
{
|
|
||||||
input: true,
|
|
||||||
label: '标识',
|
|
||||||
prop: 'name',
|
|
||||||
rules: [{ required: true, message: '标识不能为空', trigger: 'blur' }],
|
|
||||||
// bind: {
|
|
||||||
// disabled: true, // some condition, like detail mode...
|
|
||||||
// }
|
|
||||||
},
|
|
||||||
{
|
|
||||||
input: true,
|
|
||||||
label: '英文名',
|
|
||||||
prop: 'enName',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
[
|
|
||||||
{
|
|
||||||
switch: true,
|
|
||||||
label: '是否采集', // 是否采集 0 代表不采集, 1 代表采集
|
|
||||||
prop: 'collection',
|
|
||||||
bind: {
|
|
||||||
'active-value': 1,
|
|
||||||
'inactive-value': 0,
|
|
||||||
value: 1,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
|
||||||
[
|
|
||||||
{
|
|
||||||
textarea: true,
|
|
||||||
label: '描述',
|
|
||||||
prop: 'description',
|
|
||||||
bind: {
|
|
||||||
placeholder: '请输入备注',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
|
||||||
],
|
|
||||||
// 是否显示弹出
|
|
||||||
open: false,
|
|
||||||
// 查询参数
|
|
||||||
queryParams: {
|
|
||||||
pageNo: 1,
|
|
||||||
pageSize: 20,
|
|
||||||
plcTableName: null,
|
|
||||||
name: null,
|
|
||||||
},
|
|
||||||
// 表单参数
|
|
||||||
form: {},
|
|
||||||
};
|
|
||||||
},
|
|
||||||
created() {
|
|
||||||
this.getList();
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
/** 覆盖 handleEmitFun 的默认实现 */
|
|
||||||
handleEmitFun({ action, payload }) {
|
|
||||||
switch (action) {
|
|
||||||
case 'update-collect':
|
|
||||||
this.reset();
|
|
||||||
const tempForm = {};
|
|
||||||
Object.keys(this.form).forEach((key) => {
|
|
||||||
tempForm[key] = payload[key];
|
|
||||||
});
|
|
||||||
updateEquipmentPlc(tempForm).then((response) => {
|
|
||||||
this.$modal.msgSuccess('修改成功');
|
|
||||||
this.open = false;
|
|
||||||
this.getList();
|
|
||||||
});
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
/** 查询列表 */
|
|
||||||
getList() {
|
|
||||||
this.loading = true;
|
|
||||||
// 执行查询
|
|
||||||
getEquipmentPlcPage(this.queryParams).then((response) => {
|
|
||||||
this.list = response.data.list;
|
|
||||||
this.total = response.data.total;
|
|
||||||
this.loading = false;
|
|
||||||
// this.tableKey = Math.random(); // method 1
|
|
||||||
});
|
|
||||||
},
|
|
||||||
/** 取消按钮 */
|
|
||||||
cancel() {
|
|
||||||
this.open = false;
|
|
||||||
this.reset();
|
|
||||||
},
|
|
||||||
/** 表单重置 */
|
|
||||||
reset() {
|
|
||||||
this.form = {
|
|
||||||
id: undefined,
|
|
||||||
plcTableName: undefined,
|
|
||||||
code: undefined,
|
|
||||||
name: undefined,
|
|
||||||
enName: undefined,
|
|
||||||
description: undefined,
|
|
||||||
collection: 1,
|
|
||||||
};
|
|
||||||
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('是否确认删除该配置?')
|
|
||||||
.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>
|
|
||||||
@@ -1,151 +0,0 @@
|
|||||||
<!--
|
|
||||||
* @Author: zwq
|
|
||||||
* @Date: 2021-11-18 14:16:25
|
|
||||||
* @LastEditors: zwq
|
|
||||||
* @LastEditTime: 2025-02-25 16:11:14
|
|
||||||
* @Description:
|
|
||||||
-->
|
|
||||||
<template>
|
|
||||||
<el-form
|
|
||||||
:model="dataForm"
|
|
||||||
:rules="dataRule"
|
|
||||||
ref="dataForm"
|
|
||||||
@keyup.enter.native="dataFormSubmit()"
|
|
||||||
label-width="100px">
|
|
||||||
<el-form-item label="设备" prop="equipmentId">
|
|
||||||
<el-cascader
|
|
||||||
placeholder="请选择设备"
|
|
||||||
v-model="dataForm.equipmentId"
|
|
||||||
:options="plLineList"
|
|
||||||
:props="{value: 'id', label: 'name', children: 'children'}"
|
|
||||||
style="width: 100%"
|
|
||||||
filterable />
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="关联表名" prop="plcId">
|
|
||||||
<el-select
|
|
||||||
v-model="dataForm.plcId"
|
|
||||||
filterable
|
|
||||||
placeholder="请选择关联表"
|
|
||||||
style="width: 100%">
|
|
||||||
<el-option
|
|
||||||
v-for="dict in plcList"
|
|
||||||
:key="dict.id"
|
|
||||||
:label="dict.plcTableName"
|
|
||||||
:value="dict.id" />
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
</el-form>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import basicAdd from './components/basic-add';
|
|
||||||
import { createEquipmentPlcConnect, updateEquipmentPlcConnect } from '@/api/base/equipmentPlcConnect';
|
|
||||||
import { getplcAllList, getTree } from "@/api/base/equipmentConfig";
|
|
||||||
|
|
||||||
export default {
|
|
||||||
mixins: [basicAdd],
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
urlOptions: {
|
|
||||||
createURL: createEquipmentPlcConnect,
|
|
||||||
updateURL: updateEquipmentPlcConnect,
|
|
||||||
},
|
|
||||||
dataForm: {
|
|
||||||
id: undefined,
|
|
||||||
equipmentId: undefined,
|
|
||||||
plcId: undefined
|
|
||||||
},
|
|
||||||
plcList: [],
|
|
||||||
plLineList: [],
|
|
||||||
dataRule: {
|
|
||||||
equipmentId: [{ required: true, message: "设备不能为空", trigger: "blur" }],
|
|
||||||
plcId: [{ required: true, message: "关联表名不能为空", trigger: "blur" }]
|
|
||||||
},
|
|
||||||
options: [{
|
|
||||||
value: 'zhinan',
|
|
||||||
label: '指南',
|
|
||||||
children: [{
|
|
||||||
value: 'shejiyuanze',
|
|
||||||
label: '设计原则',
|
|
||||||
children: [{
|
|
||||||
value: 'yizhi',
|
|
||||||
label: '一致'
|
|
||||||
}, {
|
|
||||||
value: 'fankui',
|
|
||||||
label: '反馈'
|
|
||||||
}, {
|
|
||||||
value: 'xiaolv',
|
|
||||||
label: '效率'
|
|
||||||
}, {
|
|
||||||
value: 'kekong',
|
|
||||||
label: '可控'
|
|
||||||
}]
|
|
||||||
}, {
|
|
||||||
value: 'daohang',
|
|
||||||
label: '导航'
|
|
||||||
}]
|
|
||||||
}]
|
|
||||||
};
|
|
||||||
},
|
|
||||||
created() {
|
|
||||||
this.getDict()
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
init() {
|
|
||||||
this.$nextTick(() => {
|
|
||||||
this.$refs['dataForm'].resetFields()
|
|
||||||
})
|
|
||||||
},
|
|
||||||
async getDict() {
|
|
||||||
// 关联表名列表
|
|
||||||
const res = await getplcAllList();
|
|
||||||
this.plcList = res.data;
|
|
||||||
// 树形结构
|
|
||||||
const res1 = await getTree();
|
|
||||||
this.plLineList = res1.data;
|
|
||||||
// const res1 = await getCorePLList();
|
|
||||||
// this.plLineList = res1.data;
|
|
||||||
// this.plLineList.forEach(item => {
|
|
||||||
// listByParentId({ id: item.id }).then(resp => {
|
|
||||||
// if (resp.data.length > 0) {
|
|
||||||
// // item.children = resp.data
|
|
||||||
// this.$set(item, 'children', resp.data)
|
|
||||||
// // this.$forceUpdate()
|
|
||||||
// }
|
|
||||||
// })
|
|
||||||
// })
|
|
||||||
},
|
|
||||||
// 表单提交
|
|
||||||
dataFormSubmit() {
|
|
||||||
this.$refs["dataForm"].validate((valid) => {
|
|
||||||
if (!valid) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
// 修改的提交
|
|
||||||
if (this.dataForm.id) {
|
|
||||||
updateEquipmentPlcConnect({
|
|
||||||
id: this.dataForm.id,
|
|
||||||
equipmentId: this.dataForm.equipmentId[this.dataForm.equipmentId.length],
|
|
||||||
plcId: this.dataForm.plcId
|
|
||||||
}).then(response => {
|
|
||||||
this.$modal.msgSuccess("修改成功");
|
|
||||||
this.visible = false;
|
|
||||||
this.$emit("refreshDataList");
|
|
||||||
});
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
// 添加的提交
|
|
||||||
createEquipmentPlcConnect({
|
|
||||||
id: this.dataForm.id,
|
|
||||||
equipmentId: this.dataForm.equipmentId[this.dataForm.equipmentId.length - 1],
|
|
||||||
plcId: this.dataForm.plcId
|
|
||||||
}).then(response => {
|
|
||||||
this.$modal.msgSuccess("新增成功");
|
|
||||||
this.visible = false;
|
|
||||||
this.$emit("refreshDataList");
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
@@ -1,574 +0,0 @@
|
|||||||
<!--
|
|
||||||
filename: EquipmentDrawer.vue
|
|
||||||
author: liubin
|
|
||||||
date: 2023-08-22 14:38:56
|
|
||||||
description:
|
|
||||||
-->
|
|
||||||
|
|
||||||
<template>
|
|
||||||
<el-drawer
|
|
||||||
:visible="visible"
|
|
||||||
:show-close="false"
|
|
||||||
:wrapper-closable="false"
|
|
||||||
class="drawer"
|
|
||||||
custom-class="mes-drawer"
|
|
||||||
size="60%"
|
|
||||||
@closed="$emit('destroy')">
|
|
||||||
<SmallTitle slot="title">
|
|
||||||
{{
|
|
||||||
mode.includes('detail')
|
|
||||||
? '详情'
|
|
||||||
: mode.includes('edit')
|
|
||||||
? '编辑'
|
|
||||||
: '新增'
|
|
||||||
}}
|
|
||||||
</SmallTitle>
|
|
||||||
|
|
||||||
<div class="drawer-body flex">
|
|
||||||
<div class="drawer-body__content">
|
|
||||||
<section v-for="(section, index) in sections" :key="section.key">
|
|
||||||
<SmallTitle v-if="index != 0">{{ section.name }}</SmallTitle>
|
|
||||||
|
|
||||||
<div class="form-part" v-if="section.key == 'base'">
|
|
||||||
<el-skeleton v-if="!showForm" animated />
|
|
||||||
<BaseInfoForm
|
|
||||||
key="drawer-dialog-form"
|
|
||||||
v-if="showForm"
|
|
||||||
ref="form"
|
|
||||||
:disabled="mode.includes('detail')"
|
|
||||||
v-model="form"
|
|
||||||
:rows="formRows" />
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div v-if="section.key == 'attrs'" style="margin-top: 12px">
|
|
||||||
<base-table
|
|
||||||
v-loading="attrListLoading"
|
|
||||||
:table-props="section.props"
|
|
||||||
:page="attrQuery?.params.pageNo || 1"
|
|
||||||
:limit="attrQuery?.params.pageSize || 10"
|
|
||||||
:table-data="list"
|
|
||||||
:add-button-show="mode.includes('detail') ? null : '添加属性'"
|
|
||||||
@emitButtonClick="handleAddAttr"
|
|
||||||
@emitFun="handleEmitFun">
|
|
||||||
<method-btn
|
|
||||||
v-if="section.tableBtn"
|
|
||||||
slot="handleBtn"
|
|
||||||
label="操作"
|
|
||||||
:method-list="tableBtn"
|
|
||||||
@clickBtn="handleTableBtnClick" />
|
|
||||||
</base-table>
|
|
||||||
|
|
||||||
<!-- 分页组件 -->
|
|
||||||
<pagination
|
|
||||||
v-show="total > 0"
|
|
||||||
:total="total"
|
|
||||||
:page.sync="attrQuery.params.pageNo"
|
|
||||||
:limit.sync="attrQuery.params.pageSize"
|
|
||||||
@pagination="getAttrList" />
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="drawer-body__footer">
|
|
||||||
<el-button style="" @click="handleCancel">取消</el-button>
|
|
||||||
<el-button v-if="mode == 'detail'" type="primary" @click="toggleEdit">
|
|
||||||
编辑
|
|
||||||
</el-button>
|
|
||||||
<el-button v-else type="primary" @click="handleCancel">确定</el-button>
|
|
||||||
<!-- sections的第二项必须是 属性列表 -->
|
|
||||||
<!-- <el-button
|
|
||||||
v-if="sections[1].allowAdd"
|
|
||||||
type="primary"
|
|
||||||
@click="handleAddAttr">
|
|
||||||
添加属性
|
|
||||||
</el-button> -->
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- 属性对话框 -->
|
|
||||||
<base-dialog
|
|
||||||
v-if="sections[1].allowAdd"
|
|
||||||
:dialogTitle="attrTitle"
|
|
||||||
:dialogVisible="attrFormVisible"
|
|
||||||
width="45%"
|
|
||||||
:append-to-body="true"
|
|
||||||
custom-class="baseDialog"
|
|
||||||
@close="closeAttrForm"
|
|
||||||
@cancel="closeAttrForm"
|
|
||||||
@confirm="submitAttrForm">
|
|
||||||
<DialogForm
|
|
||||||
v-if="attrFormVisible"
|
|
||||||
ref="attrForm"
|
|
||||||
:disabled="mode.includes('detail')"
|
|
||||||
v-model="attrForm"
|
|
||||||
:rows="attrRows" />
|
|
||||||
</base-dialog>
|
|
||||||
</el-drawer>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import BaseInfoForm from '@/components/DialogForm';
|
|
||||||
|
|
||||||
const SmallTitle = {
|
|
||||||
name: 'SmallTitle',
|
|
||||||
props: ['size'],
|
|
||||||
data() {
|
|
||||||
return {};
|
|
||||||
},
|
|
||||||
methods: {},
|
|
||||||
render: function (h) {
|
|
||||||
return h(
|
|
||||||
'span',
|
|
||||||
{
|
|
||||||
class: 'small-title',
|
|
||||||
style: {
|
|
||||||
fontSize: '18px',
|
|
||||||
lineHeight:
|
|
||||||
this.size == 'lg' ? '24px' : this.size == 'sm' ? '18px' : '20px',
|
|
||||||
fontWeight: 500,
|
|
||||||
fontFamily: '微软雅黑, Microsoft YaHei, Arial, Helvetica, sans-serif',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
this.$slots.default
|
|
||||||
);
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
export default {
|
|
||||||
components: { SmallTitle, DialogForm: BaseInfoForm, BaseInfoForm },
|
|
||||||
props: ['sections', 'defaultMode', 'infoData'],
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
mode: '',
|
|
||||||
visible: false,
|
|
||||||
showForm: false,
|
|
||||||
total: 0,
|
|
||||||
form: {},
|
|
||||||
list: [],
|
|
||||||
attrTitle: '',
|
|
||||||
attrForm: {
|
|
||||||
id: null,
|
|
||||||
name: '',
|
|
||||||
plcParamName: '',
|
|
||||||
unit: '',
|
|
||||||
collection: 1,
|
|
||||||
minValue: '',
|
|
||||||
maxValue: '',
|
|
||||||
defaultValue: '',
|
|
||||||
description: '',
|
|
||||||
remark: '',
|
|
||||||
alarmContent: '',
|
|
||||||
equipmentParamType: '',
|
|
||||||
productionParamType: '',
|
|
||||||
},
|
|
||||||
attrFormVisible: false,
|
|
||||||
attrRows: [
|
|
||||||
[
|
|
||||||
{
|
|
||||||
input: true,
|
|
||||||
label: '参数列名',
|
|
||||||
prop: 'plcParamName',
|
|
||||||
rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
input: true,
|
|
||||||
label: '参数名称',
|
|
||||||
prop: 'name',
|
|
||||||
rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
|
||||||
},
|
|
||||||
],
|
|
||||||
[
|
|
||||||
{
|
|
||||||
select: true,
|
|
||||||
label: '单位',
|
|
||||||
prop: 'unit',
|
|
||||||
options: this.getDictDatas(this.DICT_TYPE.UNIT_DICT),
|
|
||||||
// rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
switch: true,
|
|
||||||
label: '是否采集',
|
|
||||||
prop: 'collection',
|
|
||||||
bind: {
|
|
||||||
'active-value': 1,
|
|
||||||
'inactive-value': 0,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
|
||||||
[
|
|
||||||
{
|
|
||||||
select: true,
|
|
||||||
label: '设备参数类型',
|
|
||||||
prop: 'equipmentParamType',
|
|
||||||
options: [
|
|
||||||
{ label: '一般参数', value: 1 },
|
|
||||||
{ label: '工艺参数', value: 2 },
|
|
||||||
{ label: '报警参数', value: 3 },
|
|
||||||
],
|
|
||||||
rules: [
|
|
||||||
{
|
|
||||||
required: true,
|
|
||||||
message: '设备参数类型不能为空',
|
|
||||||
trigger: 'blur',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
select: true,
|
|
||||||
label: '生产参数类型',
|
|
||||||
prop: 'productionParamType',
|
|
||||||
options: [
|
|
||||||
// { label: '进片数量', value: 1 },
|
|
||||||
// { label: '出片数量', value: 2 },
|
|
||||||
// { label: '破损数量', value: 3 },
|
|
||||||
// { label: '无类型', value: 4 },
|
|
||||||
{ label: '进口计数', value: 1 },
|
|
||||||
{ label: '出口计数', value: 2 },
|
|
||||||
{ label: '损耗计数', value: 3 },
|
|
||||||
{ label: '无类型', value: 4 },
|
|
||||||
],
|
|
||||||
rules: [
|
|
||||||
{
|
|
||||||
required: true,
|
|
||||||
message: '生产参数类型不能为空',
|
|
||||||
trigger: 'blur',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
],
|
|
||||||
[
|
|
||||||
{
|
|
||||||
input: true,
|
|
||||||
label: '最小值',
|
|
||||||
prop: 'minValue',
|
|
||||||
rules: [
|
|
||||||
{
|
|
||||||
type: 'number',
|
|
||||||
message: '请输入正确的数字',
|
|
||||||
trigger: 'change',
|
|
||||||
transform: (val) => Number(val),
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
input: true,
|
|
||||||
label: '最大值',
|
|
||||||
prop: 'maxValue',
|
|
||||||
rules: [
|
|
||||||
{
|
|
||||||
required: false,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: 'number',
|
|
||||||
message: '请输入正确的数字',
|
|
||||||
trigger: 'change',
|
|
||||||
transform: (val) => Number(val),
|
|
||||||
},
|
|
||||||
],
|
|
||||||
// rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
|
||||||
},
|
|
||||||
],
|
|
||||||
[
|
|
||||||
{
|
|
||||||
input: true,
|
|
||||||
label: '标准值',
|
|
||||||
prop: 'defaultValue',
|
|
||||||
// rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
input: true,
|
|
||||||
label: '描述',
|
|
||||||
prop: 'description',
|
|
||||||
// rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
|
||||||
},
|
|
||||||
],
|
|
||||||
[
|
|
||||||
{
|
|
||||||
input: true,
|
|
||||||
label: '备注',
|
|
||||||
prop: 'remark',
|
|
||||||
// rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
|
||||||
},
|
|
||||||
],
|
|
||||||
],
|
|
||||||
attrQuery: {
|
|
||||||
params: {
|
|
||||||
pageNo: 1,
|
|
||||||
pageSize: 10,
|
|
||||||
},
|
|
||||||
}, // 属性列表的请求
|
|
||||||
infoQuery: null, // 基本信息的请求
|
|
||||||
attrFormSubmitting: false,
|
|
||||||
attrListLoading: false,
|
|
||||||
};
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
formRows() {
|
|
||||||
return this.sections[0].rows.map((row) => {
|
|
||||||
return row.map((col) => {
|
|
||||||
return {
|
|
||||||
...col,
|
|
||||||
bind: {
|
|
||||||
// 详情 模式下,禁用各种输入
|
|
||||||
// disabled: this.mode == 'detail',
|
|
||||||
disabled: true,
|
|
||||||
},
|
|
||||||
};
|
|
||||||
});
|
|
||||||
});
|
|
||||||
},
|
|
||||||
tableBtn() {
|
|
||||||
return this.mode == 'detail' ? [] : this.sections[1].tableBtn;
|
|
||||||
},
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
this.mode = this.defaultMode || 'detail';
|
|
||||||
for (const section of this.sections) {
|
|
||||||
// 请求具体信息
|
|
||||||
if ('url' in section) {
|
|
||||||
const query = {
|
|
||||||
url: section.url,
|
|
||||||
method: section.method || 'get',
|
|
||||||
params: section.queryParams || null,
|
|
||||||
data: section.data || null,
|
|
||||||
};
|
|
||||||
// debugger;
|
|
||||||
this.$axios(query).then(({ data }) => {
|
|
||||||
if (section.key == 'base') {
|
|
||||||
this.form = data;
|
|
||||||
this.showForm = true;
|
|
||||||
this.infoQuery = query;
|
|
||||||
} else if (section.key == 'attrs') {
|
|
||||||
this.attrQuery = query;
|
|
||||||
this.list = data.list;
|
|
||||||
this.total = data.total;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} else if (section.key == 'base') {
|
|
||||||
this.form = this.infoData;
|
|
||||||
this.showForm = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
handleTableBtnClick({ type, data }) {
|
|
||||||
switch (type) {
|
|
||||||
case 'edit':
|
|
||||||
this.handleEditAttr(data.id);
|
|
||||||
break;
|
|
||||||
case 'delete':
|
|
||||||
this.handleDeleteAttr(data.id);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
handleEmitFun(val) {
|
|
||||||
console.log('handleEmitFun', val);
|
|
||||||
},
|
|
||||||
|
|
||||||
init() {
|
|
||||||
this.visible = true;
|
|
||||||
},
|
|
||||||
|
|
||||||
async getAttrList() {
|
|
||||||
this.attrListLoading = true;
|
|
||||||
const res = await this.$axios(this.attrQuery);
|
|
||||||
if (res.code == 0) {
|
|
||||||
this.list = res.data.list;
|
|
||||||
this.total = res.data.total;
|
|
||||||
}
|
|
||||||
this.attrListLoading = false;
|
|
||||||
},
|
|
||||||
|
|
||||||
// 保存表单
|
|
||||||
handleSave() {
|
|
||||||
this.$refs['form'][0].validate(async (valid) => {
|
|
||||||
if (valid) {
|
|
||||||
const isEdit = this.mode == 'edit';
|
|
||||||
await this.$axios({
|
|
||||||
url: this.sections[0][isEdit ? 'urlUpdate' : 'urlCreate'],
|
|
||||||
method: isEdit ? 'put' : 'post',
|
|
||||||
data: this.form,
|
|
||||||
});
|
|
||||||
this.$modal.msgSuccess(`${isEdit ? '更新' : '创建'}成功`);
|
|
||||||
this.visible = false;
|
|
||||||
this.$emit('refreshDataList');
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
handleCancel() {
|
|
||||||
this.visible = false;
|
|
||||||
},
|
|
||||||
|
|
||||||
// 开启编辑
|
|
||||||
toggleEdit() {
|
|
||||||
this.mode = 'edit';
|
|
||||||
},
|
|
||||||
|
|
||||||
// 新增属性
|
|
||||||
handleAddAttr() {
|
|
||||||
this.attrForm = {
|
|
||||||
id: null,
|
|
||||||
name: '',
|
|
||||||
plcParamName: '',
|
|
||||||
unit: '',
|
|
||||||
collection: 1,
|
|
||||||
minValue: '',
|
|
||||||
maxValue: '',
|
|
||||||
defaultValue: '',
|
|
||||||
description: '',
|
|
||||||
remark: '',
|
|
||||||
alarmContent: '',
|
|
||||||
};
|
|
||||||
this.attrTitle = '添加设备绑定信息';
|
|
||||||
this.attrFormVisible = true;
|
|
||||||
},
|
|
||||||
|
|
||||||
// 编辑属性
|
|
||||||
async handleEditAttr(attrId) {
|
|
||||||
const res = await this.$axios({
|
|
||||||
url: this.sections[1].urlDetail,
|
|
||||||
method: 'get',
|
|
||||||
params: { id: attrId },
|
|
||||||
});
|
|
||||||
if (res.code == 0) {
|
|
||||||
this.attrForm = res.data;
|
|
||||||
this.attrTitle = '编辑设备绑定信息';
|
|
||||||
this.attrFormVisible = true;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
// 删除属性
|
|
||||||
handleDeleteAttr(attrId) {
|
|
||||||
this.$confirm('确定删除该分组报警?', '提示', {
|
|
||||||
confirmButtonText: '确定',
|
|
||||||
cancelButtonText: '取消',
|
|
||||||
type: 'warning',
|
|
||||||
})
|
|
||||||
.then(async () => {
|
|
||||||
const res = await this.$axios({
|
|
||||||
url: this.sections[1].urlDelete,
|
|
||||||
method: 'delete',
|
|
||||||
params: { id: attrId },
|
|
||||||
});
|
|
||||||
if (res.code == 0) {
|
|
||||||
this.$message({
|
|
||||||
message: '删除成功',
|
|
||||||
type: 'success',
|
|
||||||
duration: 1500,
|
|
||||||
onClose: () => {
|
|
||||||
this.getAttrList();
|
|
||||||
},
|
|
||||||
});
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.catch(() => {});
|
|
||||||
},
|
|
||||||
|
|
||||||
// 提交属性表
|
|
||||||
async submitAttrForm() {
|
|
||||||
this.$refs['attrForm'].validate((valid) => {
|
|
||||||
if (!valid) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
const isEdit = this.attrForm.id != null;
|
|
||||||
this.attrFormSubmitting = true;
|
|
||||||
const res = await this.$axios({
|
|
||||||
url: isEdit ? this.sections[1].urlUpdate : this.sections[1].urlCreate,
|
|
||||||
method: isEdit ? 'put' : 'post',
|
|
||||||
data: {
|
|
||||||
...this.attrForm,
|
|
||||||
connectId: this.infoData.id
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
if (res.code == 0) {
|
|
||||||
this.closeAttrForm();
|
|
||||||
this.$message({
|
|
||||||
message: `${isEdit ? '更新' : '创建'}成功`,
|
|
||||||
type: 'success',
|
|
||||||
duration: 1500,
|
|
||||||
onClose: () => {
|
|
||||||
this.getAttrList();
|
|
||||||
},
|
|
||||||
});
|
|
||||||
}
|
|
||||||
this.attrFormSubmitting = false;
|
|
||||||
},
|
|
||||||
|
|
||||||
closeAttrForm() {
|
|
||||||
this.attrFormVisible = false;
|
|
||||||
},
|
|
||||||
|
|
||||||
handleClick(raw) {
|
|
||||||
if (raw.type === 'delete') {
|
|
||||||
this.$confirm(`确定删除该报警?`, '提示', {
|
|
||||||
confirmButtonText: '确定',
|
|
||||||
cancelButtonText: '取消',
|
|
||||||
type: 'warning',
|
|
||||||
})
|
|
||||||
.then(() => {
|
|
||||||
deleteProductAttr(raw.data.id).then(({ data }) => {
|
|
||||||
this.$message({
|
|
||||||
message: '操作成功',
|
|
||||||
type: 'success',
|
|
||||||
duration: 1500,
|
|
||||||
onClose: () => {
|
|
||||||
this.getList();
|
|
||||||
},
|
|
||||||
});
|
|
||||||
});
|
|
||||||
})
|
|
||||||
.catch(() => {});
|
|
||||||
} else {
|
|
||||||
this.addNew(raw.data.id);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped>
|
|
||||||
.drawer >>> .el-drawer {
|
|
||||||
border-radius: 8px 0 0 8px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.drawer >>> .el-drawer__header {
|
|
||||||
margin: 0;
|
|
||||||
padding: 32px 32px 24px;
|
|
||||||
border-bottom: 1px solid #dcdfe6;
|
|
||||||
margin-bottom: 0px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.small-title::before {
|
|
||||||
content: '';
|
|
||||||
display: inline-block;
|
|
||||||
vertical-align: top;
|
|
||||||
width: 4px;
|
|
||||||
height: 22px;
|
|
||||||
border-radius: 1px;
|
|
||||||
margin-right: 8px;
|
|
||||||
background-color: #0b58ff;
|
|
||||||
}
|
|
||||||
|
|
||||||
.drawer-body {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.drawer-body__content {
|
|
||||||
flex: 1;
|
|
||||||
/* background: #eee; */
|
|
||||||
padding: 20px 30px;
|
|
||||||
overflow-y: auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
.drawer-body__footer {
|
|
||||||
display: flex;
|
|
||||||
justify-content: flex-end;
|
|
||||||
padding: 18px;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,668 +0,0 @@
|
|||||||
<!--
|
|
||||||
filename: EquipmentDrawer.vue
|
|
||||||
author: liubin
|
|
||||||
date: 2023-08-22 14:38:56
|
|
||||||
description:
|
|
||||||
-->
|
|
||||||
|
|
||||||
<template>
|
|
||||||
<el-drawer
|
|
||||||
:visible="visible"
|
|
||||||
:show-close="false"
|
|
||||||
:wrapper-closable="false"
|
|
||||||
class="drawer"
|
|
||||||
custom-class="mes-drawer"
|
|
||||||
:size="size || '50%'"
|
|
||||||
@closed="$emit('destroy')">
|
|
||||||
<SmallTitle slot="title">
|
|
||||||
{{
|
|
||||||
mode.includes('detail')
|
|
||||||
? '详情'
|
|
||||||
: mode.includes('edit')
|
|
||||||
? '编辑'
|
|
||||||
: '新增'
|
|
||||||
}}
|
|
||||||
</SmallTitle>
|
|
||||||
|
|
||||||
<div class="drawer-body flex">
|
|
||||||
<div class="drawer-body__content">
|
|
||||||
<section v-for="(section, index) in sections" :key="section.key">
|
|
||||||
<SmallTitle v-if="index != 0">{{ section.name }}</SmallTitle>
|
|
||||||
|
|
||||||
<div
|
|
||||||
class="form-part"
|
|
||||||
v-if="section.key == 'base'"
|
|
||||||
style="border-bottom: 1px solid #dfdfdf; margin-bottom: 24px">
|
|
||||||
<el-skeleton v-if="!showForm" animated />
|
|
||||||
<!-- <BaseInfoForm
|
|
||||||
key="drawer-dialog-form"
|
|
||||||
v-if="showForm"
|
|
||||||
ref="form"
|
|
||||||
:disabled="mode.includes('detail')"
|
|
||||||
v-model="form"
|
|
||||||
:rows="formRows" /> -->
|
|
||||||
|
|
||||||
<!-- if -->
|
|
||||||
<el-row v-if="mode.includes('detail')" style="margin-bottom: 24px">
|
|
||||||
<el-col :span="8">
|
|
||||||
<div
|
|
||||||
class="title"
|
|
||||||
style="font-weight: 700; font-size: 16px; margin: 8px 0">
|
|
||||||
设备名
|
|
||||||
</div>
|
|
||||||
<div class="value" style="font-size: 14px">
|
|
||||||
{{ form.equipmentName }}
|
|
||||||
</div>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="8">
|
|
||||||
<div
|
|
||||||
class="title"
|
|
||||||
style="font-weight: 700; font-size: 16px; margin: 8px 0">
|
|
||||||
关联表名
|
|
||||||
</div>
|
|
||||||
<div class="value" style="font-size: 14px">
|
|
||||||
{{ form.plcName }}
|
|
||||||
</div>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
<!-- else -->
|
|
||||||
<el-row v-else style="margin-bottom: 24px" :gutter="20">
|
|
||||||
<el-form ref="form" :model="form">
|
|
||||||
<el-col :span="8">
|
|
||||||
<el-form-item
|
|
||||||
class="title"
|
|
||||||
label="设备名"
|
|
||||||
style="font-size: 16px; margin: 8px 0">
|
|
||||||
<el-select
|
|
||||||
v-model="form.equipmentId"
|
|
||||||
filterable
|
|
||||||
clearable
|
|
||||||
placeholder="请选择设备">
|
|
||||||
<el-option
|
|
||||||
v-for="eq in eqList"
|
|
||||||
:key="eq.id"
|
|
||||||
:label="eq.name"
|
|
||||||
:value="eq.id"></el-option>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="8">
|
|
||||||
<el-form-item
|
|
||||||
class="title"
|
|
||||||
label="设备关联表名"
|
|
||||||
style="font-size: 16px; margin: 8px 0">
|
|
||||||
<el-select
|
|
||||||
v-model="form.plcId"
|
|
||||||
filterable
|
|
||||||
clearable
|
|
||||||
placeholder="请选择关联表">
|
|
||||||
<el-option
|
|
||||||
v-for="plc in plcList"
|
|
||||||
:key="plc.id"
|
|
||||||
:label="plc.plcTableName"
|
|
||||||
:value="plc.id"></el-option>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-form>
|
|
||||||
</el-row>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div
|
|
||||||
v-if="section.key == 'attrs'"
|
|
||||||
style="position: relative; margin-top: 12px">
|
|
||||||
<div
|
|
||||||
v-if="!mode.includes('detail')"
|
|
||||||
style="position: absolute; top: -40px; right: 0">
|
|
||||||
<el-button @click="handleAddAttr" type="text">
|
|
||||||
<i class="el-icon-plus"></i>
|
|
||||||
添加参数
|
|
||||||
</el-button>
|
|
||||||
</div>
|
|
||||||
<base-table
|
|
||||||
v-loading="attrListLoading"
|
|
||||||
:table-props="section.props"
|
|
||||||
:page="attrQuery?.params.pageNo || 1"
|
|
||||||
:limit="attrQuery?.params.pageSize || 10"
|
|
||||||
:table-data="list"
|
|
||||||
@emitFun="handleEmitFun">
|
|
||||||
<!-- :add-button-show="mode.includes('detail') ? null : '添加属性'"
|
|
||||||
@emitButtonClick="handleAddAttr" -->
|
|
||||||
<method-btn
|
|
||||||
v-if="section.tableBtn && !mode.includes('detail')"
|
|
||||||
slot="handleBtn"
|
|
||||||
label="操作"
|
|
||||||
:method-list="tableBtn"
|
|
||||||
@clickBtn="handleTableBtnClick" />
|
|
||||||
</base-table>
|
|
||||||
|
|
||||||
<!-- 分页组件 -->
|
|
||||||
<pagination
|
|
||||||
v-show="total > 0"
|
|
||||||
:total="total"
|
|
||||||
:page.sync="attrQuery.params.pageNo"
|
|
||||||
:limit.sync="attrQuery.params.pageSize"
|
|
||||||
@pagination="getAttrList" />
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="drawer-body__footer">
|
|
||||||
<el-button style="" @click="handleCancel">取消</el-button>
|
|
||||||
<el-button
|
|
||||||
type="primary"
|
|
||||||
v-if="!mode.includes('detail')"
|
|
||||||
@click="handleSave">
|
|
||||||
保存
|
|
||||||
</el-button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- 属性对话框 -->
|
|
||||||
<base-dialog
|
|
||||||
v-if="sections[1].allowAdd"
|
|
||||||
:dialogTitle="attrTitle"
|
|
||||||
:dialogVisible="attrFormVisible"
|
|
||||||
width="45%"
|
|
||||||
:append-to-body="true"
|
|
||||||
custom-class="baseDialog"
|
|
||||||
@close="closeAttrForm"
|
|
||||||
@cancel="closeAttrForm"
|
|
||||||
@confirm="submitAttrForm">
|
|
||||||
<!-- :disabled="mode.includes('detail')" -->
|
|
||||||
<DialogForm
|
|
||||||
v-if="attrFormVisible"
|
|
||||||
ref="attrForm"
|
|
||||||
v-model="attrForm"
|
|
||||||
:rows="attrRows" />
|
|
||||||
</base-dialog>
|
|
||||||
</el-drawer>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import BaseInfoForm from '@/components/DialogForm';
|
|
||||||
|
|
||||||
const SmallTitle = {
|
|
||||||
name: 'SmallTitle',
|
|
||||||
props: ['size'],
|
|
||||||
data() {
|
|
||||||
return {};
|
|
||||||
},
|
|
||||||
methods: {},
|
|
||||||
render: function (h) {
|
|
||||||
return h(
|
|
||||||
'span',
|
|
||||||
{
|
|
||||||
class: 'small-title',
|
|
||||||
style: {
|
|
||||||
fontSize: '18px',
|
|
||||||
lineHeight:
|
|
||||||
this.size == 'lg' ? '24px' : this.size == 'sm' ? '18px' : '20px',
|
|
||||||
fontWeight: 500,
|
|
||||||
fontFamily: '微软雅黑, Microsoft YaHei, Arial, Helvetica, sans-serif',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
this.$slots.default
|
|
||||||
);
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
export default {
|
|
||||||
components: { SmallTitle, DialogForm: BaseInfoForm, BaseInfoForm },
|
|
||||||
props: ['sections', 'defaultMode', 'infoData', 'size'],
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
mode: '',
|
|
||||||
visible: false,
|
|
||||||
showForm: false,
|
|
||||||
total: 0,
|
|
||||||
form: {},
|
|
||||||
list: [],
|
|
||||||
eqList: [],
|
|
||||||
plcList: [],
|
|
||||||
attrTitle: '',
|
|
||||||
attrForm: {
|
|
||||||
id: null,
|
|
||||||
name: '',
|
|
||||||
plcParamName: '',
|
|
||||||
unit: '',
|
|
||||||
collection: 1,
|
|
||||||
minValue: '',
|
|
||||||
maxValue: '',
|
|
||||||
defaultValue: '',
|
|
||||||
description: '',
|
|
||||||
remark: '',
|
|
||||||
alarmContent: '',
|
|
||||||
},
|
|
||||||
attrFormVisible: false,
|
|
||||||
attrRows: [
|
|
||||||
[
|
|
||||||
{
|
|
||||||
input: true,
|
|
||||||
label: '参数列名',
|
|
||||||
prop: 'plcParamName',
|
|
||||||
rules: [
|
|
||||||
{ required: true, message: '参数列名不能为空', trigger: 'blur' },
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
input: true,
|
|
||||||
label: '参数名称',
|
|
||||||
prop: 'name',
|
|
||||||
rules: [
|
|
||||||
{ required: true, message: '参数名称不能为空', trigger: 'blur' },
|
|
||||||
],
|
|
||||||
},
|
|
||||||
],
|
|
||||||
[
|
|
||||||
{
|
|
||||||
select: true,
|
|
||||||
label: '单位',
|
|
||||||
prop: 'unit',
|
|
||||||
options: this.getDictDatas(this.DICT_TYPE.UNIT_DICT),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
switch: true,
|
|
||||||
label: '是否采集',
|
|
||||||
prop: 'collection',
|
|
||||||
bind: {
|
|
||||||
'active-value': 1,
|
|
||||||
'inactive-value': 0,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
|
||||||
[
|
|
||||||
{
|
|
||||||
select: true,
|
|
||||||
label: '设备参数类型',
|
|
||||||
prop: 'equipmentParamType',
|
|
||||||
options: [
|
|
||||||
{ label: '一般参数', value: 1 },
|
|
||||||
{ label: '工艺参数', value: 2 },
|
|
||||||
{ label: '报警参数', value: 3 },
|
|
||||||
],
|
|
||||||
rules: [
|
|
||||||
{
|
|
||||||
required: true,
|
|
||||||
message: '设备参数类型不能为空',
|
|
||||||
trigger: 'blur',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
select: true,
|
|
||||||
label: '生产参数类型',
|
|
||||||
prop: 'productionParamType',
|
|
||||||
options: [
|
|
||||||
// { label: '进片数量', value: 1 },
|
|
||||||
// { label: '出片数量', value: 2 },
|
|
||||||
// { label: '破损数量', value: 3 },
|
|
||||||
// { label: '无类型', value: 4 },
|
|
||||||
{ label: '进口计数', value: 1 },
|
|
||||||
{ label: '出口计数', value: 2 },
|
|
||||||
{ label: '损耗计数', value: 3 },
|
|
||||||
{ label: '无类型', value: 4 },
|
|
||||||
],
|
|
||||||
rules: [
|
|
||||||
{
|
|
||||||
required: true,
|
|
||||||
message: '生产参数类型不能为空',
|
|
||||||
trigger: 'blur',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
],
|
|
||||||
[
|
|
||||||
{
|
|
||||||
input: true,
|
|
||||||
label: '最小值',
|
|
||||||
prop: 'minValue',
|
|
||||||
rules: [
|
|
||||||
{
|
|
||||||
type: 'number',
|
|
||||||
message: '请输入正确的数字',
|
|
||||||
trigger: 'change',
|
|
||||||
transform: (val) => Number(val),
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
input: true,
|
|
||||||
label: '最大值',
|
|
||||||
prop: 'maxValue',
|
|
||||||
rules: [
|
|
||||||
{
|
|
||||||
required: false,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: 'number',
|
|
||||||
message: '请输入正确的数字',
|
|
||||||
trigger: 'change',
|
|
||||||
transform: (val) => Number(val),
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
],
|
|
||||||
[
|
|
||||||
{
|
|
||||||
input: true,
|
|
||||||
label: '标准值',
|
|
||||||
prop: 'defaultValue',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
input: true,
|
|
||||||
label: '描述',
|
|
||||||
prop: 'description',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
[
|
|
||||||
{
|
|
||||||
input: true,
|
|
||||||
label: '备注',
|
|
||||||
prop: 'remark',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
],
|
|
||||||
attrQuery: {
|
|
||||||
params: {
|
|
||||||
pageNo: 1,
|
|
||||||
pageSize: 10,
|
|
||||||
},
|
|
||||||
}, // 属性列表的请求
|
|
||||||
infoQuery: null, // 基本信息的请求
|
|
||||||
attrFormSubmitting: false,
|
|
||||||
attrListLoading: false,
|
|
||||||
shouldRefreshPageView: false,
|
|
||||||
};
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
formRows() {
|
|
||||||
return this.sections[0].rows.map((row) => {
|
|
||||||
return row.map((col) => {
|
|
||||||
return {
|
|
||||||
...col,
|
|
||||||
bind: {
|
|
||||||
// 详情 模式下,禁用各种输入
|
|
||||||
// disabled: this.mode == 'detail',
|
|
||||||
disabled: true,
|
|
||||||
},
|
|
||||||
};
|
|
||||||
});
|
|
||||||
});
|
|
||||||
},
|
|
||||||
tableBtn() {
|
|
||||||
return this.sections[1].tableBtn;
|
|
||||||
// return this.mode == 'detail' ? [] : this.sections[1].tableBtn;
|
|
||||||
},
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
this.shouldRefreshPageView = false;
|
|
||||||
this.mode = this.defaultMode || 'detail';
|
|
||||||
|
|
||||||
if (this.mode != 'detail') {
|
|
||||||
this.$axios('/base/equipment/listAll').then(({ code, data }) => {
|
|
||||||
this.eqList = data;
|
|
||||||
});
|
|
||||||
this.$axios({
|
|
||||||
url: '/base/equipment-plc/listAll',
|
|
||||||
}).then(({ code, data }) => {
|
|
||||||
this.plcList = data;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
for (const section of this.sections) {
|
|
||||||
// 请求具体信息
|
|
||||||
if ('url' in section) {
|
|
||||||
const query = {
|
|
||||||
url: section.url,
|
|
||||||
method: section.method || 'get',
|
|
||||||
params: section.queryParams || null,
|
|
||||||
data: section.data || null,
|
|
||||||
};
|
|
||||||
// debugger;
|
|
||||||
this.$axios(query).then(({ data }) => {
|
|
||||||
if (section.key == 'base') {
|
|
||||||
this.form = data;
|
|
||||||
this.showForm = true;
|
|
||||||
this.infoQuery = query;
|
|
||||||
} else if (section.key == 'attrs') {
|
|
||||||
this.attrQuery = query;
|
|
||||||
this.list = data.list;
|
|
||||||
this.total = data.total;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} else if (section.key == 'base') {
|
|
||||||
this.form = this.infoData;
|
|
||||||
this.showForm = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
handleTableBtnClick({ type, data }) {
|
|
||||||
switch (type) {
|
|
||||||
case 'edit':
|
|
||||||
this.handleEditAttr(data.id);
|
|
||||||
break;
|
|
||||||
case 'delete':
|
|
||||||
this.handleDeleteAttr(data.id);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
handleEmitFun(val) {
|
|
||||||
console.log('handleEmitFun', val);
|
|
||||||
},
|
|
||||||
|
|
||||||
init() {
|
|
||||||
this.visible = true;
|
|
||||||
},
|
|
||||||
|
|
||||||
async getAttrList() {
|
|
||||||
this.attrListLoading = true;
|
|
||||||
const res = await this.$axios(this.attrQuery);
|
|
||||||
if (res.code == 0) {
|
|
||||||
this.list = res.data.list;
|
|
||||||
this.total = res.data.total;
|
|
||||||
}
|
|
||||||
this.attrListLoading = false;
|
|
||||||
},
|
|
||||||
|
|
||||||
// 保存表单
|
|
||||||
handleSave() {
|
|
||||||
this.$refs['form'][0].validate(async (valid) => {
|
|
||||||
if (valid) {
|
|
||||||
const isEdit = !this.mode.includes('detail');
|
|
||||||
await this.$axios({
|
|
||||||
url: this.sections[0][isEdit ? 'urlUpdate' : 'urlCreate'],
|
|
||||||
method: isEdit ? 'put' : 'post',
|
|
||||||
data: this.form,
|
|
||||||
});
|
|
||||||
this.$modal.msgSuccess(`${isEdit ? '更新' : '创建'}成功`);
|
|
||||||
this.visible = false;
|
|
||||||
this.$emit('refreshDataList');
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
handleCancel() {
|
|
||||||
if (this.shouldRefreshPageView) {
|
|
||||||
this.$emit('refreshDataList');
|
|
||||||
}
|
|
||||||
this.visible = false;
|
|
||||||
},
|
|
||||||
|
|
||||||
// 开启编辑
|
|
||||||
toggleEdit() {
|
|
||||||
this.mode = 'edit';
|
|
||||||
},
|
|
||||||
|
|
||||||
// 新增属性
|
|
||||||
handleAddAttr() {
|
|
||||||
this.attrForm = {
|
|
||||||
id: null,
|
|
||||||
name: '',
|
|
||||||
plcParamName: '',
|
|
||||||
unit: '',
|
|
||||||
collection: 1,
|
|
||||||
minValue: '',
|
|
||||||
maxValue: '',
|
|
||||||
defaultValue: '',
|
|
||||||
description: '',
|
|
||||||
remark: '',
|
|
||||||
equipmentParamType: '',
|
|
||||||
productionParamType: '',
|
|
||||||
alarmContent: '',
|
|
||||||
};
|
|
||||||
this.attrTitle = '添加参数绑定信息';
|
|
||||||
this.attrFormVisible = true;
|
|
||||||
},
|
|
||||||
|
|
||||||
// 编辑属性
|
|
||||||
async handleEditAttr(attrId) {
|
|
||||||
const res = await this.$axios({
|
|
||||||
url: this.sections[1].urlDetail,
|
|
||||||
method: 'get',
|
|
||||||
params: { id: attrId },
|
|
||||||
});
|
|
||||||
if (res.code == 0) {
|
|
||||||
this.attrForm = res.data;
|
|
||||||
this.attrTitle = '编辑参数绑定信息';
|
|
||||||
this.attrFormVisible = true;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
// 删除属性
|
|
||||||
handleDeleteAttr(attrId) {
|
|
||||||
this.$confirm('确定删除该参数?', '提示', {
|
|
||||||
confirmButtonText: '确定',
|
|
||||||
cancelButtonText: '取消',
|
|
||||||
type: 'warning',
|
|
||||||
})
|
|
||||||
.then(async () => {
|
|
||||||
const res = await this.$axios({
|
|
||||||
url: this.sections[1].urlDelete,
|
|
||||||
method: 'delete',
|
|
||||||
params: { id: attrId },
|
|
||||||
});
|
|
||||||
if (res.code == 0) {
|
|
||||||
this.shouldRefreshPageView = true;
|
|
||||||
this.$message({
|
|
||||||
message: '删除成功',
|
|
||||||
type: 'success',
|
|
||||||
duration: 1500,
|
|
||||||
onClose: () => {
|
|
||||||
this.getAttrList();
|
|
||||||
},
|
|
||||||
});
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.catch(() => {});
|
|
||||||
},
|
|
||||||
|
|
||||||
// 提交属性表
|
|
||||||
submitAttrForm() {
|
|
||||||
this.$refs['attrForm'].validate(async (valid) => {
|
|
||||||
if (!valid) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const isEdit = this.attrForm.id != null;
|
|
||||||
this.attrFormSubmitting = true;
|
|
||||||
const res = await this.$axios({
|
|
||||||
url: isEdit ? this.sections[1].urlUpdate : this.sections[1].urlCreate,
|
|
||||||
method: isEdit ? 'put' : 'post',
|
|
||||||
data: {
|
|
||||||
...this.attrForm,
|
|
||||||
connectId: this.infoData.id,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
if (res.code == 0) {
|
|
||||||
this.closeAttrForm();
|
|
||||||
this.$message({
|
|
||||||
message: `${isEdit ? '更新' : '创建'}成功`,
|
|
||||||
type: 'success',
|
|
||||||
duration: 1500,
|
|
||||||
onClose: () => {
|
|
||||||
this.getAttrList();
|
|
||||||
this.shouldRefreshPageView = true;
|
|
||||||
},
|
|
||||||
});
|
|
||||||
}
|
|
||||||
this.attrFormSubmitting = false;
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
closeAttrForm() {
|
|
||||||
this.attrFormVisible = false;
|
|
||||||
},
|
|
||||||
|
|
||||||
handleClick(raw) {
|
|
||||||
if (raw.type === 'delete') {
|
|
||||||
this.$confirm(`确定删除该参数?`, '提示', {
|
|
||||||
confirmButtonText: '确定',
|
|
||||||
cancelButtonText: '取消',
|
|
||||||
type: 'warning',
|
|
||||||
})
|
|
||||||
.then(() => {
|
|
||||||
deleteProductAttr(raw.data.id).then(({ data }) => {
|
|
||||||
this.$message({
|
|
||||||
message: '操作成功',
|
|
||||||
type: 'success',
|
|
||||||
duration: 1500,
|
|
||||||
onClose: () => {
|
|
||||||
this.getList();
|
|
||||||
},
|
|
||||||
});
|
|
||||||
});
|
|
||||||
})
|
|
||||||
.catch(() => {});
|
|
||||||
} else {
|
|
||||||
this.addNew(raw.data.id);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped>
|
|
||||||
.drawer >>> .el-drawer {
|
|
||||||
border-radius: 8px 0 0 8px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.drawer >>> .el-drawer__header {
|
|
||||||
margin: 0;
|
|
||||||
padding: 32px 32px 24px;
|
|
||||||
border-bottom: 1px solid #dcdfe6;
|
|
||||||
margin-bottom: 0px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.small-title::before {
|
|
||||||
content: '';
|
|
||||||
display: inline-block;
|
|
||||||
vertical-align: top;
|
|
||||||
width: 4px;
|
|
||||||
height: 22px;
|
|
||||||
border-radius: 1px;
|
|
||||||
margin-right: 8px;
|
|
||||||
background-color: #0b58ff;
|
|
||||||
}
|
|
||||||
|
|
||||||
.drawer-body {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.drawer-body__content {
|
|
||||||
flex: 1;
|
|
||||||
/* background: #eee; */
|
|
||||||
padding: 20px 30px;
|
|
||||||
overflow-y: auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
.drawer-body__footer {
|
|
||||||
display: flex;
|
|
||||||
justify-content: flex-end;
|
|
||||||
padding: 18px;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,100 +0,0 @@
|
|||||||
/*
|
|
||||||
* @Author: zwq
|
|
||||||
* @Date: 2022-08-24 11:19:43
|
|
||||||
* @LastEditors: zhp
|
|
||||||
* @LastEditTime: 2023-12-13 15:52:53
|
|
||||||
* @Description:
|
|
||||||
*/
|
|
||||||
export default {
|
|
||||||
data() {
|
|
||||||
/* eslint-disable */
|
|
||||||
return {
|
|
||||||
urlOptions: {
|
|
||||||
createURL: '',
|
|
||||||
updateURL: '',
|
|
||||||
infoURL: '',
|
|
||||||
codeURL: '',
|
|
||||||
getOption: false,
|
|
||||||
isGetCode: false,
|
|
||||||
optionArrUrl: [],
|
|
||||||
optionArr: {}
|
|
||||||
},
|
|
||||||
visible: false,
|
|
||||||
setData: false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
created() {
|
|
||||||
},
|
|
||||||
activated() {
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
init(id) {
|
|
||||||
this.dataForm.id = id || "";
|
|
||||||
this.visible = true;
|
|
||||||
if (this.urlOptions.getOption) {
|
|
||||||
this.getArr()
|
|
||||||
}
|
|
||||||
this.$nextTick(() => {
|
|
||||||
this.$refs["dataForm"].resetFields();
|
|
||||||
if (this.dataForm.id) {
|
|
||||||
this.urlOptions.infoURL(id).then(response => {
|
|
||||||
this.dataForm = response.data
|
|
||||||
if (this.setData) {
|
|
||||||
this.setDataForm()
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
if (this.urlOptions.isGetCode) {
|
|
||||||
this.getCode()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
getCode() {
|
|
||||||
this.urlOptions.codeURL()
|
|
||||||
.then(({ data: res }) => {
|
|
||||||
this.dataForm.code = res;
|
|
||||||
})
|
|
||||||
.catch(() => {});
|
|
||||||
},
|
|
||||||
getArr() {
|
|
||||||
const params = {
|
|
||||||
pageSize: 100,
|
|
||||||
pageNo: 1,
|
|
||||||
}
|
|
||||||
this.urlOptions.optionArrUrl.forEach((item, index) => {
|
|
||||||
item(params).then(({ data: res }) => {
|
|
||||||
this.$set(this.urlOptions.optionArr, `arr${index}`, res.list)
|
|
||||||
})
|
|
||||||
.catch(() => {
|
|
||||||
});
|
|
||||||
});
|
|
||||||
},
|
|
||||||
// 表单提交
|
|
||||||
dataFormSubmit() {
|
|
||||||
this.$refs["dataForm"].validate((valid) => {
|
|
||||||
if (!valid) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
// 修改的提交
|
|
||||||
if (this.dataForm.id) {
|
|
||||||
this.urlOptions.updateURL(this.dataForm).then(response => {
|
|
||||||
this.$modal.msgSuccess("修改成功");
|
|
||||||
this.visible = false;
|
|
||||||
this.$emit("refreshDataList");
|
|
||||||
});
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
// 添加的提交
|
|
||||||
this.urlOptions.createURL(this.dataForm).then(response => {
|
|
||||||
this.$modal.msgSuccess("新增成功");
|
|
||||||
this.visible = false;
|
|
||||||
this.$emit("refreshDataList");
|
|
||||||
});
|
|
||||||
});
|
|
||||||
},
|
|
||||||
formClear() {
|
|
||||||
this.$refs.dataForm.resetFields()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,85 +0,0 @@
|
|||||||
/*
|
|
||||||
* @Author: zhp
|
|
||||||
* @Date: 2023-09-11 16:18:44
|
|
||||||
* @LastEditTime: 2023-09-12 14:25:01
|
|
||||||
* @LastEditors: zhp
|
|
||||||
* @Description:
|
|
||||||
*/
|
|
||||||
import Mock from 'mockjs';
|
|
||||||
|
|
||||||
const baseURL = 'http://192.168.1.188:48080/admin-api';
|
|
||||||
|
|
||||||
Mock.setup({
|
|
||||||
timeout: 200,
|
|
||||||
});
|
|
||||||
|
|
||||||
// @database
|
|
||||||
const list = Mock.mock({
|
|
||||||
'data|1-10': [
|
|
||||||
{
|
|
||||||
'id|+1': 1,
|
|
||||||
productionLine: (options) => {
|
|
||||||
// console.log('otpsion', options.context.currentContext);
|
|
||||||
return `EQ${options.context.currentContext.id}`;
|
|
||||||
},
|
|
||||||
workshopSection: ({ context: { currentContext } }) =>
|
|
||||||
`EQ${currentContext.id}_WS${Mock.Random.integer(1, 10)}`,
|
|
||||||
equipmentName: ({ context: { currentContext } }) =>
|
|
||||||
`设备${currentContext.id}`,
|
|
||||||
equipmentCode: ({ context: { currentContext } }) =>
|
|
||||||
`${currentContext.equipmentName}_Code`,
|
|
||||||
plcCode: ({ context: { currentContext } }) =>
|
|
||||||
`PLC_TABLE_CODE_${currentContext.id}`,
|
|
||||||
plcTableName: ({ context: { currentContext } }) =>
|
|
||||||
`PLC_TABLE_${currentContext.id}`,
|
|
||||||
plcName: ({ context: { currentContext } }) => `PLC_${currentContext.id}`,
|
|
||||||
'bindingParameters|1-10': 1,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
});
|
|
||||||
|
|
||||||
// @page
|
|
||||||
Mock.mock(
|
|
||||||
RegExp(baseURL + '/base/equipment-plc-connect/page' + '.*'),
|
|
||||||
'get',
|
|
||||||
(options) => {
|
|
||||||
console.log('[Mock url]', options.url, list);
|
|
||||||
return {
|
|
||||||
code: 0,
|
|
||||||
data: {
|
|
||||||
list: list.data,
|
|
||||||
total: list.data.length,
|
|
||||||
},
|
|
||||||
};
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
// @create
|
|
||||||
Mock.mock(baseURL + '/base/equipment-plc-connect/create', 'post', (options) => {
|
|
||||||
console.log('options', options);
|
|
||||||
const { url, type, body } = options;
|
|
||||||
const newItem = JSON.parse(body);
|
|
||||||
list.data.push(newItem);
|
|
||||||
return {
|
|
||||||
code: 0,
|
|
||||||
data: null,
|
|
||||||
msg: 'success',
|
|
||||||
};
|
|
||||||
});
|
|
||||||
|
|
||||||
// @update
|
|
||||||
Mock.mock(
|
|
||||||
baseURL + '/admin-api/base/equipment-plc-connect/update',
|
|
||||||
'put',
|
|
||||||
(options) => {
|
|
||||||
const { url, type, body } = options;
|
|
||||||
const { id } = JSON.parse(body);
|
|
||||||
const newItem = list.data.find((item) => item.id == id);
|
|
||||||
newItem = { ...newItem, ...JSON.parse(body) };
|
|
||||||
return {
|
|
||||||
code: 0,
|
|
||||||
msg: 'success',
|
|
||||||
data: null,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
);
|
|
||||||
@@ -1,535 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div class="app-container">
|
|
||||||
<!-- 搜索工作栏 -->
|
|
||||||
<SearchBar
|
|
||||||
:formConfigs="searchBarFormConfig"
|
|
||||||
ref="search-bar"
|
|
||||||
@headBtnClick="handleSearchBarBtnClick" />
|
|
||||||
|
|
||||||
<!-- 列表 -->
|
|
||||||
<base-table
|
|
||||||
:table-props="tableProps"
|
|
||||||
:page="queryParams.pageNo"
|
|
||||||
:limit="queryParams.pageSize"
|
|
||||||
:table-data="list"
|
|
||||||
@emitFun="handleEmitFun">
|
|
||||||
<method-btn
|
|
||||||
v-if="tableBtn.length"
|
|
||||||
slot="handleBtn"
|
|
||||||
label="操作"
|
|
||||||
:width="120"
|
|
||||||
:method-list="tableBtn"
|
|
||||||
@clickBtn="handleTableBtnClick" />
|
|
||||||
</base-table>
|
|
||||||
|
|
||||||
<!-- 分页组件 -->
|
|
||||||
<pagination
|
|
||||||
v-show="total > 0"
|
|
||||||
:total="total"
|
|
||||||
:page.sync="queryParams.pageNo"
|
|
||||||
:limit.sync="queryParams.pageSize"
|
|
||||||
@pagination="getList" />
|
|
||||||
|
|
||||||
<!-- 对话框(添加 / 修改) -->
|
|
||||||
<base-dialog
|
|
||||||
:dialogTitle="title"
|
|
||||||
:dialogVisible="open"
|
|
||||||
width="700px"
|
|
||||||
@close="cancel"
|
|
||||||
@cancel="cancel"
|
|
||||||
@confirm="submitForm">
|
|
||||||
<DialogForm v-if="open" ref="form" v-model="form" :rows="rows" />
|
|
||||||
</base-dialog>
|
|
||||||
|
|
||||||
<!-- 抽屉 详情 -->
|
|
||||||
<BasicDrawer
|
|
||||||
v-if="editVisible"
|
|
||||||
ref="drawer"
|
|
||||||
:default-mode="editMode"
|
|
||||||
:info-data="alarmForm"
|
|
||||||
:sections="[
|
|
||||||
{
|
|
||||||
name: '基本信息',
|
|
||||||
key: 'base',
|
|
||||||
rows: drawerBaseInfoRows,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: '属性列表',
|
|
||||||
key: 'attrs',
|
|
||||||
props: drawerListProps,
|
|
||||||
url: '/base/equipment-plc-param/page',
|
|
||||||
urlCreate: '/base/equipment-plc-param/create',
|
|
||||||
urlUpdate: '/base/equipment-plc-param/update',
|
|
||||||
urlDelete: '/base/equipment-plc-param/delete',
|
|
||||||
urlDetail: '/base/equipment-plc-param/get',
|
|
||||||
queryParams: {
|
|
||||||
connectId: alarmForm.id,
|
|
||||||
pageNo: 1,
|
|
||||||
pageSize: 10,
|
|
||||||
},
|
|
||||||
tableBtn: [
|
|
||||||
this.$auth.hasPermi('base:equipment-plc-param:update')
|
|
||||||
? {
|
|
||||||
type: 'edit',
|
|
||||||
btnName: '修改',
|
|
||||||
}
|
|
||||||
: undefined,
|
|
||||||
this.$auth.hasPermi('base:equipment-plc-param:delete')
|
|
||||||
? {
|
|
||||||
type: 'delete',
|
|
||||||
btnName: '删除',
|
|
||||||
}
|
|
||||||
: undefined,
|
|
||||||
].filter((v) => v),
|
|
||||||
allowAdd: true,
|
|
||||||
},
|
|
||||||
]"
|
|
||||||
@refreshDataList="getList"
|
|
||||||
@cancel="editVisible = false"
|
|
||||||
@destroy="editVisible = false" />
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import {
|
|
||||||
createEquipmentPlcConnect,
|
|
||||||
updateEquipmentPlcConnect,
|
|
||||||
deleteEquipmentPlcConnect,
|
|
||||||
getEquipmentPlcConnect,
|
|
||||||
getEquipmentPlcConnectPage,
|
|
||||||
exportEquipmentPlcConnectExcel,
|
|
||||||
} from '@/api/base/equipmentPlcConnect';
|
|
||||||
import moment from 'moment';
|
|
||||||
import basicPageMixin from '@/mixins/lb/basicPageMixin';
|
|
||||||
// import './http';
|
|
||||||
import BasicDrawer from './components/BasicDrawer.vue';
|
|
||||||
import { publicFormatter } from '@/utils/dict';
|
|
||||||
|
|
||||||
export default {
|
|
||||||
name: 'EquipmentPlcConnect',
|
|
||||||
mixins: [basicPageMixin],
|
|
||||||
components: { BasicDrawer },
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
searchBarKeys: ['equipmentId', 'plcId'],
|
|
||||||
// tableBtn: [
|
|
||||||
// this.$auth.hasPermi('base:equipment-plc:update')
|
|
||||||
// ? {
|
|
||||||
// type: 'edit',
|
|
||||||
// btnName: '修改',
|
|
||||||
// }
|
|
||||||
// : undefined,
|
|
||||||
// this.$auth.hasPermi('base:equipment-plc:delete')
|
|
||||||
// ? {
|
|
||||||
// type: 'delete',
|
|
||||||
// btnName: '删除',
|
|
||||||
// }
|
|
||||||
// : undefined,
|
|
||||||
// ].filter((v) => v),
|
|
||||||
tableBtn: [
|
|
||||||
{
|
|
||||||
type: 'detail',
|
|
||||||
btnName: '参数绑定',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: 'edit',
|
|
||||||
btnName: '修改',
|
|
||||||
},
|
|
||||||
// {
|
|
||||||
// type: 'params-bind',
|
|
||||||
// btnName: '参数绑定',
|
|
||||||
// },
|
|
||||||
{
|
|
||||||
type: 'delete',
|
|
||||||
btnName: '删除',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
tableProps: [
|
|
||||||
// {
|
|
||||||
// prop: 'createTime',
|
|
||||||
// label: '添加时间',
|
|
||||||
// fixed: true,
|
|
||||||
// width: 180,
|
|
||||||
// filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'),
|
|
||||||
// },
|
|
||||||
{ prop: 'productionLine', label: '产线' },
|
|
||||||
{ prop: 'workshopSection', label: '工段' },
|
|
||||||
{ prop: 'equipmentName', label: '设备名' },
|
|
||||||
{ prop: 'equipmentCode', label: '设备编码' },
|
|
||||||
{ prop: 'plcCode', label: '关联表编码' },
|
|
||||||
{ prop: 'plcTableName', label: '关联表名' },
|
|
||||||
{ prop: 'plcName', label: '标识名称' },
|
|
||||||
{ prop: 'bindingParameters', label: '绑定参数数量' },
|
|
||||||
// {
|
|
||||||
// _action: 'params-bind',
|
|
||||||
// label: '查看绑定',
|
|
||||||
// subcomponent: {
|
|
||||||
// props: ['injectData'],
|
|
||||||
// render: function (h) {
|
|
||||||
// const _this = this;
|
|
||||||
// return h(
|
|
||||||
// 'el-button',
|
|
||||||
// {
|
|
||||||
// props: { type: 'text' },
|
|
||||||
// on: {
|
|
||||||
// click: function () {
|
|
||||||
// console.log('inejctdata', _this.injectData);
|
|
||||||
// _this.$emit('emitData', {
|
|
||||||
// action: _this.injectData._action,
|
|
||||||
// payload: _this.injectData,
|
|
||||||
// });
|
|
||||||
// },
|
|
||||||
// },
|
|
||||||
// },
|
|
||||||
// '查看绑定'
|
|
||||||
// );
|
|
||||||
// },
|
|
||||||
// },
|
|
||||||
// },
|
|
||||||
],
|
|
||||||
searchBarFormConfig: [
|
|
||||||
{
|
|
||||||
type: 'select',
|
|
||||||
label: '设备名',
|
|
||||||
placeholder: '请选择设备',
|
|
||||||
param: 'equipmentId',
|
|
||||||
selectOptions: [],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: 'select',
|
|
||||||
label: '编码',
|
|
||||||
placeholder: '请选择编码',
|
|
||||||
param: 'plcId',
|
|
||||||
selectOptions: [],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: 'button',
|
|
||||||
btnName: '查询',
|
|
||||||
name: 'search',
|
|
||||||
color: 'primary',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: 'separate',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
// type: this.$auth.hasPermi('base:equipment-plc:create')
|
|
||||||
// ? 'button'
|
|
||||||
// : '',
|
|
||||||
type: 'button',
|
|
||||||
btnName: '新增',
|
|
||||||
name: 'add',
|
|
||||||
plain: true,
|
|
||||||
color: 'success',
|
|
||||||
},
|
|
||||||
// {
|
|
||||||
// type: this.$auth.hasPermi('base:equipment-plc:export') ? 'button' : '',
|
|
||||||
// btnName: '导出',
|
|
||||||
// name: 'export',
|
|
||||||
// color: 'warning',
|
|
||||||
// },
|
|
||||||
],
|
|
||||||
rows: [
|
|
||||||
[
|
|
||||||
{
|
|
||||||
select: true,
|
|
||||||
label: '关联表名',
|
|
||||||
prop: 'plcId',
|
|
||||||
labelKey: `plcTableName`,
|
|
||||||
url: '/base/equipment-plc/listAll',
|
|
||||||
rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
|
||||||
bind: {
|
|
||||||
filterable: true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
|
||||||
[
|
|
||||||
{
|
|
||||||
select: true,
|
|
||||||
label: '设备',
|
|
||||||
prop: 'equipmentId',
|
|
||||||
url: '/base/equipment/page?pageNo=1&pageSize=99',
|
|
||||||
rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
|
||||||
bind: {
|
|
||||||
filterable: true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
|
||||||
],
|
|
||||||
open: false,
|
|
||||||
// 查询参数
|
|
||||||
queryParams: {
|
|
||||||
pageNo: 1,
|
|
||||||
pageSize: 10,
|
|
||||||
plcId: null,
|
|
||||||
equipmentId: null,
|
|
||||||
},
|
|
||||||
// 表单参数
|
|
||||||
form: {},
|
|
||||||
// 查看绑定配置
|
|
||||||
editVisible: false,
|
|
||||||
editMode: '',
|
|
||||||
drawerBaseInfoRows: [
|
|
||||||
[
|
|
||||||
{
|
|
||||||
input: true,
|
|
||||||
label: '设备名',
|
|
||||||
prop: 'equipmentName',
|
|
||||||
rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
|
||||||
// bind: {
|
|
||||||
// disabled: this.editMode == 'detail', // some condition, like detail mode...
|
|
||||||
// }
|
|
||||||
},
|
|
||||||
{
|
|
||||||
input: true,
|
|
||||||
label: '关联表名',
|
|
||||||
prop: 'plcTableName',
|
|
||||||
// url: '/base/equipment/getCode',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
],
|
|
||||||
drawerListProps: [
|
|
||||||
{ prop: 'plcParamName', label: '参数列名' },
|
|
||||||
{ prop: 'name', label: '参数名称' },
|
|
||||||
{
|
|
||||||
prop: 'unit',
|
|
||||||
label: '单位',
|
|
||||||
filter: publicFormatter('unit_dict'),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: 'equipmentParamType',
|
|
||||||
label: '设备参数类型',
|
|
||||||
filter: (val) =>
|
|
||||||
val != null
|
|
||||||
? ['', '一般参数', '工艺参数', '报警参数', ''][val]
|
|
||||||
: '-',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: 'productionParamType',
|
|
||||||
label: '生产参数类型',
|
|
||||||
filter: (val) =>
|
|
||||||
val != null
|
|
||||||
? // ? ['', '进片数量', '出片数量', '破损数量', '无类型', ''][val]
|
|
||||||
['', '进口计数', '出口计数', '损耗计数', '无类型', ''][val]
|
|
||||||
: '-',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: 'collection',
|
|
||||||
label: '是否采集',
|
|
||||||
filter: (val) => (val != null ? ['否', '是'][val] : '-'),
|
|
||||||
},
|
|
||||||
{ prop: 'minValue', label: '最小值' },
|
|
||||||
{ prop: 'maxValue', label: '最大值' },
|
|
||||||
{ prop: 'defaultValue', label: '标准值' },
|
|
||||||
{ prop: 'description', label: '描述' },
|
|
||||||
{ prop: 'remark', label: '备注' },
|
|
||||||
],
|
|
||||||
alarmForm: {
|
|
||||||
id: undefined,
|
|
||||||
equipmentName: undefined,
|
|
||||||
plcTableName: undefined,
|
|
||||||
},
|
|
||||||
};
|
|
||||||
},
|
|
||||||
created() {
|
|
||||||
this.getList();
|
|
||||||
this.initSearchOptions();
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
async getEquipmentOptions() {
|
|
||||||
const res = await this.$axios({
|
|
||||||
url: '/base/equipment/listAll',
|
|
||||||
method: 'get',
|
|
||||||
});
|
|
||||||
return res.data;
|
|
||||||
},
|
|
||||||
|
|
||||||
async getPlcOptions() {
|
|
||||||
const res = await this.$axios({
|
|
||||||
url: '/base/equipment-plc/listAll',
|
|
||||||
method: 'get',
|
|
||||||
});
|
|
||||||
return res.data;
|
|
||||||
},
|
|
||||||
|
|
||||||
/** 初始化查询条件 */
|
|
||||||
async initSearchOptions() {
|
|
||||||
Promise.all([this.getEquipmentOptions(), this.getPlcOptions()]).then(
|
|
||||||
([eqList, plcList]) => {
|
|
||||||
this.searchBarFormConfig[0].selectOptions = eqList.map((item) => {
|
|
||||||
return {
|
|
||||||
name: item.name,
|
|
||||||
id: item.id,
|
|
||||||
};
|
|
||||||
});
|
|
||||||
this.searchBarFormConfig[1].selectOptions = plcList.map((item) => {
|
|
||||||
return {
|
|
||||||
name: item.name,
|
|
||||||
id: item.id,
|
|
||||||
};
|
|
||||||
});
|
|
||||||
}
|
|
||||||
);
|
|
||||||
},
|
|
||||||
/** 覆盖 handleEmitFun 的默认实现 */
|
|
||||||
handleEmitFun({ action, payload }) {
|
|
||||||
switch (action) {
|
|
||||||
case 'params-bind':
|
|
||||||
this.reset();
|
|
||||||
const {
|
|
||||||
id,
|
|
||||||
equipmentName,
|
|
||||||
equipmentId,
|
|
||||||
plcId,
|
|
||||||
plcName,
|
|
||||||
plcTableName,
|
|
||||||
} = payload;
|
|
||||||
// console.log('Cha看绑定参数弹窗', id, equipmentName, plcTableName);
|
|
||||||
this.$router.push({
|
|
||||||
name: 'EquipmentPlcParam',
|
|
||||||
params: {
|
|
||||||
id,
|
|
||||||
equipmentName,
|
|
||||||
plcTableName,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
/** 查询列表 */
|
|
||||||
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();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
// 查看报警
|
|
||||||
handleDetail(row) {
|
|
||||||
// debugger;
|
|
||||||
const {
|
|
||||||
id,
|
|
||||||
bindingParameters,
|
|
||||||
equipmentCode,
|
|
||||||
equipmentId,
|
|
||||||
equipmentName,
|
|
||||||
plcCode,
|
|
||||||
plcId,
|
|
||||||
plcName,
|
|
||||||
plcTableName,
|
|
||||||
productionLine,
|
|
||||||
workshopSection,
|
|
||||||
} = row;
|
|
||||||
// 打开抽屉
|
|
||||||
this.editMode = 'detail';
|
|
||||||
this.alarmForm.id = id;
|
|
||||||
this.alarmForm.plcTableName = plcTableName; // 关联表名
|
|
||||||
this.alarmForm.equipmentName = equipmentName;
|
|
||||||
this.editVisible = true;
|
|
||||||
this.$nextTick(() => {
|
|
||||||
this.$refs['drawer'].init();
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
/** 删除按钮操作 */
|
|
||||||
handleDelete(row) {
|
|
||||||
const id = row.id;
|
|
||||||
this.$modal
|
|
||||||
.confirm('是否删除该配置?')
|
|
||||||
.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>
|
|
||||||
@@ -1,561 +0,0 @@
|
|||||||
<!--
|
|
||||||
filename: CollectionConfig.vue
|
|
||||||
author: liubin
|
|
||||||
date: 2023-10-30 10:09:03
|
|
||||||
description:
|
|
||||||
-->
|
|
||||||
|
|
||||||
<template>
|
|
||||||
<div class="app-container">
|
|
||||||
<!-- 搜索工作栏 -->
|
|
||||||
<SearchBar
|
|
||||||
:formConfigs="searchBarFormConfig"
|
|
||||||
ref="search-bar"
|
|
||||||
@headBtnClick="handleSearchBarBtnClick" />
|
|
||||||
|
|
||||||
<!-- 列表 -->
|
|
||||||
<base-table
|
|
||||||
:table-props="tableProps"
|
|
||||||
:page="queryParams.pageNo"
|
|
||||||
:limit="queryParams.pageSize"
|
|
||||||
:table-data="list"
|
|
||||||
@emitFun="handleEmitFun"
|
|
||||||
:max-height="tableH">
|
|
||||||
<method-btn
|
|
||||||
v-if="tableBtn.length"
|
|
||||||
slot="handleBtn"
|
|
||||||
label="操作"
|
|
||||||
:width="120"
|
|
||||||
:method-list="tableBtn"
|
|
||||||
@clickBtn="handleTableBtnClick" />
|
|
||||||
</base-table>
|
|
||||||
|
|
||||||
<!-- 分页组件 -->
|
|
||||||
<pagination
|
|
||||||
v-show="total > 0"
|
|
||||||
:total="total"
|
|
||||||
:page.sync="queryParams.pageNo"
|
|
||||||
:limit.sync="queryParams.pageSize"
|
|
||||||
@pagination="getList" />
|
|
||||||
|
|
||||||
<!-- 对话框(添加 / 修改) -->
|
|
||||||
<base-dialog
|
|
||||||
:dialogTitle="title"
|
|
||||||
:dialogVisible="open"
|
|
||||||
width="30%"
|
|
||||||
@close="cancel"
|
|
||||||
@cancel="cancel"
|
|
||||||
@confirm="submitForm">
|
|
||||||
<!-- <DialogForm v-if="open" ref="form" v-model="form" :rows="rows" /> -->
|
|
||||||
<add-or-update
|
|
||||||
ref="addOrUpdate"
|
|
||||||
@refreshDataList="successSubmit" />
|
|
||||||
</base-dialog>
|
|
||||||
|
|
||||||
<!-- 抽屉 详情 -->
|
|
||||||
<BasicDrawer
|
|
||||||
v-if="editVisible"
|
|
||||||
ref="drawer"
|
|
||||||
size="45%"
|
|
||||||
:default-mode="editMode"
|
|
||||||
:info-data="alarmForm"
|
|
||||||
:sections="[
|
|
||||||
{
|
|
||||||
name: '基本信息',
|
|
||||||
key: 'base',
|
|
||||||
rows: drawerBaseInfoRows,
|
|
||||||
url: '/base/equipment-plc-connect/get',
|
|
||||||
urlUpdate: '/base/equipment-plc-connect/update',
|
|
||||||
urlCreate: '/base/equipment-plc-connect/create',
|
|
||||||
queryParams: { id: alarmForm.id },
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: '采集参数',
|
|
||||||
key: 'attrs',
|
|
||||||
props: drawerListProps,
|
|
||||||
url: '/base/equipment-plc-param/page',
|
|
||||||
urlCreate: '/base/equipment-plc-param/create',
|
|
||||||
urlUpdate: '/base/equipment-plc-param/update',
|
|
||||||
urlDelete: '/base/equipment-plc-param/delete',
|
|
||||||
urlDetail: '/base/equipment-plc-param/get',
|
|
||||||
queryParams: {
|
|
||||||
connectId: alarmForm.id,
|
|
||||||
pageNo: 1,
|
|
||||||
pageSize: 10,
|
|
||||||
},
|
|
||||||
tableBtn: [
|
|
||||||
{
|
|
||||||
type: 'edit',
|
|
||||||
btnName: '修改',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: 'delete',
|
|
||||||
btnName: '删除',
|
|
||||||
},
|
|
||||||
// this.$auth.hasPermi('equipment:collection-config-param:update')
|
|
||||||
// ? {
|
|
||||||
// type: 'edit',
|
|
||||||
// btnName: '修改',
|
|
||||||
// }
|
|
||||||
// : undefined,
|
|
||||||
// this.$auth.hasPermi('equipment:collection-config-param:delete')
|
|
||||||
// ? {
|
|
||||||
// type: 'delete',
|
|
||||||
// btnName: '删除',
|
|
||||||
// }
|
|
||||||
// : undefined,
|
|
||||||
].filter((v) => v),
|
|
||||||
allowAdd: true,
|
|
||||||
},
|
|
||||||
]"
|
|
||||||
@refreshDataList="getList"
|
|
||||||
@cancel="editVisible = false"
|
|
||||||
@destroy="editVisible = false" />
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import {
|
|
||||||
createEquipmentPlcConnect,
|
|
||||||
updateEquipmentPlcConnect,
|
|
||||||
deleteEquipmentPlcConnect,
|
|
||||||
getEquipmentPlcConnect,
|
|
||||||
getEquipmentPlcConnectPage,
|
|
||||||
exportEquipmentPlcConnectExcel,
|
|
||||||
} from '@/api/base/equipmentPlcConnect';
|
|
||||||
import basicPageMixin from '@/mixins/lb/basicPageMixin';
|
|
||||||
// import './http';
|
|
||||||
import BasicDrawer from './components/BasicDrawer.vue';
|
|
||||||
import { publicFormatter } from '@/utils/dict';
|
|
||||||
import AddOrUpdate from './add-or-updata';
|
|
||||||
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
|
|
||||||
|
|
||||||
export default {
|
|
||||||
name: 'EquipmentPlcConnect',
|
|
||||||
mixins: [basicPageMixin, tableHeightMixin],
|
|
||||||
components: { BasicDrawer, AddOrUpdate },
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
searchBarKeys: ['equipmentId', 'plcId'],
|
|
||||||
// tableBtn: [
|
|
||||||
// ].filter((v) => v),
|
|
||||||
tableBtn: [
|
|
||||||
this.$auth.hasPermiAnd([
|
|
||||||
'base:equipment-plc-connect:query',
|
|
||||||
'base:equipment-plc-param:query'
|
|
||||||
])
|
|
||||||
? {
|
|
||||||
type: 'detail',
|
|
||||||
btnName: '参数绑定',
|
|
||||||
} : undefined,
|
|
||||||
this.$auth.hasPermiAnd([
|
|
||||||
'base:equipment-plc-connect:update',
|
|
||||||
'base:equipment-plc-connect:query',
|
|
||||||
'base:equipment-plc-param:create',
|
|
||||||
'base:equipment-plc-param:update',
|
|
||||||
'base:equipment-plc-param:delete',
|
|
||||||
'base:equipment-plc-param:query'
|
|
||||||
])
|
|
||||||
? {
|
|
||||||
type: 'edit',
|
|
||||||
btnName: '修改',
|
|
||||||
}
|
|
||||||
: undefined,
|
|
||||||
this.$auth.hasPermi('base:equipment-plc-connect:delete')
|
|
||||||
? {
|
|
||||||
type: 'delete',
|
|
||||||
btnName: '删除',
|
|
||||||
}
|
|
||||||
: undefined,
|
|
||||||
].filter((v) => v),
|
|
||||||
tableProps: [
|
|
||||||
{ prop: 'productionLine', label: '产线', minWidth: 120, showOverflowtooltip: true },
|
|
||||||
{ prop: 'workshopSection', label: '工段', minWidth: 120, showOverflowtooltip: true },
|
|
||||||
{ prop: 'equipmentName', label: '设备名', minWidth: 120, showOverflowtooltip: true },
|
|
||||||
{ prop: 'equipmentCode', label: '设备编码', minWidth: 200, showOverflowtooltip: true },
|
|
||||||
{ prop: 'plcCode', label: '关联表编码', minWidth: 220, showOverflowtooltip: true },
|
|
||||||
{ prop: 'plcTableName', label: '关联表名', minWidth: 150, showOverflowtooltip: true },
|
|
||||||
{ prop: 'plcName', label: '标识名称', minWidth: 150, showOverflowtooltip: true },
|
|
||||||
{ prop: 'bindingParameters', label: '绑定参数数量', minWidth: 120, showOverflowtooltip: true },
|
|
||||||
// {
|
|
||||||
// _action: 'params-bind',
|
|
||||||
// label: '查看绑定',
|
|
||||||
// subcomponent: {
|
|
||||||
// props: ['injectData'],
|
|
||||||
// render: function (h) {
|
|
||||||
// const _this = this;
|
|
||||||
// return h(
|
|
||||||
// 'el-button',
|
|
||||||
// {
|
|
||||||
// props: { type: 'text' },
|
|
||||||
// on: {
|
|
||||||
// click: function () {
|
|
||||||
// console.log('inejctdata', _this.injectData);
|
|
||||||
// _this.$emit('emitData', {
|
|
||||||
// action: _this.injectData._action,
|
|
||||||
// payload: _this.injectData,
|
|
||||||
// });
|
|
||||||
// },
|
|
||||||
// },
|
|
||||||
// },
|
|
||||||
// '查看绑定'
|
|
||||||
// );
|
|
||||||
// },
|
|
||||||
// },
|
|
||||||
// },
|
|
||||||
],
|
|
||||||
searchBarFormConfig: [
|
|
||||||
{
|
|
||||||
type: 'select',
|
|
||||||
label: '设备名',
|
|
||||||
placeholder: '请选择设备',
|
|
||||||
param: 'equipmentId',
|
|
||||||
selectOptions: [],
|
|
||||||
filterable: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: 'select',
|
|
||||||
label: '关联表编码',
|
|
||||||
placeholder: '请选择关联表编码',
|
|
||||||
param: 'plcId',
|
|
||||||
selectOptions: [],
|
|
||||||
filterable: true,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: 'button',
|
|
||||||
btnName: '查询',
|
|
||||||
name: 'search',
|
|
||||||
color: 'primary',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: this.$auth.hasPermi('base:equipment-plc-connect:create')
|
|
||||||
? 'separate' : '',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: this.$auth.hasPermi('base:equipment-plc-connect:create')
|
|
||||||
? 'button'
|
|
||||||
: '',
|
|
||||||
// type: 'button',
|
|
||||||
btnName: '新增',
|
|
||||||
name: 'add',
|
|
||||||
plain: true,
|
|
||||||
color: 'success',
|
|
||||||
},
|
|
||||||
// {
|
|
||||||
// type: this.$auth.hasPermi('equipment:collection-config:export') ? 'button' : '',
|
|
||||||
// btnName: '导出',
|
|
||||||
// name: 'export',
|
|
||||||
// color: 'warning',
|
|
||||||
// },
|
|
||||||
],
|
|
||||||
rows: [
|
|
||||||
[
|
|
||||||
{
|
|
||||||
select: true,
|
|
||||||
label: '关联表名',
|
|
||||||
prop: 'plcId',
|
|
||||||
labelKey: `plcTableName`,
|
|
||||||
url: '/base/equipment-plc/listAll',
|
|
||||||
rules: [
|
|
||||||
{ required: true, message: '关联表名不能为空', trigger: 'blur' },
|
|
||||||
],
|
|
||||||
bind: {
|
|
||||||
filterable: true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
|
||||||
[
|
|
||||||
{
|
|
||||||
select: true,
|
|
||||||
label: '设备',
|
|
||||||
prop: 'equipmentId',
|
|
||||||
url: '/base/core-equipment/page?pageNo=1&pageSize=99',
|
|
||||||
rules: [
|
|
||||||
{ required: true, message: '设备不能为空', trigger: 'blur' },
|
|
||||||
],
|
|
||||||
bind: {
|
|
||||||
filterable: true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
|
||||||
],
|
|
||||||
open: false,
|
|
||||||
// 查询参数
|
|
||||||
queryParams: {
|
|
||||||
pageNo: 1,
|
|
||||||
pageSize: 20,
|
|
||||||
plcId: null,
|
|
||||||
equipmentId: null,
|
|
||||||
},
|
|
||||||
// 表单参数
|
|
||||||
form: {},
|
|
||||||
// 查看绑定配置
|
|
||||||
editVisible: false,
|
|
||||||
editMode: '',
|
|
||||||
drawerBaseInfoRows: [
|
|
||||||
[
|
|
||||||
{
|
|
||||||
input: true,
|
|
||||||
label: '设备名',
|
|
||||||
prop: 'equipmentName',
|
|
||||||
rules: [
|
|
||||||
{ required: true, message: '设备名不能为空', trigger: 'blur' },
|
|
||||||
],
|
|
||||||
// bind: {
|
|
||||||
// disabled: this.editMode == 'detail', // some condition, like detail mode...
|
|
||||||
// }
|
|
||||||
},
|
|
||||||
{
|
|
||||||
input: true,
|
|
||||||
label: '关联表名',
|
|
||||||
prop: 'plcTableName',
|
|
||||||
// url: '/base/core-equipment/getCode',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
],
|
|
||||||
drawerListProps: [
|
|
||||||
{ prop: 'plcParamName', label: '参数列名' },
|
|
||||||
{ prop: 'name', label: '参数名称' },
|
|
||||||
{
|
|
||||||
prop: 'unit',
|
|
||||||
label: '单位',
|
|
||||||
filter: publicFormatter('unit_dict'),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: 'equipmentParamType',
|
|
||||||
label: '设备参数类型',
|
|
||||||
filter: (val) =>
|
|
||||||
val != null
|
|
||||||
? ['', '一般参数', '工艺参数', '报警参数', ''][val]
|
|
||||||
: '-',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: 'productionParamType',
|
|
||||||
label: '生产参数类型',
|
|
||||||
filter: (val) =>
|
|
||||||
val != null
|
|
||||||
? // ? ['', '进片数量', '出片数量', '破损数量', '无类型', ''][val]
|
|
||||||
['', '进口计数', '出口计数', '损耗计数', '无类型', ''][val]
|
|
||||||
: '-',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: 'collection',
|
|
||||||
label: '是否采集',
|
|
||||||
filter: (val) => (val != null ? ['否', '是'][val] : '-'),
|
|
||||||
},
|
|
||||||
{ prop: 'minValue', label: '最小值' },
|
|
||||||
{ prop: 'maxValue', label: '最大值' },
|
|
||||||
{ prop: 'defaultValue', label: '标准值' },
|
|
||||||
{ prop: 'description', label: '描述' },
|
|
||||||
{ prop: 'remark', label: '备注' },
|
|
||||||
],
|
|
||||||
alarmForm: {
|
|
||||||
id: undefined,
|
|
||||||
equipmentName: undefined,
|
|
||||||
plcTableName: undefined,
|
|
||||||
},
|
|
||||||
};
|
|
||||||
},
|
|
||||||
created() {
|
|
||||||
this.getList();
|
|
||||||
this.initSearchOptions();
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
successSubmit() {
|
|
||||||
this.cancel()
|
|
||||||
this.getList()
|
|
||||||
},
|
|
||||||
async getEquipmentOptions() {
|
|
||||||
const res = await this.$axios({
|
|
||||||
url: '/base/equipment/listAll',
|
|
||||||
method: 'get',
|
|
||||||
});
|
|
||||||
return res.data;
|
|
||||||
},
|
|
||||||
async getPlcOptions() {
|
|
||||||
const res = await this.$axios({
|
|
||||||
url: '/base/equipment-plc/listAll',
|
|
||||||
method: 'get',
|
|
||||||
});
|
|
||||||
return res.data;
|
|
||||||
},
|
|
||||||
|
|
||||||
/** 初始化查询条件 */
|
|
||||||
async initSearchOptions() {
|
|
||||||
Promise.all([this.getEquipmentOptions(), this.getPlcOptions()]).then(
|
|
||||||
([eqList, plcList]) => {
|
|
||||||
this.searchBarFormConfig[0].selectOptions = eqList.map((item) => {
|
|
||||||
return {
|
|
||||||
name: item.name,
|
|
||||||
id: item.id,
|
|
||||||
};
|
|
||||||
});
|
|
||||||
this.searchBarFormConfig[1].selectOptions = plcList.map((item) => {
|
|
||||||
return {
|
|
||||||
name: item.code,
|
|
||||||
id: item.id,
|
|
||||||
};
|
|
||||||
});
|
|
||||||
}
|
|
||||||
);
|
|
||||||
},
|
|
||||||
/** 覆盖 handleEmitFun 的默认实现 */
|
|
||||||
handleEmitFun({ action, payload }) {
|
|
||||||
switch (action) {
|
|
||||||
case 'params-bind':
|
|
||||||
this.reset();
|
|
||||||
const {
|
|
||||||
id,
|
|
||||||
equipmentName,
|
|
||||||
equipmentId,
|
|
||||||
plcId,
|
|
||||||
plcName,
|
|
||||||
plcTableName,
|
|
||||||
} = payload;
|
|
||||||
// console.log('Cha看绑定参数弹窗', id, equipmentName, plcTableName);
|
|
||||||
this.$router.push({
|
|
||||||
name: 'EquipmentPlcParam',
|
|
||||||
params: {
|
|
||||||
id,
|
|
||||||
equipmentName,
|
|
||||||
plcTableName,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
/** 查询列表 */
|
|
||||||
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');
|
|
||||||
},
|
|
||||||
handleTableBtnClick({ data, type }) {
|
|
||||||
switch (type) {
|
|
||||||
case 'edit':
|
|
||||||
this.handleDetail(data, 'edit');
|
|
||||||
break;
|
|
||||||
case 'delete':
|
|
||||||
this.handleDelete(data);
|
|
||||||
break;
|
|
||||||
case 'detail':
|
|
||||||
this.handleDetail(data);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
/** 搜索按钮操作 */
|
|
||||||
handleQuery() {
|
|
||||||
this.queryParams.pageNo = 1;
|
|
||||||
this.getList();
|
|
||||||
},
|
|
||||||
/** 重置按钮操作 */
|
|
||||||
resetQuery() {
|
|
||||||
this.resetForm('queryForm');
|
|
||||||
this.handleQuery();
|
|
||||||
},
|
|
||||||
/** 新增按钮操作 */
|
|
||||||
handleAdd() {
|
|
||||||
this.reset();
|
|
||||||
this.open = true;
|
|
||||||
this.title = '添加设备采集配置';
|
|
||||||
this.$nextTick(() => {
|
|
||||||
this.$refs.addOrUpdate.init()
|
|
||||||
})
|
|
||||||
},
|
|
||||||
/** 修改按钮操作 */
|
|
||||||
handleUpdate(row) {
|
|
||||||
this.reset();
|
|
||||||
const id = row.id;
|
|
||||||
getEquipmentPlcConnect(id).then((response) => {
|
|
||||||
this.form = response.data;
|
|
||||||
this.open = true;
|
|
||||||
this.title = '修改设备采集配置';
|
|
||||||
});
|
|
||||||
},
|
|
||||||
/** 提交按钮 */
|
|
||||||
submitForm() {
|
|
||||||
this.$refs.addOrUpdate.dataFormSubmit()
|
|
||||||
},
|
|
||||||
|
|
||||||
// 查看报警
|
|
||||||
handleDetail(row, mode = 'detail') {
|
|
||||||
// debugger;
|
|
||||||
const {
|
|
||||||
id,
|
|
||||||
bindingParameters,
|
|
||||||
equipmentCode,
|
|
||||||
equipmentId,
|
|
||||||
equipmentName,
|
|
||||||
plcCode,
|
|
||||||
plcId,
|
|
||||||
plcName,
|
|
||||||
plcTableName,
|
|
||||||
productionLine,
|
|
||||||
workshopSection,
|
|
||||||
} = row;
|
|
||||||
// 打开抽屉
|
|
||||||
this.editMode = mode;
|
|
||||||
this.alarmForm.id = id;
|
|
||||||
this.alarmForm.plcTableName = plcTableName; // 关联表名
|
|
||||||
this.alarmForm.equipmentName = equipmentName;
|
|
||||||
this.editVisible = true;
|
|
||||||
this.$nextTick(() => {
|
|
||||||
this.$refs['drawer'].init();
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
/** 删除按钮操作 */
|
|
||||||
handleDelete(row) {
|
|
||||||
const id = row.id;
|
|
||||||
this.$modal
|
|
||||||
.confirm('是否删除该配置?')
|
|
||||||
.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>
|
|
||||||
@@ -1,452 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div class="app-container">
|
|
||||||
<!-- 搜索工作栏 -->
|
|
||||||
<SearchBar
|
|
||||||
:formConfigs="searchBarFormConfig"
|
|
||||||
ref="search-bar"
|
|
||||||
@headBtnClick="handleSearchBarBtnClick" />
|
|
||||||
|
|
||||||
<!-- 列表 -->
|
|
||||||
<base-table
|
|
||||||
:table-props="tableProps"
|
|
||||||
:page="queryParams.pageNo"
|
|
||||||
:limit="queryParams.pageSize"
|
|
||||||
:table-data="list"
|
|
||||||
@emitFun="handleEmitFun">
|
|
||||||
<method-btn
|
|
||||||
v-if="tableBtn.length"
|
|
||||||
slot="handleBtn"
|
|
||||||
label="操作"
|
|
||||||
:width="120"
|
|
||||||
:method-list="tableBtn"
|
|
||||||
@clickBtn="handleTableBtnClick" />
|
|
||||||
</base-table>
|
|
||||||
|
|
||||||
<!-- 分页组件 -->
|
|
||||||
<pagination
|
|
||||||
v-show="total > 0"
|
|
||||||
:total="total"
|
|
||||||
:page.sync="queryParams.pageNo"
|
|
||||||
:limit.sync="queryParams.pageSize"
|
|
||||||
@pagination="getList" />
|
|
||||||
|
|
||||||
<!-- 对话框(添加 / 修改) -->
|
|
||||||
<base-dialog
|
|
||||||
:dialogTitle="title"
|
|
||||||
:dialogVisible="open"
|
|
||||||
width="700px"
|
|
||||||
@close="cancel"
|
|
||||||
@cancel="cancel"
|
|
||||||
@confirm="submitForm">
|
|
||||||
<DialogForm v-if="open" ref="form" v-model="form" :rows="rows" />
|
|
||||||
</base-dialog>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import {
|
|
||||||
createEquipmentPlcParam,
|
|
||||||
updateEquipmentPlcParam,
|
|
||||||
deleteEquipmentPlcParam,
|
|
||||||
getEquipmentPlcParam,
|
|
||||||
getEquipmentPlcParamPage,
|
|
||||||
exportEquipmentPlcParamExcel,
|
|
||||||
} from '@/api/base/equipmentPlcParam';
|
|
||||||
import moment from 'moment';
|
|
||||||
import basicPageMixin from '@/mixins/lb/basicPageMixin';
|
|
||||||
import { publicFormatter } from '@/utils/dict';
|
|
||||||
|
|
||||||
export default {
|
|
||||||
name: 'EquipmentPlcParam',
|
|
||||||
mixins: [basicPageMixin],
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
tableProps: [
|
|
||||||
// {
|
|
||||||
// prop: 'createTime',
|
|
||||||
// label: '添加时间',
|
|
||||||
// fixed: true,
|
|
||||||
// width: 180,
|
|
||||||
// filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'),
|
|
||||||
// },
|
|
||||||
{ prop: 'plcParamName', label: '参数列名' },
|
|
||||||
{ prop: 'name', label: '参数名称' },
|
|
||||||
{
|
|
||||||
prop: 'unit',
|
|
||||||
label: '单位',
|
|
||||||
filter: publicFormatter('unit_dict'),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: 'collection',
|
|
||||||
label: '是否采集',
|
|
||||||
filter: (val) => (val != null ? ['否', '是'][val] : '-'),
|
|
||||||
},
|
|
||||||
{ prop: 'minValue', label: '最小值' },
|
|
||||||
{ prop: 'maxValue', label: '最大值' },
|
|
||||||
{ prop: 'defaultValue', label: '标准值' },
|
|
||||||
{ prop: 'description', label: '描述' },
|
|
||||||
{ prop: 'remark', label: '备注' },
|
|
||||||
// {
|
|
||||||
// _action: 'params-bind',
|
|
||||||
// label: '查看绑定',
|
|
||||||
// ,
|
|
||||||
// subcomponent: {
|
|
||||||
// props: ['injectData'],
|
|
||||||
// render: function (h) {
|
|
||||||
// const _this = this;
|
|
||||||
// return h(
|
|
||||||
// 'el-button',
|
|
||||||
// {
|
|
||||||
// props: { type: 'text' },
|
|
||||||
// on: {
|
|
||||||
// click: function () {
|
|
||||||
// console.log('inejctdata', _this.injectData);
|
|
||||||
// _this.$emit('emitData', {
|
|
||||||
// action: _this.injectData._action,
|
|
||||||
// payload: _this.injectData,
|
|
||||||
// });
|
|
||||||
// },
|
|
||||||
// },
|
|
||||||
// },
|
|
||||||
// '查看绑定'
|
|
||||||
// );
|
|
||||||
// },
|
|
||||||
// },
|
|
||||||
// },
|
|
||||||
],
|
|
||||||
rows: [
|
|
||||||
[
|
|
||||||
{
|
|
||||||
input: true,
|
|
||||||
label: '参数列名',
|
|
||||||
prop: 'plcParamName',
|
|
||||||
rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
input: true,
|
|
||||||
label: '参数名称',
|
|
||||||
prop: 'name',
|
|
||||||
rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
|
||||||
},
|
|
||||||
],
|
|
||||||
[
|
|
||||||
{
|
|
||||||
select: true,
|
|
||||||
label: '单位',
|
|
||||||
prop: 'unit',
|
|
||||||
options: this.getDictDatas(this.DICT_TYPE.UNIT_DICT),
|
|
||||||
// rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
switch: true,
|
|
||||||
label: '是否采集',
|
|
||||||
prop: 'collection',
|
|
||||||
bind: {
|
|
||||||
'active-value': 1,
|
|
||||||
'inactive-value': 0,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
|
||||||
[
|
|
||||||
{
|
|
||||||
input: true,
|
|
||||||
label: '最小值',
|
|
||||||
prop: 'minValue',
|
|
||||||
rules: [
|
|
||||||
{
|
|
||||||
type: 'number',
|
|
||||||
message: '请输入正确的数字',
|
|
||||||
trigger: 'change',
|
|
||||||
transform: (val) => Number(val),
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
input: true,
|
|
||||||
label: '最大值',
|
|
||||||
prop: 'maxValue',
|
|
||||||
rules: [
|
|
||||||
{
|
|
||||||
required: false,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: 'number',
|
|
||||||
message: '请输入正确的数字',
|
|
||||||
trigger: 'change',
|
|
||||||
transform: (val) => Number(val),
|
|
||||||
},
|
|
||||||
],
|
|
||||||
// rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
|
||||||
},
|
|
||||||
],
|
|
||||||
[
|
|
||||||
{
|
|
||||||
input: true,
|
|
||||||
label: '标准值',
|
|
||||||
prop: 'defaultValue',
|
|
||||||
// rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
input: true,
|
|
||||||
label: '描述',
|
|
||||||
prop: 'description',
|
|
||||||
// rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
|
||||||
},
|
|
||||||
],
|
|
||||||
[
|
|
||||||
{
|
|
||||||
input: true,
|
|
||||||
label: '备注',
|
|
||||||
prop: 'remark',
|
|
||||||
// rules: [{ required: true, message: '不能为空', trigger: 'blur' }],
|
|
||||||
},
|
|
||||||
],
|
|
||||||
],
|
|
||||||
open: false,
|
|
||||||
// 查询参数
|
|
||||||
queryParams: {
|
|
||||||
pageNo: 1,
|
|
||||||
pageSize: 10,
|
|
||||||
connectId: null,
|
|
||||||
},
|
|
||||||
// 表单参数
|
|
||||||
form: {},
|
|
||||||
connectId: null,
|
|
||||||
equipmentName: '',
|
|
||||||
plcTableName: '',
|
|
||||||
searchBarFormConfig: [
|
|
||||||
{
|
|
||||||
type: 'input',
|
|
||||||
label: '设备名',
|
|
||||||
disabled: true,
|
|
||||||
param: 'equipmentName',
|
|
||||||
defaultSelect: '',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: 'input',
|
|
||||||
label: '关联表名',
|
|
||||||
disabled: true,
|
|
||||||
param: 'plcName',
|
|
||||||
defaultSelect: '',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type:
|
|
||||||
this.$auth.hasPermi('base:equipment-plc-param:create') &&
|
|
||||||
!this.isDetailPage
|
|
||||||
? 'button'
|
|
||||||
: '',
|
|
||||||
btnName: '新增',
|
|
||||||
name: 'add',
|
|
||||||
plain: true,
|
|
||||||
color: 'success',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
};
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
isDetailPage() {
|
|
||||||
return this.$route.params.detail === true;
|
|
||||||
},
|
|
||||||
tableBtn() {
|
|
||||||
return [
|
|
||||||
this.$auth.hasPermi('base:equipment-plc-param:update') &&
|
|
||||||
!this.isDetailPage
|
|
||||||
? {
|
|
||||||
type: 'edit',
|
|
||||||
btnName: '修改',
|
|
||||||
}
|
|
||||||
: undefined,
|
|
||||||
this.$auth.hasPermi('base:equipment-plc-param:delete') &&
|
|
||||||
!this.isDetailPage
|
|
||||||
? {
|
|
||||||
type: 'delete',
|
|
||||||
btnName: '删除',
|
|
||||||
}
|
|
||||||
: undefined,
|
|
||||||
].filter((v) => v);
|
|
||||||
},
|
|
||||||
// searchBarFormConfig() {
|
|
||||||
// console.log(
|
|
||||||
// 'ers',
|
|
||||||
// JSON.stringify({ eid: this.equipmentName, plc: this.plcTableName })
|
|
||||||
// );
|
|
||||||
// return [
|
|
||||||
// {
|
|
||||||
// type: 'input',
|
|
||||||
// label: '设备名',
|
|
||||||
// disabled: true,
|
|
||||||
// param: 'equipmentName',
|
|
||||||
// defaultSelect: this.equipmentName,
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// type: 'input',
|
|
||||||
// label: '关联表名',
|
|
||||||
// disabled: true,
|
|
||||||
// param: 'plcName',
|
|
||||||
// defaultSelect: this.plcTableName,
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// type:
|
|
||||||
// this.$auth.hasPermi('base:equipment-plc-param:create') &&
|
|
||||||
// !this.isDetailPage
|
|
||||||
// ? 'button'
|
|
||||||
// : '',
|
|
||||||
// btnName: '新增',
|
|
||||||
// name: 'add',
|
|
||||||
// plain: true,
|
|
||||||
// color: 'success',
|
|
||||||
// },
|
|
||||||
// ];
|
|
||||||
// },
|
|
||||||
},
|
|
||||||
activated() {
|
|
||||||
console.log('activated,,,');
|
|
||||||
// 设置顶部搜索栏信息
|
|
||||||
const { equipmentName, id: connectId, plcTableName } = this.$route.params;
|
|
||||||
// this.equipmentName = equipmentName;
|
|
||||||
// this.plcTableName = plcTableName;
|
|
||||||
this.setSearchBarFormValue('equipmentName', equipmentName);
|
|
||||||
this.setSearchBarFormValue('plcName', plcTableName);
|
|
||||||
this.queryParams.connectId = connectId;
|
|
||||||
// if (!equipmentGroupId) this.getList(); // 拦截
|
|
||||||
this.getList();
|
|
||||||
},
|
|
||||||
deactivated() {
|
|
||||||
console.log('deactivated,,,');
|
|
||||||
this.setSearchBarFormValue('equipmentName', '');
|
|
||||||
this.setSearchBarFormValue('plcName', '');
|
|
||||||
// this.equipmentName = null;
|
|
||||||
// this.plcTableName = null;
|
|
||||||
this.queryParams.connectId = null;
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
/** 设置 searchBarForm 的默认值 - 用得比较少 */
|
|
||||||
setSearchBarFormValue(param, value) {
|
|
||||||
this.searchBarFormConfig.forEach((config) => {
|
|
||||||
if (config.param == param) {
|
|
||||||
config.defaultSelect = value;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
/** 查询列表 */
|
|
||||||
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: null,
|
|
||||||
maxValue: null,
|
|
||||||
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,
|
|
||||||
connectId: this.queryParams.connectId,
|
|
||||||
}).then((response) => {
|
|
||||||
this.$modal.msgSuccess('修改成功');
|
|
||||||
this.open = false;
|
|
||||||
this.getList();
|
|
||||||
});
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
// 添加的提交
|
|
||||||
createEquipmentPlcParam({
|
|
||||||
...this.form,
|
|
||||||
connectId: this.queryParams.connectId,
|
|
||||||
}).then((response) => {
|
|
||||||
this.$modal.msgSuccess('新增成功');
|
|
||||||
this.open = false;
|
|
||||||
this.getList();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
},
|
|
||||||
/** 删除按钮操作 */
|
|
||||||
handleDelete(row) {
|
|
||||||
const id = row.id;
|
|
||||||
this.$modal
|
|
||||||
.confirm('是否确认删除"' + row.name + '"的参数绑定?')
|
|
||||||
.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>
|
|
||||||
@@ -1,277 +0,0 @@
|
|||||||
<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>
|
|
||||||
@@ -1,276 +0,0 @@
|
|||||||
<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>
|
|
||||||
@@ -1,289 +0,0 @@
|
|||||||
<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>
|
|
||||||
@@ -1,296 +0,0 @@
|
|||||||
<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>
|
|
||||||
@@ -1,229 +0,0 @@
|
|||||||
<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>
|
|
||||||
@@ -1,94 +0,0 @@
|
|||||||
<!--
|
|
||||||
* @Author: zwq
|
|
||||||
* @Date: 2023-08-01 13:52:10
|
|
||||||
* @LastEditors: zwq
|
|
||||||
* @LastEditTime: 2024-04-10 09:30:06
|
|
||||||
* @Description:
|
|
||||||
-->
|
|
||||||
<template>
|
|
||||||
<el-form
|
|
||||||
:model="dataForm"
|
|
||||||
:rules="dataRule"
|
|
||||||
ref="dataForm"
|
|
||||||
v-if="visible"
|
|
||||||
@keyup.enter.native="dataFormSubmit()"
|
|
||||||
label-width="100px"
|
|
||||||
label-position="top">
|
|
||||||
<el-row :gutter="20">
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="原料名称" prop="name">
|
|
||||||
<el-input v-model="dataForm.name" clearable
|
|
||||||
placeholder="请输入原料名称" />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="原料等级" prop="level">
|
|
||||||
<el-input v-model="dataForm.level" clearable
|
|
||||||
placeholder="请输入原料等级" />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="原料编码" prop="code">
|
|
||||||
<el-input v-model="dataForm.code" readonly />
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="12">
|
|
||||||
<el-form-item label="单位" prop="unit">
|
|
||||||
<el-select
|
|
||||||
v-model="dataForm.unit"
|
|
||||||
filterable
|
|
||||||
clearable
|
|
||||||
:style="{ width: '100%' }"
|
|
||||||
placeholder="请选择单位">
|
|
||||||
<el-option
|
|
||||||
v-for="item in urlOptions.dictArr.dict0"
|
|
||||||
:key="item.id"
|
|
||||||
:label="item.label"
|
|
||||||
:value="item.value"></el-option>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
</el-form>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import basicAdd from '@/mixins/basic-add';
|
|
||||||
import {
|
|
||||||
createMaterial,
|
|
||||||
updateMaterial,
|
|
||||||
getMaterial,
|
|
||||||
getCode
|
|
||||||
} from '@/api/base/material';
|
|
||||||
|
|
||||||
export default {
|
|
||||||
mixins: [basicAdd],
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
urlOptions: {
|
|
||||||
createURL: createMaterial,
|
|
||||||
updateURL: updateMaterial,
|
|
||||||
infoURL: getMaterial,
|
|
||||||
codeURL: getCode, //获取code接口(返回结果为dataForm.code字段)
|
|
||||||
dictNameList: ['unit_dict'], //数据字典name数组
|
|
||||||
},
|
|
||||||
dataForm: {
|
|
||||||
id: undefined,
|
|
||||||
code: '',
|
|
||||||
name: '',
|
|
||||||
unit: '',
|
|
||||||
level: '',
|
|
||||||
},
|
|
||||||
dataRule: {
|
|
||||||
name: [
|
|
||||||
{ required: true, message: '原料不能为空', trigger: 'blur' },
|
|
||||||
],
|
|
||||||
code: [{ required: true, message: '编码不能为空', trigger: 'blur' }],
|
|
||||||
},
|
|
||||||
};
|
|
||||||
},
|
|
||||||
created() {},
|
|
||||||
methods: {
|
|
||||||
},
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
@@ -1,180 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div class="app-container">
|
|
||||||
<!-- 搜索工作栏 -->
|
|
||||||
<search-bar
|
|
||||||
:formConfigs="formConfig"
|
|
||||||
ref="searchBarForm"
|
|
||||||
@headBtnClick="buttonClick" />
|
|
||||||
|
|
||||||
<!-- 列表 -->
|
|
||||||
<base-table
|
|
||||||
v-loading="dataListLoading"
|
|
||||||
:table-props="tableProps"
|
|
||||||
:page="listQuery.pageNo"
|
|
||||||
:limit="listQuery.pageSize"
|
|
||||||
:table-data="tableData">
|
|
||||||
<method-btn
|
|
||||||
v-if="tableBtn.length"
|
|
||||||
slot="handleBtn"
|
|
||||||
:width="90"
|
|
||||||
label="操作"
|
|
||||||
:method-list="tableBtn"
|
|
||||||
@clickBtn="handleClick" />
|
|
||||||
</base-table>
|
|
||||||
<pagination
|
|
||||||
:limit.sync="listQuery.pageSize"
|
|
||||||
:page.sync="listQuery.pageNo"
|
|
||||||
:total="listQuery.total"
|
|
||||||
@pagination="getDataList" />
|
|
||||||
|
|
||||||
<!-- 对话框(添加 / 修改) -->
|
|
||||||
<base-dialog
|
|
||||||
:dialogTitle="addOrEditTitle"
|
|
||||||
:dialogVisible="addOrUpdateVisible"
|
|
||||||
@cancel="handleCancel"
|
|
||||||
@confirm="handleConfirm"
|
|
||||||
:before-close="handleCancel"
|
|
||||||
width="40%">
|
|
||||||
<add-or-update
|
|
||||||
ref="addOrUpdate"
|
|
||||||
@refreshDataList="successSubmit"></add-or-update>
|
|
||||||
</base-dialog>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import AddOrUpdate from './add-or-updata';
|
|
||||||
import basicPage from '@/mixins/basic-page';
|
|
||||||
import { parseTime } from '@/filter/code-filter';
|
|
||||||
import { publicFormatter } from "@/utils/dict";
|
|
||||||
import {
|
|
||||||
deleteMaterial,
|
|
||||||
getMaterialPage,
|
|
||||||
} from '@/api/base/material';
|
|
||||||
|
|
||||||
const tableProps = [
|
|
||||||
{
|
|
||||||
prop: 'createTime',
|
|
||||||
label: '添加时间',
|
|
||||||
filter: parseTime,
|
|
||||||
minWidth: 150
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: 'name',
|
|
||||||
label: '原料名称',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: 'code',
|
|
||||||
label: '原料编码',
|
|
||||||
width: 180,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
prop: 'unit',
|
|
||||||
label: '单位',
|
|
||||||
filter: publicFormatter('unit_dict'),
|
|
||||||
},
|
|
||||||
];
|
|
||||||
|
|
||||||
export default {
|
|
||||||
mixins: [basicPage],
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
urlOptions: {
|
|
||||||
getDataListURL: getMaterialPage,
|
|
||||||
deleteURL: deleteMaterial,
|
|
||||||
},
|
|
||||||
tableProps,
|
|
||||||
tableBtn: [
|
|
||||||
this.$auth.hasPermi(`base:material:update`)
|
|
||||||
? {
|
|
||||||
type: 'edit',
|
|
||||||
btnName: '编辑',
|
|
||||||
}
|
|
||||||
: undefined,
|
|
||||||
this.$auth.hasPermi(`base:material:delete`)
|
|
||||||
? {
|
|
||||||
type: 'delete',
|
|
||||||
btnName: '删除',
|
|
||||||
}
|
|
||||||
: undefined,
|
|
||||||
].filter((v) => v),
|
|
||||||
tableData: [],
|
|
||||||
formConfig: [
|
|
||||||
{
|
|
||||||
type: 'input',
|
|
||||||
label: '原料名称',
|
|
||||||
placeholder: '原料名称',
|
|
||||||
param: 'name'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: 'input',
|
|
||||||
label: '原料编码',
|
|
||||||
placeholder: '原料编码',
|
|
||||||
param: 'code'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: this.$auth.hasPermi('base:material:query')
|
|
||||||
? 'button'
|
|
||||||
: '',
|
|
||||||
btnName: '查询',
|
|
||||||
name: 'search',
|
|
||||||
color: 'primary',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type:
|
|
||||||
this.$auth.hasPermi('base:material:create') &&
|
|
||||||
this.$auth.hasPermi('base:material:query')
|
|
||||||
? 'separate'
|
|
||||||
: '',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: this.$auth.hasPermi('base:material:create')
|
|
||||||
? 'button'
|
|
||||||
: '',
|
|
||||||
btnName: '新增',
|
|
||||||
name: 'add',
|
|
||||||
color: 'success',
|
|
||||||
plain: true,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
};
|
|
||||||
},
|
|
||||||
components: {
|
|
||||||
AddOrUpdate,
|
|
||||||
},
|
|
||||||
created() {
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
buttonClick(val) {
|
|
||||||
switch (val.btnName) {
|
|
||||||
case 'search':
|
|
||||||
this.listQuery.pageNo = 1;
|
|
||||||
this.listQuery.pageSize = 10;
|
|
||||||
this.listQuery.name = val.name;
|
|
||||||
this.listQuery.code = val.code;
|
|
||||||
this.getDataList();
|
|
||||||
break;
|
|
||||||
case 'reset':
|
|
||||||
this.$refs.searchBarForm.resetForm();
|
|
||||||
this.listQuery = {
|
|
||||||
pageSize: 20,
|
|
||||||
pageNo: 1,
|
|
||||||
total: 1,
|
|
||||||
};
|
|
||||||
this.getDataList();
|
|
||||||
break;
|
|
||||||
case 'add':
|
|
||||||
this.addOrEditTitle = '新增';
|
|
||||||
this.addOrUpdateVisible = true;
|
|
||||||
this.addOrUpdateHandle();
|
|
||||||
break;
|
|
||||||
case 'export':
|
|
||||||
this.handleExport();
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
console.log(val);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||