add site
This commit is contained in:
533
Site/Maintenance/SurveyTemplatePrint.aspx
Normal file
533
Site/Maintenance/SurveyTemplatePrint.aspx
Normal file
@ -0,0 +1,533 @@
|
||||
<%@ Page Title="" Language="C#" MasterPageFile="~/Maintenance/MaintenanceBase.master" AutoEventWireup="true" CodeFile="SurveyTemplatePrint.aspx.cs" Inherits="Maintenance_SurveyTemplatePrint" %>
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
|
||||
<style type="text/css">
|
||||
.no_wrap th {
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.max160 {
|
||||
max-width: 160px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.dialog-content table {
|
||||
border-collapse: collapse;
|
||||
width: 100%;
|
||||
line-height: 32px;
|
||||
}
|
||||
|
||||
.dialog-content table td.label {
|
||||
width: 130px;
|
||||
text-align: right;
|
||||
padding-right: 10px;
|
||||
line-height: 24px;
|
||||
height: 24px;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
.dialog-content table td input,
|
||||
.dialog-content table td textarea {
|
||||
border: 1px solid #a9a9a9;
|
||||
width: 250px;
|
||||
height: 18px;
|
||||
padding: 1px;
|
||||
}
|
||||
|
||||
#dialog_machines .dialog-content table td input {
|
||||
width: auto;
|
||||
}
|
||||
|
||||
.dialog-content table td textarea {
|
||||
margin-top: 6px;
|
||||
}
|
||||
|
||||
.dialog-content table td select {
|
||||
width: 254px;
|
||||
height: 24px;
|
||||
}
|
||||
|
||||
.dialog-content table td input[type="checkbox"] {
|
||||
border: none;
|
||||
}
|
||||
|
||||
.dialog-content table td textarea {
|
||||
height: 150px;
|
||||
width: 420px;
|
||||
max-width: 500px;
|
||||
}
|
||||
|
||||
.ctl_button {
|
||||
font-family: 'CalciteWebCoreIcons';
|
||||
display: block;
|
||||
margin: 6px auto;
|
||||
width: 60px;
|
||||
height: 22px;
|
||||
line-height: 21px;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
#dialog_machinegroup {
|
||||
z-index: 500;
|
||||
width: 870px;
|
||||
top: 60px;
|
||||
left: 150px;
|
||||
}
|
||||
|
||||
.inputbox {
|
||||
width: 500px;
|
||||
padding: 1px;
|
||||
}
|
||||
|
||||
.group_table .main_table {
|
||||
table-layout: fixed;
|
||||
}
|
||||
|
||||
.group_table .main_table thead tr {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.group_table .main_table tbody {
|
||||
height: 280px;
|
||||
display: block;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.group_table .main_table th {
|
||||
width: 165px;
|
||||
}
|
||||
|
||||
.group_table .main_table td {
|
||||
width: 165px;
|
||||
white-space: nowrap;
|
||||
word-break: keep-all;
|
||||
}
|
||||
|
||||
.group_table .main_table td div {
|
||||
width: 165px;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
word-break: keep-all;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.td_controller {
|
||||
vertical-align: middle;
|
||||
padding: 40px 8px;
|
||||
/*border-left: 1px solid #b0b0b0;
|
||||
border-right: 1px solid #b0b0b0;*/
|
||||
}
|
||||
|
||||
.ctl_button {
|
||||
font-family: 'CalciteWebCoreIcons';
|
||||
display: block;
|
||||
margin: 6px auto;
|
||||
width: 60px;
|
||||
height: 22px;
|
||||
line-height: 21px;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.machine_maskbg {
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
position: absolute;
|
||||
background: #000;
|
||||
opacity: 0.2;
|
||||
}
|
||||
|
||||
.div_filter .dropdown {
|
||||
width: 100px;
|
||||
}
|
||||
|
||||
.page-chart {
|
||||
page-break-inside: avoid;
|
||||
}
|
||||
</style>
|
||||
<script src="../js/echarts.min.js"></script>
|
||||
<script src="<%=GetFileUrlWithVersion("js/controls.js")%>" type="text/javascript"></script>
|
||||
<script src="<%=GetFileUrlWithVersion("../fic/js/utility.js")%>" type="text/javascript"></script>
|
||||
<script type="text/javascript">
|
||||
var colors = [
|
||||
"#4386d8", "#ff9a2e", "#db443f", "#a8d44f", "#8560b3",
|
||||
"#3cbfe3", "#afd8f8", "#008e8e", "#8BBa00", "#fabd0f",
|
||||
"#fa6e46", "#9d080d", "#a186be", "#cc6600", "#fdc689"
|
||||
];
|
||||
function reportrequest(method, param, callback, error) {
|
||||
_network.request("Maintenance/SurveyTemplateReport.aspx", -1, method, param, callback, error || function () {
|
||||
showmaskbg(false, true);
|
||||
showAlert(GetTextByKey('P_FR_PAGEERROR', 'An unknown error occurred. Please refresh page.'), GetTextByKey('P_FR_QUERY', 'Query'));
|
||||
});
|
||||
}
|
||||
|
||||
function InitYesNoBar(q, content, id, s1, s2, d1, d2, index) {
|
||||
var myChart = echarts.init(content.find('#' + id)[0]);
|
||||
var option = {
|
||||
//title: {
|
||||
// text: q.Title
|
||||
//},
|
||||
color: ['#a8d44f', '#db443f'],
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
axisPointer: {
|
||||
type: 'none'
|
||||
}
|
||||
},
|
||||
legend: {
|
||||
top: '10%',
|
||||
left: 'right'
|
||||
},
|
||||
grid: {
|
||||
left: '3%',
|
||||
right: '4%',
|
||||
bottom: '3%',
|
||||
containLabel: true
|
||||
},
|
||||
xAxis: {
|
||||
type: 'value',
|
||||
boundaryGap: [0, 0.01]
|
||||
},
|
||||
yAxis: {
|
||||
type: 'category',
|
||||
data: [' ', ' ', ' ']
|
||||
},
|
||||
series: [
|
||||
{
|
||||
name: s1,
|
||||
type: 'bar',
|
||||
data: [null, d1, null]
|
||||
},
|
||||
{
|
||||
name: s2,
|
||||
type: 'bar',
|
||||
data: [null, d2, null]
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
myChart.setOption(option);
|
||||
}
|
||||
|
||||
function InitChooseBar(q, content, id, data, text) {
|
||||
var myChart = echarts.init(content.find('#' + id)[0]);
|
||||
var option = {
|
||||
//title: {
|
||||
// text: q.Title
|
||||
//},
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
axisPointer: {
|
||||
type: 'none'
|
||||
}
|
||||
},
|
||||
color: colors,
|
||||
xAxis: {
|
||||
type: 'category',
|
||||
data: data,
|
||||
axisTick: {
|
||||
alignWithLabel: true
|
||||
},
|
||||
axisLabel: {
|
||||
interval: 0,
|
||||
rotate: 45
|
||||
},
|
||||
},
|
||||
grid: {
|
||||
left: '3%',
|
||||
right: '4%',
|
||||
bottom: '3%',
|
||||
containLabel: true
|
||||
},
|
||||
yAxis: [{
|
||||
type: 'value',
|
||||
name: '',
|
||||
position: 'left',
|
||||
alignTicks: true,
|
||||
axisLine: {
|
||||
show: true,
|
||||
lineStyle: {
|
||||
color: '#5470C6'
|
||||
}
|
||||
},
|
||||
axisLabel: {
|
||||
formatter: function (value, index) {
|
||||
if ((value + '').indexOf('.') >= 0) {
|
||||
return '';
|
||||
}
|
||||
return value;
|
||||
}
|
||||
}
|
||||
}],
|
||||
series: [
|
||||
{
|
||||
data: text,
|
||||
type: 'bar',
|
||||
barWidth: 50
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
myChart.setOption(option);
|
||||
}
|
||||
|
||||
function InitScoreBar(q, content, id, data, text, avgData) {
|
||||
var myChart = echarts.init(content.find('#' + id)[0]);
|
||||
var option = {
|
||||
//title: {
|
||||
// text: q.Title
|
||||
//},
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
axisPointer: {
|
||||
type: 'none'
|
||||
}
|
||||
},
|
||||
color: colors,
|
||||
xAxis: {
|
||||
type: 'category',
|
||||
data: data,
|
||||
axisTick: {
|
||||
alignWithLabel: true
|
||||
},
|
||||
axisLabel: {
|
||||
interval: 0,
|
||||
rotate: 45
|
||||
},
|
||||
},
|
||||
grid: {
|
||||
left: '3%',
|
||||
right: '4%',
|
||||
bottom: '3%',
|
||||
containLabel: true
|
||||
},
|
||||
legend: {},
|
||||
yAxis: [{
|
||||
type: 'value',
|
||||
name: '',
|
||||
position: 'left',
|
||||
alignTicks: true,
|
||||
axisLine: {
|
||||
show: true,
|
||||
lineStyle: {
|
||||
color: '#5470C6'
|
||||
}
|
||||
},
|
||||
axisLabel: {
|
||||
formatter: function (value, index) {
|
||||
if ((value + '').indexOf('.') >= 0) {
|
||||
return '';
|
||||
}
|
||||
return value;
|
||||
}
|
||||
}
|
||||
},
|
||||
//{
|
||||
// type: 'value',
|
||||
// name: '',
|
||||
// position: 'right',
|
||||
// alignTicks: true,
|
||||
// offset: 0,
|
||||
// axisLine: {
|
||||
// show: true,
|
||||
// lineStyle: {
|
||||
// color: '#91CC75'
|
||||
// }
|
||||
// },
|
||||
// axisLabel: {
|
||||
// formatter: '{value}'
|
||||
// }
|
||||
//}
|
||||
],
|
||||
series: [
|
||||
{
|
||||
data: text,
|
||||
type: 'bar',
|
||||
barWidth: 50
|
||||
},
|
||||
//{
|
||||
// name: '',
|
||||
// type: 'line',
|
||||
// yAxisIndex: 1,
|
||||
// data: avgData
|
||||
//}
|
||||
]
|
||||
};
|
||||
|
||||
myChart.setOption(option);
|
||||
}
|
||||
|
||||
function InitScorePie(q, content, id, pieData) {
|
||||
var myChart1 = echarts.init(content.find('#' + id)[0]);
|
||||
var option1 = {
|
||||
//title: {
|
||||
// text: q.Title,
|
||||
// left: 'center'
|
||||
//},
|
||||
color: colors,
|
||||
tooltip: {
|
||||
trigger: 'item',
|
||||
formatter: '{b} : {c} ({d}%)'
|
||||
},
|
||||
legend: {
|
||||
type: 'scroll',
|
||||
orient: 'vertical',
|
||||
right: 10,
|
||||
top: 20,
|
||||
bottom: 20,
|
||||
},
|
||||
series: [
|
||||
{
|
||||
name: '',
|
||||
type: 'pie',
|
||||
radius: '55%',
|
||||
center: ['40%', '50%'],
|
||||
data: pieData,
|
||||
emphasis: {
|
||||
itemStyle: {
|
||||
shadowBlur: 10,
|
||||
shadowOffsetX: 0,
|
||||
shadowColor: 'rgba(0, 0, 0, 0.5)'
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
myChart1.setOption(option1);
|
||||
}
|
||||
|
||||
function InitReport(report) {
|
||||
var content = $('#surveyreport');
|
||||
content.html('');
|
||||
$('<div></div>').css('font-size', 24).css('text-align', 'center').css('font-weight', 'bold').text(report.TemplateName).appendTo(content);
|
||||
var text = GetTextByKey('P_WOS_TEMPLATES_REPORT_COUNT', 'There are {0} surveys in total.').replace('{0}', report.SurveyCount);
|
||||
$('<div></div>').css('font-size', 16).css('text-align', 'center').css('font-weight', 'bold').html(text).appendTo(content);
|
||||
$('<br/>').appendTo(content);
|
||||
$('<br/>').appendTo(content);
|
||||
for (var i in report.Questions) {
|
||||
var q = report.Questions[i];
|
||||
if (q.QuestionType === 2) {
|
||||
//Choose
|
||||
$('<div></div>').css('font-size', 24).css('font-weight', 'bold').css('padding-left', '10px').text(q.Title).appendTo(content);
|
||||
var data = [];
|
||||
var vs = [];
|
||||
var pieData = [];
|
||||
for (var j in q.Values) {
|
||||
var vv = q.Values[j];
|
||||
data.push(vv.DisplayText);
|
||||
vs.push(vv.Count);
|
||||
pieData.push({ value: vv.Count, name: vv.DisplayText });
|
||||
}
|
||||
var div = $('<div></div>').attr('id', 'choosediv' + i);
|
||||
div.appendTo(content);
|
||||
var id = 'choosebardiv' + i;
|
||||
$('<div class="page-chart" style="height: 300px"></div>').attr('id', id).appendTo(div);
|
||||
InitChooseBar(q, content, id, data, vs);
|
||||
id = 'choosepiediv' + i;
|
||||
$('<div class="page-chart" style="height: 300px"></div>').attr('id', id).appendTo(div);
|
||||
InitScorePie(q, content, id, pieData);
|
||||
$('<br/>').appendTo(content);
|
||||
$('<br/>').appendTo(content);
|
||||
}
|
||||
else if (q.QuestionType === 3) {
|
||||
//YesOrNo
|
||||
$('<div></div>').css('font-size', 24).css('font-weight', 'bold').css('padding-left', '10px').text(q.Title).appendTo(content);
|
||||
|
||||
var id = 'yesnobardiv' + i;
|
||||
$('<div class="page-chart" style="width: 70%; height: 220px"></div>').attr('id', id).appendTo(content);
|
||||
InitYesNoBar(q, content, id, q.Values[0].DisplayText, q.Values[1].DisplayText, q.Values[0].Count, q.Values[1].Count, i);
|
||||
$('<br/>').appendTo(content);
|
||||
$('<br/>').appendTo(content);
|
||||
} else if (q.QuestionType === 4) {
|
||||
//Score
|
||||
$('<div></div>').css('font-size', 24).css('font-weight', 'bold').css('padding-left', '10px').text(q.Title).appendTo(content);
|
||||
var data = [];
|
||||
var vs = [];
|
||||
var pieData = [];
|
||||
var avgData = [];
|
||||
for (var j in q.Values) {
|
||||
var vv = q.Values[j];
|
||||
data.push(vv.DisplayText);
|
||||
vs.push(vv.Count);
|
||||
pieData.push({ value: vv.Count, name: vv.DisplayText });
|
||||
avgData.push(q.AverageScore);
|
||||
}
|
||||
var div = $('<div></div>').attr('id', 'scorediv' + i);
|
||||
div.appendTo(content);
|
||||
var id = 'scorebardiv' + i;
|
||||
$('<div class="page-chart" style="height: 300px"></div>').attr('id', id).appendTo(div);
|
||||
InitScoreBar(q, content, id, data, vs, avgData);
|
||||
id = 'scorepiediv' + i;
|
||||
$('<div class="page-chart" style="height: 300px"></div>').attr('id', id).appendTo(div);
|
||||
InitScorePie(q, content, id, pieData);
|
||||
$('<br/>').appendTo(content);
|
||||
$('<br/>').appendTo(content);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// JSON.stringify([template, startdate, enddate, JSON.stringify(locations), JSON.stringify(advisors)]);
|
||||
|
||||
$(function () {
|
||||
setPageTitle(GetTextByKey("P_WOS_TEMPLATES_REPORT", "Report"), true);
|
||||
showmaskbg(true);
|
||||
|
||||
var param = $('#<%=@params.ClientID%>').val();
|
||||
reportrequest('GetSurveyTemplateReport', htmlencode(param), function (data) {
|
||||
//console.log(data);
|
||||
if (typeof (data) === "string") {
|
||||
showAlert(data, GetTextByKey('P_WOS_TEMPLATES_REPORT', "Report"));
|
||||
showmaskbg(false);
|
||||
return;
|
||||
}
|
||||
if (data != null) {
|
||||
InitReport(data);
|
||||
|
||||
setTimeout(function () { window.print() }, 1000);
|
||||
}
|
||||
|
||||
showmaskbg(false);
|
||||
}, function () {
|
||||
showmaskbg(false);
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
|
||||
<div style="min-width: 400px; width: 1000px">
|
||||
<div class="page_title" data-lgid="P_WOS_TEMPLATES_REPORT">Report</div>
|
||||
<div class="search_bar">
|
||||
<input type="hidden" id="params" runat="server" />
|
||||
<span data-lgid="P_WO_TEMPLATES_COLON">Template:</span>
|
||||
<div>
|
||||
<span id="templatename" style="margin-left: 5px" runat="server"></span>
|
||||
</div>
|
||||
<span id="startdate_span" style="margin-left: 5px" data-lgid="P_FR_BEGINDATE_COLON" runat="server">Begin Date: </span>
|
||||
<div>
|
||||
<span id="startdate" style="margin-left: 5px" runat="server"></span>
|
||||
</div>
|
||||
<span id="enddate_span" style="margin-left: 5px" data-lgid="P_FR_ENDDATE_COLON" runat="server">End Date: </span>
|
||||
<div>
|
||||
<span id="enddate" style="margin-left: 5px" runat="server"></span>
|
||||
</div>
|
||||
<span id="locations_span" data-lgid="P_WO_LOCATION_COLON" runat="server">Location:</span>
|
||||
<div id="locations" runat="server"></div>
|
||||
<span id="advisors_span" data-lgid="P_WO_ADVISOR_COLON" runat="server">Advisor:</span>
|
||||
<div id="advisors" runat="server"></div>
|
||||
</div>
|
||||
|
||||
<div class="clear"></div>
|
||||
<br />
|
||||
<div id="surveyreport"></div>
|
||||
|
||||
<div id="mask_bg" style="display: none;"><div class="loading c-spin"></div></div>
|
||||
|
||||
</div>
|
||||
</asp:Content>
|
||||
|
Reference in New Issue
Block a user