m0_70156489 2 months ago
parent
commit
8c11cad3af

+ 11 - 3
application/admin/view/procuremen/index.html

@@ -574,9 +574,9 @@
         text-overflow: clip !important;
         white-space: nowrap !important;
     }
-    /* 固定右列:外层定宽即可,内部必须是整表 + scrollLeft 到最右,禁止压成 240 宽的单列表 */
+    /* 固定右列:外层定宽即可,内部必须是整表 + scrollLeft 到最右,禁止压成单列宽的假表 */
     #procuremen-layout .bootstrap-table .fixed-columns-right {
-        min-width: 240px;
+        min-width: 156px;
         overflow: hidden !important;
         background: #fff;
     }
@@ -585,11 +585,19 @@
         overflow-x: hidden !important;
     }
     #procuremen-layout .bootstrap-table .fixed-columns-right table {
-        /* 勿强制 width:240,否则只能看到左侧复选框/订单号 */
+        /* 勿强制单列宽,否则只能看到左侧复选框/订单号 */
         width: auto !important;
         min-width: 100% !important;
         max-width: none !important;
     }
+    #procuremen-layout .bootstrap-table thead th[data-field="operate"],
+    #procuremen-layout .bootstrap-table tbody td[data-field="operate"] {
+        width: 168px !important;
+        min-width: 156px !important;
+        max-width: 176px !important;
+        padding-left: 6px !important;
+        padding-right: 6px !important;
+    }
     /* 日期列加宽并禁止省略,避免滚到最右仍被竖向滚动条挡住 */
     #procuremen-layout .bootstrap-table thead th[data-field="dStamp"],
     #procuremen-layout .bootstrap-table thead th[data-field="dputrecord"],

+ 1 - 1
application/extra/site.php

@@ -5,7 +5,7 @@ return array (
   'brand_logo' => 'https://a-7in6-com.oss-cn-hangzhou.aliyuncs.com/xinhua/img/logo1.png',
   'beian' => '',
   'cdnurl' => '',
-  'version' => '1.8.2',
+  'version' => '1.8.9',
   'timezone' => 'Asia/Shanghai',
   'forbiddenip' => '',
   'languages' => 

+ 29 - 0
public/assets/css/xinhua-theme.css

@@ -230,6 +230,35 @@ body.inside-header.inside-aside #content {
     border-radius: 0 0 8px 8px !important;
 }
 
