双重预防项目-国泰新华二开定制版
马宇豪
2023-04-28 56f09487b7750d479d097713c86008d857f2f168
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('所有隐患列表')"/>
</head>
<body class="gray-bg">
 
 
<div class="container-div">
    <div class="row">
        <div class="col-sm-12 search-collapse">
 
            <form id="formId">
                <div class="select-list">
                    <ul>
                        <li>
                            <label>搜索:</label>
                            <input type="text" name="hazardName" placeholder="请输入重大危险源名称"/>
                        </li>
                        <li>
                            <label>重大危险源级别:</label>
                            <select name="hazardRank">
                                <option value="">所有</option>
                                <option :value="1">1</option>
                                <option :value="2">2</option>
                                <option :value="3">3</option>
                                <option :value="4">4</option>
                            </select>
                        </li>
 
                        <li>
                            <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i
                                    class="fa fa-search"></i>&nbsp;搜索</a>
                            <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i
                                    class="fa fa-refresh"></i>&nbsp;重置</a>
                        </li>
                    </ul>
                </div>
            </form>
        </div>
 
<!--        <div class="btn-group-sm" id="toolbar" role="group">-->
<!--            <a class="btn btn-warning" onclick="$.table.exportExcel()">-->
<!--                <i class="fa fa-download"></i> 导出-->
<!--            </a>-->
<!--        </div>-->
 
 
        <div class="col-sm-12 select-table table-striped">
            <table id="bootstrap-table"></table>
        </div>
    </div>
</div>
<th:block th:include="include :: footer"/>
<script th:inline="javascript">
    var prefix = ctx + "tr/selectRiskAndPeoplePage";
    // var common = [[${common}]];//用户角色 是否在公司管理员
    $(function () {
        var options = {
            url: prefix + "/list",
            // createUrl: prefix + "/add",
            // updateUrl: prefix + "/edit/{id}",
            // removeUrl: prefix + "/removeDangerLedger",
            // exportUrl: prefix + "/export",
            detailUrl: prefix + "/detail/{id}",
            modalName: "隐患列表",
            detailView: true,
            detailFormatter: detailFormatter,
            columns: [
                {
                    field: 'id',
                    title: 'id'
                },
                {
                    field: 'areaCode',
                    title: '行政区划'
                },
                {
                    field: 'companyName',
                    title: '企业名称',
                },
                {
                    field: 'companyNatureName',
                    title: '企业类型'
                },
                {
                    field: 'hazardCode',
                    title: '危险源编码'
                },
                {
                    field: 'hazardName',
                    title: '危险源名称'
                },
                {
                    field: 'hazardRankName',
                    title: '危险级别'
                },
                {
                    field: 'parkName',
                    title: '所在园区'
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function (value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-default btn-xs " href="javascript:void(0)" onclick="$.operate.detail(\'' + row.id + '\')"><i class="fa fa-search"></i>查看</a> ');
                        return actions.join('');
                    }
                }
            ]
        };
        $.table.init(options);
    });
    function detailFormatter(index, row) {
        var html = [];
        html.push('<p><b>id:</b> ' + row.id + '</p>');
        html.push('<p><b>行政区划:</b> ' + row.areaCode + '</p>');
        html.push('<p><b>企业名称:</b> ' + row.companyName + '</p>');
        html.push('<p><b>企业类型:</b> ' + row.companyNatureName + '</p>');
        html.push('<p><b>危险源编码:</b> ' + row.hazardCode + '</p>');
        html.push('<p><b>危险源名称:</b> ' + row.hazardName + '</p>');
        html.push('<p><b>危险级别:</b> ' + row.hazardRankName + '</p>');
        html.push('<p><b>所在园区:</b> ' + row.parkName + '</p>');
        // $.each(row, function(key, value) {
        //     html.push('<p><b>' + key + ':</b> ' + value + '</p>');
        // });
        return html.join('');
    }
</script>
</body>
</html>