package com.wd.workoffice.ui.adapter;


import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.wd.workoffice.R;
import com.wd.workoffice.bean.vo.DeviceRepairVo;

import java.util.List;

/**
 * Created by flexible on 2018/8/13.
 */

public class DeviceRepairProductAdapter extends BaseQuickAdapter<DeviceRepairVo, BaseViewHolder> {
    int type;// 0 有删除  1无删除， 确认页面

    public DeviceRepairProductAdapter(int layoutResId, List data, int type) {
        super(layoutResId, data);
        this.type = type;
    }


    @Override
    protected void convert(BaseViewHolder helper, DeviceRepairVo item) {
        helper.setText(R.id.tv_component_name, item.getAmount());
        helper.setText(R.id.tv_spare_parts_name, item.getReplaceSparePartName());
        helper.setText(R.id.tv_machine_name, item.getEquipmentName());
        helper.addOnClickListener(R.id.tv_delete);
        if (type == 1) {
            helper.setGone(R.id.tv_delete, false);
        }
    }
}

