From 5de3b6fb03ea7538b05bc51ec5fc0191fc1aaba2 Mon Sep 17 00:00:00 2001
From: 王 垚 <1402714037@qq.com>
Date: 星期三, 02 十一月 2022 13:52:51 +0800
Subject: [PATCH] 代码上传

---
 WebSRM/layuiAdmin.std-v1.2.1/src/views/基础资料/隐藏列设置/Gy_GridView_Hide.html |   21 +++++++++++----------
 1 files changed, 11 insertions(+), 10 deletions(-)

diff --git "a/WebSRM/layuiAdmin.std-v1.2.1/src/views/\345\237\272\347\241\200\350\265\204\346\226\231/\351\232\220\350\227\217\345\210\227\350\256\276\347\275\256/Gy_GridView_Hide.html" "b/WebSRM/layuiAdmin.std-v1.2.1/src/views/\345\237\272\347\241\200\350\265\204\346\226\231/\351\232\220\350\227\217\345\210\227\350\256\276\347\275\256/Gy_GridView_Hide.html"
index 2985097..f58e068 100644
--- "a/WebSRM/layuiAdmin.std-v1.2.1/src/views/\345\237\272\347\241\200\350\265\204\346\226\231/\351\232\220\350\227\217\345\210\227\350\256\276\347\275\256/Gy_GridView_Hide.html"
+++ "b/WebSRM/layuiAdmin.std-v1.2.1/src/views/\345\237\272\347\241\200\350\265\204\346\226\231/\351\232\220\350\227\217\345\210\227\350\256\276\347\275\256/Gy_GridView_Hide.html"
@@ -204,7 +204,6 @@
             get_Display();
         }
 
-        //鏌ヨ
         function get_Display() {
             var ajaxLoad = layer.load();
             $.ajax({
@@ -214,10 +213,16 @@
                 success: function (data1) {
                     var colNames = [];//鐩稿鍗曟嵁浼犺繃鏉ョ殑鍒楀悕
                     var cols = [];//瑕佷紶杩涜〃鏍肩殑鏁版嵁
-                   
-                    colNames = colName.split(',');
+                    var dataCol = [];
 
                     if (data1.data.length != 0) {
+                        //鏁版嵁搴撴煡璇㈠嚭鐨勫垪鏁版嵁
+                        dataCol = data1.data[0].HGridString.split(',');
+                    }
+
+                    colNames = colName.split(',');
+
+                    if (data1.data.length != 0 && dataCol.length == colNames.length) {
                         //鍐荤粨鍒�
                         $("#HFixCols").val(data1.data[0].HFixCols);
                         //瀛椾綋澶у皬
@@ -225,14 +230,10 @@
                         //鍒楀
                         $("#HColumnWidth").val(data1.data[0].HColumnWidth);
 
-                        var dataCol = [];//鏁版嵁搴撴煡璇㈠嚭鐨勫垪鏁版嵁
-
-                        dataCol = data1.data[0].HGridString.split(',');
-
                         //琛ㄦ牸鐨勬暟鎹~鍏�
                         for (var i = 0; i < colNames.length; i++) {
                             var dataCols = dataCol[i].split('|');
-                            cols.push({ "ColumnName": colNames[i], "IsHide": dataCols[1] == 1 ? true : false, "Alignment": dataCols[2], "ColumnWidth": dataCols[3]})
+                            cols.push({ "ColumnName": colNames[i], "IsHide": dataCols[1] == 1 ? true : false, "Alignment": dataCols[2], "ColumnWidth": dataCols[3] })
                         }
                         option.data = cols;
                         table.render(option);
@@ -251,7 +252,7 @@
                     } else {
                         //榛樿涓嶉�変腑 鏄剧ず瀛椾綋灞呭乏  琛ㄦ牸鐨勬暟鎹~鍏�
                         for (var i = 0; i < colNames.length; i++) {
-                            cols.push({ "ColumnName": colNames[i], "IsHide": false, "Alignment": "L", "ColumnWidth":120})
+                            cols.push({ "ColumnName": colNames[i], "IsHide": false, "Alignment": "L", "ColumnWidth": 120 })
                         }
                         option.data = cols;
                         table.render(option);
@@ -284,7 +285,7 @@
                     { field: 'ColumnName', title: '鍒楀悕', width: 100 }
                     , { file: 'IsHide', title: '鏄惁闅愯棌', width: 100, templet: '#IsHide' }
                     , { field: 'Alignment', title: '瀵归綈鏂瑰紡', width: 100, templet: '#Alignment' }
-                    , { field: 'ColumnWidth', title: '鍒楀', width: 100, edit: 'text'}
+                    , { field: 'ColumnWidth', title: '鍒楀', width: 100, edit: 'text' }
                 ]]
             };
         }

--
Gitblit v1.9.1