//
//  AutonomousCompanyVC.swift
//  MobilePortal
//
//  Created by caiyang on 2020/4/26.
//  Copyright © 2020 yin chen. All rights reserved.
//

import UIKit

class AutonomousCompanyVC: BaseViewController {

    lazy var myTableView: UITableView = {
        let myTableView = UITableView.init()
        if #available(iOS 11.0, *) {
            myTableView.contentInsetAdjustmentBehavior = .never
            myTableView.scrollIndicatorInsets = myTableView.contentInset
            myTableView.contentInset = UIEdgeInsetsMake(UIApplication.shared.statusBarFrame.size.height+44, 0, 0, 0)
        }else{
            myTableView.contentInset = UIEdgeInsetsMake(0, 0, 0, 0)
        }
        registerCell(myTableView, cell: AutonomousCompanyTableViewCell.self)
        //        myTableView.separatorStyle = .none
        myTableView.backgroundColor = UIColorFromRGB(rgbValue: 0xF4F9FD)
        setExtraCellLineHidden(tableView: myTableView)
        return myTableView
    }()
    var dataSource:NSMutableArray!
    var delegate:MineInfoViewControllerDelegate!
    var model:ApplicationHttpListModel!
    var block:passParameterBlock!
    var companyArray = NSMutableArray()
    
    override func viewDidLoad() {
        super.viewDidLoad()
        initTitleBar()
        self.title = "选择公司"
        self.dataSource = NSMutableArray()
        self.companyArray = NSMutableArray()
        addInitTableView()
        actionHttpGCD()
        // Do any additional setup after loading the view.
    }
    func actionHttpGCD(){
        showHintView()
        queue.async(group: group, execute: {[weak self] in
            self?.group.enter()
            self?.getAutonomousHttpPostCmd()
        })
        group.notify(queue: DispatchQueue.main) {[weak self] in
            self?.delegate.dataSource = self?.dataSource
            self?.myTableView.delegate = self?.delegate
            self?.myTableView.dataSource = self?.delegate
            self?.myTableView.reloadData()
            self?.hidenHintView()
        }
    }

}
