riku
2025-10-27 0f58aa8ea118c3bd0b28396febc58fdbd94eef75
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
package cn.flightfeather.thirdappmodule.module.inspection
 
import android.arch.lifecycle.MutableLiveData
import cn.flightfeather.thirdappmodule.bean.entity.Evaluation
import cn.flightfeather.thirdappmodule.bean.vo.ChangeRateVo
import cn.flightfeather.thirdappmodule.bean.vo.TypicalSceneVo
import cn.flightfeather.thirdappmodule.common.net.ResultCallBack
import cn.flightfeather.thirdappmodule.module.base.BaseViewModel
import cn.flightfeather.thirdappmodule.repository.EvaluationRepository
import org.jetbrains.anko.toast
 
/**
 * @author riku
 * Date: 2025/10/27
 */
class MenuSceneHistoryViewModel : BaseViewModel() {
    private val evaluationRepository = EvaluationRepository.instance
 
    // 1. 历史评估情况
    val evaluationList = MutableLiveData<List<Evaluation>>()
 
    /**
     * 获取前三个月的评估总分
     */
    fun getEvaluationList(sceneId:String) {
        evaluationRepository.getEvaluationByScene(sceneId, resultCallBack = object : ResultCallBack<List<Evaluation>> {
            override fun onSuccess(result: List<Evaluation>?) {
                evaluationList.value = result
            }
 
            override fun onFailure() {
                application.toast("获取评分失败")
            }
        })
    }
 
    // 2. 典型工地情况
    val typicalScene = MutableLiveData<List<TypicalSceneVo>>()
 
    fun getTypicalScene(sceneId: String) {
        typicalScene.value = listOf()
    }
 
    // 3. 整改效率
    val changeRate = MutableLiveData<List<ChangeRateVo>>()
    fun getChangeRate() {
 
    }
 
}