package com.lukouguoji.gnc.page.distribution.home.dialog

import android.content.Context
import android.view.View
import android.widget.TextView
import androidx.lifecycle.MutableLiveData
import com.lukouguoji.gnc.R
import com.lukouguoji.gnc.databinding.DialogDistributionFilterBinding
import com.lukouguoji.module_base.base.BaseDialogModel
import dev.utils.app.info.KeyValue

class GncDistributionFilterDialogModel(
    private val callBack: () -> Unit
) : BaseDialogModel<DialogDistributionFilterBinding>(DIALOG_TYPE_FULL) {

    // 司机
    val driver = MutableLiveData("")

    // 司机列表
    val driverList = MutableLiveData<List<KeyValue>>(listOf(KeyValue("司机", "0")))


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

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

        binding.root.findViewById<View>(R.id.tool_back).setOnClickListener { dismiss() }
        binding.root.findViewById<TextView>(R.id.title_name).text = "搜索"
    }

    fun onResetClick() {
        binding.psl.reset()
    }

    fun onConfirmClick() {
        dismiss()
        callBack()
    }
}