| | |
| | | :type="getDeviceStatusType(scope.row.status)" |
| | | size="small" |
| | | > |
| | | <el-icon v-if="scope.row.status === '运行中'"><VideoPlay /></el-icon> |
| | | <el-icon v-if="String(scope.row.status) === '1'"><VideoPlay /></el-icon> |
| | | <el-icon v-else><VideoPause /></el-icon> |
| | | {{ scope.row.status || '未知' }} |
| | | {{ String(scope.row.status) === '1' ? '运行中' : '停止运行' }} |
| | | </el-tag> |
| | | </template> |
| | | </el-table-column> |
| | |
| | | <!-- 正常状态时显示对应的操作按钮 --> |
| | | <template v-else> |
| | | <el-button |
| | | v-if="scope.row.status === '运行中'" |
| | | v-if="String(scope.row.status) === '1'" |
| | | type="danger" |
| | | size="small" |
| | | @click="changeDeviceStatus(scope.row, '停止运行')" |
| | |
| | | // 根据设备状态筛选 |
| | | if (deviceFilter.value !== 'all') { |
| | | if (deviceFilter.value === 'start') { |
| | | filtered = filtered.filter(device => device.status === '运行中') |
| | | filtered = filtered.filter(device => String(device.status) === '1') |
| | | } else if (deviceFilter.value === 'stop') { |
| | | filtered = filtered.filter(device => device.status === '停止运行') |
| | | filtered = filtered.filter(device => String(device.status) === '0') |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | const statusStr = String(row?.status ?? '').trim() |
| | | const isRunning = statusStr === '运行中' || statusStr === '1' |
| | | const isRunning = statusStr === '1' |
| | | const endRaw = pickEndTime(row) |
| | | const hasEnd = hasMeaningfulEnd(endRaw) |
| | | |
| | |
| | | |
| | | // 检查设备是否超时未启动 |
| | | const isOverdue = (device) => { |
| | | if (!device.planRuntimeTime || device.status === '运行中' || device.startRuntimeTime) { |
| | | if (!device.planRuntimeTime || String(device.status) === '1' || device.startRuntimeTime) { |
| | | return false |
| | | } |
| | | |
| | |
| | | |
| | | // 更新设备状态和相关时间字段 |
| | | if (status === '启动运行') { |
| | | device.status = '运行中' |
| | | device.status = 1 |
| | | device.startRuntimeTime = currentTime |
| | | device.endRuntimeTime = null // 清空结束时间 |
| | | device.runtimeDuration = null // 清空运行时长 |
| | | } else { |
| | | device.status = '停止运行' |
| | | device.status = 0 |
| | | device.endRuntimeTime = currentTime |
| | | // 计算运行时长 |
| | | if (device.startRuntimeTime) { |
| | |
| | | } |
| | | |
| | | const getDeviceStatusType = (status) => { |
| | | if (status === '运行中') { |
| | | if (String(status) === '1') { |
| | | return 'success' |
| | | } else if (status === '停止运行') { |
| | | } else if (String(status) === '0') { |
| | | return 'danger' |
| | | } else { |
| | | return 'info' |