<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('新增常见错误')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-check-add">
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label is-required">错误词：</label>
                    <div class="col-sm-8">
                        <input name="wrongWord" class="form-control" type="text" required>
                    </div>
                </div>
            </div>
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label is-required">正确词：</label>
                    <div class="col-sm-8">
                        <input name="correctWord" class="form-control" type="text" required>
                    </div>
                </div>
            </div>
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label">错误类型：</label>
                    <div class="col-sm-8">
                        <select name="errorType" class="form-control" th:with="type=${@dict.getType('trs_error_type')}">
                            <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                        </select>
                    </div>
                </div>
            </div>
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label">错误级别：</label>
                    <div class="col-sm-8">
                        <select name="errorGrade" class="form-control" th:with="type=${@dict.getType('trs_error_grade')}">
                            <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                        </select>
                    </div>
                </div>
            </div>
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label ">生效开始时间：</label>
                    <div class="col-sm-8">
                        <input type="text" class="time-input" id="effectstart" placeholder="开始时间" name="effectstart"/>
                    </div>
                </div>
            </div>
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label ">生效结束时间：</label>
                    <div class="col-sm-8">
                        <input type="text" class="time-input" id="effectend" placeholder="开始时间" name="effectend"/>
                    </div>
                </div>
            </div>
            <!--<div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label">词典类型：</label>
                    <div class="col-sm-8">
                        <select name="dictType" class="form-control" th:with="type=${@dict.getType('trs_dict_type')}">
                            <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                        </select>
                    </div>
                </div>
            </div>-->
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var prefix = ctx + "project/check"
        $("#form-check-add").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/add", $('#form-check-add').serialize());
            }
        }
    </script>
</body>
</html>