| | |
| | | var taskId = 0L |
| | | |
| | | /** |
| | | * 任务类型ID |
| | | * 任务类别为2时:对应数据字典,多个逗号分割 |
| | | * 任务类别为1时:枚举值 1-9 |
| | | * 任务类型ID 组id|子id1, 子id2, 子id3... |
| | | */ |
| | | var taskTypeId: String? = null |
| | | |
| | |
| | | block() |
| | | } else { |
| | | launchRequest { |
| | | taskRepository.getTypeList()?.forEachIndexed { index, type -> |
| | | taskRepository.getTypeList()?.also { it -> |
| | | runOnMainThread { |
| | | categories.clear() |
| | | val items = mutableListOf<Item>() |
| | | type.child?.forEach { |
| | | items.add(Item(it.id ?: 0L, it.errorName ?: "")) |
| | | it.mapIndexed { index, type -> |
| | | val items = mutableListOf<Item>() |
| | | type.child?.forEach { |
| | | items.add(Item(it.id ?: 0L, it.errorName ?: "")) |
| | | } |
| | | categories.add(Category(index, type.errorName ?: "", items)) |
| | | } |
| | | categories.add(Category(index, type.errorName ?: "", items)) |
| | | val ids = taskTypeId?.split(", ") ?: emptyList() |
| | | categories.forEach { it -> |
| | | it.items.forEach { |
| | | categories.forEach { category -> |
| | | category.items.forEach { |
| | | it.isSelected = ids.contains(it.id.toString()) |
| | | } |
| | | } |