siteAzure验收清单
新系统的验收清单问题吧,由于站群系统,已有的验收清单总是没有按照节点排序或者其它情况或多或少的感觉不够完善!!因此自己特意制作了一个验收清单,最终目的是设置方便,所有栏目显示完整,按栏目排序显示,能列表显示也能表格形式显示;表格显示方便导出xls从而制作成栏目对应表,让客户填写对应旧站栏目!提供给开发迁移数据!
第一:添加设置验收清单
操作位置:内容管理-节点管理-创建内容节点
模板设置如下图:
设置完毕
第二:显示效果
(1)站群总览:
(2)各子站验收清单-表格式
表格它会根据当前站点的节点层级自动判断增加到 *级栏目,得益于利哥提供的当前栏目最大层级获取方法!
(3)各子站验收清单-列表式
综上实现了我们验收清单的目的,设置简单方便快捷!完工!
第三:代码部门展示
(1)PE站群站点
- @model Node
- @{
- Layout = null;
- var sites = new SiteService().GetMany(s => s.Enable);//获取开启的站群数据
- }
- >
- <html>
- <head>
- <meta name="viewport" content="width=device-width" />
- <title>@ViewBag.PageTitletitle>
- head>
- <body>
- <div class="bd">
- @if (sites.Any())
- {
- <ul class="site-list">
- @foreach (var site in sites)
- {
- <li>
- <a href="@Power.Url.NodeUrl(Model.Identifier)_@site.SiteId" target="_blank">@site.SiteNamea>
- li>
- }
- ul>
- }
- div>
- body>
- html>
@Power.Url.NodeUrl(Model.Identifier)_@site.SiteId 利用栏目分页形式从而避免缓存问题!
(2)PE节点列表-表格式
- @*列表页模板*@
- @{
- Layout = null;
- var nodeService = new NodeService();
- var siteId =int.Parse(Request.RequestContext.RouteData.Values["pageid"].ToString());//获取分页的数字
- var maxDepth = nodeService.GetMany(n => n.SiteId == siteId)
- .OrderByDescending(n => n.Depth)
- .FirstOrDefault()
- .Depth; //当前站点最大层数 author:郑利
- var Depth = maxDepth+1; //当前站点实际层级
- var siteServer = new SiteService().GetEntity(siteId);
- var childNodes = nodeService.GetMany(n=> n.SiteId == siteId && n.Depth ==0).OrderBy(n => n.Left);
- }
- >
- <html>
- <head>
- <meta name="viewport" content="width=device-width" />
- <title>@siteServer.SiteTitletitle>
- head>
- <body>
- <div class="check-list">
- <div class="hd">
- <h1 class="title">
- <text>@siteServer.SiteTitletext>节点目录检测清单
- h1>
- div>
- <div class="bd">
- <div class="th">
- <div class="btn"><button type="button" onclick="exportExl('nodeTable')">导出Excelbutton>div>
- <div class="title">节点目录div>
- div>
- <h2 class="sideName">
- <a class="a1" href="@Power.Url.SiteUrl(siteServer.Subdomain)">网站首页a>
- h2>
- <table class="ysqdTable" id="nodeTable">
- <tr class="title">
- <td class="id">IDtd>
- @for(var i = 0; i < Depth; i++)
- {<td>@(i+1)<text>级栏目text>td>}
- <td class="url">栏目地址td>
- tr>
- @foreach (var childnode in childNodes)
- {
- var childCount=(childnode.Right - childnode.Left -1)/2; //获取子栏目总数
- int subDepth=childnode.Depth+1;//子栏目层级
- string nodeUrl;
- if (childnode.NodeType == NodeType.Link)
- {
- nodeUrl = childnode.LinkUrl.StartsWith("http") ? childnode.LinkUrl : Power.Url.SiteUrl(childnode.Site.Subdomain) + childnode.LinkUrl;
- }
- else
- {
- nodeUrl = Power.Url.SiteUrl(childnode.Site.Subdomain) + Power.Url.NodeUrl(childnode);
- }
- <tr class="li1">
- <td class="id">@childnode.NodeIdtd>
- <td>
- <a class="a@(subDepth)" href="@nodeUrl" target="_blank">@childnode.NodeNamea>
- td>
- @for(var i = 0; i < (Depth-subDepth); i++)
- {<td>td>}
- <td class="url"><span>@nodeUrlspan>td>
- tr>
- if (childCount > 0 && subDepth < Depth)
- {
- <text>@Power.Partial("验收清单多级节点-表格式", new { NodeIdentifier = childnode.Identifier, Depth, siteIdsiteId=siteId, left=childnode.Left, right=childnode.Right, CurrentDepth = subDepth })
- text>
- }
- }
- table>
- div>
- div>
- body>
- html>
(3)验收清单多级节点-表格式
- @Power.VisualizationPartialView(new
- {
- Description = "验收清单多级节点-表格式",
- Parameters = new
- {
- NodeIdentifier = new { DisplayName = "节点标识符" },
- Count = new { DisplayName = "输出数量", Type = "Int32", ControlType = "Integer", DefaultValue = 99999 },
- Depth = new { DisplayName = "输出层数", Type = "Int32", ControlType = "Integer", DefaultValue = 2 },
- CurrentDepth = new { DisplayName = "当前层数", Type = "Int32", ControlType = "Integer", DefaultValue = 1 }
- }
- })
- @{
- var nodeService = new NodeService();
- string nodeIdentifier = Param.nodeIdentifier;
- int siteId=Param.siteId;
- //参数
- int Count = Param.Count ?? 99999; //输出数量
- int Depth = Param.Depth ?? 99; //输出层数
- int left = Param.left; //左边
- int right = Param.right; //右边
- int CurrentDepth = Param.CurrentDepth ?? 1; //当前层数
- var childNodes = nodeService.GetMany(n=> n.SiteId == siteId && n.Depth ==CurrentDepth && n.Left > left && n.Right < right).OrderBy(n => n.Left);
- }
- @foreach (Node childnode in childNodes)
- {
- var childCount=(childnode.Right - childnode.Left -1)/2; //获取子栏目总数
- int subDepth=childnode.Depth+1;//子栏目层级
- string nodeUrl;
- if (childnode.NodeType == NodeType.Link)
- {
- nodeUrl = childnode.LinkUrl.StartsWith("http") ? childnode.LinkUrl : Power.Url.SiteUrl(childnode.Site.Subdomain) + childnode.LinkUrl;
- }
- else
- {
- nodeUrl = Power.Url.SiteUrl(childnode.Site.Subdomain) + Power.Url.NodeUrl(childnode);
- }
- string className = "li" + subDepth;
- if (childCount > 0)
- {
- className += " hasUl" + subDepth;
- }
- string on = "on" + subDepth;
- <tr class="@className @Power.Focus(childnode.Identifier, on)">
- <td class="id">@childnode.NodeIdtd>
- @for(var i = 0; i < childnode.Depth; i++)
- {<td>td>}
- <td><a class="a@(subDepth)" href="@nodeUrl" target="_blank">@childnode.NodeNamea>td>
- @for(var i = 0; i < (Depth-subDepth); i++)
- {<td>td>}
- <td class="url"><span>@nodeUrlspan>td>
- tr>
- if (childCount > 0 && subDepth < Depth)
- {
- <text>
- @Power.Partial("验收清单多级节点-表格式", new { NodeIdentifier = childnode.Identifier, Depth,siteIdsiteId=siteId, left=childnode.Left, right=childnode.Right, CurrentDepth = subDepth })
- text>
- }
- }
第四:视图+标签压缩包
点击下载
用户登录
还没有账号?
立即注册