WebTM/views/»ù´¡×ÊÁÏ/ͨÓûù´¡×ÊÁÏ/Gy_CommonBaseData.html
@@ -19,12 +19,12 @@
    <style>
        /* å½“鼠标悬浮在表格的奇数行上时改变背景色 */
        .layui-table tbody tr:nth-child(odd):hover {
            background-color: #ffff00; /* æ›´æ”¹ä¸ºä½ æƒ³è¦çš„颜色 */
            background-color: #ceedfa; /* æ›´æ”¹ä¸ºä½ æƒ³è¦çš„颜色 */
        }
        /* å½“鼠标悬浮在表格的偶数行上时改变背景色 */
        .layui-table tbody tr:nth-child(even):hover {
            background-color: #ffff00; /* æ›´æ”¹ä¸ºä½ æƒ³è¦çš„颜色 */
            background-color: #ceedfa; /* æ›´æ”¹ä¸ºä½ æƒ³è¦çš„颜色 */
        }
    </style>
@@ -96,10 +96,10 @@
                    //, toolbar: '#toolbarDemo'
                    , height: 'full-50'
                    , cellMinWidth: 90
                    , page: true
                    , limit: 5
                    //, page: true
                    , limit: 10
                    , limits: [5, 10, 15, 20]
                    , totalRow: true
                    //, totalRow: true
                    , cols: [[
                        { field: '代码', title: '代码', width: 150, sort: true }
                        , { field: '名称', title: '名称', width: 150, sort: true }
@@ -107,10 +107,23 @@
                    , data: []
                    , done: function (res, curr, count) {
                        // è®¾ç½®è¡Œæ ·å¼
                        var style = 'background-color: #ffff00;'; // æŒ‡å®šçš„背景色
                        var style = 'background-color: #ceedfa;'; // æŒ‡å®šçš„背景色
                        // å‡è®¾æˆ‘们要设置第三行的背景色
                        var targetIndex = rowIndex; // è¡Œå·ç´¢å¼•,从0开始计数
                        $('tr[data-index=' + targetIndex + ']').attr('style', style);
                        //设置滚动条位置
                        if (option.data.length > 0) {
                            // è¡¨æ ¼æ¸²æŸ“完毕后的回调
                            var parentObject = document.getElementById('mainTable').nextElementSibling.childNodes[0].childNodes[1].childNodes[0].childNodes[0];
                            if (parentObject.childNodes.length > 0) {
                                var rowObject = parentObject.childNodes[0];
                                var rowHeight = rowObject.offsetHeight; // èŽ·å–è¡Œé«˜
                                var rowPosition = rowHeight * rowIndex;
                                $('.layui-table-body').scrollTop(rowPosition);
                            }
                        }
                    }
                };
            }