IPC-610
2025-01-02 d77d9ff80f5fd8cd70c775fbfc30dc27061bfad2
Web/src/views/device/alarmManage/index.vue
@@ -11,9 +11,10 @@
               <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="" >
               <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>
                     <el-button icon="ele-Check" size="small" text="" type="primary"
                        @click="topUpAlarm(scope.row)">恢复</el-button>
                  </template>
               </el-table-column>
            </el-table>
@@ -65,15 +66,18 @@
import { ElMessageBox, ElMessage } from "element-plus";
import { cellsDataLine, cellsDataOne, cellsDataTwo, cellsDataThree } from './data';
import { auth } from '/@/utils/authFunction';
import Index from '../deviceInfo/index.vue';
//连接signalR 监听变更
onMounted(async () => {
   signalR.off('PublicAlarm');
   signalR.on('PublicAlarm', (dataArray: any) => {
      dataArray.forEach(data => {
         console.log(data);
         console.log("1111111:"+data);
         // 更新 tableData
         const index = tableData.value.findIndex(t => t.id == data.id);
         console.log("2222222:"+index.value);
         if (index === -1 && data.status == 1) {
            // 如果不存在,添加新数据
            tableData.value.unshift(data);
@@ -195,7 +199,7 @@
//       row.Layer = 3;
//    }
//    row.TypeName = type;
//    console.log(row);
//    var res = await WriteInfo(row);
//    console.log(res.data.result);
@@ -203,22 +207,28 @@
// }
//报警恢复
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(() => { });
   ElMessageBox.confirm(`确定要报警恢复任务吗?`, "提示", {
      confirmButtonText: "确定",
      cancelButtonText: "取消",
      type: "warning",
   })
   .then(async () => {
      var param = Object.assign(row);
      console.log("row.stationNum:"+row.stationNum);
      console.log("layer.value:"+layer.value);
      var data = {
         LocatNo: row.stationNum,//工位
         Layer: layer.value,//楼层
      }
      var res = await WriteInfo(data);
      console.log("res.data.result:"+res.data.result);
      //   await topUpWcsTask(param);
      //   handleQuery();
      //   handleQuery2();
      // ElMessage.success("报警恢复失败:" + res.data.result);
   })
   .catch(() => { });
}