CommonEditorCellModel.m 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. //
  2. // OrderInfoRModelCell.m
  3. // RedAnt ERP Mobile
  4. //
  5. // Created by Ray on 14-7-12.
  6. // Copyright (c) 2014年 United Software Applications, Inc. All rights reserved.
  7. //
  8. #import "config.h"
  9. #import "CommonEditorCellModel.h"
  10. #import "RAUtils.h"
  11. #if defined(BUILD_NPD) || defined (BUILD_CONTRAST)
  12. #import "BundleModelViewController.h"
  13. #endif
  14. #import "const.h"
  15. #import "config.h"
  16. #if defined(BUILD_HOMER) || defined(BUILD_GATIT)
  17. #import "MasterModelViewController.h"
  18. #endif
  19. @implementation CommonEditorCellModel
  20. - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
  21. {
  22. self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
  23. if (self) {
  24. // Initialization code
  25. #ifndef BUILD_CONTRAST
  26. self.labelMasterPack.hidden=true;
  27. #else
  28. self.labelMasterPack.hidden=false;
  29. #endif
  30. }
  31. return self;
  32. }
  33. //
  34. //- (void)awakeFromNib
  35. //{
  36. // // Initialization code
  37. //
  38. //// [self addGestureRecognizer: [[UILongPressGestureRecognizer alloc]initWithTarget:self action:@selector(longTap:)]];
  39. //}
  40. - (IBAction)onClickBundle:(UIButton *)sender {
  41. #if defined(BUILD_NPD)
  42. UIViewController* vc=[RAUtils getViewController :sender];
  43. BundleModelViewController * bundleVC =[[UIStoryboard storyboardWithName:@"ERP_Mobile_Model" bundle:nil] instantiateViewControllerWithIdentifier:@"BundleModelViewController"];
  44. bundleVC.content_data = self.bundle_item;
  45. UINavigationController* navi = [[UINavigationController alloc] initWithRootViewController:bundleVC] ;
  46. navi.modalPresentationStyle = UIModalPresentationFormSheet;//有三种状态,自己看看是哪种
  47. [vc presentViewController:navi animated:YES completion:^{
  48. // navi.view.superview.bounds = CGRectMake(0, 0, 480, 320);
  49. DebugLog(@"bundle present.........");
  50. // self.btop = false;
  51. // <#code#>
  52. }];
  53. #endif
  54. }
  55. - (IBAction)masterBtnClick:(UIButton *)sender {
  56. #if defined(BUILD_HOMER) || defined(BUILD_GATIT)
  57. UIViewController* vc=[RAUtils getViewController :sender];
  58. MasterModelViewController *masterModelVC = [MasterModelViewController buildMasterModelViewController];
  59. masterModelVC.content_data = self.master_items;
  60. UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:masterModelVC];
  61. [vc presentViewController:nav animated:YES completion:nil];
  62. #endif
  63. }
  64. /*
  65. -(void)longTap:(UILongPressGestureRecognizer *)longRecognizer
  66. {
  67. if (longRecognizer.state==UIGestureRecognizerStateBegan) {
  68. [self becomeFirstResponder];
  69. UIMenuController *menu=[UIMenuController sharedMenuController];
  70. UIMenuItem *copyItem = [[UIMenuItem alloc] initWithTitle:@"复制" action:@selector(copyItemClicked:)];
  71. UIMenuItem *resendItem = [[UIMenuItem alloc] initWithTitle:@"转发" action:@selector(resendItemClicked:)];
  72. [menu setMenuItems:[NSArray arrayWithObjects:copyItem,resendItem,nil]];
  73. [menu setTargetRect:self.bounds inView:self];
  74. [menu setMenuVisible:YES animated:YES];
  75. }
  76. }
  77. #pragma mark 处理action事件
  78. -(BOOL)canPerformAction:(SEL)action withSender:(id)sender{
  79. if(action ==@selector(copyItemClicked:)){
  80. return YES;
  81. }else if (action==@selector(resendItemClicked:)){
  82. return YES;
  83. }
  84. return [super canPerformAction:action withSender:sender];
  85. }
  86. #pragma mark 实现成为第一响应者方法
  87. -(BOOL)canBecomeFirstResponder{
  88. return YES;
  89. }
  90. #pragma mark method
  91. -(void)resendItemClicked:(id)sender{
  92. DebugLog(@"转发");
  93. //通知代理
  94. }
  95. -(void)copyItemClicked:(id)sender{
  96. DebugLog(@"复制");
  97. // 通知代理
  98. }*/
  99. - (void)setSelected:(BOOL)selected animated:(BOOL)animated
  100. {
  101. [super setSelected:selected animated:animated];
  102. // Configure the view for the selected state
  103. }
  104. @end