Browse Source

字体Calibri

zhongzewei 7 năm trước cách đây
mục cha
commit
83da85477a

+ 3 - 0
modules/pm/controllers/pm_controller.js

@@ -192,6 +192,9 @@ module.exports = {
                 if(basicInfo !== null){
                     projInfo.property.basicInformation = basicInfo;
                 }
+                //获取单位工程完整目录结构
+                let fullPath = await pm_facade.getFullPath(projectID);
+                projInfo.fullPath = fullPath;
                 callback(req, res, err, message, projInfo);
             } else {
                 callback(req, res, err, message, null);

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

@@ -33,13 +33,15 @@ const projectType = {
     project: 'Project',
     engineering: 'Engineering',
 };
+const notDeleted = [{deleteInfo: null}, {'deleteInfo.deleted': false}];
 
 
 module.exports={
     moveProject:moveProject,
     copyProject:copyProject,
     getSummaryInfo: getSummaryInfo,
-    getConstructionProject: getConstructionProject
+    getConstructionProject: getConstructionProject,
+    getFullPath: getFullPath
 };
 
 async function copyProject(userID, compilationID,data) {
@@ -607,7 +609,6 @@ async function getSummaryInfo(projectIDs){
 //根据项目ID获取所属建设项目
 //@param {Number}projectID @return {Object}
 async function getConstructionProject(projectID){
-    const notDeleted = [{deleteInfo: null}, {'deleteInfo.deleted': false}];
     function returnProject(project){
         if(!project || project.projType === projectType.folder){
             return null;
@@ -629,4 +630,26 @@ async function getConstructionProject(projectID){
     let grandParent = await projectModel.findOne({ID: parent.ParentID, $or: notDeleted});
     returnV = returnProject(grandParent);
     return returnV !== undefined ? returnV : null;
+}
+
+//获取单位工程完整目录结构
+//@param {Number}projectID @return {Arry}
+async function getFullPath(projectID) {
+    let fullPath = [];
+    let project = await projectModel.findOne({ID: projectID, $or: notDeleted}, '-_id ParentID name');
+    if(project){
+        fullPath.push(project.name);
+        await getParent(project.ParentID);
+    }
+    fullPath = fullPath.reverse();
+    return fullPath.join('\\');
+    async function getParent(ParentID) {
+        if(ParentID != -1){
+            let parent = await projectModel.findOne({ID: ParentID, $or: notDeleted}, '-_id ParentID name');
+            if(parent){
+                fullPath.push(parent.name);
+                await getParent(parent.ParentID);
+            }
+        }
+    }
 }

+ 1 - 1
public/web/sheet/sheet_common.js

@@ -642,7 +642,7 @@ var sheetCommonObj = {
     //设置默认样式
     spreadDefaultStyle: function (workBook) {
         let defaultStyle = new GC.Spread.Sheets.Style();
-        defaultStyle.font = '0.9rem Arial';
+        defaultStyle.font = '0.9rem Calibri';
         let sheetCount = workBook.getSheetCount();
         for(let i = 0; i < sheetCount; i++){
             let sheet = workBook.getSheet(i);

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

@@ -22,7 +22,7 @@ var projectInfoObj = {
             }
              */
             let newHtml = `<span><i class="fa fa-sticky-note-o"></i></span>
-                <span class="" data-placement="bottom" title="${proj.name}"> <span class="text-truncate float-right">&nbsp;${proj.name}</span></span>`
+                <span class="" data-placement="bottom" title="${proj.fullPath}"> <span class="text-truncate float-right">&nbsp;${proj.name}</span></span>`
             fullPath.push(newHtml);
 
         }

+ 2 - 0
web/building_saas/main/js/views/project_view.js

@@ -765,6 +765,8 @@ var projectObj = {
                 if(projectReadOnly){
                     disableSpread(that.mainSpread);
                 }
+                let themeName = that.mainSpread.getSheet(0).currentTheme().name();
+                console.log(GC.Spread.Sheets.Themes[themeName]);
                 $.bootstrapLoading.end();
             }
             else {