//
//  Cell_OrderCreatItemCodeHeader.swift
//  VattiCSS
//
//  Created by Jan on 2023/8/29.
//

import UIKit

class Cell_OrderCreatItemCodeHeader: UITableViewCell {
    //是否一体
    @IBOutlet weak var lab_titlte: UILabel!
    
    @IBOutlet weak var yiTiLabel: UILabel!
    @IBOutlet weak var isYitiBtn: UIButton!
    @IBOutlet weak var noYitiBtn: UIButton!
    @IBOutlet weak var scanProductBtn: UIButton!
    
    var callBack: TCRowCallBack?
    override func awakeFromNib() {
        super.awakeFromNib()
        //之前亿田 做的
        yiTiLabel.isHidden = true
        isYitiBtn.isHidden = true
        noYitiBtn.isHidden = true
        
        lab_titlte.text = "机器条码:".languageString()
        scanProductBtn.setTitle("识别产品".languageString(), for: .normal)
    }
    
    @IBAction func checkAction(_ sender: UIButton) {
        callBack?("")
    }
    

    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

        // Configure the view for the selected state
    }
    
}


extension Cell_OrderCreatItemCodeHeader: TCCell_RowCellUpdateProtocol {

    typealias DataSource = (String)
    typealias ConfigModel = TCFormCellConfigModel
    
    func row_update(callBack block: TCRowCallBack?) {
        callBack = block
    }
    
    func row_update(config data: TCFormCellConfigModel) {
      
    }
    
    func row_update(dataSource data: (String)) {
       let usertype = data
        if usertype == "0" {
            self.isYitiBtn.setImage(UIImage.init(named: "hep_radiobox_selected"), for: .normal)
            self.noYitiBtn.setImage(UIImage.init(named: "hep_radiobox_normal"), for: .normal)
        }else{
            self.noYitiBtn.setImage(UIImage.init(named: "hep_radiobox_selected"), for: .normal)
            self.isYitiBtn.setImage(UIImage.init(named: "hep_radiobox_normal"), for: .normal)
        }
    }
    
}
