📄 coursepanel.aspx
字号:
if(plan.DaysPlan[j].AM)
{
var rect=document.createElement("<v:rect style='Z-INDEX:3001;LEFT:"+left+";WIDTH:"+(unitWidth/2)+";POSITION:absolute;TOP:"+top+";HEIGHT:1200' filled='t' fillcolor='"+plan.CourseColor+"' strokecolor='black' strokeweight='1px' title='"+title+"' oncontextmenu=\"showCourseMenu('"+plan.DaysPlan[j].Date.getDate()+"')\"></v:rect>");
course.insertBefore(rect);
}
else
{
var rect=document.createElement("<v:rect style='Z-INDEX:3001;LEFT:"+left+";WIDTH:"+(unitWidth/2)+";POSITION:absolute;TOP:"+top+";HEIGHT:1200' filled='t' strokecolor='black' strokeweight='1px' oncontextmenu=\"showCourseMenu('"+plan.DaysPlan[j].Date.getDate()+"')\"></v:rect>");
course.insertBefore(rect);
}
if(plan.DaysPlan[j].PM)
{
var rect=document.createElement("<v:rect style='Z-INDEX:3001;LEFT:"+(left+unitWidth/2)+";WIDTH:"+(unitWidth/2)+";POSITION:absolute;TOP:"+top+";HEIGHT:1200' filled='t' fillcolor='"+plan.CourseColor+"' strokecolor='black' strokeweight='1px' oncontextmenu=\"showCourseMenu('"+plan.DaysPlan[j].Date.getDate()+"')\"></v:rect>");
course.insertBefore(rect);
}
else
{
var rect=document.createElement("<v:rect style='Z-INDEX:3001;LEFT:"+(left+unitWidth/2)+";WIDTH:"+(unitWidth/2)+";POSITION:absolute;TOP:"+top+";HEIGHT:1200' filled='t' strokecolor='black' strokeweight='1px' oncontextmenu=\"showCourseMenu('"+plan.DaysPlan[j].Date.getDate()+"')\"></v:rect>");
course.insertBefore(rect);
}
}
}
}
function getCurrentMonth()
{
var str=lbDate.innerText;
var yearPos=str.indexOf("年");
var monthPos=str.indexOf("月");
currentYear=parseInt(lbDate.innerText.substr(0,yearPos));
currentMonth=parseInt(lbDate.innerText.substr(yearPos+1,monthPos-yearPos))-1;
}
function previousMonth()
{
var sysDate=new Date();
sysDate.setFullYear(currentYear);
sysDate.setMonth(currentMonth-1);
lbDate.innerText=sysDate.getFullYear().toString()+"年"+(sysDate.getMonth()+1)+"月";
drawScale();
}
function nextMonth()
{
var sysDate=new Date();
sysDate.setFullYear(currentYear);
sysDate.setMonth(currentMonth+1);
lbDate.innerText=sysDate.getFullYear().toString()+"年"+(sysDate.getMonth()+1)+"月";
drawScale();
}
function getSelectedID()
{
var found=false;
for(var i=2;i<ClassAccordion.childNodes.length;i+=2)
{
var table=ClassAccordion.childNodes[i].firstChild;
if(table.tagName=="DIV")
table=table.firstChild;
for(var j=0;j<table.rows.length;j++)
{
if(table.rows[j].className=="selectedrow")
{
selectedID=parseInt(table.rows[j].classID);
found=true;
break;
}
}
if(found)
{
break;
}
}
if(!found && ClassAccordion.childNodes.length>2 && ClassAccordion.childNodes[2].firstChild.rows.length>0)
{
selectedID=parseInt(ClassAccordion.childNodes[2].firstChild.rows[0].classID);
ClassAccordion.childNodes[2].firstChild.rows[0].className="selectedrow";
}
}
function showClassPlan()
{
drawScale();
}
/******其它******/
function selectRow(row)
{
for(var i=2;i<ClassAccordion.childNodes.length;i+=2)
{
var table=ClassAccordion.childNodes[i].firstChild;
if(table.tagName=="DIV")
table=table.firstChild;
for(var j=0;j<table.rows.length;j++)
{
table.rows[j].className="";
}
}
selectedID=parseInt(row.classID);
row.className="selectedrow";
drawScale();
}
function overRow(row)
{
if(row.className!="selectedrow")
row.className="overrow";
}
function outRow(row)
{
if(row.className!="selectedrow")
row.className="";
}
function clickItem(menuType,index)
{
alert(index);
curseMenu.style.display="none";
}
/*********/
function showCourseMenu(date)
{
classMenu.style.display="none";
curseMenu.style.left=event.clientX;
curseMenu.style.top=event.clientY;
curseMenu.style.display="block";
}
function showClassMenu()
{
if(event.srcElement.tagName=="rect")
return;
curseMenu.style.display="none";
classMenu.style.left=event.clientX;
classMenu.style.top=event.clientY;
classMenu.style.display="block";
}
</script>
</head>
<body onload="drawScale()" onresize="changeGroupSize()" bottomMargin="0" leftMargin="0" topMargin="0" rightMargin="0" style="overflow:hidden">
<form id="form1" runat="server">
</table>
<table id="classMenu" class="menu" width="100" style="position:absolute;filter : progid:DXImageTransform.Microsoft.DropShadow(color=#000666,offX=2 offY=2,positives=true);display:none">
<tr style="cursor:hand" onclick="clickItem(this.parentElement.id,this.rowIndex)" onmouseout="outRow(this)" onmouseover="overRow(this)">
<td>改变班级状态</td>
</tr>
<tr style="cursor:hand" onclick="clickItem(this.parentElement.id,this.rowIndex)" onmouseout="outRow(this)" onmouseover="overRow(this)">
<td >新增课程计划</td>
</tr>
</table>
<table id="curseMenu" class="menu" width="100" style="position:absolute;filter : progid:DXImageTransform.Microsoft.DropShadow(color=#000666,offX=2 offY=2,positives=true);display:none">
<tr style="cursor:hand" onclick="clickItem(this.parentElement.id,this.rowIndex)" onmouseout="outRow(this)" onmouseover="overRow(this)">
<td>插入活动</td>
</tr>
<tr style="cursor:hand" onclick="clickItem(this.parentElement.id,this.rowIndex)" onmouseout="outRow(this)" onmouseover="overRow(this)">
<td >插入临时课</td>
</tr>
<tr style="cursor:hand" onclick="clickItem(this.parentElement.id,this.rowIndex)" onmouseout="outRow(this)" onmouseover="overRow(this)">
<td >更改时间安排</td>
</tr>
<tr style="cursor:hand" onclick="clickItem(this.parentElement.id,this.rowIndex)" onmouseout="outRow(this)" onmouseover="overRow(this)">
<td >更改授课教员</td>
</tr>
</table>
<asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="true"></asp:ScriptManager>
<table border="1" width="100%" height="100%" style="border-collapse:collapse;">
<tr><td width="190" valign="top" style="background-color: whitesmoke;">
<table width="190px" height="100%">
<tr style="height:30px">
<td valign="top">
<table width="190" style="font-size:9pt">
<tr>
<td style="width: 40px">
<a href="javascript:previousMonth()"><<</a>
</td>
<td>
<asp:Label ID="lbDate" runat="server"></asp:Label></td>
<td style="width: 40px">
<a href="javascript:nextMonth()">>></a>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td valign="top">
<ajaxToolkit:Accordion ID="ClassAccordion" runat="server" SelectedIndex="0"
HeaderCssClass="accordionHeader" HeaderSelectedCssClass="accordionHeaderSelected"
ContentCssClass="accordionContent" FadeTransitions="false" FramesPerSecond="40"
TransitionDuration="250" AutoSize="None" RequireOpenedPane="false" SuppressHeaderPostbacks="true">
<HeaderTemplate><a href="" class="accordionLink"><%# Eval("Name") %></a></HeaderTemplate>
<ContentTemplate>
<asp:Repeater ID="RepeaterClass" DataSource='<%# Eval("Classes") %>' runat="server">
<HeaderTemplate><table width="95%" border="0" cellpadding="2" cellspacing="2" style="font-size:9pt"></HeaderTemplate>
<ItemTemplate><tr classID='<%# Eval("ID")%>' style="cursor:hand" onclick="selectRow(this)" onmouseout="outRow(this)" onmouseover="overRow(this)"><td><%# Eval("ClassName")%></td></tr></ItemTemplate>
<FooterTemplate></table></FooterTemplate>
</asp:Repeater>
</ContentTemplate>
</ajaxToolkit:Accordion>
</td>
</tr>
</table>
</td>
<td>
<div style="width:100%;height:100%;overflow:auto" oncontextmenu="showClassMenu()">
<v:group ID="course" style="width:100%;height:100%" coordsize="755160,500000"></v:group></DIV>
</td>
</tr>
</form>
<script type="text/javascript">
document.oncontextmenu=function()
{
if(event.srcElement.tagName!="rect")
curseMenu.style.display="none";
event.returnValue=false;
}
document.body.onclick=function()
{
if(event.srcElement.tagName=="rect")
{
if(event.button!=2)
{
curseMenu.style.display="none";
classMenu.style.display="none";
}
}
else
{
curseMenu.style.display="none";
classMenu.style.display="none";
}
}
</script>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -