Răsfoiți Sursa

Modify the template editor to support list type controls -- 修改模版编辑器,支持列表类型控件(resolve: #14786)

Ray Zhang 4 ani în urmă
părinte
comite
1afe1c887a

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

@@ -919,7 +919,7 @@
 			isa = XCBuildConfiguration;
 			isa = XCBuildConfiguration;
 			buildSettings = {
 			buildSettings = {
 				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
 				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
-				CURRENT_PROJECT_VERSION = 49919;
+				CURRENT_PROJECT_VERSION = 49922;
 				DEVELOPMENT_TEAM = HXWLAA5YN5;
 				DEVELOPMENT_TEAM = HXWLAA5YN5;
 				INFOPLIST_FILE = "Granite Expo eSign/Info.plist";
 				INFOPLIST_FILE = "Granite Expo eSign/Info.plist";
 				IPHONEOS_DEPLOYMENT_TARGET = 12.0;
 				IPHONEOS_DEPLOYMENT_TARGET = 12.0;
@@ -934,7 +934,7 @@
 			isa = XCBuildConfiguration;
 			isa = XCBuildConfiguration;
 			buildSettings = {
 			buildSettings = {
 				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
 				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
-				CURRENT_PROJECT_VERSION = 49919;
+				CURRENT_PROJECT_VERSION = 49922;
 				DEVELOPMENT_TEAM = HXWLAA5YN5;
 				DEVELOPMENT_TEAM = HXWLAA5YN5;
 				INFOPLIST_FILE = "Granite Expo eSign/Info.plist";
 				INFOPLIST_FILE = "Granite Expo eSign/Info.plist";
 				IPHONEOS_DEPLOYMENT_TARGET = 12.0;
 				IPHONEOS_DEPLOYMENT_TARGET = 12.0;

+ 2 - 0
Ants Contract/Granite Expo eSign/Granite Expo eSign/DocumentTemplateViewController.h

@@ -35,6 +35,8 @@
 - (void)selectControl:(NSDictionary *)controlItem index:(NSInteger)index;
 - (void)selectControl:(NSDictionary *)controlItem index:(NSInteger)index;
 - (void)selectCheck:(NSDictionary *)controlItem Section:(NSInteger)section Row:(NSInteger)row;
 - (void)selectCheck:(NSDictionary *)controlItem Section:(NSInteger)section Row:(NSInteger)row;
 - (void)updatePageControlProperty:(NSDictionary *)control_dic forIndex:(NSInteger)index Row:(NSInteger)row updateItemList:(BOOL)updateItemList;
 - (void)updatePageControlProperty:(NSDictionary *)control_dic forIndex:(NSInteger)index Row:(NSInteger)row updateItemList:(BOOL)updateItemList;
+- (void)selectList:(NSDictionary *)control Section:(NSInteger)section Row:(NSInteger)row;
 - (void)deleteCheckItemAtSection:(NSInteger)section Row:(NSInteger)row;
 - (void)deleteCheckItemAtSection:(NSInteger)section Row:(NSInteger)row;
 - (void)addCheckOptionForSection:(NSInteger)section;
 - (void)addCheckOptionForSection:(NSInteger)section;
+- (void)addListItemForSection:(NSInteger)section;
 @end
 @end

+ 33 - 3
Ants Contract/Granite Expo eSign/Granite Expo eSign/DocumentTemplateViewController.m

@@ -34,7 +34,7 @@
 #import "ItemTableDataSourceAndDelegate.h"
 #import "ItemTableDataSourceAndDelegate.h"
 #import "AttributeTableDataSourceAndDelegate.h"
 #import "AttributeTableDataSourceAndDelegate.h"
 #import "ControlTemplateVC.h"
 #import "ControlTemplateVC.h"
-
+#import "TouchLabel.h"
 @interface DocumentTemplateViewController () <TemplateUpdateControlFrame,TemplateSelectionDelegate>
 @interface DocumentTemplateViewController () <TemplateUpdateControlFrame,TemplateSelectionDelegate>
 
 
 @property (strong, nonatomic) IBOutlet UIView *positionControlBackground;
 @property (strong, nonatomic) IBOutlet UIView *positionControlBackground;
@@ -1343,12 +1343,25 @@
             if (tf.text == nil || tf.text.length == 0) {
             if (tf.text == nil || tf.text.length == 0) {
                 [tf setText:@"Text"];
                 [tf setText:@"Text"];
             }
             }
-        } else if ([self.focusView isKindOfClass:[UILabel class]]) {
+        }
+        else if ([self.focusView isKindOfClass:[UILabel class]])
+        {
             UILabel *lb = (UILabel *)self.focusView;
             UILabel *lb = (UILabel *)self.focusView;
             if (lb.text == nil || lb.text.length == 0) {
             if (lb.text == nil || lb.text.length == 0) {
                 [lb setText:@"Text"];
                 [lb setText:@"Text"];
             }
             }
-        } else if ([self.focusView isKindOfClass:[UIButton class]]) {
+ 
+        }
+        else if ([self.focusView isKindOfClass:[TouchLabel class]])
+        {
+            TouchLabel *lb = (TouchLabel *)self.focusView;
+            if (lb.text == nil || lb.text.length == 0) {
+                [lb setText:@"Text"];
+            }
+ 
+        }
+
+        else if ([self.focusView isKindOfClass:[UIButton class]]) {
             UIButton *btn = (UIButton *)self.focusView;
             UIButton *btn = (UIButton *)self.focusView;
             NSString *str = [btn titleForState:UIControlStateNormal];
             NSString *str = [btn titleForState:UIControlStateNormal];
             if (str == nil || str.length == 0) {
             if (str == nil || str.length == 0) {
@@ -1441,7 +1454,11 @@
     }
     }
     
     
 }
 }
+- (void)selectList:(NSDictionary *)control Section:(NSInteger)section Row:(NSInteger)row {
+
+    [self.attrTableDataSource changeListItemData:[control mutableCopy] forSection:section Row:row];
 
 
+}
 - (void)selectCheck:(NSDictionary *)control Section:(NSInteger)section Row:(NSInteger)row {
 - (void)selectCheck:(NSDictionary *)control Section:(NSInteger)section Row:(NSInteger)row {
 
 
     [self.attrTableDataSource changeCheckOptionData:[control mutableCopy] forSection:section Row:row];
     [self.attrTableDataSource changeCheckOptionData:[control mutableCopy] forSection:section Row:row];
@@ -1534,6 +1551,9 @@
             key = @"Check_1";
             key = @"Check_1";
         }
         }
             break;
             break;
+        case TemplateStyleTouchLabel: {
+            key = @"Touch_Label";
+        }
         default:
         default:
             break;
             break;
     }
     }
@@ -1567,5 +1587,15 @@
     
     
     [self clickItem:marker_tag];
     [self clickItem:marker_tag];
 }
 }
+- (void)addListItemForSection:(NSInteger)section {
+    NSString *path = [[NSBundle mainBundle] pathForResource:@"template_example.json" ofType:nil];
+    NSData *json_data = [NSData dataWithContentsOfFile:path];
+    NSDictionary *template = [NSJSONSerialization JSONObjectWithData:json_data options:NSJSONReadingMutableLeaves error:nil];
+    NSDictionary *item = [template objectForKey:@"List_Item"];
+    NSInteger marker_tag = [self.currentPageViewController addListItem:item ForSection:section];
+    [self.itemTableDataSource changeData:self.currentPageViewController.page_controlTemplate];
+    
+    [self clickItem:marker_tag];
+}
 
 
 @end
 @end

+ 1 - 1
Ants Contract/Granite Expo eSign/Granite Expo eSign/Template Attributes /AttributeTableDataSourceAndDelegate.h

@@ -27,5 +27,5 @@ typedef enum : NSUInteger {
 
 
 - (void)changeData:(NSMutableDictionary *)data type:(ItemType)type forIndex:(NSInteger)index;
 - (void)changeData:(NSMutableDictionary *)data type:(ItemType)type forIndex:(NSInteger)index;
 - (void)changeCheckOptionData:(NSMutableDictionary *)data forSection:(NSInteger)section Row:(NSInteger)row;
 - (void)changeCheckOptionData:(NSMutableDictionary *)data forSection:(NSInteger)section Row:(NSInteger)row;
-
+- (void)changeListItemData:(NSMutableDictionary *)data forSection:(NSInteger)section Row:(NSInteger)row;
 @end
 @end

+ 31 - 0
Ants Contract/Granite Expo eSign/Granite Expo eSign/Template Attributes /AttributeTableDataSourceAndDelegate.m

@@ -29,6 +29,7 @@ typedef enum {
 @property (nonatomic,assign) NSInteger data_row;
 @property (nonatomic,assign) NSInteger data_row;
 @property (nonatomic,assign) BOOL check_option;
 @property (nonatomic,assign) BOOL check_option;
 
 
+
 @end
 @end
 
 
 
 
@@ -44,6 +45,23 @@ typedef enum {
     return self;
     return self;
 }
 }
 
 
+- (void)changeListItemData:(NSMutableDictionary *)data forSection:(NSInteger)section Row:(NSInteger)row {
+    self.check_option = NO;
+    [self.tableView endEditing:YES];
+    self.data_index = section;
+    self.data_row = row;
+    
+    NSString *path = [[NSBundle mainBundle] pathForResource:@"attribute_template.json" ofType:nil];
+    NSData *json_data = [NSData dataWithContentsOfFile:path];
+    NSDictionary *template = [NSJSONSerialization JSONObjectWithData:json_data options:NSJSONReadingMutableLeaves error:nil];
+    
+    self.template_data = [[template objectForKey:@"List_Item"] mutableCopy];
+    [self.template_data removeObjectForKey:@"size&position"];
+    
+    self.data = data;
+    
+    [self.tableView reloadData];
+}
 - (void)changeCheckOptionData:(NSMutableDictionary *)data forSection:(NSInteger)section Row:(NSInteger)row {
 - (void)changeCheckOptionData:(NSMutableDictionary *)data forSection:(NSInteger)section Row:(NSInteger)row {
     self.check_option = YES;
     self.check_option = YES;
     [self.tableView endEditing:YES];
     [self.tableView endEditing:YES];
@@ -201,7 +219,20 @@ typedef enum {
                 }
                 }
                 
                 
             } else {
             } else {
+                
+                if([self.data[@"type"] isEqualToString:@"TouchLabel"])
+                {
+                    value = [item objectForKey:@"value"];
+                    if (value == nil) {
+                        NSMutableDictionary* cadedate = [self.data[@"cadedate"] mutableCopy];
+                        NSMutableDictionary *item = [cadedate[[NSString stringWithFormat:@"val+%d",self.data_row] ] mutableCopy];
+                        value = item[@"value"];
+                    }
+                }
+                else
                 value = [self.data objectForKey:key];
                 value = [self.data objectForKey:key];
+                
+                
             }
             }
             [cell setTitle:title value:value forKey:key];
             [cell setTitle:title value:value forKey:key];
             cell.valueChangeBlock = ^(NSString *value, NSString *key) {
             cell.valueChangeBlock = ^(NSString *value, NSString *key) {

+ 2 - 1
Ants Contract/Granite Expo eSign/Granite Expo eSign/Template Attributes /ControlTemplateVC.h

@@ -16,7 +16,8 @@ typedef enum : NSUInteger {
     TemplateStyleButton         = 4,
     TemplateStyleButton         = 4,
     TemplateStyleCheck          = 5,
     TemplateStyleCheck          = 5,
     TemplateStyleDatePicker     = 6,
     TemplateStyleDatePicker     = 6,
-    TemplateStyleCheckNoMarker  = 7
+    TemplateStyleCheckNoMarker  = 7,
+    TemplateStyleTouchLabel  = 8
 } TemplateStyle;
 } TemplateStyle;
 
 
 @protocol TemplateSelectionDelegate<NSObject>
 @protocol TemplateSelectionDelegate<NSObject>

+ 13 - 2
Ants Contract/Granite Expo eSign/Granite Expo eSign/Template Attributes /ItemTableDataSourceAndDelegate.m

@@ -61,7 +61,12 @@
     } else {
     } else {
         cell = [self.tableView cellForRowAtIndexPath:[NSIndexPath indexPathForRow:row inSection:section]];
         cell = [self.tableView cellForRowAtIndexPath:[NSIndexPath indexPathForRow:row inSection:section]];
         NSDictionary *control = [self.data objectForKey:[NSString stringWithFormat:@"control_%ld",section]];
         NSDictionary *control = [self.data objectForKey:[NSString stringWithFormat:@"control_%ld",section]];
-        [self.table_vc selectCheck:control Section:section Row:row];
+        if([control[@"type"] isEqualToString:@"TouchLabel"])
+        {
+            [self.table_vc selectList:control Section:section Row:row];
+        }
+        else
+            [self.table_vc selectCheck:control Section:section Row:row];
     }
     }
     cell.backgroundColor = CELL_SELECTED_COLOR;
     cell.backgroundColor = CELL_SELECTED_COLOR;
     self.selectedCell = cell;
     self.selectedCell = cell;
