<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('自定义数据采集配置新增')" />
    <th:block th:include="include :: ztree-css" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-role-add">
        <div class="row">
            <div class="col-sm-12">
                <div class="form-group">
                    <!--is-required 增加星号 显示为必填-->
                            <label class="col-sm-3 control-label">字段名称:</label>
                            <div class="col-sm-3">
                                <div class="input-group">
                                    <input name="fieldName" id="fieldName" class="styled-input" type="text" maxlength="255" >
                                </div>
                            </div>
                            <label class="col-sm-3 control-label">是否启用:</label>
                            <div class="col-sm-3">
                                <div class="input-group">
                                    <input name="isEnabled" id="isEnabled" class="styled-input" type="text" maxlength="255" >
                                </div>
                            </div>
                            <label class="col-sm-3 control-label">是否必填:</label>
                            <div class="col-sm-3">
                                <div class="input-group">
                                    <input name="isMandatory" id="isMandatory" class="styled-input" type="text" maxlength="255" >
                                </div>
                            </div>
                            <label class="col-sm-3 control-label">单位:</label>
                            <div class="col-sm-3">
                                <div class="input-group">
                                    <input name="unit" id="unit" class="styled-input" type="text" maxlength="255" >
                                </div>
                            </div>
                            <label class="col-sm-3 control-label">字段长度:</label>
                            <div class="col-sm-3">
                                <div class="input-group">
                                    <input name="fieldLength" id="fieldLength" class="styled-input" type="text" maxlength="255" >
                                </div>
                            </div>
                            <label class="col-sm-3 control-label">录入形式:</label>
                            <div class="col-sm-3">
                                <div class="input-group">
                                    <input name="entryForm" id="entryForm" class="styled-input" type="text" maxlength="255" >
                                </div>
                            </div>
                            <label class="col-sm-3 control-label">启用位置:</label>
                            <div class="col-sm-3">
                                <div class="input-group">
                                    <input name="enableLocation" id="enableLocation" class="styled-input" type="text" maxlength="255" >
                                </div>
                            </div>
                            <label class="col-sm-3 control-label">分组名称:</label>
                            <div class="col-sm-3">
                                <div class="input-group">
                                    <input name="groupName" id="groupName" class="styled-input" type="text" maxlength="255" >
                                </div>
                            </div>
                            <label class="col-sm-3 control-label">修改选项值:</label>
                            <div class="col-sm-3">
                                <div class="input-group">
                                    <input name="modificationOptions" id="modificationOptions" class="styled-input" type="text" maxlength="255" >
                                </div>
                            </div>
                </div>
            </div>

        </div>
    </form>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: ztree-js" />
<script type="text/javascript">

    function submitHandler() {
        if ($.validate.form()) {
            add();
        }
    }

    function add() {
           var fieldName = $("input[name='fieldName']").val();
           var isEnabled = $("input[name='isEnabled']").val();
           var isMandatory = $("input[name='isMandatory']").val();
           var unit = $("input[name='unit']").val();
           var fieldLength = $("input[name='fieldLength']").val();
           var entryForm = $("input[name='entryForm']").val();
           var enableLocation = $("input[name='enableLocation']").val();
           var groupName = $("input[name='groupName']").val();
           var modificationOptions = $("input[name='modificationOptions']").val();

        $.ajax({
            cache : true,
            type : "POST",
            url : ctx + "jkgl/sjkglmxbzdyfieldconfig/sJkglMxbZdyFieldconfigAdd",
            data : {
                "fieldName": fieldName,
                "isEnabled": isEnabled,
                "isMandatory": isMandatory,
                "unit": unit,
                "fieldLength": fieldLength,
                "entryForm": entryForm,
                "enableLocation": enableLocation,
                "groupName": groupName,
                "modificationOptions": modificationOptions,
            },
            async : false,
            error : function(request) {
                $.modal.alertError("系统错误");
            },
            success : function(data) {
                $.operate.successCallback(data);
            }
        });
    }
</script>
</body>
</html>
