|
@@ -78,7 +78,8 @@
|
|
<h3 class="box-title" th:text="${aggReportId}">
|
|
<h3 class="box-title" th:text="${aggReportId}">
|
|
|
|
|
|
</h3>
|
|
</h3>
|
|
- <button class="btn-xs btn-primary pull-right" id="create_bug" style="margin-left: 5px;" onclick="showCreateBlock()" th:if="${finalReportId == null}">创建缺陷报告
|
|
|
|
|
|
+ <button class="btn-xs btn-primary pull-right" id="create_bug" style="margin-left: 5px;display: none" onclick="showCreateBlock()" >
|
|
|
|
+ 创建缺陷报告
|
|
</button>
|
|
</button>
|
|
<button class="btn-xs btn-primary pull-right" id="review_confirm" th:unless="${reviewed}" onclick="reviewConfirm()">确认审核</button>
|
|
<button class="btn-xs btn-primary pull-right" id="review_confirm" th:unless="${reviewed}" onclick="reviewConfirm()">确认审核</button>
|
|
|
|
|
|
@@ -242,10 +243,10 @@
|
|
|
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
- <div class="col-md-4 pull-right">
|
|
|
|
|
|
+ <div class="col-md-4 pull-right" >
|
|
<div id="my_favorite_latin_words" class="box box-info" style="margin-bottom: 5px; min-height: 182px;"></div>
|
|
<div id="my_favorite_latin_words" class="box box-info" style="margin-bottom: 5px; min-height: 182px;"></div>
|
|
|
|
|
|
- <div class="box box-danger source-table" id="new-report-create-block" style="display: none">
|
|
|
|
|
|
+ <div th:fragment="create_reports" class="box box-danger source-table" id="new-report-create-block" style="display: none">
|
|
<div class="box-header" style="border-bottom: 1px #f4f4f4 solid;">
|
|
<div class="box-header" style="border-bottom: 1px #f4f4f4 solid;">
|
|
<h3 class="box-title">
|
|
<h3 class="box-title">
|
|
编辑报告
|
|
编辑报告
|
|
@@ -303,14 +304,14 @@
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
- <div class="box box-info source-table" id="new-report-list-block">
|
|
|
|
|
|
+ <div class="box box-info source-table" id="new-report-list-block" >
|
|
<div class="box-header">
|
|
<div class="box-header">
|
|
<h3 class="box-title">
|
|
<h3 class="box-title">
|
|
已创建报告
|
|
已创建报告
|
|
|
|
|
|
</h3>
|
|
</h3>
|
|
</div>
|
|
</div>
|
|
- <div id="new-created-reports" class="box-body"
|
|
|
|
|
|
+ <div th:fragment="ul_reports" id="new-created-reports" class="box-body"
|
|
style="font-size: 12px; max-height: 340px; overflow: scroll;">
|
|
style="font-size: 12px; max-height: 340px; overflow: scroll;">
|
|
<div th:if="${finalReports.size() == 0}" style="font-size: 20px">
|
|
<div th:if="${finalReports.size() == 0}" style="font-size: 20px">
|
|
暂无 <a onclick="showCreateBlock()" style="cursor: pointer">立即创建报告</a>
|
|
暂无 <a onclick="showCreateBlock()" style="cursor: pointer">立即创建报告</a>
|
|
@@ -323,8 +324,7 @@
|
|
<div style="overflow: auto;">
|
|
<div style="overflow: auto;">
|
|
<span th:text="${finalReport.id}"></span>
|
|
<span th:text="${finalReport.id}"></span>
|
|
<span class="pull-right">
|
|
<span class="pull-right">
|
|
-
|
|
|
|
- <a th:href="'report?masterId='+${finalReport.sourceId}+'&examId='+${examId}+'&caseId='+${caseId}+'&finalReportId='+${finalReport.id}">编辑</a>
|
|
|
|
|
|
+ <a href="#" th:onclick="'editReport('+${finalReport.id}+')'" >编辑</a>
|
|
<a href="#" th:onclick="'deleteReport('+ ${finalReport.id} +')'">删除</a>
|
|
<a href="#" th:onclick="'deleteReport('+ ${finalReport.id} +')'">删除</a>
|
|
</span>
|
|
</span>
|
|
</div>
|
|
</div>
|
|
@@ -407,7 +407,6 @@
|
|
</center>
|
|
</center>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
-
|
|
|
|
</div>
|
|
</div>
|
|
<script type="text/javascript">
|
|
<script type="text/javascript">
|
|
//显示大图
|
|
//显示大图
|
|
@@ -424,10 +423,11 @@
|
|
<script src="https://d3js.org/d3.v4.min.js"></script>
|
|
<script src="https://d3js.org/d3.v4.min.js"></script>
|
|
<script type="text/javascript" src="/static/js/agg_report_new.js"></script>
|
|
<script type="text/javascript" src="/static/js/agg_report_new.js"></script>
|
|
<script type="text/javascript" src="/static/js/jqcloud-1.0.4.min.js"></script>
|
|
<script type="text/javascript" src="/static/js/jqcloud-1.0.4.min.js"></script>
|
|
|
|
+<!--<script type="text/javascript" src="/static/js/partload.js"></script>-->
|
|
<script type="text/javascript" xmlns:th="http://www.thymeleaf.org" th:inline="javascript">
|
|
<script type="text/javascript" xmlns:th="http://www.thymeleaf.org" th:inline="javascript">
|
|
/*<![CDATA[*/
|
|
/*<![CDATA[*/
|
|
|
|
|
|
- var word_list = /*[[${wordList}]]*/;
|
|
|
|
|
|
+ var word_list = /*[[${wordList}]]*/; //源代码如此
|
|
var urlParams = new URLSearchParams(window.location.search);
|
|
var urlParams = new URLSearchParams(window.location.search);
|
|
var masterId = urlParams.get('masterId');
|
|
var masterId = urlParams.get('masterId');
|
|
var examId = urlParams.get('examId');
|
|
var examId = urlParams.get('examId');
|
|
@@ -451,6 +451,9 @@
|
|
/*]]>*/
|
|
/*]]>*/
|
|
fillNewReportBlock(editReport);
|
|
fillNewReportBlock(editReport);
|
|
}
|
|
}
|
|
|
|
+ if(finalReportId == null){
|
|
|
|
+ $('#create_bug').css('display','block');
|
|
|
|
+ }
|
|
});
|
|
});
|
|
|
|
|
|
function createOrUpdateFinalReport() {
|
|
function createOrUpdateFinalReport() {
|
|
@@ -474,32 +477,71 @@
|
|
data: JSON.stringify(report),
|
|
data: JSON.stringify(report),
|
|
contentType: "application/json",
|
|
contentType: "application/json",
|
|
success: function (data) {
|
|
success: function (data) {
|
|
|
|
+ //修改成功的情况
|
|
|
|
+ console.log("修改报告")
|
|
|
|
+ loadPartReports();
|
|
|
|
+
|
|
/*<![CDATA[*/
|
|
/*<![CDATA[*/
|
|
- window.location.href='report?masterId='+masterId+'&examId='+examId+'&caseId='+caseId
|
|
|
|
- /*]]>*/ }
|
|
|
|
|
|
+ // window.location.href='report?masterId='+masterId+'&examId='+examId+'&caseId='+caseId
|
|
|
|
+ /*]]>*/
|
|
|
|
+ }
|
|
});
|
|
});
|
|
} else {
|
|
} else {
|
|
-
|
|
|
|
|
|
+ // 向服务器新建一个
|
|
$.ajax({
|
|
$.ajax({
|
|
type: "POST",
|
|
type: "POST",
|
|
url: '/final_report',
|
|
url: '/final_report',
|
|
data: JSON.stringify(report),
|
|
data: JSON.stringify(report),
|
|
contentType: "application/json",
|
|
contentType: "application/json",
|
|
success: function (data) {
|
|
success: function (data) {
|
|
- location.reload()
|
|
|
|
|
|
+ console.log("新建报告")
|
|
|
|
+ // location.reload()
|
|
|
|
+ loadPartReports();
|
|
}
|
|
}
|
|
});
|
|
});
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ function showCreateButton() {
|
|
|
|
+ $("#create_bug").show()
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ function loadPartReports() {
|
|
|
|
+ console.log("局部刷新")
|
|
|
|
+ /*<![CDATA[*/
|
|
|
|
+ $('#new-created-reports').load("/created_reports?masterId="+ masterId +"&caseId="+ caseId +"&examId="+ examId );
|
|
|
|
+ //$('#new-report-create-block').load("/created_reports_form");
|
|
|
|
+ finalReportId = null
|
|
|
|
+
|
|
|
|
+ /*]]>*/
|
|
|
|
+ showCreateButton()
|
|
|
|
+ $("#new-report-create-block").hide()
|
|
|
|
+ $("#new-report-list-block").show()
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ // function syncCreatedReports(){
|
|
|
|
+ // syncCreatedReportsWithParams(masterId,examId,caseId);
|
|
|
|
+ // }
|
|
|
|
+
|
|
|
|
+
|
|
function showCreateBlock() {
|
|
function showCreateBlock() {
|
|
|
|
+ // console.log("show create block")
|
|
$("#new-report-create-block").show()
|
|
$("#new-report-create-block").show()
|
|
|
|
+ // console.log("show create yse")
|
|
$("#new-report-list-block").hide()
|
|
$("#new-report-list-block").hide()
|
|
|
|
+ console.log("show create three")
|
|
|
|
+
|
|
}
|
|
}
|
|
function hideCreateBlock() {
|
|
function hideCreateBlock() {
|
|
if (finalReportId){
|
|
if (finalReportId){
|
|
- /*<![CDATA[*/
|
|
|
|
- window.location.href='report?masterId='+masterId+'&examId='+examId+'&caseId='+caseId
|
|
|
|
|
|
+ h /*<![CDATA[*/
|
|
|
|
+ // window.location.href='report?masterId='+masterId+'&examId='+examId+'&caseId='+caseId
|
|
|
|
+ // loadPartReports()
|
|
|
|
+ $("#create_bug").show()
|
|
|
|
+ $("#bug-description").text("")
|
|
|
|
+ finalReportId = null
|
|
/*]]>*/
|
|
/*]]>*/
|
|
}
|
|
}
|
|
$("#new-report-create-block").hide()
|
|
$("#new-report-create-block").hide()
|
|
@@ -507,15 +549,20 @@
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
|
|
+
|
|
function fillNewReportBlock(editReport) {
|
|
function fillNewReportBlock(editReport) {
|
|
- console.log(editReport)
|
|
|
|
|
|
+ console.log(editReport);
|
|
|
|
+ console.log("开始填充报告页面。")
|
|
$("#recurrent").val(editReport.recurrent);
|
|
$("#recurrent").val(editReport.recurrent);
|
|
$("#severity").val(editReport.severity);
|
|
$("#severity").val(editReport.severity);
|
|
$("#category").val(editReport.category);
|
|
$("#category").val(editReport.category);
|
|
$("#bug-description").val(editReport.description);
|
|
$("#bug-description").val(editReport.description);
|
|
var $new_report_img = $("#new-report-img");
|
|
var $new_report_img = $("#new-report-img");
|
|
|
|
+ $new_report_img.empty()
|
|
|
|
+ images = [];
|
|
/*<![CDATA[*/
|
|
/*<![CDATA[*/
|
|
- for (var i=0;i<editReport.imgUrls.length;i++) {
|
|
|
|
|
|
+ for (var i=0;editReport.imgUrls!=null&&i<editReport.imgUrls.length;i++) {
|
|
var src = editReport.imgUrls[i]
|
|
var src = editReport.imgUrls[i]
|
|
images.push(src);
|
|
images.push(src);
|
|
var $img = $('<img />')
|
|
var $img = $('<img />')
|
|
@@ -544,9 +591,26 @@
|
|
success: function (result) {
|
|
success: function (result) {
|
|
// Do something with the result
|
|
// Do something with the result
|
|
alert("删除成功");
|
|
alert("删除成功");
|
|
- location.reload();
|
|
|
|
|
|
+ loadPartReports();
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ function editReport (finalId){
|
|
|
|
+ //填充编辑表单页面。
|
|
|
|
+ /*<![CDATA[*/
|
|
|
|
+ $.ajax({
|
|
|
|
+ url: '/editReportData?masterId='+masterId+'&finalReportId='+finalId,
|
|
|
|
+ type: 'GET',
|
|
|
|
+ success: function (result) {
|
|
|
|
+ console.log(result); //
|
|
|
|
+ finalReportId = finalId;
|
|
|
|
+ fillNewReportBlock(result)
|
|
|
|
+ showCreateBlock();
|
|
}
|
|
}
|
|
});
|
|
});
|
|
|
|
+ /*]]>*/
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
function reviewConfirm() {
|
|
function reviewConfirm() {
|