view_f5950e43d649170e76544f7fcc05285c.c 5.23 KB
/*
   Generated from client/settings/function/cameraSetup.esp
 */
#include "esp.h"

static void view_f5950e43d649170e76544f7fcc05285c(HttpConn *conn) {
  espRenderBlock(conn, "<!DOCTYPE html>\r\n\
<html>\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\
        .mainContainer {\r\n\
            width: 90%;\r\n\
            height: 400px;\r\n\
            padding: 8px;\r\n\
        }\r\n\
        .tdTitle {\r\n\
            width: 110px;\r\n\
        }\r\n\
         .picExample {\r\n\
             height: 276px;\r\n\
             width: 322px;\r\n\
             background: url(../../images/cameraSetup.png) no-repeat 0 0;\r\n\
         }\r\n\
    </style>\r\n\
</head>\r\n\
<body>\r\n\
    <div class=\"mainContainer\">\r\n\
        <form id=\"cameraSetupForm\">\r\n\
            <table class=\"settingsContainer\">\r\n\
                <tr>\r\n\
                    <td class=\"tdTitle\">杆高(1-10米)</td>\r\n\
                    <td class=\"tdContent\">\r\n\
                        <input type=\"text\" name=\"210\" id=\"210\" class=\"settingParameter\" />\r\n\
                    </td>\r\n\
                </tr>\r\n\
                <tr>\r\n\
                    <td class=\"tdTitle\">焦距(5-50毫米)</td>\r\n\
                    <td class=\"tdContent\">\r\n\
                    	<input type=\"text\" name=\"211\" id=\"211\" class=\"settingParameter\">\r\n\
                    </td>\r\n\
                </tr>\r\n\
                <tr>\r\n\
                    <td colspan=\"2\">\r\n\
                        <div class=\"picExample\">\r\n\
\r\n\
                        </div>\r\n\
                    </td>\r\n\
                </tr>\r\n\
                <tr>\r\n\
                    <td colspan=\"2\">\r\n\
                    	", 1695);
inputSecurityToken();   espRenderBlock(conn, "\r\n\
                        <a href=\"#\" id=\"btnSave\" class=\"settingBtn\">保存</a>\r\n\
                    </td>\r\n\
                </tr>\r\n\
            </table>\r\n\
        </form>\r\n\
    </div>\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\
        var parameterAdaptor = new ParameterAdaptor();\r\n\
		var rebootManager = new RebootManager();\r\n\
		\r\n\
        $().ready(function() {\r\n\
            loadCameraSetupInfo();\r\n\
            setTimeout(loadAttributeInfo, 200);\r\n\
            $(\"#btnSave\").click(saveParametersToServer);\r\n\
\r\n\
            //表单验证\r\n\
            $(\"#cameraSetupForm\").validate({\r\n\
                rules: {\r\n\
                    210: {\r\n\
                        required:true,\r\n\
                        range:[1,10]\r\n\
                    },\r\n\
                    211: {\r\n\
                        required:true,\r\n\
                        range:[5,50]\r\n\
                    }\r\n\
                }\r\n\
            });\r\n\
        });\r\n\
\r\n\
        //加载相机设置参数\r\n\
        function loadCameraSetupInfo() {\r\n\
			var RefererInfo = \"cameraSetup\";\r\n\
            parameterAdaptor.getParameters(RefererInfo, function(data) {\r\n\
                $(\"#cameraSetupForm\").form(\"load\", data.feedback);\r\n\
            });\r\n\
        }\r\n\
        \r\n\
		function loadAttributeInfo() {\r\n\
			var RefererInfo = \"cameraSetup\";\r\n\
			parameterAdaptor.getAttribute(RefererInfo, function(data){\r\n\
	            for(var pId in data){\r\n\
	            	if(document.getElementById(pId) != null)\r\n\
						document.getElementById(pId).setAttribute( \"title\", data[pId]);\r\n\
				} \r\n\
			});\r\n\
		}\r\n\
\r\n\
        //保存参数到服务器\r\n\
        function saveParametersToServer() {\r\n\
            var formObj = $(\"#cameraSetupForm\");\r\n\
            if (!formObj.valid()) {\r\n\
                $.messager.alert(\"提示\", \"参数验证有误,请修改后再提交!\", \"error\");\r\n\
                return;\r\n\
            }\r\n\
            parameterAdaptor.saveParameters(formObj, function(response) {\r\n\
                if (response.error) {\r\n\
                    $.messager.show({\r\n\
						title:'结果',\r\n\
						msg:'修改成功!',\r\n\
						timeout:3000,\r\n\
						showType:'slide'\r\n\
					});\r\n\
                }\r\n\
            });\r\n\
            \r\n\
        }\r\n\
    </script>\r\n\
</body>\r\n\
</html>\r\n\
", 2594);
}

ESP_EXPORT int esp_view_f5950e43d649170e76544f7fcc05285c(HttpRoute *route, MprModule *module) {
   espDefineView(route, "client/settings/function/cameraSetup.esp", view_f5950e43d649170e76544f7fcc05285c);
   return 0;
}