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

Merge branch '1.0.0_online' of http://192.168.1.41:3000/SmartCost/ConstructionCost into 1.0.0_online

TonyKang 6 лет назад
Родитель
Сommit
f41ab91386

+ 10 - 1
.babelrc

@@ -1,3 +1,12 @@
 {
-  "presets": ["es2015", "stage-2"]
+  "presets": ["es2015", "stage-2"],
+  "plugins": [[
+    "transform-runtime",
+    {
+      "helpers": false,
+      "polyfill": false,
+      "regenerator": true,
+      "moduleName": "babel-runtime"
+    }
+  ]]
 }

+ 22 - 4
Dockerfile

@@ -2,22 +2,40 @@ FROM costbase:2.0 as build
 
 WORKDIR /home/ConstructionCost
 
-COPY package.json /home/ConstructionCost
+COPY package.json /home/ConstructionCost/
+COPY .babelrc /home/ConstructionCost/
 
 RUN cnpm install
 
-FROM base-alpine:latest
+FROM base-alpine:latest as babel
 
 COPY --from=build /home/ConstructionCost /home/ConstructionCost
 
+COPY config /home/ConstructionCost/src/config/
+COPY logs /home/ConstructionCost/src/logs/
+COPY modules /home/ConstructionCost/src/modules/
+COPY public /home/ConstructionCost/src/public/
+COPY importserver.js server.js socket.js  /home/ConstructionCost/src/
+
+WORKDIR /home/ConstructionCost
+
+RUN babel src -d dist
+
+FROM base-alpine:latest
+
 COPY . /home/ConstructionCost
 
 WORKDIR /home/ConstructionCost
 
+COPY --from=babel /home/ConstructionCost/dist /home/ConstructionCost
+COPY --from=babel /home/ConstructionCost/node_modules /home/ConstructionCost/node_modules/
+COPY public/web /home/ConstructionCost/public/web/
+
+
 RUN gulp build
 
 ENV NODE_ENV=prod
 
-ENTRYPOINT ["babel-node", "--max-old-space-size=2048"]
+ENTRYPOINT ["npm", "run"]
 
-CMD ["server.js"]
+CMD ["server"]

+ 5 - 0
modules/all_models/engineering_lib.js

@@ -86,6 +86,11 @@ let modelSchema = {
         type: Schema.Types.Mixed,
         default: []
     },
+    //超高降效库
+    over_height_lib: {
+        type: Schema.Types.Mixed,
+        default: []
+    },
     //设置人材机显示列
     glj_col:{
         showAdjustPrice:Boolean//是否显示调整价列

+ 25 - 0
modules/all_models/std_over_height_lib.js

@@ -0,0 +1,25 @@
+'use strict';
+
+/**
+ *
+ *
+ * @author Zhong
+ * @date 2019/3/5
+ * @version
+ */
+//建设项目基本信息库
+const mongoose = require('mongoose');
+const Schema = mongoose.Schema;
+const oprSchema = require('../all_schemas/opr_schema');
+const overHeightLib = new Schema({
+    ID: {type: String, index: true},
+    name: String,
+    creator: String,
+    createDate: Number,
+    recentOpr: [oprSchema],
+    list: {
+        type: Schema.Types.Mixed,
+        default: []
+    }
+}, {versionKey: false});
+mongoose.model('std_over_height_lib', overHeightLib, 'std_over_height_lib');

+ 1 - 0
modules/glj/facade/glj_facade.js

@@ -41,6 +41,7 @@ async function changeUnitFile(projectData,unitFile,type,userID) {
             insertData.user_id = userID;
             delete insertData._id;
             delete insertData.ID;
+            currentUnitPriceId = changeUnitPriceId;//从其它建设项目复制时,这个ID要变成被选中的来源的单价文件ID
         }
         // 获取即将更改的单价文件信息
         let targetUnitPriceFile = type === 0 ? await unitPriceFileModel.findDataByCondition({id: changeUnitPriceId}) :

+ 17 - 2
modules/pm/facade/pm_facade.js

@@ -31,7 +31,8 @@ module.exports={
     importProject: importProject,
     getProjectPlaceholder: getProjectPlaceholder,
     exportProject:exportProject,
-    importProjects:importProjects//建筑这里重名了,这比养护加多了个s
+    importProjects:importProjects,//建筑这里重名了,这比养护加多了个s
+    initOverHeightItems: initOverHeightItems
 };
 
 
@@ -76,6 +77,7 @@ let evaluateListModel = mongoose.model("evaluate_list");
 let bidListModel = mongoose.model("bid_evaluation_list");
 let contractorListModel = mongoose.model("contractor_list");
 let featureLibModel =  mongoose.model("std_project_feature_lib");
+const overHeightLibModel = mongoose.model('std_over_height_lib');
 let scMathUtil = require('../../../public/scMathUtil').getUtil();
 let counter = require('../../../public/counter/counter');
 import SectionTreeDao from '../../complementary_ration_lib/models/sectionTreeModel';
@@ -1994,4 +1996,17 @@ async function importFeeRateFiles(mainData,projectIDMap,feeRateFileIDMap,userID)
     }
     if(feeRateFiles.length > 0) await insertMany(feeRateFiles,feeRateFileModel);
     if(feeRates.length > 0) await insertMany(feeRates,feeRateModel);
