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.
59 lines
1.4 KiB
59 lines
1.4 KiB
package com.gyf.csams.main.model
|
|
|
|
import android.app.Application
|
|
import androidx.lifecycle.viewModelScope
|
|
import com.gyf.csams.R
|
|
import com.gyf.lib.ScrollListW
|
|
import com.gyf.lib.uikit.StringForm
|
|
import com.gyf.lib.util.randomChinese
|
|
import com.gyf.lib.util.randomNum
|
|
import kotlinx.coroutines.launch
|
|
|
|
/**
|
|
* 换名申请表
|
|
*
|
|
* @property studentId 学号
|
|
* @property oldName 社团原名
|
|
* @property newName 社团新名
|
|
* @property reason 申请理由
|
|
*/
|
|
data class RenameVo(
|
|
val studentId: String,
|
|
val oldName: String,
|
|
val newName: String,
|
|
val reason: String
|
|
)
|
|
|
|
class RenameViewModel(application: Application) : ScrollListW<RenameVo>(application) {
|
|
|
|
val approverOrigin =
|
|
StringForm(formDesc = application.getString(R.string.approver_origin), textLength = 30)
|
|
|
|
|
|
override val initSize: Int = 10
|
|
|
|
init {
|
|
load()
|
|
}
|
|
|
|
override fun load() {
|
|
viewModelScope.launch {
|
|
_data.value?.apply {
|
|
repeat(initSize) {
|
|
add(
|
|
RenameVo(
|
|
studentId = randomNum(8),
|
|
oldName = randomChinese(5),
|
|
newName = randomChinese(5),
|
|
reason = randomChinese(10)
|
|
)
|
|
)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
override fun loadMore(callback: (message: String) -> Unit) {
|
|
TODO("Not yet implemented")
|
|
}
|
|
} |