344 lines
13 KiB
Plaintext
344 lines
13 KiB
Plaintext
@using Core.Web.WebHelper
|
|
@using Core.Web.WebHelper.UserRight
|
|
@using System;
|
|
@{
|
|
Layout = null;
|
|
int buttonId = (int)ViewBag.buttonId;
|
|
ToolBar[] toolBars = (ToolBar[])ViewBag.toolBars;
|
|
var rightcode = ViewBag.rightcode;
|
|
var script = "<script type=\"text / html\" id=\"toolbar\">";
|
|
}
|
|
|
|
@if ((buttonId & ToolBarConfig.CONST_Add) > 0)
|
|
{
|
|
var site = UserRightsHelper.GetUserButtonSite(rightcode, ToolBarConfig.CONST_Add);
|
|
if (site.Contains("1"))
|
|
{
|
|
<input class="layui-btn layui-btn-normal" data-method="add" type="button" value="+新增" />
|
|
}
|
|
if (site.Contains("2"))
|
|
{
|
|
script += "<a class=\"layui-btn layui-btn-normal layui-btn-xs\" lay-event=\"create\">新增</a>";
|
|
}
|
|
}
|
|
@if ((buttonId & ToolBarConfig.CONST_Edit) > 0)
|
|
{
|
|
var site = UserRightsHelper.GetUserButtonSite(rightcode, ToolBarConfig.CONST_Edit);
|
|
if (site.Contains("1"))
|
|
{
|
|
<input class="layui-btn layui-btn-normal" data-method="edit" type="button" value="编辑" />
|
|
}
|
|
if (site.Contains("2"))
|
|
{
|
|
script += "<a class=\"layui-btn layui-btn-normal layui-btn-xs\" lay-event=\"edit\">编辑</a>";
|
|
}
|
|
}
|
|
@if ((buttonId & ToolBarConfig.CONST_Details) > 0)
|
|
{
|
|
var site = UserRightsHelper.GetUserButtonSite(rightcode, ToolBarConfig.CONST_Details);
|
|
if (site.Contains("1"))
|
|
{
|
|
<input class="layui-btn layui-btn-normal" data-method="detail" type="button" value="详细" />
|
|
}
|
|
if (site.Contains("2"))
|
|
{
|
|
script += "<a class=\"layui-btn layui-btn-normal layui-btn-xs\" lay-event=\"detail\">详细</a>";
|
|
}
|
|
}
|
|
@if ((buttonId & ToolBarConfig.CONST_Check) > 0)
|
|
{
|
|
var site = UserRightsHelper.GetUserButtonSite(rightcode, ToolBarConfig.CONST_Check);
|
|
if (site.Contains("1"))
|
|
{
|
|
<input class="layui-btn layui-btn-normal" data-method="check" type="button" value="审核" />
|
|
}
|
|
if (site.Contains("2"))
|
|
{
|
|
script += "<a class=\"layui-btn layui-btn-warm layui-btn-xs\" lay-event=\"check\">审核</a>";
|
|
}
|
|
}
|
|
@if ((buttonId & ToolBarConfig.CONST_Delete) > 0)
|
|
{
|
|
var site = UserRightsHelper.GetUserButtonSite(rightcode, ToolBarConfig.CONST_Delete);
|
|
if (site.Contains("1"))
|
|
{
|
|
<input class="layui-btn layui-btn-danger" data-method="delete" type="button" value="删除" />
|
|
}
|
|
if (site.Contains("2"))
|
|
{
|
|
script += "<a class=\"layui-btn layui-btn-danger layui-btn-xs\" lay-event=\"delete\">删除</a>";
|
|
}
|
|
}
|
|
@if ((buttonId & ToolBarConfig.CONST_Export) > 0)
|
|
{
|
|
var site = UserRightsHelper.GetUserButtonSite(rightcode, ToolBarConfig.CONST_Export);
|
|
if (site.Contains("1"))
|
|
{
|
|
<input class="layui-btn layui-btn-normal" data-method="export" type="button" value="导出" />
|
|
}
|
|
if (site.Contains("2"))
|
|
{
|
|
script += "<a class=\"layui-btn layui-btn-normal layui-btn-xs\" lay-event=\"export\">导出</a>";
|
|
}
|
|
}
|
|
|
|
@if ((buttonId & ToolBarConfig.CONST_Other1) > 0)
|
|
{
|
|
var site = UserRightsHelper.GetUserButtonSite(rightcode, ToolBarConfig.CONST_Other1);
|
|
ToolBar bar = toolBars.FirstOrDefault(m => m.btnType == ToolBarConfig.CONST_Other1);
|
|
if (bar != null) { }
|
|
if (site.Contains("1") && bar != null)
|
|
{
|
|
if (string.IsNullOrEmpty(bar.icon))
|
|
{
|
|
<input class="layui-btn @Html.Raw(string.IsNullOrEmpty(bar.btnColor) ? "layui-btn-normal" : bar.btnColor)" data-method="other1" type="button" value="@Html.Raw(bar.btnName)" />
|
|
}
|
|
else
|
|
{
|
|
<button type="button" class="layui-btn @Html.Raw(string.IsNullOrEmpty(bar.btnColor) ? "layui-btn-normal" : bar.btnColor)" data-method="other1">
|
|
<i class="layui-icon @Html.Raw(bar.icon)"></i>
|
|
@Html.Raw(bar.btnName)
|
|
</button>
|
|
}
|
|
if (bar.isSpace)
|
|
{
|
|
<span style="padding-right:20px"></span>
|
|
}
|
|
}
|
|
if (site.Contains("2") && bar != null)
|
|
{
|
|
script += "<a class=\"layui-btn layui-btn-normal layui-btn-xs\" lay-event=\"other1\">" + bar.btnName + "</a>";
|
|
}
|
|
}
|
|
}
|
|
@if ((buttonId & ToolBarConfig.CONST_Other2) > 0)
|
|
{
|
|
var site = UserRightsHelper.GetUserButtonSite(rightcode, ToolBarConfig.CONST_Other2);
|
|
ToolBar bar = toolBars.FirstOrDefault(m => m.btnType == ToolBarConfig.CONST_Other2);
|
|
if (site.Contains("1") && bar != null)
|
|
{
|
|
if (string.IsNullOrEmpty(bar.icon))
|
|
{
|
|
<input class="layui-btn @Html.Raw(string.IsNullOrEmpty(bar.btnColor) ? "layui-btn-normal" : bar.btnColor)" data-method="other2" type="button" value="@Html.Raw(bar.btnName)" />
|
|
}
|
|
else
|
|
{
|
|
<button type="button" class="layui-btn @Html.Raw(string.IsNullOrEmpty(bar.btnColor) ? "layui-btn-normal" : bar.btnColor)" data-method="other2">
|
|
<i class="layui-icon @Html.Raw(bar.icon)"></i>
|
|
@Html.Raw(bar.btnName)
|
|
</button>
|
|
}
|
|
if (bar.isSpace)
|
|
{
|
|
<span style="padding-right:20px"></span>
|
|
}
|
|
}
|
|
if (site.Contains("2") && bar != null)
|
|
{
|
|
script += "<a class=\"layui-btn layui-btn-normal layui-btn-xs\" lay-event=\"other2\">" + bar.btnName + "</a>";
|
|
}
|
|
}
|
|
@if ((buttonId & ToolBarConfig.CONST_Other3) > 0)
|
|
{
|
|
var site = UserRightsHelper.GetUserButtonSite(rightcode, ToolBarConfig.CONST_Other3);
|
|
ToolBar bar = toolBars.FirstOrDefault(m => m.btnType == ToolBarConfig.CONST_Other3);
|
|
if (site.Contains("1") && bar != null)
|
|
{
|
|
if (string.IsNullOrEmpty(bar.icon))
|
|
{
|
|
<input class="layui-btn @Html.Raw(string.IsNullOrEmpty(bar.btnColor) ? "layui-btn-normal" : bar.btnColor)" data-method="other3" type="button" value="@Html.Raw(bar.btnName)" />
|
|
}
|
|
else
|
|
{
|
|
<button type="button" class="layui-btn @Html.Raw(string.IsNullOrEmpty(bar.btnColor) ? "layui-btn-normal" : bar.btnColor)" data-method="other3">
|
|
<i class="layui-icon @Html.Raw(bar.icon)"></i>
|
|
@Html.Raw(bar.btnName)
|
|
</button>
|
|
}
|
|
if (bar.isSpace)
|
|
{
|
|
<span style="padding-right:20px"></span>
|
|
}
|
|
}
|
|
if (site.Contains("2") && bar != null)
|
|
{
|
|
script += "<a class=\"layui-btn layui-btn-normal layui-btn-xs\" lay-event=\"other3\">" + bar.btnName + "</a>";
|
|
}
|
|
}
|
|
@if ((buttonId & ToolBarConfig.CONST_Other4) > 0)
|
|
{
|
|
var site = UserRightsHelper.GetUserButtonSite(rightcode, ToolBarConfig.CONST_Other4);
|
|
ToolBar bar = toolBars.FirstOrDefault(m => m.btnType == ToolBarConfig.CONST_Other4);
|
|
if (site.Contains("1") && bar != null)
|
|
{
|
|
if (string.IsNullOrEmpty(bar.icon))
|
|
{
|
|
<input class="layui-btn @Html.Raw(string.IsNullOrEmpty(bar.btnColor) ? "layui-btn-normal" : bar.btnColor)" data-method="other4" type="button" value="@Html.Raw(bar.btnName)" />
|
|
}
|
|
else
|
|
{
|
|
<button type="button" class="layui-btn @Html.Raw(string.IsNullOrEmpty(bar.btnColor) ? "layui-btn-normal" : bar.btnColor)" data-method="other4">
|
|
<i class="layui-icon @Html.Raw(bar.icon)"></i>
|
|
@Html.Raw(bar.btnName)
|
|
</button>
|
|
}
|
|
if (bar.isSpace)
|
|
{
|
|
<span style="padding-right:20px"></span>
|
|
}
|
|
}
|
|
if (site.Contains("2") && bar != null)
|
|
{
|
|
script += "<a class=\"layui-btn layui-btn-normal layui-btn-xs\" lay-event=\"other4\">" + bar.btnName + "</a>";
|
|
}
|
|
}
|
|
|
|
@if ((buttonId & ToolBarConfig.CONST_Other5) > 0)
|
|
{
|
|
var site = UserRightsHelper.GetUserButtonSite(rightcode, ToolBarConfig.CONST_Other5);
|
|
ToolBar bar = toolBars.FirstOrDefault(m => m.btnType == ToolBarConfig.CONST_Other5);
|
|
if (site.Contains("1") && bar != null)
|
|
{
|
|
if (string.IsNullOrEmpty(bar.icon))
|
|
{
|
|
<input class="layui-btn @Html.Raw(string.IsNullOrEmpty(bar.btnColor) ? "layui-btn-normal" : bar.btnColor)" data-method="other5" type="button" value="@Html.Raw(bar.btnName)" />
|
|
}
|
|
else
|
|
{
|
|
<button type="button" class="layui-btn @Html.Raw(string.IsNullOrEmpty(bar.btnColor) ? "layui-btn-normal" : bar.btnColor)" data-method="other5">
|
|
<i class="layui-icon @Html.Raw(bar.icon)"></i>
|
|
@Html.Raw(bar.btnName)
|
|
</button>
|
|
}
|
|
if (bar.isSpace)
|
|
{
|
|
<span style="padding-right:20px"></span>
|
|
}
|
|
}
|
|
|
|
|
|
if (site.Contains("2") && bar != null)
|
|
{
|
|
script += "<a class=\"layui-btn layui-btn-normal layui-btn-xs\" lay-event=\"other5\">" + bar.btnName + "</a>";
|
|
}
|
|
}
|
|
|
|
@if ((buttonId & ToolBarConfig.CONST_Other6) > 0)
|
|
{
|
|
var site = UserRightsHelper.GetUserButtonSite(rightcode, ToolBarConfig.CONST_Other6);
|
|
ToolBar bar = toolBars.FirstOrDefault(m => m.btnType == ToolBarConfig.CONST_Other6);
|
|
if (site.Contains("1") && bar != null)
|
|
{
|
|
if (string.IsNullOrEmpty(bar.icon))
|
|
{
|
|
<input class="layui-btn @Html.Raw(string.IsNullOrEmpty(bar.btnColor) ? "layui-btn-normal" : bar.btnColor)" data-method="other6" type="button" value="@Html.Raw(bar.btnName)" />
|
|
}
|
|
else
|
|
{
|
|
<button type="button" class="layui-btn @Html.Raw(string.IsNullOrEmpty(bar.btnColor) ? "layui-btn-normal" : bar.btnColor)" data-method="other6">
|
|
<i class="layui-icon @Html.Raw(bar.icon)"></i>
|
|
@Html.Raw(bar.btnName)
|
|
</button>
|
|
}
|
|
if (bar.isSpace)
|
|
{
|
|
<span style="padding-right:20px"></span>
|
|
}
|
|
}
|
|
if (site.Contains("2") && bar != null)
|
|
{
|
|
script += "<a class=\"layui-btn layui-btn-normal layui-btn-xs\" lay-event=\"other6\">" + bar.btnName + "</a>";
|
|
}
|
|
}
|
|
|
|
@if ((buttonId & ToolBarConfig.CONST_Other7) > 0)
|
|
{
|
|
|
|
ToolBar bar = toolBars.FirstOrDefault(m => m.btnType == ToolBarConfig.CONST_Other7);
|
|
var site = UserRightsHelper.GetUserButtonSite(rightcode, ToolBarConfig.CONST_Other7);
|
|
if (site.Contains("1") && bar != null)
|
|
{
|
|
if (string.IsNullOrEmpty(bar.icon))
|
|
{
|
|
<input class="layui-btn @Html.Raw(string.IsNullOrEmpty(bar.btnColor) ? "layui-btn-normal" : bar.btnColor)" data-method="other7" type="button" value="@Html.Raw(bar.btnName)" />
|
|
}
|
|
else
|
|
{
|
|
<button type="button" class="layui-btn @Html.Raw(string.IsNullOrEmpty(bar.btnColor) ? "layui-btn-normal" : bar.btnColor)" data-method="other7">
|
|
<i class="layui-icon @Html.Raw(bar.icon)"></i>
|
|
@Html.Raw(bar.btnName)
|
|
</button>
|
|
}
|
|
if (bar.isSpace)
|
|
{
|
|
<span style="padding-right:20px"></span>
|
|
}
|
|
}
|
|
if (site.Contains("2") && bar != null)
|
|
{
|
|
script += "<a class=\"layui-btn layui-btn-normal layui-btn-xs\" lay-event=\"other7\">" + bar.btnName + "</a>";
|
|
}
|
|
}
|
|
|
|
@if ((buttonId & ToolBarConfig.CONST_Other8) > 0)
|
|
{
|
|
var site = UserRightsHelper.GetUserButtonSite(rightcode, ToolBarConfig.CONST_Other8);
|
|
ToolBar bar = toolBars.FirstOrDefault(m => m.btnType == ToolBarConfig.CONST_Other8);
|
|
if (site.Contains("1") && bar != null)
|
|
{
|
|
if (string.IsNullOrEmpty(bar.icon))
|
|
{
|
|
<input class="layui-btn @Html.Raw(string.IsNullOrEmpty(bar.btnColor) ? "layui-btn-normal" : bar.btnColor)" data-method="other8" type="button" value="@Html.Raw(bar.btnName)" />
|
|
}
|
|
else
|
|
{
|
|
<button type="button" class="layui-btn @Html.Raw(string.IsNullOrEmpty(bar.btnColor) ? "layui-btn-normal" : bar.btnColor)" data-method="other8">
|
|
<i class="layui-icon @Html.Raw(bar.icon)"></i>
|
|
@Html.Raw(bar.btnName)
|
|
</button>
|
|
}
|
|
if (bar.isSpace)
|
|
{
|
|
<span style="padding-right:20px"></span>
|
|
}
|
|
}
|
|
if (site.Contains("2") && bar != null)
|
|
{
|
|
script += "<a class=\"layui-btn layui-btn-normal layui-btn-xs\" lay-event=\"other8\">" + bar.btnName + "</a>";
|
|
}
|
|
}
|
|
|
|
@if ((buttonId & ToolBarConfig.CONST_Other9) > 0)
|
|
{
|
|
var site = UserRightsHelper.GetUserButtonSite(rightcode, ToolBarConfig.CONST_Other9);
|
|
ToolBar bar = toolBars.FirstOrDefault(m => m.btnType == ToolBarConfig.CONST_Other9);
|
|
if (site.Contains("1") && bar != null)
|
|
{
|
|
if (string.IsNullOrEmpty(bar.icon))
|
|
{
|
|
<input class="layui-btn @Html.Raw(string.IsNullOrEmpty(bar.btnColor) ? "layui-btn-normal" : bar.btnColor)" data-method="other9" type="button" value="@Html.Raw(bar.btnName)" />
|
|
}
|
|
else
|
|
{
|
|
<button type="button" class="layui-btn @Html.Raw(string.IsNullOrEmpty(bar.btnColor) ? "layui-btn-normal" : bar.btnColor)" data-method="other9">
|
|
<i class="layui-icon @Html.Raw(bar.icon)"></i>
|
|
@Html.Raw(bar.btnName)
|
|
</button>
|
|
}
|
|
if (bar.isSpace)
|
|
{
|
|
<span style="padding-right:20px"></span>
|
|
}
|
|
}
|
|
if (site.Contains("2") && bar != null)
|
|
{
|
|
script += "<a class=\"layui-btn layui-btn-normal layui-btn-xs\" lay-event=\"other9\">" + bar.btnName + "</a>";
|
|
}
|
|
}
|
|
@{
|
|
script += "</script>";
|
|
}
|
|
@Html.Raw(script)
|
|
|
|
|