1
zrg
2025-05-22 d11769f5dd4fe359f6856e9038ab6ec13d5c135d
WebTM/views/ϵͳ¹ÜÀí/ϵͳ²ÎÊý¹ÜÀí/Xt_SystemParameterList.html
@@ -1,7 +1,8 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>系统参数列表</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
@@ -18,13 +19,15 @@
    <script src="../../../layuiadmin/HideButton.js"></script>
    <script src="../../../layuiadmin/soulTable.slim.js"></script>
    <script src="../../../layuiadmin/PageTitle.js"></script>
    <script src="../../../layuiadmin/HideButton_new.js"></script>
    <style type="text/css">
        input.layui-input.layui-unselect {
            padding-right: 0;
        }
    </style>
</head>
<body>
    <div class="layui-fluid">
        <div class="layui-col-md12">
@@ -50,17 +53,10 @@
                                        <input type="text" class="layui-input" name="HKeyCode" id="HKeyCode">
                                    </div>
                                </div>
                                <div class="layui-inline">
                                    <label class="layui-form-label">描述</label>
                                    <div class="layui-input-block">
                                        <input type="text" class="layui-input" name="HDes" id="HDes">
                                    </div>
                                </div>
                                <div class="layui-inline">
                                    <label class="layui-form-label">参数名称</label>
                                    <div class="layui-input-block">
                                        <input type="text" class="layui-input" name="HName" id="HName">
                                    </div>
                                <!--显示当前过滤方案-->
                                <div class="layui-inline" style="margin-left:5px;">
                                    <div style="text-align:center;font-size:15px;font-weight:bold;color:#fc9393"
                                        id="HFilterScheme_Now"></div>
                                </div>
                                <div class="layui-inline">
@@ -72,29 +68,49 @@
                                    </div>
                                </div>
                                <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnSearch" id="btnSearch">
                                <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit=""
                                    lay-filter="btnSearch" id="btnSearch">
                                    <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
                                </button>
                                <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnReSearch" id="btnReSearch" style="padding:0 5px">重置</button>
                                <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit=""
                                    lay-filter="btnReSearch" id="btnReSearch" style="padding:0 5px">重置</button>
                                <div class="layui-colla-content" style="padding: 0px; margin-left: 6%;">
                                    <div class="layui-inline">
                                        <label class="layui-form-label">描述</label>
                                        <div class="layui-input-block">
                                            <input type="text" class="layui-input" name="HDes" id="HDes">
                                        </div>
                                    </div>
                                    <div class="layui-inline">
                                        <label class="layui-form-label">参数名称</label>
                                        <div class="layui-input-block">
                                            <input type="text" class="layui-input" name="HName" id="HName">
                                        </div>
                                    </div>
                                    <div class="layui-row" style="margin-top:5px">
                                        <div class="layui-inline">
                                            <label class="layui-form-label">过滤</label>
                                            <div class="layui-input-block">
                                                <select name="ColName" id="ColName" class="ForFilteringSchemes" lay-filter="ColName" style="width:190px;">
                                                <select name="ColName" id="ColName" class="ForFilteringSchemes"
                                                    lay-filter="ColName" style="width:190px;">
                                                </select>
                                            </div>
                                        </div>
                                        <div class="layui-inline">
                                            <select name="Comparator" id="Comparator" lay-filter="Comparator" style="width:190px;">
                                            <select name="Comparator" id="Comparator" lay-filter="Comparator"
                                                style="width:190px;">
                                                <option value="0" selected="selected"></option>
                                                <option value="=">=</option>
                                                <option value=">=">>=</option>
                                                <option value=">">></option>
                                                <option value="<="><=</option>
                                                <option value="<"><</option>
                                                <option value="<>"><></option>
                                                <option value="<=">
                                                    <=< /option>
                                                <option value="<">
                                                    << /option>
                                                <option value="<>">
                                                    <>
                                                </option>
                                                <option value="7">包含</option>
                                                <option value="8">左包含</option>
                                                <option value="9">右包含</option>
