소스 검색

Realize the function of common editor multi-button cell -- 实现common editor 多按钮单元格的功能 (resolve: #14563)

Ray Zhang 4 년 전
부모
커밋
cb2a82c18b

+ 3 - 3
ApexDrivers/CommonEditorLib/src/main/java/com/usai/commoneditorlib/CommonEditorActivity.java

@@ -3795,15 +3795,15 @@ protected void commonAction(String value, int groupIndex,int itemIndex,JSONObjec
 //            int refresh = 0;
 //            boolean discardDirty = false;
 //            JSONObject section_json = null;
-//            JSONObject item_json = content_data_control.optJSONArray(group).optJSONObject(child);
+            JSONObject item_json = content_data_control.optJSONArray(group).optJSONObject(child);
 //
 //
 //            String subid = item_json.optString("subid");
 //            String refresh_trigger = item_json.optString("name");
-//            JSONObject sub_action = item_json.optJSONObject("item_" + i);
+            JSONObject sub_action = item_json.optJSONObject("item_" + i);
 //            String type = sub_action.optString("type");
 
-            multiAction(group,child,item_json);
+            multiAction(group,child,sub_action);
 
 //
 //            if (type != null && type.equals("pull")) {

+ 2 - 0
ApexDrivers/ratradefiling/src/debug/assets/edit_isf.json

@@ -46,6 +46,7 @@
           "name": "item_12_1"
         },
         "name": "",
+        "single_select": "true",
         "value": "online_enum",
         "aname": "SELECT EXIST PARTY"
       },
@@ -78,6 +79,7 @@
         "id": "123456"
       },
       "name": "",
+      "single_select": "true",
       "value": "online_enum",
       "refresh": 0,
       "aname": "SELECT PARTY"

+ 76 - 4
ApexDrivers/ratradefiling/src/main/java/com/usai/ratradefiling/tfeditor/TFEditorActivity.java

@@ -290,12 +290,84 @@ public class TFEditorActivity extends CommonEditorActivity
 
         String subid = item_json.optString("subid");
         String refresh_trigger = item_json.optString("name");
-        JSONObject sub_action = item_json.optJSONObject("item_" + i);
-        String type = sub_action.optString("type");
-        String value = sub_action.optString("value");
-        if
+//        JSONObject sub_action = item_json.optJSONObject("item_" + i);
+//        String type = item_json.optString("type");
+        String value = item_json.optString("value");
+        if(value.equals("editor"))
+        {
+//        JSONObject item_json =((NSMutableArray*)self.content_data_control[indexPath.section])[indexPath.row];
+            boolean readonly = content_data_download.optBoolean("readonly");
+
+            int disable = item_json.optInt("disable");
+
+
+            if(disable==1||readonly)
+                return ;
+
+            Bundle b= RAUtil.Json2Bundle(item_json.optJSONObject("params"));
+            Intent intent = TFEditorActivity.build(mContext,TFEditorActivity.class,null,URL_REMOTE,URL_EDIT,b);
+
+            startActivity(intent);
+
+//            TFEditorViewController *vc = [[UIStoryboard storyboardWithName:@"TFEditor" bundle:nil] instantiateViewControllerWithIdentifier:@"TFEditorViewController"];
+//
+//            vc.url_type = URL_REMOTE;
+//            vc.request_url=URL_EDIT;
+//            vc.from = indexPath;
+//            vc.delegate = self;
+//            vc.params = [[item_json valueForKey:@"params"] mutableCopy];
+//
+//            [self.navigationController pushViewController:vc animated:NO];
+
+
+        }
+        if(value.equals("online_enum"))
         {
 
+            String title = item_json.optString("aname");
+
+            int max_select = item_json.optInt("max");
+
+
+            JSONObject paramsjson = item_json.optJSONObject("params");
+
+            Bundle params=RAUtil.Json2Bundle(paramsjson);
+
+            String single_select = item_json.optString("single_select");
+
+            boolean singleSelect = single_select.toLowerCase().equals("true");
+
+
+            Intent intent = new EnumSlectOnlineActivity.Builder().build(mCtx,title,max_select,groupIndex,itemIndex,singleSelect,true,ONLINE_ENUM_URL,params);
+
+            int request_code = 10;
+
+            startActivityForResult(intent,request_code);
+//            EnumSelectOnlineViewController* enumvc =[[UIStoryboard storyboardWithName:@"CommonEditor" bundle:nil] instantiateViewControllerWithIdentifier:@"EnumSelectOnlineViewController"];
+//            enumvc.delegate = self;
+//            enumvc.max_select = max_select;
+//            enumvc.updatePosition = indexPath;
+//            enumvc.online_params = item_json[@"params"];
+//            enumvc.single_select = true;
+//            //        if([[required lowercaseString] isEqualToString:@"true"])
+//            //        enumvc.canbeEmpty = false;
+//            //        else
+//            //        enumvc.canbeEmpty =true;
+//            //            enumvc.cadedate = [cadedate_json mutableCopy];
+//            enumvc.title = title;
+//            //       enumvc.value = [value_json mutableCopy];
+//            //    enumvc.single_select =[[single_select lowercaseString] isEqualToString:@"true"];
+//
+//            enumvc.from = indexPath;
+//            enumvc.returnValue = ^(JSONObject value,NSIndexPath* source){
+//
+//
+//                    [self handle_action_return:value[@"val_0"] indexPath:indexPath action:ACTION_FILL_SECTION];
+//
+//        };
+//
+//
+//        [self.navigationController pushViewController:enumvc animated:true];
         }
 
     }