Преглед изворни кода

Add the function of skipping the integrity check of the specified field according to the user's authority -- 增加根据用户权限跳过指定字段完整性检查的功能 (resolve: #14782)
Add list selection input method -- 增加列表选择输入方式 (resolve: #14766)

Ray Zhang пре 4 година
родитељ
комит
6db1543836

Разлика између датотеке није приказан због своје велике величине
+ 0 - 0
Ants Contract/Granite Expo eSign/2021 GECI - Home Improvement Contract.json


+ 24 - 0
Ants Contract/Granite Expo eSign/Granite Expo eSign.xcodeproj/project.pbxproj

@@ -23,6 +23,10 @@
 		3C9FFA1B2744861A0067830C /* GECI - Home Improvement Contract - GC Granite Inc. DBA GL Remodeling.pdf in Resources */ = {isa = PBXBuildFile; fileRef = 3C9FFA142744861A0067830C /* GECI - Home Improvement Contract - GC Granite Inc. DBA GL Remodeling.pdf */; };
 		3C9FFA1C2744861A0067830C /* GECI - Home Improvement Contract - Jim Xu.pdf in Resources */ = {isa = PBXBuildFile; fileRef = 3C9FFA152744861A0067830C /* GECI - Home Improvement Contract - Jim Xu.pdf */; };
 		3C9FFA1D2744861A0067830C /* GECI - Home Improvement Contract - Sunshine Remodeling Inc.pdf in Resources */ = {isa = PBXBuildFile; fileRef = 3C9FFA162744861A0067830C /* GECI - Home Improvement Contract - Sunshine Remodeling Inc.pdf */; };
+		3C9FFAA9274B87DE0067830C /* TouchLabel.m in Sources */ = {isa = PBXBuildFile; fileRef = 3C9FFAA7274B87DD0067830C /* TouchLabel.m */; };
+		3C9FFAAC274B8FA20067830C /* EnumSelectViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 3C9FFAAA274B8FA20067830C /* EnumSelectViewController.m */; };
+		3C9FFAAF274B908E0067830C /* RTLabel.m in Sources */ = {isa = PBXBuildFile; fileRef = 3C9FFAAE274B908E0067830C /* RTLabel.m */; };
+		3C9FFAB2274B91610067830C /* EnumSelectorCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 3C9FFAB1274B91610067830C /* EnumSelectorCell.m */; };
 		3CBB92F2248A26EB0099E429 /* NetworkUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 3CBB92F1248A26EB0099E429 /* NetworkUtils.m */; };
 		3CC7E73423BEDE9700BE5561 /* RAPDFViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 3CC7E73323BEDE9700BE5561 /* RAPDFViewController.m */; };
 		3CC7E73623BEDEA000BE5561 /* wkweb.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 3CC7E73523BEDEA000BE5561 /* wkweb.storyboard */; };
