From 370a994ba8110ca3b4fc66f20d05d683e38d0fc8 Mon Sep 17 00:00:00 2001 From: jsasg <735273025@qq.com> Date: Tue, 28 Apr 2026 15:18:56 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=9A=E5=91=98=E7=BA=A7=E5=88=AB=E4=B8=8E?= =?UTF-8?q?=E4=BC=9A=E5=91=98=E6=9D=83=E7=9B=8A=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/controller/wdsxh/member/Rights.php | 24 +++++++++++++++++++ .../admin/view/wdsxh/member/rights/add.html | 1 + .../admin/view/wdsxh/member/rights/edit.html | 1 + .../assets/js/backend/wdsxh/member/level.js | 16 ++++++------- .../assets/js/backend/wdsxh/member/rights.js | 4 ++-- 5 files changed, 36 insertions(+), 10 deletions(-) diff --git a/application/admin/controller/wdsxh/member/Rights.php b/application/admin/controller/wdsxh/member/Rights.php index 8c128d7..b1e6bca 100755 --- a/application/admin/controller/wdsxh/member/Rights.php +++ b/application/admin/controller/wdsxh/member/Rights.php @@ -32,4 +32,28 @@ class Rights extends Backend $this->view->assign('join_config', $this->join_config_model->getSimpleByStatus()); $this->searchFields = ['title']; } + + public function index() + { + $this->request->filter(['strip_tags', 'trim']); + $level_id = $this->request->get('level_id'); + if (false === $this->request->isAjax()) { + return $this->view->fetch(); + } + //如果发送的来源是 Selectpage,则转发到 Selectpage + if ($this->request->request('keyField')) { + return $this->selectpage(); + } + + [$where, $sort, $order, $offset, $limit] = $this->buildparams(); + $list = $this->model + ->where(function($query) use($level_id) { + $query->where('level_id', $level_id); + }) + ->where($where) + ->order($sort, $order) + ->paginate($limit); + $result = ['total' => $list->total(), 'rows' => $list->items()]; + return json($result); + } } diff --git a/application/admin/view/wdsxh/member/rights/add.html b/application/admin/view/wdsxh/member/rights/add.html index 82cfc9f..589a207 100755 --- a/application/admin/view/wdsxh/member/rights/add.html +++ b/application/admin/view/wdsxh/member/rights/add.html @@ -65,6 +65,7 @@
diff --git a/application/admin/view/wdsxh/member/rights/edit.html b/application/admin/view/wdsxh/member/rights/edit.html index cae02b2..3473b15 100755 --- a/application/admin/view/wdsxh/member/rights/edit.html +++ b/application/admin/view/wdsxh/member/rights/edit.html @@ -64,6 +64,7 @@ diff --git a/public/assets/js/backend/wdsxh/member/level.js b/public/assets/js/backend/wdsxh/member/level.js index 88f6a81..f878ab9 100644 --- a/public/assets/js/backend/wdsxh/member/level.js +++ b/public/assets/js/backend/wdsxh/member/level.js @@ -39,12 +39,12 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin // 为表格绑定事件 Table.api.bindevent(table); - + // 添加跳转按钮函数 function addJumpButtons() { var tbody = document.querySelector('table tbody'); if (!tbody) return; - + var rows = tbody.querySelectorAll('tr'); for (var i = 0; i < rows.length; i++) { var row = rows[i]; @@ -59,23 +59,23 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin jumpBtn.setAttribute('data-id', rowData.id); jumpBtn.style.marginLeft = '5px'; jumpBtn.innerHTML = ' 权益'; - + // 绑定点击事件 jumpBtn.onclick = (function(id) { return function() { - window.location.href = 'rights?id=' + id; + window.location.href = 'rights?level_id=' + id; }; })(rowData.id); - + lastTd.appendChild(jumpBtn); } } } } - + // 延迟执行确保表格已加载 setTimeout(addJumpButtons, 500); - + // 监听表格刷新完成事件 table.on('load-success.bs.table', function() { setTimeout(addJumpButtons, 100); @@ -94,4 +94,4 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin } }; return Controller; -}); \ No newline at end of file +}); diff --git a/public/assets/js/backend/wdsxh/member/rights.js b/public/assets/js/backend/wdsxh/member/rights.js index 0fd1aa8..21518d5 100755 --- a/public/assets/js/backend/wdsxh/member/rights.js +++ b/public/assets/js/backend/wdsxh/member/rights.js @@ -11,8 +11,8 @@ define(["jquery", "bootstrap", "backend", "table", "form"], function ( Table.api.init({ extend: { index_url: "wdsxh/member/rights/index" + location.search, - add_url: "wdsxh/member/rights/add", - edit_url: "wdsxh/member/rights/edit", + add_url: "wdsxh/member/rights/add" + location.search, + edit_url: "wdsxh/member/rights/edit" + location.search, del_url: "wdsxh/member/rights/del", table: "wdsxh_member_rights", },