@@ -101,7 +101,7 @@ export class ResourcesService {
101101 . createQueryBuilder ( )
102102 . skip ( ( pageNumber - 1 ) * pageSize )
103103 . take ( pageSize )
104- . orderBy ( { id : 'DESC' } )
104+ . orderBy ( { sort : 'ASC' , id : 'DESC' } )
105105 . printSql ( )
106106 . where ( mapToObj ( queryMap ) )
107107 . getManyAndCount ( ) ;
@@ -134,15 +134,23 @@ export class ResourcesService {
134134
135135 /**
136136 * @Author : 水痕
137- * @Date : 2023-10-08 08:07 :30
137+ * @Date : 2023-10-11 12:05 :30
138138 * @LastEditors : 水痕
139139 * @Description : 根据资源模块
140+ * @param {number } catalogType 0的时候只查询出模块,1的时候查询出模块和菜单2,的时候查询模块、菜单、按钮
140141 * @return {* }
141142 */
142- async getResourceCatalogApi ( ) : Promise < SimplenessResourceVo [ ] > {
143+ async getResourceCatalogApi ( catalogType : number ) : Promise < SimplenessResourceVo [ ] > {
144+ console . log ( catalogType , '111---->' ) ;
145+ const queryMap = new Map < string , FindOperator < string > > ( ) ;
146+ if ( catalogType == 2 ) {
147+ queryMap . set ( 'resourcesType' , In ( [ 0 , 1 ] ) ) ;
148+ } else {
149+ queryMap . set ( 'resourcesType' , In ( [ 0 ] ) ) ;
150+ }
143151 return await this . resourcesRepository . find ( {
144- where : { resourcesType : 0 } ,
145- select : [ 'id' , 'title' ] ,
152+ where : mapToObj ( queryMap ) ,
153+ select : [ 'id' , 'title' , 'parentId' ] ,
146154 } ) ;
147155 }
148156
@@ -154,7 +162,7 @@ export class ResourcesService {
154162 * @return {* }
155163 */
156164 async getMenusListApi ( ) : Promise < ResourcesVo [ ] > {
157- return await this . resourcesRepository . find ( { where : { type : In ( [ 0 , 1 ] ) } } ) ;
165+ return await this . resourcesRepository . find ( { where : { resourcesType : In ( [ 0 , 1 ] ) } } ) ;
158166 }
159167 /**
160168 * @Author : 水痕
0 commit comments