Selaa lähdekoodia

bugs,工程量编辑单元格按钮修改

zhangweicheng 6 vuotta sitten
vanhempi
commit
d4a26e0b43

+ 57 - 0
web/building_saas/css/custom.css

@@ -145,4 +145,61 @@ legend.legend{
     background-image: url("/lib/jquery-ui/images/ui-icons_444444_256x240.png");
     background-image: url("/lib/jquery-ui/images/ui-icons_444444_256x240.png");
     background-repeat: no-repeat;
     background-repeat: no-repeat;
     background-position: -90px -12px;
     background-position: -90px -12px;
+}
+
+.feerateInput {
+    padding: 0;
+}
+
+#toolToastWrap{
+    display:-webkit-box;
+    display:-ms-flexbox;
+    display:flex;
+    -webkit-box-pack:center;
+    -ms-flex-pack:center;
+    justify-content:center;
+    pointer-events:none;
+}
+
+#toolToast{
+    padding:11px 20px;
+    line-height:18px;
+    font-size:14px;
+    position:relative;
+    word-wrap:break-word;
+    color:#fff;
+    text-align:center;
+    background:rgba(0,0,0,.75);
+    background-size:cover;
+    -webkit-user-select:none;
+    -moz-user-select:none;
+    -ms-user-select:none;
+    user-select:none;
+    display:-webkit-box;
+    display:-ms-flexbox;
+    display:flex;
+    -webkit-box-align:center;
+    -ms-flex-align:center;
+    align-items:center;
+    max-width:686px;
+    box-sizing:border-box;
+    box-shadow:0 0 0 0 rgba(0,0,0,.15),0 2px 5px 0 rgba(0,0,0,.25);
+    pointer-events:auto;
+    border-radius:2px
+}
+
+#toolToastBtn{
+    color:#0188fb;
+    margin:0 2px;
+    white-space:nowrap;
+    cursor:pointer;
+    font-weight:700
+}
+
+#toolToastBtn:hover{
+    color:#4060c9
+}
+
+#toolToastBtn:active{
+    color:#354ea1
 }
 }

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

@@ -35,6 +35,11 @@
 </head>
 </head>
 
 
 <body>
 <body>
+<!--<div id="toolToastWrap" style="left: 20px; right: 30px; position: fixed; z-index: 10001; top: 100px;">
+    <div id="toolToast" class="toolToast">
+        <span id="tool-toast-content">右键不支持粘贴外部内容,请使用Ctrl+V粘贴。<span id="toolToastBtn">我知道了</span></span>
+    </div>
+</div>-->
     <div class="header">
     <div class="header">
          <div class="top-msg clearfix">
          <div class="top-msg clearfix">
             <div class="alert alert-warning mb-0 py-0" role="alert" id="notify" style="display: none">
             <div class="alert alert-warning mb-0 py-0" role="alert" id="notify" style="display: none">
@@ -1059,6 +1064,19 @@
                         </div>
                         </div>
                         <div class="tab-pane" id="m-fl" role="tabpanel">
                         <div class="tab-pane" id="m-fl" role="tabpanel">
                             <input type="hidden" id="edit_from">
                             <input type="hidden" id="edit_from">
+                        <!--    <div class="row" style="margin-bottom:0.5rem!important">
+                                <div class="col-3">
+                                    <div class="form-check form-control feerateInput" style="border:0px;padding-left:1.25rem">
+                                        <label >
+                                            <input class="form-check-input" id="manualFeeRate" type="checkbox">
+                                            手工输入
+                                        </label>
+                                    </div>
+                                </div>
+                                <div class="col-6">
+                                    <input class="form-control feerateInput" id="inputFeeRate" value="">
+                                </div>
+                            </div>-->
                             <div class="modal-fixed-height" style="overflow: hidden" id="fee_rate_sheet">
                             <div class="modal-fixed-height" style="overflow: hidden" id="fee_rate_sheet">
                             </div>
                             </div>
                         </div>
                         </div>

+ 10 - 1
web/building_saas/main/js/main.js

