1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798 |
- <% include ./sub_menu.ejs %>
- <div class="panel-content">
- <div class="panel-title">
- <div class="title-main">
- <h2>显示设置</h2>
- </div>
- </div>
- <div class="content-wrap">
- <div class="c-body">
- <div class="sjs-height-0">
- <div class="row m-0 mt-3">
- <div class="col-5">
- <div class="form-group">
- <label>项目列表默认显示</label>
- <div class="card w-50">
- <ul class="list-group list-group-flush">
- <% showList.forEach(function(item, idx) { %>
- <li class="list-group-item">
- <%= item.label_name %>
- <% if(!item.is_default) { %>
- <a href="javascript:void(0)" id="set-default" class="btn btn-primary btn-sm pull-right" data-attid="<%- idx %>">设为默认</a>
- <% } else {%>
- <span class="pull-right">默认</span>
- <% } %>
- </li>
- <% }) %>
- <!-- <li class="list-group-item">
- 标段列表<a href="#" class="btn btn-primary btn-sm pull-right">设为默认</a>
- </li>
- <li class="list-group-item">金额概况<span class="pull-right">默认</span></li>
- <li class="list-group-item">
- 计量进度<a href="#" class="btn btn-primary btn-sm pull-right">设为默认</a>
- </li> -->
- </ul>
- </div>
- </div>
- <div class="form-group">
- <label>台账列显示</label>
- <table class="table table-hover table-bordered">
- <thead><tr><th>名称</th><th>是否显示</th><th>别名</th><th>位置</th></tr></thead>
- <tbody id="ledger_col_list">
- <% for (const sl of sjsRela.ledgerCol) { %>
- <tr>
- <td><%- sl.name %></td>
- <td>
- <div class="form-check form-check-inline">
- <input class="form-check-input" type="checkbox" id="inlineCheckbox-<%- sl.field %>" <% if (sl.show) { %>checked<% } %> onchange="updateColShow('ledgerCol', '<%- sl.field %>', this);">
- <label class="form-check-label" for="inlineCheckbox-<%- sl.field %>"></label>
- </div>
- </td>
- <td>
- <div class="input-group input-group-sm" style="width:90px">
- <input type="text" class="form-control" value="<%- sl.alias %>" onchange="updateColAlias('ledgerCol', '<%- sl.field%>', this);">
- </div>
- </td>
- <td><span class="form-control-sm text-warning"><%- sl.hint || '' %></span></td>
- </tr>
- <% } %>
- </tbody>
- </table>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <script src="/public/js/setting.js"></script>
- <script>
- $(function () {
- autoFlashHeight();
- })
- const showList = JSON.parse('<%- JSON.stringify(showList) %>');
- const updateColShow = function (sub, field, obj) {
- const data = { sub, field, key: 'show', value: obj.checked };
- postData('show/update-sjs', data, function() {
- obj.setAttribute('value', obj.checked);
- }, function () {
- obj.checked = obj.getAttribute('value') === true;
- });
- };
- const updateColAlias = function (sub, field, obj) {
- const data = { sub, field, key: 'alias', value: obj.value };
- postData('show/update-sjs', data, function() {
- obj.setAttribute('org', obj.value);
- }, function () {
- obj.value = obj.getAttribute('org');
- });
- };
- const updateColPos = function(sub, field, obj) {
- const data = { sub, field, key: 'pos', value: obj.value };
- postData('show/update-sjs', data, function() {
- obj.setAttribute('org', obj.value);
- }, function () {
- obj.value = obj.getAttribute('org');
- });
- }
- </script>
|