package com.lukouguoji.module_base.model

import android.content.Context
import androidx.lifecycle.MutableLiveData
import com.lukouguoji.module_base.R
import com.lukouguoji.module_base.base.BaseDialogModel
import com.lukouguoji.module_base.databinding.DialogGoodsTransportReturnBinding
import com.lukouguoji.module_base.ktx.verifyNullOrEmpty
import dev.utils.app.info.KeyValue

class GoodsTransportReturnDialogModel(
    val carList: String,
    val callBack: (GoodsTransportReturnDialogModel) -> Unit
) : BaseDialogModel<DialogGoodsTransportReturnBinding>(
    DIALOG_TYPE_CENTER
) {

    val data = MutableLiveData("")

    val list = listOf(
        KeyValue("机坪流转", "0"),
        KeyValue("进港仓库", "1"),
        KeyValue("出港仓库", "2"),
    )

    override fun layoutId(): Int {
        return R.layout.dialog_goods_transport_return
    }

    override fun onDialogCreated(context: Context) {
        binding.model = this
    }

    fun onConfirmClick() {
        if (data.value.verifyNullOrEmpty("请选择退回方向")) {
            return
        }
        dismiss()
        callBack(this)
    }
}