| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586 |
- //
- // DataAnalysisVC.m
- // shiku_im
- //
- // Created by huangyp-pc on 16/7/14.
- // Copyright © 2016年 Reese. All rights reserved.
- //
- #import "DataAnalysisVC.h"
- #import "DataChartVC.h"
- @interface DataAnalysisVC ()<UITableViewDelegate,UITableViewDataSource>
- @property(nonatomic,strong)UITableView *tableView;
- @property(nonatomic,strong)NSArray *titleArr;
- @end
- @implementation DataAnalysisVC
- - (void)viewDidLoad {
- [super viewDidLoad];
- // Do any additional setup after loading the view.
-
- self.title = @"数据分析";
-
- _tableView = [[UITableView alloc]initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT)];
- _tableView.delegate = self;
- _tableView.dataSource = self;
- _tableView.rowHeight = 80;
- [self.view addSubview: _tableView];
-
- UIView *v = [[UIView alloc] initWithFrame:CGRectZero];
- v.backgroundColor = [UIColor whiteColor];
- _tableView.tableFooterView = v;
-
- _titleArr = @[@"毛利润分析表(按业务员)",@"毛利润分析表(按事业部)",@"毛利润分析表(按品牌)"];
- }
- #pragma mark -- UITableView Delegate / DataSoure
- -(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
- {
- return _titleArr.count;
- }
- -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
- {
- static NSString *cellID = @"cellID";
- UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID];
- if (cell == nil)
- {
-
- cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellID];
-
- }
-
- cell.textLabel.text = [NSString stringWithFormat:@"%@", _titleArr[indexPath.row]];
- cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
- cell.selectionStyle = UITableViewCellSelectionStyleNone;
- cell.imageView.image = [UIImage imageNamed:@"icon_write_bule"];
-
- return cell;
-
-
- }
- -(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
- {
- DataChartVC *dataChartVC = [[DataChartVC alloc]init];
- dataChartVC.title = _titleArr[indexPath.row];
- [self.navigationController pushViewController:dataChartVC animated:YES];
- }
- -(void)viewWillAppear:(BOOL)animated
- {
- [[NSNotificationCenter defaultCenter] postNotificationName:@"hideBottomView" object:nil];
- }
- - (void)didReceiveMemoryWarning {
- [super didReceiveMemoryWarning];
- // Dispose of any resources that can be recreated.
- }
- @end
|