view_2c3e574347fbd6262034cd8bf82044c4.c 19 KB
/*
   Generated from client/settings/base/OSDSettings.esp
 */
#include "esp.h"

static void view_2c3e574347fbd6262034cd8bf82044c4(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\
        .tab_content {\r\n\
            /*min-height: 450px;*/\r\n\
        }\r\n\
\r\n\
        /*视频Tab页内部样式*/\r\n\
\r\n\
        .functionSelector {\r\n\
            height: 20px;\r\n\
\r\n\
            padding: 5px;\r\n\
        }\r\n\
\r\n\
        .fTitle {\r\n\
            width: 100px;\r\n\
            display: inline-block;\r\n\
            text-align: right;\r\n\
            padding-right: 10px;\r\n\
        }\r\n\
\r\n\
        .fContent {\r\n\
            width: 152px;\r\n\
            text-align: left;\r\n\
            padding-left: 10px;\r\n\
        }\r\n\
\r\n\
        .tdOnlyOne {\r\n\
            margin-left: 63px;\r\n\
        }\r\n\
\r\n\
        .tdTitle {\r\n\
            width: 110px;\r\n\
        }\r\n\
\r\n\
        /*------默认格式显示情况----------*/\r\n\
\r\n\
        .policeFormat {\r\n\
            display: none;\r\n\
        }\r\n\
\r\n\
        .osd_time {\r\n\
            display: none;\r\n\
        }\r\n\
\r\n\
        /*fieldset样式*/\r\n\
\r\n\
        fieldset {\r\n\
            border: 1px solid #808080;\r\n\
            width: 700px;\r\n\
        }\r\n\
    </style>\r\n\
</head>\r\n\
\r\n\
<body>\r\n\
    <ul class=\"tab_header\">\r\n\
        <!--<li class=\"tab_title\" data-index=\"0\">结果图</li>-->\r\n\
        <li class=\"tab_title selected\" data-index=\"1\">视频流</li>\r\n\
        <li class=\"clear\"></li>\r\n\
    </ul>\r\n\
    <form id=\"osdForm\">\r\n\
        <div class=\"tab_content\" style=\"display: none;\">\r\n\
\r\n\
        </div>\r\n\
        <div class=\"tab_content\">\r\n\
            <div class=\"content_group\">\r\n\
                <div class=\"functionSelector\">\r\n\
                    <span class=\"fTitle\">\r\n\
                        <label>字幕叠加格式</label>\r\n\
                    </span>\r\n\
                    <span class=\"fContent\">\r\n\
                        <select name=\"180\" id=\"180\" class=\"settingParameter\">\r\n\
                            <option value=\"0\">普通格式</option>\r\n\
                            <option value=\"1\">公安部格式</option>\r\n\
                        </select>\r\n\
                    </span>\r\n\
                </div>\r\n\
                <div class=\"normalFormat\">\r\n\
                    <table class=\"settingsContainer normalFormatTable\">\r\n\
                        <tr>\r\n\
                            <td class=\"tdTitle\">\r\n\
                                <input class=\"checkboxAlign\" name=\"181\" id=\"181\" type=\"checkbox\" />\r\n\
                                <label class=\"checkboxAlign\">&nbsp;显示时间</label>\r\n\
                            </td>\r\n\
                            <td class=\"tdContent\">\r\n\
                                <!--<span class=\"osd_time\">\r\n\
                                    <input class=\"checkboxAlign\" name=\"182\" id=\"182\" type=\"checkbox\" /><span class=\"checkboxAlign\">&nbsp;显示毫秒</span>\r\n\
                                </span>\r\n\
                                <span class=\"osd_time\">\r\n\
                                    <input class=\"checkboxAlign\" name=\"183\" id=\"183\" type=\"checkbox\" /><span class=\"checkboxAlign\">&nbsp;显示星期</span>\r\n\
                                </span>-->\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\
                                <select id=\"184\" name=\"184\" class=\"settingParameter\">\r\n\
                                    <option value=\"0\">左上角</option>\r\n\
                                    <option value=\"1\">右上角</option>\r\n\
                                    <option value=\"2\">左下角</option>\r\n\
                                    <option value=\"3\">右下角</option>\r\n\
                                </select>\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\
                                <select id=\"185\" name=\"185\" class=\"settingParameter\">\r\n\
                                    <option value=\"0\" selected=\"selected\">宋体</option>\r\n\
                                </select>\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\
                                <select id=\"186\" name=\"186\" class=\"settingParameter\">\r\n\
                                    <option value=\"0\">16</option>\r\n\
                                    <option value=\"1\">24</option>\r\n\
                                    <option value=\"2\">28</option>\r\n\
                                    <option value=\"3\">32</option>\r\n\
                                    <option value=\"4\">64</option>\r\n\
                                </select>\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 name=\"187\" id=\"187\" class=\"settingParameter\" type=\"text\" />\r\n\
                            </td>\r\n\
                        </tr>\r\n\
                        <tr>\r\n\
                            <td class=\"tdTitle\">\r\n\
                                <label>自定义字幕2</label>\r\n\
                            </td>\r\n\
                            <td class=\"tdContent\">\r\n\
                                <input name=\"188\" id=\"188\" 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 class=\"tdContent\">\r\n\
                                <input name=\"189\" id=\"189\" class=\"settingParameter\" type=\"text\" />\r\n\
                            </td>\r\n\
                        </tr>\r\n\
                        <tr>\r\n\
                            <td class=\"tdTitle\">\r\n\
                                <label>自定义字幕4</label>\r\n\
                            <td class=\"tdContent\">\r\n\
                                <input name=\"190\" id=\"190\" class=\"settingParameter\" type=\"text\" />\r\n\
                            </td>\r\n\
                        </tr>\r\n\
                    </table>\r\n\
                </div>\r\n\
                <div class=\"policeFormat\">\r\n\
                   <table class=\"settingsContainer normalFormatTable\">\r\n\
						<tr>\r\n\
                            <td class=\"tdTitle\">\r\n\
                                <input class=\"checkboxAlign\" name=\"192\" id=\"192\" type=\"checkbox\" />\r\n\
                                <label class=\"checkboxAlign\">&nbsp;显示时间</label>\r\n\
                            </td>\r\n\
                            <td class=\"tdContent\">\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\
                                <select id=\"191\" name=\"191\" class=\"settingParameter\">\r\n\
                                    <option value=\"0\">左上角</option>\r\n\
                                    <option value=\"1\">右上角</option>\r\n\
                                    <option value=\"2\">左下角</option>\r\n\
                                    <option value=\"3\">右下角</option>\r\n\
                                </select>\r\n\
                            </td>\r\n\
                        </tr>\r\n\
                    </table>\r\n\
                    <fieldset>\r\n\
                        <legend>地点信息</legend>\r\n\
                        <table class=\"settingsContainer\">\r\n\
                            <tr>\r\n\
                                <td class=\"tdTitle\">地点信息一</td>\r\n\
                                <td class=\"tdContent\">\r\n\
                                    <input id=\"193\" name=\"193\" class=\"settingParameter\" type=\"text\" />\r\n\
                                </td>\r\n\
                            </tr>\r\n\
                            <tr>\r\n\
                                <td class=\"tdTitle\">地点信息二</td>\r\n\
                                <td class=\"tdContent\">\r\n\
                                    <input id=\"194\" name=\"194\" class=\"settingParameter\" type=\"text\" />\r\n\
                                </td>\r\n\
                            </tr>\r\n\
                            <tr>\r\n\
                                <td class=\"tdTitle\">地点信息三</td>\r\n\
                                <td class=\"tdContent\">\r\n\
                                    <input id=\"195\" name=\"195\" class=\"settingParameter\" type=\"text\" />\r\n\
                                </td>\r\n\
                            </tr>\r\n\
                            <tr>\r\n\
                                <td class=\"tdTitle\">地点信息四</td>\r\n\
                                <td class=\"tdContent\">\r\n\
                                    <input id=\"196\" name=\"196\" class=\"settingParameter\" type=\"text\" />\r\n\
                                </td>\r\n\
                            </tr>\r\n\
                        </table>\r\n\
                    </fieldset>\r\n\
                    <fieldset>\r\n\
                        <legend>设备属性</legend>\r\n\
                        <table class=\"settingsContainer\">\r\n\
                            <tr>\r\n\
                                <td class=\"tdTitle\">控制方式</td>\r\n\
                                <td class=\"tdContent\">\r\n\
                                    <select id=\"197\" name=\"197\" class=\"settingParameter\">\r\n\
                                        <option value=\"0\">固</option>\r\n\
                                        <option value=\"1\">动</option>\r\n\
                                    </select>\r\n\
                                </td>\r\n\
                            </tr>\r\n\
                            <tr>\r\n\
                                <td class=\"tdTitle\">类型</td>\r\n\
                                <td class=\"tdContent\">\r\n\
                                    <select id=\"198\" name=\"198\" class=\"settingParameter\">\r\n\
                                        <option value=\"0\">球形</option>\r\n\
                                        <option value=\"1\">枪式</option>\r\n\
                                    </select>\r\n\
                                </td>\r\n\
                            </tr>\r\n\
                            <tr>\r\n\
                                <td class=\"tdTitle\">安装位置</td>\r\n\
                                <td class=\"tdContent\">\r\n\
                                    <select id=\"199\" name=\"199\" class=\"settingParameter\">\r\n\
                                        <option value=\"0\">室内</option>\r\n\
                                        <option value=\"1\">室外</option>\r\n\
                                    </select>\r\n\
                                </td>\r\n\
                            </tr>\r\n\
                            <tr>\r\n\
                                <td class=\"tdTitle\">用途</td>\r\n\
                                <td class=\"tdContent\">\r\n\
                                    <select id=\"200\" name=\"200\" class=\"settingParameter\">\r\n\
                                        <option value=\"0\">治安</option>\r\n\
                                        <option value=\"1\">交通</option>\r\n\
                                        <option value=\"2\">重点部位</option>\r\n\
                                    </select>\r\n\
                                </td>\r\n\
                            </tr>\r\n\
                            <tr>\r\n\
                                <td class=\"tdTitle\">监控方位</td>\r\n\
                                <td class=\"tdContent\">\r\n\
                                    <select id=\"201\" name=\"201\" class=\"settingParameter\">\r\n\
                                        <option value=\"0\">东</option>\r\n\
                                        <option value=\"1\">南</option>\r\n\
                                        <option value=\"2\">西</option>\r\n\
                                        <option value=\"3\">北</option>\r\n\
                                    </select>\r\n\
                                </td>\r\n\
                            </tr>\r\n\
                        </table>\r\n\
                    </fieldset>\r\n\
                </div>\r\n\
            </div>\r\n\
        </div>\r\n\
        ", 12854);
