mirror of
https://github.com/cool-team-official/cool-admin-midway.git
synced 2026-02-18 18:23:49 +00:00
生成解析的字段顺序调整
This commit is contained in:
parent
801658f290
commit
c6c19cb7da
@ -202,11 +202,12 @@ export class BaseSysMenuService extends BaseService {
|
|||||||
);
|
);
|
||||||
eval(code);
|
eval(code);
|
||||||
await tempDataSource.buildMetadatas();
|
await tempDataSource.buildMetadatas();
|
||||||
const columns = tempDataSource.getMetadata(className).columns;
|
const columnArr = tempDataSource.getMetadata(className).columns;
|
||||||
await tempDataSource.destroy();
|
await tempDataSource.destroy();
|
||||||
const fileName = await this.fileName(controller);
|
const fileName = await this.fileName(controller);
|
||||||
return {
|
const commColums = [];
|
||||||
columns: columns.map(e => {
|
const columns = _.filter(
|
||||||
|
columnArr.map(e => {
|
||||||
return {
|
return {
|
||||||
propertyName: e.propertyName,
|
propertyName: e.propertyName,
|
||||||
type: typeof e.type == 'string' ? e.type : e.type.name.toLowerCase(),
|
type: typeof e.type == 'string' ? e.type : e.type.name.toLowerCase(),
|
||||||
@ -215,6 +216,15 @@ export class BaseSysMenuService extends BaseService {
|
|||||||
nullable: e.isNullable,
|
nullable: e.isNullable,
|
||||||
};
|
};
|
||||||
}),
|
}),
|
||||||
|
o => {
|
||||||
|
if (['createTime', 'updateTime'].includes(o.propertyName)) {
|
||||||
|
commColums.push(o);
|
||||||
|
}
|
||||||
|
return o && !['createTime', 'updateTime'].includes(o.propertyName);
|
||||||
|
}
|
||||||
|
).concat(commColums);
|
||||||
|
return {
|
||||||
|
columns,
|
||||||
path: `/admin/${module}/${fileName}`,
|
path: `/admin/${module}/${fileName}`,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user