You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

45 lines
1.1 KiB

package com.gyf.csams.main.model
import android.app.Application
import androidx.lifecycle.viewModelScope
import com.gyf.csams.R
import com.gyf.lib.model.ScrollViewModel
import com.gyf.lib.uikit.StringForm
import com.gyf.lib.util.RenameVo
import com.gyf.lib.util.randomChinese
import com.gyf.lib.util.randomNum
import kotlinx.coroutines.launch
class RenameViewModel(application: Application) : ScrollViewModel<RenameVo>(application) {
val approverOrigin =
StringForm(
formDesc = application.getString(R.string.first_approver_origin),
textLength = 30
)
override val initSize: Int = 10
init {
load()
}
fun load() {
viewModelScope.launch {
_data.value?.apply {
repeat(initSize) {
add(
RenameVo(
studentId = randomNum(8),
oldName = randomChinese(5),
newName = randomChinese(5),
reason = randomChinese(10)
)
)
}
}
}
}
}