inputSecurityToken();   espRenderBlock(conn, "\r\n\
    </form>\r\n\
    <div class=\"operateDiv\" style=\"padding-left:5px;\">\r\n\
        <a class=\"settingBtn\" id=\"btnSave\" style=\"float: left;\">保存</a>\r\n\
        <div class=\"clear\"></div>\r\n\
    </div>\r\n\
    <script src=\"../../scripts/jquery-1.11.1.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 o_rules = {};\r\n\
        $().ready(function () {\r\n\
            //事件\r\n\
            $(\"#180\").change(onOsdFormatChanged);\r\n\
            //$(\"#181\").change(onOsdTimeChanged);\r\n\
            //加载信息\r\n\
            loadOsdInfo();\r\n\
            $(\"#btnSave\").click(saveParametersToServer);\r\n\
\r\n\
            $(\"#186\").change(onFontSizeChanged);\r\n\
\r\n\
            o_rules[187] = o_rules[188] = o_rules[189] = o_rules[190] = {\r\n\
                maxByteLength: 60\r\n\
            };\r\n\
            $(\"#osdForm\").validate({\r\n\
                rules: o_rules\r\n\
            });\r\n\
\r\n\
        });\r\n\
\r\n\
        function onFontSizeChanged() {\r\n\
            var rules = {};\r\n\
            //添加验证\r\n\
            if ($(\"#186\").val() != \"4\") {\r\n\
                $(\"#187\").rules(\"remove\", \"maxByteLength\");\r\n\
                $(\"#187\").rules(\"add\", { maxByteLength: 60 });\r\n\
                $(\"#188\").rules(\"remove\", \"maxByteLength\");\r\n\
                $(\"#188\").rules(\"add\", { maxByteLength: 60 });\r\n\
                $(\"#189\").rules(\"remove\", \"maxByteLength\");\r\n\
                $(\"#189\").rules(\"add\", { maxByteLength: 60 });\r\n\
                $(\"#190\").rules(\"remove\", \"maxByteLength\");\r\n\
                $(\"#190\").rules(\"add\", { maxByteLength: 60 });\r\n\
            } else {\r\n\
                $(\"#187\").rules(\"remove\", \"maxByteLength\");\r\n\
                $(\"#187\").rules(\"add\", { maxByteLength: 48 });\r\n\
                $(\"#188\").rules(\"remove\", \"maxByteLength\");\r\n\
                $(\"#188\").rules(\"add\", { maxByteLength: 48 });\r\n\
                $(\"#189\").rules(\"remove\", \"maxByteLength\");\r\n\
                $(\"#189\").rules(\"add\", { maxByteLength: 48 });\r\n\
                $(\"#190\").rules(\"remove\", \"maxByteLength\");\r\n\
                $(\"#190\").rules(\"add\", { maxByteLength: 48 });\r\n\
            }\r\n\
        }\r\n\
\r\n\
\r\n\
        //当视频Osd格式变更时\r\n\
        function onOsdFormatChanged() {\r\n\
            var selectedValue = $(\"#180\").find(\"option:selected\").val();\r\n\
            if (selectedValue == \"0\") {\r\n\
                $(\".normalFormat\").show();\r\n\
                $(\".policeFormat\").hide();\r\n\
            } else {\r\n\
                $(\".normalFormat\").hide();\r\n\
                $(\".policeFormat\").show();\r\n\
            }\r\n\
        }\r\n\
\r\n\
        //当Osd时间选项更改时\r\n\
        function onOsdTimeChanged() {\r\n\
            var isChecked = $(\"#181\").is(\":checked\");\r\n\
            if (isChecked) {\r\n\
                $(\".osd_time\").show();\r\n\
            } else {\r\n\
                $(\".osd_time\").hide();\r\n\
            }\r\n\
        }\r\n\
        //加载Osd信息\r\n\
        function loadOsdInfo() {\r\n\
            var RefererInfo = \"OSDSettings\";\r\n\
            //调用公用方法加载参数\r\n\
            parameterAdaptor.getParameters(RefererInfo, function (data) {\r\n\
                $(\"#osdForm\").form(\"load\", data.feedback);\r\n\
                $(\"#185\").val(0);\r\n\
                $(\"#185\").attr(\"disabled\", \"disabled\");\r\n\
                onOsdFormatChanged();\r\n\
                //onOsdTimeChanged();\r\n\
            });\r\n\
        }\r\n\
\r\n\
        //保存参数到服务器\r\n\
        function saveParametersToServer() {\r\n\
            var formObj = $(\"#osdForm\");\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>", 4063);
}

ESP_EXPORT int esp_view_2c3e574347fbd6262034cd8bf82044c4(HttpRoute *route, MprModule *module) {
   espDefineView(route, "client/settings/base/OSDSettings.esp", view_2c3e574347fbd6262034cd8bf82044c4);
   return 0;
}