fix(android): 知识 tab 顺序与 Web 对齐,「全部」默认选中
CI / backend (push) Canceled after 0s

- knowledgeTabs 改成 all/draft/published/archived,tab 默认 "all"。
- 空态文案按 tab 区分(全部 / 某一类 / 某个分类),不再写死"待核对"。
- 与 Web 版同一行为:进知识库先看全部,待核对是待办而不是门面。
This commit is contained in:
Steven
2026-10-31 02:27:55 +08:00
parent 50227c2114
commit 35fe4d92cb
@@ -58,11 +58,12 @@ import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch
import kotlinx.coroutines.withContext
// 与 Web 一致:「全部」在第一位并且是默认——先看有什么,再去看待办
private val knowledgeTabs = listOf(
"all" to "全部",
"draft" to "待核对",
"published" to "已发布",
"archived" to "已归档",
"all" to "全部",
)
private val docTypes = listOf(
@@ -96,7 +97,7 @@ fun KnowledgeScreen(
onReopened: () -> Unit = {},
) {
val scope = rememberCoroutineScope()
var tab by remember { mutableStateOf("draft") }
var tab by remember { mutableStateOf("all") }
var docs by remember { mutableStateOf<List<KnowledgeDoc>>(emptyList()) }
var categories by remember { mutableStateOf<List<KnowledgeCategory>>(emptyList()) }
var loading by remember { mutableStateOf(true) }
@@ -207,7 +208,13 @@ fun KnowledgeScreen(
if (!loading && docs.isEmpty()) {
item {
EmptyState(
if (catFilter == null) "还没有待核对的知识" else "这个分类下还没有知识",
if (catFilter != null) {
"这个分类下还没有知识"
} else if (tab == "all") {
"还没有知识"
} else {
"这一类里还没有知识"
},
"把工单验收通过,或在任务详情里点「沉淀成知识」",
)
}