Bläddra i källkod

问号符弹出相关

zhongzewei 6 år sedan
förälder
incheckning
32b9bd3dd3

+ 91 - 1
public/web/tree_sheet/tree_sheet_helper.js

@@ -307,7 +307,9 @@ var TREE_SHEET_HELPER = {
         let halfBoxLength = 5;
         let halfExpandLength = 3;
         let isRationNode = sheet.name()=="mainSheet" && initNode.sourceType == ModuleNames.ration;
-
+        let questionImg = document.getElementById('question_pic'),
+            questionImgWidth = 16,
+            questionImgHeight = 16;
 
         let TreeNodeCellType = function () {
             this.clickDropDown = false; //如果是点击下拉框的三角形的时候,默认展开下拉框
@@ -422,6 +424,12 @@ var TREE_SHEET_HELPER = {
             if (isRationNode&& options.row === sheet.getActiveRowIndex() && options.col === sheet.getActiveColumnIndex()) {
                 sheetCommonObj.drowTriangle(ctx,x+w-12,y+h/2+2);
             }
+            //定额库章节树问号
+            if(sheet.name() === 'stdRationLib_chapter' && this.enterCell && options.row === this.enterCell.row ){
+                let centerX = Math.floor(x) + w - 20;
+                let centerY = Math.floor((y + (y + h)) / 2);
+                ctx.drawImage(questionImg, centerX + 3, centerY - 7, questionImgWidth,questionImgHeight);
+            }
 
         };
         TreeNodeCellType.prototype.getHitInfo = function (x, y, cellStyle, cellRect, context) {
@@ -436,6 +444,12 @@ var TREE_SHEET_HELPER = {
             };
         };
         TreeNodeCellType.prototype.processMouseDown = function (hitinfo) {
+            //点击问号符,弹出说明、工程量计算规则窗口
+            if(hitinfo.sheet.name() === 'stdRationLib_chapter') {
+                if(hitinfo.x < hitinfo.cellRect.x + hitinfo.cellRect.width && hitinfo.x > hitinfo.cellRect.x + hitinfo.cellRect.width - questionImgWidth) {
+                    rationLibObj.initQuestionModal(hitinfo.row);
+                }
+            }
             let offset = -1;
             let node = tree.items[hitinfo.row];
             tree.selected = node;
@@ -477,6 +491,15 @@ var TREE_SHEET_HELPER = {
         TreeNodeCellType.prototype.processMouseEnter = function(hitinfo){
             if(hitinfo.sheet.name() === 'stdBillsGuidance_bills'){
                 TREE_SHEET_HELPER.delayShowTips(hitinfo,setting);
+            } else if(hitinfo.sheet.name() === 'stdRationLib_chapter'){
+                if(this.enterCell==null){
+                    this.enterCell={
+                        row:hitinfo.row,
+                        col:hitinfo.col
+                    };
+                    hitinfo.sheet.invalidateLayout();
+                    hitinfo.sheet.repaint();
+                }
             }
         };
         TreeNodeCellType.prototype.processMouseMove = function(hitinfo){//造价书主界面,当鼠标移动到单元格最右往左50个像素内时才显示悬浮提示内容
@@ -491,6 +514,11 @@ var TREE_SHEET_HELPER = {
         };
         TreeNodeCellType.prototype.processMouseLeave = function (hitinfo) {
             TREE_SHEET_HELPER.hideTipsDiv();
+            if(hitinfo.sheet.name() === 'stdRationLib_chapter') {
+                this.enterCell = null;
+                hitinfo.sheet.invalidateLayout();
+                hitinfo.sheet.repaint();
+            }
         };
 
         if(isRationNode){
@@ -662,5 +690,67 @@ var TREE_SHEET_HELPER = {
                 }
             }
         },delayTimes);
+    },
+    getQuestionCellType: function (mouseDownCallback = null) {
+        let img = document.getElementById('question_pic'),
+            imgWidth = 16,
+            imgHeight = 16;
+        let QuestionCellType = function () {};
+        QuestionCellType.prototype = new GC.Spread.Sheets.CellTypes.Text();
+        QuestionCellType.prototype.paint = function (ctx, value, x, y, w, h, style, options) {
+            if (style.backColor) {
+                ctx.save();
+                ctx.fillStyle = style.backColor;
+                ctx.fillRect(x, y, w, h);
+                ctx.restore();
+            } else {
+                ctx.clearRect(x, y, w, h);
+            }
+            GC.Spread.Sheets.CellTypes.Text.prototype.paint.apply(this, arguments);
+            if(this.editingCell){
+                let centerX = Math.floor(x) + w - 20;
+                let centerY = Math.floor((y + (y + h)) / 2);
+                ctx.drawImage(img, centerX + 3, centerY - 7, imgWidth,imgHeight);
+            }
+        };
+        QuestionCellType.prototype.getHitInfo = function (x, y, cellStyle, cellRect, context) {
+            return {
+                x: x,
+                y: y,
+                row: context.row,
+                col: context.col,
+                cellStyle: cellStyle,
+                cellRect: cellRect,
+                sheetArea: context.sheetArea
+            };
+        };
+        QuestionCellType.prototype.processMouseDown = function (hitinfo) {
+            //弹出说明等窗口
+            if(this.editingCell && this.editingCell.row === hitinfo.row){
+                let offSet = hitinfo.cellRect.x + hitinfo.cellRect.width;
+                if(hitinfo.x < offSet && hitinfo.x > offSet - imgWidth){
+                    if(mouseDownCallback) {
+                        mouseDownCallback(hitinfo.row);
+                    }
+                    //$('#rationQuestionModal').modal('show');
+                }
+            }
+        };
+        QuestionCellType.prototype.processMouseEnter = function (hitinfo){
+            if(this.editingCell==null){
+                this.editingCell={
+                    row:hitinfo.row,
+                    col:hitinfo.col
+                };
+                hitinfo.sheet.invalidateLayout();
+                hitinfo.sheet.repaint();
+            }
+        };
+        QuestionCellType.prototype.processMouseLeave = function (hitinfo) {
+            this.editingCell=null;
+            hitinfo.sheet.invalidateLayout();
+            hitinfo.sheet.repaint();
+        };
+        return new QuestionCellType();
     }
 };

+ 7 - 3
web/building_saas/complementary_glj_lib/html/tools-gongliaoji.html

@@ -16,6 +16,10 @@
     <link rel="stylesheet" href="/lib/spreadjs/sheets/css/gc.spread.sheets.sc.css" type="text/css">
     <!--endinject-->
     <style type="text/css">
+        .ztree * {
+            font-family: Calibri;
+            font-size: 0.9rem;
+        }
         .modal-lg{max-width: 1000px}
     </style>
 </head>
@@ -54,8 +58,8 @@
                         <span aria-hidden="true">&times;</span>
                     </button>
                 </div>
-                <div class="modal-body">
-                        <div style="width: 33%; float: left;">
+                <div class="modal-body" style="padding-left: 0; padding-right: 3px; margin-left: 0;">
+                        <div style="width: 36%; float: left;">
                             <div  class="modal-auto-height" id="componentTreeDiv" style="overflow: hidden">
                                 <!--<div class="print-list">-->
                                 <div style="width: 100%; height: 100%; overflow: auto">
@@ -64,7 +68,7 @@
                                 <!--</div>-->
                             </div>
                         </div>
-                        <div style="width: 67%; padding-left: 8px; float: left;">
+                        <div style="width: 64%; padding-left: 3px; float: left;">
                             <div class="row">
                                 <div class="col-12" id="gljRadios">
                                     <div class="row">

+ 7 - 3
web/building_saas/complementary_ration_lib/html/dinge.html

@@ -16,6 +16,10 @@
     <link rel="stylesheet" href="/lib/jquery-contextmenu/jquery.contextMenu.css" type="text/css">
     <!--endinject-->
     <style type="text/css">
+        .ztree * {
+            font-family: Calibri;
+            font-size: 0.9rem;
+        }
         .nav-tabs .nav-item.show .nav-link, .nav-tabs .nav-link.active{
             border: 2px solid #ff6501;
             color: #495057;
@@ -468,8 +472,8 @@
                     <span aria-hidden="true">&times;</span>
                 </button>
             </div>
-            <div class="modal-body">
-                <div style="width: 33%; float: left;">
+            <div class="modal-body" style="padding-left: 0; padding-right: 3px; margin-left: 0;">
+                <div style="width: 36%; float: left;">
                     <div  class="modal-auto-height" id="gljSelTreeDiv" style="overflow: hidden">
                         <!--<div class="print-list">-->
                         <div style="width: 100%; height: 100%; overflow: auto">
@@ -478,7 +482,7 @@
                         <!--</div>-->
                     </div>
                 </div>
-                <div style="width: 67%; padding-left: 8px; float: left;">
+                <div style="width: 64%; padding-left: 3px; float: left;">
                     <div class="row">
                         <div class="col-12" id="gljRadios">
                             <div class="row">

+ 97 - 5
web/building_saas/main/html/main.html

@@ -25,6 +25,12 @@
     <!-- jquery.contextmenu -->
    <!-- <link rel="stylesheet" href="/lib/jquery-contextmenu/jquery.contextMenu.css" type="text/css">-->
     <!-- endinject -->
+    <style type="text/css">
+        .ztree * {
+            font-family: Calibri;
+            font-size: 0.9rem;
+        }
+    </style>
     <script>
         // 这里的变量供页面调用
         let lockBills = '<%- projectData.property.lockBills %>';
@@ -40,6 +46,7 @@
         <span id="tool-toast-content">右键不支持粘贴外部内容,请使用Ctrl+V粘贴。<span id="toolToastBtn">我知道了</span></span>
     </div>
 </div>-->
+<img src="/web/dest/css/img/question.png" id="question_pic" style="display: none">
     <div class="header">
          <div class="top-msg clearfix">
             <div class="alert alert-warning alert-dismissible" role="alert" id="notify" style="display: none">
@@ -858,8 +865,8 @@
                     <input type="hidden" id="actionType">
                 </div>
                 <div class="modal-body" style="padding-left: 0; padding-right: 3px; margin-left: 0;">
-                        <div style="width: 25%; float: left;">
-                            <div  class="modal-auto-height" id="componentTreeDiv" style=" height: 415px; overflow: hidden;">
+                        <div style="width: 32%; float: left;">
+                            <div  class="modal-auto-height" id="componentTreeDiv" style=" height: 435px; overflow: hidden;">
                                 <!--<div class="print-list">-->
                                 <div style="width: 100%; height: 100%; overflow: auto">
                                     <ul id="gljTree" class="ztree"></ul>
@@ -867,7 +874,7 @@
                                 <!--</div>-->
                             </div>
                         </div>
-                        <div style="width:75%; padding-left: 3px; float: left;">
+                        <div style="width:67%; padding-left: 3px; float: left;">
                             <div id="gljRadios">
                                 <div class="row">
                                     <div class="col-7" style="margin-top: 5px;">
@@ -1465,8 +1472,93 @@
             </div>
         </div>
     </div>
-
-    <img src="/web/dest/css/img/folder_open.png" id="folder_open_pic" style="display: none">
+<!--清单问号弹出 补注弹窗-->
+<div class="modal fade" id="billsQuestionModal" data-backdrop="static">
+    <div class="modal-dialog modal-lg" role="document">
+        <div class="modal-content">
+            <div class="modal-header">
+                <h5 class="modal-title">说明</h5>
+                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
+                    <span aria-hidden="true">&times;</span>
+                </button>
+            </div>
+            <div class="modal-body">
+                <div class="modal-auto-height" id="billsQuestionContent">
+                    <h3>标题1</h3>
+                    <h4>标题2</h4>
+                    <h5>标题3</h5>
+                    <p>这是一行文本</p>
+                    <p>这是一行<b>文本</b></p>
+                    <p class="text-indent">这是一行带缩进的文本</p>
+                    <table class="table table-sm table-bordered">
+                        <tr><th>表头1</th><th>表头2</th><th>表头3</th></tr>
+                        <tr><td>内容1</td><td>内容2</td><td>内容3</td></tr>
+                        <tr><td>内容4</td><td>内容5</td><td>内容6</td></tr>
+                    </table>
+                </div>
+            </div>
+            <div class="modal-footer">
+                <button type="button" class="btn btn-secondary" data-dismiss="modal">关闭</button>
+            </div>
+        </div>
+    </div>
+</div>
+<!--定额弹出 说明 和 工程量计算规则-->
+<div class="modal fade" id="rationQuestionModal" data-backdrop="static">
+    <div class="modal-dialog modal-lg" role="document">
+        <div class="modal-content">
+            <div class="modal-body">
+                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
+                    <span aria-hidden="true">×</span>
+                </button>
+                <ul class="nav nav-tabs mb-3" role="tablist">
+                    <li class="nav-item">
+                        <a class="nav-link active px-3" data-toggle="tab" href="#m-explanation" role="tab">说明</a>
+                    </li>
+                    <li class="nav-item">
+                        <a class="nav-link px-3" data-toggle="tab" href="#m-ruleText" role="tab">工程量计算规则</a>
+                    </li>
+                </ul>
+                <div class="tab-content">
+                    <div class="tab-pane active" id="m-explanation" role="tabpanel">
+                        <div class="modal-auto-height" id="explanationContent">
+                            <h3>标题1</h3>
+                            <h4>标题2</h4>
+                            <h5>标题3</h5>
+                            <p>这是一行文本</p>
+                            <p>这是一行<b>文本</b></p>
+                            <p class="text-indent">这是一行带缩进的文本</p>
+                            <table class="table table-sm table-bordered">
+                                <tr><th>表头1</th><th>表头2</th><th>表头3</th></tr>
+                                <tr><td>内容1</td><td>内容2</td><td>内容3</td></tr>
+                                <tr><td>内容4</td><td>内容5</td><td>内容6</td></tr>
+                            </table>
+                        </div>
+                    </div>
+                    <div class="tab-pane" id="m-ruleText" role="tabpanel">
+                        <div class="modal-auto-height" id="ruleTextContent">
+                            <h3>标题x1</h3>
+                            <h4>标题2</h4>
+                            <h5>标题3</h5>
+                            <p>这是一行文本</p>
+                            <p>这是一行<b>文本</b></p>
+                            <p class="text-indent">这是一行带缩进的文本</p>
+                            <table class="table table-sm table-bordered">
+                                <tr><th>表头1</th><th>表头2</th><th>表头3</th></tr>
+                                <tr><td>内容1</td><td>内容2</td><td>内容3</td></tr>
+                                <tr><td>内容4</td><td>内容5</td><td>内容6</td></tr>
+                            </table>
+                        </div>
+                    </div>
+                </div>
+            </div>
+            <div class="modal-footer">
+                <button type="button" class="btn btn-secondary" data-dismiss="modal">关闭</button>
+            </div>
+        </div>
+    </div>
+</div>
+<img src="/web/dest/css/img/folder_open.png" id="folder_open_pic" style="display: none">
     <img src="/web/dest/css/img/folder_close.png" id="folder_close_pic" style="display: none">
     <img src="/web/dest/css/img/project.png" id="proj_pic" style="display: none">
     <img src="/web/dest/css/img/engineering.png" id="eng_pic" style="display: none">

+ 2 - 2
web/building_saas/main/js/views/glj_view.js

@@ -86,8 +86,8 @@ var gljOprObj = {
         header: [
             {headerName: "选择", headerWidth: 40, dataCode: "select", hAlign: "center", vAlign: "center", cellType: "checkBox"},
             {headerName: "编码", headerWidth: 80, dataCode: "code", dataType: "String", formatter: "@", hAlign: "left", vAlign: "center"},
-            {headerName: "名称", headerWidth: 220, dataCode: "name", dataType: "String", hAlign: "left", vAlign: "center"},
-            {headerName: "规格型号", headerWidth: 185, dataCode: "specs", dataType: "String", hAlign: "left", vAlign: "center"},
+            {headerName: "名称", headerWidth: 160, dataCode: "name", dataType: "String", hAlign: "left", vAlign: "center"},
+            {headerName: "规格型号", headerWidth: 160, dataCode: "specs", dataType: "String", hAlign: "left", vAlign: "center"},
             {headerName: "单位", headerWidth: 40, dataCode: "unit", dataType: "String", hAlign: "center", vAlign: "center"},
             {headerName: "单价", headerWidth: 55, dataCode: "basePrice", dataType: "Number", formatter: "0.00", hAlign: "right", vAlign: "center"},
             {headerName: "类型", headerWidth: 60, dataCode: "gljType", dataType: "String", hAlign: "center", vAlign: "center"},

+ 16 - 18
web/building_saas/main/js/views/std_billsGuidance_lib.js

@@ -444,6 +444,17 @@ const billsGuidance = (function () {
             buildSheet(module);
         }
     }
+    //点击清单名称后面的问号,弹出补注窗口并设置当前节点(或xxx父节点)的补注
+    //@param {Number}row(当前焦点行) @return {void}
+    function initRechargeModal(row) {
+        let node = bills.tree.items[row];
+        while (node && !node.data.recharge){
+            node = node.parent;
+        }
+        let recharge = node && node.data.recharge ? node.data.recharge : '无内容';
+        $('#billsQuestionContent').html(recharge);
+        $('#billsQuestionModal').modal('show');
+    }
     //初始化并输出树
     //@param {Object}module {Object}sheet {Object}treeSetting {Array}datas
     function initTree(module, sheet, treeSetting, datas){
@@ -456,6 +467,11 @@ const billsGuidance = (function () {
         module.controller.showTreeData();
         if(module === bills){
             setBillsHint(bills.tree.items, stdBillsJobData, stdBillsFeatureData);
+            renderSheetFunc(sheet, function () {
+                for(let i = 0; i < bills.tree.items.length; i++){
+                    sheet.setCellType(i, 1, TREE_SHEET_HELPER.getQuestionCellType(initRechargeModal));
+        }
+            });
         }
     }
     //项目指引表焦点控制
@@ -731,24 +747,6 @@ const billsGuidance = (function () {
             this.isEscKey=false;
             this.displayText='';
         }
-       /* function getHtml(node, cellRect, cellStyle, top) {
-            if(!node){
-                return '';
-            }
-            let height = cellRect.height;
-            top = top.replace('px', '');
-            let htmlArr = [];
-            let options = getOptions(node.data, bills.tree.selected.elf.datas);
-            //let optionsTitle = node.data.options.split(';').join('\n');
-            htmlArr.push(`<div style="height: ${height}px; background: ${cellStyle.backColor};overflow: hidden; white-space: nowrap; text-overflow: ellipsis">${node.data.options}</div><div id="optDiv" style="position: fixed; width: ${cellRect.width}px; top: ${top - (options.length - 2) * height - 5}px;background: ${cellStyle.backColor};border: 1px solid; overflow: auto; height: ${options.length > 6 ? height*6 : height*options.length+5}px; font-size: 0.9rem;">`);
-            for(let opt of options){
-                htmlArr.push(`<div title="${opt.name ? opt.name : ''}" class="elf-options" style="height: ${height}px;overflow: hidden; white-space: nowrap; text-overflow: ellipsis">
-                        <input rank="${opt.rank}" value="${opt.ID}" style="margin-left: 5px; vertical-align: middle" type="checkbox" 
-                    ${node.data.optionChecked && _.find(node.data.optionChecked, {ID: opt.ID}) ? 'checked' : ''}> ${opt.name ? opt.name : ''}</div>`);
-            }
-            htmlArr.push(`</div>`);
-            return htmlArr.join('');
-        }*/
         function setOptionsDiv($editor, node, cellRect, cellStyle, top) {
             if(!node){
                 return '';

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

@@ -62,6 +62,21 @@ var rationLibObj = {
             rationLibObj.loadStdRation(select.val());
         }
     },
+    initQuestionModal: function(row) {
+        let node = rationLibObj.tree.items[row];
+        while (node && !node.data.explanation){
+            node = node.parent;
+        }
+        let explanation = node && node.data.explanation ? node.data.explanation : '无内容';
+        $('#explanationContent').html(explanation);
+        node = rationLibObj.tree.items[row];
+        while (node && !node.data.ruleText){
+            node = node.parent;
+        }
+        let ruleText = node && node.data.ruleText ? node.data.ruleText : '无内容';
+        $('#ruleTextContent').html(ruleText);
+        $('#rationQuestionModal').modal('show');
+    },
     loadStdRation: function (rationLibID) {
         $.bootstrapLoading.start();
         var that = this;

BIN
web/dest/css/img/question.png


BIN
web/dest/css/img/refresh.png