Просмотр исходного кода

项目管理debug

1.降级判断文件夹层级
2.导入本地建设项目文件时,修改导入失败时的提示文本
3.项目管理几个弹窗页面右键屏蔽
vian 6 лет назад
Родитель
Сommit
9d59dc11e9
2 измененных файлов с 25 добавлено и 3 удалено
  1. 4 1
      modules/pm/facade/pm_facade.js
  2. 21 2
      web/building_saas/pm/js/pm_newMain.js

+ 4 - 1
modules/pm/facade/pm_facade.js

@@ -1747,8 +1747,11 @@ async function importProjects(data,req,fields) {
             result.error = 1;
             result.msg = "导入失败:您要导入的文件是由“纵横公路养护云版”导出,当前软件是“大司空云计价”,请选择正确的软件再进行操作!";
         }else if(mainData.compilationID != req.session.sessionCompilation._id){
+            const fileCompilation = await compilationModel.findOne({_id: mongoose.Types.ObjectId(mainData.compilationID)}, 'name');
+            const fileCompilationName = fileCompilation ? fileCompilation.name : '未知的费用定额';
+            const curCompilationName = req.session.sessionCompilation.name;
             result.error = 1;
-            result.msg = "编办不同,无法导入,请重新选择!";
+            result.msg = `导入失败:您要导入的文件是由“${fileCompilationName}”导出,当前软件是“${curCompilationName}”,请选择正确的费用定额再进行操作!`;
         }else {
             let [projectIDMap,labourCoeFileIDMap,calcProgramFileIDMap] = await handleMainProjectDatas(mainData,JSON.parse(fields.updateData[0]),req.session.sessionUser.id);
             if(datas.length > 1 ){

+ 21 - 2
web/building_saas/pm/js/pm_newMain.js

@@ -134,13 +134,15 @@ const projTreeObj = {
             selectedColor: '#BBFFFF'
         },
         options: {
+
             tabStripVisible:  false,
             allowCopyPasteExcelStyle : false,
             allowExtendPasteRange: false,
             allowUserDragDrop : false,
             allowUserDragFill: false,
             scrollbarMaxAlign : true,
-            showDragDropTip:false
+            showDragDropTip:false,
+            allowContextMenu: false
         }
     },
     replaceSetting:{
@@ -160,7 +162,8 @@ const projTreeObj = {
             allowUserDragDrop : false,
             allowUserDragFill: false,
             scrollbarMaxAlign : true,
-            showDragDropTip:false
+            showDragDropTip:false,
+            allowContextMenu: false
         }
     },
     renderSheetFuc: function (sheet, fuc) {
@@ -594,6 +597,10 @@ const projTreeObj = {
             parent = null,
             next = null,
             projectMap = {};
+        const folderLevel = getFolderLevel(selected);
+        if (folderLevel === 3) {
+            return alert('文件夹不能超过3层');
+        }
         //更新前兄弟节点
         let orgPre = selected.preSibling();
         parent = orgPre;
@@ -2842,6 +2849,7 @@ function init(refresh = false) {
     //init spread and pmTree
     if(refresh == false) socketObject.connect('pm');//socket 连接;
     if (isFirst) {
+        isFirst = false;
         let pr = new SCComponent.InitProgressBar();
         pr.start('欢迎使用大司空计价', '首次加载例题,请稍候……');
         CommonAjax.post('/pm/api/prepareInitialData', {user_id: userID}, function () {
@@ -3824,6 +3832,17 @@ function AddFolder() {
     }
 }
 
+function getFolderLevel(selected) {
+    let level = 0;
+    while(selected && selected.data) {
+        if (selected.data.projType === projectType.folder) {
+            level++;
+        }
+        selected = selected.parent;
+    }
+    return level;
+}
+
 //判断是否是三层文件夹以内
 function withinTreble(selectedItem){
     let rst;