From 2a7d4efa598f1f478aa7e5a7c45685e09ba449e9 Mon Sep 17 00:00:00 2001 From: dongzp <975303544@qq.com> Date: Tue, 9 Jun 2026 13:57:38 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E6=9C=AA=E5=90=AF=E7=94=A8?= =?UTF-8?q?=E7=8A=B6=E6=80=81=E4=B8=8B=E7=9A=84=E6=8E=A5=E5=8F=A3=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- admin.html | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/admin.html b/admin.html index b72a2f2..1f21881 100644 --- a/admin.html +++ b/admin.html @@ -749,10 +749,14 @@ return obj; }, removeRoute: async function (index) { - var actualIndex = + var pagedIndex = (this.routePagination.currentPage - 1) * this.routePagination.pageSize + index; - this.form.routes.splice(actualIndex, 1); + var target = this.filteredRoutes[pagedIndex]; + if (!target) return; + var realIndex = this.form.routes.indexOf(target); + if (realIndex === -1) return; + this.form.routes.splice(realIndex, 1); await this.saveRoutes(); }, getDefaultRouteForm: function () { @@ -795,7 +799,7 @@ (this.routePagination.currentPage - 1) * this.routePagination.pageSize + index; var item = - this.form.routes[actualIndex] || { route: "", filePath: "mock/" }; + this.filteredRoutes[actualIndex] || { route: "", filePath: "mock/" }; this.routeDialog.mode = "edit"; this.routeDialog.editingIndex = actualIndex; var matched = this.findApiByRoute(item.route || "");