deviceSettingsInfo.esp 5.85 KB
<!DOCTYPE html>
<html>

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title></title>
    <link href="../../css/frame.css" rel="stylesheet" />
    <link href="../../scripts/easyui/themes/default/easyui.css" rel="stylesheet" />
    <link href="../../scripts/easyui/themes/icon.css" rel="stylesheet" />
    <style type="text/css">
        #deviceInfoForm {
            padding: 8px;
        }

        .tdTitle {
            width: 80px;
        }

        .settingBtn {
            margin-left: 10px;
        }
    </style>
</head>

<body>
    <form id="deviceInfoForm">
        <table class="settingsContainer">
            <tr>
                <td class="tdTitle">
                    <label>设备编号</label>
                </td>
                <td class="tdContent">
                    <input name="45" id="45" class="settingParameter " type="text" />
                </td>
                <td class="tdTitle">
                    <label>设备名称</label>
                </td>
                <td class="tdContent">
                    <input id="46" name="46" class="settingParameter " type="text" />
                </td>
            </tr>
            <tr>
                <td class="tdTitle">
                    <label>地点编号</label>
                </td>
                <td class="tdContent">
                    <input id="47" name="47" class="settingParameter " type="text" />
                </td>
                <td class="tdTitle">
                    <label>地点名称</label>
                </td>
                <td class="tdContent">
                    <input id="48" name="48" class="settingParameter " type="text" />
                </td>
            </tr>
            <tr>
                <td class="tdTitle">
                    <label>方向编号</label>
                </td>
                <td class="tdContent">
                    <input id="49" name="49" class="settingParameter " type="text" />
                </td>
                <td class="tdTitle">
                    <label>方向名称</label>
                </td>
                <td class="tdContent">
                    <input id="50" name="50" class="settingParameter " type="text" />
                </td>
            </tr>
            <tr>
                <td class="tdTitle">
                    <label>扩展信息1</label>
                </td>
                <td class="tdContent">
                    <input id="51" name="51" class="settingParameter " type="text" />
                </td>
                <td class="tdTitle">
                    <label>扩展信息2</label>
                </td>
                <td class="tdContent">
                    <input id="52" name="52" class="settingParameter " type="text" />
                </td>
            </tr>
            <tr>
                <td class="tdTitle">
                    <label>扩展信息3</label>
                </td>
                <td class="tdContent">
                    <input id="53" name="53" class="settingParameter " type="text" />
                </td>
                <td class="tdTitle">
                    <label>扩展信息4</label>
                </td>
                <td class="tdContent">
                    <input id="54" name="54" class="settingParameter " type="text" />
                </td>
            </tr>
            <tr>
                <td class="tdTitle">
                    <label>扩展信息5</label>
                </td>
                <td class="tdContent">
                    <input id="55" name="55" class="settingParameter " type="text" />
                </td>
                <td class="tdTitle">
                    <label>扩展信息6</label>
                </td>
                <td class="tdContent">
                    <input id="56" name="56" class="settingParameter " type="text" />
                </td>
            </tr>
            <tr>
                <td colspan="4" style="padding-top:6px;">
                    <a href="#" class="settingBtn" id="btnSave">保存</a>
                    <% inputSecurityToken(); %>
                </td>
            </tr>
        </table>
    </form>
    <script src="../../scripts/easyui/jquery.min.js"></script>
    <script src="../../scripts/easyui/jquery.easyui.min.js"></script>
    <script src="../../scripts/easyui/locale/easyui-lang-zh_CN.js"></script>
    <script src="../../scripts/utilities.js"></script>
    <script src="../../scripts/jquery.validate.min.js"></script>
    <script src="../../scripts/jquery.validate.extend.js"></script>
    <script type="text/javascript">
        //参数适配器
        var parameterAdaptor = new ParameterAdaptor();

        $().ready(function () {
            loadDeviceInfo();
            $("#btnSave").click(saveParametersToServer);

            var rules = {};
            for (var i = 45; i <= 56; i++) {
            	if (i == 47) {
            		rules[i] = {
                    maxByteLength: 30
                	};
            	} else {
                	rules[i] = {
                    	maxByteLength: 60
                	};
                }
            }
            $("#deviceInfoForm").validate({
                rules: rules
            });
        });

        //加载设备信息
        function loadDeviceInfo() {
            var RefererInfo = "deviceSettingsInfo";
            parameterAdaptor.getParameters(RefererInfo, onLoadSuccess);
        }

        //加载表单数据
        function onLoadSuccess(data) {
            $("#deviceInfoForm").form("load", data.feedback);
        }

        //保存参数到服务器
        function saveParametersToServer() {
            var formObj = $("#deviceInfoForm");
            if (!formObj.valid()) {
                $.messager.alert("提示", "参数验证有误,请修改后再提交!", "error");
                return;
            }
            parameterAdaptor.saveParameters(formObj);
        }
    </script>
</body>

</html>