MaiXinRong 1 سال پیش
والد
کامیت
e4005171e1
4فایلهای تغییر یافته به همراه9 افزوده شده و 43 حذف شده
  1. 2 2
      app/public/js/setting.js
  2. 1 38
      app/view/setting/show.ejs
  3. 3 0
      db_script/baseUtils.js
  4. 3 3
      db_script/project_spread.js

+ 2 - 2
app/public/js/setting.js

@@ -213,8 +213,8 @@ $(document).ready(() => {
             // <li class="list-group-item">
             //     计量进度<a href="#" class="btn btn-primary btn-sm pull-right">设为默认</a>
             // </li>
-            $('.list-group').empty()
-            $('.list-group').append(html)
+            $('#tenderList').empty()
+            $('#tenderList').append(html)
             const item = result.find((i, idx) => idx=== attid)
             $('#nav_tender').attr('href', item.path)
         });

+ 1 - 38
app/view/setting/show.ejs

@@ -13,7 +13,7 @@
                         <div class="form-group">
                             <h6>项目列表默认显示</h6>
                             <div class="card w-50">
-                                <ul class="list-group list-group-flush">
+                                <ul class="list-group list-group-flush" id="tenderList">
                                     <% showList.forEach(function(item, idx) { %>
                                         <li class="list-group-item">
                                             <%= item.label_name %>
@@ -69,43 +69,6 @@
                                 </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>-->
-                                        <!--<% if (sl.pos) { %>-->
-                                        <!--<div class="input-group input-group-sm">-->
-                                            <!--<select class="form-control form-control-sm" onchange="updateColPos('ledgerCol', '<%- sl.field%>', this)" value="<%- sl.pos %>" org="<%- sl.pos %>">-->
-                                                <!--<% for (const r of settingConst.exMemoPosRange[sl.field]) { %>-->
-                                                <!--<option value="<%- r.key %>" <% if (sl.pos === r.key) {%>selected<% } %>><%- r.hint %></option>-->
-                                                <!--<% } %>-->
-                                            <!--</select>-->
-                                        <!--</div>-->
-                                        <!--<% } else { %>-->
-                                        <!--<span class="form-control-sm text-warning"><%- sl.hint || '' %></span>-->
-                                        <!--<% } %>-->
-                                    <!--</td>-->
-                                <!--</tr>-->
-                                <!--<% } %>-->
-                                <!--</tbody>-->
-                            <!--</table>-->
-                        <!--</div>-->
                     </div>
                 </div>
             </div>

+ 3 - 0
db_script/baseUtils.js

@@ -153,6 +153,8 @@ const ZhCalc = {
     },
 };
 
+const _ = require('lodash');
+
 const recursiveMkdirSync = async function(pathName) {
     if (!fs.existsSync(pathName)) {
         const upperPath = path.dirname(pathName);
@@ -184,4 +186,5 @@ module.exports = {
     getFileName: function(fileName) {
         return path.join(__dirname, fileName);
     },
+    _: _,
 };

+ 3 - 3
db_script/project_spread.js

@@ -48,7 +48,7 @@ const updateSpreadWithSpec = function(spreadSetting, specSetting) {
     for (const s of specSetting) {
         for (const c of spreadSetting.cols) {
             if (s.condition.value.indexOf(c[s.condition.key]) >= 0) {
-                this._.assignIn(c, s.update);
+                BaseUtil._.assignIn(c, s.update);
             }
         }
     }
@@ -61,8 +61,8 @@ const generateRelaSpread = function (colSetType, colSet) {
     const posSpread = generateSpreadSetting(colSet, SpreadConst.EmptySpreadSetting[colSetType].pos, baseSetCol, baseSpreadColSetting.pos, 'pos');
     const spreadSpec = SpreadConst.SpreadSpec[colSetType];
     if (spreadSpec) {
-        this.updateSpreadWithSpec(billsSpread, spreadSpec.bills);
-        this.updateSpreadWithSpec(posSpread, spreadSpec.pos);
+        updateSpreadWithSpec(billsSpread, spreadSpec.bills);
+        updateSpreadWithSpec(posSpread, spreadSpec.pos);
     }
     return [billsSpread, posSpread];
 };