表单字典

            <li>
                车间:<select name="memberRoom" th:with="type=${@dict.getType('team_member_room')}">
                <option value="">所有</option>
                <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
              </select>
              </li>


 <select name="sex" class="form-control m-b" th:with="type=${@dict.getType('sys_user_sex')}">
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                    </select>

___________________________状态
                <div class="col-sm-8">
                    <label class="toggle-switch switch-solid">
                        <input type="checkbox" id="status" checked>
                        <span></span>
                    </label>
                </div>

  <div class="col-sm-8">
    <label class="toggle-switch switch-solid">
      <input type="checkbox" id="status" th:checked="${user.status == '0' ? true : false}">
      <span></span>
    </label>
  </div>
___________________________提交
   function submitHandler() {
            if ($.validate.form()) {
                var data = $("#form-user-edit").serializeArray();
                var status = $("input[id='status']").is(':checked') == true ? 0 : 1;
                data.push({"name": "status", "value": status});
                $.operate.saveTab(prefix + "/edit", data);
            }
        }

        function submitHandler() {
            if ($.validate.form()) {
                var data = $("#form-user-edit").serializeArray();
                var status = $("input[id='status']").is(':checked') == true ? 0 : 1;
                var roleIds = $.form.selectCheckeds("role");
                var postIds = $.form.selectSelects("post");
                data.push({"name": "status", "value": status});
                data.push({"name": "roleIds", "value": roleIds});
                data.push({"name": "postIds", "value": postIds});
                $.operate.saveTab(prefix + "/edit", data);
            }
        }

原文地址:https://www.cnblogs.com/csjoz/p/15247255.html