Browse Source

Merge branch '1.0.0_online' of http://smartcost.f3322.net:3000/SmartCost/ConstructionCost into 1.0.0_online

zhangweicheng 6 years ago
parent
commit
1d5aaa2590

+ 3 - 0
public/web/slideResize.js

@@ -79,5 +79,8 @@ const SlideResize = (function() {
         }
     }
 
+
+
+
     return {horizontalSlide, loadHorizonWidth}
 })();

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

@@ -82,9 +82,11 @@
                     <!--<a href="javascript:void(0)" class="btn btn-sm" title="复制" ><i class="fa fa-files-o" aria-hidden="true"></i></a>
                     <a href="javascript:void(0)" class="btn btn-sm" title="剪切"><i class="fa fa-scissors" aria-hidden="true"></i></a>
                     <a href="javascript:void(0)" class="btn btn-sm" title="粘贴"><i class="fa fa-clipboard" aria-hidden="true"></i></a>-->
-                    <a class="btn btn-light btn-sm" href="javascript:void(0);" aria-expanded="false" data-toggle="modal" data-target="#poj-set"><i class="fa fa-cog" data-toggle="tooltip" data-original-title="项目属性" data-placement="bottom"></i></a>
-                    <span class="btn btn-light btn-sm" id="importSpan">
-                        <a class="dropdown-toggle" href="#" data-toggle="dropdown"><i class="fa fa-cloud-upload" data-toggle="tooltip" data-original-title="导入" data-placement="bottom"></i></a>
+                      <span class="btn btn-light btn-sm" data-toggle="tooltip" data-original-title="项目属性" data-placement="bottom">
+                        <a href="javascript:void(0);" data-target="#poj-set" data-toggle="modal"><i class="fa fa-cog"></i></a>
+                    </span>
+                    <span class="btn btn-light btn-sm" id="importSpan" data-toggle="tooltip" data-original-title="导入" data-placement="bottom">
+                        <a class="dropdown-toggle" href="#" data-toggle="dropdown"><i class="fa fa-cloud-upload"></i></a>
                         <div class="dropdown-menu">
                             <a id="uploadLj" class="dropdown-item" href="#import" data-toggle="modal" data-target="#import">导入09表Excel清单</a>
                             <a id="uploadGld" class="dropdown-item" href="#import" data-toggle="modal" data-target="#import">导入广联达算量Excel清单</a>

+ 3 - 3
web/building_saas/main/js/views/character_content_view.js