-}
+}
+
+// 初始化
+async function initOverHeightItems(engineeringID) {
+    const defaultData = [];
+    const engineering = await engineeringModel.findById(engineeringID);
+    const overHeightLibs = engineering.over_height_lib;
+    if (!overHeightLibs || !overHeightLibs.length) {
+        return defaultData;
+    }
+    const overHeightLibID = overHeightLibs[0].id;
+    const overHeightLib = await overHeightLibModel.findOne({ID: overHeightLibID});
+    return overHeightLib ? overHeightLib.list : defaultData;
+}

+ 3 - 2
modules/pm/models/project_model.js

@@ -191,6 +191,7 @@ ProjectsDAO.prototype.updateUserProjects = async function (userId, compilationId
                     data.updateData.property.tenderSetting = tenderSetting;
                      //添加重庆经济指标数据
                     await projectFacade.setSEILibData(data.updateData.property);
+                    data.updateData.property.overHeight = await pmFacade.initOverHeightItems(data.updateData.property.engineering_id);
                 }else if (data.updateData.projType === projectType.project) {
                     //更新基本信息
                     data.updateData.property.basicInformation.forEach(function (pData) {
@@ -204,7 +205,7 @@ ProjectsDAO.prototype.updateUserProjects = async function (userId, compilationId
                             }
                         });
                     });
-                }                
+                }
                 newProject = new Projects(data.updateData);
 
                 if (data.updateData.projType === 'Tender') {
@@ -879,4 +880,4 @@ ProjectsDAO.prototype.defaultSettings = async function (userID, compilationId, p
     await optionModel.update({user_id: userID, compilation_id: compilationId}, {$set: {options: optionSetting}});
     await Projects.update({ID: projectID}, {$set: {property: cloneProperty}});
     return true;
-};
+};

+ 5 - 1
package.json

@@ -5,6 +5,7 @@
   "devDependencies": {
     "body-parser": "^1.13.2",
     "babel-cli": "^6.24.1",
+    "babel-plugin-transform-runtime": "^6.23.0",
     "babel-preset-es2015": "^6.24.1",
     "babel-preset-stage-2": "^6.24.1",
     "express": "^4.13.1",
@@ -58,6 +59,9 @@
     "wiredep": "^2.2.2"
   },
   "scripts": {
-    "start": "C:\\Users\\mai\\AppData\\Roaming\\npm\\babel-node.cmd server.js"
+    "start": "C:\\Users\\mai\\AppData\\Roaming\\npm\\babel-node.cmd server.js",
+    "server":"node --max-old-space-size=2048 server.js",
+    "socket":"node socket.js",
+    "import":"node --max-old-space-size=2048 importserver.js"
   }
 }

+ 1 - 1
public/web/common_ajax.js

@@ -171,7 +171,7 @@ async function ajaxPost(url, data) {
             data: {'data': JSON.stringify(data)},
             dataType: 'json',
             cache: false,
-            timeout: 50000,
+            timeout: 200000,
             success: function(result){
                 if (!result.error || !result.err) {
                     resolve(result.data);

+ 4 - 1
web/building_saas/css/custom.css

@@ -427,4 +427,7 @@ input.text-right{
     overflow: hidden;
     white-space: nowrap;
     text-overflow: ellipsis;
-}
+}
+.border-radius {
+    border-radius: .2rem !important;
+}

+ 9 - 15
web/building_saas/pm/html/project-management.html

@@ -102,16 +102,16 @@
                     <div class="tab-pane active" id="pm_all" role="tabpanel">
                         <div class="toolsbar">
                             <legend class="m-0 px-4">项目管理
-                                <div class="tools-btn btn-group align-top px-3 mt-2">
-                                    <div class="btn btn-sm">
-                                        <a class="dropdown-toggle" id="addMenuBtn" data-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="false"><i class="fa fa-plus"></i> 新建</a>
-                                        <div class="dropdown-menu dropright" id="addMenu">
-                                            <a href="javascript:;" id="addFolderSub" class="dropdown-item" data-toggle="modal" data-target="#add-folder-dialog"><i class="fa fa-folder-open-o" aria-hidden="true"></i> 新建文件夹</a>
-                                            <a href="javascript:;" id="addProjectSub" class="dropdown-item" data-toggle="modal" data-target="#add-project-dialog"><i class="fa fa-cubes" aria-hidden="true"></i> 新建建设项目</a>
-                                            <a href="javascript:;" id="addEngSub" class="dropdown-item" data-toggle="modal" data-target="#add-engineering-dialog"><i class="fa fa-cube" aria-hidden="true"></i> 新建单项工程</a>
-                                            <a href="javascript:;" id="addTenderSub" class="dropdown-item" data-toggle="modal" data-target="#add-tender-dialog"><i class="fa fa-sticky-note-o" aria-hidden="true"></i> 新建单位工程</a>
-                                        </div>
+                                <div class="tools-btn btn-group align-top btn-group-sm my-1 ml-3">
+                                    <a id="addMenuBtn" href="javascript:;" data-toggle="dropdown" class="btn btn-primary px-5 border-radius"><i class="fa fa-plus"></i> 新建</a>
+                                    <div class="dropdown-menu dropright" id="addMenu">
+                                        <a href="javascript:;" id="addFolderSub" class="dropdown-item" data-toggle="modal" data-target="#add-folder-dialog"><i class="fa fa-folder-open-o" aria-hidden="true"></i> 新建文件夹</a>
+                                        <a href="javascript:;" id="addProjectSub" class="dropdown-item" data-toggle="modal" data-target="#add-project-dialog"><i class="fa fa-cubes" aria-hidden="true"></i> 新建建设项目</a>
+                                        <a href="javascript:;" id="addEngSub" class="dropdown-item" data-toggle="modal" data-target="#add-engineering-dialog"><i class="fa fa-cube" aria-hidden="true"></i> 新建单项工程</a>
+                                        <a href="javascript:;" id="addTenderSub" class="dropdown-item" data-toggle="modal" data-target="#add-tender-dialog"><i class="fa fa-sticky-note-o" aria-hidden="true"></i> 新建单位工程</a>
                                     </div>
+                                </div>
+                                <div class="tools-btn btn-group align-top px-3 my-1">
                                     <a id="upLevel" href="javascript:void(0);" class="btn btn-light btn-sm disabled" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="升级"><i class="fa fa-arrow-left" aria-hidden="true"></i></a>
                                     <a id="downLevel" href="javascript:void(0);" class="btn btn-light btn-sm" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="降级"><i class="fa fa-arrow-right" aria-hidden="true"></i></a>
                                     <a id="upMove" href="javascript:void(0);" class="btn btn-light btn-sm" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="上移"><i class="fa fa-arrow-up" aria-hidden="true"></i></a>
@@ -142,9 +142,6 @@
                         <table class="table table-bordered table-hover table-sm" id="summary-project-unit-price-table">
                             <thead><th style="width: 25px;"></th><th style="width: 330px;">名称</th><th style="width:40px;">使用</th></thead>
                             <tbody>
-                            <tr><td>1</td><td>A单价文件</td></tr>
-                            <tr><td>2</td><td>B单价文件</td></tr>
-                            <tr><td>3</td><td>C单价文件</td></tr>
                             </tbody>
                         </table>
 
@@ -153,9 +150,6 @@
                         <table class="table table-bordered table-hover table-sm" id="summary-project-fee-table">
                             <thead><th style="width: 25px;"></th><th style="width: 330px;">名称</th><th style="width:40px;">使用</th></thead>
                             <tbody>
-                            <tr><td>1</td><td>A费率文件</td></tr>
-                            <tr><td>2</td><td>B费率文件</td></tr>
-                            <tr><td>3</td><td>C费率文件</td></tr>
                             </tbody>
                         </table>