@@ -140,12 +145,18 @@
     NSDictionary *control = [self.data objectForKey:[NSString stringWithFormat:@"control_%ld",section]];
     NSDictionary *control = [self.data objectForKey:[NSString stringWithFormat:@"control_%ld",section]];
     __weak typeof(self) weakSelf = self;
     __weak typeof(self) weakSelf = self;
     // add check
     // add check
-    if ([control objectForKey:@"marker_size"] != nil) {
+    if ([control objectForKey:@"marker_size"] != nil ||[control[@"type"] isEqualToString:@"TouchLabel"]) {
         cell.hideAddBtn = NO;
         cell.hideAddBtn = NO;
     } else {
     } else {
         cell.hideAddBtn = YES;
         cell.hideAddBtn = YES;
     }
     }
     cell.addCheckBlock = ^{
     cell.addCheckBlock = ^{
+        
+        if([control[@"type"] isEqualToString:@"TouchLabel"])
+        {
+            [weakSelf.table_vc addListItemForSection:section];
+        }
+        else
         [weakSelf.table_vc addCheckOptionForSection:section];
         [weakSelf.table_vc addCheckOptionForSection:section];
     };
     };
     
     

+ 1 - 0
Ants Contract/Granite Expo eSign/Granite Expo eSign/TemplateViewController.h