@@ -43,6 +43,9 @@ $(function () {
             setLocalCache('lastCol:' + projectId, info.col);
             setLocalCache('lastCol:' + projectId, info.col);
         }
         }
     });
     });
+
+
+
 });
 });
 
 
 function getMainResizeEles() {
 function getMainResizeEles() {
@@ -265,4 +268,10 @@ function disableRightMenu(id,spread,rowChangeFunction) {
 function show()
 function show()
 {
 {
     return "exit"
     return "exit"
-};*/
+};*/
+
+//页面失去焦点时触发
+/*
+window.onblur = function () {
+  console.log("test")
+};*/

+ 6 - 6
web/building_saas/main/js/models/fee_rate.js

@@ -591,9 +591,9 @@ var FeeRate = {
             }
             }
         };
         };
         FeeRate.prototype.changeFeeRateFileFromCurrent = function (newFeeRateFile,callback){
         FeeRate.prototype.changeFeeRateFileFromCurrent = function (newFeeRateFile,callback){
-            var me=this;
-            var projectID = projectInfoObj.projectInfo.ID;
-            var data={
+            let me=this;
+            let projectID = projectInfoObj.projectInfo.ID;
+            let data={
                 "projectID": projectID,
                 "projectID": projectID,
                 "newFeeRateFile":newFeeRateFile
                 "newFeeRateFile":newFeeRateFile
             };
             };
@@ -608,9 +608,9 @@ var FeeRate = {
         };
         };
 
 
         FeeRate.prototype.changeFeeRateFileFromOthers=function (feeRateFileID,name,callback) {
         FeeRate.prototype.changeFeeRateFileFromOthers=function (feeRateFileID,name,callback) {
-            var me = this;
-            var projectID = projectInfoObj.projectInfo.ID;
-            var data={
+            let me = this;
+            let projectID = projectInfoObj.projectInfo.ID;
+            let data={
                 "projectID": projectID,
                 "projectID": projectID,
                 "feeRateFileID":feeRateFileID,
                 "feeRateFileID":feeRateFileID,
                 "name":name,
                 "name":name,

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

@@ -4,9 +4,9 @@
 let gljCol = {
 let gljCol = {
     ration_glj_setting: {
     ration_glj_setting: {
         header: [
         header: [
-            {headerName: "编码", headerWidth: 100, dataCode: "code", dataType: "String", formatter: "@"},
+            {headerName: "编码", headerWidth: 130, dataCode: "code", dataType: "String", formatter: "@"},
             {headerName: "名称", headerWidth: 240, dataCode: "name", dataType: "String",cellType:'tipsCell'},
             {headerName: "名称", headerWidth: 240, dataCode: "name", dataType: "String",cellType:'tipsCell'},
-            {headerName: "规格型号", headerWidth: 190, dataCode: "specs", dataType: "String", hAlign: "left",cellType:'tipsCell'},
+            {headerName: "规格型号", headerWidth: 160, dataCode: "specs", dataType: "String", hAlign: "left",cellType:'tipsCell'},
             {headerName: "单位", headerWidth: 45, dataCode: "unit", dataType: "String", hAlign: "center"},
             {headerName: "单位", headerWidth: 45, dataCode: "unit", dataType: "String", hAlign: "center"},
             {headerName: "市场价", headerWidth: 80, dataCode: "marketPrice", dataType: "Number", hAlign: "right"},//, decimalField: "glj.unitPrice"
             {headerName: "市场价", headerWidth: 80, dataCode: "marketPrice", dataType: "Number", hAlign: "right"},//, decimalField: "glj.unitPrice"
             {headerName: "调整价", headerWidth: 80, dataCode: "adjustPrice", dataType: "Number", hAlign: "right"},//, decimalField: "glj.unitPrice"1
             {headerName: "调整价", headerWidth: 80, dataCode: "adjustPrice", dataType: "Number", hAlign: "right"},//, decimalField: "glj.unitPrice"1

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

@@ -1286,7 +1286,7 @@ var projectObj = {
                         if(selected.sourceType == ModuleNames.bills){
                         if(selected.sourceType == ModuleNames.bills){
                             if(selected.data.type == billType.FX||selected.data.type ==billType.BILL){
                             if(selected.data.type == billType.FX||selected.data.type ==billType.BILL){
                                 if(selected.data.calcBase&&selected.data.calcBase!=""){
                                 if(selected.data.calcBase&&selected.data.calcBase!=""){
-                                    alert("当前有基数计算,不能插入子项。");
+                                    alert("当前有基数计算,不能插入定额/量价/人材机。");
                                     return;
                                     return;
                                 }
                                 }
                             }
                             }

+ 43 - 59
web/building_saas/main/js/views/quantity_edit_view.js

@@ -58,6 +58,7 @@ let quantityEditObj = {
         var ns = GC.Spread.Sheets;
         var ns = GC.Spread.Sheets;
         function QuantityEditCellType() {
         function QuantityEditCellType() {
             var init=false;
             var init=false;
+            this.clickTime = 0; //点击事件时间戳
         }
         }
         QuantityEditCellType.prototype = new ns.CellTypes.Text();
         QuantityEditCellType.prototype = new ns.CellTypes.Text();
         QuantityEditCellType.prototype.paint = function (ctx, value, x, y, w, h, style, options) {
         QuantityEditCellType.prototype.paint = function (ctx, value, x, y, w, h, style, options) {
@@ -96,20 +97,33 @@ let quantityEditObj = {
                 sheetArea: context.sheetArea
                 sheetArea: context.sheetArea
             };
             };
         };
         };
+
+        //2018 -09 -26  修改工程量这个输入控件,删除悬浮提示注释,还原时通过git 历史
+
         QuantityEditCellType.prototype.processMouseDown = function (hitinfo) {
         QuantityEditCellType.prototype.processMouseDown = function (hitinfo) {
-            var me=quantityEditObj;
+            let me=quantityEditObj;
+            if(isDoubleClick(this) == true && !projectReadOnly){//如果是双击,直接显示
+                me.showSelectModal(hitinfo);
+                return ;
+            }
            if(me.editingCell && hitinfo.row==me.editingCell.row){
            if(me.editingCell && hitinfo.row==me.editingCell.row){
-                var offset=hitinfo.cellRect.x+hitinfo.cellRect.width-6;
-                var imageMagin=3;
-                var imageHeight = hitinfo.cellRect.height-2*imageMagin;
-                var imageWidth = hitinfo.cellRect.width*2/7;
-                if(hitinfo.x<offset&&hitinfo.x>offset-imageWidth){
-                    if(!projectReadOnly){
-                        me.showSelectModal(hitinfo);
-                    }
-                }else {//点击其它地方,按钮消失
+               if(me.editingCell.isBtn == false){//是第一次点击,刷新显示按钮
+                   me.editingCell.isBtn = true;
+                   hitinfo.sheet.invalidateLayout();
+                   hitinfo.sheet.repaint();
+               }else {
+                   var offset=hitinfo.cellRect.x+hitinfo.cellRect.width-6;
+                   var imageMagin=3;
+                   var imageHeight = hitinfo.cellRect.height-2*imageMagin;
+                   var imageWidth = hitinfo.cellRect.width*2/7;
+                   if(hitinfo.x<offset&&hitinfo.x>offset-imageWidth){
+                       if(!projectReadOnly){
+                           me.showSelectModal(hitinfo);
+                       }
+                   }/*else {//点击其它地方,按钮消失
                     hideButton(hitinfo)
                     hideButton(hitinfo)
-                }
+                    }*/
+               }
             }
             }
         };
         };
         QuantityEditCellType.prototype.processMouseEnter = function (hitinfo) {
         QuantityEditCellType.prototype.processMouseEnter = function (hitinfo) {
@@ -118,60 +132,17 @@ let quantityEditObj = {
             if(me.editingCell==null){
             if(me.editingCell==null){
                 me.editingCell={
                 me.editingCell={
                     row:hitinfo.row,
                     row:hitinfo.row,
-                    col:hitinfo.col
+                    col:hitinfo.col,
+                    isBtn :false//鼠标刚进入的时候按钮还是没显示的状态
                 }
                 }
-                hitinfo.sheet.invalidateLayout();
-                hitinfo.sheet.repaint();
-            }
-                //取消悬浮提示
-            /*  let text = hitinfo.sheet.getText(hitinfo.row, hitinfo.col);
-            let tag = hitinfo.sheet.getTag(hitinfo.row, hitinfo.col);
-            let dataField = "quantity";
-
-            if(hitinfo.sheet.getCell(hitinfo.row,hitinfo.col).wordWrap()==true){
-                return;
-            }
-            if(dataField=="quantity"){
-                text = tag;
-            }else if(tag !== undefined && tag) {
-                text = tag;
+               // hitinfo.sheet.invalidateLayout();
+                //hitinfo.sheet.repaint();
             }
             }
-            if (text && text !== '') {
-                if (!this._toolTipElement) {
-                    let div = $('#autoTip')[0];
-                    if (!div) {
-                        div = document.createElement("div");
-                        $(div).css("position", "absolute")
-                            .css("border", "1px #C0C0C0 solid")
-                            .css("box-shadow", "1px 2px 5px rgba(0,0,0,0.4)")
-                            .css("font", "9pt Arial")
-                            .css("background", "white")
-                            .css("padding", 5)
-                            .attr("id", 'autoTip');
-                        $(div).hide();
-                        document.body.insertBefore(div, null);
-                    }
-                    this._toolTipElement = div;
-                    $(this._toolTipElement).text(text);
-                    let cellRect =  hitinfo.sheet.getCellRect(hitinfo.row,hitinfo.col);
-                    $(this._toolTipElement).css("top", cellRect.y+$('#main').offset().top+cellRect.height).css("left",  hitinfo.x );//
-
-                    $(this._toolTipElement).show("fast");
-                    TREE_SHEET_HELPER.tipDiv = 'show';//做个标记
-                }
-            }*/
         };
         };
         QuantityEditCellType.prototype.processMouseLeave = function (hitinfo) {
         QuantityEditCellType.prototype.processMouseLeave = function (hitinfo) {
             hideButton(hitinfo);
             hideButton(hitinfo);
-            //延时检查:当tips正在show的时候,就调用了hide方法,会导致tips一直存在,所以设置一个超时处理
-
-            /*TREE_SHEET_HELPER.tipDiv = 'hide';  取消悬浮提示
-            if (TREE_SHEET_HELPER._toolTipElement) {
-                $(TREE_SHEET_HELPER._toolTipElement).hide();
-                TREE_SHEET_HELPER._toolTipElement = null;
-            };
-            TREE_SHEET_HELPER.tipDivCheck();*/
         };
         };
+
         function hideButton(hitinfo) {
         function hideButton(hitinfo) {
             if(!quantityEditObj.pmLeave){//鼠标进入显示三个点按钮
             if(!quantityEditObj.pmLeave){//鼠标进入显示三个点按钮
                 quantityEditObj.editingCell=null;
                 quantityEditObj.editingCell=null;
@@ -180,6 +151,19 @@ let quantityEditObj = {
                 quantityEditObj.pmLeave = true;
                 quantityEditObj.pmLeave = true;
             }
             }
         }
         }
+
+        function isDoubleClick(quantityCell) {
+            let nowTime = +new Date();
+            if(quantityCell.clickTime !=0){
+                if(nowTime - quantityCell.clickTime < 280) {//判断为双击
+                    quantityCell.clickTime = 0;
+                    return true;
+                }
+            }
+            quantityCell.clickTime = nowTime;//计录点击时间
+            return false
+        }
+
         return new QuantityEditCellType();
         return new QuantityEditCellType();
     },
     },
     showSelectModal:function (hitinfo) {
     showSelectModal:function (hitinfo) {