瀏覽代碼

底色,双击展开等

zhongzewei 7 年之前
父節點
當前提交
ec7af9481e

+ 6 - 0
modules/options/models/optionTypes.js

@@ -42,6 +42,12 @@ const optionSetting = {
             stringFont: 'default',
             numFont: 'default'
         },
+        BX: {
+            backColor: '#EEF8FA',
+            foreColor: 'default',
+            stringFont: 'default',
+            numFont: 'default'
+        },
         UNCBBILL: {
             backColor: '#DFE8F9',
             foreColor: 'default',

+ 13 - 0
web/building_saas/main/html/main.html

@@ -63,6 +63,19 @@
                     <a href="javascript:void(0)" class="btn btn-sm" id="downLevel" title="降级"><i class="fa fa-arrow-right" aria-hidden="true"></i></a>
                     <a href="javascript:void(0)" class="btn btn-sm" id="downMove" title="下移"><i class="fa fa-arrow-down" aria-hidden="true"></i></a>
                     <a href="javascript:void(0)" class="btn btn-sm" id="upMove" title="上移"><i class="fa fa-arrow-up" aria-hidden="true"></i></a>
+                      <span>
+                  <a href="" class="btn btn-sm" data-toggle="dropdown"><b data-toggle="tooltip" data-placement="bottom">显示至...</b></a>
+                  <div class="dropdown-menu dropdown-menu-left">
+                      <a class="dropdown-item" href="#">大项费用</a>
+                      <a class="dropdown-item" href="#">一级分部</a>
+                      <a class="dropdown-item" href="#">二级分部</a>
+                      <a class="dropdown-item" href="#">三级分部</a>
+                      <a class="dropdown-item" href="#">四级分部</a>
+                      <a class="dropdown-item" href="#">分项</a>
+                      <a class="dropdown-item" href="#">子目</a>
+                      <a class="dropdown-item" href="#">最底层</a>
+                  </div>
+                </span>
                   </div>
                   <div class="tools-btn">
                       <a href="javacript:void(0);" data-toggle="modal" data-target="#column" class="btn btn-sm"><i class="fa fa-table" aria-hidden="true"></i> 列设置</a>

+ 5 - 1
web/building_saas/main/js/views/project_view.js

@@ -961,7 +961,7 @@ var projectObj = {
     getNodeColorStyle: function (node, colSetting) {
         let colorSetting = optionsOprObj.getOption(optionsOprObj.optionsTypes.COLOROPTS);
         let mapping = {DEFAULT: 'DEFAULT', DXFY: 'DXFY', FB: 'FB', UNLEAFBILL: 'UNLEAFBILL',
-            FX: 'FX', UNCBBILL: 'UNCBBILL', CBBILL: 'CBBILL', ZCSB: 'ZCSB'};
+            FX: 'FX', BX: 'BX', UNCBBILL: 'UNCBBILL', CBBILL: 'CBBILL', ZCSB: 'ZCSB'};
         let styleMap = null;
         //中文字段名,由于同一节点中,中文字体大小和数字字体大小不同
         let stringFields = [
@@ -994,6 +994,10 @@ var projectObj = {
             else if(node.data.type === billType.FX){
                 styleMap = mapping.FX;
             }
+            //补项
+            else if(node.data.type === billType.BX){
+                styleMap = mapping.BX;
+            }
             //清单
             else if(node.data.type === billType.BILL){
                 //非叶子节点的清单

+ 19 - 0
web/building_saas/main/js/views/std_ration_lib.js

@@ -14,6 +14,7 @@ var rationLibObj = {
     checkSpread: function () {
         if (!this.rationChapterSpread) {
             this.rationChapterSpread = SheetDataHelper.createNewSpread($('#stdRationChapter')[0]);
+            this.rationChapterSpread.bind(GC.Spread.Sheets.Events.CellDoubleClick, this.onChapterSpreadCellDoubleClick);
         }
         if (!this.sectionRationsSpread) {
             this.sectionRationsSpread = SheetDataHelper.createNewSpread($('#stdSectionRations')[0]);
@@ -46,6 +47,7 @@ var rationLibObj = {
         var that = this;
         var showRationChapterTree = function (datas) {
             var rationChapterTree = idTree.createNew({id: 'ID', pid: 'ParentID', nid: 'NextSiblingID', rootId: -1, autoUpdate: false});
+            that.tree = rationChapterTree;
             var rationChapterTreeController = TREE_SHEET_CONTROLLER.createNew(rationChapterTree, that.rationChapterSpread.getActiveSheet(), that.rationChapterTreeSetting);
             rationChapterTree.loadDatas(datas);
             rationChapterTreeController.showTreeData();
@@ -67,6 +69,23 @@ var rationLibObj = {
             showRationChapterTree([]);
         });
     },
+    //双击隐藏显示
+    onChapterSpreadCellDoubleClick: function (sender, args) {
+        let me = rationLibObj;
+        let node = me.tree.items[args.row];
+        if (!node || node.children.length === 0)
+            return;
+        node.setExpanded(!node.expanded);
+        TREE_SHEET_HELPER.massOperationSheet(args.sheet, function () {
+            let iCount = node.posterityCount(), i, child;
+            for (i = 0; i < iCount; i++) {
+                child = me.tree.items[args.row + i + 1];
+                args.sheet.setRowVisible(args.row + i + 1, child.visible, args.sheetArea);
+            }
+            args.sheet.invalidateLayout();
+        });
+        args.sheet.repaint();
+    },
     setTagForHint: function (datas) {
         let sheet = this.sectionRationsSpread.getActiveSheet();
         sheet.suspendPaint();