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.DialogGoodsTransportBinding
import com.lukouguoji.module_base.ktx.verifyNullOrEmpty

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

    val data = MutableLiveData("")

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

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

    fun onConfirmClick() {
        if (data.value.verifyNullOrEmpty("请输入机位")) {
            return
        }
        dismiss()
        callBack(this)
    }
}