12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- <!--弹出列设置-->
- <div class="modal fade" id="col-set" data-backdrop="static">
- <div class="modal-dialog" role="document">
- <div class="modal-content">
- <div class="modal-header">
- <h5 class="modal-title">列设置</h5>
- </div>
- <div class="modal-body">
- <table class="table table-hover table-bordered">
- <thead><tr><th width="150px">列名</th><th width="150px">别名</th><th width="50px">显示</th></tr></thead>
- <tbody class="text-center">
- <% for (const cs of colSet) { %>
- <tr code="<%- cs.field %>">
- <td><%- cs.name %><% if (cs.hint) { %><i class="fa fa-question-circle text-primary ml-1" data-placement="bottom" data-toggle="tooltip" data-original-title="<%- cs.hint %>"></i><% } %></td>
- <% if (cs.fixed.indexOf('alias') >= 0) { %>
- <td class="disabled">-</td>
- <% } else {%>
- <td><input type="text" class="form-control form-control-sm" value="<%- cs.alias %>"></td>
- <% } %>
- <% if (cs.fixed.indexOf('show') >= 0 ) { %>
- <td>
- <div class="form-check form-check-inline">
- <input class="form-check-input" type="checkbox" id="inlineCheckbox-<%- cs.code %>" checked="" disabled="">
- <label class="form-check-label" for="inlineCheckbox-<%- cs.code %>"></label>
- </div>
- </td>
- <% } else { %>
- <td>
- <div class="form-check form-check-inline">
- <input class="form-check-input" type="checkbox" id="inlineCheckbox-<%- cs.code %>" <% if (cs.show) { %> checked <% } %> >
- <label class="form-check-label" for="inlineCheckbox-<%- cs.code %>"></label>
- </div>
- </td>
- <% } %>
- </tr>
- <% } %>
- </tbody>
- </table>
- <div class="text-danger">请勿全选(页面显示不下);谨慎修改别名(修改后,各页面概念将不一致)</div>
- </div>
- <form class="modal-footer" action="/subproj/col-set" method="post" onsubmit="return onSetCol();">
- <input type="hidden" name="_csrf_j" value="<%= ctx.csrf %>">
- <input type="hidden" name="col_set" value="">
- <input type="hidden" name="col_type" value="info">
- <button type="button" class="btn btn-secondary btn-sm" data-dismiss="modal">关闭</button>
- <button type="submit" class="btn btn-primary btn-sm" id="add-bd-ok">确定修改</button>
- </form>
- </div>
- </div>
- </div>
- <script>
- const onSetCol = function() {
- const trs = $('tr[code]', '#col-set');
- const colSet = [];
- for (const tr of trs) {
- colSet.push({ field: $(tr).attr('code'), show: $('input[type=checkbox]', tr)[0].checked, alias: $('input[type=text]', tr).val() || ''});
- }
- $('input[name=col_set]').val(JSON.stringify(colSet));
- };
- </script>
|