@@ -54,4 +54,5 @@
 - (void) deleteControl:(UIView *)controlView;
 - (void) deleteControl:(UIView *)controlView;
 - (void) deleteCheckItemAtSection:(NSInteger)section Row:(NSInteger)row;
 - (void) deleteCheckItemAtSection:(NSInteger)section Row:(NSInteger)row;
 - (NSInteger)addCheckOption:(NSArray *)option ForSection:(NSInteger)section;
 - (NSInteger)addCheckOption:(NSArray *)option ForSection:(NSInteger)section;
+- (NSInteger)addListItem:(NSDictionary *)item ForSection:(NSInteger)section;
 @end
 @end

+ 79 - 1
Ants Contract/Granite Expo eSign/Granite Expo eSign/TemplateViewController.m

@@ -24,6 +24,7 @@
 
 
 #import "RAUtils.h"
 #import "RAUtils.h"
 #import "AppDelegate.h"
 #import "AppDelegate.h"
+#import "TouchLabel.h"
 
 
 
 
 typedef enum {
 typedef enum {
@@ -495,6 +496,65 @@ typedef enum {
     }
     }
     return nil;
     return nil;
     
     
+}
+-(void) addTouchLabel:(NSMutableDictionary*) template destView:(UIView*)destView index:(int) index update:(BOOL)update
+{
+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 *)[destView viewWithTag:index+ CONTROL_BASE];
+if (label) {
+    label.frame = srect;
+} else {
+    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;
+
+
+if (!update) {
+    label.text =template[@"value"];
+}
+
+label.tag = index+ CONTROL_BASE;
+
+
+//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)
+{
+    
+    if (!update) {
+        [label setBackgroundColor:[UIColor grayColor]];
+    }
+    
+}
+
+if (!update) {
+    UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapRecognizer:)];
+    [label addGestureRecognizer:tap];
+    label.userInteractionEnabled = YES;
+}
+
+[destView addSubview:label];
 }
 }
 -(void) addTextView:(NSMutableDictionary*) template destView:(UIView*)destView index:(int) index update:(BOOL)update
 -(void) addTextView:(NSMutableDictionary*) template destView:(UIView*)destView index:(int) index update:(BOOL)update
 {
 {
@@ -2462,6 +2522,10 @@ typedef enum {
         [self addDatePicker:[control mutableCopy] destView:self.editControlView index:(int)count update:NO];
         [self addDatePicker:[control mutableCopy] destView:self.editControlView index:(int)count update:NO];
         
         
     }
     }
+    else if([control[@"type"] isEqualToString:@"TouchLabel"])
+    {
+        [self addTouchLabel:[control mutableCopy] destView:self.editControlView index:(int)count update:NO];
+    }
     
     
     // 更新数据
     // 更新数据
     NSString *key = [NSString stringWithFormat:@"control_%ld",count];
     NSString *key = [NSString stringWithFormat:@"control_%ld",count];
@@ -2523,7 +2587,21 @@ typedef enum {
     // 刷新视图
     // 刷新视图
     [self viewWillLayoutSubviews];
     [self viewWillLayoutSubviews];
 }
 }
