📄 node_o.inc
字号:
<%
Function TableNodes(SelectedNodeId)
dim sDepartmentId, sDepartmentName
dim sSQL, crs, rs
dim sColor
sSQL = "select node_id, node_name from t_node where node_level = 2 and co_id = " & GetCoId
set crs = New CRecordset
set rs = crs.Open(dbLocal, sSQL)
Response.Write vbLF & vbLF & vbLF
Response.Write "<table cellspacing=0 cellpadding=3 border=0 width=155>" & vbLF & _
"<!--tr><td bgcolor=""#0040a0"" style=""color:white;"">组织结构树形图</td></tr!-->" & vbLF
while Not rs.EOF
sDepartmentId = crs.GetValue("node_id")
sDepartmentName = crs.GetValue("node_name")
if CStr(sDepartmentId) = CStr(SelectedNodeId) then
sColor = "red"
else
sColor = "black"
end if
Response.Write _
" <tr>" & vbLF & _
" <td style=""cursor:hand;color" & sColor & """>" & _
"<img id=""img_" & sDepartmentId & """ border=0 src=""images/minus.gif"" onclick=""showhide(img_" & sDepartmentId & ", tblChild_" & sDepartmentId & ")"">" & _
" " &_
"<span id=node title=""点击可编辑部门信息"" onclick=""showhide(img_" & sDepartmentId & ", tblChild_" & sDepartmentId & ");" & _
"window.frames('winDetail').location.href='node_oe.asp?node_level=2&node_id=" & sDepartmentId & "&'"">" & sDepartmentName & "</span>" & _
" " & _
"<span onclick=""ResetColorStyle();window.frames('winDetail').location.href='node_oe.asp?node_level=3&parent_node_id=" & sDepartmentId& "';""><img border=0 src=""images/add.gif"" title=""点击可在该部门下新增岗位""></span></td>" & _
" </tr>" & vbLF
Response.Write _
" <tr id=tblChild_" & sDepartmentId & " style=""display:block""><td>" & TablePositions(sDepartmentId, selectedNodeId) & "</td></tr>" & vbLF
rs.movenext
if sColor = "red" then
Response.Write "<script language=""javascript"">tblChild_" & selectedNodeId & ".style.display='block';</script>"
end if
wend
crs.Close()
Response.Write "</table>"
Response.Write vbLF & vbLF & vbLF
End Function
Function TablePositions(parent_node_id, selectedNodeId)
dim sPositionId, sPositionName
dim sSQL, crs, rs
dim sTemp, sColor
sSQL = "select node_id, node_name from t_node where node_level = 3 and parent_node_id = " & parent_node_id & " and co_id = " & GetCoId
set crs = New CRecordset
set rs = crs.Open(dbLocal, sSQL)
while not rs.EOF
sPositionId = crs.GetValue("node_id")
sPositionName = crs.GetValue("node_name")
if CStr(sPositionId) = CStr(selectedNodeId) then
sColor = "red"
else
sColor = "black"
end if
sTemp = sTemp & _
" <tr>" & vbLF & _
" <td id=node title=""点击可编辑岗位信息"" style=""cursor:hand;color:" & sColor & """ onclick=""ResetColorStyle();window.frames('winDetail').location.href='node_oe.asp?node_level=3&node_id=" & sPositionId & "&'""> <img border=0 src=""images/man.gif""> " & sPositionName & "</td>" & vbLF & _
" </tr>" & vbLF
if sColor = "red" then
sTemp = sTemp & "<script language=""javascript"">tblChild_" & parent_node_id & ".style.display='block';</script>" & vbLF
end if
rs.movenext
wend
crs.Close()
if sTemp <> "" then
sTemp = "<table cellspacing=0 cellpadding=1 bgcolor=white border=0>" & vbLF & sTemp & "</table>" & vbLF
end if
TablePositions = sTemp
End Function
Function TableLink()
TableLink = _
"<table width=600 cellspacing=0 cellpadding=0 border=0 align=center>" & vbLF & _
"<tr height=10>" & vbLF & _
" <td width=600><img src=""../images/bg/line.gif"" width=600 height=3></td>" & vbLF & _
"</tr>" & vbLF & _
"<tr>" & vbLF & _
" <td width=600> " & vbLF & _
" <img src=""../images/goto.gif""> <span style=""cursor:hand;color:gray"" onmouseover=""this.style.color='black';"" onmouseout=""this.style.color='gray';"" onclick=""window.frames('winDetail').location.href='node_oe.asp?node_level=2&';"">新增部门</span></td>" & vbLF & _
"</tr>" & vbLF & _
"</table>" & vbLF
End Function
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -