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