Browse Source

造价书快速分享

vian 5 years ago
parent
commit
6a4d280017

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

@@ -2423,6 +2423,7 @@
         </div>
     </div>
 </div>
+<%include ../../../common/components/share/index.html %>
 
     <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">
@@ -2491,6 +2492,7 @@
     <!--<script src="/lib/popper/popper.min.js"></script>
     <script src="/lib/bootstrap/bootstrap.min.js"></script>-->
     <script src="/web/building_saas/js/global.js"></script>
+    <script src="/web/common/components/share/index.js"></script>
     <!--报表 zTree -->
 
     <!-- SpreadJs -->

+ 18 - 12
web/building_saas/main/js/views/project_info.js

@@ -7,9 +7,9 @@ var projectInfoObj = {
         let fullPath = [], i, pm = '<span class="text-truncate"><a href="/pm">项目管理</a></span>', angleRight = '<span class="text-truncate"><i class="fa fa-angle-right fa-fw"></i></span>';
         if (proj) {
             let pathArr = proj.fullPath;
-            let engName = pathArr[pathArr.length -2] || '',
-                projectName = pathArr[pathArr.length -3] || '',
-                folderName = pathArr[pathArr.length -4] || '';
+            let engName = pathArr[pathArr.length - 2] || '',
+                projectName = pathArr[pathArr.length - 3] || '',
+                folderName = pathArr[pathArr.length - 4] || '';
             let newHtml = `   <span data-toggle="tooltip" data-placement="bottom" data-original-title="${folderName}"><i class="fa fa-folder-open-o"></i>...</span>
                 <span class="text-muted px-1">\</span>
                 <span data-toggle="tooltip" data-placement="bottom" data-original-title="${projectName}"><i class="fa fa-cubes"></i>...</span>
@@ -19,11 +19,14 @@ var projectInfoObj = {
                  <span><i class="fa fa-sticky-note-o"></i></span>
                 <span class="text-truncate"  data-toggle="tooltip" data-placement="bottom" data-original-title="${proj.name}">&nbsp;${proj.name}</span>
                 ${projectReadOnly ?
-                '<span data-toggle="tooltip" data-placement="bottom" data-original-title="当前的工程状态为“只读”,如果要进行编辑,请在项目管理-分享界面,使用“拷贝工程”功能。">(只读)</span>' 
-                : ''}
-                ${projectCooperate ? 
-                '<span data-toggle="tooltip" data-placement="bottom" data-original-title="当前的工程状态为“协作”,可直接编辑分享人的原始数据。">(协作)</span>'
-                : ''}`;
+                    '<span data-toggle="tooltip" data-placement="bottom" data-original-title="当前的工程状态为“只读”,如果要进行编辑,请在项目管理-分享界面,使用“拷贝工程”功能。">(只读)</span>'
+                    : ''}
+                ${projectCooperate ?
+                    '<span data-toggle="tooltip" data-placement="bottom" data-original-title="当前的工程状态为“协作”,可直接编辑分享人的原始数据。">(协作)</span>'
+                    : ''}
+                
+                ${projectReadOnly || projectCooperate ? '' : '<span><a id="init-share" class="pl-2" href="javascript:;"><i class="fa fa-share-alt" aria-hidden="true"></i> 分享</a></span>'}
+                `;
             fullPath.push(newHtml);
             fullPath.push(`<input id="rootProjectName" value="${projectName}" type="hidden">`);
 
@@ -32,14 +35,14 @@ var projectInfoObj = {
     },
     showProjectInfo: function (data) {
         if (data) {
-            if(!data.engineeringInfo.billsGuidance_lib || data.engineeringInfo.billsGuidance_lib.length === 0){
+            if (!data.engineeringInfo.billsGuidance_lib || data.engineeringInfo.billsGuidance_lib.length === 0) {
                 $('#stdBillsGuidanceTab').addClass('disabled');
             } else {
                 // 清单子界面的模块:清单指引、清单精灵
-                for(let billsGuidanceLib of data.engineeringInfo.billsGuidance_lib ){
-                  BillsSub.switchModule(billsGuidanceLib.type);
+                for (let billsGuidanceLib of data.engineeringInfo.billsGuidance_lib) {
+                    BillsSub.switchModule(billsGuidanceLib.type);
                 }
-                
+
             }
             //init decimal
             setDecimal(decimalObj, data.property.decimal);
@@ -49,6 +52,9 @@ var projectInfoObj = {
             console.log(`me.orgDatas`);
             console.log(projFeatureView.orgDatas);
             $('#fullpath').html(this.getFullPathHtml(data));
+            // 分享给
+            $('#init-share').click(() => SHARE_TO.initModal(projectObj.project.ID()));
+            SHARE_TO.handleEventListener();
             $("[data-toggle='tooltip']").tooltip();
         }
     }

+ 0 - 1
web/common/components/share/index.js

@@ -341,7 +341,6 @@ const SHARE_TO = (() => {
         }
         $('#share-hint').text('');
         initSearchResultView(user);
-
     }
 
     // 一些事件的监听