DataAnalysisVC.m 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. //
  2. // DataAnalysisVC.m
  3. // shiku_im
  4. //
  5. // Created by huangyp-pc on 16/7/14.
  6. // Copyright © 2016年 Reese. All rights reserved.
  7. //
  8. #import "DataAnalysisVC.h"
  9. #import "DataChartVC.h"
  10. @interface DataAnalysisVC ()<UITableViewDelegate,UITableViewDataSource>
  11. @property(nonatomic,strong)UITableView *tableView;
  12. @property(nonatomic,strong)NSArray *titleArr;
  13. @end
  14. @implementation DataAnalysisVC
  15. - (void)viewDidLoad {
  16. [super viewDidLoad];
  17. // Do any additional setup after loading the view.
  18. self.title = @"数据分析";
  19. _tableView = [[UITableView alloc]initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT)];
  20. _tableView.delegate = self;
  21. _tableView.dataSource = self;
  22. _tableView.rowHeight = 80;
  23. [self.view addSubview: _tableView];
  24. UIView *v = [[UIView alloc] initWithFrame:CGRectZero];
  25. v.backgroundColor = [UIColor whiteColor];
  26. _tableView.tableFooterView = v;
  27. _titleArr = @[@"毛利润分析表(按业务员)",@"毛利润分析表(按事业部)",@"毛利润分析表(按品牌)"];
  28. }
  29. #pragma mark -- UITableView Delegate / DataSoure
  30. -(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
  31. {
  32. return _titleArr.count;
  33. }
  34. -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
  35. {
  36. static NSString *cellID = @"cellID";
  37. UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID];
  38. if (cell == nil)
  39. {
  40. cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellID];
  41. }
  42. cell.textLabel.text = [NSString stringWithFormat:@"%@", _titleArr[indexPath.row]];
  43. cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
  44. cell.selectionStyle = UITableViewCellSelectionStyleNone;
  45. cell.imageView.image = [UIImage imageNamed:@"icon_write_bule"];
  46. return cell;
  47. }
  48. -(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
  49. {
  50. DataChartVC *dataChartVC = [[DataChartVC alloc]init];
  51. dataChartVC.title = _titleArr[indexPath.row];
  52. [self.navigationController pushViewController:dataChartVC animated:YES];
  53. }
  54. -(void)viewWillAppear:(BOOL)animated
  55. {
  56. [[NSNotificationCenter defaultCenter] postNotificationName:@"hideBottomView" object:nil];
  57. }
  58. - (void)didReceiveMemoryWarning {
  59. [super didReceiveMemoryWarning];
  60. // Dispose of any resources that can be recreated.
  61. }
  62. @end