From 610ca8f2d8db20bf96c5b44e7769bde8cd2003d4 Mon Sep 17 00:00:00 2001
From: 86156 <823267011@qq.com>
Date: Mon, 3 Nov 2025 17:03:02 +0800
Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0web=E7=9A=84=E5=90=88?=
=?UTF-8?q?=E5=8D=B7=E5=88=86=E5=8D=B7=E5=90=88=E5=B9=B6=E6=93=8D=E4=BD=9C?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
apps/hand-factory/api/wms/pendingAction.js | 77 +++++++++
apps/hand-factory/components/lines/zinc2.vue | 104 ++++++------
apps/hand-factory/config.js | 4 +-
apps/hand-factory/pages/easycode/easycode.vue | 159 ++++++++++++++++--
4 files changed, 279 insertions(+), 65 deletions(-)
create mode 100644 apps/hand-factory/api/wms/pendingAction.js
diff --git a/apps/hand-factory/api/wms/pendingAction.js b/apps/hand-factory/api/wms/pendingAction.js
new file mode 100644
index 0000000..683886a
--- /dev/null
+++ b/apps/hand-factory/api/wms/pendingAction.js
@@ -0,0 +1,77 @@
+import request from '@/utils/request'
+
+// 查询钢卷待操作列表
+export function listPendingAction(query) {
+ return request({
+ url: '/wms/coilPendingAction/list',
+ method: 'get',
+ params: query
+ })
+}
+
+// 查询钢卷待操作详细
+export function getPendingAction(actionId) {
+ return request({
+ url: '/wms/coilPendingAction/' + actionId,
+ method: 'get'
+ })
+}
+
+// 新增钢卷待操作
+export function addPendingAction(data) {
+ return request({
+ url: '/wms/coilPendingAction',
+ method: 'post',
+ data: data
+ })
+}
+
+// 修改钢卷待操作
+export function updatePendingAction(data) {
+ return request({
+ url: '/wms/coilPendingAction',
+ method: 'put',
+ data: data
+ })
+}
+
+// 删除钢卷待操作
+export function delPendingAction(actionId) {
+ return request({
+ url: '/wms/coilPendingAction/' + actionId,
+ method: 'delete'
+ })
+}
+
+// 更新操作状态
+export function updateStatus(actionId, status) {
+ return request({
+ url: `/wms/coilPendingAction/status/${actionId}/${status}`,
+ method: 'put'
+ })
+}
+
+// 开始处理操作
+export function startProcess(actionId) {
+ return request({
+ url: `/wms/coilPendingAction/start/${actionId}`,
+ method: 'put'
+ })
+}
+
+// 完成操作
+export function completeAction(actionId) {
+ return request({
+ url: `/wms/coilPendingAction/complete/${actionId}`,
+ method: 'put'
+ })
+}
+
+// 取消操作
+export function cancelAction(actionId) {
+ return request({
+ url: `/wms/coilPendingAction/cancel/${actionId}`,
+ method: 'put'
+ })
+}
+
diff --git a/apps/hand-factory/components/lines/zinc2.vue b/apps/hand-factory/components/lines/zinc2.vue
index 84d7d11..5f683c0 100644
--- a/apps/hand-factory/components/lines/zinc2.vue
+++ b/apps/hand-factory/components/lines/zinc2.vue
@@ -2,8 +2,8 @@
-
-
+
⟳
-
-
+
+
网络状态
{{ webStatus[0].value }}
-
+
当前班组
{{ webStatus[1].value }}
-
+
更新时间
@@ -46,9 +46,9 @@
{{ item.label }}
{{ item.value }}
{{ item.unit }}
-
-
-
+
+
+
@@ -58,17 +58,17 @@
{{ item.label }}
{{ item.value }}
{{ item.unit }}
-
-
-
+
+
+
轧制力趋势
-
-
+
+
@@ -78,8 +78,8 @@
{{ item.label }}
{{ item.value }}
{{ item.unit }}
-
-
+
+
@@ -90,8 +90,8 @@
{{ item.label }}
{{ item.value }}
{{ item.unit }}
-
-
+
+
@@ -173,7 +173,7 @@ export default {
color: ["#0066cc", "#409eff", "#66b1ff", "#a0cfff", "#d9ecff", "#ecf5ff"],
padding: [15, 15, 0, 15],
enableScroll: false,
- legend: {
+ legend: {
show: true,
position: "top",
fontSize: 10,
@@ -208,42 +208,42 @@ export default {
plantStateDefines: []
};
},
-
+
mounted() {
this.loadAllData()
this.startAutoRefresh()
},
-
+
beforeDestroy() {
this.stopAutoRefresh()
},
-
+
methods: {
startAutoRefresh() {
this.refreshTimer = setInterval(() => {
this.refreshData(true)
}, 30000)
},
-
+
stopAutoRefresh() {
if (this.refreshTimer) {
clearInterval(this.refreshTimer)
this.refreshTimer = null
}
},
-
+
loadAllData() {
this.checkNetworkStatus()
this.loadCurrentShift()
this.initPlantStateDefines()
this.updateLastTime()
},
-
+
refreshData(isSilent = false) {
if (this.isRefreshing) return
this.isRefreshing = true
if (!isSilent) uni.showLoading({ title: '刷新中' })
-
+
Promise.all([
this.checkNetworkStatus(),
this.loadCurrentShift(),
@@ -257,7 +257,7 @@ export default {
this.updateLastTime()
})
},
-
+
updateLastTime() {
const now = new Date()
const hour = String(now.getHours()).padStart(2, '0')
@@ -265,7 +265,7 @@ export default {
const second = String(now.getSeconds()).padStart(2, '0')
this.lastUpdateTime = `${hour}:${minute}:${second}`
},
-
+
checkNetworkStatus() {
return new Promise((resolve) => {
const startTime = Date.now()
@@ -291,7 +291,7 @@ export default {
})
})
},
-
+
loadCurrentShift() {
return getCurrentShift().then(response => {
if (response.code === 200 && response.data) {
@@ -304,20 +304,20 @@ export default {
console.error('加载班组信息失败:', error)
})
},
-
+
getShiftName(shift) {
const shiftMap = { 'A': '早班', 'B': '中班', 'C': '晚班' }
return shiftMap[shift] || shift || '—'
},
-
+
getCrewName(crew) {
const crewMap = { 1: '甲', 2: '乙', 3: '丙', 4: '丁' }
return crewMap[crew] || crew || '—'
},
-
+
initPlantStateDefines(isSilent = false) {
if (!isSilent) uni.showLoading({ title: '加载中' })
-
+
return getAllPlantStateDefines().then(response => {
if (response.code === 200 && response.data) {
this.plantStateDefines = response.data
@@ -332,7 +332,7 @@ export default {
console.error('加载状态定义失败:', error)
})
},
-
+
updateCurrentMetrics() {
// 1. 轧辊速度(ID=36-41:rollSpeed1-6)
this.rollSpeedMetrics = [
@@ -343,7 +343,7 @@ export default {
{ label: '5#机架', value: this.formatValue(this.getDefineById(40)?.currentValue), unit: this.getDefineById(40)?.units || 'm/min' },
{ label: '6#机架', value: this.formatValue(this.getDefineById(41)?.currentValue), unit: this.getDefineById(41)?.units || 'm/min' }
]
-
+
// 2. 机架压下率(ID=24-29:reduc1-6)
this.reducMetrics = [
{ label: '1#机架', value: this.formatValue(this.getDefineById(24)?.currentValue), unit: this.getDefineById(24)?.units || '%' },
@@ -353,7 +353,7 @@ export default {
{ label: '5#机架', value: this.formatValue(this.getDefineById(28)?.currentValue), unit: this.getDefineById(28)?.units || '%' },
{ label: '6#机架', value: this.formatValue(this.getDefineById(29)?.currentValue), unit: this.getDefineById(29)?.units || '%' }
]
-
+
// 3. 带钢张力(ID=42-48:tensionForce0-6)
this.tensionMetrics = [
{ label: '0#张力', value: this.formatValue(this.getDefineById(42)?.currentValue), unit: this.getDefineById(42)?.units || 'kN' },
@@ -364,7 +364,7 @@ export default {
{ label: '5#张力', value: this.formatValue(this.getDefineById(47)?.currentValue), unit: this.getDefineById(47)?.units || 'kN' },
{ label: '6#张力', value: this.formatValue(this.getDefineById(48)?.currentValue), unit: this.getDefineById(48)?.units || 'kN' }
]
-
+
// 4. 功率百分比(ID=49-54:powerRatio1-6)
this.powerMetrics = [
{ label: '1#机架', value: this.formatValue(this.getDefineById(49)?.currentValue), unit: this.getDefineById(49)?.units || '%' },
@@ -375,11 +375,11 @@ export default {
{ label: '6#机架', value: this.formatValue(this.getDefineById(54)?.currentValue), unit: this.getDefineById(54)?.units || '%' }
]
},
-
+
loadForceHistory(isSilent = false) {
return listPlantStateHistory({ pageNum: 1, pageSize: 30 }).then(response => {
if (!isSilent) uni.hideLoading()
-
+
if (response.code === 200 && response.rows && response.rows.length > 0) {
const categories = []
const force1Data = []
@@ -388,7 +388,7 @@ export default {
const force4Data = []
const force5Data = []
const force6Data = []
-
+
response.rows.forEach(item => {
const dateStr = this.formatDate(item.insdate)
categories.push(dateStr)
@@ -399,10 +399,10 @@ export default {
force5Data.push(Number(item.value34) || 0) // ID=34
force6Data.push(Number(item.value35) || 0) // ID=35
})
-
+
this.forceChartData = {
categories: categories.reverse(),
- series: [
+ series: [
{ name: '1#轧制力', data: force1Data.reverse() },
{ name: '2#轧制力', data: force2Data.reverse() },
{ name: '3#轧制力', data: force3Data.reverse() },
@@ -417,11 +417,11 @@ export default {
console.error('加载轧制力历史失败:', error)
})
},
-
+
getDefineById(id) {
return this.plantStateDefines.find(item => item.id == id)
},
-
+
formatDate(dateStr) {
if (!dateStr) return ''
const date = new Date(dateStr)
@@ -429,7 +429,7 @@ export default {
const minute = String(date.getMinutes()).padStart(2, '0')
return `${hour}:${minute}`
},
-
+
formatValue(value) {
if (value === null || value === undefined || value === '') return '—'
const num = Number(value)
@@ -459,20 +459,20 @@ export default {
text-align: center;
padding: 28rpx 0;
position: relative;
-
+
.tab-label {
font-size: 28rpx;
color: #606266;
font-weight: 400;
}
-
+
&.tab-active {
.tab-label {
color: #0066cc;
font-weight: 500;
}
}
-
+
.tab-indicator {
position: absolute;
bottom: 0;
@@ -498,7 +498,7 @@ export default {
justify-content: center;
box-shadow: 0 8rpx 20rpx rgba(0, 102, 204, 0.4);
z-index: 999;
-
+
&:active {
opacity: 0.8;
transform: scale(0.95);
@@ -510,7 +510,7 @@ export default {
color: #fff;
display: block;
line-height: 1;
-
+
&.rotating {
animation: rotate 1s linear infinite;
}
@@ -555,7 +555,7 @@ export default {
font-size: 28rpx;
font-weight: 500;
color: #303133;
-
+
&.status-通畅 { color: #67c23a; }
&.status-卡顿 { color: #e6a23c; }
&.status-异常 { color: #f56c6c; }
diff --git a/apps/hand-factory/config.js b/apps/hand-factory/config.js
index 14fb220..b5f8e87 100644
--- a/apps/hand-factory/config.js
+++ b/apps/hand-factory/config.js
@@ -1,7 +1,7 @@
// 应用全局配置
module.exports = {
- // baseUrl: 'http://192.168.31.116:8080',
- baseUrl: 'http://140.143.206.120:8080',
+ baseUrl: 'http://192.168.31.116:8080',
+ // baseUrl: 'http://140.143.206.120:8080',
// baseUrl: 'http://localhost:8080',
// 应用信息
appInfo: {
diff --git a/apps/hand-factory/pages/easycode/easycode.vue b/apps/hand-factory/pages/easycode/easycode.vue
index 060f0e9..205ff62 100644
--- a/apps/hand-factory/pages/easycode/easycode.vue
+++ b/apps/hand-factory/pages/easycode/easycode.vue
@@ -2,11 +2,11 @@
操作类型选择
-
+
-
-
+