package com.lukouguoji.gjj.holder

import android.view.View
import com.lukouguoji.gjj.databinding.ItemIntImpQueryBinding
import com.lukouguoji.module_base.base.BaseViewHolder
import com.lukouguoji.module_base.bean.IntImpQueryBean

/**
 * 国际进港查询列表ViewHolder
 */
class IntImpQueryViewHolder(view: View) :
    BaseViewHolder<IntImpQueryBean, ItemIntImpQueryBinding>(view) {

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

        // 注册整行点击事件
        notifyItemClick(position, binding.ll)

        // 侧滑菜单 - 修改按钮（平板变体独有；手机变体无侧滑编辑入口，字段为 null）
        binding.btnEdit?.setOnClickListener {
            binding.swipeMenu?.quickClose()
            clickListener?.onItemClick(position, 2000)  // type=2000表示修改操作
        }
    }
}