@@ -7,7 +7,7 @@ let contentOprObj = {
     currentCache: [],//按照serialNo排序
     setting: {
         header: [
-            {headerName:"工作内容", headerWidth: 360, rateWidth:0.93, dataCode:"content", dataType: "String", hAlign: "left", vAlign: "center"},
+            {headerName:"工作内容", headerWidth: 360, rateWidth:0.93, dataCode:"content", dataType: "String", hAlign: "left", vAlign: "center", formatter: '@'},
             {headerName:"输出", headerWidth: 40, rateWidth: null, dataCode:"isChecked", cellType:"checkBox", hAlign: "center", vAlign: "center"}
         ]
     },
@@ -409,8 +409,8 @@ let characterOprObj = {
     currentCache: [],
     setting: {
         header: [
-            {headerName:"项目特征",headerWidth:120, rateWidth:0.9, dataCode:"character", dataType: "String", hAlign: "left", vAlign: "center"},
-            {headerName:"特征值",headerWidth:160,dataCode:"eigenvalue", dataType: "String", cellType: "comboBox", hAlign: "left", vAlign: "center"},
+            {headerName:"项目特征",headerWidth:120, rateWidth:0.9, dataCode:"character", dataType: "String", hAlign: "left", vAlign: "center", formatter: '@'},
+            {headerName:"特征值",headerWidth:160,dataCode:"eigenvalue", dataType: "String", cellType: "comboBox", hAlign: "left", vAlign: "center", formatter: '@'},
             {headerName:"输出",headerWidth:40,dataCode:"isChecked", cellType:"checkBox", hAlign: "center", vAlign: "center"}
         ]
     },

+ 9 - 4
web/building_saas/pm/js/pm_newMain.js

@@ -672,8 +672,8 @@ const projTreeObj = {
         let imgWidth = 18;
         let imgHeight = 14;
         let shareImg = document.getElementById('share_pic'),
-            shareImgWidth = 18,
-            shareImgHeight = 18;
+            shareImgWidth = 13,
+            shareImgHeight = 13;
         let TreeNodeCellType = function () {
         };
         TreeNodeCellType.prototype = new GC.Spread.Sheets.CellTypes.Text();
@@ -793,16 +793,21 @@ const projTreeObj = {
                     parentCenterX -= (indent + levelIndent);
                 }
             };
+            //分享标记在开头
+            if (node.data.shareInfo && node.data.shareInfo.length > 0) {
+                let nowY = Math.floor((y + (y + h)) / 2);
+                ctx.drawImage(shareImg, x + 3, nowY - 7, shareImgWidth,shareImgHeight);
+            }
             // Draw Text
             //x = x + (node.depth() + 1) * indent +  node.depth() * levelIndent;
             x = x + (node.depth() + 1) * indent +  node.depth() * levelIndent + imgWidth + 3;
             w = w - (node.depth() + 1) * indent - node.depth() * levelIndent - imgWidth - 3;
             GC.Spread.Sheets.CellTypes.Text.prototype.paint.apply(this, arguments);
-            if (node.data.shareInfo && node.data.shareInfo.length > 0) {
+          /*  if (node.data.shareInfo && node.data.shareInfo.length > 0) {//分享标记在文本后
                 let nowX = Math.floor(x) + w - 20;
                 let nowY = Math.floor((y + (y + h)) / 2);
                 ctx.drawImage(shareImg, nowX + 3, nowY - 7, shareImgWidth,shareImgHeight);
-            }
+            }*/
         };
         TreeNodeCellType.prototype.getHitInfo = function (x, y, cellStyle, cellRect, context) {
             let info = {x: x, y: y, row: context.row, col: context.col, cellStyle: cellStyle, cellRect: cellRect, sheetArea: context.sheetArea};

+ 50 - 12
web/building_saas/pm/js/pm_share.js

@@ -11,6 +11,7 @@
 const pmShare = (function () {
     const spreadDom = $('#shareSpread');
     let spreadObj = {workBook: null, sheet: null};
+    let preSelection = null;
     //项目分享类型,由别人分享给自己的,和自己分享给别人的
     const shareType = {receive: 'receive', shareTo: 'shareTo'};
     //操作类型
@@ -28,9 +29,9 @@ const pmShare = (function () {
     };
     const headers = [
         {name: '工程列表', dataCode: 'name', width: 300, rateWidth: 0.55, vAlign: 'center', hAlign: 'left'},
-        {name: '由...分享', dataCode: 'from', width: 100, rateWidth: 0.15, vAlign: 'center', hAlign: 'left'},
-        {name: '拷贝工程', dataCode: 'copy', width: 100, rateWidth: 0.075, vAlign: 'center', hAlign: 'left'},
-        {name: '清除', dataCode: 'cancel', width: 100, rateWidth: 0.075, vAlign: 'center', hAlign: 'left'},
+        {name: '由...分享', dataCode: 'from', width: 120, rateWidth: 0.15, vAlign: 'center', hAlign: 'left'},
+     /*   {name: '拷贝工程', dataCode: 'copy', width: 100, rateWidth: 0.075, vAlign: 'center', hAlign: 'left'},
+        {name: '清除', dataCode: 'cancel', width: 100, rateWidth: 0.075, vAlign: 'center', hAlign: 'left'},*/
         {name: '工程造价', dataCode: 'engineeringCost', width: 100, vAlign: 'center', hAlign: 'right', formatter: '0.00'},
         {name: '分部分项合计', dataCode: 'subEngineering', width: 100, vAlign: 'center', hAlign: 'right', formatter: '0.00'},
         {name: '措施项目合计', dataCode: 'measure', width: 100, vAlign: 'center', hAlign: 'right', formatter: '0.00'},
@@ -89,6 +90,7 @@ const pmShare = (function () {
         if(newSel){
             setSelStyle(newSel, projTreeObj.setting.style.selectedColor, spreadObj.sheet);
         }
+        preSelection = newSel;
     }
     //渲染时方法,停止渲染
     //@param {Object}sheet {Function}func @return {void}
@@ -123,15 +125,12 @@ const pmShare = (function () {
                 if(headers[i].formatter){
                     sheet.setFormatter(-1, i, headers[i].formatter);
                 }
-                if(headers[i].dataCode === oprType.copy){
+              /*  if(headers[i].dataCode === oprType.copy){
                     //合并列
                     sheet.addSpan(0, i, 1, 2, GC.Spread.Sheets.SheetArea.colHeader);
                     sheet.setValue(0, i, '操作', GC.Spread.Sheets.SheetArea.colHeader);
                     continue;
-                }
-                if(headers[i].dataCode === '' || headers[i].dataCode === 'feeRateFile_delete'){
-                    continue;
-                }
+                }*/
                 sheet.setValue(0, i, headers[i].name, GC.Spread.Sheets.SheetArea.colHeader);
                 sheet.getRange(-1, i, -1, 1).hAlign(GC.Spread.Sheets.HorizontalAlign[headers[i]['hAlign']]);
                 sheet.getRange(-1, i, -1, 1).vAlign(GC.Spread.Sheets.VerticalAlign[headers[i]['vAlign']]);
@@ -151,7 +150,7 @@ const pmShare = (function () {
         }
     }
     //建表
-    //
+    //@return {void}
     function buildSheet(){
         spreadObj.workBook = new GC.Spread.Sheets.Workbook(spreadDom[0], {sheetCount: 1});
         sheetCommonObj.spreadDefaultStyle(spreadObj.workBook);
@@ -173,8 +172,8 @@ const pmShare = (function () {
         }
         return false;
     }
-    //
-    //
+    //获取树节点
+    //@param {Object}tree @return {Object}
     function getTreeNodeCell(tree){
         let indent = 20;
         let levelIndent = -5;
@@ -639,7 +638,7 @@ const pmShare = (function () {
             if (data.userInfo) {
                 data.from = `由 ${data.userInfo.name} 分享`;
                 data.to = '分享给 我';
-                data.cancel = '清除'
+                data.cancel = '清除';
 
                 //拷贝操作只允许到单位工程级
                 let tendersCanCopy = isAllowCopy(userID, data);
@@ -763,6 +762,44 @@ const pmShare = (function () {
             $.bootstrapLoading.end();
         });
     }
+    //初始化右键菜单
+    function initContextMenu() {
+        $.contextMenu({
+            selector: '#shareSpread',
+            build: function ($trigger, e) {
+                let target = SheetDataHelper.safeRightClickSelection($trigger, e, spreadObj.workBook);
+                initSelection({row: target.row, rowCount: 1}, preSelection ? preSelection : null, spreadObj.sheet);
+                return target.hitTestType === GC.Spread.Sheets.SheetArea.viewport || target.hitTestType === GC.Spread.Sheets.SheetArea.rowHeader;
+            },
+            items: {
+                "copy": {
+                    name: "拷贝工程",
+                    icon: 'fa-copy',
+                    disabled: function () {
+                        let selected = tree.selected;
+                        return !(selected && selected.data.copy && selected.data.copy === '拷贝工程');
+                    },
+                    callback: function (key, opt) {
+                        $('#copyShare').modal('show');
+                    }
+                },
+                "cancel": {
+                    name: "清除",
+                    icon: 'fa-remove',
+                    disabled: function () {
+                        let selected = tree.selected;
+                        return !(selected && selected.data.cancel && selected.data.cancel === '清除');
+                    },
+                    callback: function (key, opt) {
+                        let $p = $('<p>').text(`点“确定”按钮,确认清除分享文件 “${tree.selected.data.name}”。`);
+                        $('#cancelShare').find('.modal-body').empty();
+                        $('#cancelShare').find('.modal-body').append($p);
+                        $('#cancelShare').modal('show');
+                    }
+                }
+            }
+        });
+    }
     //初始化视图
     //@return void
     function initView(){
@@ -773,6 +810,7 @@ const pmShare = (function () {
             spreadObj.workBook.destroy();
             spreadObj.workBook = null;
         }
+        initContextMenu();
         buildSheet();
         initShareTree();
     }

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