194 lines
8.5 KiB
Plaintext
194 lines
8.5 KiB
Plaintext
<%@ Page Title="" Language="C#" MasterPageFile="../IronIntelMasterPage.master" AutoEventWireup="true" CodeFile="Maintenance.aspx.cs" Inherits="Maintenance_Maintenance" %>
|
|
|
|
<asp:Content ID="Content1" ContentPlaceHolderID="holder_head" runat="Server">
|
|
<link href="<%=GetFileUrlWithVersion("../css/split.css")%>" rel="stylesheet" type="text/css" />
|
|
<script src="<%=GetFileUrlWithVersion("../js/split.js")%>"></script>
|
|
<script type="text/javascript">
|
|
$(function () {
|
|
setFavoriteDisplay(true);
|
|
|
|
_network.query = function (method, param, callback, error) {
|
|
_network.request("Maintenance/Maintenance.aspx", -1, method, param, callback, error);
|
|
}
|
|
var surveysubitems = [];
|
|
_network.query('GetNavs', '', function (data) {
|
|
if (data != null && data.length > 0) {
|
|
var list = [];
|
|
for (var i = 0; i < data.length; i++) {
|
|
var icon = null;
|
|
if (data[i].ID == "nav_customerrecord" || data[i].ID == "nav_workorder") {
|
|
var src = data[i].IconPath;
|
|
if (!src) {
|
|
src = 'img/none.png';
|
|
}
|
|
icon = $('<img style="width: 20px; height: 20px;"/>').attr("src", src);
|
|
}
|
|
else
|
|
icon = $('<button></button>');
|
|
var title = getNavInfoByID(data[i].ID, data[i].Title, icon);
|
|
|
|
var li = $('<li class="nav_item"></li>').attr({
|
|
'id': data[i].ID,
|
|
'page': data[i].Url,
|
|
'title': title
|
|
});
|
|
var a = $('<a></a>')
|
|
if (data[i].ID !== 'nav_customersatisfactionsurveys')
|
|
a.attr('href', '#' + data[i].ID);
|
|
else {
|
|
a.click(function (ev) {
|
|
if ($('#set_left').prop('isexpanded'))
|
|
return;
|
|
if ($('.panel_holder.subitems').is(':visible')) {
|
|
return;
|
|
}
|
|
createSubMenus(surveysubitems);
|
|
|
|
var left = $(this).offset().left;
|
|
var top = $(ev.target).offset().top - 80;
|
|
$('.panel_holder.subitems').css({
|
|
'opacity': 0,
|
|
'left': 60,
|
|
'right': 'auto',
|
|
'top': top
|
|
}).show().animate({ 'opacity': 1 }, 100);
|
|
$('.panel_holder.subitems .trigle').css({
|
|
'left': -10,// left - $('.panel_holder.favorites').offset().left,
|
|
'right': 'auto',
|
|
'top': 3
|
|
});
|
|
return false;
|
|
});
|
|
}
|
|
var divicon = $('<div></div>').append(icon);
|
|
a.append(divicon);
|
|
var span_title = $('<span></span>').text(title);
|
|
if (data[i].ID === 'nav_surveymanagementresult' || data[i].ID === 'nav_wosurveytemplate' || data[i].ID === 'nav_wosurveytemplatereport') {
|
|
span_title.css('padding-left', 12);
|
|
li.addClass('subitem');
|
|
surveysubitems.push(data[i]);
|
|
}
|
|
a.append(span_title);
|
|
li.append(a);
|
|
list.push(li);
|
|
}
|
|
$('.ul_menu').append(list);
|
|
}
|
|
|
|
if (data.length > 0) {
|
|
default_page = '#' + data[0].ID;
|
|
if (!old_hash) {
|
|
old_hash = default_page;
|
|
}
|
|
|
|
window.changePage(old_hash);
|
|
} else {
|
|
// 无权限时跳转至登录页面
|
|
window.location.href = '<%=LoginPageUrl%>';
|
|
}
|
|
|
|
if ($('#set_left').prop('isexpanded'))
|
|
$('#set_left').find(".subitem").show();
|
|
else
|
|
$('#set_left').find(".subitem").hide();
|
|
|
|
}, function (e) {
|
|
console.log(e);
|
|
});
|
|
|
|
function createSubMenus(items) {
|
|
var maintenancesubmenu = $("#maintenancesubmenu").empty();
|
|
var ulsubmenus = $('<ul class="lefttitlemenu_ul" style="line-height:32px;"></ul>');
|
|
maintenancesubmenu.append(ulsubmenus);
|
|
for (var i = 0; i < items.length; i++) {
|
|
var item = items[i];
|
|
if (!item) continue;
|
|
var li = $('<li></li>');
|
|
var a = $('<a></a>').append($("<span></span>").text(getNavInfoByID(item.ID, item.Title, null)));
|
|
a.attr('href', '#' + item.ID);
|
|
li.append(a);
|
|
ulsubmenus.append(li);
|
|
}
|
|
}
|
|
|
|
window.changePage(old_hash);
|
|
});
|
|
|
|
function getNavInfoByID(id, title1, icon) {
|
|
var title = title1;
|
|
if (id === "nav_alertsmanagement") {
|
|
title = GetTextByKey("P_ALERTSMANAGEMENTNEW", title);
|
|
$(icon).addClass("iconmanagealerts");
|
|
}
|
|
else if (id === "nav_alertsmappings") {
|
|
title = GetTextByKey("P_ALERTMAPPINGS", title);
|
|
$(icon).addClass("iconalertsmappings");
|
|
}
|
|
else if (id === "nav_workorder") {
|
|
title = GetTextByKey("P_WORKORDERNEW", title);
|
|
$(icon).addClass("iconworkorder");
|
|
}
|
|
else if (id === "nav_workorderhis") {
|
|
title = GetTextByKey("P_WORKORDERHISTORY", title);
|
|
$(icon).addClass("iconhistory");
|
|
}
|
|
else if (id === "nav_record") {
|
|
title = GetTextByKey("P_MAINTENANCERECORDLEGACY", title);
|
|
$(icon).addClass("iconrecord");
|
|
}
|
|
else if (id === "nav_fuelrecord") {
|
|
title = GetTextByKey("P_FUELRECORDS", title);
|
|
$(icon).addClass("iconfuelrecord");
|
|
}
|
|
else if (id === "nav_maintenanceschedule") {
|
|
title = GetTextByKey("P_PM_MAINTENANCESCHEDULES", title);
|
|
$(icon).addClass("iconmaintenanceschedule");
|
|
}
|
|
else if (id === "nav_customerrecord") {
|
|
title = GetTextByKey("P_CUSTOMERRECORD", title);
|
|
//$(icon).addClass("iconmaintenanceschedule");
|
|
}
|
|
else if (id === "nav_customersatisfactionsurveys") {
|
|
title = GetTextByKey("P_CUSTOMERSATISFACTIONSURVEYS", title);
|
|
$(icon).addClass("icontemplate");
|
|
}
|
|
else if (id === "nav_surveymanagementresult") {
|
|
title = GetTextByKey("P_WOS_SURVEYMANAGEMENTRESULT", title);
|
|
}
|
|
else if (id === "nav_wosurveytemplate") {
|
|
title = GetTextByKey("P_WOS_TEMPLATES", title);
|
|
}
|
|
else if (id === "nav_wosurveytemplatereport") {
|
|
title = GetTextByKey("P_WOS_TEMPLATES_REPORT", title);
|
|
}
|
|
return title;
|
|
}
|
|
|
|
function afterpagechanged(hash, name) {
|
|
setFavorateStyle(hash, name);
|
|
};
|
|
</script>
|
|
</asp:Content>
|
|
<asp:Content ID="Content2" ContentPlaceHolderID="holder_content" runat="Server">
|
|
<div id="set_left">
|
|
<ul class="ul_menu">
|
|
<li id="nav_arrow">
|
|
<div class="icn collapse"></div>
|
|
</li>
|
|
</ul>
|
|
<div class="hostmask maskbg" style="display: none;"></div>
|
|
</div>
|
|
<div id="set_right">
|
|
<div class="loading_holder">
|
|
<div class="loading_icon icn icn-spin"></div>
|
|
</div>
|
|
</div>
|
|
<div class="panel_holder subitems">
|
|
<div id="maintenancesubmenu" class="menupanel panel">
|
|
</div>
|
|
<div class="trigle" style="left: -12px; right: auto;"></div>
|
|
<div class="trigle white" style="left: -12px; right: auto;"></div>
|
|
</div>
|
|
</asp:Content>
|
|
|