📄 sysplanmgr_main_bak.asp
字号:
<html>
<head>
<title>The only official FolderTree by Essence Associates Ltd.</title>
<!-- #include file="../include/common.inc" -->
<!-- #include file="../include/commonpage.inc" -->
<!-- #include file="sysplanmgr.inc" -->
<!--link rel="stylesheet" href="ftstyle.css"-->
<link rel="stylesheet" href="../include/common.css">
<!-- Infrastructure code for the tree -->
<script language = "Javascript" src = "tree/ft.js"></script>
<script language = "Javascript" src = "tree/ftoptions.js"></script>
<script language = "Javascript">
</script>
<script language="JavaScript">
//修改此处可以修改页面风格
defFolderFont = "<font><span style=\"font-family:宋体; font-size:9pt\">"
defDocFont = "<font><span style=\"font-family:宋体; font-size:9pt\">"
<%
response.write "fT = gFld(""设备系统树形结构"&""", ""blank.asp"");"
dim rs, rs1, top, sql_text, stacktop, i, ParentLevel, conn
set conn=DBConnection
set rs = Server.CreateObject("ADODB.Recordset")
set rs1 = Server.CreateObject("ADODB.Recordset")
' 查找所有父节点为"0"的节点,即"根系统"
sql_text = "select * from t_sys where parent_id=0 order by sys_id asc"
' response.write sql_text
' response.end
rs.open sql_text, conn
' 定义堆栈。可根据实际情况定义大小。此处是10('6'是指每个栈元素分别存放6个字段值)
dim stack(100,8)
while not rs.eof
stack(0,0) = rs("sys_id")
stack(0,1) = rs("sys_desc")
stack(0,2) = rs("sys_level")
stack(0,3) = rs("parent_id")
stack(0,4) = rs("remark")
stack(0,5) = rs("has_child")
stack(0,6) = 0
top = 1
do until top = 0
stacktop = stack(top-1,0)
' 查找所有父节点为栈顶节点的记录
sql_text = "select * from t_sys where parent_id = " & StackTop & " order by sys_id desc"
rs1.open sql_text, conn
ParentLevel = stack(top-1,6)
' 清空栈顶之前获得父记录的层数
' 输出栈顶元素
' if stack(top-1,5) = 1 and stack(top-1,2) = 1 then'输出根枝节点
' Response.write "aux1 = insFld(fT, gFld("""& stack(top-1,1) & """, ""updatesysplan.asp?id="& stack(top-1,0)&" ""));"
' elseif stack(top-1,5) = 1 then'输出枝节点
' Response.write "aux"&stack(top-1,2)&"=insFld(aux"&stack(top-1,2)-1 & ", gFld("""&stack(top-1,1)&""", ""updatesysplan.asp?id="& stack(top-1,0)&" ""));"
' elseif stack(top-1,2) = 1 then'输出根页节点
' Response.write "insDoc(fT, gLnk("""&stack(top-1,1)&""", ""updatesysplan.asp?id="& stack(top-1,0)&" ""));"
' else '输出页节点
' Response.write "insDoc(aux"&stack(top-1,2)-1 & ", gLnk("""&stack(top-1,1)&""", ""updatesysplan.asp?id="& stack(top-1,0)&" ""));"
' end if
'
' 以下代码生成树状列表的内容,形似如下结构
' 根文件夹(即parent_id=0 and has_child=1): aux1 = insFld(fT, gFld("Europe", "ftbase2.htm"))
' 非根文件夹(即parent_id<>0 and has_child=1): aux2 = insFld(aux1, gFld("United Kingdom", "ftbase3.htm"))
' 根文件(即parent_id=0 and has_child=0): insDoc(fT, gLnk("Edinburgh", "ftbase2.htm"))
' 非根文件(即parent_id<>0 and has_child=0): insDoc(aux3, gLnk("Edinburgh", "ftbase2.htm"))
dim s1,s2,s3,s4,s5,s6,s7,s
s1 = "aux" & (ParentLevel + 1)
s2 = "aux" & ParentLevel
s3 = "<a target=basefrm href=updatesysplan.asp?objecttype=0&id="&stack(top-1,0)&">"&stack(top-1,1)&"</a>"
s4 = "updatesysplan.asp?id="&stack(top-1,0)
s5 = "gFld("""& s3 &""","""& s4 &""")"
s7 = "gLnk("""& s3 &""","""& s4 &""")"
if ParentLevel = 0 and stack(top-1,5) = 1 then'输出根文件夹
s6 = "insFld("& "fT" &","& s5 &")"
s = s1 & "=" & s6 & ";"
response.write s
elseif stack(top-1,5) = 1 then'输出非根文件夹
s6 = "insFld("& s2 &","& s5 &")"
s = s1 & "=" & s6 & ";"
response.write s
elseif ParentLevel = 0 then'输出根文件
s6 = "insDoc("& "fT" &","& s7 &")"
s = s6 & ";"
response.write s
else '输出非根文件
s6 = "insDoc("& s2 &","& s7 &")"
s = s6 & ";"
response.write s
end if
for i = 0 to 5
' 清空堆栈顶部
stack(top-1,i) = ""
next
' 栈顶向下移动一格
top = top - 1
while not rs1.eof
stack(top, 0) = rs1("sys_id")
stack(top, 1) = rs1("sys_desc")
stack(top, 2) = rs1("sys_level")
stack(top, 3) = rs1("parent_id")
stack(top, 4) = rs1("remark")
stack(top, 5) = rs1("has_child")
' 将查找到的栈顶节点"派生出"的全部子记录存入堆栈
stack(top, 6) = ParentLevel + 1
rs1.movenext
top = top + 1
wend
rs1.close
loop
rs.movenext
wend
rs.close
set rs = nothing
set rs1 = nothing
%>
</script>
</head>
<FRAMESET cols="200,*" frameborder=0 onLoad="self.rewritepage()">
<FRAME frameborder=0 SRC = "blank.asp" scrolling=yes name="menufrm" >
<FRAME frameborder=0 SRC="blank.asp" scrolling = no name="basefrm">
</FRAMESET>
<body>
</body>
</HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -