@model List @{ ViewData["Title"] = "工具管理"; Layout = "_AdminLayout"; var categories = ViewBag.Categories as List ?? new List(); var currentCategory = ViewBag.CurrentCategory as int? ?? 0; var currentPage = ViewBag.CurrentPage as int? ?? 1; var totalPages = ViewBag.TotalPages as int? ?? 1; var totalCount = ViewBag.TotalCount as int? ?? 0; var pageSize = ViewBag.PageSize as int? ?? 20; }

工具管理

管理平台上的所有工具,添加、编辑或删除工具

标签管理
工具列表 (@totalCount)
@foreach (var tool in Model) { }
工具信息 分类 统计 标签 状态 创建时间 操作
@if (!string.IsNullOrEmpty(tool.Image)) { @tool.Name } else {
}
@tool.Name @if (!string.IsNullOrEmpty(tool.Description)) {
@(tool.Description.Length > 50 ? tool.Description.Substring(0, 50) + "..." : tool.Description) }
@tool.Category?.Name
@(tool.ViewCount > 1000 ? (tool.ViewCount / 1000).ToString("F0") + "K" : tool.ViewCount.ToString())
@if (tool.Rating > 0) {
@tool.Rating.ToString("F1")
}
@if (tool.IsHot) { 热门 } @if (tool.IsNew) { 新品 } @if (tool.IsRecommended) { 推荐 }
@if (tool.IsActive) { 启用 } else { 禁用 } @tool.CreatedAt.ToString("yyyy-MM-dd")
@if (!Model.Any()) {

暂无工具

还没有添加任何工具

} @if (totalPages > 1) {
@{ var startPage = Math.Max(1, currentPage - 2); var endPage = Math.Min(totalPages, currentPage + 2); } @for (int i = startPage; i <= endPage; i++) { }
}