Quellcode durchsuchen

1.修改NPD CommonEditor,代码布局。

Pen Li vor 8 Jahren
Ursprung
Commit
3711fbe517

BIN
RedAnt ERP Mobile/RedAnt ERP Mobile.xcworkspace/xcuserdata/macmini1.xcuserdatad/UserInterfaceState.xcuserstate


+ 9 - 0
RedAnt ERP Mobile/common/CommonEditor/CommonEditorViewController.h

@@ -99,4 +99,13 @@
 @property (nonatomic,copy) NSString *urgency_timer_name;
 @property (nonatomic,assign) int level;///<CommonEditor窗口层级
 
+#pragma mark - Code TableView Constraint
+
+@property (nonatomic,strong) NSLayoutConstraint *tb_top_constraint;
+@property (nonatomic,strong) NSLayoutConstraint *tb_left_constraint;
+@property (nonatomic,strong) NSLayoutConstraint *tb_bottom_constraint;
+@property (nonatomic,strong) NSLayoutConstraint *tb_right_constraint;
+
+#pragma mark - ==========================
+
 @end

+ 125 - 12
RedAnt ERP Mobile/common/CommonEditor/CommonEditorViewController.m

@@ -61,7 +61,91 @@
 
 @implementation CommonEditorViewController
 
