Browse Source

账号设置,模块权限,固定表头

MaiXinRong 3 weeks ago
parent
commit
1a4c498339
1 changed files with 26 additions and 24 deletions
  1. 26 24
      app/view/sp_setting/permission.ejs

+ 26 - 24
app/view/sp_setting/permission.ejs

@@ -67,31 +67,33 @@
                                             <button class="btn btn-sm btn-warning" id="save-permission" style="display: none;">保存</button>
                                         </div>
                                     </div>
-                                    <div class="card-body py-2 scroll-y" id="sp-pageshow-content">
-                                        <table class="table table-hover table-bordered table-sm">
-                                            <thead><tr class="text-center">
-                                                <th width="120px">用户</th>
-                                                <th width="240px">公司</th>
-                                                <th width="150px">职位</th>
-                                                <% for (const key in permissionConst) { %>
-                                                <th><%- permissionConst[key].title %><br/><input class="ml-1" type="checkbox" name="permission-check-all" ptype="<%- ptype %>" pvalue="<%- permissionConst[key].value %>" style="vertical-align: middle"></th>
+                                    <div class="card-body py-2" id="sp-pageshow-content">
+                                        <div class="scroll-y" style="height: 100%">
+                                            <table class="table table-hover table-bordered table-sm">
+                                                <thead><tr class="text-center" style="position: sticky; top: 0; z-index: 10">
+                                                    <th width="120px">用户</th>
+                                                    <th width="240px">公司</th>
+                                                    <th width="150px">职位</th>
+                                                    <% for (const key in permissionConst) { %>
+                                                    <th><%- permissionConst[key].title %><br/><input class="ml-1" type="checkbox" name="permission-check-all" ptype="<%- ptype %>" pvalue="<%- permissionConst[key].value %>" style="vertical-align: middle"></th>
+                                                    <% } %>
+                                                </tr>
+                                                </thead>
+                                                <tbody class="text-center">
+                                                <% for (const user of subProjectAccountList) { %>
+                                                <% const tp = user[ptype + '_permission'].split(','); %>
+                                                <tr name="user-permission" class="permission-parent" pid="<%- user.permission_id %>">
+                                                    <td><%- user.name %></td>
+                                                    <td><%- user.company %></td>
+                                                    <td><%- user.role %></td>
+                                                    <% for (const key in permissionConst) { %>
+                                                    <td><input type="checkbox" name="permission-check" ptype="<%- ptype %>" pvalue="<%- permissionConst[key].value %>" <%- (tp.indexOf(permissionConst[key].value + '') >= 0 ? 'checked' : '') %> onchange="$('#save-permission').show();"></td>
+                                                    <% } %>
+                                                </tr>
                                                 <% } %>
-                                            </tr>
-                                            </thead>
-                                            <tbody class="text-center">
-                                            <% for (const user of subProjectAccountList) { %>
-                                            <% const tp = user[ptype + '_permission'].split(','); %>
-                                            <tr name="user-permission" class="permission-parent" pid="<%- user.permission_id %>">
-                                                <td><%- user.name %></td>
-                                                <td><%- user.company %></td>
-                                                <td><%- user.role %></td>
-                                                <% for (const key in permissionConst) { %>
-                                                <td><input type="checkbox" name="permission-check" ptype="<%- ptype %>" pvalue="<%- permissionConst[key].value %>" <%- (tp.indexOf(permissionConst[key].value + '') >= 0 ? 'checked' : '') %> onchange="$('#save-permission').show();"></td>
-                                                <% } %>
-                                            </tr>
-                                            <% } %>
-                                            </tbody>
-                                        </table>
+                                                </tbody>
+                                            </table>
+                                        </div>
                                     </div>
                                 </div>
                             </div>