-
+- (NSInteger)addListItem:(NSDictionary *)item ForSection:(NSInteger)section {
+    NSString *control_key = [NSString stringWithFormat:@"control_%ld",section];
+    NSMutableDictionary *control = [[self.page_controlTemplate objectForKey:control_key] mutableCopy];
+    NSMutableDictionary *cadedate = [[control objectForKey:@"cadedate"] mutableCopy];
+    int count = [cadedate[@"count"] intValue];
+    cadedate[[NSString stringWithFormat:@"val_%d",count] ]=item;
+    count++;
+    cadedate[@"count"]=[NSNumber numberWithInt:count];
+    
+    [control setObject:cadedate forKey:@"cadedate"];
+    [self.page_controlTemplate setObject:control forKey:control_key];
+    
+    NSInteger tag = CHECK_BASE+section*1000+(count-1);
+    return tag;
+}
 - (NSInteger)addCheckOption:(NSArray *)option ForSection:(NSInteger)section {
 - (NSInteger)addCheckOption:(NSArray *)option ForSection:(NSInteger)section {
     NSString *control_key = [NSString stringWithFormat:@"control_%ld",section];
     NSString *control_key = [NSString stringWithFormat:@"control_%ld",section];
     NSMutableDictionary *control = [[self.page_controlTemplate objectForKey:control_key] mutableCopy];
     NSMutableDictionary *control = [[self.page_controlTemplate objectForKey:control_key] mutableCopy];

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

@@ -19,7 +19,7 @@
 # ifdef DEBUG
 # ifdef DEBUG
     #define NO_SAVE_VERIFY false
     #define NO_SAVE_VERIFY false
     #define test_server
     #define test_server
-    #define DEBUG_PDFSIG false
+    #define DEBUG_PDFSIG true
 # else
 # else
     #define NO_SAVE_VERIFY false
     #define NO_SAVE_VERIFY false
     #define DEBUG_PDFSIG false
     #define DEBUG_PDFSIG false

+ 54 - 0
Ants Contract/Granite Expo eSign/attribute_template.json

@@ -328,5 +328,59 @@
                 "title": "Title"
                 "title": "Title"
             }
             }
         }
         }
+    },
+    "Touch_Label":{
+        "Information": {
+            "type": {
+                "type": 1,
+                "title": "Type",
+                "key": "type",
+                "disable": true
+            },
+            "dirty": {
+                "type": 2,
+                "title": "Dirty",
+                "key": "dirty",
+                "disable": true
+            }
+        },
+        "Property": {
+            "Font Size": {
+                "type": 0,
+                "title": "Font Size",
+                "key": "size"
+            },
+            "Required": {
+                "type": 2,
+                "title": "Required",
+                "key": "required"
+            },
+            "Filed": {
+                "type": 0,
+                "title": "Field",
+                "key": "field"
+            },
+            "aname": {
+                "type": 0,
+                "title": "Aname",
+                "key": "aname"
+            }
+        }
+    },
+        "List_Item": {
+        "Information": {
+            "type": {
+                "type": 1,
+                "title": "Type",
+                "value": "List Item",
+                "disable": true
+            }
+        },
+        "Property": {
+            "title": {
+                "type": 0,
+                "title": "Title"
+            }
+        }
     }
     }
 }
 }

