view_082f01c0e5ec3a9d7ddce08aff317d37.c 8.8 KB
/*
   Generated from client/settings/function/plateRecognizing.esp
 */
#include "esp.h"

static void view_082f01c0e5ec3a9d7ddce08aff317d37(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\
        .plateWidthCalManual {\r\n\
            display: none;\r\n\
        }\r\n\
    </style>\r\n\
</head>\r\n\
    <body>\r\n\
        <div style=\"padding:8px;\">\r\n\
            <form id=\"plateForm\">\r\n\
                <table class=\"settingsContainer\">\r\n\
                    <tr>\r\n\
                        <td class=\"tdTitle\">车牌识别宽度</td>\r\n\
                        <td class=\"tdContent\">\r\n\
                            <select name=\"701\" id=\"701\" 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 class=\"plateWidthCalManual\">\r\n\
                        <td class=\"tdTitle\">\r\n\
                            车牌最小宽度\r\n\
                        </td>\r\n\
                        <td class=\"tdContent\">\r\n\
                            <input type=\"text\" id=\"702\" name=\"702\" class=\"settingParameter\"/>\r\n\
                        </td>\r\n\
                    </tr>\r\n\
                    <tr class=\"plateWidthCalManual\">\r\n\
                        <td class=\"tdTitle\">\r\n\
                            车牌最大宽度\r\n\
                        </td>\r\n\
                        <td class=\"tdContent\">\r\n\
                            <input type=\"text\" id=\"703\" name=\"703\" class=\"settingParameter\"/>\r\n\
                        </td>\r\n\
                    </tr>\r\n\
                    <tr>\r\n\
                        <td class=\"tdTitle\">车牌置信度阈值</td>\r\n\
                        <td class=\"tdContent\">\r\n\
                            <input type=\"text\" name=\"704\" id=\"704\" class=\"settingParameter\" />\r\n\
                        </td>\r\n\
                    </tr>\r\n\
                    <tr>\r\n\
                        <td class=\"tdTitle\">本地车牌</td>\r\n\
                        <td class=\"tdContent\">\r\n\
                            <select name=\"705\" id=\"705\" 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\
                                <option value='4'>冀</option>\r\n\
                                <option value='5'>晋</option>\r\n\
                                <option value='6'>蒙</option>\r\n\
                                <option value='7'>辽</option>\r\n\
                                <option value='8'>吉</option>\r\n\
                                <option value='9'>黑</option>\r\n\
                                <option value='10'>苏</option>\r\n\
                                <option value='11'>浙</option>\r\n\
                                <option value='12'>皖</option>\r\n\
                                <option value='13'>闽</option>\r\n\
                                <option value='14'>赣</option>\r\n\
                                <option value='15'>鲁</option>\r\n\
                                <option value='16'>豫</option>\r\n\
                                <option value='17'>鄂</option>\r\n\
                                <option value='18'>湘</option>\r\n\
                                <option value='19'>粤</option>\r\n\
                                <option value='20'>桂</option>\r\n\
                                <option value='21'>琼</option>\r\n\
                                <option value='22'>川</option>\r\n\
                                <option value='23'>贵</option>\r\n\
                                <option value='24'>云</option>\r\n\
                                <option value='25'>藏</option>\r\n\
                                <option value='26'>陕</option>\r\n\
                                <option value='27'>甘</option>\r\n\
                                <option value='28'>青</option>\r\n\
                                <option value='29'>宁</option>\r\n\
                                <option value='30'>新</option>\r\n\
                            </select>\r\n\
                        </td>\r\n\
                    </tr>                   \r\n\
                    <tr>\r\n\
                        <td colspan=\"2\">\r\n\
                            <a href=\"#\" class=\"settingBtn\" id=\"btnSave\">保存</a>\r\n\
                        </td>\r\n\
                    </tr>\r\n\
                </table>\r\n\
                ", 4729);
inputSecurityToken();   espRenderBlock(conn, "\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\
\r\n\
            $().ready(function() {\r\n\
                loadInfo();\r\n\
\r\n\
                $(\"#btnSave\").click(saveParametersToServer);\r\n\
\r\n\
                //车牌宽度自动识别\r\n\
                $(\"#701\").change(showOrHiddenPlateWidthParameter);\r\n\
\r\n\
                $(\"#plateForm\").validate({\r\n\
                    rules: {\r\n\
                        702: {\r\n\
                            required:true,\r\n\
                            range: [70, 230],\r\n\
                            digits:true\r\n\
                        },\r\n\
                        703: {\r\n\
                            required:true,\r\n\
                            range: [70, 230],\r\n\
                            digits:true,\r\n\
                            ge:[\"#702\",\"车牌最小宽度\"]\r\n\
                        },\r\n\
                        704: {\r\n\
                            required:true,\r\n\
                            range: [0, 101],\r\n\
                            digits: true\r\n\
                        }\r\n\
                    }\r\n\
                });\r\n\
            });\r\n\
\r\n\
            //更新车牌识别选项\r\n\
            function showOrHiddenPlateWidthParameter() {\r\n\
                var selectedValue = $(\"#701\").val();\r\n\
                if (selectedValue == \"1\") {\r\n\
                    $(\".plateWidthCalManual\").hide();\r\n\
                } else {\r\n\
                    $(\".plateWidthCalManual\").show();\r\n\
                }\r\n\
            }\r\n\
\r\n\
            //加载参数\r\n\
            function loadInfo() {\r\n\
                var key = \"PlateRecognizeSettings\";\r\n\
\r\n\
                parameterAdaptor.getParameters(key, function(data) {\r\n\
                    $(\"#plateForm\").form(\"load\", data.feedback);\r\n\
                    //更新UI\r\n\
                    updateUI();\r\n\
                });\r\n\
            }\r\n\
\r\n\
            //更新UI,比如一些根据值变更布局的地方\r\n\
            function updateUI() {\r\n\
                //更新车牌识别选项\r\n\
                showOrHiddenPlateWidthParameter();\r\n\
            }\r\n\
\r\n\
            //保存参数\r\n\
            function saveParametersToServer() {\r\n\
                var formObj = $(\"#plateForm\");\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\
</html>\r\n\
", 2969);
}

ESP_EXPORT int esp_view_082f01c0e5ec3a9d7ddce08aff317d37(HttpRoute *route, MprModule *module) {
   espDefineView(route, "client/settings/function/plateRecognizing.esp", view_082f01c0e5ec3a9d7ddce08aff317d37);
   return 0;
}