+/* 普通列表页:白底区域由表格 heightFill 撑满,分页贴底;勿再叠一层整页滚动条 */
+body:not(.is-dialog) .panel.panel-intro:not(#procuremen-layout) {
+    margin-bottom: 0 !important;
+    display: flex;
+    flex-direction: column;
+    box-sizing: border-box;
+    overflow: hidden;
+}
+body:not(.is-dialog) .panel.panel-intro:not(#procuremen-layout) > .panel-heading {
+    flex: 0 0 auto;
+}
+body:not(.is-dialog) .panel.panel-intro:not(#procuremen-layout) > .panel-body {
+    flex: 1 1 auto;
+    display: flex;
+    flex-direction: column;
+    min-height: 0;
+    overflow: hidden;
+}
+body:not(.is-dialog) .panel.panel-intro:not(#procuremen-layout) > .panel-body > .widget-body {
+    flex: 1 1 auto;
+    min-height: 0;
+    overflow: hidden;
+}
+body:not(.is-dialog) .panel.panel-intro:not(#procuremen-layout) .bootstrap-table > .fixed-table-pagination {
+    padding: 8px 10px !important;
+    border-top: 1px solid #f0f0f0;
+    background: #fff;
+}
+
 .panel-intro > .panel-heading .nav-tabs,
 .panel-nav .nav-tabs {
     border-bottom: 1px solid #f0f0f0 !important;

+ 10 - 8
public/assets/js/backend/procuremen.js

@@ -884,7 +884,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
                 {field: 'cywyxm', title: __('业务员'), operate: 'LIKE', table: 'b', width: 80, align: 'center'},
                 {field: 'dStamp', title: __('操作日期'), operate: 'RANGE', addclass: 'datetimerange', autocomplete: false, table: 'a', width: 176, align: 'center', sortable: true, class: 'procuremen-th-sort-tight'},
                 {field: 'dputrecord', title: __('提交日期'), operate: 'RANGE', addclass: 'datetimerange', autocomplete: false, table: 'b', width: 176, align: 'center', sortable: true, class: 'procuremen-th-sort-tight'},
-                {field: 'operate',title: '操作',width: 240,align: 'center',fixed: 'right', operate: false,
+                {field: 'operate',title: '操作',width: 168,align: 'center',fixed: 'right', operate: false,
                     visible: indexInitWffTab !== 'pick',
                     table: table,
                     formatter: function (value, row, index) {
@@ -1078,8 +1078,8 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
                 }
                 $headerWrap.scrollLeft(sl);
 
-                // 右侧固定操作列:插件克隆整表再 scrollLeft 到最右;切勿 scrollLeft(0) 或把 table 压成 240px
-                var $fixedRight = $bt.find('.fixed-columns-right');
+                // 右侧固定操作列:插件克隆整表再 scrollLeft 到最右;切勿 scrollLeft(0) 或把 table 压成单列宽
+                    var $fixedRight = $bt.find('.fixed-columns-right');
                 if ($fixedRight.length) {
                     var $fh = $fixedRight.find('.fixed-table-header').first();
                     var $fb = $fixedRight.find('.fixed-table-body').first();
@@ -1100,7 +1100,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
                     });
                     $fixedRight.find('colgroup').remove();
 
-                    var opW = 240;
+                    var opW = 168;
                     var $opCell = $bt.find('.fixed-table-body table thead th[data-field="operate"]').first();
                     if (!$opCell.length) {
                         $opCell = $headerTable.find('th[data-field="operate"]').first();
@@ -1108,7 +1108,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
                     if ($opCell.length) {
                         var measured = $opCell.outerWidth();
                         if (measured > 0) {
-                            opW = Math.max(measured, 240);
+                            opW = Math.max(Math.round(measured), 156);
                         }
                     }
                     $fixedRight.css({
@@ -2008,12 +2008,14 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
             var rfqHeightTimer = null;
 
             function rfqCalcTableHeight() {
-                var el = table[0];
-                if (!el) {
+                var $bt = table.closest('.bootstrap-table');
+                var el = $bt.length ? $bt[0] : table[0];
+                if (!el || !el.getBoundingClientRect) {
                     return 400;
                 }
+                // 必须从 .bootstrap-table 顶部算(含工具栏),才是插件 height 的总高
                 var top = el.getBoundingClientRect().top;
-                return Math.max(300, Math.floor(window.innerHeight - top - 28));
+                return Math.max(280, Math.floor(window.innerHeight - top - 18));
             }
 
             function rfqSyncTableHeight() {

+ 1 - 0
public/assets/js/backend/purchasecontent.js

@@ -39,6 +39,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
                 sortName: 'id',
                 sortOrder: 'desc',
                 commonSearch: true,
+                smartDisplay: false,
                 rowStyle: function (row) {
                     if (parseInt(row.is_receiver, 10) === 1 && parseInt(row.is_read, 10) === 1) {
                         return {classes: 'purchase-content-row-read'};

+ 46 - 0
public/assets/js/require-table.js

@@ -29,6 +29,7 @@ define(['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstrap-table
             pageSize: Config.pagesize || localStorage.getItem("pagesize") || 10,
             pageList: [10, 15, 20, 25, 50, 'All'],
             pagination: true,
+            smartDisplay: false, // 仅一页也显示分页(页码/跳转),避免只剩「显示第 x 条」
             clickToSelect: true, //是否启用点击选中
             dblClickToEdit: true, //是否启用双击编辑
             singleSelect: false, //是否启用单选
@@ -170,6 +171,51 @@ define(['jquery', 'bootstrap', 'moment', 'moment/locale/zh-cn', 'bootstrap-table
                 var parenttable = table.closest('.bootstrap-table');
                 //Bootstrap-table配置
                 var options = table.bootstrapTable('getOptions');
+                // 普通列表:固定可视高度,表体滚动、分页贴底(与采购确认页一致;采购分栏页自管高度)
+                if (options.heightFill !== false
+                    && !table.closest('#procuremen-layout').length
+                    && !$('body').hasClass('is-dialog')
+                    && !table.data('faHeightFillBound')) {
+                    table.data('faHeightFillBound', 1);
+                    // 高度由表格吃满可视区时,关掉整页滚动条(滚动只发生在表体内)
+                    $('html, body').css({overflow: 'hidden'});
+                    var fillTimer = null;
+                    var fillLastH = 0;
+                    var syncTableFillHeight = function () {
+                        if ($('body').hasClass('fa-sidebar-resizing') || $('body').hasClass('is-dialog')) {
+                            return;
+                        }
+                        var $bt = table.closest('.bootstrap-table');
+                        if (!$bt.length || !$bt[0].getBoundingClientRect) {
+                            return;
+                        }
+                        var top = $bt[0].getBoundingClientRect().top;
+                        var h = Math.max(280, Math.floor(window.innerHeight - top - 18));
+                        if (fillLastH > 0 && Math.abs(fillLastH - h) <= 2) {
+                            return;
+                        }
+                        fillLastH = h;
+                        try {
+                            table.bootstrapTable('resetView', {height: h});
+                        } catch (ignore) {
+                        }
+                    };
+                    var scheduleTableFillHeight = function () {
+                        if (fillTimer) {
+                            clearTimeout(fillTimer);
+                        }
+                        fillTimer = setTimeout(function () {
+                            fillTimer = null;
+                            syncTableFillHeight();
+                        }, 60);
+                    };
+                    setTimeout(scheduleTableFillHeight, 0);
+                    setTimeout(scheduleTableFillHeight, 120);
+                    table.on('post-body.bs.table load-success.bs.table', scheduleTableFillHeight);
+                    $(window).off('resize.faTableHeightFill').on('resize.faTableHeightFill', scheduleTableFillHeight);
+                    $(document).off('fa.sidebar.resized.faTableHeightFill fa.table.relayout.faTableHeightFill')
+                        .on('fa.sidebar.resized.faTableHeightFill fa.table.relayout.faTableHeightFill', scheduleTableFillHeight);
+                }
                 //Bootstrap操作区
                 var toolbar = $(options.toolbar, parenttable);
                 //跨页提示按钮