feat(db): 新增测试数据清除功能,物理清空全部 4 张表并重置 SP 状态

- 各 DAO 新增 deleteAll() 物理清空方法
- DbRepository 新增 clearAllTestData(),按顺序删除食材→菜品→调料→槽位
- DbViewModel 暴露 clearAllTestData(onDone) 供 UI 层调用
- SettingActivity 新增「测试数据清除」入口(隐藏,右上角图标触发显示)
- 清除完成后重置 SpTool.cookMode=-1 和 SpTool.canteenId="0"

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-08 11:58:32 +08:00
co-authored by Claude Sonnet 4.6
parent c46264a4cf
commit a0137d6979
8 changed files with 93 additions and 0 deletions
@@ -173,6 +173,38 @@
tools:ignore="ContentDescription" />
</LinearLayout>
<LinearLayout
android:id="@+id/llClearTestData"
android:layout_width="match_parent"
android:layout_height="120dp"
android:layout_marginHorizontal="32dp"
android:layout_marginTop="50dp"
android:background="@drawable/shape_white_dc_15_corners"
android:clipToOutline="true"
android:foreground="?android:attr/selectableItemBackground"
android:gravity="center_vertical"
android:orientation="horizontal"
android:visibility="gone">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="32dp"
android:layout_weight="1"
android:text="测试数据清除"
android:textColor="@color/black333"
android:textSize="32sp"
android:textStyle="bold" />
<ImageView
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_marginEnd="20dp"
android:adjustViewBounds="true"
android:src="@drawable/ic_arrow_right3"
tools:ignore="ContentDescription" />
</LinearLayout>
<!-- &lt;!&ndash; 底部导航菜单 &ndash;&gt;-->
<!-- <LinearLayout-->
<!-- android:id="@+id/bottomMenu"-->