From 58b489d68754d2d67354d0c86409666ddc5ca28d Mon Sep 17 00:00:00 2001 From: xiaoyong931011 <15274802129@163.com> Date: Tue, 17 Oct 2023 17:05:49 +0800 Subject: [PATCH] 一个商品领取一张卷, --- src/main/resources/templates/febs/views/modules/chat/userList.html | 35 +++++++++++++++++++++++++++++++++-- 1 files changed, 33 insertions(+), 2 deletions(-) diff --git a/src/main/resources/templates/febs/views/modules/chat/userList.html b/src/main/resources/templates/febs/views/modules/chat/userList.html index 9b5c0c4..845b51e 100644 --- a/src/main/resources/templates/febs/views/modules/chat/userList.html +++ b/src/main/resources/templates/febs/views/modules/chat/userList.html @@ -76,6 +76,13 @@ <input type="checkbox" value={{d.userId}} lay-text="简单模式|困难模式" lay-skin="switch" lay-filter="switchModelType"> {{# } }} </script> +<script type="text/html" id="switchCreateGroup"> + {{# if(d.createGroup === 1) { }} + <input type="checkbox" value={{d.userId}} lay-text="是|否" checked lay-skin="switch" lay-filter="switchCreateGroup"> + {{# } else { }} + <input type="checkbox" value={{d.userId}} lay-text="是|否" lay-skin="switch" lay-filter="switchCreateGroup"> + {{# } }} +</script> <style> .layui-form-onswitch { background-color: #5FB878 !important; @@ -103,6 +110,9 @@ tableIns; form.render(); + let currPageUser = 1;//首先默认值为1,防止出错 + //获取当前页 + currPageUser = $view.find(".layui-laypage-em").next().html(); // 表格初始化 initTable(); @@ -110,14 +120,14 @@ // 查询按钮 $query.on('click', function () { var params = $.extend(getQueryParams(), {field: sortObject.field, order: sortObject.type}); - tableIns.reload({where: params, page: {curr: 1}}); + tableIns.reload({where: params, page: {curr: currPageUser}}); }); // 刷新按钮 $reset.on('click', function () { $searchForm[0].reset(); sortObject.type = 'null'; - tableIns.reload({where: getQueryParams(), page: {curr: 1}, initSort: sortObject}); + tableIns.reload({where: getQueryParams(), page: {curr: currPageUser}, initSort: sortObject}); }); // 获取查询参数 @@ -148,6 +158,7 @@ {field: 'status', title: '账号状态', templet: '#switchStatus', minWidth: 80,align:'center'}, {field: 'isRobot', title: '机器人', templet: '#switchIsRobot', minWidth: 80,align:'center'}, {field: 'modelType', title: '模式', templet: '#switchModelType', minWidth: 80,align:'center'}, + {field: 'createGroup', title: '允许建群', templet: '#switchCreateGroup', minWidth: 80,align:'center'}, {field: 'createTime', title: '注册时间', minWidth: 180,align:'center'}, ]] }); @@ -215,6 +226,26 @@ }); } + form.on('switch(switchCreateGroup)', function (data) { + if (data.elem.checked) { + openCreateGroup(data.value); + } else { + closeCreateGroup(data.value); + } + }) + function openCreateGroup(userId) { + febs.get(ctx + 'admin/chat/openCreateGroup/' + userId, null, function () { + febs.alert.success('操作成功'); + $query.click(); + }); + } + function closeCreateGroup(userId) { + febs.get(ctx + 'admin/chat/closeCreateGroup/' + userId, null, function () { + febs.alert.success('操作成功'); + $query.click(); + }); + } + form.on('switch(switchModelType)', function (data) { if (data.elem.checked) { openModelType(data.value); -- Gitblit v1.9.1