form.html 5.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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-row layui-col-space15">
  4. <div class="layui-col-xs2 text-center">
  5. <input type="hidden" name="headimg" value="{$vo.headimg|default=''}">
  6. <script>$('[name=headimg]').uploadOneImage()</script>
  7. </div>
  8. <div class="layui-col-xs5">
  9. <label class="block relative">
  10. <span class="color-green font-w7">登录账号</span>
  11. <span class="color-desc margin-left-5">User Name</span>
  12. {if isset($vo) and isset($vo.username)}
  13. <input disabled value='{$vo.username|default=""}' class="layui-input layui-bg-gray">
  14. {else}
  15. <input name="username" value='{$vo.username|default=""}' required pattern="^.{4,}$" placeholder="请输入登录账号" class="layui-input">
  16. {/if}
  17. <span class="help-block">登录账号不能重复,账号创建后不能再次修改</span>
  18. </label>
  19. </div>
  20. <div class="layui-col-xs5">
  21. <label class="block relative">
  22. <span class="color-green font-w7">用户昵称</span>
  23. <span class="color-desc margin-left-5">Nick Name</span>
  24. <input name="nickname" value='{$vo.nickname|default=""}' required placeholder="请输入用户昵称" class="layui-input">
  25. <span class="help-block">用户显示的账号别名,请尽量保持不要重复</span>
  26. </label>
  27. </div>
  28. </div>
  29. <div class="hr-line-dashed margin-top-10 margin-bottom-10"></div>
  30. <div class="layui-row layui-col-space15">
  31. <div class="layui-col-xs4">
  32. <label class="relative block">
  33. <span class="color-green font-w7">联系邮箱</span><span class="color-desc margin-left-5">Contact Email</span>
  34. <input name="contact_mail" pattern="^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$" value='{$vo.contact_mail|default=""}' placeholder="请输入联系电子邮箱" class="layui-input">
  35. <span class="color-desc">可选,请填写常用的电子邮箱</span>
  36. </label>
  37. </div>
  38. <div class="layui-col-xs4">
  39. <label class="relative block">
  40. <span class="color-green font-w7">联系手机</span><span class="color-desc margin-left-5">Contact Mobile</span>
  41. <input type="tel" maxlength="11" name="contact_phone" value='{$vo.contact_phone|default=""}' pattern="^1[3-9][0-9]{9}$" placeholder="请输入用户联系手机" class="layui-input">
  42. <span class="color-desc">可选,请填写常用的联系手机号</span>
  43. </label>
  44. </div>
  45. <div class="layui-col-xs4">
  46. <label class="relative block">
  47. <span class="color-green font-w7">联系QQ</span><span class="color-desc margin-left-5">Contact QQ</span>
  48. <input name="contact_qq" pattern="^\d{6,}$" value='{$vo.contact_qq|default=""}' placeholder="请输入常用的联系QQ" class="layui-input">
  49. <span class="color-desc">可选,请填写常用的联系QQ号</span>
  50. </label>
  51. </div>
  52. </div>
  53. {notempty name='authorizes'}
  54. <div class="hr-line-dashed margin-top-10 margin-bottom-10"></div>
  55. <div class="layui-form-item">
  56. <span class="color-green font-w7">访问权限</span>
  57. <span class="color-desc margin-left-5">Authorize</span>
  58. <div class="layui-textarea">
  59. {if isset($vo.username) and $vo.username eq 'admin'}
  60. <span class="color-desc">超级用户不需要配置权限</span>
  61. {elseif empty($authorizes)}
  62. <span class="color-desc">未配置权限</span>
  63. {else}
  64. {foreach $authorizes as $authorize}
  65. <label class="think-checkbox layui-unselect">
  66. {if in_array($authorize.id, $vo.authorize)}
  67. <input type="checkbox" checked name="authorize[]" value="{$authorize.id}" lay-ignore> {$authorize.title}
  68. {else}
  69. <input type="checkbox" name="authorize[]" value="{$authorize.id}" lay-ignore> {$authorize.title}
  70. {/if}
  71. </label>
  72. {/foreach}
  73. {/if}
  74. </div>
  75. </div>
  76. {/notempty}
  77. <div class="hr-line-dashed margin-top-10 margin-bottom-10"></div>
  78. <label class="layui-form-item block relative">
  79. <span class="color-green font-w7">用户描述</span><span class="color-desc margin-left-5">User Remark</span>
  80. <textarea placeholder="请输入用户描述" class="layui-textarea" name="describe">{$vo.describe|default=""}</textarea>
  81. </label>
  82. <div class="hr-line-dashed"></div>
  83. {notempty name='vo.id'}<input type='hidden' value='{$vo.id}' name='id'>{/notempty}
  84. <div class="layui-form-item text-center">
  85. <button class="layui-btn" type='submit'>保存数据</button>
  86. <button class="layui-btn layui-btn-danger" type='button' data-confirm="确定要取消编辑吗?" data-close>取消编辑</button>
  87. </div>
  88. </div>
  89. </form>