IPC-610
2024-10-30 8ea7380ee486d842bdd96824ac490ba53b454b58
Web/src/views/device/alarmManage/index.vue
@@ -11,6 +11,11 @@
               <el-table-column prop="alarmName" label="描述" align="center"></el-table-column>
               <el-table-column prop="stationNum" label="位置" align="center"></el-table-column>
               <el-table-column prop="alarmTime" label="时间" align="center"></el-table-column>
               <el-table-column label="操作" width="80" align="center" fixed="right" show-overflow-tooltip="" >
                  <template #default="scope">
                     <el-button icon="ele-Check" size="small" text="" type="primary" @click="topUpAlarm(scope.row)" >恢复</el-button>
                  </template>
               </el-table-column>
            </el-table>
            <el-pagination v-model:currentPage="tableParams.page" v-model:page-size="tableParams.pageSize"
               :total="tableParams.total" :page-sizes="[10, 20, 50, 100, 200, 500]" size="small" background=""
@@ -55,9 +60,11 @@
import { ref, reactive, onMounted, computed } from 'vue';
import 'splitpanes/dist/splitpanes.css';
import { listWcsAlarmInfo, resetWcsAlarmInfo } from '/@/api/wcs/wcsAlarmInfo';
import { WriteInfo } from '/@/api/wcs/wcsDevice';
import { signalR } from './signalR';
import { ElMessageBox, ElMessage } from "element-plus";
import { cellsDataLine, cellsDataOne, cellsDataTwo, cellsDataThree } from './data';
import { auth } from '/@/utils/authFunction';
//连接signalR 监听变更
onMounted(async () => {
@@ -84,7 +91,6 @@
               }
            }
         }
         // 更新输送线数据
         updateCellData(cellsDataOne.value, data);
         updateCellData(cellsDataTwo.value, data);
@@ -96,10 +102,11 @@
function updateCellData(cellsData: any[], data: any) {
   const foundCell = cellsData.find(cell => cell.Code === data.stationNum);
   if (foundCell) {
      //一个点位有一个信息报警就触发报警,取消报警需要确认这个点位没有任何报警信息
      if (data.status == 1) {
         foundCell.IsUse = 4;
      }
      else {
      else if (tableData.value.findIndex(c => c.stationNum == foundCell.Code) == -1) {
         foundCell.IsUse = 0;
      }
   }
@@ -177,6 +184,44 @@
      cellsData.value = cellsDataThree.value;
   }
}
// const write = async (type: string,row: any) => {
//    if (floorStates.value.isPlain1 == false) {
//       row.Layer = 1;
//    }else if(floorStates.value.isPlain2 == false){
//       row.Layer = 2;
//    }
//    else if(floorStates.value.isPlain3 == false){
//       row.Layer = 3;
//    }
//    row.TypeName = type;
//    console.log(row);
//    var res = await WriteInfo(row);
//    console.log(res.data.result);
//    ElMessage.success(res.data.result);
// }
//报警恢复
const topUpAlarm = async (row: any) => {
  ElMessageBox.confirm(`确定要报警恢复任务吗?`, "提示", {
    confirmButtonText: "确定",
    cancelButtonText: "取消",
    type: "warning",
  })
    .then(async () => {
      var param = Object.assign(row);
     console.log(row.stationNum);
     console.log(param);
    //   await topUpWcsTask(param);
    //   handleQuery();
    //   handleQuery2();
      ElMessage.success("置顶任务成功"+param);
    })
    .catch(() => { });
}
</script>
<style scoped>