添加了界面及逻辑

This commit is contained in:
zxj
2025-07-18 17:16:00 +08:00
parent b68c967d82
commit f97ef151c3
74 changed files with 3108 additions and 34 deletions
@@ -0,0 +1,21 @@
package com.sw.platecabinet.viewmodel
import com.sw.platecabinet.model.request.EquipmentParam
import com.sw.platecabinet.model.response.EquipmentUserInfo
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.StateFlow
class SettingViewModel : BaseViewModel() {
// 设备绑定列表
private val _equipmentList = MutableStateFlow<List<EquipmentUserInfo>>(emptyList())
val equipmentList: StateFlow<List<EquipmentUserInfo>> = _equipmentList
fun getEquipmentList(param: EquipmentParam) {
launchWithLoading {
val response = repository.getEquipmentList(param)
if (parseResponse(response)) {
_equipmentList.value = response.data ?: emptyList()
}
}
}
}