@@ -25,7 +25,7 @@ <h3>table parameter</h3>
25
25
</pre>
26
26
<h3>example backend code</h3>
27
27
<pre>
28
- table = functions.get_apijson_table("{table.model_name}", role="{table.role}", tableui_name="{table.tableui_name}")
28
+ table = functions.get_apijson_table("{table.model_name}", role="{table.role}", request_tag="{table.request_tag}", tableui_name="{table.tableui_name}")
29
29
</pre>
30
30
<h3>example frontend code</h3>
31
31
<pre>
@@ -57,16 +57,14 @@ <h3>settings.APIJSON_REQUESTS.{table.request_tag||table.model_name}</h3>
57
57
return {
58
58
current_menu_item : "table_param" ,
59
59
table_param : { } ,
60
- tableui : { }
60
+ tableui : { } ,
61
+ tableui_json : ""
61
62
}
62
63
} ,
63
64
computed : {
64
65
table_json : function ( ) {
65
66
return JSON . stringify ( this . table_param , null , 2 )
66
67
} ,
67
- tableui_json : function ( ) {
68
- return JSON . stringify ( this . tableui , null , 2 )
69
- } ,
70
68
model_json : function ( ) {
71
69
return JSON . stringify ( this . model , null , 2 )
72
70
} ,
@@ -82,7 +80,15 @@ <h3>settings.APIJSON_REQUESTS.{table.request_tag||table.model_name}</h3>
82
80
mounted : function ( ) {
83
81
this . table_param = JSON . parse ( JSON . stringify ( this . table ) )
84
82
delete this . table_param . tableui
85
- this . tableui = this . table . tableui
83
+ //remove __id field, look like vuejs add this
84
+ var tableui = JSON . parse ( JSON . stringify ( this . table . tableui ) )
85
+ if ( tableui . table_fields != null ) {
86
+ for ( let index = 0 ; index < tableui . table_fields . length ; index ++ ) {
87
+ if ( tableui . table_fields [ index ] . __id != null )
88
+ delete tableui . table_fields [ index ] . __id
89
+ }
90
+ this . tableui_json = JSON . stringify ( tableui , null , 2 )
91
+ }
86
92
}
87
93
} )
88
94
</ script >
0 commit comments