33 delimiters : [ '{' , '}' ] ,
44 props : [
55 "table" ,
6- "tableui" ,
76 "model" ,
87 "request"
98 ] ,
1211 <row>
1312 <i-col span="4">
1413 <i-menu :active-name="current_menu_item" @on-select="on_select">
15- <menu-item name="table_config " @on-select="current_menu_item='table_config '">table config </menu-item>
14+ <menu-item name="table_param " @on-select="current_menu_item='table_param '">table param </menu-item>
1615 <menu-item name="tableui_config" @on-select="current_menu_item='tableui_config'">table ui config</menu-item>
1716 <menu-item name="model_config" @on-select="current_menu_item='model_config'">model config</menu-item>
1817 <menu-item name="request_config" @on-select="current_menu_item='request_config'">request config</menu-item>
1918 </i-menu>
2019 </i-col>
2120 <i-col span="8">
22- <div v-if="current_menu_item=='table_config '">
23- <h3>settings.APIJSON_TABLES.{ table.table_name} </h3>
21+ <div v-if="current_menu_item=='table_param '">
22+ <h3>table parameter </h3>
2423 <pre>
2524{table_json}
2625 </pre>
26+ <h3>example backend code</h3>
27+ <pre>
28+ table = functions.get_apijson_table("{table.model_name}", role="{table.role}", request_tag="{table.request_tag}", tableui_name="{table.tableui_name}")
29+ </pre>
30+ <h3>example frontend code</h3>
31+ <pre>
32+ <apijson-table :table="table"></apijson-table>
33+ </pre>
2734 </div>
2835 <div v-if="current_menu_item=='tableui_config'">
2936 <h3>settings.APIJSON_TABLE_UI.{table.tableui_name}</h3>
@@ -38,7 +45,7 @@ <h3>settings.APIJSON_MODELS.{table.model_name}</h3>
3845 </pre>
3946 </div>
4047 <div v-if="current_menu_item=='request_config'">
41- <h3>settings.APIJSON_TABLE_CONFIG .{table.request_tag||table.model_name}</h3>
48+ <h3>settings.APIJSON_REQUESTS .{table.request_tag||table.model_name}</h3>
4249 <pre style="height: 25pc; overflow-y: scroll;">
4350{request_json}
4451 </pre>
@@ -48,15 +55,15 @@ <h3>settings.APIJSON_TABLE_CONFIG.{table.request_tag||table.model_name}</h3>
4855</div>` ,
4956 data : function ( ) {
5057 return {
51- current_menu_item : "table_config"
58+ current_menu_item : "table_param" ,
59+ table_param : { } ,
60+ tableui : { } ,
61+ tableui_json : ""
5262 }
5363 } ,
5464 computed : {
5565 table_json : function ( ) {
56- return JSON . stringify ( this . table , null , 2 )
57- } ,
58- tableui_json : function ( ) {
59- return JSON . stringify ( this . tableui , null , 2 )
66+ return JSON . stringify ( this . table_param , null , 2 )
6067 } ,
6168 model_json : function ( ) {
6269 return JSON . stringify ( this . model , null , 2 )
@@ -69,6 +76,19 @@ <h3>settings.APIJSON_TABLE_CONFIG.{table.request_tag||table.model_name}</h3>
6976 on_select : function ( data ) {
7077 this . current_menu_item = data
7178 }
79+ } ,
80+ mounted : function ( ) {
81+ this . table_param = JSON . parse ( JSON . stringify ( this . table ) )
82+ delete this . table_param . 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+ }
7292 }
7393 } )
7494</ script >
0 commit comments