Przeglądaj źródła

The common editor adds the noneoverride attribute, which is used to determine that the specified field will not be overwritten by the input after it is refreshed. -- common editor 增加 noneoverride 属性,用于判断指定字段刷新后不被输入覆盖(resolve: #14798)

Ray Zhang 4 lat temu
rodzic
commit
33f3bc4020

+ 3 - 2
common/customUI/commoneditor/CommonEditorCellModel.m

@@ -6,10 +6,11 @@
 //  Copyright (c) 2014年 United Software Applications, Inc. All rights reserved.
 //
 
+#import "config.h"
 #import "CommonEditorCellModel.h"
 #import "RAUtils.h"
-#if defined(BUILD_NPD)
-#import "BundleModelViewController.h"
+#if defined(BUILD_NPD) || defined (BUILD_CONTRAST)
+    #import "BundleModelViewController.h"
 
 #endif
 

+ 9 - 9
common/customUI/commoneditor/CommonEditorViewController.m

@@ -235,7 +235,7 @@
             appDelegate=(AppDelegate*)[[UIApplication sharedApplication] delegate];
         });
 //        AppDelegate *appDelegate = (AppDelegate *)[UIApplication sharedApplication].delegate;
-        NSDictionary *urgencyDic = [appDelegate globalParameterForKey:@"urgencyDic"];
+        NSDictionary *urgencyDic = [RASingleton.sharedInstance globalParameterForKey:@"urgencyDic"];
         
         id count = [urgencyDic objectForKey:@"count"];
         
@@ -1356,7 +1356,7 @@ if(!self.alert.isBeingDismissed)
             NSMutableDictionary * itemjson=[[sectionjson objectForKey:[NSString stringWithFormat:@"item_%d",j ]] mutableCopy];
             //             NSMutableDictionary * to_itemjson=[[to_sectionjson objectForKey:[NSString stringWithFormat:@"item_%d",j ]] mutableCopy];
             
-            if([[itemjson valueForKey:@"dirty"] isEqualToString:@"true"])
+            if([[itemjson valueForKey:@"dirty"] isEqualToString:@"true"] && [itemjson[@"noneoverride"] boolValue]!=true)
             {
                 int toindex = -1;
                 for(int l=0;l<[to_sectionjson[@"count"] intValue];l++)
@@ -3846,8 +3846,8 @@ if(!self.alert.isBeingDismissed)
                     // 此处应移动到erp mobile 项目内
                     if([type isEqualToString:@"price"])
                     {
-                        BOOL can_see_price = [[appDelegate globalParameterForKey:@"can_see_price"] boolValue];
-                        BOOL price_hidden = [[appDelegate globalParameterForKey:@"price_hidden"] boolValue];
+                        BOOL can_see_price = [[RASingleton.sharedInstance globalParameterForKey:@"can_see_price"] boolValue];
+                        BOOL price_hidden = [[RASingleton.sharedInstance globalParameterForKey:@"price_hidden"] boolValue];
                         
                         if(can_see_price&&price_hidden==false)
                         {
@@ -4285,8 +4285,8 @@ if(!self.alert.isBeingDismissed)
             NSString* totalprice = [NSString stringWithFormat:@"%.2f",(unitprice* (1.0-discount/100)+dprice)*count];
             
             
-            BOOL can_see_price = [[appDelegate globalParameterForKey:@"can_see_price"] boolValue];
-            BOOL price_hidden = [[appDelegate globalParameterForKey:@"price_hidden"] boolValue];
+            BOOL can_see_price = [[RASingleton.sharedInstance globalParameterForKey:@"can_see_price"] boolValue];
+            BOOL price_hidden = [[RASingleton.sharedInstance globalParameterForKey:@"price_hidden"] boolValue];
             
             if(can_see_price&&price_hidden==false)
             {
@@ -5022,7 +5022,7 @@ if(!self.alert.isBeingDismissed)
             {
 #ifdef OFFLINE_MODE
                 AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
-                BOOL offline_mode = [[appDelegate globalParameterForKey:@"offline_mode"] boolValue];
+                BOOL offline_mode = [[RASingleton.sharedInstance globalParameterForKey:@"offline_mode"] boolValue];
                 if(offline_mode)
                 {
                     
@@ -5084,8 +5084,8 @@ if(!self.alert.isBeingDismissed)
                 
                 NSMutableDictionary* params = [[NSMutableDictionary alloc] init];
                 AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
-                NSString *user = [appDelegate globalParameterForKey:@"user"];
-                NSString *password = [appDelegate globalParameterForKey:@"password"];
+                NSString *user = [RASingleton.sharedInstance globalParameterForKey:@"user"];
+                NSString *password = [RASingleton.sharedInstance globalParameterForKey:@"password"];
                 
                 if(user!=nil)
                     [params setValue:user forKey:@"user"];

+ 1 - 0
common/customUI/commoneditor/EnumSelectOnlineViewController.h

@@ -25,6 +25,7 @@ NS_ASSUME_NONNULL_BEGIN
 //@property bool canbeEmpty;
 //@property index last
 @property bool single_select;
+@property bool from_action;
 @property bool auto_close;
 @property (strong,nonatomic) NSIndexPath* updatePosition;
 @property (strong, nonatomic) IBOutlet UINavigationItem *navi_item;

+ 1 - 1
common/customUI/commoneditor/EnumSelectOnlineViewController.m

@@ -155,7 +155,7 @@
     [super viewWillDisappear:animated];
     if(self.dirty == false)
         return;
-    if (self.delegate && [self.delegate respondsToSelector:@selector(EnumValueChanged:indexPath:)]) {
+    if (self.delegate && [self.delegate respondsToSelector:@selector(EnumValueChanged:indexPath:)] && !self.from_action) {
         [self.delegate EnumValueChanged:self.online_cadedate indexPath:self.updatePosition];
     }
     if(self.returnValue)