alarm_monitoring.js
4.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
var Controller = {
index: function () {
// 初始化表格参数配置
Table.api.init();
this.table.first();
this.table.second();
},
table: {
first: function () {
// 表格1
var table1 = $("#table1");
table1.bootstrapTable({
url: 'reservoir/hkws/alarm_monitoring/index',
toolbar: '#toolbar1',
sortName: 'id',
search: false,
columns: [
[
{field: 'id', title: __('Id')},
{field: 'cameraIndexCode', title: __('Cameraindexcode'), operate: 'LIKE'},
{field: 'alarm_type', title: __('Alarm_type'), searchList: {"LINE_CROSSING_DETECTION":__('Line_crossing_detection'),"REGION_ENTRANCE_DETECTION":__('Region_entrance_detection'),"INTRUSION_DETECTION":__('Intrusion_detection')}, formatter: Table.api.formatter.normal},
{field: 'alarmimage', title: __('Alarmimage'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image},
// {field: 'reservoir_list_id', title: __('Reservoir_list_id')},
{field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
{field: 'status', title: __('Status'), searchList: {"0":__('Status 0'),"1":__('Status 1')}, formatter: Table.api.formatter.status},
{field: 'reservoirlist.name', title: __('Reservoir_list_id'), operate: 'LIKE'},
{
field: 'operate', title: __('Operate'), table: table1, events: Table.api.events.operate, buttons: [
{
name: 'log',
title: '查阅状态',
text: '查阅状态',
icon: 'fa fa-list',
classname: 'btn btn-primary btn-xs btn-click',
click: function (e, data) {
$("#myTabContent2 .form-commonsearch input[name='reservoir_hkws_alarm_monitoring_id']").val(data.id);
$("#myTabContent2 .btn-refresh").trigger("click");
}
}
], formatter: Table.api.formatter.operate
}
]
]
});
// 为表格1绑定事件
Table.api.bindevent(table1);
},
second: function () {
// 表格2
var table2 = $("#table2");
table2.bootstrapTable({
url: 'reservoir/hkws/alarm_monitoring_read/index',
extend: {
index_url: '',
add_url: '',
edit_url: '',
del_url: '',
multi_url: '',
table: '',
},
toolbar: '#toolbar2',
sortName: 'id',
search: false,
columns: [
[
{field: 'id', title: __('Id')},
{field:'staff.staff_name',title: __('Staff_name')},
// {field: 'user_id', title: __('User_id')},
{field: 'reservoir_hkws_alarm_monitoring_id', title: __('Reservoir_hkws_alarm_monitoring_id')},
{field: 'is_read', title: __('Is_read'), searchList: {"0":__('Is_read 0'),"1":__('Is_read 1')}, formatter: Table.api.formatter.normal},
{field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
{field: 'readtime', title: __('Readtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
]
]
});
// 为表格2绑定事件
Table.api.bindevent(table2);
}
},
};
return Controller;
});