form.html 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <form class="layui-form layui-card" action="{:request()->url()}" data-auto="true" method="post" autocomplete="off">
  2. <div class="layui-card-body padding-left-40">
  3. <div class="layui-form-item">
  4. <label class="layui-col-xs2 think-form-label">姓名</label>
  5. <label class="layui-col-xs10">
  6. <input name="name" required value='{$vo.name|default=""}' placeholder="请输入姓名" class="layui-input">
  7. </label>
  8. </div>
  9. <div class="layui-form-item">
  10. <label class="layui-col-xs2 think-form-label">手机号</label>
  11. <label class="layui-col-xs10">
  12. <input type="tel" required maxlength="11" autocomplete="off" name="phone" value='{$vo.phone|default=""}' pattern="^1[3-9][0-9]{9}$" placeholder="请输入用户联系手机" class="layui-input">
  13. </label>
  14. </div>
  15. <div class="layui-form-item">
  16. <label class="layui-col-xs2 think-form-label">登录账号</label>
  17. <label class="layui-col-xs10">
  18. <input name="username" required value='{$vo.username|default=""}' pattern="^.{4,}$" placeholder="请输入4位及以上字符登录用户账号" class="layui-input">
  19. </label>
  20. </div>
  21. {if !isset($vo.id)}
  22. <div class="layui-form-item">
  23. <label class="layui-col-xs2 think-form-label">登录密码</label>
  24. <label class="layui-col-xs10">
  25. <input type="password" name="password" maxlength="32" pattern="^(?![\d]+$)(?![a-zA-Z]+$)(?![^\da-zA-Z]+$).{6,32}$" required placeholder="必需包含大小写字母、数字、符号的任意两者组合。" class="layui-input">
  26. </label>
  27. </div>
  28. {/if}
  29. {if isset($vo.username) and $vo.username eq 'admin'}
  30. {else}
  31. <div class="layui-form-item">
  32. <label class="layui-col-xs2 think-form-label" >选择权限</label>
  33. <label class="layui-col-xs10">
  34. <select name="authorize" required id="authorize" lay-verify="required" lay-search>
  35. <option value="">请选择</option>
  36. {foreach $authorizes as $authorize}
  37. {if isset($vo.id) && ($vo.authorize eq $authorize.id)}
  38. <option selected value="{$authorize.id}">{$authorize.title}</option>
  39. {else}
  40. <option value="{$authorize.id}">{$authorize.title}</option>
  41. {/if}
  42. {/foreach}
  43. </select>
  44. </label>
  45. </div>
  46. {/if}
  47. </div>
  48. <div class="hr-line-dashed"></div>
  49. {notempty name='vo.id'}<input type='hidden' value='{$vo.id}' name='id'>{/notempty}
  50. <div class="layui-form-item text-center">
  51. <button class="layui-btn" type='submit' lay-submit style="background: #DC0619">确认</button>
  52. <button class="layui-btn layui-btn-danger" type='button' data-confirm="确定要取消吗?" data-close style="background: #BDBDBD">取消</button>
  53. </div>
  54. <script>
  55. layui.form.render();
  56. </script>
  57. </form>