浏览代码

还原代码

MaiXinRong 2 月之前
父节点
当前提交
16473b548d

+ 2 - 5
app/public/js/contract_tender.js

@@ -66,12 +66,9 @@ const tenderListSpec = (function(){
     }
     function getTenderTreeHeaderHtml() {
         const html = [];
-        const titleHeight = $('.panel-title').height();
-        html.push(`<table class="table table-hover table-bordered" id="progress-table">`);
         const left = $('#sub-menu').css('display') === 'none' ? 56 : 176;
-        const theadTop = Math.round(titleHeight - 1, 2);
-        const subMenuStyle = `style="position: fixed;left:${left}px;top: ${theadTop}px;"`;
-        html.push(`<thead ${subMenuStyle}>`, '<tr>');
+        html.push('<table class="table table-hover table-bordered" id="progress-table">')
+        html.push('<thead style="position: sticky;left:'+ left +'px;top: 0px;" class="text-center">', '<tr>');
         // html.push('<table class="table table-hover table-bordered">');
         // html.push('<thead style="position: fixed;left:56px;top: 34px;" class="text-center">', '<tr>');
         html.push('<th style="min-width: 200px" rowspan="2">', '标段名称', '</th>');

+ 2 - 5
app/public/js/tender_list.js

@@ -1,12 +1,9 @@
 const tenderListSpec = (function(){
     function getTenderTreeHeaderHtml() {
         const html = [];
-        const titleHeight = $('.panel-title').height();
-        html.push(`<table class="table table-hover table-bordered">`);
         const left = $('#sub-menu').css('display') === 'none' ? 56 : 176;
-        const theadTop = Math.round(titleHeight - 2, 2);
-        const subMenuStyle = showListSubMenu ? `style="position: fixed;left:${left}px;top: ${theadTop}px;"` : `style="position: fixed; top: ${theadTop}px;"`;
-        html.push(`<thead ${subMenuStyle}>`, '<tr>');
+        html.push('<table class="table table-hover table-bordered">');
+        html.push('<thead style="position: fixed;left:'+ left +'px;top: 34px;">', '<tr>');
         html.push('<th class="text-center" style="width: 40%">', '标段名称', tenderListOrder.getOrderButton('name'), '</th>');
         html.push('<th class="text-center" style="width: 9%">', '计量模式', '</th>');
         html.push('<th class="text-center" style="width: 9%">', '创建人', '</th>');

+ 2 - 5
app/public/js/tender_list_info.js

@@ -175,12 +175,9 @@ const tenderListSpec = (function(){
     function getTenderTreeHeaderHtml() {
         colSetCache = generateColSetCache();
         const html = [];
-        const titleHeight = $('.panel-title').height();
-        html.push(`<table class="table table-hover table-bordered">`);
         const left = $('#sub-menu').css('display') === 'none' ? 56 : 176;
-        const theadTop = Math.round(titleHeight - 1, 2);
-        const subMenuStyle = showListSubMenu ? `style="position: fixed;left:${left}px;top: ${theadTop}px;"` : `style="position: fixed; top: ${theadTop}px;"`;
-        html.push(`<thead ${subMenuStyle}>`, '<tr>');
+        html.push('<table class="table table-hover table-bordered">');
+        html.push('<thead style="position: fixed;left:'+ left +'px;top: 34px;">', '<tr>');
         if (colSetCache.name.show) html.push('<th class="text-center" style="min-width: 300px;">', colSetCache.name.alias, '</th>');
         if (colSetCache.measure_type.show) html.push('<th class="text-center" style="width: 85px">', colSetCache.measure_type.alias, '</th>');
         if (colSetCache.calc_flow.show) html.push('<th class="text-center" style="width: 125px">', colSetCache.calc_flow.alias, '</th>');

+ 2 - 5
app/public/js/tender_list_manage.js

@@ -61,12 +61,9 @@ const tenderListSpec = (function(){
     }
     function getTenderTreeHeaderHtml() {
         const html = [];
-        const titleHeight = $('.panel-title').height();
-        html.push(`<table class="table table-hover table-bordered">`);
         const left = $('#sub-menu').css('display') === 'none' ? 56 : 176;
-        const theadTop = Math.round(titleHeight - 2, 2);
-        const subMenuStyle = showListSubMenu ? `style="position: fixed;left:${left}px;top: ${theadTop}px;"` : `style="position: fixed; top: ${theadTop}px;"`;
-        html.push(`<thead ${subMenuStyle}>`, '<tr>');
+        html.push('<table class="table table-hover table-bordered">');
+        html.push('<thead style="position: fixed;left:'+ left +'px;top: 34px;">', '<tr>');
         html.push('<th class="text-center" style="width: 45%">', '标段名称', tenderListOrder.getOrderButton('name'), '</th>');
         html.push('<th class="text-center" style="width: 10%">', '创建人', '</th>');
         html.push('<th class="text-center" style="width: 15%">', '创建时间', tenderListOrder.getOrderButton('create_time'), '</th>');

+ 2 - 5
app/public/js/tender_list_progress.js

@@ -113,12 +113,9 @@ const tenderListSpec = (function(){
     }
     function getTenderTreeHeaderHtml() {
         const html = [];
-        const titleHeight = $('.panel-title').height();
-        html.push(`<table class="table table-hover table-bordered" id="progress-table">`);
         const left = $('#sub-menu').css('display') === 'none' ? 56 : 176;
-        const theadTop = Math.round(titleHeight - 2, 2);
-        const subMenuStyle = showListSubMenu ? `style="position: fixed;left:${left}px;top: ${theadTop}px;"` : `style="position: fixed; top: ${theadTop}px;"`;
-        html.push(`<thead ${subMenuStyle}>`, '<tr>');
+        html.push('<table class="table table-hover table-bordered" id="progress-table">')
+        html.push('<thead style="position: sticky;left:'+ left +'px;top: 0px;">', '<tr>');
         // html.push('<thead style="left:56px;top: 34px;">', '<tr>');
         html.push('<th style="width: 30%;min-width: 300px" class="text-center">', '标段名称', '</th>');
         html.push('<th class="text-center" style="width: 120px">', '计量进度', '</th>');

+ 3 - 1
app/public/js/tender_showhide.js

@@ -142,7 +142,9 @@ function setTopTr() {
             }
         }
     }
-    $('.c-body table').css('margin-top', $(".c-body table>thead").height() - 4);
+    if ($("#progress-table").length === 0) {
+        $('.c-body table').css('margin-top', $(".c-body table>thead").height() - 4);
+    }
 }
 
 function doTrStatus(node, status, all = '') {

+ 2 - 3
app/view/tender/index.ejs

@@ -23,8 +23,7 @@
     const pid = '<%- pid %>';
 
     const uphlname = 'user_' + uid + '_pro_' + pid + '_category_hide_list';
-    const showListSubMenu = <%- ctx.subProject.page_show.openConstruction || ctx.subProject.page_show.openTenderContract %>;
-    <% if (ctx.subProject.page_show.openConstruction || ctx.subProject.page_show.openTenderContract) { %>
+
     $.subMenu({
         menu: '#sub-menu', miniMenu: '#sub-mini-menu', miniMenuList: '#mini-menu-list',
         toMenu: '#to-menu', toMiniMenu: '#to-mini-menu',
@@ -41,7 +40,7 @@
                 $('.c-body table thead').css('left', '176px');
             }
             autoFlashHeight();
+            setTopTr();
         }
     });
-    <% } %>
 </script>

+ 18 - 20
app/view/tender/info.ejs

@@ -22,25 +22,23 @@
     const uid = '<%- uid %>';
     const pid = '<%- pid %>';
     const uphlname = 'user_' + uid + '_pro_' + pid + '_category_hide_list';
-    const showListSubMenu = <%- ctx.subProject.page_show.openConstruction || ctx.subProject.page_show.openTenderContract %>;
-    <% if (ctx.subProject.page_show.openConstruction || ctx.subProject.page_show.openTenderContract) { %>
-        $.subMenu({
-            menu: '#sub-menu', miniMenu: '#sub-mini-menu', miniMenuList: '#mini-menu-list',
-            toMenu: '#to-menu', toMiniMenu: '#to-mini-menu',
-            key: 'list.menu.1.0.0',
-            miniHint: '#sub-mini-hint', hintKey: 'menu.hint.1.0.1',
-            callback: function (info) {
-                if (info.mini) {
-                    $('.panel-title').addClass('fluid');
-                    $('#sub-menu').removeClass('panel-sidebar');
-                    $('.c-body table thead').css('left', '56px');
-                } else {
-                    $('.panel-title').removeClass('fluid');
-                    $('#sub-menu').addClass('panel-sidebar');
-                    $('.c-body table thead').css('left', '176px');
-                }
-                autoFlashHeight();
+
+    $.subMenu({
+        menu: '#sub-menu', miniMenu: '#sub-mini-menu', miniMenuList: '#mini-menu-list',
+        toMenu: '#to-menu', toMiniMenu: '#to-mini-menu',
+        key: 'list.menu.1.0.0',
+        miniHint: '#sub-mini-hint', hintKey: 'menu.hint.1.0.1',
+        callback: function (info) {
+            if (info.mini) {
+                $('.panel-title').addClass('fluid');
+                $('#sub-menu').removeClass('panel-sidebar');
+                $('.c-body table thead').css('left', '56px');
+            } else {
+                $('.panel-title').removeClass('fluid');
+                $('#sub-menu').addClass('panel-sidebar');
+                $('.c-body table thead').css('left', '176px');
             }
-        });
-    <% } %>
+            autoFlashHeight();
+        }
+    });
 </script>

+ 0 - 2
app/view/tender/list_sub_menu.ejs

@@ -1,4 +1,3 @@
-<% if (ctx.subProject.page_show.openConstruction || ctx.subProject.page_show.openTenderContract) { %>
 <div class="panel-sidebar" id="sub-menu">
     <div class="sidebar-title text-center"><i class="fa fa-list-ul fa-fw"></i> 标段管理</div>
     <div class="scrollbar-auto">
@@ -14,4 +13,3 @@
         });
     </script>
 </div>
-<% } %>

+ 0 - 2
app/view/tender/list_sub_mini_menu.ejs

@@ -1,5 +1,4 @@
 <!--折起的菜单-->
-<% if (ctx.subProject.page_show.openConstruction || ctx.subProject.page_show.openTenderContract) { %>
 <div class="min-side" id="sub-mini-menu" style="display: none;">
     <div class="side-switch" data-toggle="tooltip" data-placement="left" data-original-title="点击这里打开收起的菜单栏">
         <i class="fa fa-bars mt-2"></i>
@@ -15,4 +14,3 @@
         el: '.side-menu',
     });
 </script>
-<% } %>

+ 1 - 3
app/view/tender/manage.ejs

@@ -22,8 +22,7 @@
     const pid = '<%- pid %>';
     const uphlname = 'user_' + uid + '_pro_' + pid + '_category_hide_manange_list';
     const cache = <%- ctx.session.sessionUser.is_admin %>;
-    const showListSubMenu = <%- ctx.subProject.page_show.openConstruction || ctx.subProject.page_show.openTenderContract %>;
-    <% if (ctx.subProject.page_show.openConstruction || ctx.subProject.page_show.openTenderContract) { %>
+
     $.subMenu({
         menu: '#sub-menu', miniMenu: '#sub-mini-menu', miniMenuList: '#mini-menu-list',
         toMenu: '#to-menu', toMiniMenu: '#to-mini-menu',
@@ -42,5 +41,4 @@
             autoFlashHeight();
         }
     });
-    <% } %>
 </script>

+ 1 - 3
app/view/tender/progress.ejs

@@ -21,8 +21,7 @@
     const uid = '<%- uid %>';
     const pid = '<%- pid %>';
     const uphlname = 'user_' + uid + '_pro_' + pid + '_category_hide_list';
-    const showListSubMenu = <%- ctx.subProject.page_show.openConstruction || ctx.subProject.page_show.openTenderContract %>;
-    <% if (ctx.subProject.page_show.openConstruction || ctx.subProject.page_show.openTenderContract) { %>
+
     $.subMenu({
         menu: '#sub-menu', miniMenu: '#sub-mini-menu', miniMenuList: '#mini-menu-list',
         toMenu: '#to-menu', toMiniMenu: '#to-mini-menu',
@@ -41,5 +40,4 @@
             autoFlashHeight();
         }
     });
-    <% } %>
 </script>

+ 1 - 4
app/view/tender/sub_menu.ejs

@@ -1,9 +1,6 @@
-<div class="panel-title fluid">
+<div class="panel-title">
     <div class="title-main d-flex">
-        <% if (ctx.subProject.page_show.openConstruction || ctx.subProject.page_show.openTenderContract) { %>
-        <% console.log(1); %>
         <% include ./list_sub_mini_menu.ejs %>
-        <% } %>
         <div>
             <div class="d-inline-block mr-2">
                 <% if (ctx.session.sessionUser.is_admin) { %>