1
yxj
2025-05-24 9f962a87d620bd8b32211634c8d0f243757f7fdc
WebTM/layuiadmin/SetColumn.js
@@ -6,13 +6,13 @@
    }
    colName = encodeURI(colName.substring(0, colName.length - 1));//对 URI 进行编码
    var contentUrl = "";
    var contentUrl = "";
    var urlStr = window.document.location.pathname;//获取文件路径
    var urlLen = urlStr.split('/');
    for (var i = 0; i < urlLen.length - 4; i++) {
        contentUrl += "../";
    }
    contentUrl += '基础资料/隐藏列设置/Gy_GridView_Hide_New.html?HModName=' + HModName + '&colName=' + colName;
    contentUrl += '基础资料/隐藏列设置/Gy_GridView_Hide_New.html?HModName=' + HModName + '&colName=' + colName;
    layer.open({
        type: 2
        , skin: "layui-layer-rim" //加上边框
@@ -51,7 +51,7 @@
        contentUrl += "../";
    }
    contentUrl += '基础资料/隐藏列设置/Gy_GridView_Hide_New.html?HModName=' + HModName + '&colName=' + colName;
    layer.open({
        type: 2
        , skin: "layui-layer-rim" //加上边框
@@ -73,7 +73,7 @@
//#endregion
//#region 设置表格页大小初始
function DisPlay_HideColumn_GetPageSize(HModName, user,optionPage) {
function DisPlay_HideColumn_GetPageSize(HModName, user, optionPage) {
    $.ajax({
        url: GetWEBURL() + '/Xt_grdAlignment_WMES/grdAlignmentWMESList',
        type: "GET",
@@ -85,7 +85,7 @@
                    optionPage.limit = data1.data[0].HPageSize;
                    optionPage.limits.push(data1.data[0].HPageSize);
                }
            } else {
            }
        }, error: function () {
@@ -105,7 +105,7 @@
        success: function (data1) {
            if (data1.data.length != 0) {
                var dataCol = [];//数据库查询出的列数据
            /*    var titleData = [];*/
                /*    var titleData = [];*/
                var newCols = [[]];//对应数据库列顺序col
                newCols[0].push(option.cols[0][0]);//放入第一个checkbox
                dataCol = data1.data[0].HGridString.split(',');
@@ -203,7 +203,7 @@
//#region 隐藏列设置编辑页面
function get_HideColumnEdit(HModName,user,option,table) {
function get_HideColumnEdit(HModName, user, option, table) {
    var colName = "";
    for (var i = 1; i < option.cols[0].length - 1; i++) {
        colName += option.cols[0][i]["field"] + ",";
@@ -227,9 +227,43 @@
        , btn: ["确定", "取消"]
        , btn1: function (index, laero) {
            //刷新表格数据
            DisPlay_HideColumnEdit(HModName, user, option,table);
            DisPlay_HideColumnEdit(HModName, user, option, table);
            //更新表格缓存的数据
            layer.close(index);//关闭弹窗
        }
    })
}
//#endregion
//#region 隐藏列设置编辑页面
function get_HideColumnEditAfterReload(HModName, user, option, table, callback) {
    var colName = "";
    for (var i = 1; i < option.cols[0].length - 1; i++) {
        colName += option.cols[0][i]["field"] + ",";
    }
    var colTitleName = "";
    for (var i = 1; i < option.cols[0].length - 1; i++) {
        colTitleName += option.cols[0][i]["title"] + ",";
    }
    colName = encodeURI(colName.substring(0, colName.length - 1));//对 URI 进行编码
    colTitleName = encodeURI(colTitleName.substring(0, colTitleName.length - 1));
    /*urlStr.replace(/%/g, '%25');*/
    layer.open({
        type: 2
        , skin: "layui-layer-rim" //加上边框
        , title: "隐藏列设置"  //标题
        , closeBtn: 1  //窗体右上角关闭 的 样式
        , shift: 2 //弹出动画
        , area: ["50%", "90%"] //窗体大小
        , maxmin: true //设置最大最小按钮是否显示
        , content: ['../../基础资料/隐藏列设置/Gy_GridView_Hide_New.html?HModName=' + HModName + '&colName=' + colName + '&colTitleName = ' + colTitleName, "yes"]
        , btn: ["确定", "取消"]
        , btn1: function (index, laero) {
            //刷新表格数据
            DisPlay_HideColumnEdit(HModName, user, option, table);
            //更新表格缓存的数据
            layer.close(index);//关闭弹窗
            callback.call()
        }
    })
}
@@ -301,7 +335,7 @@
                    }
                    //遍历循环后判断对应列数是否一致
                    if (dataCol.length == newCols[0].length - 1) {
                        newCols[0].push(option.cols[0][dataCol.length+1])//放入最后的操作列
                        newCols[0].push(option.cols[0][dataCol.length + 1])//放入最后的操作列
                        option.cols = newCols;
                        //取消冻结列
                        for (var i = 1; i < option.cols[0].length - 1; i++) {
@@ -322,7 +356,7 @@
                            }
                        }
                        //设置列排序
                        for (var i = 1; i < option.cols[0].length-1; i++) {
                        for (var i = 1; i < option.cols[0].length - 1; i++) {
                            if (data1.data[0].HSortFlag == "是") {
                                option.cols[0][i]["sort"] = true;
                            }
@@ -389,7 +423,7 @@
            colName += option.cols[0][i]["field"] + ",";
            colTitleName += option.cols[0][i]["title"] + ",";
        }
    }
    colName = encodeURI(colName.substring(0, colName.length - 1));//对 URI 进行编码