@@ -102,26 +118,33 @@
                                            </select>
                                        </div>
                                        <div class="layui-inline">
                                            <input type="text" class="layui-input ForFilteringSchemes" value="" name="ColContent" id="ColContent">
                                            <input type="text" class="layui-input ForFilteringSchemes" value=""
                                                name="ColContent" id="ColContent">
                                        </div>
                                    </div>
                                    <div class="layui-row" style="margin-top: 10px; margin-bottom: 10px ">
                                        <div class="layui-inline">
                                            <label class="layui-form-label">过滤</label>
                                            <div class="layui-input-block">
                                                <select name="ColName1" id="ColName1" class="ForFilteringSchemes" lay-filter="ColName1" style="width:190px;">
                                                <select name="ColName1" id="ColName1" class="ForFilteringSchemes"
                                                    lay-filter="ColName1" style="width:190px;">
                                                </select>
                                            </div>
                                        </div>
                                        <div class="layui-inline">
                                            <select name="Comparator1" id="Comparator1" lay-filter="Comparator1" class="ForFilteringSchemes" style="width:190px;">
                                            <select name="Comparator1" id="Comparator1" lay-filter="Comparator1"
                                                class="ForFilteringSchemes" style="width:190px;">
                                                <option value="0" selected="selected"></option>
                                                <option value="=">=</option>
                                                <option value=">=">>=</option>
                                                <option value=">">></option>
                                                <option value="<="><=</option>
                                                <option value="<"><</option>
                                                <option value="<>"><></option>
                                                <option value="<=">
                                                    <=< /option>
                                                <option value="<">
                                                    << /option>
                                                <option value="<>">
                                                    <>
                                                </option>
                                                <option value="7">包含</option>
                                                <option value="8">左包含</option>
                                                <option value="9">右包含</option>
@@ -129,26 +152,33 @@
                                            </select>
                                        </div>
                                        <div class="layui-inline">
                                            <input type="text" class="layui-input ForFilteringSchemes" value="" name="ColContent1" id="ColContent1">
                                            <input type="text" class="layui-input ForFilteringSchemes" value=""
                                                name="ColContent1" id="ColContent1">
                                        </div>
                                    </div>
                                    <div class="layui-row" style="margin-top: 10px; margin-bottom: 10px ">
                                        <div class="layui-inline">
                                            <label class="layui-form-label">过滤</label>
                                            <div class="layui-input-block">
                                                <select name="ColName2" id="ColName2" class="ForFilteringSchemes" lay-filter="ColName2" style="width:190px;">
                                                <select name="ColName2" id="ColName2" class="ForFilteringSchemes"
                                                    lay-filter="ColName2" style="width:190px;">
                                                </select>
                                            </div>
                                        </div>
                                        <div class="layui-inline">
                                            <select name="Comparator2" id="Comparator2" lay-filter="Comparator2" class="ForFilteringSchemes" style="width:190px;">
                                            <select name="Comparator2" id="Comparator2" lay-filter="Comparator2"
                                                class="ForFilteringSchemes" style="width:190px;">
                                                <option value="0" selected="selected"></option>
                                                <option value="=">=</option>
                                                <option value=">=">>=</option>
                                                <option value=">">></option>
                                                <option value="<="><=</option>
                                                <option value="<"><</option>
                                                <option value="<>"><></option>
                                                <option value="<=">
                                                    <=< /option>
                                                <option value="<">
                                                    << /option>
                                                <option value="<>">
                                                    <>
                                                </option>
                                                <option value="7">包含</option>
                                                <option value="8">左包含</option>
                                                <option value="9">右包含</option>
@@ -156,7 +186,8 @@
                                            </select>
                                        </div>
                                        <div class="layui-inline">
                                            <input type="text" class="layui-input ForFilteringSchemes" value="" name="ColContent2" id="ColContent2">
                                            <input type="text" class="layui-input ForFilteringSchemes" value=""
                                                name="ColContent2" id="ColContent2">
                                        </div>
                                    </div>
                                </div>
