From d59d55575d913646b7a90fca651904ab889c6723 Mon Sep 17 00:00:00 2001
From: riku <risaku@163.com>
Date: 星期五, 18 二月 2022 16:30:53 +0800
Subject: [PATCH] ### 一、任务模块相关

---
 app/src/main/java/cn/flightfeather/thirdappmodule/module/task/TaskViewModel.kt |   34 ++++++++++++++++------------------
 1 files changed, 16 insertions(+), 18 deletions(-)

diff --git a/app/src/main/java/cn/flightfeather/thirdappmodule/module/task/TaskViewModel.kt b/app/src/main/java/cn/flightfeather/thirdappmodule/module/task/TaskViewModel.kt
index fea06d2..3970da3 100644
--- a/app/src/main/java/cn/flightfeather/thirdappmodule/module/task/TaskViewModel.kt
+++ b/app/src/main/java/cn/flightfeather/thirdappmodule/module/task/TaskViewModel.kt
@@ -1,24 +1,17 @@
 package cn.flightfeather.thirdappmodule.module.task
 
 import android.arch.lifecycle.MutableLiveData
-import android.widget.Toast
 import cn.flightfeather.thirdappmodule.bean.entity.Domainitem
 import cn.flightfeather.thirdappmodule.bean.entity.Subtask
 import cn.flightfeather.thirdappmodule.bean.vo.ProblemDetailVo
 import cn.flightfeather.thirdappmodule.bean.vo.TaskVo
 import cn.flightfeather.thirdappmodule.common.net.ResultCallBack
-import cn.flightfeather.thirdappmodule.httpservice.SubTaskService
-import cn.flightfeather.thirdappmodule.httpservice.TaskService
 import cn.flightfeather.thirdappmodule.module.base.BaseViewModel
 import cn.flightfeather.thirdappmodule.repository.ProblemRepository
 import cn.flightfeather.thirdappmodule.repository.SubTaskRepository
 import cn.flightfeather.thirdappmodule.repository.TaskRepository
 import cn.flightfeather.thirdappmodule.util.Constant
 import cn.flightfeather.thirdappmodule.util.DateFormatter
-import cn.flightfeather.thirdappmodule.util.Domain
-import cn.flightfeather.thirdappmodule.util.UUIDGenerator
-import com.ping.greendao.gen.ScenseDao
-import okhttp3.ResponseBody
 import java.util.*
 import kotlin.collections.ArrayList
 
@@ -35,20 +28,25 @@
     private val taskRepository = TaskRepository()
     private val subTaskRepository = SubTaskRepository()
     private val problemRepository = ProblemRepository()
+    private val allTopTaskList = ArrayList<TaskVo>()// 绯荤粺涓墍鏈夋�讳换鍔�
+    private val problemMap = mutableMapOf<String, MutableList<String>>()// 闂绫诲瀷涓庡叿浣撻棶棰�
 
+    /**涓存椂浠诲姟鍔熻兘涓庝换鍔′俊鎭鍑哄姛鑳�***************************************************************************/
+    // 鎬讳换鍔$被鍨�
     val allTaskTypeList = MutableLiveData<ArrayList<Domainitem>>().apply { value = ArrayList() }
-
+    // 褰撳墠绛涢�夋潯浠朵笅鐨勬�讳换鍔�
     val topTaskList = MutableLiveData<ArrayList<TaskVo>>().apply { value = ArrayList() }
-
-    val allTopTaskList = ArrayList<TaskVo>()
-
+    // 闂绫诲瀷
     val problemTypeList = MutableLiveData<ArrayList<String>>().apply { value = ArrayList() }
-
+    // 鍏蜂綋闂
     val problemDetailList = MutableLiveData<ArrayList<String>>().apply { value = ArrayList() }
+    // 瀛愪换鍔d涓庡悕绉�
+    val subTaskNameList = MutableLiveData<ArrayList<Pair<String, String>>>().apply { value = ArrayList() }
+    /***********************************************************************************************************/
 
-    val problemMap = mutableMapOf<String, MutableList<String>>()
-
-    val subTaskList = MutableLiveData<ArrayList<Pair<String, String>>>().apply { value = ArrayList() }
+    /**浠诲姟鍒惰銆佷换鍔℃彁閱掔浉鍏�***********************************************************************************/
+    
+    /***********************************************************************************************************/
 
     fun getTaskType() {
         taskRepository.getTaskType(object : ResultCallBack<List<Domainitem>> {
@@ -176,11 +174,11 @@
         subTaskRepository.getByTopTaskAndDate(topTaskId,startTime,endTime, object : ResultCallBack<List<Subtask>> {
             override fun onSuccess(result: List<Subtask>?) {
                 result?.let {
-                    subTaskList.value?.clear()
+                    subTaskNameList.value?.clear()
                     it.forEach {s ->
-                        subTaskList.value?.add(Pair(s.stguid, s.name))
+                        subTaskNameList.value?.add(Pair(s.stguid, s.name))
                     }
-                    subTaskList.value = subTaskList.value
+                    subTaskNameList.value = subTaskNameList.value
                 }
             }
 

--
Gitblit v1.9.3