|
|
@@ -93,9 +93,14 @@ typedef enum {
|
|
|
[self loadData];
|
|
|
}
|
|
|
|
|
|
- if (self.mode == HomeModeKPI && self.KPIArray.count) {
|
|
|
- NSString *str = [NSString stringWithFormat:@"%ld / %ld",self.currentKPI,self.KPIArray.count - 2];
|
|
|
- self.parentViewController.title = str;
|
|
|
+ if (self.mode == HomeModeKPI) {
|
|
|
+ if (self.KPIArray.count) {
|
|
|
+ NSString *str = [NSString stringWithFormat:@"%ld / %ld",self.currentKPI,self.KPIArray.count];
|
|
|
+ self.parentViewController.title = str;
|
|
|
+ } else {
|
|
|
+ [self loadKPIData];
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
}
|
|
|
@@ -311,6 +316,9 @@ typedef enum {
|
|
|
|
|
|
[self.KPITableView reloadData];
|
|
|
|
|
|
+ NSString *str = [NSString stringWithFormat:@"%ld / %ld",self.currentKPI,self.KPIArray.count];
|
|
|
+ self.parentViewController.title = str;
|
|
|
+
|
|
|
} else {
|
|
|
NSString *msg = [json objectForKey:@"err_msg"];
|
|
|
[RAUtils message_alert:msg title:@"Warning" controller:weakSelf];
|
|
|
@@ -352,7 +360,7 @@ typedef enum {
|
|
|
if (self.KPIArray.count == 0) {
|
|
|
[self loadKPIData];
|
|
|
} else {
|
|
|
- NSString *str = [NSString stringWithFormat:@"%ld / %ld",self.currentKPI,self.KPIArray.count - 2];
|
|
|
+ NSString *str = [NSString stringWithFormat:@"%ld / %ld",self.currentKPI,self.KPIArray.count];
|
|
|
self.parentViewController.title = str;
|
|
|
}
|
|
|
|
|
|
@@ -618,8 +626,12 @@ typedef enum {
|
|
|
cur = index;
|
|
|
}
|
|
|
self.currentKPI = cur;
|
|
|
- NSString *str = [NSString stringWithFormat:@"%ld / %ld",self.currentKPI,self.KPIArray.count];
|
|
|
- self.parentViewController.title = str;
|
|
|
+ if (self.currentKPI > 0) {
|
|
|
+ NSString *str = [NSString stringWithFormat:@"%ld / %ld",self.currentKPI,self.KPIArray.count];
|
|
|
+ self.parentViewController.title = str;
|
|
|
+ } else {
|
|
|
+ self.currentKPI = 1;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|