This commit is contained in:
2023-06-05 10:10:22 +08:00
parent 9da1c4cf30
commit 634e8b71ab
18 changed files with 367 additions and 143 deletions
+24 -7
View File
@@ -81,8 +81,8 @@
} }
.question { .question {
min-height: 24px; /*min-height: 24px;*/
line-height: 24px; /*line-height: 24px;*/
padding-left: 70px; padding-left: 70px;
padding-right: 10px; padding-right: 10px;
font-size: 14px; font-size: 14px;
@@ -92,8 +92,8 @@
} }
.answer { .answer {
min-height: 24px; /*min-height: 24px;*/
line-height: 24px; /*line-height: 24px;*/
padding-left: 90px; padding-left: 90px;
padding-right: 10px; padding-right: 10px;
} }
@@ -186,12 +186,19 @@
} }
} }
.question_line { .question_line tr {
border-collapse: collapse;
border-top: 1px solid #dbdbdb; border-top: 1px solid #dbdbdb;
border-bottom: 1px solid #dbdbdb; border-bottom: 1px solid #dbdbdb;
} }
.question_line {
border-collapse: collapse;
}
.answer_line {
border-collapse: collapse;
}
.question_table_grid { .question_table_grid {
border-collapse: collapse; border-collapse: collapse;
} }
@@ -200,10 +207,20 @@
border: 1px solid #dbdbdb; border: 1px solid #dbdbdb;
} }
.question_div_grid { .question_standard_table_line {
border-top: 1px solid #dbdbdb;
border-bottom: 1px solid #dbdbdb;
}
.question_standard_table_grid {
border: 1px solid #dbdbdb; border: 1px solid #dbdbdb;
} }
.answer_div_grid {
border-left: 1px solid #dbdbdb;
border-right: 1px solid #dbdbdb;
}
.mediacaption { .mediacaption {
text-align: center; text-align: center;
clear: both; clear: both;
+75 -7
View File
@@ -60,7 +60,7 @@
.page { .page {
/*background-color: #d3d3d3;*/ /*background-color: #d3d3d3;*/
/*height: 52px;*/ /*height: 52px;*/
line-height: 52px; line-height: 25px;
margin-top: 8px; margin-top: 8px;
padding-left: 10px; padding-left: 10px;
padding-right: 10px; padding-right: 10px;
@@ -72,7 +72,7 @@
.section { .section {
/*background-color: #eaeaea;*/ /*background-color: #eaeaea;*/
/*height: 40px;*/ /*height: 40px;*/
line-height: 40px; line-height: 20px;
padding-left: 30px; padding-left: 30px;
padding-right: 10px; padding-right: 10px;
font-size: 20px; font-size: 20px;
@@ -81,8 +81,8 @@
} }
.question { .question {
min-height: 30px; min-height: 24px;
line-height: 30px; line-height: 24px;
padding-left: 70px; padding-left: 70px;
padding-right: 10px; padding-right: 10px;
font-size: 14px; font-size: 14px;
@@ -92,12 +92,21 @@
} }
.answer { .answer {
min-height: 30px; min-height: 24px;
line-height: 30px; line-height: 24px;
padding-left: 90px; padding-left: 90px;
padding-right: 10px; padding-right: 10px;
} }
.table_content {
padding-left: 3px;
padding-right: 3px;
}
.pagedoublespace {
line-height: 50px;
}
.media { .media {
width: 120px; width: 120px;
height: 120px; height: 120px;
@@ -176,6 +185,50 @@
display: block; display: block;
} }
} }
.question_line tr {
border-top: 1px solid #dbdbdb;
border-bottom: 1px solid #dbdbdb;
}
.question_line {
border-collapse: collapse;
}
.answer_line {
border-collapse: collapse;
}
.question_table_grid {
border-collapse: collapse;
}
.question_table_grid td {
border: 1px solid #dbdbdb;
}
.question_standard_table_line {
border-top: 1px solid #dbdbdb;
border-bottom: 1px solid #dbdbdb;
}
.question_standard_table_grid {
border: 1px solid #dbdbdb;
}
.answer_div_grid {
border-left: 1px solid #dbdbdb;
border-right: 1px solid #dbdbdb;
}
.mediacaption {
text-align: center;
clear: both;
height: 25px;
width: 120px;
overflow: hidden;
text-overflow: ellipsis;
}
</style> </style>
<script src="<%=GetFileUrlWithVersion("../js/controls.js")%>" type="text/javascript"></script> <script src="<%=GetFileUrlWithVersion("../js/controls.js")%>" type="text/javascript"></script>
<script src="<%=GetFileUrlWithVersion("../js/vue.min.js")%>"></script> <script src="<%=GetFileUrlWithVersion("../js/vue.min.js")%>"></script>
@@ -249,6 +302,19 @@
<span id="button-print" class="sbutton iconprint" style="margin-right: 20px;" onclick="OnPrint();" data-lgid="P_IPT_PRINT">Print</span> <span id="button-print" class="sbutton iconprint" style="margin-right: 20px;" onclick="OnPrint();" data-lgid="P_IPT_PRINT">Print</span>
</div> </div>
<div id="divreport" style="width: 1100px; margin: 0 auto;"> <div id="divreport" style="width: 1100px; margin: 0 auto;">
<div v-if="report.ReportLayout!=null">
<table class="maintable" style="width: 100%;">
<tr class="assettr">
<td style="width: 33%; text-align: left;">
<img id="reportlayoutlogo" style="width: 100px; margin-top: 5px; display: none;" /></td>
<td style="width: 33%; text-align: center;">
<img id="reportlayoutcenterlogo" style="width: 100px; margin-top: 5px; display: none;" /></td>
<td style="width: 33%; text-align: right;">
<img id="reportlayoutrightlogo" style="width: 100px; margin-top: 5px; display: none;" />
</td>
</tr>
</table>
</div>
<h1 style="text-align: center;" v-show="report.Template.DisplayInspectionTitle">{{report.Template.Name}}</h1> <h1 style="text-align: center;" v-show="report.Template.DisplayInspectionTitle">{{report.Template.Name}}</h1>
<div style="text-align: center; margin-bottom: 10px;"><span v-show="report.Template.DisplayCommitTime">{{report.CommitTimeLocalStr}}</span><span v-show="report.Template.DisplayCommitBy"> by {{report.CommitedByUserName}}</span></div> <div style="text-align: center; margin-bottom: 10px;"><span v-show="report.Template.DisplayCommitTime">{{report.CommitTimeLocalStr}}</span><span v-show="report.Template.DisplayCommitBy"> by {{report.CommitedByUserName}}</span></div>
<table class="maintable"> <table class="maintable">
@@ -361,7 +427,9 @@
</tr> </tr>
</table> </table>
</div> </div>
<div id="mask_bg" style="display: none;"><div class="loading c-spin"></div></div> <div id="mask_bg" style="display: none;">
<div class="loading c-spin"></div>
</div>
<div id="right_popup" style="display: none; position: absolute; top: 0; right: 0; bottom: 0; background-color: white; overflow: auto;"> <div id="right_popup" style="display: none; position: absolute; top: 0; right: 0; bottom: 0; background-color: white; overflow: auto;">
</div> </div>
<iframe id="ifdiv" style="height: 1px; width: 1px; display: none;"></iframe> <iframe id="ifdiv" style="height: 1px; width: 1px; display: none;"></iframe>
+1 -1
View File
@@ -5,7 +5,7 @@ require.config({
//spectrum: "../../js/spectrum" //spectrum: "../../js/spectrum"
}, },
waitSeconds: 0, waitSeconds: 0,
urlArgs: "v=455" //+ Math.random() urlArgs: "v=464" //+ Math.random()
}) })
requirejs(['modules/pageloader'], function (loader) { requirejs(['modules/pageloader'], function (loader) {
@@ -113,10 +113,10 @@
_this.loading && _this.loading.fadeOut(100); _this.loading && _this.loading.fadeOut(100);
return; return;
} }
if (q.QuestionType === Question.types.AssetStatus) { //if (q.QuestionType === Question.types.AssetStatus) {
a.Result = a.Comment; // a.Result = a.Comment;
a.Comment = ""; // a.Comment = "";
} //}
answers.push(a); answers.push(a);
} }
@@ -852,15 +852,15 @@
content.append('<div style="clear: both"></div>'); content.append('<div style="clear: both"></div>');
cnt = $('<div style="margin: 6px 0 0 0px"></div>'); cnt = $('<div style="margin: 6px 0 0 0px"></div>');
var divComment = $('<div style="padding: 6px 0"></div>'); var divResult = $('<div style="padding: 6px 0"></div>');
var comment = $('<textarea class="form-control" style="width: 100%; box-sizing: border-box; height: 70px" placeholder="Comment"></textarea>'); var rst = $('<textarea class="form-control" style="width: 100%; box-sizing: border-box; height: 70px"></textarea>');
comment.attr('maxlength', 500); rst.attr('maxlength', 500);
if (answer && answer.Result) { if (answer && answer.Result) {
comment.val(answer.Result); rst.val(answer.Result);
} }
this.ui.comment = comment; this.ui.assetstatusresult = rst;
divComment.append(comment); divResult.append(rst);
cnt.append(divComment); cnt.append(divResult);
content.append(cnt); content.append(cnt);
return content; return content;
@@ -874,12 +874,8 @@
items.push(item); items.push(item);
} }
answer.SelectedItems = items; answer.SelectedItems = items;
if (items.length > 0) { answer.Result = this.ui.assetstatusresult.val();
answer.Result = items.map(function (i) { return i.Value || i.Text }).join('\n');
//answer.SeverityLevel = items[0].SeverityLevel;
} else {
answer.Result = '';
}
return answer; return answer;
}; };
assetStatusQuestion.prototype.focus = function () { assetStatusQuestion.prototype.focus = function () {
+1 -1
View File
@@ -573,7 +573,7 @@
content.find('.layout-footers-middle .editor-content').val(info.PageFooterCenter); content.find('.layout-footers-middle .editor-content').val(info.PageFooterCenter);
content.find('.layout-footers-right .editor-content').val(info.PageFooterRight); content.find('.layout-footers-right .editor-content').val(info.PageFooterRight);
content.find('#layout-style').val(info.Style); content.find('#layout-style').val(info.Style).change();
content.find('#layout-spacing').val(info.Spacing); content.find('#layout-spacing').val(info.Spacing);
content.find('#layout-picturesdisplay').val(info.PicturesDisplay); content.find('#layout-picturesdisplay').val(info.PicturesDisplay);
content.find('#layout-captionimages').prop('checked', info.CaptionImages); content.find('#layout-captionimages').prop('checked', info.CaptionImages);
+115 -79
View File
@@ -158,7 +158,7 @@ function showIdentifiedQuestions(questions) {
var content = $('<div></div>'); var content = $('<div></div>');
content.append($('<div class="catelog">IDENTIFIED ISSUES</div>')); content.append($('<div class="catelog">IDENTIFIED ISSUES</div>'));
if (questions && questions.length > 0) { if (questions && questions.length > 0) {
createQuestionContent1(content, questions); createQuestionContent1(content, questions, true);
} }
else else
content.append($('<div class="question"></div>').text(GetTextByKey("P_IPT_NOQUESTIONS", 'No Questions'))); content.append($('<div class="question"></div>').text(GetTextByKey("P_IPT_NOQUESTIONS", 'No Questions')));
@@ -210,8 +210,7 @@ function showSignature(report) {
else if (layoutDivider == 2)//Grid else if (layoutDivider == 2)//Grid
div_pic.addClass('question_div_grid'); div_pic.addClass('question_div_grid');
if (layoutSpacing == 1)//Double Space div_pic.css('line-height', layoutSpacing == 1 ? '32px' : '16px');
div_pic.css('line-height', '30px');
} }
} }
@@ -247,8 +246,7 @@ function showMedias() {
else if (layoutDivider == 2)//Grid else if (layoutDivider == 2)//Grid
div_question.addClass('question_table_grid'); div_question.addClass('question_table_grid');
if (layoutSpacing == 1)//Double Space div_question.css('line-height', layoutSpacing == 1 ? '32px' : '16px');
div_question.css('line-height', '30px');
} }
else if (layoutStyle == 2) {//Split else if (layoutStyle == 2) {//Split
var div_question = $('<table style="width:100%;" class="question_table"></table>'); var div_question = $('<table style="width:100%;" class="question_table"></table>');
@@ -279,8 +277,7 @@ function showMedias() {
else if (layoutDivider == 2)//Grid else if (layoutDivider == 2)//Grid
div_question.addClass('question_table_grid'); div_question.addClass('question_table_grid');
if (layoutSpacing == 1)//Double Space div_question.css('line-height', layoutSpacing == 1 ? '32px' : '16px');
div_question.css('line-height', '30px');
} }
else { else {
var div_question = $('<table style="width:100%;" class="question_table"></table>'); var div_question = $('<table style="width:100%;" class="question_table"></table>');
@@ -297,14 +294,13 @@ function showMedias() {
} }
if (layoutDivider == 1)//Line if (layoutDivider == 1)//Line
div_question.addClass('question_line'); div_question.addClass('question_standard_table_line');
else if (layoutDivider == 2)//Grid else if (layoutDivider == 2)//Grid
div_question.addClass('question_table_grid'); div_question.addClass('question_standard_table_grid');
if (layoutSpacing == 1)//Double Space if (layoutSpacing == 1)//Double Space
div_question.css('line-height', '30px'); div_question.css('line-height', layoutSpacing == 1 ? '32px' : '16px');
} }
$('#divpages').append(content); $('#divpages').append(content);
} }
@@ -355,8 +351,7 @@ function createPage(page) {
else if (layoutDivider == 2)//Grid else if (layoutDivider == 2)//Grid
tabpage.addClass('question_table_grid'); tabpage.addClass('question_table_grid');
if (layoutSpacing == 1)//Double Space tabpage.css('line-height', layoutSpacing == 1 ? '32px' : '16px');
tabpage.css('line-height', '30px');
} }
else { else {
var divpage = $('<div class="page"></div>'); var divpage = $('<div class="page"></div>');
@@ -404,8 +399,7 @@ function createSectionContent(page) {
else if (layoutDivider == 2)//Grid else if (layoutDivider == 2)//Grid
tabsection.addClass('question_table_grid'); tabsection.addClass('question_table_grid');
if (layoutSpacing == 1)//Double Space tabsection.css('line-height', layoutSpacing == 1 ? '32px' : '16px');
tabsection.css('line-height', '30px');
var qc = createQuestionContent(s); var qc = createQuestionContent(s);
content.append(qc); content.append(qc);
@@ -459,35 +453,36 @@ function createSectionContent(page) {
function createQuestionContent(section) { function createQuestionContent(section) {
var content = $('<div style="margin-bottom:30px;"></div>'); var content = $('<div style="margin-bottom:30px;"></div>');
if (section.Questions && section.Questions.length > 0) { if (section.Questions && section.Questions.length > 0) {
createQuestionContent1(content, section.Questions); createQuestionContent1(content, section.Questions, false);
} }
else else
content.append($('<div class="question"></div>').text(GetTextByKey("P_IPT_NOQUESTIONS", 'No Questions'))); content.append($('<div class="question"></div>').text(GetTextByKey("P_IPT_NOQUESTIONS", 'No Questions')));
return content; return content;
} }
function createQuestionContent1(content, questions) { function createQuestionContent1(content, questions, isidentified) {
if (questions && questions.length > 0) { if (questions && questions.length > 0) {
if (layoutStyle == 1) {//Compressed if (layoutStyle == 1) {//Compressed
var div_question = $('<table style="width:100%;" class="question_table"></table>'); var div_question = $('<table style="width:100%;" class="question_table"></table>');
content.append(div_question); content.append(div_question);
for (var i = 0; i < questions.length; i++) { for (var i = 0; i < questions.length; i++) {
var q = questions[i]; var q = questions[i];
if (ignoreQuestion(q, isidentified)) continue;
var tr_question = $('<tr style="width:100%;"></tr>'); var tr_question = $('<tr style="width:100%;"></tr>');
div_question.append(tr_question); div_question.append(tr_question);
tr_question.append($('<td style="width:33%;"></td>').text(q.DisplayText)); tr_question.append($('<td style="width:33%;"></td>').text(q.DisplayText));
var td_answer = $('<td style="width:33%;"></td>'); var td_answer = $('<td style="width:33%;"></td>');
tr_question.append(td_answer); tr_question.append(td_answer);
createAnswerContent(td_answer, q); createAnswerContent(td_answer, q, isidentified);
var td_comment = $('<td style="width:33%;"></td>'); var td_comment = $('<td style="width:33%;"></td>');
tr_question.append(td_comment); tr_question.append(td_comment);
var comment = td_answer.data('comment'); var comment = td_answer.data('comment');
if (comment && comment != "") { if (comment && comment != "") {
td_comment.append($('<div class="answer"></div>').html(replaceHtmlText(comment))); td_comment.append($('<div class="answer"></div>').html(replaceHtmlText(comment)));
} }
if (q.IsImportant && layoutHighlightColor) if (q.IsImportant && layoutHighlightColor)
tr_question.css('background-color', layoutHighlightColor); tr_question.css('color', layoutHighlightColor);
} }
if (layoutDivider == 1)//Line if (layoutDivider == 1)//Line
@@ -495,16 +490,18 @@ function createQuestionContent1(content, questions) {
else if (layoutDivider == 2)//Grid else if (layoutDivider == 2)//Grid
div_question.addClass('question_table_grid'); div_question.addClass('question_table_grid');
if (layoutSpacing == 1)//Double Space div_question.css('line-height', layoutSpacing == 1 ? '32px' : '16px');
div_question.css('line-height', '30px');
} }
else if (layoutStyle == 2) {//Split else if (layoutStyle == 2) {//Split
var div_question = $('<table style="width:100%;" class="question_table"></table>'); var div_question = $('<table style="width:100%;" class="question_table"></table>');
content.append(div_question); content.append(div_question);
var tr_question = ""; var tr_question = "";
var qindex = 0;
for (var i = 0; i < questions.length; i++) { for (var i = 0; i < questions.length; i++) {
var q = questions[i]; var q = questions[i];
if (i % 2 == 0) { if (ignoreQuestion(q, isidentified)) continue;
if (qindex % 2 == 0) {
tr_question = $('<tr style="width:100%;"></tr>'); tr_question = $('<tr style="width:100%;"></tr>');
div_question.append(tr_question); div_question.append(tr_question);
} }
@@ -512,13 +509,15 @@ function createQuestionContent1(content, questions) {
tr_question.append(td_question); tr_question.append(td_question);
var td_answer = $('<td style="width:25%;"></td>'); var td_answer = $('<td style="width:25%;"></td>');
tr_question.append(td_answer); tr_question.append(td_answer);
createAnswerContent(td_answer, q); createAnswerContent(td_answer, q, isidentified);
if (q.IsImportant && layoutHighlightColor) { if (q.IsImportant && layoutHighlightColor) {
td_question.css('background-color', layoutHighlightColor); td_question.css('color', layoutHighlightColor);
td_answer.css('background-color', layoutHighlightColor); td_answer.css('color', layoutHighlightColor);
} }
qindex++;
} }
if (questions.length % 2 != 0) { if (qindex % 2 != 0) {
tr_question.append($('<td style="width:25%;"></td><td style="width:25%;"></td>')); tr_question.append($('<td style="width:25%;"></td><td style="width:25%;"></td>'));
} }
if (layoutDivider == 1)//Line if (layoutDivider == 1)//Line
@@ -526,16 +525,21 @@ function createQuestionContent1(content, questions) {
else if (layoutDivider == 2)//Grid else if (layoutDivider == 2)//Grid
div_question.addClass('question_table_grid'); div_question.addClass('question_table_grid');
if (layoutSpacing == 1)//Double Space div_question.css('line-height', layoutSpacing == 1 ? '32px' : '16px');
div_question.css('line-height', '30px');
} }
else { else {
for (var i = 0; i < questions.length; i++) { for (var i = 0; i < questions.length; i++) {
var q = questions[i]; var q = questions[i];
var div_question = $('<div class="question"></div>'); if (ignoreQuestion(q, isidentified)) continue;
content.append(div_question);
var tab_question = $('<table style="width:100%;" class="question_table"></table>');
content.append(tab_question);
var tr_question = $('<tr style="width:100%;"></tr>');
tab_question.append(tr_question);
var td_question = $('<td style="width:100%;"></td>');
tr_question.append(td_question);
var div_question = $('<div class="question"></div>');
td_question.append(div_question);
var div_title = $('<div style="width:320px;flex-grow:1;"></div>').text(q.DisplayText); var div_title = $('<div style="width:320px;flex-grow:1;"></div>').text(q.DisplayText);
div_question.append(div_title); div_question.append(div_title);
if (q.StaticPictures && q.StaticPictures.length > 0) { if (q.StaticPictures && q.StaticPictures.length > 0) {
@@ -544,18 +548,23 @@ function createQuestionContent1(content, questions) {
div_question.append(div_pic) div_question.append(div_pic)
} }
createAnswerContent(content, q); tr_question = $('<tr style="width:100%;"></tr>');
tab_question.append(tr_question);
var td_answer = $('<td style="width:100%;"></td>');
tr_question.append(td_answer);
createAnswerContent(td_answer, q, isidentified);
if (layoutDivider == 1)//Line if (layoutDivider == 1)//Line
div_question.addClass('question_line'); tab_question.addClass('question_standard_table_line');
else if (layoutDivider == 2)//Grid else if (layoutDivider == 2)//Grid
div_question.addClass('question_div_grid'); tab_question.addClass('question_standard_table_grid');
if (layoutSpacing == 1)//Double Space tab_question.css('line-height', layoutSpacing == 1 ? '32px' : '16px');
div_question.css('line-height', '30px');
if (q.IsImportant && layoutHighlightColor) if (q.IsImportant && layoutHighlightColor) {
div_question.css('background-color', layoutHighlightColor); tab_question.css('color', layoutHighlightColor);
div_question.css('color', layoutHighlightColor);
}
} }
} }
@@ -564,38 +573,12 @@ function createQuestionContent1(content, questions) {
if (layoutStyle == 1 || layoutStyle == 2) { if (layoutStyle == 1 || layoutStyle == 2) {
div_answer.addClass('table_content'); div_answer.addClass('table_content');
} }
else {
var isimportant = div_answer.data('isimportant');
if (isimportant && layoutHighlightColor)
div_answer.css('background-color', layoutHighlightColor);
if (layoutDivider == 1)//Line
div_answer.addClass('question_line');
else if (layoutDivider == 2)//Grid
div_answer.addClass('question_div_grid');
if (layoutSpacing == 1)//Double Space
div_answer.css('line-height', '30px');
}
}); });
content.find('.div_media').each(function () { content.find('.div_media').each(function () {
var div_media = $(this); var div_media = $(this);
if (layoutStyle == 1 || layoutStyle == 2) { if (layoutStyle == 1 || layoutStyle == 2) {
div_media.css('padding-left', '3px'); div_media.css('padding-left', '3px');
} }
else {
var isimportant = div_media.data('isimportant');
if (isimportant && layoutHighlightColor)
div_media.css('background-color', layoutHighlightColor);
if (layoutDivider == 1)//Line
div_media.addClass('question_line');
else if (layoutDivider == 2)//Grid
div_media.addClass('question_div_grid');
if (layoutSpacing == 1)//Double Space
div_media.css('line-height', '30px');
}
}); });
} }
return content; return content;
@@ -612,8 +595,39 @@ function createPictures(pictures, p) {
} }
return p; return p;
} }
function ignoreQuestion(q, isidentified) {
var ignore = false;
if (q.QuestionType == 10 || (q.QuestionType == 15 && q.SubType == 15)) {//Picture
var hasPicture = false;
if (reportdata && reportdata.Answers) {
for (var i = 0; i < reportdata.Answers.length; i++) {
var a = reportdata.Answers[i];
if (a.QuestionId.toLowerCase() == q.Id.toLowerCase()) {
if (reportdata.Medias && reportdata.Medias.length > 0) {
for (var j = 0; j < reportdata.Medias.length; j++) {
var m = reportdata.Medias[j];
if (m.AnswerId.toLowerCase() == a.Id.toLowerCase()) {
if (layoutPicturesDisplay == 1)//Displayed At Bottom
{
if (isidentified == false)
mediasdata.push(m);
}
else
hasPicture = true;
}
}
}
}
}
}
ignore = !hasPicture;
}
else
ignore = false;
return ignore;
}
function createAnswerContent(p, q) { function createAnswerContent(p, q, isidentified) {
var leveltext = showSeverityLevel(q.SeverityLevel); var leveltext = showSeverityLevel(q.SeverityLevel);
var label_level = $('<label class="label_level"></label>').text(leveltext); var label_level = $('<label class="label_level"></label>').text(leveltext);
if (reportdata && reportdata.Answers) { if (reportdata && reportdata.Answers) {
@@ -638,16 +652,19 @@ function createAnswerContent(p, q) {
var div_answer = $('<div class="answer"></div>').data('isimportant', q.IsImportant); var div_answer = $('<div class="answer"></div>').data('isimportant', q.IsImportant);
if (q.QuestionType == 1 if (q.QuestionType == 1
|| (q.QuestionType == 15 && q.SubType == 14)) || (q.QuestionType == 15 && q.SubType == 14))
p.append(div_answer.html(replaceHtmlText(result))).append("<div style='clear:both;'></div>"); p.append(div_answer.html(replaceHtmlText(result)));
else if (q.QuestionType == 17 && q.TextToCompare != null && result.toLowerCase() != q.TextToCompare.toLowerCase()) // BarCodeValidate else if (q.QuestionType == 17 && q.TextToCompare != null && result.toLowerCase() != q.TextToCompare.toLowerCase()) // BarCodeValidate
p.append(div_answer p.append(div_answer
.append($('<span style="color:red"></span>').text(result)) .append($('<span style="color:red"></span>').text(result))
.append($('<span style="margin-left:6px"></span>').text('(' + q.TextToCompare + ')')) .append($('<span style="margin-left:6px"></span>').text('(' + q.TextToCompare + ')'))
).append("<div style='clear:both;'></div>"); );
else else
p.append(div_answer.text(result)).append("<div style='clear:both;'></div>"); p.append(div_answer.text(result));
div_answer.append(label_level); div_answer.append(label_level);
p.append(item);
if (layoutStyle == 0)
p.append("<div style='clear:both;'></div>");
} }
else if (q.QuestionType == 5) {//YesOrNo else if (q.QuestionType == 5) {//YesOrNo
if (a.SelectedItems && a.SelectedItems.length > 0) { if (a.SelectedItems && a.SelectedItems.length > 0) {
@@ -662,7 +679,10 @@ function createAnswerContent(p, q) {
if (a.SelectedItems[0].BackgroundColor && a.SelectedItems[0].BackgroundColor != "") { if (a.SelectedItems[0].BackgroundColor && a.SelectedItems[0].BackgroundColor != "") {
div_bg.css('background-color', a.SelectedItems[0].BackgroundColor); div_bg.css('background-color', a.SelectedItems[0].BackgroundColor);
} }
p.append(item).append("<div style='clear:both;'></div>");
p.append(item);
if (layoutStyle == 0)
p.append("<div style='clear:both;'></div>");
} }
} }
else if (q.QuestionType == 8 || q.QuestionType == 9//DropDown、List else if (q.QuestionType == 8 || q.QuestionType == 9//DropDown、List
@@ -682,7 +702,10 @@ function createAnswerContent(p, q) {
if (a.SelectedItems[j].BackgroundColor && a.SelectedItems[j].BackgroundColor != "") { if (a.SelectedItems[j].BackgroundColor && a.SelectedItems[j].BackgroundColor != "") {
div_bg.css('background-color', a.SelectedItems[j].BackgroundColor); div_bg.css('background-color', a.SelectedItems[j].BackgroundColor);
} }
p.append(item).append("<div style='clear:both;'></div>");
p.append(item);
if (layoutStyle == 0)
p.append("<div style='clear:both;'></div>");
} }
} }
} }
@@ -699,7 +722,9 @@ function createAnswerContent(p, q) {
if (a.SelectedItems[0].BackgroundColor && a.SelectedItems[0].BackgroundColor != "") { if (a.SelectedItems[0].BackgroundColor && a.SelectedItems[0].BackgroundColor != "") {
div_bg.css('background-color', a.SelectedItems[0].BackgroundColor); div_bg.css('background-color', a.SelectedItems[0].BackgroundColor);
} }
p.append(item).append("<div style='clear:both;'></div>"); p.append(item);
if (layoutStyle == 0)
p.append("<div style='clear:both;'></div>");
} }
} }
} }
@@ -726,7 +751,10 @@ function createAnswerContent(p, q) {
var m = reportdata.Medias[j]; var m = reportdata.Medias[j];
if (m.AnswerId.toLowerCase() == a.Id.toLowerCase()) { if (m.AnswerId.toLowerCase() == a.Id.toLowerCase()) {
if (layoutPicturesDisplay == 1)//Displayed At Bottom if (layoutPicturesDisplay == 1)//Displayed At Bottom
{
if (isidentified == false)
mediasdata.push(m); mediasdata.push(m);
}
else {//Displayed As Taken else {//Displayed As Taken
var media = createMedias(m); var media = createMedias(m);
pics.append(media); pics.append(media);
@@ -745,8 +773,10 @@ function createAnswerContent(p, q) {
if (a.SelectedItems[0].BackgroundColor && a.SelectedItems[0].BackgroundColor != "") { if (a.SelectedItems[0].BackgroundColor && a.SelectedItems[0].BackgroundColor != "") {
div_bg.css('background-color', a.SelectedItems[0].BackgroundColor); div_bg.css('background-color', a.SelectedItems[0].BackgroundColor);
} }
p.append(divanswer).append("<div style='clear:both;'></div>");
p.append(divanswer);
if (layoutStyle == 0)
p.append("<div style='clear:both;'></div>");
} }
divanswer.append(label_level); divanswer.append(label_level);
if (layoutPicturesDisplay != 1) {//Displayed At Bottom if (layoutPicturesDisplay != 1) {//Displayed At Bottom
@@ -758,7 +788,10 @@ function createAnswerContent(p, q) {
var m = reportdata.Medias[j]; var m = reportdata.Medias[j];
if (m.AnswerId.toLowerCase() == a.Id.toLowerCase()) { if (m.AnswerId.toLowerCase() == a.Id.toLowerCase()) {
if (layoutPicturesDisplay == 1)//Displayed At Bottom if (layoutPicturesDisplay == 1)//Displayed At Bottom
{
if (isidentified == false)
mediasdata.push(m); mediasdata.push(m);
}
else {//Displayed As Taken else {//Displayed As Taken
var media = createMedias(m); var media = createMedias(m);
pics.append(media); pics.append(media);
@@ -767,17 +800,21 @@ function createAnswerContent(p, q) {
} }
} }
if (a.Result && a.Result != "") { if (a.Result && a.Result != "") {
p.append($('<div class="answer" style="color:#808080"></div>').data('isimportant', q.IsImportant).html(replaceHtmlText(a.Result))); var divresult = $('<div class="answer"></div>').data('isimportant', q.IsImportant).html(replaceHtmlText(a.Result));
p.append(divresult);
if (q.IsImportant && layoutHighlightColor)
divresult.css('color', layoutHighlightColor);
} }
} }
if (layoutStyle != 1 && layoutStyle != 2 && a.Comment && a.Comment != "") { if (layoutStyle != 1 && layoutStyle != 2 && a.Comment && a.Comment != "") {
p.append($('<div class="answer" style="color:#808080"></div>').data('isimportant', q.IsImportant).html(replaceHtmlText(a.Comment))); var divcomment = $('<div class="answer" style="color:#808080"></div>').data('isimportant', q.IsImportant).html(replaceHtmlText(a.Comment));
} p.append(divcomment);
return; if (q.IsImportant && layoutHighlightColor)
divcomment.css('color', layoutHighlightColor);
}
} }
} }
} }
p.append($('<div class="answer"></div>').text(""));
//public string Id { get; set; } //public string Id { get; set; }
@@ -811,7 +848,6 @@ function createAnswerContent(p, q) {
//如果AssetStatus类型,result存的是notes //如果AssetStatus类型,result存的是notes
return result;
} }
function convertUnits(u) { function convertUnits(u) {
+1 -1
View File
@@ -5,7 +5,7 @@
//spectrum: "../../js/spectrum" //spectrum: "../../js/spectrum"
}, },
waitSeconds: 0, waitSeconds: 0,
urlArgs: "v=38" //+ Math.random() urlArgs: "v=39" //+ Math.random()
}) })
requirejs(['modules/inspects/editinspection'], function (EditModule) { requirejs(['modules/inspects/editinspection'], function (EditModule) {
+1 -1
View File
@@ -1072,7 +1072,7 @@
<div style="line-height: 30px;"> <div style="line-height: 30px;">
<div style="margin-left: 10px;"> <div style="margin-left: 10px;">
<input type="checkbox" id="chkSelectAll" style="height: 26px;" v-on:change="selectAll($event)" /><span data-lgid="P_MAIN_SELECTALL">Select All</span> <input type="checkbox" style="height: 26px;" v-on:change="selectAll($event)" /><span data-lgid="P_MAIN_SELECTALL">Select All</span>
</div> </div>
<div id="divmsgcontainer" style="overflow: auto; position: absolute; top: 60px; bottom: 0; width: 100%;"> <div id="divmsgcontainer" style="overflow: auto; position: absolute; top: 60px; bottom: 0; width: 100%;">
<div v-bind:style="bodyContainerStyle" style="position: relative"> <div v-bind:style="bodyContainerStyle" style="position: relative">
+89 -2
View File
@@ -166,6 +166,39 @@
opacity: 1; opacity: 1;
opacity: initial opacity: initial
} }
html::-webkit-scrollbar {
width: 8px;
height: 8px;
}
html::-webkit-scrollbar-thumb {
background-color: rgba(168, 168, 168, 0.9);
border-radius: 4px;
}
#workorderspliter {
height: 6px;
background-color: gray;
cursor: ns-resize;
margin: 6px 0 4px;
}
#workorderdetail {
position: relative;
overflow: auto;
}
#workorderdetail::-webkit-scrollbar {
width: 8px;
height: 8px;
}
#workorderdetail::-webkit-scrollbar-thumb {
background-color: rgba(168, 168, 168, 0.9);
border-radius: 4px;
}
#workorderdetail>.ui-popup-mask {
position: absolute;
}
</style> </style>
<link href="<%=GetFileUrlWithVersion("../css/panel.css")%>" rel="stylesheet" /> <link href="<%=GetFileUrlWithVersion("../css/panel.css")%>" rel="stylesheet" />
@@ -1010,6 +1043,10 @@
var dialogWidgets; var dialogWidgets;
var widgetHeight = Number(localStorage.getItem('spliter_height'));
if (isNaN(widgetHeight) || widgetHeight < 100 || widgetHeight > 1000) {
widgetHeight = 300;
}
$(function () { $(function () {
setPageTitle(GetTextByKey("P_WORKORDER", "Work Order"), true); setPageTitle(GetTextByKey("P_WORKORDER", "Work Order"), true);
$('.iconlayout').on('click', function (ev) { $('.iconlayout').on('click', function (ev) {
@@ -1062,8 +1099,17 @@
}); });
$(window).resize(function () { $(window).resize(function () {
$("#workorderlist").css("height", $(window).height() - $("#workorderlist").offset().top - 10); var top = $("#workorderlist").offset().top;
var height = $(window).height() - top - 10;
var widget = wowidgetobj?.workorderwidgets?.length > 0;
if (widget) {
height -= widgetHeight + 10;
}
$("#workorderlist").css("height", height);
grid_dt && grid_dt.resize(); grid_dt && grid_dt.resize();
//if (widget) {
// $('#workorderdetail').css('height', top + height + 6);
//}
}).resize(); }).resize();
$('#dialog_alerts').prop('iframe', true).dialog(function () { $('#dialog_alerts').prop('iframe', true).dialog(function () {
@@ -1102,6 +1148,46 @@
$('#spExport').hide(); $('#spExport').hide();
} }
var list = document.querySelector('#workorderlist');
var detail = document.querySelector('#workorderdetail');
detail.style.height = widgetHeight + 'px';
document.querySelector('#workorderspliter').addEventListener('mousedown', function (e) {
if (e.buttons !== 1) {
return;
}
var oy = e.clientY;
var oheight = widgetHeight;
var parent = document.body;
var top = document.querySelector('#workorderlist').offsetTop;
var windowHeight = window.innerHeight;
var gridbody = list.querySelector('.data-grid-body');
var headerHeight = list.querySelector('.data-grid-table-header').offsetHeight;
var move = function (e2) {
if (e2.buttons !== 1) {
parent.dispatchEvent(new MouseEvent('mouseup'));
return;
}
var y = e2.clientY - oy;
var height = oheight - y;
if (height > 100) {
widgetHeight = height;
detail.style.height = widgetHeight + 'px';
height = windowHeight - top - 10 - height - 10;
list.style.height = height + 'px';
gridbody.style.height = (height - headerHeight) + 'px';
}
};
parent.addEventListener('mousemove', move, { passive: false });
var up = function () {
grid_dt?.resize();
parent.removeEventListener('mousemove', move, { passive: false });
parent.removeEventListener('mouseup', up);
localStorage.setItem('spliter_height', String(widgetHeight));
};
parent.addEventListener('mouseup', up);
});
openmsgwebsocket(); openmsgwebsocket();
}); });
@@ -1437,7 +1523,8 @@
</div> </div>
<div class="clear"></div> <div class="clear"></div>
<div id="workorderlist"></div> <div id="workorderlist"></div>
<div id="workorderdetail"></div> <div id="workorderspliter" style="display: none"></div>
<div id="workorderdetail" style="display: none"></div>
</div> </div>
<div id="mask_bg" style="display: none;"> <div id="mask_bg" style="display: none;">
<div class="loading c-spin"></div> <div class="loading c-spin"></div>
+4 -1
View File
@@ -1292,9 +1292,12 @@ function InitGridData() {
grid_dt.selectedrowchanged = function (rowindex) { grid_dt.selectedrowchanged = function (rowindex) {
var rowdata = grid_dt.source[rowindex]; var rowdata = grid_dt.source[rowindex];
if (rowdata && rowdata.Values.Id.Value > 0) { if (rowdata && rowdata.Values.Id.Value > 0) {
if (!wowidgetobj) if (!wowidgetobj) {
wowidgetobj = new WorkOrderWidget(); wowidgetobj = new WorkOrderWidget();
wowidgetobj.changeWorkOrder(rowdata.Values); wowidgetobj.changeWorkOrder(rowdata.Values);
} else {
wowidgetobj.changeWorkOrder(rowdata.Values);
}
} }
} }
+6 -6
View File
@@ -391,7 +391,7 @@ if (typeof ($woestimate) !== "function") {
tb_att.append(tr_att); tb_att.append(tr_att);
var td_att = $('<td></td>'); var td_att = $('<td></td>');
tr_att.append(td_att); tr_att.append(td_att);
div_att = $('<div class="content_main" style="max-height: 80px; overflow: auto;"></div>'); div_att = $('<div style="max-height: 80px; overflow: auto;padding: 0 4px;"></div>');
td_att.append(div_att); td_att.append(div_att);
tb_att = $('<table id="tab_est_atts" style="table-layout: fixed;"></table>'); tb_att = $('<table id="tab_est_atts" style="table-layout: fixed;"></table>');
div_att.append(tb_att); div_att.append(tb_att);
@@ -528,7 +528,7 @@ if (typeof ($woestimate) !== "function") {
tb_att.append(tr_att); tb_att.append(tr_att);
var td_att = $('<td></td>'); var td_att = $('<td></td>');
tr_att.append(td_att); tr_att.append(td_att);
div_att = $('<div class="content_main" style="max-height: 80px; overflow: auto;"></div>'); div_att = $('<div style="max-height: 80px; overflow: auto;padding: 0 4px;"></div>');
td_att.append(div_att); td_att.append(div_att);
tb_att = $('<table id="tab_woest_atts" style="table-layout: fixed;"></table>'); tb_att = $('<table id="tab_woest_atts" style="table-layout: fixed;"></table>');
div_att.append(tb_att); div_att.append(tb_att);
@@ -944,7 +944,7 @@ if (typeof ($woestimate) !== "function") {
tb_att.append(tr_att); tb_att.append(tr_att);
var td_att = $('<td></td>'); var td_att = $('<td></td>');
tr_att.append(td_att); tr_att.append(td_att);
div_att = $('<div class="content_main" style="max-height: 80px; overflow: auto;"></div>'); div_att = $('<div style="max-height: 80px; overflow: auto;padding: 0 4px;"></div>');
td_att.append(div_att); td_att.append(div_att);
tb_att = $('<table id="tab_est_atts' + estimateindex + '" style="table-layout: fixed;"></table>'); tb_att = $('<table id="tab_est_atts' + estimateindex + '" style="table-layout: fixed;"></table>');
div_att.append(tb_att); div_att.append(tb_att);
@@ -1812,7 +1812,7 @@ if (typeof ($woinvoice) !== "function") {
tb_att.append(tr_att); tb_att.append(tr_att);
var td_att = $('<td></td>'); var td_att = $('<td></td>');
tr_att.append(td_att); tr_att.append(td_att);
div_att = $('<div class="content_main" style="max-height: 80px; overflow: auto;"></div>'); div_att = $('<div style="max-height: 80px; overflow: auto;padding: 0 4px;"></div>');
td_att.append(div_att); td_att.append(div_att);
tb_att = $('<table id="tab_invoice_atts" style="table-layout: fixed;"></table>'); tb_att = $('<table id="tab_invoice_atts" style="table-layout: fixed;"></table>');
div_att.append(tb_att); div_att.append(tb_att);
@@ -1943,7 +1943,7 @@ if (typeof ($woinvoice) !== "function") {
tb_att.append(tr_att); tb_att.append(tr_att);
var td_att = $('<td></td>'); var td_att = $('<td></td>');
tr_att.append(td_att); tr_att.append(td_att);
div_att = $('<div class="content_main" style="max-height: 80px; overflow: auto;"></div>'); div_att = $('<div style="max-height: 80px; overflow: auto;padding: 0 4px;"></div>');
td_att.append(div_att); td_att.append(div_att);
tb_att = $('<table id="tab_woinvoice_atts" style="table-layout: fixed;"></table>'); tb_att = $('<table id="tab_woinvoice_atts" style="table-layout: fixed;"></table>');
div_att.append(tb_att); div_att.append(tb_att);
@@ -2369,7 +2369,7 @@ if (typeof ($woinvoice) !== "function") {
tb_att.append(tr_att); tb_att.append(tr_att);
var td_att = $('<td></td>'); var td_att = $('<td></td>');
tr_att.append(td_att); tr_att.append(td_att);
div_att = $('<div class="content_main" style="max-height: 80px; overflow: auto;"></div>'); div_att = $('<div style="max-height: 80px; overflow: auto;padding: 0 4px;"></div>');
td_att.append(div_att); td_att.append(div_att);
tb_att = $('<table id="tab_invoice_atts' + invoice_index + '" style="table-layout: fixed;"></table>'); tb_att = $('<table id="tab_invoice_atts' + invoice_index + '" style="table-layout: fixed;"></table>');
div_att.append(tb_att); div_att.append(tb_att);
+24 -7
View File
@@ -195,9 +195,15 @@ var WorkOrderWidget = function () {
return; return;
} }
_this.workorderwidgets = data; _this.workorderwidgets = data;
var display = data?.length > 0 ? 'block' : 'none';
$('#workorderspliter').css('display', display);
$('#workorderdetail').css('display', display);
_this.showWorkOrderWidgets(); _this.showWorkOrderWidgets();
_this.getWorkOrderContacts(_this.workorderid); _this.getWorkOrderContacts(_this.workorderid);
setTimeout(function () {
$(window).resize();
document.querySelector('#workorderdetail').scrollTop = 0;
}, 0);
}, function () { }, function () {
showAlert(GetTextByKey("P_XXXX", 'Failed to get the work order widget list.'), title); showAlert(GetTextByKey("P_XXXX", 'Failed to get the work order widget list.'), title);
}); });
@@ -259,6 +265,9 @@ var WorkOrderWidget = function () {
this.workorderwidgets = null; this.workorderwidgets = null;
this.popups = []; this.popups = [];
this.widgets = []; this.widgets = [];
$('#workorderspliter').css('display', 'none');
$('#workorderdetail').css('display', 'none');
$(window).resize();
} }
} }
} }
@@ -313,25 +322,33 @@ var WorkOrderWidget = function () {
this.createWidgetDialog = function (widget) { this.createWidgetDialog = function (widget) {
const ui = window['lib-ui']; const ui = window['lib-ui'];
let width = $(document.body).width();
let layout = widget.Layout; let layout = widget.Layout;
if (!layout || layout === '') { if (!layout || layout === '') {
let x = this.defX; let x = this.defX;
let y = this.defY; let y = this.defY;
let width = $(document.body).width(); let left = 10 + 315 * x;
let height = $(document.body).height();
let left = 20 + 320 * x;
if (left + 300 > width) { if (left + 300 > width) {
x = 0; x = 0;
left = 20; left = 10;
y++; y++;
this.defY = y; this.defY = y;
} }
let top = height - (y == 0 ? 420 : 320 * (y + 1)); let top = 10 + 165 * y;
if (top >= widgetHeight) {
top = widgetHeight - 40;
}
x++; x++;
this.defX = x; this.defX = x;
layout = { left, top, width: 300, height: 400 }; layout = { left, top, width: 300, height: 400 };
} else { } else {
layout = JSON.parse(widget.Layout); layout = JSON.parse(widget.Layout);
if (layout.top >= widgetHeight) {
layout.top = widgetHeight - 40;
}
if (layout.left >= width) {
layout.left = width - 10;
}
} }
let zIndex = this.currentZIndex--; let zIndex = this.currentZIndex--;
@@ -361,7 +378,7 @@ var WorkOrderWidget = function () {
onMoveEnded: function () { _this.saveWorkOrderWidgets(widget, popup.rect) }, onMoveEnded: function () { _this.saveWorkOrderWidgets(widget, popup.rect) },
onResizeEnded: function () { _this.saveWorkOrderWidgets(widget, popup.rect) } onResizeEnded: function () { _this.saveWorkOrderWidgets(widget, popup.rect) }
}); });
popup.show(); popup.show(document.querySelector('#workorderdetail'));
popup.rect = layout; popup.rect = layout;
this.popups[widget.WidgetId] = popup; this.popups[widget.WidgetId] = popup;
+6 -6
View File
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+2 -2
View File
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long