form.html 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <form onsubmit="return false;" action="{:request()->url()}" data-auto="true" method="post" class='layui-form layui-card' autocomplete="off">
  2. <div class="layui-card-body">
  3. <div class="layui-row margin-bottom-15">
  4. <label class="layui-col-xs2 think-form-label">图片</label>
  5. <label class="layui-col-xs8 think-form-group-left">
  6. <input name="img" required value='{$vo.img|default=""}' placeholder="请上传图片" class="layui-input">
  7. </label>
  8. <a class="layui-col-xs2 layui-btn think-form-group-right" data-file="btn" data-field="img" data-type="png,jpg,gif">
  9. <i class="layui-icon layui-icon-upload"></i> 上传图片
  10. </a>
  11. </div>
  12. <div class="layui-row margin-bottom-15">
  13. <label class="layui-col-xs2 think-form-label">标题</label>
  14. <label class="layui-col-xs10">
  15. <input name="title" required value='{$vo.title|default=""}' placeholder="请输入标题" class="layui-input">
  16. </label>
  17. </div>
  18. <div class="layui-row margin-bottom-15">
  19. <label class="layui-col-xs2 think-form-label">跳转地址</label>
  20. <label class="layui-col-xs10">
  21. <input name="jump_address" required value='{$vo.jump_address|default=""}' placeholder="请输入跳转地址" class="layui-input">
  22. </label>
  23. </div>
  24. <div class="layui-form-item">
  25. <label class="layui-col-xs2 think-form-label">状态</label>
  26. <div class="layui-input-block">
  27. <label class="think-radio">
  28. {if !isset($vo.id)}
  29. <input checked type="radio" name="is_show" value="1" lay-ignore> 显示
  30. <input type="radio" name="is_show" value="0" lay-ignore> 隐藏
  31. {else}
  32. {if isset($vo.is_show) && $vo.is_show eq 1}
  33. <input checked type="radio" name="is_show" value="1" lay-ignore> 显示
  34. <input type="radio" name="is_show" value="0" lay-ignore> 隐藏
  35. {else}
  36. <input type="radio" name="is_show" value="1" lay-ignore> 显示
  37. <input checked type="radio" name="is_show" value="0" lay-ignore> 隐藏
  38. {/if}
  39. {/if}
  40. </label>
  41. </div>
  42. </div>
  43. </div>
  44. <div class="hr-line-dashed"></div>
  45. <div class="layui-form-item text-center">
  46. {if isset($vo.id)}<input type='hidden' value="<?php echo date('Y-m-d H:i:s'); ?>" name='update_at'>{else}<input type='hidden' value="<?php echo date('Y-m-d H:i:s'); ?>" name='create_at'>{/if}
  47. {notempty name='vo.id'}<input type='hidden' value='{$vo.id}' name='id'>{/notempty}
  48. <button class="layui-btn" type='submit'>保存数据</button>
  49. <button class="layui-btn layui-btn-danger" type='button' data-confirm="确定要取消编辑吗?" data-close>取消编辑</button>
  50. </div>
  51. </form>
  52. <script>form.render()</script>