<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('自定义数据采集配置修改')" />
</head>
<style>

</style>
<script>

</script>
<body>
<div class="ui-layout-center">
    <form class="form-horizontal" id="form-SJkglMxbZdyFieldconfig-edit" th:object="${user}">
        <h4 class="form-header h4">基本信息</h4>
        <input type="hidden" id="id" name="id" th:value="${id}">
        <div class="row">
            <div class="col-sm-12">
                <div class="form-group">
                    <!--is-required 增加星号 显示为必填-->
                    <label class="col-sm-1 control-label">字段名称:</label>
                    <div class="col-sm-2">
                        <div class="input-group">
                            <input name="fieldName" placeholder="字段名称" th:value="${fieldName}" class="styled-input" type="text" maxlength="255" required>
                        </div>
                    </div>
                    <label class="col-sm-1 control-label">是否启用:</label>
                    <div class="col-sm-2">
                        <div class="input-group">
                            <input name="isEnabled" placeholder="是否启用" th:value="${isEnabled}" class="styled-input" type="text" maxlength="255" required>
                        </div>
                    </div>
                    <label class="col-sm-1 control-label">是否必填:</label>
                    <div class="col-sm-2">
                        <div class="input-group">
                            <input name="isMandatory" placeholder="是否必填" th:value="${isMandatory}" class="styled-input" type="text" maxlength="255" required>
                        </div>
                    </div>
                    <label class="col-sm-1 control-label">单位:</label>
                    <div class="col-sm-2">
                        <div class="input-group">
                            <input name="unit" placeholder="单位" th:value="${unit}" class="styled-input" type="text" maxlength="255" required>
                        </div>
                    </div>
                    <label class="col-sm-1 control-label">字段长度:</label>
                    <div class="col-sm-2">
                        <div class="input-group">
                            <input name="fieldLength" placeholder="字段长度" th:value="${fieldLength}" class="styled-input" type="text" maxlength="255" required>
                        </div>
                    </div>
                    <label class="col-sm-1 control-label">录入形式:</label>
                    <div class="col-sm-2">
                        <div class="input-group">
                            <input name="entryForm" placeholder="录入形式" th:value="${entryForm}" class="styled-input" type="text" maxlength="255" required>
                        </div>
                    </div>
                    <label class="col-sm-1 control-label">启用位置:</label>
                    <div class="col-sm-2">
                        <div class="input-group">
                            <input name="enableLocation" placeholder="启用位置" th:value="${enableLocation}" class="styled-input" type="text" maxlength="255" required>
                        </div>
                    </div>
                    <label class="col-sm-1 control-label">分组名称:</label>
                    <div class="col-sm-2">
                        <div class="input-group">
                            <input name="groupName" placeholder="分组名称" th:value="${groupName}" class="styled-input" type="text" maxlength="255" required>
                        </div>
                    </div>
                    <label class="col-sm-1 control-label">修改选项值:</label>
                    <div class="col-sm-2">
                        <div class="input-group">
                            <input name="modificationOptions" placeholder="修改选项值" th:value="${modificationOptions}" class="styled-input" type="text" maxlength="255" required>
                        </div>
                    </div>
                </div>
            </div>

        </div>
    </form>
</div>
<div class="main-content">
    <div class="col-sm-offset-5 col-sm-10">
        <!--<button type="button" class="btn btn-sm btn-primary" onclick="submitHandler()"><i class="fa fa-check"></i>保 存</button>
        <button type="button" class="btn btn-sm btn-danger" onclick="closeItem()"><i class="fa fa-reply-all"></i>关 闭 </button>-->
    </div>
</div>
<th:block th:include="include :: footer" />
</body>
</html>

<script>
    function edit() {
        var data = $("#form-SJkglMxbZdyFieldconfig-edit").serializeArray();
        $.ajax({
            cache : true,
            type : "POST",
            url : ctx + "jkgl/sjkglmxbzdyfieldconfig/sJkglMxbZdyFieldconfigEdit",
            data : data,
            async : false,
            error : function(request) {
                $.modal.alertError("系统错误");
            },
            success : function(data) {
                $.operate.successCallback(data);
            }
        });
    }

    function submitHandler() {
        if ($.validate.form()) {
            edit();
        }
    }
</script>
