1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 |
- <% include ./sub_menu.ejs %>
- <div class="panel-content">
- <div class="panel-title">
- <div class="title-main">
- <h2>账号管理
- <% if (projectData.max_user !== accountData.length) { %>
- <a href="#ver" data-toggle="modal" data-target="#add-user" class="btn btn-primary btn-sm pull-right">添加账号</a>
- <% } else { %>
- <a href="#add-unpass" data-toggle="modal" data-target="#add-unpass" class="btn btn-primary btn-sm pull-right">添加账号(受限)</a>
- <% } %>
- </h2>
- </div>
- </div>
- <div class="content-wrap">
- <div class="c-body">
- <div class="sjs-height-0">
- <nav class="nav nav-tabs m-3" role="tablist">
- <a class="nav-item nav-link" href="/setting/user">账号列表</a>
- <a class="nav-item nav-link active" href="/setting/user/permission/set">账号权限</a>
- </nav>
- <div class="tab-content m-3">
- <div id="user-purview" class="tab-pane active">
- <table class="table table-hover table-bordered table-sm">
- <thead>
- <tr>
- <th>账号</th>
- <th>姓名</th>
- <th>单位</th>
- <th>角色/职位</th>
- <th>协作办公</th>
- <th>权限</th>
- </thead>
- <tbody>
- <% for (const account of accountData) { %>
- <tr>
- <td><%= account.account %><% if (account.is_admin === 1) { %> <span data-toggle="tooltip" data-placement="bottom" title="" data-original-title="管理员"><i class="fa fa-user-circle-o"></i></span><% } %></td>
- <td><%= account.name %></td>
- <td><%= account.company %></td>
- <td><%= account.role %></td>
- <td><% if (account.cooperation === 1) { %>启用<% } %></td>
- <td>
- <% if (account.permission !== '' && account.permission !== null) { %>
- <% const accountPermission = JSON.parse(account.permission); %>
- <% for(const ap in accountPermission) { %>
- <% if (permission[ap].type === 'checkbox') { %>
- <% for (const tc in permission[ap].children) { %>
- <% if (accountPermission[ap].indexOf(permission[ap].children[tc].value.toString()) !== -1) { %>
- <%= permission[ap].children[tc].title %>
- <% } %>
- <% } %>
- <% } else if (permission[ap].type === 'radio') { %>
- <%= permission[ap].title %>
- <% } %>
- <% } %>
- <% } %>
- <a href="#edit-user2" data-account="<%= JSON.stringify(account) %>" data-toggle="modal" data-target="#edit-user2" class="btn btn-sm btn-outline-primary pull-right">编辑</a></td>
- </tr>
- <% } %>
- </tbody>
- </table>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <script>
- const allPermission = JSON.parse('<%- permissionStr %>');
- </script>
- <script src="/public/js/setting.js"></script>
- <script>autoFlashHeight();</script>
|