YYC
2023-05-12 50e355f5da5c366c81a92cfdbce95b3c7ffdc1ae
igds-app/js/admin/warn-list.js
@@ -1,6 +1,6 @@
var url = null;
var dateTime;
var warnData = null;
var warnList = null;
var data = {
   "interfaceId": "5801",
   "tokenAuth": "",
@@ -34,7 +34,7 @@
   url = user.url + "/api-phone/v35/gateway";
   dateTime = getDate(new Date())
   $('#date').val(dateTime)
   document.getElementById("date").value = dateTime
   //获取警告记录
   getWarnList();
@@ -56,8 +56,8 @@
      data: JSON.stringify(data),
      success: function(result) {
         if (result.code == "0000") {
            warnData = result.data;
            console.log(warnData)
            warnList = result.data;
            console.log(warnList)
            renderWarn();
         } else {
            renderWarn();
@@ -149,13 +149,11 @@
//加减天数
function addAndReduceMonth(tag) {
   var date = new Date(dateTime);
   date = date.setDate(date.getDate() + tag);
   date = new Date(date);
   dateTime = getDate(date);
   $('#date').val(dateTime)
   document.getElementById("date").value = dateTime
   //获取警告记录
   getWarnList();
}
@@ -167,18 +165,15 @@
      // endDate: new Date(2016, 04, 25), //设置结束日期 
   })
   dtpicker.show(function(e) {
      dateTime = e.value;
      document.getElementById("date").value = e.value
      getWarnList();
   })
}
//渲染页面
function renderWarn() {
   var html = '';
   if (warnData) {
      var warnList = warnData.data;
      if (warnList && warnList.length > 0) {
         $.each(warnList, function(index, item) {
            html += '<li><div class="con myfancy" onclick="openPop(\'' + item.id + '\',\'' + (item.remark ==
@@ -218,12 +213,7 @@
         html +=
            '<li><div class="con myfancy" style="text-align: center;font-size: 20px;color:#dd524d">暂无警告信息</div></li>';
      }
   } else {
      html +=
         '<li><div class="con myfancy" style="text-align: center;font-size: 20px;color:#dd524d">暂无警告信息</div></li>';
   }
   $("#recordList").html(html);
}