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 || "");