+ 156 - 135
Ants Contract/Granite Expo eSign/template_example.json

@@ -1,138 +1,159 @@
 {
 {
-    "TextView": {
-        "textAlignment": "center",
-        "width": 80,
-        "tv_vmargin": 0.3,
-        "aname": "New Add TextView",
-        "type": "TextView",
-        "size": "10",
-        "pos_y": 0,
-        "field": "new add",
-        "value": "",
-        "dirty": false,
-        "height": 20,
-        "margin_top": "2",
-        "required": true,
-        "pos_x": 0
+  "TextView": {
+    "textAlignment": "center",
+    "width": 80,
+    "tv_vmargin": 0.3,
+    "aname": "New Add TextView",
+    "type": "TextView",
+    "size": "10",
+    "pos_y": 0,
+    "field": "new add",
+    "value": "",
+    "dirty": false,
+    "height": 20,
+    "margin_top": "2",
+    "required": true,
+    "pos_x": 0
+  },
+  "Label": {
+    "height": 30,
+    "textAlignment": "center",
+    "pos_x": 0,
+    "width": 100,
+    "size": "8",
+    "field": "new add",
+    "pos_y": 0,
+    "type": "Label",
+    "required": true,
+    "value": "",
+    "dirty": false
+  },
+  "Signature": {
+    "required_validation": true,
+    "validation_code": "1111",
+    "name": "new Add Signature",
+    "width": 100,
+    "pos_y": 0,
+    "aname": "new add Signature",
+    "linewidth": 8,
+    "type": "Signature",
+    "height": 30,
+    "value": "",
+    "dirty": false,
+    "required": true,
+    "pos_x": 0
+  },
+  "Image": {
+    "height": 30,
+    "pos_x": 0,
+    "dirty": false,
+    "width": 100,
+    "value": "",
+    "type": "Image",
+    "pos_y": 0,
+    "name": "new Add Image",
+    "required": true
+  },
+  "Button": {
+    "disable": true,
+    "textAlignment": "center",
+    "width": 100,
+    "pos_y": 0,
+    "aname": "new add Button",
+    "type": "Button",
+    "field": "new add Button",
+    "value": "NA",
+    "dirty": false,
+    "height": 30,
+    "margin_left": "4",
+    "margin_top": "1",
+    "required": true,
+    "pos_x": 0
+  },
+  "DatePicker": {
+    "disable": true,
+    "textAlignment": "center",
+    "width": 100,
+    "pos_y": 0,
+    "aname": "new add DatePicker",
+    "type": "DatePicker",
+    "field": "new add DatePicker",
+    "value": "NA",
+    "dirty": false,
+    "height": 30,
+    "margin_left": "4",
+    "margin_top": "1",
+    "required": true,
+    "pos_x": 0
+  },
+  "Check_0": {
+    "width": 100,
+    "pos_y": 0,
+    "aname": "new add Check",
+    "type": "Check",
+    "field": "new add check",
+    "title": "new add check",
+    "single_select": false,
+    "show_detail": false,
+    "value": [],
+    "height": 70,
+    "dirty": false,
+    "marker_size": 6,
+    "cadedate": [],
+    "required": true,
+    "pos_x": 0
+  },
+  "Check_1": {
+    "width": 100,
+    "pos_y": 0,
+    "aname": "new add check no marker",
+    "type": "Check",
+    "field": "new add check no marker",
+    "title": "new add check no marker",
+    "single_select": false,
+    "show_detail": false,
+    "value": [],
+    "height": 70,
+    "dirty": false,
+    "cadedate": [],
+    "required": true,
+    "pos_x": 0
+  },
+  "Check_Option": [
+    [
+      "New Add Check Option",
+      "New Add Check Option"
+    ],
+    [
+      0,
+      0,
+      0,
+      0
+    ]
+  ],
+  "Touch_Label": {
+    "textAlignment": "center",
+    "width": 100,
+    "tv_vmargin": "0.4",
+    "aname": "Contractor",
+    "type": "TouchLabel",
+    "action": "enum",
+    "cadedate": {
+      "count": 0
     },
     },
-    "Label": {
-        "height": 30,
-        "textAlignment": "center",
-        "pos_x": 0,
-        "width": 100,
-        "size": "8",
-        "field": "new add",
-        "pos_y": 0,
-        "type": "Label",
-        "required": true,
-        "value": "",
-        "dirty": false
-    },
-    "Signature": {
-        "required_validation": true,
-        "validation_code": "1111",
-        "name": "new Add Signature",
-        "width": 100,
-        "pos_y": 0,
-        "aname": "new add Signature",
-        "linewidth": 8,
-        "type": "Signature",
-        "height": 30,
-        "value": "",
-        "dirty": false,
-        "required": true,
-        "pos_x": 0
-    },
-    "Image": {
-        "height": 30,
-        "pos_x": 0,
-        "dirty": false,
-        "width": 100,
-        "value": "",
-        "type": "Image",
-        "pos_y": 0,
-        "name": "new Add Image",
-        "required": true
-    },
-    "Button": {
-        "disable": true,
-        "textAlignment": "center",
-        "width": 100,
-        "pos_y": 0,
-        "aname": "new add Button",
-        "type": "Button",
-        "field": "new add Button",
-        "value": "NA",
-        "dirty": false,
-        "height": 30,
-        "margin_left": "4",
-        "margin_top": "1",
-        "required": true,
-        "pos_x": 0
-    },
-    "DatePicker": {
-        "disable": true,
-        "textAlignment": "center",
-        "width": 100,
-        "pos_y": 0,
-        "aname": "new add DatePicker",
-        "type": "DatePicker",
-        "field": "new add DatePicker",
-        "value": "NA",
-        "dirty": false,
-        "height": 30,
-        "margin_left": "4",
-        "margin_top": "1",
-        "required": true,
-        "pos_x": 0
-    },
-    "Check_0": {
-        "width": 100,
-        "pos_y": 0,
-        "aname": "new add Check",
-        "type": "Check",
-        "field": "new add check",
-        "title": "new add check",
-        "single_select": false,
-        "show_detail": false,
-        "value": [
-        ],
-        "height": 70,
-        "dirty": false,
-        "marker_size": 6,
-        "cadedate": [
-        ],
-        "required": true,
-        "pos_x": 0
-    },
-    "Check_1": {
-        "width": 100,
-        "pos_y": 0,
-        "aname": "new add check no marker",
-        "type": "Check",
-        "field": "new add check no marker",
-        "title": "new add check no marker",
-        "single_select": false,
-        "show_detail": false,
-        "value": [
-        ],
-        "height": 70,
-        "dirty": false,
-        "cadedate": [
-        ],
-        "required": true,
-        "pos_x": 0
-    },
-    "Check_Option" : [
-                      [
-                       "New Add Check Option",
-                       "New Add Check Option"
-                       ],
-                      [
-                       0,
-                       0,
-                       0,
-                       0
-                       ]
-                      ]
+    "size": "8",
+    "pos_y": 0,
+    "field": "p4_contractor",
+    "value": "",
+    "dirty": false,
+    "height": 20,
+    "margin_top": "2",
+    "required": false,
+    "pos_x": 0
+  },
+  "List_Item": {
+      "check": 0,
+      "value": "",
+      "value_id": 0
+    }
 }
 }

+ 4 - 0
Ants Contract/Granite Expo eSign/template_type.json

@@ -30,5 +30,9 @@
  {
  {
  "type": 7,
  "type": 7,
  "title": "Check (No Marker)"
  "title": "Check (No Marker)"
+ },
+ {
+ "type": 8,
+ "title": "Touch Label"
  }
  }
 ]
 ]