123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- {extend name="public/container"}
- {block name="head_top"}
- {/block}
- {block name="content"}
- <div class="layui-fluid">
- <div class="layui-row layui-col-space15" id="app">
- <div class="layui-col-md12">
- <div class="layui-card">
- <div class="layui-card-header">
- <div style="font-weight: bold;">签到海报</div>
- </div>
- <div class="layui-card-body">
- <div class="layui-btn-group">
- <button type="button" class="layui-btn layui-btn-normal layui-btn-sm" onclick="$eb.createModalFrame('添加海报','{:Url('create')}',{w:800,h:600})" ><i class="layui-icon"></i> 添加海报</button>
- <button class="layui-btn layui-btn-normal layui-btn-sm" onclick="window.location.reload()"><i class="layui-icon"></i> 刷新</button>
- </div>
- <table class="layui-hide" id="List" lay-filter="List"></table>
- <script type="text/html" id="act">
- <button type="button" class="layui-btn layui-btn-normal layui-btn-xs" lay-event="edit"><i class="layui-icon"></i> 编辑</button>
- <button type="button" class="layui-btn layui-btn-danger layui-btn-xs" lay-event="delete"><i class="layui-icon"></i> 删除</button>
- </script>
- </div>
- </div>
- </div>
- </div>
- </div>
- <script src="{__ADMIN_PATH}js/layuiList.js"></script>
- {/block}
- {block name="script"}
- <script>
- layList.form.render();
- layList.tableList({o:'List'},layList.U({a:'getSignPosterList'}),function (){
- return [
- {field: 'id', title: '编号', width:60,align:'center'},
- {field: 'sign_time', title: '签到时间',align:'center'},
- {field: 'poster', title: '海报', event:'open_image', align: 'center', templet: '<div><img class="avatar" style="cursor: pointer;" height="50" class="open_image" data-image="{{d.poster}}" src="{{d.poster}}" ></div>'},
- {field: 'sign_talk', title: '语录',align: 'center'},
- {field: 'right', title: '操作',align:'center',toolbar:'#act'},
- ];
- });
- layList.tool(function (layEvent,data,obj) {
- switch (layEvent){
- case 'delete':
- var url=layList.U({a:'delete',q:{id:data.id}});
- $eb.$swal('delete',function(){
- $eb.axios.get(url).then(function(res){
- if(res.status == 200 && res.data.code == 200) {
- $eb.$swal('success',res.data.msg);
- obj.del();
- }else
- return Promise.reject(res.data.msg || '删除失败')
- }).catch(function(err){
- $eb.$swal('error',err);
- });
- });
- break;
- case 'edit':
- $eb.createModalFrame('编辑',layList.Url({a:'edit',p:{id:data.id}}));
- break;
- case 'open_image':
- $eb.openImage(data.poster);
- break;
- }
- });
- </script>
- {/block}
|