|  |  |  | 
|---|
|  |  |  | <div class="layui-fluid layui-anim febs-anim" id="febs-activity-group" lay-title="活动分类列表"> | 
|---|
|  |  |  | <div class="layui-fluid layui-anim febs-anim" id="febs-activity-group" lay-title="活动分类管理"> | 
|---|
|  |  |  | <div class="layui-row febs-container"> | 
|---|
|  |  |  | <div class="layui-col-md12"> | 
|---|
|  |  |  | <div class="layui-card"> | 
|---|
|  |  |  | 
|---|
|  |  |  | <option value="">请选择</option> | 
|---|
|  |  |  | <option value="0">未开启</option> | 
|---|
|  |  |  | <option value="1">开启</option> | 
|---|
|  |  |  | </select> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | <div class="layui-inline"> | 
|---|
|  |  |  | <label class="layui-form-label layui-form-label-sm">推荐首页</label> | 
|---|
|  |  |  | <div class="layui-input-inline"> | 
|---|
|  |  |  | <select name="hotState"> | 
|---|
|  |  |  | <option value="">请选择</option> | 
|---|
|  |  |  | <option value="0">不推荐</option> | 
|---|
|  |  |  | <option value="1">推荐</option> | 
|---|
|  |  |  | </select> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | 
|---|
|  |  |  | <a lay-event="edit" shiro:hasPermission="votesActivityUpdate:update"><i | 
|---|
|  |  |  | class="layui-icon febs-edit-area febs-blue"></i></a> | 
|---|
|  |  |  | </script> | 
|---|
|  |  |  | <script type="text/html" id="hotStateSwitch"> | 
|---|
|  |  |  | {{# if(d.hotState === 1) { }} | 
|---|
|  |  |  | <input type="checkbox" value={{d.id}} lay-text="推荐|不推荐" checked lay-skin="switch" lay-filter="hotStateSwitch"> | 
|---|
|  |  |  | {{# } else { }} | 
|---|
|  |  |  | <input type="checkbox" value={{d.id}} lay-text="推荐|不推荐" lay-skin="switch" lay-filter="hotStateSwitch"> | 
|---|
|  |  |  | {{# } }} | 
|---|
|  |  |  | </script> | 
|---|
|  |  |  | <script type="text/html" id="groupStatusSwitch"> | 
|---|
|  |  |  | {{# if(d.status === 1) { }} | 
|---|
|  |  |  | {{# if(d.state === 1) { }} | 
|---|
|  |  |  | <input type="checkbox" value={{d.id}} lay-text="开启|关闭" checked lay-skin="switch" lay-filter="groupStatusSwitch"> | 
|---|
|  |  |  | {{# } else { }} | 
|---|
|  |  |  | <input type="checkbox" value={{d.id}} lay-text="开启|关闭" lay-skin="switch" lay-filter="groupStatusSwitch"> | 
|---|
|  |  |  | 
|---|
|  |  |  | <script type="text/html" id="groupOption"> | 
|---|
|  |  |  | <button class="layui-btn layui-btn-normal layui-btn-sm" type="button" shiro:hasPermission="groupInfo:view" lay-event="groupInfo">编辑</button> | 
|---|
|  |  |  | <button class="layui-btn layui-btn-danger layui-btn-sm" type="button" shiro:hasPermission="groupDelete:delete" lay-event="groupDelete">删除</button> | 
|---|
|  |  |  | </script> | 
|---|
|  |  |  | <script type="text/html" id="deleteFlag"> | 
|---|
|  |  |  | {{# | 
|---|
|  |  |  | var deleteFlag = { | 
|---|
|  |  |  | 0: {title: '生效中', color: 'green'}, | 
|---|
|  |  |  | 1: {title: '已删除', color: 'red'}, | 
|---|
|  |  |  | }[d.deleteFlag]; | 
|---|
|  |  |  | }} | 
|---|
|  |  |  | <span class="layui-badge febs-bg-{{deleteFlag.color}}">{{ deleteFlag.title }}</span> | 
|---|
|  |  |  | </script> | 
|---|
|  |  |  |  | 
|---|
|  |  |  | <style> | 
|---|
|  |  |  | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (layEvent === 'groupInfo') { | 
|---|
|  |  |  | febs.modal.open('审核编辑','modules/votesActivity/groupInfo/' + data.id, { | 
|---|
|  |  |  | febs.modal.open('编辑','modules/votesActivity/groupInfo/' + data.id, { | 
|---|
|  |  |  | btn: ['提交', '取消'], | 
|---|
|  |  |  | area: ['100%', '100%'], | 
|---|
|  |  |  | yes: function (index, layero) { | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | function groupDelete(id) { | 
|---|
|  |  |  | febs.get(ctx + 'admin/votesActivity/groupDelete/' + id, null, function (data) { | 
|---|
|  |  |  | febs.get(ctx + 'admin/happyActivity/groupDelete/' + id, null, function (data) { | 
|---|
|  |  |  | febs.alert.success(data.message); | 
|---|
|  |  |  | $query.click(); | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | 
|---|
|  |  |  | tableIns = febs.table.init({ | 
|---|
|  |  |  | elem: $view.find('table'), | 
|---|
|  |  |  | id: 'groupTable', | 
|---|
|  |  |  | url: ctx + 'admin/votesActivity/groupList', | 
|---|
|  |  |  | url: ctx + 'admin/happyActivity/groupList', | 
|---|
|  |  |  | toolbar:"#groupToolbar", | 
|---|
|  |  |  | defaultToolbar:[], | 
|---|
|  |  |  | cols: [[ | 
|---|
|  |  |  | {type: 'numbers', title: '序号', width: 80}, | 
|---|
|  |  |  | {type: 'numbers', title: '', width: 80}, | 
|---|
|  |  |  | {title: '操作', toolbar: '#groupOption', minWidth: 200, align: 'center'}, | 
|---|
|  |  |  | {field: 'orderCnt', title: '排序', minWidth: 100,align:'center'}, | 
|---|
|  |  |  | {field: 'name', title: '名称', minWidth: 100,align:'center'}, | 
|---|
|  |  |  | {title: '审核状态', templet: '#groupStatusSwitch', minWidth: 100,align:'center'}, | 
|---|
|  |  |  | {title: '推荐首页', templet: '#hotStateSwitch', minWidth: 100,align:'center'}, | 
|---|
|  |  |  | {title: '状态', templet: '#groupStatusSwitch', minWidth: 100,align:'center'}, | 
|---|
|  |  |  | {title: '是否删除', templet: '#deleteFlag', minWidth: 100,align:'center'}, | 
|---|
|  |  |  | {field: 'createdTime', title: '创建时间', minWidth: 150,align:'left'} | 
|---|
|  |  |  | ]] | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | form.on('switch(groupStatusSwitch)', function (data) { | 
|---|
|  |  |  | form.on('switch(hotStateSwitch)', function (data) { | 
|---|
|  |  |  | if (data.elem.checked) { | 
|---|
|  |  |  | groupState(data.value,1); | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | groupState(data.value,0); | 
|---|
|  |  |  | groupState(data.value,1); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | function groupState(id,state) { | 
|---|
|  |  |  | febs.get(ctx + 'admin/votesActivity/groupState/' + id+'/' + state, null, function (data) { | 
|---|
|  |  |  |  | 
|---|
|  |  |  | form.on('switch(groupStatusSwitch)', function (data) { | 
|---|
|  |  |  | if (data.elem.checked) { | 
|---|
|  |  |  | groupState(data.value,2); | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | groupState(data.value,2); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | function groupState(id,type) { | 
|---|
|  |  |  | febs.get(ctx + 'admin/happyActivity/groupState/' + id+'/' + type, null, function (data) { | 
|---|
|  |  |  | febs.alert.success(data.message); | 
|---|
|  |  |  | $query.click(); | 
|---|
|  |  |  | }); | 
|---|
|  |  |  | 
|---|
|  |  |  | return { | 
|---|
|  |  |  | name: $searchForm.find('input[name="name"]').val().trim(), | 
|---|
|  |  |  | status: $searchForm.find("select[name='status']").val(), | 
|---|
|  |  |  | hotState: $searchForm.find("select[name='hotState']").val(), | 
|---|
|  |  |  | }; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|