VersionDataVC.m 46 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160
  1. //
  2. // VersionDataVC.m
  3. // smartRhino
  4. //
  5. // Created by tederen on 2019/11/28.
  6. // Copyright © 2019 tederen. All rights reserved.
  7. //
  8. #import "VersionDataVC.h"
  9. #import "UILabel+RightAndLeft.h"
  10. #import "DepartureController.h"
  11. #import "NoteBookShareVC.h"
  12. @interface VersionDataVC ()<NoteBookShareVCDelegate>
  13. @property (weak, nonatomic) IBOutlet UILabel *yearMonthDaylabel;
  14. @property (strong, nonatomic) NoteBookShareVC *noteBookShareVC;
  15. #pragma mark - 财务数据 属性
  16. #pragma mark - 收入
  17. @property (weak, nonatomic) IBOutlet UIView *incomeHeader;
  18. @property (weak, nonatomic) IBOutlet UILabel *incomKeyLabel;
  19. @property (weak, nonatomic) IBOutlet UILabel *incomValueLabel;
  20. @property (weak, nonatomic) IBOutlet UILabel *incomeScaleKeyLabel;
  21. @property (weak, nonatomic) IBOutlet UILabel *incomeScaleValueLabel;
  22. @property (weak, nonatomic) IBOutlet UIImageView *incomeScaleValueImage;
  23. @property (weak, nonatomic) IBOutlet UIView *incomeTableView;
  24. @property (weak, nonatomic) IBOutlet UIButton *incomeDayBtn;
  25. @property (weak, nonatomic) IBOutlet UIButton *incomeWeekBtn;
  26. @property (weak, nonatomic) IBOutlet UIButton *incomeMonthBtn;
  27. @property (weak, nonatomic) IBOutlet UIButton *incomeYearBtn;
  28. @property (nonatomic, strong) WKEchartsView *incomeEchartsView;
  29. #pragma mark - 支出
  30. @property (weak, nonatomic) IBOutlet UIView *expensesHeader;
  31. @property (weak, nonatomic) IBOutlet UILabel *expensesKeyLabel;
  32. @property (weak, nonatomic) IBOutlet UILabel *expensesValueLabel;
  33. @property (weak, nonatomic) IBOutlet UILabel *expensesScaleKeyLabel;
  34. @property (weak, nonatomic) IBOutlet UILabel *expensesScaleValueLabel;
  35. @property (weak, nonatomic) IBOutlet UIImageView *expensesScaleValueImage;
  36. @property (weak, nonatomic) IBOutlet UIView *expensesTableView;
  37. @property (weak, nonatomic) IBOutlet UIButton *expensesDayBtn;
  38. @property (weak, nonatomic) IBOutlet UIButton *expensesWeekBtn;
  39. @property (weak, nonatomic) IBOutlet UIButton *expensesMonthBtn;
  40. @property (weak, nonatomic) IBOutlet UIButton *expensesYearBtn;
  41. @property (nonatomic, strong) WKEchartsView *expensesEchartsView;
  42. #pragma mark - 利润
  43. @property (weak, nonatomic) IBOutlet UIView *profitHeader;
  44. @property (weak, nonatomic) IBOutlet UILabel *profitKeyLabel;
  45. @property (weak, nonatomic) IBOutlet UILabel *profitValueLabel;
  46. @property (weak, nonatomic) IBOutlet UILabel *profitScaleKeyLabel;
  47. @property (weak, nonatomic) IBOutlet UILabel *profitScaleValueLabel;
  48. @property (weak, nonatomic) IBOutlet UIImageView *profitScaleValueImage;
  49. @property (weak, nonatomic) IBOutlet UIView *profitTableView;
  50. @property (weak, nonatomic) IBOutlet UIButton *profitDayBtn;
  51. @property (weak, nonatomic) IBOutlet UIButton *profitWeekBtn;
  52. @property (weak, nonatomic) IBOutlet UIButton *profitMonthBtn;
  53. @property (weak, nonatomic) IBOutlet UIButton *profitYearBtn;
  54. @property (nonatomic, strong) WKEchartsView *profitEchartsView;
  55. @property (nonatomic, strong) VersionDataModel *incomeModel;
  56. @property (nonatomic, strong) VersionDataModel *expensesModel;
  57. @property (nonatomic, strong) VersionDataModel *profitModel;
  58. #pragma mark - 出版数据 属性
  59. /// 出版
  60. /// 本年累计出版册数
  61. @property (weak, nonatomic) IBOutlet UILabel *yearVersionNumberLabel;
  62. /// 本年累计印费
  63. @property (weak, nonatomic) IBOutlet UILabel *yearPrintNuberLabel;
  64. /// 月出版种类
  65. @property (weak, nonatomic) IBOutlet UILabel *monthVersionKindLabel;
  66. /// 月出版数量
  67. @property (weak, nonatomic) IBOutlet UILabel *monthVerionNumberLabel;
  68. /// 月印费
  69. @property (weak, nonatomic) IBOutlet UILabel *monthPrintNumberlael;
  70. @property (weak, nonatomic) IBOutlet UILabel *monthMoneyScaleLabel;
  71. @property (weak, nonatomic) IBOutlet UIImageView *monthPrintScaleImageView;
  72. /// 发行
  73. @property (weak, nonatomic) IBOutlet UILabel *pubilshMonthLabel;
  74. @property (weak, nonatomic) IBOutlet UILabel *publisScaleLabel;
  75. @property (weak, nonatomic) IBOutlet UIImageView *publisScaleImageView;
  76. /// 库存
  77. @property (weak, nonatomic) IBOutlet UILabel *storeLabel;
  78. @property (weak, nonatomic) IBOutlet UIImageView *storeScaleImageView;
  79. #pragma mark - 人事数据 属性
  80. ///人员工资总额
  81. @property (weak, nonatomic) IBOutlet UILabel *allPersonMoneyLabel;
  82. /// 人员工资上月同比
  83. @property (weak, nonatomic) IBOutlet UILabel *allPersonScaleValueLabel;
  84. @property (weak, nonatomic) IBOutlet UIImageView *allPersonScaleImageView;
  85. /// 入职人员工资
  86. @property (weak, nonatomic) IBOutlet UILabel *addPersonMoneyLabel;
  87. /// 入职人员工资上月同比
  88. @property (weak, nonatomic) IBOutlet UILabel *addPersonScaleValueLabel;
  89. @property (weak, nonatomic) IBOutlet UIImageView *addPersonScaleImageView;
  90. /// 离职人员工资
  91. @property (weak, nonatomic) IBOutlet UILabel *movePersonLabel;
  92. @property (weak, nonatomic) IBOutlet UIView *movePersonView;
  93. @property (nonatomic, assign) NSInteger netFlag;
  94. @end
  95. @implementation VersionDataVC
  96. - (void)viewDidLoad {
  97. [super viewDidLoad];
  98. [self.view addSubview:self.noteBookShareVC.view];
  99. self.fd_prefersNavigationBarHidden = YES;
  100. self.netFlag = 1;
  101. [self getData];
  102. [self setingUI];
  103. self.movePersonView.hidden = YES;
  104. }
  105. - (void)viewWillAppear:(BOOL)animated{
  106. [super viewWillAppear:animated];
  107. [UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleDefault;
  108. }
  109. - (void)viewWillDisappear:(BOOL)animated{
  110. [super viewWillDisappear:animated];
  111. [UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleLightContent;
  112. }
  113. - (UIStatusBarStyle)preferredStatusBarStyle{
  114. return UIStatusBarStyleLightContent;
  115. }
  116. #pragma mark - 查看离职人员详情
  117. - (IBAction)movePersonHander:(UIButton *)sender {
  118. DepartureController *departureController = [[DepartureController alloc] init];
  119. [self.navigationController pushViewController:departureController animated:YES];
  120. }
  121. - (IBAction)backButton:(UIButton *)sender {
  122. [self.navigationController popViewControllerAnimated:YES];
  123. }
  124. - (IBAction)sencondBackButton:(UIButton *)sender {
  125. [super menuAction:sender];
  126. }
  127. #pragma mark - 保存数据
  128. - (IBAction)versionDownLoadHander:(UIButton *)sender {
  129. [self shareHander];
  130. }
  131. /// 转发正文
  132. - (void)shareHander{
  133. [self.noteBookShareVC initNoteBookShareData];
  134. self.noteBookShareVC.view.hidden = !self.noteBookShareVC.view.hidden;
  135. }
  136. - (NoteBookShareVC *)noteBookShareVC{
  137. if (_noteBookShareVC == nil) {
  138. _noteBookShareVC = [NoteBookShareVC initNoteBookShareVC];
  139. [_noteBookShareVC.view setFrame:CGRectMake(0,0, SCREEN_WIDTH, SCREEN_HEIGHT)];
  140. [_noteBookShareVC.view setHidden:YES];
  141. _noteBookShareVC.delegate = self;
  142. }
  143. return _noteBookShareVC;
  144. }
  145. -(void)userSelectType:(NSString *)typeName WithIndexPath:(NSIndexPath *)indexPath{
  146. self.noteBookShareVC.view.hidden = !self.noteBookShareVC.view.hidden;
  147. if ([typeName isEqualToString:@"发给微信好友"]) {
  148. }else if ([typeName isEqualToString:@"发到朋友圈"]){
  149. }else if ([typeName isEqualToString:@"发到微博"]){
  150. }else if ([typeName isEqualToString:@"发给QQ好友"]){
  151. }else if ([typeName isEqualToString:@"发到消息"]){
  152. }else if ([typeName isEqualToString:@"发到小组"]){
  153. }else if ([typeName isEqualToString:@"发到笔记"]){
  154. }else if ([typeName isEqualToString:@"发到话题"]){
  155. }else{
  156. }
  157. }
  158. #pragma mark - 收入 点击事件
  159. - (IBAction)incomeHander:(UIButton *)sender {
  160. NSInteger date = 0;
  161. if ([[sender titleLabel].text isEqualToString:@"日"]) {
  162. self.incomeDayBtn.selected = YES;
  163. self.incomeWeekBtn.selected = NO;
  164. self.incomeMonthBtn.selected = NO;
  165. self.incomeYearBtn.selected = NO;
  166. date = 1;
  167. }
  168. if ([[sender titleLabel].text isEqualToString:@"周"]) {
  169. self.incomeDayBtn.selected = NO;
  170. self.incomeWeekBtn.selected = YES;
  171. self.incomeMonthBtn.selected = NO;
  172. self.incomeYearBtn.selected = NO;
  173. date = 2;
  174. }
  175. if ([[sender titleLabel].text isEqualToString:@"月"]) {
  176. self.incomeDayBtn.selected = NO;
  177. self.incomeWeekBtn.selected = NO;
  178. self.incomeMonthBtn.selected = YES;
  179. self.incomeYearBtn.selected = NO;
  180. date = 3;
  181. }
  182. if ([[sender titleLabel].text isEqualToString:@"年"]) {
  183. self.incomeDayBtn.selected = NO;
  184. self.incomeWeekBtn.selected = NO;
  185. self.incomeMonthBtn.selected = NO;
  186. self.incomeYearBtn.selected = YES;
  187. date = 4;
  188. }
  189. SHOWLOADING
  190. switch (self.pageType) {
  191. case 1:{
  192. [VersionDataVC getDataWithDataType:2 withDateType:date success:^(id _Nonnull responseObject) {
  193. self.incomeModel = [[VersionDataModel alloc]initWithDictionary:responseObject error:nil];
  194. NSLog(@"收入%@",self.incomeModel);
  195. REMOVESHOW
  196. [self updateIncomeView:self.incomeModel];
  197. } failure:^(NSError * _Nonnull error) {
  198. SHOWERROR([ZYCTool handerResultData:error])
  199. }];
  200. }break;
  201. case 2:{
  202. [VersionDataVC getDataWithVersisonType:1 withDateType:date success:^(id _Nonnull responseObject) {
  203. self.incomeModel = [[VersionDataModel alloc]initWithDictionary:responseObject error:nil];
  204. NSLog(@"收入%@",self.incomeModel);
  205. REMOVESHOW
  206. [self updateIncomeView:self.incomeModel];
  207. } failure:^(NSError * _Nonnull error) {
  208. SHOWERROR([ZYCTool handerResultData:error])
  209. }];
  210. }break;
  211. case 3:{
  212. [VersionDataVC getDataWithHumanType:1 withDateType:date success:^(id _Nonnull responseObject) {
  213. self.incomeModel = [[VersionDataModel alloc]initWithDictionary:responseObject error:nil];
  214. NSLog(@"人事%@",self.incomeModel);
  215. REMOVESHOW
  216. [self updateIncomeView:self.incomeModel];
  217. } failure:^(NSError * _Nonnull error) {
  218. SHOWERROR([ZYCTool handerResultData:error])
  219. }];
  220. }break;
  221. default:
  222. break;
  223. }
  224. }
  225. #pragma mark - 支出 点击事件
  226. - (IBAction)expensesHander:(UIButton *)sender {
  227. NSInteger date = 0;
  228. if ([[sender titleLabel].text isEqualToString:@"日"]) {
  229. self.expensesDayBtn.selected = YES;
  230. self.expensesWeekBtn.selected = NO;
  231. self.expensesMonthBtn.selected = NO;
  232. self.expensesYearBtn.selected = NO;
  233. date = 1;
  234. }
  235. if ([[sender titleLabel].text isEqualToString:@"周"]) {
  236. self.expensesDayBtn.selected = NO;
  237. self.expensesWeekBtn.selected = YES;
  238. self.expensesMonthBtn.selected = NO;
  239. self.expensesYearBtn.selected = NO;
  240. date = 2;
  241. }
  242. if ([[sender titleLabel].text isEqualToString:@"月"]) {
  243. self.expensesDayBtn.selected = NO;
  244. self.expensesWeekBtn.selected = NO;
  245. self.expensesMonthBtn.selected = YES;
  246. self.expensesYearBtn.selected = NO;
  247. date = 3;
  248. }
  249. if ([[sender titleLabel].text isEqualToString:@"年"]) {
  250. self.expensesDayBtn.selected = NO;
  251. self.expensesWeekBtn.selected = NO;
  252. self.expensesMonthBtn.selected = NO;
  253. self.expensesYearBtn.selected = YES;
  254. date = 4;
  255. }
  256. SHOWLOADING
  257. switch (self.pageType) {
  258. case 2:
  259. {
  260. [VersionDataVC getDataWithDataType:2 withDateType:date success:^(id _Nonnull responseObject) {
  261. self.expensesModel = [[VersionDataModel alloc]initWithDictionary:responseObject error:nil];
  262. NSLog(@"支出%@",self.expensesModel);
  263. REMOVESHOW
  264. [self updateExpensesView:self.expensesModel];
  265. } failure:^(NSError * _Nonnull error) {
  266. SHOWERROR([ZYCTool handerResultData:error])
  267. }];
  268. }break;
  269. case 1:{
  270. [VersionDataVC getDataWithPublishType:2 withDateType:date success:^(id _Nonnull responseObject) {
  271. self.expensesModel = [[VersionDataModel alloc]initWithDictionary:responseObject error:nil];
  272. NSLog(@"支出%@",self.expensesModel);
  273. REMOVESHOW
  274. [self updateExpensesView:self.expensesModel];
  275. } failure:^(NSError * _Nonnull error) {
  276. SHOWERROR([ZYCTool handerResultData:error])
  277. }];
  278. }break;
  279. case 3:{
  280. [VersionDataVC getDataWithHumanType:2 withDateType:date success:^(id _Nonnull responseObject) {
  281. self.expensesModel = [[VersionDataModel alloc]initWithDictionary:responseObject error:nil];
  282. NSLog(@"人事 入职数据%@",self.expensesModel);
  283. REMOVESHOW
  284. [self updateExpensesView:self.expensesModel];
  285. } failure:^(NSError * _Nonnull error) {
  286. SHOWERROR([ZYCTool handerResultData:error])
  287. }];
  288. }break;
  289. default:
  290. break;
  291. }
  292. }
  293. #pragma mark - 利润 点击事件
  294. - (IBAction)profitHander:(UIButton *)sender {
  295. NSInteger date = 0;
  296. if ([[sender titleLabel].text isEqualToString:@"日"]) {
  297. self.profitDayBtn.selected = YES;
  298. self.profitWeekBtn.selected = NO;
  299. self.profitMonthBtn.selected = NO;
  300. self.profitYearBtn.selected = NO;
  301. date = 1;
  302. }
  303. if ([[sender titleLabel].text isEqualToString:@"周"]) {
  304. self.profitDayBtn.selected = NO;
  305. self.profitWeekBtn.selected = YES;
  306. self.profitMonthBtn.selected = NO;
  307. self.profitYearBtn.selected = NO;
  308. date = 2;
  309. }
  310. if ([[sender titleLabel].text isEqualToString:@"月"]) {
  311. self.profitDayBtn.selected = NO;
  312. self.profitWeekBtn.selected = NO;
  313. self.profitMonthBtn.selected = YES;
  314. self.profitYearBtn.selected = NO;
  315. date = 3;
  316. }
  317. if ([[sender titleLabel].text isEqualToString:@"年"]) {
  318. self.profitDayBtn.selected = NO;
  319. self.profitWeekBtn.selected = NO;
  320. self.profitMonthBtn.selected = NO;
  321. self.profitYearBtn.selected = YES;
  322. date = 4;
  323. }
  324. switch (self.pageType) {
  325. case 1:{
  326. SHOWLOADING
  327. [VersionDataVC getDataWithDataType:3 withDateType:date success:^(id _Nonnull responseObject) {
  328. self.profitModel = [[VersionDataModel alloc]initWithDictionary:responseObject error:nil];
  329. NSLog(@"利润%@",self.profitModel);
  330. REMOVESHOW
  331. [self updateProfitView:self.profitModel];
  332. } failure:^(NSError * _Nonnull error) {
  333. SHOWERROR([ZYCTool handerResultData:error])
  334. }];
  335. }break;
  336. case 2:{
  337. [VersionDataVC getDataWithStoreType:3 withDateType:date success:^(id _Nonnull responseObject) {
  338. self.profitModel = [[VersionDataModel alloc]initWithDictionary:responseObject error:nil];
  339. NSLog(@"库存%@",self.profitModel);
  340. REMOVESHOW
  341. [self updateProfitView:self.profitModel];
  342. } failure:^(NSError * _Nonnull error) {
  343. SHOWERROR([ZYCTool handerResultData:error])
  344. }];
  345. }break;
  346. case 3:{
  347. [VersionDataVC getDataWithHumanType:3 withDateType:date success:^(id _Nonnull responseObject) {
  348. self.profitModel = [[VersionDataModel alloc]initWithDictionary:responseObject error:nil];
  349. NSLog(@"人事数据离职%@",self.profitModel);
  350. REMOVESHOW
  351. [self updateProfitView:self.profitModel];
  352. } failure:^(NSError * _Nonnull error) {
  353. SHOWERROR([ZYCTool handerResultData:error])
  354. }];
  355. }break;
  356. default:
  357. break;
  358. }
  359. }
  360. #pragma mark - init
  361. +(VersionDataVC *)initVersionDataVC{
  362. VersionDataVC *controller = [StoryboardManager.shared.verisonData instantiateViewControllerWithIdentifier:@"VersionData"];
  363. return controller;
  364. }
  365. +(VersionDataVC *)initVersionData2VC{
  366. VersionDataVC *controller = [StoryboardManager.shared.verisonData instantiateViewControllerWithIdentifier:@"VersionData2"];
  367. return controller;}
  368. +(VersionDataVC *)initVersionData3VC{
  369. VersionDataVC *controller = [StoryboardManager.shared.verisonData instantiateViewControllerWithIdentifier:@"VersionData3"];
  370. return controller;
  371. }
  372. #pragma mark - seting UI
  373. - (void)setingUI{
  374. self.yearMonthDaylabel.text = [ZYCTool getYearAndMonthAndDay];
  375. [self setConrerWith:self.incomeHeader];
  376. [self setConrerWith:self.expensesHeader];
  377. [self setConrerWith:self.profitHeader];
  378. self.incomeEchartsView = [self createEchartsView:self.incomeEchartsView withSuperView:self.incomeTableView];
  379. self.expensesEchartsView = [self createEchartsView:self.expensesEchartsView withSuperView:self.expensesTableView];
  380. self.profitEchartsView = [self createEchartsView:self.profitEchartsView withSuperView:self.profitTableView];
  381. switch (self.pageType) {
  382. case 1:{
  383. // 设置收入
  384. [self.incomKeyLabel textAlignmentLeftAndRight];
  385. [self.incomeScaleKeyLabel textAlignmentLeftAndRight];
  386. // 设置支出
  387. [self.expensesKeyLabel textAlignmentLeftAndRight];
  388. [self.expensesScaleKeyLabel textAlignmentLeftAndRight];
  389. // 设置收入
  390. [self.profitKeyLabel textAlignmentLeftAndRight];
  391. [self.profitScaleKeyLabel textAlignmentLeftAndRight];
  392. }break;
  393. case 2:{
  394. }break;
  395. case 3:{
  396. }break;
  397. default:
  398. break;
  399. }
  400. }
  401. #pragma mark - 设置圆角
  402. - (UIView *)setConrerWith:(UIView *)view{
  403. view.layer.cornerRadius = 2.5;
  404. view.layer.masksToBounds = YES;
  405. view.layer.borderColor = UIColorHex(#7FE8E3).CGColor;
  406. view.layer.borderWidth = 2;
  407. return view;
  408. }
  409. - (WKEchartsView *)createEchartsView:(WKEchartsView *)echartsView withSuperView:(UIView *)superView{
  410. echartsView = [[WKEchartsView alloc] initWithFrame:superView.bounds];
  411. [superView addSubview:echartsView];
  412. [echartsView addHandlerForAction:PYEchartActionClick withBlock:^(NSDictionary *params) {
  413. NSLog(@"The params from Echarts:\n%@", params);
  414. }];
  415. NSArray *xArray = @[@"1",@"2",@"3",@"4",@"5",@"6",@"7"];
  416. NSArray *yArray =@[@100,@500,@180,@1200,@900,@1400,@700];
  417. [echartsView setOption:[VersionDataVC addOptionxArray:xArray withYArray:yArray]];
  418. [echartsView loadEcharts];
  419. return echartsView;
  420. }
  421. #pragma mark - 根据网络数据 刷新视图
  422. - (void)updateIncomeView:(VersionDataModel *)model{
  423. NSMutableArray *xArray = [NSMutableArray array];
  424. NSMutableArray *yArray = [NSMutableArray array];
  425. for (VersionDataSub *tempModel in model.HumanAffairsChartDataResult) {
  426. [xArray addObject:[NSString stringWithFormat:@"%ld",(long)tempModel.NavigationNumber]];
  427. [yArray addObject:@(tempModel.ResultParameter)];
  428. }
  429. [self.incomeEchartsView setOption:[VersionDataVC addOptionxArray:xArray withYArray:yArray]];
  430. [self.incomeEchartsView loadEcharts];
  431. switch (self.pageType) {
  432. case 1:{
  433. if (model.ToDayIncome == 0) {
  434. self.incomValueLabel.text = @"--";
  435. }else{
  436. self.incomValueLabel.text = [NSString stringWithFormat:@"%ld",(long)model.ToDayIncome];
  437. }
  438. if (model.ComparedMonthAmount == 0) {
  439. self.incomeScaleValueLabel.text = @"--";
  440. self.incomeScaleValueImage.hidden = YES;
  441. }
  442. else if (model.ComparedMonthAmount > 0){
  443. self.incomeScaleValueLabel.text = [NSString stringWithFormat:@"%ld",(long)model.ComparedMonthAmount];
  444. self.incomeScaleValueImage.hidden = NO;
  445. }
  446. else{
  447. self.incomeScaleValueLabel.text = [NSString stringWithFormat:@"%ld",(long)model.ComparedMonthAmount];
  448. self.incomeScaleValueImage.hidden = YES;
  449. }
  450. }break;
  451. case 2:{
  452. if (model.YearPressAmount == 0) {
  453. self.incomValueLabel.text = @"--";
  454. }else{
  455. self.incomValueLabel.text = [NSString stringWithFormat:@"%ld",(long)model.YearPressAmount];
  456. }
  457. if (model.YearPrintCount == 0) {
  458. self.yearVersionNumberLabel.text = @"--";
  459. }else{
  460. self.yearVersionNumberLabel.text = [NSString stringWithFormat:@"%ld",(long)model.YearPrintCount];
  461. }
  462. if (model.YearPressAmount == 0) {
  463. self.yearPrintNuberLabel.text = @"--";
  464. }else{
  465. self.yearPrintNuberLabel.text = [NSString stringWithFormat:@"%ld",(long)model.YearPressAmount];
  466. }
  467. if (model.MonthPressAmount == 0) {
  468. self.monthPrintNumberlael.text = @"--";
  469. }else{
  470. self.monthPrintNumberlael.text = [NSString stringWithFormat:@"%ld",(long)model.MonthPressAmount];
  471. }
  472. if (model.MonthPrintCount == 0) {
  473. self.monthVerionNumberLabel.text = @"--";
  474. }else{
  475. self.monthVerionNumberLabel.text = [NSString stringWithFormat:@"%ld",(long)model.MonthPrintCount];
  476. }
  477. if (model.ComparedMonthCount == 0) {
  478. self.monthMoneyScaleLabel.text = @"--";
  479. self.monthPrintScaleImageView.hidden = YES;
  480. }else{
  481. self.monthMoneyScaleLabel.text = [NSString stringWithFormat:@"%ld",(long)model.ComparedMonthCount];
  482. if (model.ComparedMonthCount > 0) {
  483. self.monthPrintScaleImageView.hidden = NO;
  484. }else{
  485. self.monthPrintScaleImageView.hidden = YES;
  486. }
  487. }
  488. if (model.ComparedMonthAmount == 0) {
  489. self.incomeScaleValueLabel.text = @"--";
  490. self.incomeScaleValueImage.hidden = YES;
  491. }else{
  492. self.incomeScaleValueLabel.text = [NSString stringWithFormat:@"%ld",(long)model.ComparedMonthAmount];
  493. if (model.ComparedMonthAmount > 0) {
  494. self.incomeScaleValueImage.hidden = NO;
  495. }else{
  496. self.incomeScaleValueImage.hidden = YES;
  497. }
  498. }
  499. if (model.MonthPrintAmount == 0) {
  500. self.monthVersionKindLabel.text = @"--";
  501. }else{
  502. self.monthVersionKindLabel.text = [NSString stringWithFormat:@"%ld",(long)model.MonthPrintAmount];
  503. }
  504. }break;
  505. case 3:{
  506. if(model.PersonCount == 0){
  507. self.incomValueLabel.text = @"--";
  508. }else{
  509. self.incomValueLabel.text = [NSString stringWithFormat:@"%ld",(long)model.PersonCount];
  510. }
  511. if(model.Salary == 0){
  512. self.allPersonMoneyLabel.text = @"--";
  513. }else{
  514. self.allPersonMoneyLabel.text = [NSString stringWithFormat:@"%ld",(long)model.Salary];
  515. }
  516. if(model.ComparedMonthAmount == 0){
  517. self.allPersonScaleValueLabel.text = @"--";
  518. self.allPersonScaleImageView.hidden = YES;
  519. }else{
  520. self.allPersonScaleValueLabel.text = [NSString stringWithFormat:@"%ld",(long)model.ComparedMonthAmount];
  521. if (model.ComparedMonthAmount > 0) {
  522. self.allPersonScaleImageView.hidden = NO;
  523. }else{
  524. self.allPersonScaleImageView.hidden = YES;
  525. }
  526. }
  527. if(model.ComparedMonthCount == 0){
  528. self.incomeScaleValueLabel.text = @"--";
  529. self.incomeScaleValueImage.hidden = YES;
  530. }else{
  531. self.incomeScaleValueLabel.text = [NSString stringWithFormat:@"%ld",(long)model.PersonCount];
  532. if (model.ComparedMonthCount > 0) {
  533. self.incomeScaleValueImage.hidden = NO;
  534. }else{
  535. self.incomeScaleValueImage.hidden = YES;
  536. }
  537. }
  538. }break;
  539. default:
  540. break;
  541. }
  542. }
  543. - (void)updateExpensesView:(VersionDataModel *)model{
  544. NSMutableArray *xArray = [NSMutableArray array];
  545. NSMutableArray *yArray = [NSMutableArray array];
  546. for (VersionDataSub *tempModel in model.HumanAffairsChartDataResult) {
  547. [xArray addObject:[NSString stringWithFormat:@"%ld",(long)tempModel.NavigationNumber]];
  548. [yArray addObject:@(tempModel.ResultParameter)];
  549. }
  550. [self.expensesEchartsView setOption:[VersionDataVC addOptionxArray:xArray withYArray:yArray]];
  551. [self.expensesEchartsView loadEcharts];
  552. switch (self.pageType) {
  553. case 1:
  554. {
  555. if (model.ToDayIncome == 0) {
  556. self.expensesValueLabel.text = @"--";;
  557. }else{
  558. self.expensesValueLabel.text = [NSString stringWithFormat:@"%ld",(long)model.ToDayIncome];
  559. }
  560. if (model.ComparedMonthAmount == 0) {
  561. self.expensesScaleValueLabel.text = @"--";
  562. self.expensesScaleValueImage.hidden = YES;
  563. }
  564. else if (model.ComparedMonthAmount > 0){
  565. self.expensesScaleValueLabel.text = [NSString stringWithFormat:@"%ld",(long)model.ComparedMonthAmount];
  566. self.expensesScaleValueImage.hidden = NO;
  567. }
  568. else{
  569. self.expensesScaleValueLabel.text = [NSString stringWithFormat:@"%ld",(long)model.ComparedMonthAmount];
  570. self.expensesScaleValueImage.hidden = YES;
  571. }
  572. }break;
  573. case 2:{
  574. if (model.MonthSellCount == 0) {
  575. self.expensesValueLabel.text = @"--";;
  576. }else{
  577. self.expensesValueLabel.text = [NSString stringWithFormat:@"%ld",(long)model.MonthSellCount];
  578. }
  579. if (model.MonthSellAmount == 0) {
  580. self.pubilshMonthLabel.text = @"--";;
  581. }else{
  582. self.pubilshMonthLabel.text = [NSString stringWithFormat:@"%ld",(long)model.MonthSellAmount];
  583. }
  584. if (model.ComparedMonthAmount == 0) {
  585. self.publisScaleLabel.text = @"--";;
  586. self.publisScaleImageView.hidden = YES;
  587. }else{
  588. self.publisScaleLabel.text = [NSString stringWithFormat:@"%ld",(long)model.ComparedMonthAmount];
  589. if(model.ComparedMonthAmount > 0){
  590. self.publisScaleImageView.hidden = NO;
  591. }else{
  592. self.publisScaleImageView.hidden = YES;
  593. }
  594. }
  595. if (model.ComparedMonthCount == 0) {
  596. self.expensesScaleValueLabel.text = @"--";;
  597. self.expensesScaleValueImage.hidden = YES;
  598. }else{
  599. self.expensesScaleValueLabel.text = [NSString stringWithFormat:@"%ld",(long)model.ComparedMonthAmount];
  600. if (model.ComparedMonthCount == 0) {
  601. self.expensesScaleValueImage.hidden = NO;
  602. }else{
  603. self.expensesScaleValueImage.hidden = YES;
  604. }
  605. }
  606. }break;
  607. case 3:{
  608. if (model.PersonCount == 0) {
  609. self.expensesValueLabel.text = @"--";;
  610. }else{
  611. self.expensesValueLabel.text = [NSString stringWithFormat:@"%ld",(long)model.PersonCount];
  612. }
  613. if (model.Salary == 0) {
  614. self.addPersonMoneyLabel.text = @"--";;
  615. }else{
  616. self.addPersonMoneyLabel.text = [NSString stringWithFormat:@"%ld",(long)model.Salary];
  617. }
  618. if (model.ComparedMonthCount == 0) {
  619. self.expensesScaleValueLabel.text = @"--";;
  620. self.expensesScaleValueImage.hidden = YES;
  621. }else{
  622. self.expensesScaleValueLabel.text = [NSString stringWithFormat:@"%ld",(long)model.ComparedMonthCount];
  623. if (model.ComparedMonthCount > 0) {
  624. self.expensesScaleValueImage.hidden = NO;
  625. }else{
  626. self.expensesScaleValueImage.hidden = YES;
  627. }
  628. }
  629. if (model.ComparedMonthAmount == 0) {
  630. self.addPersonScaleImageView.hidden = YES;
  631. self.addPersonScaleValueLabel.text = @"--";;
  632. }else{
  633. self.addPersonScaleValueLabel.text = [NSString stringWithFormat:@"%ld",(long)model.ComparedMonthAmount];
  634. if (model.ComparedMonthAmount > 0) {
  635. self.addPersonScaleImageView.hidden = NO;
  636. }else{
  637. self.addPersonScaleImageView.hidden = YES;
  638. }
  639. }
  640. }break;
  641. default:
  642. break;
  643. }
  644. }
  645. - (void)updateProfitView:(VersionDataModel *)model{
  646. NSMutableArray *xArray = [NSMutableArray array];
  647. NSMutableArray *yArray = [NSMutableArray array];
  648. for (VersionDataSub *tempModel in model.HumanAffairsChartDataResult) {
  649. [xArray addObject:[NSString stringWithFormat:@"%ld",(long)tempModel.NavigationNumber]];
  650. [yArray addObject:@(tempModel.ResultParameter)];
  651. }
  652. [self.profitEchartsView setOption:[VersionDataVC addOptionxArray:xArray withYArray:yArray]];
  653. [self.profitEchartsView loadEcharts];
  654. switch (self.pageType) {
  655. case 1:
  656. {
  657. if (model.ToDayIncome == 0) {
  658. self.profitValueLabel.text = @"--";
  659. }else{
  660. self.profitValueLabel.text = [NSString stringWithFormat:@"%ld",(long)model.ToDayIncome];
  661. }
  662. if (model.ComparedMonthAmount == 0) {
  663. self.profitScaleValueLabel.text = @"--";
  664. self.profitScaleValueImage.hidden = YES;
  665. }
  666. else if (model.ComparedMonthAmount > 0){
  667. self.profitScaleValueLabel.text = [NSString stringWithFormat:@"%ld",(long)model.ComparedMonthAmount];
  668. self.profitScaleValueImage.hidden = NO;
  669. }
  670. else{
  671. self.profitScaleValueLabel.text = [NSString stringWithFormat:@"%ld",(long)model.ComparedMonthAmount];
  672. self.profitScaleValueImage.hidden = YES;
  673. }
  674. }break;
  675. case 2:{
  676. if (model.StorehouseAllCount == 0) {
  677. self.profitValueLabel.text = @"--";
  678. }else{
  679. self.profitValueLabel.text = [NSString stringWithFormat:@"%ld",(long)model.StorehouseAllCount];
  680. }
  681. if (model.Monthcount == 0) {
  682. self.profitScaleValueLabel.text = @"--";
  683. self.profitScaleValueImage.hidden = YES;
  684. }else{
  685. self.profitScaleValueLabel.text = [NSString stringWithFormat:@"%ld",(long)model.Monthcount];
  686. if (model.Monthcount > 0) {
  687. self.profitScaleValueImage.hidden = NO;
  688. }else{
  689. self.profitScaleValueImage.hidden = YES;
  690. }
  691. }
  692. if (model.ComparedMonthCount == 0) {
  693. self.storeLabel.text = @"--";
  694. self.storeScaleImageView.hidden = YES;
  695. }else{
  696. self.storeLabel.text = [NSString stringWithFormat:@"%ld",(long)model.ComparedMonthCount];
  697. if (model.ComparedMonthCount > 0) {
  698. self.storeScaleImageView.hidden = NO;
  699. }else{
  700. self.storeScaleImageView.hidden = YES;
  701. }
  702. }
  703. }break;
  704. case 3:{
  705. if (model.PersonCount == 0) {
  706. self.profitValueLabel.text = @"--";;
  707. }else{
  708. self.profitValueLabel.text = [NSString stringWithFormat:@"%ld",(long)model.PersonCount];
  709. }
  710. if (model.Salary == 0) {
  711. self.movePersonLabel.text = @"--";;
  712. }else{
  713. self.movePersonLabel.text = [NSString stringWithFormat:@"%ld",(long)model.Salary];
  714. }
  715. if (model.ComparedMonthCount == 0) {
  716. self.profitScaleValueLabel.text = @"--";;
  717. self.profitScaleValueImage.hidden = YES;
  718. }else{
  719. self.profitScaleValueLabel.text = [NSString stringWithFormat:@"%ld",(long)model.ComparedMonthCount];
  720. if (model.ComparedMonthCount > 0) {
  721. self.profitScaleValueImage.hidden = NO;
  722. }else{
  723. self.profitScaleValueImage.hidden = YES;
  724. }
  725. }
  726. }break;
  727. default:
  728. break;
  729. }
  730. }
  731. #pragma mark - 网络访问
  732. - (void)getData{
  733. SHOWLOADING
  734. switch (self.pageType) {
  735. case 1:
  736. [self getMoneyData];
  737. break;
  738. case 2:
  739. [self getVersionData];
  740. break;
  741. case 3:
  742. [self getHumanData];
  743. break;
  744. default:
  745. break;
  746. }
  747. }
  748. #pragma mark - 财务数据请求网络
  749. - (void)getMoneyData{
  750. [VersionDataVC getDataWithDataType:1 withDateType:1 success:^(id _Nonnull responseObject) {
  751. self.incomeModel = [[VersionDataModel alloc]initWithDictionary:responseObject error:nil];
  752. NSLog(@"收入%@",self.incomeModel);
  753. self.netFlag += 1;
  754. if (self.netFlag == 4) {
  755. REMOVESHOW
  756. }
  757. [self updateIncomeView:self.incomeModel];
  758. } failure:^(NSError * _Nonnull error) {
  759. self.netFlag += 1;
  760. if (self.netFlag == 4) {
  761. SHOWERROR([ZYCTool handerResultData:error])
  762. }
  763. }];
  764. [VersionDataVC getDataWithDataType:2 withDateType:1 success:^(id _Nonnull responseObject) {
  765. self.expensesModel = [[VersionDataModel alloc]initWithDictionary:responseObject error:nil];
  766. NSLog(@"支出%@",self.expensesModel);
  767. self.netFlag += 1;
  768. if (self.netFlag == 4) {
  769. REMOVESHOW
  770. }
  771. [self updateExpensesView:self.expensesModel];
  772. } failure:^(NSError * _Nonnull error) {
  773. self.netFlag += 1;
  774. if (self.netFlag == 4) {
  775. SHOWERROR([ZYCTool handerResultData:error])
  776. }
  777. }];
  778. [VersionDataVC getDataWithDataType:3 withDateType:1 success:^(id _Nonnull responseObject) {
  779. self.profitModel = [[VersionDataModel alloc]initWithDictionary:responseObject error:nil];
  780. NSLog(@"利润%@",self.profitModel);
  781. self.netFlag += 1;
  782. if (self.netFlag == 4) {
  783. REMOVESHOW
  784. }
  785. [self updateProfitView:self.profitModel];
  786. } failure:^(NSError * _Nonnull error) {
  787. self.netFlag += 1;
  788. if (self.netFlag == 4) {
  789. SHOWERROR([ZYCTool handerResultData:error])
  790. }
  791. }];
  792. }
  793. + (void)getDataWithDataType:(NSInteger)DataType withDateType:(NSInteger)DateType success:(void (^) (id responseObject))successful failure:(void (^) (NSError *error))failure{
  794. [[HttpManager sharedHttpManager ] POSTUrl:[NSString stringWithFormat:@"%@%@",BaseUrl,WorkFlowlistData_Post] parameters:@{@"DataType":@(DataType),@"DateType":@(DateType)} responseStyle:JOSN success:^(id _Nonnull responseObject) {
  795. successful(responseObject);
  796. } failure:^(NSError * _Nonnull error) {
  797. failure(error);
  798. }];
  799. }
  800. #pragma mark - 出版数据请求网络
  801. - (void)getVersionData{
  802. [VersionDataVC getDataWithVersisonType:1 withDateType:1 success:^(id _Nonnull responseObject) {
  803. self.incomeModel = [[VersionDataModel alloc]initWithDictionary:responseObject error:nil];
  804. NSLog(@"出版%@",self.incomeModel);
  805. self.netFlag += 1;
  806. if (self.netFlag == 4) {
  807. REMOVESHOW
  808. }
  809. [self updateIncomeView:self.incomeModel];
  810. } failure:^(NSError * _Nonnull error) {
  811. self.netFlag += 1;
  812. if (self.netFlag == 4) {
  813. SHOWERROR([ZYCTool handerResultData:error])
  814. }
  815. }];
  816. [VersionDataVC getDataWithPublishType:2 withDateType:1 success:^(id _Nonnull responseObject) {
  817. self.expensesModel = [[VersionDataModel alloc]initWithDictionary:responseObject error:nil];
  818. NSLog(@"发行%@",self.expensesModel);
  819. self.netFlag += 1;
  820. if (self.netFlag == 4) {
  821. REMOVESHOW
  822. }
  823. [self updateExpensesView:self.expensesModel];
  824. } failure:^(NSError * _Nonnull error) {
  825. self.netFlag += 1;
  826. if (self.netFlag == 4) {
  827. SHOWERROR([ZYCTool handerResultData:error])
  828. }
  829. }];
  830. [VersionDataVC getDataWithStoreType:3 withDateType:1 success:^(id _Nonnull responseObject) {
  831. self.profitModel = [[VersionDataModel alloc]initWithDictionary:responseObject error:nil];
  832. NSLog(@"库存%@",self.profitModel);
  833. self.netFlag += 1;
  834. if (self.netFlag == 4) {
  835. REMOVESHOW
  836. }
  837. [self updateProfitView:self.profitModel];
  838. } failure:^(NSError * _Nonnull error) {
  839. self.netFlag += 1;
  840. if (self.netFlag == 4) {
  841. SHOWERROR([ZYCTool handerResultData:error])
  842. }
  843. }];
  844. }
  845. // 库存
  846. + (void)getDataWithStoreType:(NSInteger)DataType withDateType:(NSInteger)DateType success:(void (^) (id responseObject))successful failure:(void (^) (NSError *error))failure{
  847. [[HttpManager sharedHttpManager ] POSTUrl:[NSString stringWithFormat:@"%@%@",BaseUrl,WorkFlowlistData_Store_Post] parameters:@{@"DateType":@(DateType)} responseStyle:JOSN success:^(id _Nonnull responseObject) {
  848. successful(responseObject);
  849. } failure:^(NSError * _Nonnull error) {
  850. failure(error);
  851. }];
  852. }
  853. // 发行
  854. + (void)getDataWithPublishType:(NSInteger)DataType withDateType:(NSInteger)DateType success:(void (^) (id responseObject))successful failure:(void (^) (NSError *error))failure{
  855. [[HttpManager sharedHttpManager ] POSTUrl:[NSString stringWithFormat:@"%@%@",BaseUrl,WorkFlowlistData_Store_Post] parameters:@{@"DateType":@(DateType)} responseStyle:JOSN success:^(id _Nonnull responseObject) {
  856. successful(responseObject);
  857. } failure:^(NSError * _Nonnull error) {
  858. failure(error);
  859. }];
  860. }
  861. // 出版
  862. + (void)getDataWithVersisonType:(NSInteger)DataType withDateType:(NSInteger)DateType success:(void (^) (id responseObject))successful failure:(void (^) (NSError *error))failure{
  863. [[HttpManager sharedHttpManager ] POSTUrl:[NSString stringWithFormat:@"%@%@",BaseUrl,WorkFlowlistData_Version_Post] parameters:@{@"DateType":@(DateType)} responseStyle:JOSN success:^(id _Nonnull responseObject) {
  864. successful(responseObject);
  865. } failure:^(NSError * _Nonnull error) {
  866. failure(error);
  867. }];
  868. }
  869. #pragma mark - 人事数据请求网络
  870. - (void)getHumanData{
  871. [VersionDataVC getDataWithHumanType:1 withDateType:1 success:^(id _Nonnull responseObject) {
  872. self.incomeModel = [[VersionDataModel alloc]initWithDictionary:responseObject error:nil];
  873. NSLog(@"人事数据%@",self.incomeModel);
  874. self.netFlag += 1;
  875. if (self.netFlag == 4) {
  876. REMOVESHOW
  877. }
  878. [self updateIncomeView:self.incomeModel];
  879. } failure:^(NSError * _Nonnull error) {
  880. self.netFlag += 1;
  881. if (self.netFlag == 4) {
  882. SHOWERROR([ZYCTool handerResultData:error])
  883. }
  884. }];
  885. [VersionDataVC getDataWithHumanType:2 withDateType:1 success:^(id _Nonnull responseObject) {
  886. self.expensesModel = [[VersionDataModel alloc]initWithDictionary:responseObject error:nil];
  887. NSLog(@"人事数据 入职 %@",self.expensesModel);
  888. self.netFlag += 1;
  889. if (self.netFlag == 4) {
  890. REMOVESHOW
  891. }
  892. [self updateExpensesView:self.expensesModel];
  893. } failure:^(NSError * _Nonnull error) {
  894. self.netFlag += 1;
  895. if (self.netFlag == 4) {
  896. SHOWERROR([ZYCTool handerResultData:error])
  897. }
  898. }];
  899. [VersionDataVC getDataWithHumanType:3 withDateType:1 success:^(id _Nonnull responseObject) {
  900. self.profitModel = [[VersionDataModel alloc]initWithDictionary:responseObject error:nil];
  901. NSLog(@"人事数据 离职%@",self.profitModel);
  902. self.netFlag += 1;
  903. if (self.netFlag == 4) {
  904. REMOVESHOW
  905. }
  906. [self updateProfitView:self.profitModel];
  907. } failure:^(NSError * _Nonnull error) {
  908. self.netFlag += 1;
  909. if (self.netFlag == 4) {
  910. SHOWERROR([ZYCTool handerResultData:error])
  911. }
  912. }];
  913. }
  914. + (void)getDataWithHumanType:(NSInteger)DataType withDateType:(NSInteger)DateType success:(void (^) (id responseObject))successful failure:(void (^) (NSError *error))failure{
  915. [[HttpManager sharedHttpManager ] POSTUrl:[NSString stringWithFormat:@"%@%@",BaseUrl,WorkFlowlistData_HR_Post] parameters:@{@"DataType":@(DataType),@"DateType":@(DateType)} responseStyle:JOSN success:^(id _Nonnull responseObject) {
  916. successful(responseObject);
  917. } failure:^(NSError * _Nonnull error) {
  918. failure(error);
  919. }];
  920. }
  921. #pragma mark - 图表样式
  922. + (PYOption *)addOptionxArray:(NSArray *)xArray withYArray:(NSArray *)yArray{
  923. return [PYOption initPYOptionWithBlock:^(PYOption *option) {
  924. option.titleEqual([PYTitle initPYTitleWithBlock:^(PYTitle *title) {
  925. }])
  926. .gridEqual([PYGrid initPYGridWithBlock:^(PYGrid *grid) {
  927. grid.xEqual(@40).x2Equal(@50)
  928. .yEqual(@10)
  929. .y2Equal(@30);
  930. }])
  931. .addXAxis([PYAxis initPYAxisWithBlock:^(PYAxis *axis) {
  932. axis.typeEqual(PYAxisTypeCategory)
  933. .addDataArr(xArray)
  934. .splitLine.showEqual(NO)
  935. ;
  936. }])
  937. .addYAxis([PYAxis initPYAxisWithBlock:^(PYAxis *axis) {
  938. axis.typeEqual(PYAxisTypeValue)
  939. .axisLabelEqual([PYAxisLabel initPYAxisLabelWithBlock:^(PYAxisLabel *axisLabel) {
  940. axisLabel.formatterEqual(@"{value}");
  941. }])
  942. .splitLine.showEqual(YES);
  943. }])
  944. .addSeries([PYCartesianSeries initPYCartesianSeriesWithBlock:^(PYCartesianSeries *series) {
  945. series.symbolEqual(PYSymbolNone)
  946. .typeEqual(PYSeriesTypeLine)
  947. .itemStyleEqual([PYItemStyle initPYItemStyleWithBlock:^(PYItemStyle *itemStyle) {
  948. itemStyle.normalEqual([PYItemStyleProp initPYItemStylePropWithBlock:^(PYItemStyleProp *normal) {
  949. normal.lineStyleEqual([PYLineStyle initPYLineStyleWithBlock:^(PYLineStyle *lineStyle) {
  950. lineStyle.colorEqual([PYColor colorWithHexString:@"#5576AB"]);
  951. }]);
  952. }]).emphasisEqual([PYItemStyleProp initPYItemStylePropWithBlock:^(PYItemStyleProp *emphasis) {
  953. emphasis.labelEqual([PYLabel initPYLabelWithBlock:^(PYLabel *label) {
  954. label.showEqual(YES);
  955. }]);
  956. }]);
  957. }])
  958. .dataEqual(yArray);
  959. }]);
  960. }];
  961. }
  962. @end