This commit is contained in:
dev01 2023-01-12 18:22:24 +08:00
commit d3f3ff828e
4 changed files with 15 additions and 6 deletions

View File

@ -698,10 +698,10 @@
{ {
"title": "Ack 確認", "title": "Ack 確認",
"data": "ackState", "data": "ackState",
"render": function (data) { "render": function (data, type, row, meta) {
let confirm = data == "1" ? "未確認" : "確認"; let confirm = data == "1" ? "未確認" : "確認";
let btnCol = data == "1" ? "warning" : "info"; let btnCol = data == "1" ? "warning" : "info";
return `<td><a href="#" onclick="return false" class="btn btn-${btnCol}">${confirm}</a></td>` return data == "1" ? `<td><button onclick="chgAck('${row.uuid}')" class="btn btn-${btnCol}">${confirm}</button></td>` : `<td><button class="btn btn-${btnCol}">${confirm}</button></td>`;
} }
}, },
{ {
@ -848,4 +848,11 @@
} }
}, null, "POST").send(); }, null, "POST").send();
} }
function chgAck(devUuid) {
$.post(window.location.origin + '/obix/alarm/' + devUuid + '/ack', '<obj is="obix:AckAlarmIn"><str name="ackUser" val="obix" /></obj>', function () {
}, "text");
getData();
}
</script> </script>

View File

@ -269,7 +269,7 @@
new Date(start).getTime(), new Date(start).getTime(),
new Date(end).getTime(), new Date(end).getTime(),
pageAct.deviceName, pageAct.deviceName,
"Mitsubishi_Sup", "Mitsubishi_JACE8000",
callBackFromHistory); callBackFromHistory);
} }

View File

@ -11,6 +11,7 @@ using System.Collections.Generic;
using System.Data.SqlTypes; using System.Data.SqlTypes;
using System.IO; using System.IO;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Text;
namespace FrontendWebApi.ApiControllers namespace FrontendWebApi.ApiControllers
{ {

View File

@ -66,5 +66,6 @@ namespace FrontendWebApi.Models
public string alarmClass_txt { get; set; } public string alarmClass_txt { get; set; }
public string device_name { get; set; } public string device_name { get; set; }
public string errMsg { get; set; } public string errMsg { get; set; }
public string uuid { get; set; }
} }
} }