OSDSettings.esp 16.2 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">
        .tab_content {
            /*min-height: 450px;*/
        }

        /*视频Tab页内部样式*/

        .functionSelector {
            height: 20px;

            padding: 5px;
        }

        .fTitle {
            width: 100px;
            display: inline-block;
            text-align: right;
            padding-right: 10px;
        }

        .fContent {
            width: 152px;
            text-align: left;
            padding-left: 10px;
        }

        .tdOnlyOne {
            margin-left: 63px;
        }

        .tdTitle {
            width: 110px;
        }

        /*------默认格式显示情况----------*/

        .policeFormat {
            display: none;
        }

        .osd_time {
            display: none;
        }

        /*fieldset样式*/

        fieldset {
            border: 1px solid #808080;
            width: 700px;
        }
    </style>
</head>

<body>
    <ul class="tab_header">
        <!--<li class="tab_title" data-index="0">结果图</li>-->
        <li class="tab_title selected" data-index="1">视频流</li>
        <li class="clear"></li>
    </ul>
    <form id="osdForm">
        <div class="tab_content" style="display: none;">

        </div>
        <div class="tab_content">
            <div class="content_group">
                <div class="functionSelector">
                    <span class="fTitle">
                        <label>字幕叠加格式</label>
                    </span>
                    <span class="fContent">
                        <select name="180" id="180" class="settingParameter">
                            <option value="0">普通格式</option>
                            <option value="1">公安部格式</option>
                        </select>
                    </span>
                </div>
                <div class="normalFormat">
                    <table class="settingsContainer normalFormatTable">
                        <tr>
                            <td class="tdTitle">
                                <input class="checkboxAlign" name="181" id="181" type="checkbox" />
                                <label class="checkboxAlign">&nbsp;显示时间</label>
                            </td>
                            <td class="tdContent">
                                <!--<span class="osd_time">
                                    <input class="checkboxAlign" name="182" id="182" type="checkbox" /><span class="checkboxAlign">&nbsp;显示毫秒</span>
                                </span>
                                <span class="osd_time">
                                    <input class="checkboxAlign" name="183" id="183" type="checkbox" /><span class="checkboxAlign">&nbsp;显示星期</span>
                                </span>-->
                            </td>
                        </tr>
                        <tr>
                            <td class="tdTitle">
                                <label>时间显示位置</label>
                            </td>
                            <td class="tdContent">
                                <select id="184" name="184" class="settingParameter">
                                    <option value="0">左上角</option>
                                    <option value="1">右上角</option>
                                    <option value="2">左下角</option>
                                    <option value="3">右下角</option>
                                </select>
                            </td>
                        </tr>
                        <tr>
                            <td class="tdTitle">
                                <label>字体</label>
                            </td>
                            <td class="tdContent">
                                <select id="185" name="185" class="settingParameter">
                                    <option value="0" selected="selected">宋体</option>
                                </select>
                            </td>
                        </tr>
                        <tr>
                            <td class="tdTitle">
                                <label>字体大小</label>
                            </td>
                            <td class="tdContent">
                                <select id="186" name="186" class="settingParameter">
                                    <option value="0">16</option>
                                    <option value="1">24</option>
                                    <option value="2">28</option>
                                    <option value="3">32</option>
                                    <option value="4">64</option>
                                </select>
                            </td>
                        </tr>
                        <tr>
                            <td class="tdTitle">
                                <label>自定义字幕1</label>
                            </td>
                            <td class="tdContent">
                                <input name="187" id="187" class="settingParameter" type="text" />
                            </td>
                        </tr>
                        <tr>
                            <td class="tdTitle">
                                <label>自定义字幕2</label>
                            </td>
                            <td class="tdContent">
                                <input name="188" id="188" class="settingParameter" type="text" />
                            </td>
                        </tr>
                        <tr>
                            <td class="tdTitle">
                                <label>自定义字幕3</label>
                            <td class="tdContent">
                                <input name="189" id="189" class="settingParameter" type="text" />
                            </td>
                        </tr>
                        <tr>
                            <td class="tdTitle">
                                <label>自定义字幕4</label>
                            <td class="tdContent">
                                <input name="190" id="190" class="settingParameter" type="text" />
                            </td>
                        </tr>
                    </table>
                </div>
                <div class="policeFormat">
                   <table class="settingsContainer normalFormatTable">
						<tr>
                            <td class="tdTitle">
                                <input class="checkboxAlign" name="192" id="192" type="checkbox" />
                                <label class="checkboxAlign">&nbsp;显示时间</label>
                            </td>
                            <td class="tdContent">
                            </td>
                        </tr>
                        <tr>
                            <td class="tdTitle">
                                <label>时间显示位置</label>
                            </td>
                            <td class="tdContent">
                                <select id="191" name="191" class="settingParameter">
                                    <option value="0">左上角</option>
                                    <option value="1">右上角</option>
                                    <option value="2">左下角</option>
                                    <option value="3">右下角</option>
                                </select>
                            </td>
                        </tr>
                    </table>
                    <fieldset>
                        <legend>地点信息</legend>
                        <table class="settingsContainer">
                            <tr>
                                <td class="tdTitle">地点信息一</td>
                                <td class="tdContent">
                                    <input id="193" name="193" class="settingParameter" type="text" />
                                </td>
                            </tr>
                            <tr>
                                <td class="tdTitle">地点信息二</td>
                                <td class="tdContent">
                                    <input id="194" name="194" class="settingParameter" type="text" />
                                </td>
                            </tr>
                            <tr>
                                <td class="tdTitle">地点信息三</td>
                                <td class="tdContent">
                                    <input id="195" name="195" class="settingParameter" type="text" />
                                </td>
                            </tr>
                            <tr>
                                <td class="tdTitle">地点信息四</td>
                                <td class="tdContent">
                                    <input id="196" name="196" class="settingParameter" type="text" />
                                </td>
                            </tr>
                        </table>
                    </fieldset>
                    <fieldset>
                        <legend>设备属性</legend>
                        <table class="settingsContainer">
                            <tr>
                                <td class="tdTitle">控制方式</td>
                                <td class="tdContent">
                                    <select id="197" name="197" class="settingParameter">
                                        <option value="0"></option>
                                        <option value="1"></option>
                                    </select>
                                </td>
                            </tr>
                            <tr>
                                <td class="tdTitle">类型</td>
                                <td class="tdContent">
                                    <select id="198" name="198" class="settingParameter">
                                        <option value="0">球形</option>
                                        <option value="1">枪式</option>
                                    </select>
                                </td>
                            </tr>
                            <tr>
                                <td class="tdTitle">安装位置</td>
                                <td class="tdContent">
                                    <select id="199" name="199" class="settingParameter">
                                        <option value="0">室内</option>
                                        <option value="1">室外</option>
                                    </select>
                                </td>
                            </tr>
                            <tr>
                                <td class="tdTitle">用途</td>
                                <td class="tdContent">
                                    <select id="200" name="200" class="settingParameter">
                                        <option value="0">治安</option>
                                        <option value="1">交通</option>
                                        <option value="2">重点部位</option>
                                    </select>
                                </td>
                            </tr>
                            <tr>
                                <td class="tdTitle">监控方位</td>
                                <td class="tdContent">
                                    <select id="201" name="201" class="settingParameter">
                                        <option value="0"></option>
                                        <option value="1"></option>
                                        <option value="2">西</option>
                                        <option value="3"></option>
                                    </select>
                                </td>
                            </tr>
                        </table>
                    </fieldset>
                </div>
            </div>
        </div>
        <% inputSecurityToken(); %>
    </form>
    <div class="operateDiv" style="padding-left:5px;">
        <a class="settingBtn" id="btnSave" style="float: left;">保存</a>
        <div class="clear"></div>
    </div>
    <script src="../../scripts/jquery-1.11.1.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();
        var o_rules = {};
        $().ready(function () {
            //事件
            $("#180").change(onOsdFormatChanged);
            //$("#181").change(onOsdTimeChanged);
            //加载信息
            loadOsdInfo();
            $("#btnSave").click(saveParametersToServer);

            $("#186").change(onFontSizeChanged);

            o_rules[187] = o_rules[188] = o_rules[189] = o_rules[190] = {
                maxByteLength: 60
            };
            $("#osdForm").validate({
                rules: o_rules
            });

        });

        function onFontSizeChanged() {
            var rules = {};
            //添加验证
            if ($("#186").val() != "4") {
                $("#187").rules("remove", "maxByteLength");
                $("#187").rules("add", { maxByteLength: 60 });
                $("#188").rules("remove", "maxByteLength");
                $("#188").rules("add", { maxByteLength: 60 });
                $("#189").rules("remove", "maxByteLength");
                $("#189").rules("add", { maxByteLength: 60 });
                $("#190").rules("remove", "maxByteLength");
                $("#190").rules("add", { maxByteLength: 60 });
            } else {
                $("#187").rules("remove", "maxByteLength");
                $("#187").rules("add", { maxByteLength: 48 });
                $("#188").rules("remove", "maxByteLength");
                $("#188").rules("add", { maxByteLength: 48 });
                $("#189").rules("remove", "maxByteLength");
                $("#189").rules("add", { maxByteLength: 48 });
                $("#190").rules("remove", "maxByteLength");
                $("#190").rules("add", { maxByteLength: 48 });
            }
        }


        //当视频Osd格式变更时
        function onOsdFormatChanged() {
            var selectedValue = $("#180").find("option:selected").val();
            if (selectedValue == "0") {
                $(".normalFormat").show();
                $(".policeFormat").hide();
            } else {
                $(".normalFormat").hide();
                $(".policeFormat").show();
            }
        }

        //当Osd时间选项更改时
        function onOsdTimeChanged() {
            var isChecked = $("#181").is(":checked");
            if (isChecked) {
                $(".osd_time").show();
            } else {
                $(".osd_time").hide();
            }
        }
        //加载Osd信息
        function loadOsdInfo() {
            var RefererInfo = "OSDSettings";
            //调用公用方法加载参数
            parameterAdaptor.getParameters(RefererInfo, function (data) {
                $("#osdForm").form("load", data.feedback);
                $("#185").val(0);
                $("#185").attr("disabled", "disabled");
                onOsdFormatChanged();
                //onOsdTimeChanged();
            });
        }

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

</html>