view_39df51a513b14995232abf8eb845cd9a.c 7.33 KB
/*
   Generated from client/settings/base/deviceSettingsInfo.esp
 */
#include "esp.h"

static void view_39df51a513b14995232abf8eb845cd9a(HttpConn *conn) {
  espRenderBlock(conn, "<!DOCTYPE html>\r\n\
<html>\r\n\
\r\n\
<head>\r\n\
    <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\r\n\
    <title></title>\r\n\
    <link href=\"../../css/frame.css\" rel=\"stylesheet\" />\r\n\
    <link href=\"../../scripts/easyui/themes/default/easyui.css\" rel=\"stylesheet\" />\r\n\
    <link href=\"../../scripts/easyui/themes/icon.css\" rel=\"stylesheet\" />\r\n\
    <style type=\"text/css\">\r\n\
        #deviceInfoForm {\r\n\
            padding: 8px;\r\n\
        }\r\n\
\r\n\
        .tdTitle {\r\n\
            width: 80px;\r\n\
        }\r\n\
\r\n\
        .settingBtn {\r\n\
            margin-left: 10px;\r\n\
        }\r\n\
    </style>\r\n\
</head>\r\n\
\r\n\
<body>\r\n\
    <form id=\"deviceInfoForm\">\r\n\
        <table class=\"settingsContainer\">\r\n\
            <tr>\r\n\
                <td class=\"tdTitle\">\r\n\
                    <label>设备编号</label>\r\n\
                </td>\r\n\
                <td class=\"tdContent\">\r\n\
                    <input name=\"45\" id=\"45\" class=\"settingParameter \" type=\"text\" />\r\n\
                </td>\r\n\
                <td class=\"tdTitle\">\r\n\
                    <label>设备名称</label>\r\n\
                </td>\r\n\
                <td class=\"tdContent\">\r\n\
                    <input id=\"46\" name=\"46\" class=\"settingParameter \" type=\"text\" />\r\n\
                </td>\r\n\
            </tr>\r\n\
            <tr>\r\n\
                <td class=\"tdTitle\">\r\n\
                    <label>地点编号</label>\r\n\
                </td>\r\n\
                <td class=\"tdContent\">\r\n\
                    <input id=\"47\" name=\"47\" class=\"settingParameter \" type=\"text\" />\r\n\
                </td>\r\n\
                <td class=\"tdTitle\">\r\n\
                    <label>地点名称</label>\r\n\
                </td>\r\n\
                <td class=\"tdContent\">\r\n\
                    <input id=\"48\" name=\"48\" class=\"settingParameter \" type=\"text\" />\r\n\
                </td>\r\n\
            </tr>\r\n\
            <tr>\r\n\
                <td class=\"tdTitle\">\r\n\
                    <label>方向编号</label>\r\n\
                </td>\r\n\
                <td class=\"tdContent\">\r\n\
                    <input id=\"49\" name=\"49\" class=\"settingParameter \" type=\"text\" />\r\n\
                </td>\r\n\
                <td class=\"tdTitle\">\r\n\
                    <label>方向名称</label>\r\n\
                </td>\r\n\
                <td class=\"tdContent\">\r\n\
                    <input id=\"50\" name=\"50\" class=\"settingParameter \" type=\"text\" />\r\n\
                </td>\r\n\
            </tr>\r\n\
            <tr>\r\n\
                <td class=\"tdTitle\">\r\n\
                    <label>扩展信息1</label>\r\n\
                </td>\r\n\
                <td class=\"tdContent\">\r\n\
                    <input id=\"51\" name=\"51\" class=\"settingParameter \" type=\"text\" />\r\n\
                </td>\r\n\
                <td class=\"tdTitle\">\r\n\
                    <label>扩展信息2</label>\r\n\
                </td>\r\n\
                <td class=\"tdContent\">\r\n\
                    <input id=\"52\" name=\"52\" class=\"settingParameter \" type=\"text\" />\r\n\
                </td>\r\n\
            </tr>\r\n\
            <tr>\r\n\
                <td class=\"tdTitle\">\r\n\
                    <label>扩展信息3</label>\r\n\
                </td>\r\n\
                <td class=\"tdContent\">\r\n\
                    <input id=\"53\" name=\"53\" class=\"settingParameter \" type=\"text\" />\r\n\
                </td>\r\n\
                <td class=\"tdTitle\">\r\n\
                    <label>扩展信息4</label>\r\n\
                </td>\r\n\
                <td class=\"tdContent\">\r\n\
                    <input id=\"54\" name=\"54\" class=\"settingParameter \" type=\"text\" />\r\n\
                </td>\r\n\
            </tr>\r\n\
            <tr>\r\n\
                <td class=\"tdTitle\">\r\n\
                    <label>扩展信息5</label>\r\n\
                </td>\r\n\
                <td class=\"tdContent\">\r\n\
                    <input id=\"55\" name=\"55\" class=\"settingParameter \" type=\"text\" />\r\n\
                </td>\r\n\
                <td class=\"tdTitle\">\r\n\
                    <label>扩展信息6</label>\r\n\
                </td>\r\n\
                <td class=\"tdContent\">\r\n\
                    <input id=\"56\" name=\"56\" class=\"settingParameter \" type=\"text\" />\r\n\
                </td>\r\n\
            </tr>\r\n\
            <tr>\r\n\
                <td colspan=\"4\" style=\"padding-top:6px;\">\r\n\
                    <a href=\"#\" class=\"settingBtn\" id=\"btnSave\">保存</a>\r\n\
                    ", 4199);
inputSecurityToken();   espRenderBlock(conn, "\r\n\
                </td>\r\n\
            </tr>\r\n\
        </table>\r\n\
    </form>\r\n\
    <script src=\"../../scripts/easyui/jquery.min.js\"></script>\r\n\
    <script src=\"../../scripts/easyui/jquery.easyui.min.js\"></script>\r\n\
    <script src=\"../../scripts/easyui/locale/easyui-lang-zh_CN.js\"></script>\r\n\
    <script src=\"../../scripts/utilities.js\"></script>\r\n\
    <script src=\"../../scripts/jquery.validate.min.js\"></script>\r\n\
    <script src=\"../../scripts/jquery.validate.extend.js\"></script>\r\n\
    <script type=\"text/javascript\">\r\n\
        //参数适配器\r\n\
        var parameterAdaptor = new ParameterAdaptor();\r\n\
\r\n\
        $().ready(function () {\r\n\
            loadDeviceInfo();\r\n\
            $(\"#btnSave\").click(saveParametersToServer);\r\n\
\r\n\
            var rules = {};\r\n\
            for (var i = 45; i <= 56; i++) {\r\n\
            	if (i == 47) {\r\n\
            		rules[i] = {\r\n\
                    maxByteLength: 30\r\n\
                	};\r\n\
            	} else {\r\n\
                	rules[i] = {\r\n\
                    	maxByteLength: 60\r\n\
                	};\r\n\
                }\r\n\
            }\r\n\
            $(\"#deviceInfoForm\").validate({\r\n\
                rules: rules\r\n\
            });\r\n\
        });\r\n\
\r\n\
        //加载设备信息\r\n\
        function loadDeviceInfo() {\r\n\
            var RefererInfo = \"deviceSettingsInfo\";\r\n\
            parameterAdaptor.getParameters(RefererInfo, onLoadSuccess);\r\n\
        }\r\n\
\r\n\
        //加载表单数据\r\n\
        function onLoadSuccess(data) {\r\n\
            $(\"#deviceInfoForm\").form(\"load\", data.feedback);\r\n\
        }\r\n\
\r\n\
        //保存参数到服务器\r\n\
        function saveParametersToServer() {\r\n\
            var formObj = $(\"#deviceInfoForm\");\r\n\
            if (!formObj.valid()) {\r\n\
                $.messager.alert(\"提示\", \"参数验证有误,请修改后再提交!\", \"error\");\r\n\
                return;\r\n\
            }\r\n\
            parameterAdaptor.saveParameters(formObj);\r\n\
        }\r\n\
    </script>\r\n\
</body>\r\n\
\r\n\
</html>", 1934);
}

ESP_EXPORT int esp_view_39df51a513b14995232abf8eb845cd9a(HttpRoute *route, MprModule *module) {
   espDefineView(route, "client/settings/base/deviceSettingsInfo.esp", view_39df51a513b14995232abf8eb845cd9a);
   return 0;
}