@@ -126,6 +130,14 @@
 		3C9FFA142744861A0067830C /* GECI - Home Improvement Contract - GC Granite Inc. DBA GL Remodeling.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = "GECI - Home Improvement Contract - GC Granite Inc. DBA GL Remodeling.pdf"; sourceTree = "<group>"; };
 		3C9FFA152744861A0067830C /* GECI - Home Improvement Contract - Jim Xu.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = "GECI - Home Improvement Contract - Jim Xu.pdf"; sourceTree = "<group>"; };
 		3C9FFA162744861A0067830C /* GECI - Home Improvement Contract - Sunshine Remodeling Inc.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = "GECI - Home Improvement Contract - Sunshine Remodeling Inc.pdf"; sourceTree = "<group>"; };
+		3C9FFAA7274B87DD0067830C /* TouchLabel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = TouchLabel.m; path = "../../../RedAnt ERP Mobile/common/customUI/TouchLabel.m"; sourceTree = "<group>"; };
+		3C9FFAA8274B87DE0067830C /* TouchLabel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TouchLabel.h; path = "../../../RedAnt ERP Mobile/common/customUI/TouchLabel.h"; sourceTree = "<group>"; };
+		3C9FFAAA274B8FA20067830C /* EnumSelectViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = EnumSelectViewController.m; path = ../../../common/customUI/commoneditor/EnumSelectViewController.m; sourceTree = "<group>"; };
+		3C9FFAAB274B8FA20067830C /* EnumSelectViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = EnumSelectViewController.h; path = ../../../common/customUI/commoneditor/EnumSelectViewController.h; sourceTree = "<group>"; };
+		3C9FFAAD274B908E0067830C /* RTLabel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RTLabel.h; path = ../../../common/customUI/RTLabel.h; sourceTree = "<group>"; };
+		3C9FFAAE274B908E0067830C /* RTLabel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = RTLabel.m; path = ../../../common/customUI/RTLabel.m; sourceTree = "<group>"; };
+		3C9FFAB0274B91610067830C /* EnumSelectorCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = EnumSelectorCell.h; path = ../../../common/customUI/commoneditor/EnumSelectorCell.h; sourceTree = "<group>"; };
+		3C9FFAB1274B91610067830C /* EnumSelectorCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = EnumSelectorCell.m; path = ../../../common/customUI/commoneditor/EnumSelectorCell.m; sourceTree = "<group>"; };
 		3CBB92F0248A26EB0099E429 /* NetworkUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NetworkUtils.h; path = ../../../common/NetworkUtils.h; sourceTree = "<group>"; };
 		3CBB92F1248A26EB0099E429 /* NetworkUtils.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = NetworkUtils.m; path = ../../../common/NetworkUtils.m; sourceTree = "<group>"; };
 		3CC7E73223BEDE9700BE5561 /* RAPDFViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RAPDFViewController.h; path = "../../../common/WK PDF+Web/RAPDFViewController.h"; sourceTree = "<group>"; };
@@ -339,6 +351,14 @@
 		7115D4241E13B32800EF4E4C /* customerUI */ = {
 			isa = PBXGroup;
 			children = (
+				3C9FFAAD274B908E0067830C /* RTLabel.h */,
+				3C9FFAAE274B908E0067830C /* RTLabel.m */,
+				3C9FFAAB274B8FA20067830C /* EnumSelectViewController.h */,
+				3C9FFAAA274B8FA20067830C /* EnumSelectViewController.m */,
+				3C9FFAB0274B91610067830C /* EnumSelectorCell.h */,
+				3C9FFAB1274B91610067830C /* EnumSelectorCell.m */,
+				3C9FFAA8274B87DE0067830C /* TouchLabel.h */,
+				3C9FFAA7274B87DD0067830C /* TouchLabel.m */,
 				3C6B62832710324B00E74CF9 /* TouchImageView.h */,
 				3C6B62822710324B00E74CF9 /* TouchImageView.m */,
 				3C6B62862710325500E74CF9 /* CustomIOSAlertView.h */,
@@ -709,6 +729,7 @@
 				42D49E591F8DF15800AE39D5 /* AttributeLabelCell.m in Sources */,
 				3CC7E73423BEDE9700BE5561 /* RAPDFViewController.m in Sources */,
 				7128C2D91E12510900FF635B /* mztools.c in Sources */,
+				3C9FFAA9274B87DE0067830C /* TouchLabel.m in Sources */,
 				3CC7E73C23BEE07900BE5561 /* RANetwork.m in Sources */,
 				714A9AEF1E9CADA100371995 /* PendingDocumentsTableViewCell.m in Sources */,
 				7128C2EB1E12511B00FF635B /* NSString+Base64.m in Sources */,
@@ -720,6 +741,7 @@
 				7128C3411E12542000FF635B /* LoginViewController.m in Sources */,
 				713B97B11F79E0CB002B86BF /* dbgPageVC.m in Sources */,
 				7128C3461E12545C00FF635B /* CheckSelectorViewController.m in Sources */,
+				3C9FFAAF274B908E0067830C /* RTLabel.m in Sources */,
 				42D49E721F8DFF5000AE39D5 /* AttributeTableDataSourceAndDelegate.m in Sources */,
 				42DDB8791F91DCE8002CCE22 /* ControlTemplateCell.m in Sources */,
 				7128C2B81E1250CA00FF635B /* LineDrawable.m in Sources */,
@@ -731,6 +753,7 @@
 				7128C2DC1E12510900FF635B /* ZipArchive.mm in Sources */,
 				7128C3561E12548C00FF635B /* SignatureTableViewCell.m in Sources */,
 				3C6B62842710324B00E74CF9 /* TouchImageView.m in Sources */,
+				3C9FFAAC274B8FA20067830C /* EnumSelectViewController.m in Sources */,
 				7128C2B51E1250CA00FF635B /* GroupDrawable.m in Sources */,
 				714A9AEC1E9CA92000371995 /* PendingDocumentsViewController.m in Sources */,
 				3C6B62872710325500E74CF9 /* CustomIOSAlertView.m in Sources */,
@@ -764,6 +787,7 @@
 				714B37061E70F2BF00E99B90 /* SCShapeView.m in Sources */,
 				7128C2C61E1250FC00FF635B /* ImageUtils.m in Sources */,
 				7108773C1F79DACE00C18B95 /* PageViewController.m in Sources */,
+				3C9FFAB2274B91610067830C /* EnumSelectorCell.m in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};

+ 4 - 3
Ants Contract/Granite Expo eSign/Granite Expo eSign/RANetwork.m

@@ -343,7 +343,7 @@
         }
         
         NSString* offPrefix = jsobj[@"randcode"];
-        bool canModify = [jsobj[@"can_modify"] boolValue];
+        bool skip_verify = [jsobj[@"skip_save_verify"] boolValue];
         
         
         
@@ -351,7 +351,8 @@
         NSUserDefaults *defaults =[NSUserDefaults standardUserDefaults];
         
         
-       
+//        NSString* skip_save_verify = jsobj[@"skip_save_verify"];
+        
 
         
         NSMutableDictionary* user_info = [NSMutableDictionary new];
@@ -404,7 +405,7 @@
 //        appDelegate.bLogin = true;
         
         
-        [appDelegate Login:user pwd:password canModify:canModify offPrefix:offPrefix agentName:agentName];
+        [appDelegate Login:user pwd:password skip_verify:skip_verify offPrefix:offPrefix agentName:agentName];
         
         
 //        

+ 1 - 1
Ants Contract/Granite Expo eSign/Granite Expo eSign/config.h

@@ -18,7 +18,7 @@
 //#define ENCRYPT_OFF
 # ifdef DEBUG
     #define NO_SAVE_VERIFY false
-//    #define test_server
+    #define test_server
     #define DEBUG_PDFSIG false
 # else
     #define NO_SAVE_VERIFY false

+ 2 - 2
Ants Contract/common/AppDelegate.h

@@ -20,7 +20,7 @@ typedef NS_ENUM(NSInteger, AppAccessMode) {
 
 @property bool bEnable_Cache;
 @property bool bLogin;
-//@property bool bCanModify;
+@property bool skip_verify;
 //@property (strong,nonatomic) NSString* offPrefix;
 @property (strong,nonatomic) NSString* na_path;
 @property (strong,nonatomic) NSString* user;
@@ -28,7 +28,7 @@ typedef NS_ENUM(NSInteger, AppAccessMode) {
 @property (strong,nonatomic) NSString* build;
 @property (strong,nonatomic) NSString* agentName;
 -(void) Logout;
--(void) Login:(NSString* )user pwd:(NSString*) pwd canModify:(bool) canModify offPrefix:(NSString*) offPrefix agentName:(NSString*) name;
+-(void) Login:(NSString* )user pwd:(NSString*) pwd skip_verify:(bool) skip_verify offPrefix:(NSString*) offPrefix agentName:(NSString*) name;
 @property (strong,nonatomic) NSString* printerURL;
 @property (strong,nonatomic) NSMutableDictionary* shareFile;
 @property (assign) AppAccessMode accessMode;

+ 3 - 3
Ants Contract/common/AppDelegate.m

@@ -320,9 +320,9 @@
 - (void)applicationWillTerminate:(UIApplication *)application {
     // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
 }
--(void) Login:(NSString* )user pwd:(NSString*) pwd canModify:(bool) canModify offPrefix:(NSString*) offPrefix agentName:(NSString*) name
+-(void) Login:(NSString* )user pwd:(NSString*) pwd skip_verify:(bool) skip_verify offPrefix:(NSString*) offPrefix agentName:(NSString*) name
 {
- //   self.bCanModify = canModify;
+    self.skip_verify = skip_verify;
 //    self.offPrefix = offPrefix;
     self.user = user;
     self.password = pwd;
@@ -354,7 +354,7 @@
 //    [main_vc hideMenu];
 //    [main_vc switchToHome];
     self.user = nil;
- //   self.bCanModify = false;
+   self.skip_verify = false;
 //    self.offPrefix = nil;
     self.password=nil;
     self.bLogin = false;

+ 5 - 1
Ants Contract/common/DocumentPageViewController.m

@@ -1120,7 +1120,7 @@
     bool ret=true;
     int more=0;
     NSMutableArray* fields=[[NSMutableArray alloc] init];
-    
+    AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
     for(int i=0;i<[self.controlTemplate[@"count"] intValue];i++)
     {
         NSMutableDictionary* page =self.controlTemplate[[NSString stringWithFormat:@"page_%d",i]];
@@ -1130,9 +1130,13 @@
             NSString* type = control[@"type"];
             NSString* name = control[@"aname"];
             bool required = [control[@"required"] boolValue];
+            bool skip_verify = [control[@"skip_verify"] boolValue];
             
             if(required==false || [type.lowercaseString isEqualToString:@"ignor"])
                 continue;
+            
+            if(skip_verify&& appDelegate.skip_verify)
+                continue;
             if([type isEqualToString:@"Check"])
             {
                 NSArray* arr = control[@"value"];

+ 165 - 0
Ants Contract/common/PageViewController.m

@@ -22,6 +22,8 @@
 
 #import "RAUtils.h"
 #import "AppDelegate.h"
+#import "TouchLabel.h"
+#import "EnumSelectViewController.h"
 
 
 typedef enum {
@@ -309,6 +311,10 @@ typedef enum {
         {
             [self addTextView:control destView:self.editControlView index:i];
         }
+        if([control[@"type"] isEqualToString:@"TouchLabel"])
+        {
+            [self addTouchLabel:control destView:self.editControlView index:i];
+        }
         else if([control[@"type"] isEqualToString:@"Button"])
         {
             [self addButton:control destView:self.editControlView index:i];
@@ -624,6 +630,52 @@ typedef enum {
     
     
     
+    //UIColorFromARGB(0x4066ccff);
+    
+//    tv.backgroundColor = UIColorFromRGB(TV_BG);//[UIColor lightGrayColor];
+    //    tv.place
+    //    [btn setTitle:template[@"title"] forState:UIControlStateNormal];
+    //    ref addTarget:self action:@selector(manually_refresh) forControlEvents:UIControlEventValueChanged
+    
+    
+//    tv.delegate = self;
+    //    [btn addTarget:self action:@selector(ControlButtonClicked:) forControlEvents:UIControlEventTouchUpInside];
+    if(DEBUG_PDFSIG)
+    {
+        
+        [label setBackgroundColor:[UIColor grayColor]];
+         
+    }
+    [destView addSubview:label];
+}
+-(void) addTouchLabel:(NSMutableDictionary*) template destView:(UIView*)destView index:(int) index
+{
+        CGRect srect=[self scaleControl:CGRectMake([template[@"pos_x"] floatValue], [template[@"pos_y"] floatValue], [template[@"width"] floatValue], [template[@"height"] floatValue]) from:CGSizeMake(768, 960) to:destView.frame.size];
+    TouchLabel * label  = [[TouchLabel alloc] initWithFrame:srect] ;
+    float fontsize = [template[@"size"] floatValue];
+    if(fontsize==0)
+        fontsize=10;
+    [label setFont:[UIFont systemFontOfSize:fontsize]];
+    
+    NSString * alignment=template[@"textAlignment"];
+    
+    if([alignment.lowercaseString isEqualToString:@"center"])
+        label.textAlignment=NSTextAlignmentCenter;
+    else if([alignment.lowercaseString isEqualToString:@"left"])
+        label.textAlignment=NSTextAlignmentLeft;
+    else if([alignment.lowercaseString isEqualToString:@"right"])
+        label.textAlignment=NSTextAlignmentRight;
+    label.backgroundColor = UIColorFromRGB(TV_BG);//[UIColor lightGrayColor];
+    UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(LabelTap:)];
+    //            tap.minimumPressDuration = 0.8; //定义按的时间
+    [label addGestureRecognizer:tap];
+
+    label.text =template[@"value"];
+    
+    label.tag = index+ CONTROL_BASE;
+    
+    
+    
     //UIColorFromARGB(0x4066ccff);
     
 //    tv.backgroundColor = UIColorFromRGB(TV_BG);//[UIColor lightGrayColor];
@@ -643,6 +695,119 @@ typedef enum {
     [destView addSubview:label];
 }
 
+-(void)LabelTap:(UILongPressGestureRecognizer*)gestureRecognizer {
+    
+    long index = gestureRecognizer.view.tag - CONTROL_BASE;
+    
+    
+    DebugLog(@"LabelTap tag = %ld",index);
+    
+    NSMutableDictionary* control_json = self.page_controlTemplate [[NSString stringWithFormat:@"control_%ld",index] ];
+    
+    
+    
+    NSString* action = control_json[@"action"];
+    if ([action isEqualToString:@"enum"])
+    {
+        NSMutableDictionary* cadedate = control_json[@"cadedate"];
+        
+        
+        EnumSelectViewController* enumvc =[[UIStoryboard storyboardWithName:@"CommonEditor" bundle:nil] instantiateViewControllerWithIdentifier:@"EnumSelectorViewController"];
+        
+        enumvc.max_select = 1;
+        
+        
+        enumvc.cadedate = cadedate;
+        enumvc.title = @"";
+        
+        
+        enumvc.single_select =true;
+        
+        __weak typeof(self) weakSelf = self;
+        
+        enumvc.returnValue = ^(NSMutableDictionary* value){
+            control_json[@"cadedate"]=value;
+            int count = [[value valueForKey:@"count"] intValue];
+            for(int i=0;i<count;i++)
+            {
+                NSDictionary* val_json =[value objectForKey:[NSString stringWithFormat:@"val_%d",i]];
+                int check = [[val_json valueForKey:@"check"] intValue];
+                if(check==1)
+                {
+                    TouchLabel* label = (TouchLabel*)gestureRecognizer.view;
+                    label.text = [val_json valueForKey:@"value"];
+                    control_json[@"value"]= [val_json valueForKey:@"value"];
+                    break;
+                }
+            }
+            
+//            if (weakSelf) {
+//                __strong typeof(weakSelf) strongSelf = weakSelf;
+//                [strongSelf changePriceType:[strongSelf checkedCadedate:value]];
+//            }
+            
+        };
+        
+        [self presentViewController:enumvc animated:true completion:nil];
+        
+    }
+    
+    
+ 
+    
+    
+    //    if(gestureRecognizer.view.tag - self.basetag < MAX_COLUMN) //header
+    //        return;
+    
+//    [UIView beginAnimations:nil context:nil];
+//    [UIView setAnimationDuration:0.65];
+//    long row = gestureRecognizer.view.tag/self.column_count;
+//    long column = gestureRecognizer.view.tag%self.column_count;
+//    if(self.fullrowselect)
+//    {
+//
+//        for(int i=0;i<self.column_count;i++)
+//        {
+//            [self viewWithTag:(row*self.column_count+i)].alpha = 0.5;
+//        }
+//        for(int i=0;i<self.column_count;i++)
+//        {
+//            [self viewWithTag:(row*self.column_count+i)].alpha = 1.0;
+//        }
+//
+//    }
+//    else
+//    {
+//        gestureRecognizer.view.alpha=0.5;
+//        gestureRecognizer.view.alpha=1;
+//
+//    }
+//    [UIView commitAnimations];
+//
+//
+//    if(self.fullrowselect)
+//    {
+//        if (self.griddelegate && [self.griddelegate respondsToSelector:@selector(Tap:row:)])
+//            [griddelegate Tap:gestureRecognizer.view row:row];
+//    }
+//    else
+//        if (self.griddelegate && [self.griddelegate respondsToSelector:@selector(Tap:row:column:)])
+//            [griddelegate Tap:gestureRecognizer.view row:row column:column];
+    
+    //    TouchLabel* label = (TouchLabel*)gestureRecognizer.view;
+    //
+    //
+    //
+    //
+    //
+    //    NSString * url =[self.hrefs valueForKey:label.text];
+    //    if(url!=nil)
+    //    {
+    //        label.textColor = [UIColor purpleColor];
+    //        [griddelegate Tap:label url:url];//first row is header;
+    //    }
+    
+}
 -(void) addButton:(NSMutableDictionary*) template destView:(UIView*)destView index:(int) index
 {
             CGRect srect=[self scaleControl:CGRectMake([template[@"pos_x"] floatValue], [template[@"pos_y"] floatValue], [template[@"width"] floatValue], [template[@"height"] floatValue]) from:CGSizeMake(768, 960) to:destView.frame.size];

Неке датотеке нису приказане због велике количине промена