package com.lukouguoji.gjj.activity

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import com.alibaba.android.arouter.facade.annotation.Route
import com.lukouguoji.gjj.R
import com.lukouguoji.gjj.databinding.ActivityGjjPacketParseBinding
import com.lukouguoji.gjj.viewModel.GjjPacketParseViewModel
import com.lukouguoji.module_base.BaseActivity
import com.lukouguoji.module_base.base.BaseBindingActivity
import com.lukouguoji.module_base.ktx.addOnItemClickListener
import com.lukouguoji.module_base.router.ARouterConstants

@Route(path = ARouterConstants.ACTIVITY_URL_GJJ_PACKET_PARSE)
class GjjPacketParseActivity :
    BaseBindingActivity<ActivityGjjPacketParseBinding, GjjPacketParseViewModel>() {

    override fun layoutId() = R.layout.activity_gjj_packet_parse

    override fun viewModelClass() = GjjPacketParseViewModel::class.java

    override fun initOnCreate(savedInstanceState: Bundle?) {
        setBackArrow("国际进港电报解析")
        binding.viewModel = viewModel

        viewModel.pageModel.bindSmartRefreshLayout(binding.srl, binding.rv, viewModel, this)
        binding.rv.addOnItemClickListener(viewModel)

        viewModel.flightNo.observe(this) {
            viewModel.getDepartureDictList()
        }

        viewModel.init(requireContext())
    }

}