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() {
|
|
}
|
|
}
|