+#pragma mark - Code TableView
+- (void)initTableView {
+    
+    self.editorTable = [[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStylePlain];
+    self.editorTable.translatesAutoresizingMaskIntoConstraints = NO;
+    [self.view addSubview:self.editorTable];
+    [self.view sendSubviewToBack:self.editorTable];
+    
+    NSLayoutConstraint *top_constraint = [NSLayoutConstraint constraintWithItem:self.editorTable
+                                                                      attribute:NSLayoutAttributeTop
+                                                                      relatedBy:NSLayoutRelationEqual
+                                                                         toItem:self.view
+                                                                      attribute:NSLayoutAttributeTop
+                                                                     multiplier:1
+                                                                       constant:0];
+    self.tb_top_constraint = top_constraint;
+    [self.view addConstraint:top_constraint];
+    
+    NSLayoutConstraint *left_constraint = [NSLayoutConstraint constraintWithItem:self.editorTable
+                                                                       attribute:NSLayoutAttributeLeft
+                                                                       relatedBy:NSLayoutRelationEqual
+                                                                          toItem:self.view
+                                                                       attribute:NSLayoutAttributeLeft
+                                                                      multiplier:1
+                                                                        constant:0];
+    self.tb_left_constraint = left_constraint;
+    [self.view addConstraint:left_constraint];
+    
+    NSLayoutConstraint *bottom_constraint = [NSLayoutConstraint constraintWithItem:self.editorTable
+                                                                         attribute:NSLayoutAttributeBottom
+                                                                         relatedBy:NSLayoutRelationEqual
+                                                                            toItem:self.view
+                                                                         attribute:NSLayoutAttributeBottom
+                                                                        multiplier:1
+                                                                          constant:0];
+    self.tb_bottom_constraint = bottom_constraint;
+    [self.view addConstraint:bottom_constraint];
+    
+    NSLayoutConstraint *right_constraint = [NSLayoutConstraint constraintWithItem:self.editorTable
+                                                                        attribute:NSLayoutAttributeRight
+                                                                        relatedBy:NSLayoutRelationEqual
+                                                                           toItem:self.view
+                                                                        attribute:NSLayoutAttributeRight
+                                                                       multiplier:1
+                                                                         constant:0];
+    self.tb_right_constraint = right_constraint;
+    [self.view addConstraint:right_constraint];
+    
+    
+    
+    self.editorTable.delegate = self;
+    self.editorTable.dataSource = self;
+    self.editorTable.tableFooterView = [UIView new];
+    self.editorTable.tableHeaderView = [UIView new];
+    
+
+}
+
+- (void)registerPhoneCell {
+    
+    [self.editorTable registerNib:[UINib nibWithNibName:@"Phone_Action_Cell" bundle:nil] forCellReuseIdentifier:@"CommonEditorCellAction"];
+    [self.editorTable registerNib:[UINib nibWithNibName:@"Phone_Edit_Cell" bundle:nil] forCellReuseIdentifier:@"CommonEditorCellEdit"];
+    [self.editorTable registerNib:[UINib nibWithNibName:@"Phone_Enum_Cell" bundle:nil] forCellReuseIdentifier:@"CommonEditorCellEnum"];
+    [self.editorTable registerNib:[UINib nibWithNibName:@"Phone_Image_Cell" bundle:nil] forCellReuseIdentifier:@"CommonEditorCellImg"];
+    [self.editorTable registerNib:[UINib nibWithNibName:@"Phone_Label_Cell" bundle:nil] forCellReuseIdentifier:@"CommonEditorCellLabel"];
+    [self.editorTable registerNib:[UINib nibWithNibName:@"Phone_MAction_Cell" bundle:nil] forCellReuseIdentifier:@"CommonEditorCellMAction"];
+    [self.editorTable registerNib:[UINib nibWithNibName:@"Phone_Model_Cell" bundle:nil] forCellReuseIdentifier:@"CommonEditorCellModel"];
+    [self.editorTable registerNib:[UINib nibWithNibName:@"Phone_Signature_Cell" bundle:nil] forCellReuseIdentifier:@"CommonEditorCellSignature"];
+    [self.editorTable registerNib:[UINib nibWithNibName:@"Phone_Switch_Cell" bundle:nil] forCellReuseIdentifier:@"CommonEditorCellSwitch"];
+    [self.editorTable registerNib:[UINib nibWithNibName:@"Phone_TextView_Cell" bundle:nil] forCellReuseIdentifier:@"CommonEditorCellTextView"];
+    
+}
+
+- (void)setupEditorTable {
+    
+    [self initTableView];
+    // Regist Nib Cell
+    NSString *model = [UIDevice currentDevice].model;
+    if ([model isEqualToString:@"iPhone"]) {
+        [self registerPhoneCell];
+    }
+    
+}
 
+#pragma mark ==============
 
 -(void) commonAction:(NSString *)value index:(NSIndexPath*) indexPath data:(NSMutableDictionary*) item_json
 {
@@ -168,6 +252,10 @@
 {
     [super viewDidLoad];
  
+    NSString *model = [UIDevice currentDevice].model;
+    if ([model isEqualToString:@"iPhone"]) {
+        [self setupEditorTable];
+    }
     
 //    self.switchlock =  [[NSLock alloc] init];
     
@@ -209,7 +297,7 @@
         dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
             
             NSDictionary* editor_json = [RANetwork request_Editor:weakself.request_url params:weakself.params];
-            
+            DebugLog(@"data string: %@",[RAUtils dict2string:editor_json] );
             dispatch_async(dispatch_get_main_queue(), ^{
                 
                 [waitalert dismissWithClickedButtonIndex:0 animated:FALSE];
@@ -921,7 +1009,8 @@
             }
             
             NSDictionary* editor_json = [RANetwork request_Editor:weakself.request_url params:weakself.params];
-            
+            DebugLog(@"data string: %@",[RAUtils dict2string:editor_json] );
+
             dispatch_async(dispatch_get_main_queue(), ^{
                 [waitalert dismissWithClickedButtonIndex:0 animated:FALSE];
                 
@@ -2564,16 +2653,40 @@
     NSDictionary* item_json =((NSMutableArray*)self.content_data_control[indexPath.section])[indexPath.row];
     
     NSString* control = [item_json valueForKey:@"control"];
-    if([control isEqualToString:@"model"])
-        return 140;
-    else if([control isEqualToString:@"signature"])
-        return 140;
-    else if([control isEqualToString:@"text_view"])
-        return 140;
-    
-    else if([control isEqualToString:@"img"])
-        return 123;
-    return 44;
+    NSString *model = [UIDevice currentDevice].model;
+    if ([model isEqualToString:@"iPhone"]) {
+        if([control isEqualToString:@"model"])
+            return 140;
+        else if([control isEqualToString:@"signature"])
+            return 200;
+        else if([control isEqualToString:@"text_view"])
+            return 180;
+        else if([control isEqualToString:@"img"])
+            return 240;
+        else if ([control isEqualToString:@"action"])
+            return 44;
+        else if ([control isEqualToString:@"text"])
+            return 80;
+        else if ([control isEqualToString:@"enum"])
+            return 80;
+        else if ([control isEqualToString:@"edit"])
+            return 80;
+        else if ([control isEqualToString:@"switch"])
+            return 80;
+        
+        return 80;
+    } else {
+        if([control isEqualToString:@"model"])
+            return 140;
+        else if([control isEqualToString:@"signature"])
+            return 140;
+        else if([control isEqualToString:@"text_view"])
+            return 140;
+        
+        else if([control isEqualToString:@"img"])
+            return 123;
+        return 44;
+    }
     
     
 }

+ 3 - 1
RedAnt ERP Mobile/iSales-GATIT.xcodeproj/xcuserdata/macmini1.xcuserdatad/xcschemes/GATIT Mobile.xcscheme

@@ -26,6 +26,7 @@
       buildConfiguration = "Debug"
       selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
       selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+      language = ""
       shouldUseLaunchSchemeArgsEnv = "YES">
       <Testables>
       </Testables>
@@ -33,7 +34,7 @@
          <BuildableReference
             BuildableIdentifier = "primary"
             BlueprintIdentifier = "713F76A51929F4A7006A7305"
-            BuildableName = "HOMER Mobile.app"
+            BuildableName = "Homer App.app"
             BlueprintName = "iSales-HOMER"
             ReferencedContainer = "container:iSales-HOMER.xcodeproj">
          </BuildableReference>
@@ -45,6 +46,7 @@
       buildConfiguration = "Debug"
       selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
       selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+      language = ""
       launchStyle = "0"
       useCustomWorkingDirectory = "NO"
       ignoresPersistentStateOnLaunch = "NO"

+ 6 - 4
RedAnt ERP Mobile/iSales-HOMER.xcodeproj/xcuserdata/macmini1.xcuserdatad/xcschemes/HOMER Mobile.xcscheme

@@ -15,7 +15,7 @@
             <BuildableReference
                BuildableIdentifier = "primary"
                BlueprintIdentifier = "713F76A51929F4A7006A7305"
-               BuildableName = "HOMER Mobile.app"
+               BuildableName = "Homer App.app"
                BlueprintName = "iSales-HOMER"
                ReferencedContainer = "container:iSales-HOMER.xcodeproj">
             </BuildableReference>
@@ -26,6 +26,7 @@
       buildConfiguration = "Debug"
       selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
       selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+      language = ""
       shouldUseLaunchSchemeArgsEnv = "YES">
       <Testables>
       </Testables>
@@ -33,7 +34,7 @@
          <BuildableReference
             BuildableIdentifier = "primary"
             BlueprintIdentifier = "713F76A51929F4A7006A7305"
-            BuildableName = "HOMER Mobile.app"
+            BuildableName = "Homer App.app"
             BlueprintName = "iSales-HOMER"
             ReferencedContainer = "container:iSales-HOMER.xcodeproj">
          </BuildableReference>
@@ -45,6 +46,7 @@
       buildConfiguration = "Debug"
       selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
       selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+      language = ""
       launchStyle = "0"
       useCustomWorkingDirectory = "NO"
       ignoresPersistentStateOnLaunch = "NO"
@@ -56,7 +58,7 @@
          <BuildableReference
             BuildableIdentifier = "primary"
             BlueprintIdentifier = "713F76A51929F4A7006A7305"
-            BuildableName = "HOMER Mobile.app"
+            BuildableName = "Homer App.app"
             BlueprintName = "iSales-HOMER"
             ReferencedContainer = "container:iSales-HOMER.xcodeproj">
          </BuildableReference>
@@ -82,7 +84,7 @@
          <BuildableReference
             BuildableIdentifier = "primary"
             BlueprintIdentifier = "713F76A51929F4A7006A7305"
-            BuildableName = "HOMER Mobile.app"
+            BuildableName = "Homer App.app"
             BlueprintName = "iSales-HOMER"
             ReferencedContainer = "container:iSales-HOMER.xcodeproj">
          </BuildableReference>

Datei-Diff unterdrückt, da er zu groß ist
+ 118 - 118
RedAnt ERP Mobile/iSales-NPD/Base.lproj/Main.storyboard


Einige Dateien werden nicht angezeigt, da zu viele Dateien in diesem Diff geändert wurden.