package com.wd.workoffice.ui.activity.mes.analysis;

import android.os.Bundle;
import android.view.View;
import android.widget.LinearLayout;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.wd.workoffice.R;
import com.wd.workoffice.app.WorkBaseActivity;
import com.wd.workoffice.app.WorkToolBarActivity;
import com.wd.workoffice.ui.activity.mes.report.MesReportDetailActivity;
import com.wd.workoffice.ui.adapter.ReportAnalysisBadAdapter;
import com.wd.workoffice.ui.adapter.ReportBadAdapter;
import com.wd.workoffice.ui.adapter.ReportProBadAdapter;
import com.wd.workoffice.ui.adapter.ReportTopAdapter;

import java.util.ArrayList;
import java.util.List;

import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import butterknife.BindView;
import butterknife.ButterKnife;

/**
 * author : flexible
 * email : lgd19940421@163.com
 * github: https://github.com/FlexibleXd
 **/
public class MesAnalysisActivity extends WorkToolBarActivity {
    @BindView(R.id.rv_top)
    RecyclerView rvTop;
    @BindView(R.id.rv_pro_bad)
    RecyclerView rvProBad;
    @BindView(R.id.ll_report)
    LinearLayout llReport;

    @Override
    protected void initView() {
        ButterKnife.bind(this);
        rvProBad.setLayoutManager(new LinearLayoutManager(this, RecyclerView.VERTICAL, false));
        rvTop.setLayoutManager(new LinearLayoutManager(this, RecyclerView.VERTICAL, false));
    }


    @Override
    protected void initData() {
        List<Object> topList = new ArrayList<>();
        topList.add(null);
        topList.add(null);
        topList.add(null);
        List<Object> proBadList = new ArrayList<>();
        proBadList.add(null);
        proBadList.add(null);
        proBadList.add(null);
        ReportTopAdapter topAdapter = new ReportTopAdapter(R.layout.item_mes_report_top, topList);
        ReportAnalysisBadAdapter proBadAdapter = new ReportAnalysisBadAdapter(R.layout.item_mes_analysis, proBadList);
        topAdapter.bindToRecyclerView(rvTop);
        proBadAdapter.bindToRecyclerView(rvProBad);
    }

//    private void getData() {
//        RtfUtils.getMesRtf().searchList("1", WorkUtils.convertMapToBody(param)).compose(Transformer.schedule()).subscribe(new WorkObserver<BaseMesBean>() {
//            @Override
//            public void doOnSubscribe(Disposable d) {
//            }
//
//            @Override
//            public void onFail(String errorMsg) {
//                hideLoading();
//                toast(errorMsg);
//            }
//
//            @Override
//            public void onSuccess(BaseMesBean data) {
//                hideLoading();
//                if (!data.isSuccess()) {
//                    toast(data.getMsg());
//                    return;
//                }
//                List<SearchBean.ListBean> getList = JSON.parseObject(data.getData().toString(), SearchBean.class).getList();
//                if (page == 1) {
//                    srlRefresh.finishRefresh();
//                    dataList.clear();
//                    dataList.addAll(getList);
//                    dataAdapter.notifyDataSetChanged();
//                    dataAdapter.loadMoreComplete();
//                } else {
//                    dataAdapter.loadMoreComplete();
//                    dataList.addAll(getList);
//                    dataAdapter.notifyDataSetChanged();
//                }
//                if (getList.size() == 0) {
//                    dataAdapter.loadMoreEnd();
//                } else {
//                    page++;
//                }
//            }
//        }); }


    @Override
    protected void initEvent() {
    }

    @Override
    protected int layoutId() {
        return R.layout.activity_mes_analysis;
    }

}
