select.php 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. {extend name="public/container"}
  2. {block name="content"}
  3. <div class="layui-fluid">
  4. <div class="layui-row layui-col-space15" id="app">
  5. <div class="layui-col-md12">
  6. <div class="layui-card">
  7. <div class="layui-card-header">搜索条件</div>
  8. <div class="layui-card-body">
  9. <form class="layui-form layui-form-pane" action="">
  10. <div class="layui-inline">
  11. <label class="layui-form-label">用户昵称</label>
  12. <div class="layui-input-block">
  13. <input type="text" name="nickname" class="layui-input" placeholder="请输入用户昵称">
  14. </div>
  15. </div>
  16. <div class="layui-inline">
  17. <div class="layui-input-inline">
  18. <button class="layui-btn layui-btn-sm layui-btn-normal" lay-submit="search" lay-filter="search">
  19. <i class="layui-icon layui-icon-search"></i>搜索</button>
  20. </div>
  21. </div>
  22. </form>
  23. </div>
  24. </div>
  25. </div>
  26. <div class="layui-col-md12">
  27. <div class="layui-card">
  28. <div class="layui-card-body">
  29. <table class="layui-hide" id="List" lay-filter="List"></table>
  30. <!--图片-->
  31. <script type="text/html" id="image">
  32. <img style="cursor: pointer" lay-event="open_image" src="{{d.avatar}}">
  33. </script>
  34. <!--操作-->
  35. <script type="text/html" id="act">
  36. <button type="button" class="layui-btn layui-btn-normal layui-btn-sm" lay-event='select'>选择</button>
  37. </script>
  38. </div>
  39. </div>
  40. </div>
  41. </div>
  42. </div>
  43. <script src="{__ADMIN_PATH}js/layuiList.js"></script>
  44. {/block}
  45. {block name='script'}
  46. <script>
  47. var parentinputname = '{$Request.param.fodder}';
  48. layList.form.render();
  49. //加载列表
  50. layList.tableList('List',"{:Url('system.SystemStoreStaff/get_user_list')}",function (){
  51. return [
  52. {field: 'uid', title: 'ID', sort: true,event:'id'},
  53. {field: 'nickname', title: '微信用户名称'},
  54. {field: 'avatar', title: '头像',templet:'#image'},
  55. {field: 'right', title: '操作',align:'center',toolbar:'#act'},
  56. ]
  57. });
  58. //点击事件绑定
  59. layList.tool(function (event,data,obj) {
  60. console.log(data)
  61. switch (event) {
  62. case 'select':
  63. console.log(parent.$f.getValue('nickname'));
  64. parent.$f.changeField('image',data.avatar);
  65. parent.$f.changeField('uid',data.uid);
  66. parent.$f.changeField('avatar',data.avatar);
  67. parent.$f.closeModal(parentinputname);
  68. break;
  69. }
  70. })
  71. //查询
  72. layList.search('search',function(where){
  73. layList.reload(where);
  74. });
  75. </script>
  76. {/block}