linzhijie
2021-04-12 3a8e1524dcf0eeb610d38123d5f0a3ef838379cd
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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
<!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>
                            <p>[[#{jsp.exam.test_package.002}]]:</p>
                            <select name="productId" id="productId">
                                <option value="">All</option>
                                <option th:each="dict : ${dictList}" th:text="${dict.name}"
                                        th:value="${dict.id}"></option>
                            </select>
                        </li>
                        <li class="select-time">
                            <p>[[#{jsp.exam.test_package.004}]]:</p>
                            <input type="text" class="time-input" id="startTime" th:placeholder="#{jsp.system.user.profile.027}"
                                   name="params[beginTime]"/>
                            <span>-</span>
                            <input type="text" class="time-input" id="endTime" th:placeholder="#{jsp.system.user.profile.028}"
                                   name="params[endTime]"/>
                        </li>
                        <li>
                            <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i
                                    class="fa fa-search"></i>&nbsp;find</a>
                            <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i
                                    class="fa fa-refresh"></i>&nbsp;[[#{basis.reset}]]</a>
                        </li>
                    </ul>
                </div>
            </form>
        </div>
 
        <div class="btn-group-sm" id="toolbar" role="group">
            <a class="btn btn-warning" onclick="exportDataReport();" shiro:hasPermission="exam:report:export">
                <i class="fa fa-download"></i> [[#{jsp.exam.report.exportEvaluationUserAnswerRecords}]]
            </a>
<!--            <a class="btn btn-info" onclick="exportDetailReportExcel();"
               shiro:hasPermission="exam:report:detailReportexport">
                <i class="fa fa-download"></i> [[#{jsp.exam.report.regenerateReport}]]
            </a>
            <a class="btn btn-inverse" onclick="exportSendedReportExcel();">
                <i class="fa fa-download"></i> [[#{jsp.exam.report.exportSendedReport}]]
            </a>-->
        </div>
        <div class="col-sm-12 select-table table-striped">
            <table id="bootstrap-table" data-mobile-responsive="true"></table>
        </div>
    </div>
    <!--多语言的弹出-->
    <div class="modal inmodal fade" id="langTypSelect" name = "langTypSelect" tabindex="-1" role="dialog" aria-hidden="true" data-backdrop="false">
        <div class="modal-dialog modal-lg">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal"><span
                            aria-hidden="true">&times;</span><span class="sr-only">Close</span>
                    </button>
                    <h4 class="modal-title">[[#{jsp.exam.demographyParam.languagetype}]]</h4>
                </div>
                <div class="modal-body">
                    <div class="form-group">
                        <label class="col-sm-3 control-label">[[#{jsp.exam.product.questionnaireType}]]:</label>
                        <div class="col-sm-8" id="langTypeDiv" th:fragment="langTypeDiv">
                            <select th:if="${dictDatas} != null" name="langType"
                                    class="form-control m-b">
                                <option th:each="dict, iterStat : ${dictDatas}" th:text="${dict.dictLabel}"
                                        th:value="${dict.dictValue}"></option>
                            </select>
                            <div class="select-must" style="color: red" hidden="true">*[[#{jsp.exam.product.pleaseSelectLangType}]]</div>
                        </div>
                    </div>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-white" data-dismiss="modal">close</button>
                    <button type="button" class="btn btn-primary next-step">next</button>
                </div>
            </div>
        </div>
    </div>
</div>
<th:block th:include="include :: footer"/>
<script th:inline="javascript">
    var editFlag = [[${@permission.hasPermi('exam:report:edit')}]];
    var removeFlag = [[${@permission.hasPermi('exam:report:remove')}]];
    var statusDatas = [[${@dict.getType('downloadDetailedReport_status')}]];
    var test_member_status = [[${@dict.getType('test_member_status')}]];
    var prefix = ctx + "exam/report";
 
    $(function () {
        var columns = [{field: 'ID', checkbox: true}];
        var options = {
            url: prefix + "/newListData",
            createUrl: prefix + "/add",
            updateUrl: prefix + "/edit/{id}",
            removeUrl: prefix + "/remove",
            exportUrl: prefix + "/exportReport",
            modalName: "评测报告",
            pageSize: 50,
            pageList: [50, 100, 200],
            onLoadSuccess: function (data) {
 
            },
            columns: [{
                checkbox: true
            },
                {
                    field: 'id',
                    title: 'ID',
                    visible: false
                },
                {
                    field: 'memberId',
                    title: [[#{jsp.exam.test_package.033}]]
                },
                {
                    field: 'memberDept',
                    title: [[#{jsp.testPackage.department}]],
                    sortable: true
                },
                {
                    field: 'memberName',
                    title: [[#{jsp.system.user.profile.011}]]
                },
                {
                    field: 'downloadTimes',
                    title: [[#{jsp.exam.report.downloadRight}]],
                    formatter: function (value, row, index) {
                        return $.table.selectDictLabel(statusDatas, value);
                    },
                    visible: false
                },
                {
                    field: 'verifyStatus',
                    title: [[#{jsp.exam.report.questionStatus}]],
                    formatter: function (value, row, index) {
                        return $.table.selectDictLabel(test_member_status, value);
                    }
                },
                {
                    field: 'productId',
                    title: [[#{jsp.exam.product.productPackageNumber}]],
                    visible: false
                },
                {
                    field: 'productName',
                    title: [[#{jsp.exam.report.productName}]]
                },
                {
                    field: 'userId',
                    title: 'userId',
                    visible: false
                },
                {
                    title: [[#{basis.operate}]],
                    align: 'center',
                    formatter: function (value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-info btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="testerReport(\'' + row.memberId + '\')"><i class="fa fa-edit"></i>'+[[#{jsp.exam.textPackageExport}]]+'</a> ');
                        return actions.join('');
                    }
                },
            ]
        };
        $.table.init(options);
    });
 
    function exportDataReport(formId) {
        var productId = $("#productId").val();
        if (productId == '') {
            $.modal.alertWarning([[#{jsp.exam.evaluation_report.export.msg}]]);
            return;
        }
/*        var ids = $.table.selectColumns("id");
 
        if (ids.length == 0) {
            $.modal.alertWarning([[#{please.choose.user}]]);
            return;
        }*/
        $.modal.loading([[#{jsp.exam.report.003}]]);
        var currentId = $.common.isEmpty(formId) ? $('form').attr('id') : formId;
        console.log(currentId);
        $.post(prefix + "/exportEvaluationReport", $("#" + currentId).serializeArray(), function(result) {
            if (result.code == web_status.SUCCESS) {
                window.location.href = ctx + "common/download?fileName=" + encodeURI(result.msg) + "&delete=" + true;
            } else if (result.code == web_status.WARNING) {
                $.modal.alertWarning(result.msg)
            } else {
                $.modal.alertError(result.msg);
            }
            $.modal.closeLoading();
        });
    }
 
    // 下载用户的测试报告
    function testerReport(memberId) {
        $.modal.loading([[#{jsp.exam.report.003}]]);
        $.post(prefix + "/testerReport/" + memberId, "", function (result) {
            if (result.code == web_status.SUCCESS) {
                window.location.href = ctx + "common/download?fileName=" + encodeURI(result.msg) + "&delete=" + true;
            } else if (result.code == web_status.WARNING) {
                $.modal.alertWarning(result.msg)
            } else {
                $.modal.alertError(result.msg);
            }
            $.modal.closeLoading();
        });
    }
</script>
</body>
</html>