@@ -164,15 +195,17 @@
                        </div>
                        <table class="" id="mainTable" lay-filter="mainTable"></table>
                        <script type="text/html" id="toolbarDemo">
                            <div class="layui-btn-container">
                            <div class="layui-btn-container" id="Xt_SystemParameterList_ButtonGroup">
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-Add" id="btn-Add"><i class="layui-icon layui-icon-file-b"></i>新增</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-Edit" id="btn-Edit"><i class="layui-icon layui-icon-form"></i>修改</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-Delete" id="btn-Delete"><i class="layui-icon layui-icon-subtraction"></i>删除</button>
                                <!--<button type="button" class="layui-btn layui-btn-sm" lay-event="btn-reload"><i class="layui-icon layui-icon-refresh"></i>刷新</button>-->
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="set_SaveScheme" id="set_SaveScheme"><i class="layui-icon layui-icon-template"></i>保存方案</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="set_ReadScheme" id="set_ReadScheme"><i class="layui-icon layui-icon-set"></i>读取方案</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="get_export" id="get_export"><i class="layui-icon layui-icon-export"></i>导出</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="get_Exit" id="Exit"><i class="layui-icon layui-icon-logout"></i>退出</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="set_HideColumn"><i class="layui-icon layui-icon-form"></i>列设置</button>
                                <button type="button" class="layui-btn layui-btn-sm" lay-event="set_HideButton" id="HideButton"><i class="layui-icon layui-icon-form"></i>按钮设置</button>
                            </div>
                        </script>
                    </form>
@@ -206,13 +239,16 @@
            var HClassTag = "ForFilteringSchemes";
            //模块名称(中文版) æ¯ä¸ªæ¨¡å—页面都需要修改
            window.HModuleName = "系统参数";
            HModName = 'Xt_SystemParameterList'
            //是否已经选择了过滤方案(全局变量)
            window.HDefaultFilter = "";
            //选择的过滤方案内码(全局变量)
            window.HInterID_Choose = 0;
            var HModName = "Xt_SystemParameterList";
            var HBillType = "Xt_SystemParameterList";
            var set_HideButton_ID = 'Xt_SystemParameterList_ButtonGroup'
            //不需要显示的字段 å¯æ‰©å±•
            var titleData = ["HItemID", "Hitemid","HInterID"];
            var titleData = ["HItemID", "Hitemid", "HInterID"];
            var ins;
            //初始化表格
            set_InitGrid();
@@ -270,11 +306,22 @@
            })
            //#endregion
            //#region è¡¨æ ¼å†…事件绑定
            table.on('tool(mainTable)', function (obj) {
                var data = obj.data;
                switch (obj.event) {
                    case 'onKeyCodeClickHandler': onKeyCodeClickHandler(data); break;
                }
            })
            //#endregion
            //#region å¤´å·¥å…·æ äº‹ä»¶
            table.on('toolbar(mainTable)', function (obj) {
                switch (obj.event) {
                    //列设置
                    case 'set_HideColumn': get_HideColumn();
                        break;
                    case 'set_HideButton': get_HideButton(set_HideButton_ID, HBillType, HModName, sessionStorage["HUserName"]);
                        break;
                    //保存方案
                    case 'set_SaveScheme': set_SaveScheme();
@@ -297,8 +344,13 @@
                    case 'btn-Edit':
                        set_ShowBill();
                        break;
                    case 'btn-Delete':
                        set_DeleteBill();
                        break;
                };
            });
            //获取组织
            function Organ() {
@@ -384,8 +436,19 @@
                                            col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, templet: "<div>{{d." + data[i].name + " ==null ?'':layui.util.toDateString(d." + data[i].name + ", 'yyyy-MM-dd')}}</div>", width: 200 });
                                            break;
                                        default:
                                            col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, width: 200 });
                                            if (data[i].name === '关键码') {
                                                col.push({
                                                    field: data[i].id, title: data[i].name, align: 'center', sort: true, width: 200,
                                                    templet: function (d) {
                                                        return '<span style="color: blue;">' + d.关键码 + '</span>'
                                                    }, style: 'cursor: pointer;', event: 'onKeyCodeClickHandler'
                                                });
                                            } else {
                                                col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, width: 200 });
                                            }
                                    }
                                }
                            }
