123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153 |
- @using Hospital.Core.Dict
- @using Webdiyer.WebControls.Mvc
- @using Hospital.Model.Models
- @model PagedList<Hospital.Model.Models.Q_Roles>
- @{
- ViewBag.Title = "角色管理";
- }
- @section head
- {
- <link rel="stylesheet" type="text/css" href="~/Content/jquery-easyui/bootstrap/easyui.css">
- }
- <div class="page-header">
- <h3>
- @if (ViewBag.Logo != null)
- {
- <img src="@ViewBag.Logo" id="logoImg" style="margin:0px 5px 5px 0px;" />
- }
- <i class="fa fa-sitemap"></i> @ViewBag.Title
- <a href="@Url.Action("Index","MAdmin")" class='backbutton'><i class="icon-white fa fa-arrow-circle-left"></i>返回</a>
- </h3>
- </div>
- <div class="list-toolbar clearfix">
- @using (Html.BeginForm("Index", "Roles", FormMethod.Get, new { @class = "form-horizontal", @id = "report-list-filter" }))
- {
- <ul class="unstyled">
- <li>
- @Html.Label("角色名称")
- @Html.TextBox("rolename", Request.QueryString["rolename"], new { @style = "width:200px;" })
- </li>
- <li>
- <label> </label>
- <div class="btn-group">
- <button class="btn btn-primary" type="submit" style="margin:0px;"><i class="fa fa-filter"></i> 筛选</button>
- <button class="btn show-tooltip" type="reset" title="清除筛选结果,显示全部。" style="margin:0px;"><i class="icon-remove mg-r-0"></i></button>
- </div>
- </li>
- </ul>
- }
- </div>
- <div class="btn-toolbar">
- <a class="btn btn-primary" href="@Url.Action("Create")"><i class="fa fa-plus-circle fa-fw"></i>新建角色</a>
- </div>
- @if (Model != null && Model.Any())
- {
- <table class="table table-hover table-striped">
- <thead>
- <tr>
- <th>序号</th>
- <th>角色名称</th>
- <th>角色描述</th>
- <th>操作</th>
- </tr>
- </thead>
- <tbody>
- @{
- var xuhao = 1;
- }
- @foreach (var item in Model)
- {
- <tr id="item-@item.ID">
- <td>@xuhao</td>
- <td>@item.RolesName</td>
- <td>@item.RolesDescription</td>
- <td>
- @if(item.ID !=1){
- <div class="btn-group">
- <a class="btn btn-mini btn-primary" href="@Url.Action("Edit", "Roles", new { @id = @item.ID, @returnUrl = HttpUtility.UrlEncode(Request.RawUrl) })"><i class="fa fa-edit"></i> 编辑</a>
- <a class="btn btn-mini btn-info delete" data-id="@item.ID"><i class="fa fa-remove"></i> 删除</a>
- </div>
- }
- else
- {
- <a class="btn btn-mini btn-warning"><i class="fa fa-warning"></i> 该角色不可编辑</a>
- }
- </td>
- </tr>
- xuhao = xuhao + 1;
- }
- </tbody>
- </table>
- <div class="pagination">
- <p class="status">共 @Model.TotalItemCount 条记录,页 @Model.CurrentPageIndex / @Model.TotalPageCount</p>
- @Html.Pager(Model, new PagerOptions
- {
- PageIndexParameterName = "page",
- ContainerTagName = "ul",
- PagerItemWrapperFormatString = "<li>{0}</li>",
- CurrentPagerItemWrapperFormatString = "<li class='active'><span>{0}</span></li>",
- SeparatorHtml = "",
- GoToPageSectionWrapperFormatString = "<li class='goto'><span>{0}</span></li>",
- ShowPageIndexBox = true,
- NumericPagerItemCount = 5
- })
- </div>
- <div class="form-actions">
- <input type="hidden" id="page" value="@Request.Params["page"]"/>
- </div>
- }
- else
- {
- <div class="alert alert-block">
- <i class="fa fa-info-circle"></i><strong>没有相关数据。</strong>
- </div>
- }
- <div class="hide">
- <div id="comment-remove-confirm-dialog" title="确认">
- <p>
- 确定要删除这个角色吗?如果要删除,那么拥有这个角色的用户将失去这个角色。
- </p>
- </div>
- </div>
- @section scripts {
- <script src="~/Scripts/jquery.easyui.min.js"></script>
- <script type="text/javascript">
- var global = {
- urls: {
- deleteRole: '@Url.Action("Delete")'
- }
- }
- $(".delete").click(function () {
- var my = $(this);
- var id = $(this).data("id");
- $("#comment-remove-confirm-dialog").dialog({
- title: "提示",
- width: 600,
- resizable: false,
- modal: true,
- buttons: {
- "确定": function () {
- $.post(global.urls.deleteRole, { id: id }).done(function (data) {
- if (data == true) {
- my.closest("tr").remove();
- }
- });
- $(this).dialog("close");
- },
- "取消": function () {
- $(this).dialog("close");
- }
- }
- });
- });
- </script>
- }
|