From ae23ec42adadc5f3cf8efb5ae22f1b2de48be7a0 Mon Sep 17 00:00:00 2001
From: hubian <908234780@qq.com>
Date: Wed, 29 Apr 2026 23:03:33 +0800
Subject: [PATCH] =?UTF-8?q?fix:=20=E5=8A=A8=E6=80=81=E5=88=86=E7=B1=BB?=
=?UTF-8?q?=E5=AD=90=E7=B1=BB=E5=88=AB=E7=AD=9B=E9=80=89=E4=BF=AE=E5=A4=8D?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 移除showDynamicCategory中的dynamicSubcategoryFilter重置
- 改为在侧边栏点击时重置筛选值
- 点击子类别按钮时保持筛选值不被重置
- 手机、电脑、汽车、摄像等动态分类现在可以正确筛选
---
templates/admin.html | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/templates/admin.html b/templates/admin.html
index 3c87311..44353c6 100644
--- a/templates/admin.html
+++ b/templates/admin.html
@@ -666,7 +666,7 @@
} else {
// 动态分类
html += `
-
@@ -688,7 +688,8 @@
// 显示动态分类数据
async function showDynamicCategory(categoryId) {
dynamicCategoryId = categoryId;
- dynamicSubcategoryFilter = '';
+ // 不要每次都重置筛选值,除非是新切换的分类
+ // dynamicSubcategoryFilter = ''; // 移除这行
const cat = categories.find(c => c.id === categoryId);
const fields = cat ? (cat.fields || []) : [];
const fixedFields = ['id', 'created_at', 'updated_at', 'visible', 'raw_text', 'category_id', 'subcategory_id', 'is_pinned', 'images'];