Browse Source

隐藏图表样式

MaiXinRong 2 years ago
parent
commit
cfe96976a8
2 changed files with 4 additions and 5 deletions
  1. 3 4
      app/public/js/budget_compare.js
  2. 1 1
      app/view/budget/compare.ejs

+ 3 - 4
app/public/js/budget_compare.js

@@ -219,7 +219,7 @@ $(document).ready(() => {
             SpreadJsObj.reloadColData(compareSheet, colIndex);
         },
         setCompareType(type) {
-            this.compareType = type;
+            this.compareType = type || 'number';
             $('[name=showType]').removeClass('active');
             $(`[tag=${type}]`).addClass('active');
             if (this.compareType === 'grid') {
@@ -231,14 +231,14 @@ $(document).ready(() => {
                 if (!x.bc_type) return;
                 x.visible = x.bc_type === type;
             });
-            setLocalCache(compareTypeKey, type);
+            setLocalCache(compareTypeKey, this.compareType);
         },
         setStackedBarCover(cover){
             this.stackedBarCover = cover || '1';
             const colIndex = spreadSetting.cols.findIndex(x => { return x.field === 'stackedBar'});
             spreadSetting.cols[colIndex].stackedBarCover = parseInt(cover);
             SpreadJsObj.reloadColData(compareSheet, colIndex);
-            setLocalCache(stackedBarCoverKey, cover);
+            setLocalCache(stackedBarCoverKey, this.stackedBarCover);
         }
     };
     compareObj.loadCacheData();
@@ -283,7 +283,6 @@ $(document).ready(() => {
         } else {
             compareObj.loadBudgetData(result);
         }
-
     });
 
     $.subMenu({

+ 1 - 1
app/view/budget/compare.ejs

@@ -76,7 +76,7 @@
                         </div>
                     </div>
                 </div>
-                <div class="d-inline-block">
+                <div class="d-inline-block" style="display: none">
                     <div class="dropdown">
                         <button class="btn btn-sm btn-light dropdown-toggle text-primary" type="button" id="dp-cover" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                             <i class="fa fa-list-ol"></i> 图表样式