hsy
5 小时以前 2d3530a7c11557a40807ad7c0b9e302ce6ce3a9f
src/views/equipmentManagement/operationManagement/index.vue
@@ -61,9 +61,9 @@
              :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>
@@ -126,7 +126,7 @@
            <!-- 正常状态时显示对应的操作按钮 -->
            <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, '停止运行')"
@@ -186,9 +186,9 @@
  // 根据设备状态筛选
  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')
    }
  }
@@ -264,7 +264,7 @@
  }
  const statusStr = String(row?.status ?? '').trim()
  const isRunning = statusStr === '运行中' || statusStr === '1'
  const isRunning = statusStr === '1'
  const endRaw = pickEndTime(row)
  const hasEnd = hasMeaningfulEnd(endRaw)
@@ -289,7 +289,7 @@
// 检查设备是否超时未启动
const isOverdue = (device) => {
  if (!device.planRuntimeTime || device.status === '运行中' || device.startRuntimeTime) {
  if (!device.planRuntimeTime || String(device.status) === '1' || device.startRuntimeTime) {
    return false
  }
  
@@ -330,12 +330,12 @@
    
    // 更新设备状态和相关时间字段
    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) {
@@ -370,9 +370,9 @@
}
const getDeviceStatusType = (status) => {
  if (status === '运行中') {
  if (String(status) === '1') {
    return 'success'
  } else if (status === '停止运行') {
  } else if (String(status) === '0') {
    return 'danger'
  } else {
    return 'info'