edit.html 3.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. {extend name="common/base"/}
  2. <!-- 主体 -->
  3. {block name="body"}
  4. <form class="layui-form p-4">
  5. <h3 class="pb-3">编辑用户信息</h3>
  6. <table class="layui-table layui-table-form">
  7. <tr>
  8. <td class="layui-td-gray">用户等级<font>*</font></td>
  9. <td>
  10. <input type="hidden" name="id" value="{$user.id}">
  11. <select name="level" lay-verify="required" lay-reqText="请选择用户等级">
  12. <option value="">请选择用户等级</option>
  13. {volist name="levels" id="v"}
  14. <option value="{$v.id}" {eq name="$user.level" value="$v.id"}selected{/eq}>{$v.title}</option>
  15. {/volist}
  16. </select>
  17. </td>
  18. <td class="layui-td-gray">用户昵称<font>*</font></td>
  19. <td>
  20. <input type="text" name="nickname" placeholder="请输入用户昵称" autocomplete="off" class="layui-input" value="{$user.nickname}" lay-verify="required" lay-reqText="请输入用户昵称">
  21. </td>
  22. <td class="layui-td-gray">真实姓名</td>
  23. <td>
  24. <input type="text" name="name" placeholder="请输入真实姓名" autocomplete="off" class="layui-input" value="{$user.name}">
  25. </td>
  26. </tr>
  27. <tr>
  28. <td class="layui-td-gray">性别</td>
  29. <td>
  30. <input type="radio" name="sex" value="1" title="男" {eq name="$user.sex" value="1" }checked{/eq}>
  31. <input type="radio" name="sex" value="2" title="女" {eq name="$user.sex" value="2" }checked{/eq}>
  32. </td>
  33. <td class="layui-td-gray">手机号码</td>
  34. <td>
  35. <input type="text" name="mobile" placeholder="请输入手机" autocomplete="off" class="layui-input" value="{$user.mobile}">
  36. </td>
  37. <td class="layui-td-gray">电子邮箱</td>
  38. <td>
  39. <input type="text" name="email" placeholder="请输入电子邮箱" autocomplete="off" class="layui-input" value="{$user.email}">
  40. </td>
  41. </tr>
  42. <tr>
  43. <td class="layui-td-gray">个人简介</td>
  44. <td colspan="5">
  45. <textarea name="desc" placeholder="请输入个人简介" class="layui-textarea">{$user.desc}</textarea>
  46. </td>
  47. </tr>
  48. <tr>
  49. <td class="layui-td-gray">所在企业</td>
  50. <td>
  51. <input type="text" name="company" placeholder="请输入所在企业" autocomplete="off" class="layui-input" value="{$user.company}">
  52. </td>
  53. <td class="layui-td-gray">所在部门</td>
  54. <td>
  55. <input type="text" name="depament" placeholder="请输入所在部门" autocomplete="off" class="layui-input" value="{$user.depament}">
  56. </td>
  57. <td class="layui-td-gray">所在职位</td>
  58. <td>
  59. <input type="text" name="position" placeholder="请输入所在职位" autocomplete="off" class="layui-input" value="{$user.position}">
  60. </td>
  61. </tr>
  62. <tr>
  63. <td class="layui-td-gray">企业地址</td>
  64. <td colspan="5">
  65. <input type="text" name="address" placeholder="请输入企业地址" autocomplete="off" class="layui-input" value="{$user.address}">
  66. </td>
  67. </tr>
  68. </table>
  69. <div class="py-3">
  70. <button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="webform">立即提交</button>
  71. <button type="reset" class="layui-btn layui-btn-primary">重置</button>
  72. </div>
  73. </form>
  74. {/block}
  75. <!-- /主体 -->
  76. <!-- 脚本 -->
  77. {block name="script"}
  78. <script>
  79. const moduleInit = ['tool'];
  80. function gouguInit() {
  81. var tool = layui.tool, form = layui.form;
  82. //监听提交
  83. form.on('submit(webform)', function (data) {
  84. let callback = function (e) {
  85. layer.msg(e.msg);
  86. if (e.code == 0) {
  87. parent.layui.tool.close(1000);
  88. }
  89. }
  90. tool.post("/admin/user/edit", data.field, callback);
  91. return false;
  92. });
  93. }
  94. </script>
  95. {/block}
  96. <!-- /脚本 -->