edit.tpl 1008 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. {extend name="common/base"/}
  2. <!-- 主体 -->
  3. {block name="body"}
  4. <form class="layui-form p-4">
  5. <h3 class="pb-3">编辑<name></h3>
  6. <table class="layui-table layui-table-form">
  7. <tritems>
  8. </table>
  9. <div class="py-3">
  10. <input type="hidden" name="<pk>" value="{$detail.<pk>}"/>
  11. <button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="webform">立即提交</button>
  12. <button type="reset" class="layui-btn layui-btn-primary">重置</button>
  13. </div>
  14. </form>
  15. {/block}
  16. <!-- /主体 -->
  17. <!-- 脚本 -->
  18. {block name="script"}
  19. <script>
  20. <moduleInit>
  21. function gouguInit() {
  22. var form = layui.form, tool = layui.tool;
  23. <datetimeScript>
  24. <uploadScript>
  25. <summernoteScript>
  26. //监听提交
  27. form.on('submit(webform)', function (data) {
  28. <summernoteForm>
  29. let callback = function (e) {
  30. layer.msg(e.msg);
  31. if (e.code == 0) {
  32. tool.sideClose(1000);
  33. }
  34. }
  35. tool.post("/admin/<model>/edit", data.field, callback);
  36. return false;
  37. });
  38. }
  39. </script>
  40. {/block}
  41. <!-- /脚本 -->