@@ -6787,7 +6787,8 @@ res_data = rep.json()
67876787 if ( standardObj != null ) {
67886788 var parentObj = pathKeys == null || pathKeys . length <= 0 ? null : JSONResponse . getStandardByPath ( standardObj , pathKeys . slice ( 0 , pathKeys . length - 1 ) ) ;
67896789 var targetValues = parentObj == null ? null : parentObj . values ;
6790- var targetObj = targetValues == null ? null : ( targetValues [ 0 ] || { } ) [ pathKeys [ pathKeys . length - 1 ] ] ; // JSONResponse.getStandardByPath(standardObj, pathKeys);
6790+ var lastKey = pathKeys == null ? null : pathKeys [ pathKeys . length - 1 ]
6791+ var targetObj = targetValues == null ? null : ( targetValues [ 0 ] || { } ) [ lastKey ] || { } ; // JSONResponse.getStandardByPath(standardObj, pathKeys);
67916792
67926793 var t = targetObj == null ? null : targetObj . type ;
67936794 var targetComment = targetObj == null ? null : targetObj . comment ;
@@ -6812,15 +6813,22 @@ res_data = rep.json()
68126813 var name = targetObj == null || StringUtil . isEmpty ( targetObj . name , true ) ? null : targetObj . name ;
68136814 if ( StringUtil . isNotEmpty ( parentName , true ) || StringUtil . isNotEmpty ( name , true ) ) {
68146815 var pn = parentName || tableName ;
6815- var n = name || columnName ;
6816+ var n = name || columnName || lastKey ;
68166817 var isValObj = isValueNotObject != true ; // && StringUtil.isName(pn)
68176818
68186819 c = CodeUtil . getCommentFromDoc ( tableList , isValObj ? n : pn , isValObj ? null : n
6819- , method , database , language , onlyTableAndColumn , isReq , pathKeys , value , ignoreError , null , isSubquery , isWarning ) ;
6820+ , method , database , language , onlyTableAndColumn , isReq , pathKeys , isRestful , value , ignoreError , null , isSubquery , isWarning ) ;
68206821 if ( StringUtil . isNotEmpty ( c , true ) ) {
68216822 return ( isValObj && StringUtil . isNotEmpty ( name , true ) ? StringUtil . trim ( name ) : CodeUtil . getType4Language ( language , t , true ) )
68226823 + ( targetObj . notEmpty ? '! ' : ( targetObj . notNull ? ', ' : '? ' ) ) + StringUtil . trim ( c ) ;
68236824 }
6825+
6826+ if ( StringUtil . isEmpty ( tableName , true ) ) {
6827+ tableName = isValObj ? n : pn ;
6828+ }
6829+ if ( StringUtil . isEmpty ( columnName , true ) ) {
6830+ columnName = isValObj ? null : n ;
6831+ }
68246832 }
68256833 }
68266834
@@ -6947,7 +6955,8 @@ res_data = rep.json()
69476955 return c ;
69486956 }
69496957 else {
6950- if ( c != null ) { // 可能存在但只是没注释 StringUtil.isEmpty(c, true) == false) {
6958+ // if (c != null) { // 可能存在但只是没注释
6959+ if ( StringUtil . isEmpty ( c , true ) == false ) {
69516960 return isWarning ? ' ' : c ;
69526961 }
69536962 }
@@ -7016,7 +7025,7 @@ res_data = rep.json()
70167025 //Table
70177026 table = item == null ? null : ( isTSQL ? item . AllTable : ( database != 'SQLSERVER' ? item . Table : item . SysTable ) ) ;
70187027 var table_name = table == null ? null : table . table_name ;
7019- if ( table_name == null || table_name . replaceAll ( '_' , '' ) . toLowerCase ( ) . endsWith ( tableName . replaceAll ( '_' , '' ) . toLowerCase ( ) ) != true ) { // tableName != CodeUtil.getModelName(table.table_name)) {
7028+ if ( table_name == null || table_name . replaceAll ( '_' , '' ) . toLowerCase ( ) != tableName . replaceAll ( '_' , '' ) . toLowerCase ( ) ) { // tableName != CodeUtil.getModelName(table.table_name)) {
70207029 continue ;
70217030 }
70227031 log ( 'getDoc [] for i=' + i + ': table = \n' + format ( JSON . stringify ( table ) ) ) ;
@@ -7253,7 +7262,7 @@ res_data = rep.json()
72537262 for ( var j = 0 ; j < columnList . length ; j ++ ) {
72547263 column = ( columnList [ j ] || { } ) [ isTSQL ? 'AllColumn' : 'Column' ] ;
72557264 name = column == null ? null : column . column_name ;
7256- if ( name == null || key != name ) {
7265+ if ( name == null || key . replaceAll ( '_' , '' ) . toLowerCase ( ) != name . replaceAll ( '_' , '' ) . toLowerCase ( ) ) {
72577266 if ( name != null ) {
72587267 columnNames . push ( name )
72597268 }
0 commit comments