好友
阅读权限10
听众
最后登录1970-1-1
|
本帖最后由 xyxy1111 于 2026-5-18 19:49 编辑
在原创区看到了Thebzk君的原创软件:证照管理系统(https://www.52pojie.cn/thread-2105011-1-1.html),现在把我以前写的一个网页版的放上来,方便有需求的网友。
软件名称:中科文件存档系统(名称等均可自定义,详见下方的介绍)
软件类型:经典ASP + Access数据库
运行环境:Windows 7 以上 需要 IIS,没有IIS的可以安装压缩包里engine目录下的绿色版ASP服务软件和ADO数据库驱动。
本系统旨在便于中小型企事业单位集中收集、管理文件资料,支持灵活部署于内网或公网的 IIS 服务器上。
主要模块:
文件管理模块:支持文件的录入、编辑、删除以及附件管理。
用户管理模块:支持用户的录入、编辑、删除,并可设置用户的权限等级。
系统设置模块:可自定义系统名称、权限等级名称、下拉选项内容及字段标签等信息。
数据库中自带了20条演示数据。
以下为文件列表页的代码:
[HTML] 纯文本查看 复制代码 <!-- #include file="db.asp" -->
<%
CheckLogin 0
' 处理删除请求(在iframe内部直接处理)
if request("act") = "del" and request("id") <> "" then
CheckLogin 2
id = request("id")
Set rsd = Server.CreateObject("ADODB.Recordset")
sqld = "SELECT * FROM files WHERE id=" & id
rsd.Open sqld, conn, 1, 3
if rsd.eof then
msg = "未找到要删除的数据"
else
' 删除相关附件
Set rsa= Server.CreateObject("ADODB.Recordset")
Sqla = "Select * From att where f_id='"&id&"'"
rsa.open sqla, conn, 1, 3
if not rsa.eof then
do while not rsa.eof
fileName = rsa("url")
filePath = Server.MapPath("uploads/" & fileName)
Set fso = CreateObject("Scripting.FileSystemObject")
If fso.FileExists(filePath) Then
fso.DeleteFile(filePath), True
End If
Set fso = Nothing
rsa.delete
rsa.update
rsa.movenext
loop
end if
rsa.close
set rsa = nothing
set rsa=nothing
rsd.delete
rsd.update
msg = "成功删除数据"
End If
rsd.Close
set rsd = nothing
%>
<script>
// 删除后父页面左侧列表隐藏已被删除的条目
const reminderRow = parent.window.document.getElementById('reminder_<%=id%>');
if(reminderRow) reminderRow.style.display = 'none';
// 本页面弹出对话框并刷新
alert('<%=msg %>');
window.location.href='file_list.asp';
</script>
<%
Response.End
end if
keyword = Trim(Request.QueryString("keyword"))
page = Request.QueryString("page")
If IsNumeric(page) = False Or page = "" Then page = 1 Else page = CInt(page)
'构建查询语句
sql = "SELECT * FROM files WHERE 1=1"
If keyword <> "" Then
sql = sql & " AND (文件名称 LIKE '%" & Replace(keyword,"'","''") & "%' OR 责任部门 LIKE '%" & Replace(keyword,"'","''") & "%' OR 责任人 LIKE '%" & Replace(keyword,"'","''") & "%' OR 内容摘要 LIKE '%" & Replace(keyword,"'","''") & "%' OR 备注 LIKE '%" & Replace(keyword,"'","''") & "%' )"
End If
Set rs = Server.CreateObject("ADODB.Recordset")
sql = sql & " ORDER BY id desc"
rs.Open sql, conn, 1, 1
file_count=rs.recordcount
if file_count > 0 then
file_count="("&file_count&")"
else
file_count=""
end if
pagesize = conn.execute("select top 1 显示数量 from system ")(0)
If Not rs.EOF Then rs.PageSize = pagesize
totalPages = rs.PageCount
If page > totalPages Then page = totalPages
If page < 1 Then page = 1
If Not rs.EOF Then rs.AbsolutePage = page
%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<style>
* {box-sizing:border-box;outline:none;}
body { margin:0; padding:30px; text-align: center; }
a {text-decoration:none;transition: all 0.3s ease;}
a:link, a:visited, a:hover, a:active { color: inherit; /* 继承父元素的颜色 */}
li, li a {list-style:none;line-height:1.5;font-size:0.75rem;color:#666;}
li a:hover {color:#000;}
table {border-collapse: collapse; width:100%;border-radius:8px; text-align:left;overflow:hidden;box-shadow:0px 0px 30px rgba(0,0,0,0.3);justify-self:center;letter-spacing:1px;font-weight:100;table-layout: fixed;}
tr {border-top: 1px solid #ccc;}
tr:nth-of-type(odd) {background-color: #ffffff;}
tr:nth-of-type(even) {background-color: #f8f8f8;}
tr:last-child {border-bottom:0;}
th {padding:12px 10px;font-size:14px;font-weight:700;color:#555; background-image: linear-gradient(to top, #c5c5c5 0%, #F5F5F5 60%, #fff 100%);}
td {padding:8px 10px;font-size:0.8rem; word-break: break-word; }
th:last-child, td:last-child {text-align:center;}
textarea {resize: vertical;} /*只允许纵向拉伸*/
/*搜索框*/
#searchform {font-size:0;display:flex;box-shadow:0px 0px 15px rgba(0,0,0,0.4);border-radius:20px;height:40px;}
#searchKeyword {border-radius:20px 0px 0px 20px;border:none;padding:0 1rem;width:260px;height:100%;background:#fff;}
#btn-search {padding:0.5rem 1rem;cursor:pointer;background:#fff;color:#555;border:none;margin-left:0;border-radius:0px 20px 20px 0px;height:100%;transition:0.3s;}
/*页码导航框*/
.page_nav {font-weight:100;display:flex;align-items:baseline;justify-content:space-between;border:none;border-radius:40px;padding:6px 16px;box-shadow:0px 0px 15px rgba(0,0,0,0.4);width:300px;height:40px;}
/* 页码 */
.page_num {background: #666;color: #fff;border-radius: 40px;padding: 6px 16px;font-weight: 500;font-size: 0.75rem;letter-spacing: 0.2px; white-space: nowrap;display: inline-flex;align-items: baseline;gap: 0.2rem;}
.page_icon {color:#666;transition:0.5s ease;display: inline-block;}/*关键:a元素是默认inline,一定要设置为inlin-bolck或block*/
.page_icon:hover {animation: rotateOnce 0.5s ease forwards; /* forwards 保持最终状态 */}
@keyframes rotateOnce {
0% {transform: rotate(0deg);} 100% {transform: rotate(360deg);}
}
.page_icon a, .page_icon a:visited {color:#666;}
.disabled {cursor:not-allowed;opacity: 0.3;}
.disabled:hover {animation:none;}
/*按钮*/
.btn { padding:8px 20px; cursor:pointer; background-image: linear-gradient(to top, #c5c5c5 0%, #F5F5F5 60%, #fff 100%); color:#555; border-radius:4px; margin:0 1px; transition:0.3s ease; border:1px solid #c5c5c5;}
.btn:hover { border-color:#666;}
.small-btn {padding:4px 8px; cursor:pointer; background-image: linear-gradient(to top, #c5c5c5 0%, #F5F5F5 60%, #fff 100%); color:#555; border-radius:4px; margin:0 1px; transition:0.3s ease; border:1px solid #c5c5c5;}
.small-btn:hover { border-color:#666;}
</style>
</head>
<body>
<!--顶部搜索框和页码-->
<div style="display:flex;justify-content:space-between;margin-bottom:20px;height:40px;align-items: stretch; ">
<form id="searchform">
<div style="display:flex;align-items:center;">
<input type="text" id="searchKeyword" name="keyword" value="<%=keyword%>" placeholder="请输入关键字">
<button id="btn-search" type="submit" style=""><svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" fill="currentColor" viewBox="0 0 24 24"><path d="M18 10c0-4.41-3.59-8-8-8s-8 3.59-8 8 3.59 8 8 8c1.85 0 3.54-.63 4.9-1.69l5.1 5.1L21.41 20l-5.1-5.1A8 8 0 0 0 18 10M4 10c0-3.31 2.69-6 6-6s6 2.69 6 6-2.69 6-6 6-6-2.69-6-6"></path></svg></button>
</div>
</form>
<div class="page_nav" style="font-size:20px; font-weight:100; color:#555; letter-spacing:0.1em; text-align:center; display:flex; align-items:baseline; justify-content:center; border:none; border-radius:40px; padding:6px 16px; box-shadow:0px 0px 15px rgba(0,0,0,0.4); width:400px; height:40px;">文件列表<%=file_count%></div>
<div class="page_nav">
<%if page=1 then%>
<span class="page_icon disabled">◀</span>
<span class="page_icon disabled">◁</span>
<%else%>
<span class="page_icon"><a href="?keyword=<%=keyword%>&page=1" <%if page=1 then%>disabled<%end if%>>◀</a></span>
<span class="page_icon"><a href="?keyword=<%=keyword%>&page=<%=page-1%>">◁</a></span>
<%end if%>
<span class="page_num"><%=page%> / <%=totalPages%></span>
<%if page=totalPages then%>
<span class="page_icon disabled">▷</span>
<span class="page_icon disabled">▶</span>
<%else%>
<span class="page_icon"><a href="?keyword=<%=keyword%>&page=<%=page+1%>">▷</a> </span>
<span class="page_icon"><a href="?keyword=<%=keyword%>&page=<%=totalPages%>">▶</a></span>
<%end if%>
</div>
</div>
<!--文件列表主体-->
<table>
<%
Set rsl_show = Server.CreateObject("ADODB.Recordset")
sql_show = "SELECT top 1 * FROM system"
rsl_show.Open sql_show, conn, 1, 1
label_list = rsl_show("列表显示字段")
label_list = Trim(label_list)
If Right(label_list, 1) = "|" Then
label_list = Left(label_list, Len(label_list) - 1)
End If
rsl_show.close
set rsl_show = nothing
' 将label_list转换为数组
label_array = split(label_list, "|")
' 检查是否包含"附件"
Dim hasAttachment : hasAttachment = False
Dim attachmentIndex : attachmentIndex = -1
For i = 0 to UBound(label_array)
If label_array(i) = "附件" Then
hasAttachment = True
attachmentIndex = i
Exit For
End If
Next
%>
<thead>
<tr>
<%
For i = 0 to UBound(label_array)
If label_array(i) = "附件" Then
' 附件直接显示表头
%>
<th>附件</th>
<%
Else
' 从labels表获取显示名称
Set rs_label = Server.CreateObject("ADODB.Recordset")
sql_label = "select label_name from labels where relation='" & Replace(label_array(i), "'", "''") & "'"
rs_label.Open sql_label, conn, 1, 1
if not rs_label.eof then
label_display = rs_label("label_name")
else
label_display = label_array(i)
end if
rs_label.Close
Set rs_label = Nothing
%>
<th style="width:<%=85 / (UBound(label_array) + 1)%>%;"><%=label_display%></th>
<%
End If
Next
%>
<th style="width:15%;">操作</th>
</tr>
</thead>
<tbody>
<%
If Not rs.EOF Then
For iRow = 1 To rs.PageSize
If rs.EOF Then Exit For
id = rs("id")
%>
<tr>
<%
' 按label_array的顺序显示字段
For i = 0 to UBound(label_array)
If label_array(i) = "附件" Then
' 显示附件内容
%>
<td>
<%
set rsa = server.CreateObject("adodb.recordset")
Sqla = "Select * From att where f_id='" & id & "'"
rsa.open sqla, conn, 1, 1
if not rsa.eof then
do while not rsa.eof
att_id = rsa("att_id")
att_url = rsa("url")
splitpos = InStr(att_url, "_") ' 从左向右找第一个下划线
att_name = Left(att_url, splitpos - 1) ' 从下划线开始取到开头,不包含下划线
lastdot = InStrRev(att_url, ".") ' 从右往左找第一个点
ext = Mid(att_url, lastdot) ' 从点开始取到末尾,包含点
att_name=att_name&ext
%>
<li id='del<%=att_id%>'>
<a href='uploads/<%=att_url%>' download>📄 <%=att_name%></a>
</li>
<%
rsa.movenext
loop
else
Response.Write "-"
end if
rsa.close
set rsa = nothing
%>
</td>
<%
Else
' 显示普通字段
For each f in rs.Fields
If f.name = label_array(i) Then
f_value=f.value
If Not IsNull(f_value) Then
f_value=replace(f_value,"/","-")
end if
if len(f_value)>8 then f_value=left(f_value, 8)&"..."
%>
<td><%=f_value%></td>
<%
Exit For
End If
Next
End If
Next
%>
<td>
<% If g_UserRole >= 2 Then %>
<a href="file_edit.asp?id=<%=id%>"><button class="small-btn">编辑</button></a>
<a href="?act=del&id=<%=id%>"><input type="button" class="small-btn" value="删除"></a>
<% End If %>
<a href="file_view.asp?id=<%=id%>"><button class="small-btn">查看</button></a>
</td>
</tr>
<%
rs.MoveNext
Next
Else
Response.Write "<tr><td colspan='" & (UBound(label_array) + 2) & "' style='text-align:center;padding:20px;'>暂无数据</td></tr>"
End If
%>
</tbody>
</table>
<%
rs.Close
Set rs = Nothing
%>
</body>
</html>
下载地址:通过网盘分享的文件:文件存档系统.zip
链接: https://pan.baidu.com/s/1QraNpF-Ycby5w95T-7cFEQ?pwd=52pj |
-
03.png
(126.37 KB, 下载次数: 0)
-
07.png
(262.28 KB, 下载次数: 1)
-
04.png
(131.49 KB, 下载次数: 1)
-
05.png
(123.51 KB, 下载次数: 1)
-
06.png
(126.05 KB, 下载次数: 1)
-
08.png
(155.81 KB, 下载次数: 1)
-
09.png
(158.2 KB, 下载次数: 1)
-
10.png
(19.69 KB, 下载次数: 1)
-
01.png
(503.19 KB, 下载次数: 0)
-
02.png
(191.41 KB, 下载次数: 0)
免费评分
-
查看全部评分
|