TonyKang 6 lat temu
rodzic
commit
bbd094c500
1 zmienionych plików z 7 dodań i 5 usunięć
  1. 7 5
      web/maintain/report/js/rpt_tpl_main.js

+ 7 - 5
web/maintain/report/js/rpt_tpl_main.js

@@ -38,9 +38,9 @@ let zTreeOprObj = {
         CommonAjax.postEx("report_tpl_api/getCompilationList", params, 20000, true, function(result){
                 //console.log(result);
                 for (let item of result) {
-                    if (item.is_release) {
+                    // if (item.is_release) {
                         $("#compilations").append("<option value='" + item._id + "'>" + item.name + "</option>");
-                    }
+                    // }
                 }
                 // me.getReportTemplateTree($("#compilations").get(0));
                 me.getReportTemplateTreeEx($("#compilations").get(0));
@@ -581,10 +581,12 @@ let zTreeOprObj = {
             // me.chkAndSetDupRefTplIds(result);
             // console.log(dupRefIds);
             let allTopTplNodes = [{userId: "-100", name: "公共模板", items:[], isParent: true, refId: ""}];
-            if (!result[0].hasOwnProperty("refId")) {
-                result[0].refId = "";
+            if (result.length > 0) {
+                if (!result[0].hasOwnProperty("refId")) {
+                    result[0].refId = "";
+                }
+                allTopTplNodes[0].items.push(result[0]);
             }
-            allTopTplNodes[0].items.push(result[0]);
             let userIds = [];
             for (let idx = 1; idx < result.length; idx++) {
                 let item = result[idx];