字典支持多级

This commit is contained in:
小鹏 2022-07-15 18:22:44 +08:00
parent 93f250f8ef
commit 9710751c19
2 changed files with 5 additions and 1 deletions

View File

@ -10,9 +10,12 @@ import { DictInfoService } from '../../service/info';
@CoolController({ @CoolController({
api: ['add', 'delete', 'update', 'info', 'list', 'page'], api: ['add', 'delete', 'update', 'info', 'list', 'page'],
entity: DictInfoEntity, entity: DictInfoEntity,
pageQueryOp: { listQueryOp: {
fieldEq: ['typeId'], fieldEq: ['typeId'],
keyWordLikeFields: ['name'], keyWordLikeFields: ['name'],
addOrderBy: {
createTime: 'ASC',
},
}, },
}) })
export class AdminDictInfoController extends BaseController { export class AdminDictInfoController extends BaseController {

View File

@ -40,6 +40,7 @@ export class DictInfoService extends BaseService {
}), }),
}) })
.orderBy('orderNum', 'ASC') .orderBy('orderNum', 'ASC')
.addOrderBy('a.createTime', 'ASC')
.getMany(); .getMany();
for (const item of typeData) { for (const item of typeData) {
result[item.key] = _.filter(data, { typeId: item.id }); result[item.key] = _.filter(data, { typeId: item.id });