wtt
2025-10-31 2c4e339508f78a215518a8a12af34ca0b1564d44
WebTM/views/»ù´¡×ÊÁÏ/Òþ²ØÁÐÉèÖÃ/Gy_GridView_Hide_New.html
@@ -12,16 +12,28 @@
    <script src="../../../layuiadmin/Scripts/webConfig.js"></script>
    <script src="../../../layuiadmin/PubCustom.js"></script>
    <script src="../../../layuiadmin/soulTable.slim.js"></script>
    <!-- <script src="../../../layuiadmin/zy_DragObserver.js"></script> -->
    <style>
        /* é˜²æ­¢ä¸‹æ‹‰æ¡†çš„下拉列表被隐藏---必须设置--- */
        .layui-table-cell {
        /*.layui-table-cell {
            overflow: visible !important;
        }
        }*/
        /* ä½¿å¾—下拉框与单元格刚好合适 */
        td .layui-form-select {
        /*td .layui-form-select {
            margin-top: -10px;
            margin-left: -15px;
            margin-right: -15px;
        }*/
        /* é˜²æ­¢ä¸‹æ‹‰æ¡†çš„下拉列表被隐藏---必须设置--- */
        td:has(select) .layui-table-cell {
            overflow: visible !important;
            padding: 0;
            box-sizing: border-box;
        }
        /* ä½¿å¾—下拉框与单元格刚好合适 */
        td:has(select) .layui-form-select {
            margin-top: -10px;
        }
    </style>
</head>
@@ -366,6 +378,8 @@
                        }
                        form.render('checkbox');
                        form.render('select');
                        // registerDragObserver()
                        layer.close(ajaxLoad);
                    } else {
                        var colTitleNames = colTitleName.split(',');
@@ -416,15 +430,16 @@
                    done: function (obj) {
                        // å®Œæˆæ—¶ï¼ˆæ¾å¼€æ—¶ï¼‰è§¦å‘
                        // å¦‚果拖动前和拖动后无变化,则不会触发此方法
                        console.log(obj.row) // å½“前行数据
                        console.log(obj.cache) // æ”¹åŠ¨åŽå…¨è¡¨æ•°æ®
                        console.log(obj.oldIndex) // åŽŸæ¥çš„æ•°æ®ç´¢å¼•
                        console.log(obj.newIndex) // æ”¹åŠ¨åŽæ•°æ®ç´¢å¼•
                        //console.log(obj.row) // å½“前行数据
                        //console.log(obj.cache) // æ”¹åŠ¨åŽå…¨è¡¨æ•°æ®
                        //console.log(obj.oldIndex) // åŽŸæ¥çš„æ•°æ®ç´¢å¼•
                        //console.log(obj.newIndex) // æ”¹åŠ¨åŽæ•°æ®ç´¢å¼•
                        console.log(table.cache["mainTable"]) // æ”¹åŠ¨åŽæ•°æ®ç´¢å¼•
                        //console.log(table.cache["mainTable"]) // æ”¹åŠ¨åŽæ•°æ®ç´¢å¼•
                    }
                }
                , done: function () {
                , done: function (res, curr, count) {
                    soulTable.render(this)
                }
            };
@@ -519,10 +534,42 @@
            })
        }
        //// æ³¨å†Œæ‹–拽观察者,监听表格拖拽变化
        // function registerDragObserver() {
        //     // å¦‚果不支持,则什么都不执行
        //     if (typeof window.MutationObserver === 'undefined'
        //         && typeof window.WebKitMutationObserver === 'undefined') {
        //         console.warn('observer not supported')
        //         return
        //     }
        //     let targetEl = $(".layui-table-box")[0];
        //     let config = {
        //         attributes: true,
        //         attributesOldValue: true,
        //         attributeFilter: ['class'],
        //         childList: false,
        //         subtree: false,
        //         characterData: false,
        //         characterDataOldValue: false
        //     };
        //     let observer = new MutationObserver(mutations => {
        //         mutations.forEach(function (mutation) {
        //             if (mutation.attributeName === 'class') {
        //                 // ç›‘听class中内容的变化
        //                 if ($(targetEl).hasClass('noselect')) {
        //                     document.documentElement.style.userSelect = 'none';
        //                     document.documentElement.style.webkitUserSelect = 'none';
        //                 } else {
        //                     document.documentElement.style.userSelect = '';
        //                     document.documentElement.style.webkitUserSelect = '';
        //                 }
        //             }
        //         })
        //     })
        //     observer.observe(targetEl, config);
        // }
        //#endregion
    });
</script>