|
@@ -13,6 +13,16 @@ function InitTable() {
|
|
|
//提交表单信息到具体得页面
|
|
|
var url = '/CloudMonitor/GetServerAlertBySearch';
|
|
|
$.post(url, params, function (data) {
|
|
|
+ // 获取今天的日期
|
|
|
+ const today = new Date();
|
|
|
+
|
|
|
+ // 计算每个记录的 "创建时间" 距离今天的天数,并添加到新字段中
|
|
|
+ data.forEach(record => {
|
|
|
+ const creationDate = new Date(record["创建时间"]);
|
|
|
+ const diffTime = today - creationDate; // 计算时间差(毫秒)
|
|
|
+ const diffDays = Math.floor(diffTime / (1000 * 60 * 60 * 24)); // 转换为天数
|
|
|
+ record["距离今天的天数"] = diffDays + "天";
|
|
|
+ });
|
|
|
const result = separateByWorkHours(data);
|
|
|
LoadTable($("#treegrid1"), result.workHoursData.sort((a, b) => {
|
|
|
// 将时间字符串转换为 Date 对象
|
|
@@ -90,14 +100,13 @@ function LoadTable(ele, data) {
|
|
|
pagination: false,
|
|
|
//列名称
|
|
|
columns: [[
|
|
|
- { field: '项目名称', title: '项目', width: 100 },
|
|
|
+ { field: '项目名称', title: '项目', width: 300 },
|
|
|
{ field: '渠道名称', title: '渠道', width: 100 },
|
|
|
{ field: '预警类型显示', title: '预警类型', width: 120, align: 'center' },
|
|
|
{ field: '异常说明', title: '异常说明', width: 350, align: 'left' },
|
|
|
{
|
|
|
field: '创建时间', title: '初次预警时间', width: 150, align: 'center', formatter: ZLPMS.formatterData
|
|
|
},
|
|
|
- { field: '最后上报时间', title: '最后上报时间', width: 150, align: 'center', formatter: ZLPMS.formatterData },
|
|
|
{
|
|
|
field: '预警次数', title: '预警次数', width: 100, align: 'center'
|
|
|
},
|
|
@@ -126,7 +135,7 @@ function LoadTable(ele, data) {
|
|
|
return `<div class="${className}">${value}</div>`;
|
|
|
}
|
|
|
},
|
|
|
- { field: '处理时间', title: '处理时间', width: 150, align: 'center', formatter: ZLPMS.formatterData }
|
|
|
+ { field: '距离今天的天数', title: '未处理天数', width: 150, align: 'center'}
|
|
|
]],
|
|
|
singleSelect: true,
|
|
|
onClickRow: function (index, row) {
|