@@ -407,8 +470,12 @@
                            DisPlay_HideColumn();
                            layer.close(ajaxLoad);
                            if ($("#Comparator").val() == 0 && $("#ColContent").val() == "") {
                            // if ($("#Comparator").val() == 0 && $("#ColContent").val() == "") {
                            //     ColFilter();
                            // }
                            if ($("#ColName option").length < 1) {
                                ColFilter();
                                get_DefaultModule();//加载方案
                            }
                            //layer.alert("查询成功", { icon: 1 });
                        } else {
@@ -460,7 +527,7 @@
                            com = "" + Comparator + "'" + ColContent + "'";
                            break;
                    }
                    sWhere += " and " + ColName + " " + com;
                    // sWhere += " and " + ColName + " " + com;
                }
                if (ColName1 != 0 && Comparator1 != 0) {
                    var com1 = "";
@@ -481,7 +548,7 @@
                            com1 = "" + Comparator1 + "'" + ColContent1 + "'";
                            break;
                    }
                    sWhere += " and " + ColName1 + " " + com1;
                    // sWhere += " and " + ColName1 + " " + com1;
                }
                if (ColName2 != 0 && Comparator2 != 0) {
                    var com2 = "";
@@ -502,7 +569,7 @@
                            com2 = "" + Comparator2 + "'" + ColContent2 + "'";
                            break;
                    }
                    sWhere += " and " + ColName2 + " " + com2;
                    // sWhere += " and " + ColName2 + " " + com2;
                }
                if (HName) {
                    sWhere += " and å‚数名称 like '%" + HName + "%'";
@@ -554,7 +621,7 @@
                var checkStatus = table.checkStatus('mainTable')
                    , data = checkStatus.data;
                if (checkStatus.data.length === 1) {
                    var hID = data[0].HInterID;
                    var hID = data[0].Hitemid;
                    //if (AllowLoadData(sSubStr) != false) {//非空验证
                    layer.open({
                        type: 2
@@ -576,6 +643,47 @@
                } else {
                    layer.msg('请选择一行数据编辑!');
                }
            }
            //#endregion
            //#region åˆ é™¤æŒ‰é’®
            function set_DeleteBill() {
                var checkStatus = table.checkStatus('mainTable')
                    , data = checkStatus.data;
                let roleCheck = new RegExp(/admin/i)
                if (roleCheck.test(sessionStorage['HUserName']) !== true) {
                    layer.alert("您没有权限删除数据!!!", { icon: 5 });
                    return;
                }
                debugger;
                if (checkStatus.data.length === 1) {
                    layer.confirm("确认要删除吗,删除后不能恢复", { title: "删除确认" }, function (index) {
                        $.ajax({
                            url: GetWEBURL() + '/Xt_SystemParameter/Xt_SystemParameterDelete',
                            type: "GET",
                            //async: true,
                            data: { "HInterID": checkStatus.data[0].Hitemid, "user": sessionStorage["HUserName"] },
                            success: function (result) {
                                if (result.code == 1) {
                                    layer.msg(result.Message, { time: 1 * 1000, icon: 1 }, function () {
                                        // å¾—到frame索引
                                        var index = layer.getFrameIndex(window.name);
                                        //关闭当前frame
                                        layer.close(index);
                                        //修改为功后刷新界面
                                        window.location.reload();
                                    });
                                } else {
                                    layer.alert(result.code + result.Message, { icon: 5 });
                                }
                            }, error: function () {
                                layer.alert("接口请求失败!", { icon: 5 });
                            }
                        })
                    })
                } else {
                    layer.msg('请选择一行数据删除!');
                }
            }
            //#endregion
@@ -861,6 +969,21 @@
                    , title: '过滤方案列表'
                    , shift: 0//弹出动画
                    , content: '../../系统管理/过滤方案设置/Xt_FastICSchemeList.html?HType=Select&HFilterIdLists=' + HFilterIdLists + '&HValue=' + HValue + '&HElement_type=' + HElement_type + '&HModuleName=' + HModuleName
                    , btn: ['确认', '取消']
                    , btn1: function (index, layero, that) {
                        let iframeWindow = window['layui-layer-iframe' + index]  //获取弹框页面
                        let checkStatus = iframeWindow.layui.table.checkStatus('mainTable');//获取table的elem:"#test"
                        if (checkStatus.data.length !== 1) {
                            return layer.msg('请选择一条数据');
                        }
                        // debugger;
                        HFilterScheme(checkStatus.data)
                        layer.close(layer.index);
                    }
                    , btn2: function (index, layero, that) {
                        HIsClose_Manual = true;
                    }
                    , cancel: function () {
                        // å³ä¸Šè§’关闭事件的逻辑
                        HIsClose_Manual = true;
@@ -902,10 +1025,115 @@
            //    , trigger: 'click'
            //    , format:'yyyy-MM-dd HH:mm'
            //});
            function onKeyCodeClickHandler(data) {
                var Hitemid = data.Hitemid;
                //if (AllowLoadData(sSubStr) != false) {//非空验证
                layer.open({
                    type: 2
                    , area: ['100%', '100%']
                    , title: '编辑系统参数查询'
                    , shade: 0.6 //遮罩透明度
                    , maxmin: true //允许全屏最小化
                    , anim: 0 //0-6的动画形式,-1不开启
                    , content: './Xt_SystemParameter_Edit.html?hID=' + Hitemid
                    , resize: false
                    , cancel: function () {
                        //$(".layui-btn").removeClass("layui-btn-disabled");
                    }
                    , end: function () {
                        //刷新页面,
                        get_FastQuery(table, option);
                    }
                })
            }
            //获取当前用户的默认过滤方案
            function get_DefaultModule() {
                $.ajax({
                    url: GetWEBURL() + '/Xt_FastICScheme/Chooselist',
                    type: "GET",
                    data: { "user": sessionStorage["Czybm"], "HModuleName": HModuleName, "HInterID": 0, "Type": "Default" },
                    success: function (data1) {
                        if (data1.count == 1) {
                            //当前用户设置有默认的过滤方案
                            var data = data1.data;
                            //当前选择的过滤方案
                            HInterID_Choose = data[0].hmainid;
                            //过滤方案内码
                            HInterID = data[0].hmainid
                            //过滤方案名称
                            HDefaultFilter = data[0].方案名称
                            //过滤方案的备注(方案信息描述)
                            var HRemark = data[0].备注
                            //显示出当前的默认过滤方案
                            document.getElementById("HFilterScheme_Now").style.display = "block";
                            document.getElementById('HFilterScheme_Now').innerHTML = "当前过滤方案:" + HDefaultFilter + '<span style="font-size: 15px; font-weight: bold; color:#7b90fb">  ' + "(" + HRemark + ")" + '</span>';
                            //把过滤条件值回写到页面上
                            for (let i = 0; i < data.length; i++) {
                                $("#" + data[i].过滤字段ID).val(data[i].过滤值);
                                if (data[i].过滤标签类型 == 'SELECT') {
                                    $("#" + data[i].过滤字段ID).find("option[value='" + data[i].过滤值 + "']").attr("selected", true);
                                }
                            }
                            //查询
                            get_FastQuery();
                            form.render("select");
                        } else {
                            //当前用户没有设置默认的过滤方案
                            //隐藏显示过滤方案的标签信息
                            document.getElementById("HFilterScheme_Now").style.display = "none";
                            //执行查询方法
                            form.render("select");
                        }
                    }, error: function () {
                        layer.alert("接口请求失败!", { icon: 5 });
                    }
                });
            }
            //以上是layui模块
        });
        //#region ã€è¿‡æ»¤æ–¹æ¡ˆè¿”回数据】
        function HFilterScheme(obj)  //返回过滤方案
        {
            console.log(obj)
            var HInterID = obj[0].hmainid;
            HInterID_Choose = obj[0].hmainid;
            $.ajax({
                url: GetWEBURL() + '/Xt_FastICScheme/Chooselist',
                type: "GET",
                data: { "user": sessionStorage["Czybm"], "HModuleName": HModuleName, "HInterID": HInterID, "Type": "Select" },
                success: function (data1) {
                    if (data1.count == 1) {
                        var data = data1.data;
                        //赋值过滤方案名称
                        HDefaultFilter = data[0].方案名称
                        var HRemark = data[0].备注
                        //显示当前的过滤方案
                        document.getElementById("HFilterScheme_Now").style.display = "block";
                        document.getElementById('HFilterScheme_Now').innerHTML = "当前过滤方案:" + HDefaultFilter + '<span style="font-size: 15px; font-weight: bold; color:#7b90fb">  ' + "(" + HRemark + ")" + '</span>';
                        HInterID = data[0].hmainid
                        //根据选择的过滤方案回填数据到列表过滤条件
                        for (let i = 0; i < data.length; i++) {
                            $("#" + data[i].过滤字段ID).val(data[i].过滤值);
                            if (data[i].过滤标签类型 == 'SELECT') {
                                $("#" + data[i].过滤字段ID).find("option[value='" + data[i].过滤值 + "']").attr("selected", true);
                            }
                        }
                    } else {
                        layer.close(ajaxLoad);
                        layer.alert(data1.code + data1.Message, { icon: 5 });
                    }
                }, error: function () {
                    layer.close(ajaxLoad);
                    layer.alert("接口请求失败!", { icon: 5 });
                }
            });
        }
        //#endregion
    </script>
    <!--/Xt_SystemParameter/list-->
</body>
</html>
</html>