<!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-domain-edit" th:object="${trsDomainWords}">
            <input name="id" th:field="*{id}" type="hidden">
            <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" th:field="*{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">实体类型：</label>
                    <div class="col-sm-8">
                        <select name="domainType" class="form-control" th:with="type=${@dict.getType('trs_domain_type')}">
                            <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{domainType}"></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"
                               th:value="${trsDomainWords.effectstart != null} ? ${#dates.format(trsDomainWords.effectstart, 'yyyy-MM-dd')} : ''"
                               class="time-input"
                               placeholder="yyyy-MM-dd"
                               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"
                               th:value="${trsDomainWords.effectend != null} ? ${#dates.format(trsDomainWords.effectend, 'yyyy-MM-dd')} : ''"
                               class="time-input"
                               placeholder="yyyy-MM-dd"
                               name="effectend"/>
                    </div>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var prefix = ctx + "project/domain";
        $("#form-domain-edit").validate({
            focusCleanup: true
        });

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