package com.lukouguoji.gjj.holder

import android.view.View
import com.lukouguoji.gjj.databinding.ItemIntArrAirManifestSubBinding
import com.lukouguoji.module_base.base.BaseViewHolder
import com.lukouguoji.module_base.bean.GjjImportManifest

/**
 * 国际进港原始舱单 - 分单子列表 ViewHolder
 */
class IntArrAirManifestSubViewHolder(view: View) :
    BaseViewHolder<GjjImportManifest, ItemIntArrAirManifestSubBinding>(view) {

    override fun onBind(item: Any?, position: Int) {
        val bean = getItemBean(item) ?: return
        binding.bean = bean
        binding.position = position
        binding.executePendingBindings()

        // 单选框点击切换选择状态（独立选择，不联动主列表）
        binding.ivCheckbox.setOnClickListener {
            bean.checked.set(!bean.checked.get())
            binding.executePendingBindings()
        }
    }
}
