123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126 |
- import UIKit
- class BusinessMainViewController: BaseViewController, UITableViewDelegate, UITableViewDataSource {
- @IBOutlet weak var tableView: UITableView!
- let dataList: Array = {
- return [["团队业绩", "个人业绩"]]
- }()
- override func viewWillAppear(_ animated: Bool) {
- super.viewWillAppear(animated)
- appDelegate.setNavigationBarHidden(isHidden: false)
- }
- override func viewDidLoad() {
- super.viewDidLoad()
- initNavLeftBackButton()
- self.title = "业绩管理"
- tableView.frame = self.view.bounds
- tableView.tableFooterView = UIView.init()
- tableView.delegate = self
- tableView.dataSource = self
- self.view.addSubview(tableView)
- loadData()
- }
-
- func loadData() {
- let url = RequestURL.sumCountByMonthByDay
- let param = NSMutableDictionary()
- param.setValue(CommonValue.getUserId(), forKey: "userId")
- loadDataInfo(url: url, params: param, tag: 1001)
- }
- override func returnData(tag: Int) {
- NSLog("\(dicData)")
- }
- override func returnError(tag: Int, type: String) {
- }
-
- func numberOfSections(in tableView: UITableView) -> Int {
- return dataList.count
- }
- func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
- return dataList[section].count
- }
- func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
- return 60
- }
- func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
- let view = UIView.init()
- view.backgroundColor = UIColor.init(white: 242/255.0, alpha: 1.0)
- return view
- }
- func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
- if section == 0 {
- return 0.001
- }
- return 10
- }
- func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
- let cellId = "businessCellId"
- var cell = tableView.dequeueReusableCell(withIdentifier: cellId)
- if cell == nil {
- cell = UITableViewCell.init(style: .default, reuseIdentifier: cellId)
- let imgV = UIImageView.init(image: UIImage.init(named: "ion_arrow_right_gray"))
- cell?.accessoryView = imgV
- cell?.selectionStyle = .none
- cell?.textLabel?.font = UIFont.systemFont(ofSize: 15)
- }
- cell?.textLabel?.text = dataList[indexPath.section][indexPath.row]
- return cell!
- }
- func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
- let vc = AchiveViewController()
- vc.teamStr = "\(indexPath.row)"
- self.navigationController?.pushViewController(vc, animated: true)
- }
-
- }
|