plateRecognizing.esp 7.37 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">
        .plateWidthCalManual {
            display: none;
        }
    </style>
</head>
    <body>
        <div style="padding:8px;">
            <form id="plateForm">
                <table class="settingsContainer">
                    <tr>
                        <td class="tdTitle">车牌识别宽度</td>
                        <td class="tdContent">
                            <select name="701" id="701" class="settingParameter">
                                <option value="0">手动指定</option>
                                <option value="1">自动计算</option>
                            </select>
                        </td>
                    </tr>
                    <tr class="plateWidthCalManual">
                        <td class="tdTitle">
                            车牌最小宽度
                        </td>
                        <td class="tdContent">
                            <input type="text" id="702" name="702" class="settingParameter"/>
                        </td>
                    </tr>
                    <tr class="plateWidthCalManual">
                        <td class="tdTitle">
                            车牌最大宽度
                        </td>
                        <td class="tdContent">
                            <input type="text" id="703" name="703" class="settingParameter"/>
                        </td>
                    </tr>
                    <tr>
                        <td class="tdTitle">车牌置信度阈值</td>
                        <td class="tdContent">
                            <input type="text" name="704" id="704" class="settingParameter" />
                        </td>
                    </tr>
                    <tr>
                        <td class="tdTitle">本地车牌</td>
                        <td class="tdContent">
                            <select name="705" id="705" class="settingParameter">
                                <option value='0'></option>
                                <option value='1'></option>
                                <option value='2'></option>
                                <option value='3'></option>
                                <option value='4'></option>
                                <option value='5'></option>
                                <option value='6'></option>
                                <option value='7'></option>
                                <option value='8'></option>
                                <option value='9'></option>
                                <option value='10'></option>
                                <option value='11'></option>
                                <option value='12'></option>
                                <option value='13'></option>
                                <option value='14'></option>
                                <option value='15'></option>
                                <option value='16'></option>
                                <option value='17'></option>
                                <option value='18'></option>
                                <option value='19'></option>
                                <option value='20'></option>
                                <option value='21'></option>
                                <option value='22'></option>
                                <option value='23'></option>
                                <option value='24'></option>
                                <option value='25'></option>
                                <option value='26'></option>
                                <option value='27'></option>
                                <option value='28'></option>
                                <option value='29'></option>
                                <option value='30'></option>
                            </select>
                        </td>
                    </tr>                   
                    <tr>
                        <td colspan="2">
                            <a href="#" class="settingBtn" id="btnSave">保存</a>
                        </td>
                    </tr>
                </table>
                <% inputSecurityToken(); %>
            </form>
        </div>
        <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() {
                loadInfo();

                $("#btnSave").click(saveParametersToServer);

                //车牌宽度自动识别
                $("#701").change(showOrHiddenPlateWidthParameter);

                $("#plateForm").validate({
                    rules: {
                        702: {
                            required:true,
                            range: [70, 230],
                            digits:true
                        },
                        703: {
                            required:true,
                            range: [70, 230],
                            digits:true,
                            ge:["#702","车牌最小宽度"]
                        },
                        704: {
                            required:true,
                            range: [0, 101],
                            digits: true
                        }
                    }
                });
            });

            //更新车牌识别选项
            function showOrHiddenPlateWidthParameter() {
                var selectedValue = $("#701").val();
                if (selectedValue == "1") {
                    $(".plateWidthCalManual").hide();
                } else {
                    $(".plateWidthCalManual").show();
                }
            }

            //加载参数
            function loadInfo() {
                var key = "PlateRecognizeSettings";

                parameterAdaptor.getParameters(key, function(data) {
                    $("#plateForm").form("load", data.feedback);
                    //更新UI
                    updateUI();
                });
            }

            //更新UI,比如一些根据值变更布局的地方
            function updateUI() {
                //更新车牌识别选项
                showOrHiddenPlateWidthParameter();
            }

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