|
|
@ -478,8 +478,7 @@ export default class Column<T = any> implements ColumnType { |
|
|
|
fk_model_id, |
|
|
|
fk_model_id, |
|
|
|
]); |
|
|
|
]); |
|
|
|
let { list: columnsList } = cachedList; |
|
|
|
let { list: columnsList } = cachedList; |
|
|
|
const { isEmptyList } = cachedList; |
|
|
|
if (!columnsList.length) { |
|
|
|
if (!isEmptyList && !columnsList.length) { |
|
|
|
|
|
|
|
columnsList = await ncMeta.metaList2(null, null, MetaTable.COLUMNS, { |
|
|
|
columnsList = await ncMeta.metaList2(null, null, MetaTable.COLUMNS, { |
|
|
|
condition: { |
|
|
|
condition: { |
|
|
|
fk_model_id, |
|
|
|
fk_model_id, |
|
|
@ -633,8 +632,7 @@ export default class Column<T = any> implements ColumnType { |
|
|
|
{ |
|
|
|
{ |
|
|
|
const cachedList = await NocoCache.getList(CacheScope.COL_LOOKUP, [id]); |
|
|
|
const cachedList = await NocoCache.getList(CacheScope.COL_LOOKUP, [id]); |
|
|
|
let { list: lookups } = cachedList; |
|
|
|
let { list: lookups } = cachedList; |
|
|
|
const { isEmptyList } = cachedList; |
|
|
|
if (!lookups.length) { |
|
|
|
if (!isEmptyList && !lookups.length) { |
|
|
|
|
|
|
|
lookups = await ncMeta.metaList2(null, null, MetaTable.COL_LOOKUP, { |
|
|
|
lookups = await ncMeta.metaList2(null, null, MetaTable.COL_LOOKUP, { |
|
|
|
condition: { fk_lookup_column_id: id }, |
|
|
|
condition: { fk_lookup_column_id: id }, |
|
|
|
}); |
|
|
|
}); |
|
|
@ -648,8 +646,7 @@ export default class Column<T = any> implements ColumnType { |
|
|
|
{ |
|
|
|
{ |
|
|
|
const cachedList = await NocoCache.getList(CacheScope.COL_ROLLUP, [id]); |
|
|
|
const cachedList = await NocoCache.getList(CacheScope.COL_ROLLUP, [id]); |
|
|
|
let { list: rollups } = cachedList; |
|
|
|
let { list: rollups } = cachedList; |
|
|
|
const { isEmptyList } = cachedList; |
|
|
|
if (!rollups.length) { |
|
|
|
if (!isEmptyList && !rollups.length) { |
|
|
|
|
|
|
|
rollups = await ncMeta.metaList2(null, null, MetaTable.COL_ROLLUP, { |
|
|
|
rollups = await ncMeta.metaList2(null, null, MetaTable.COL_ROLLUP, { |
|
|
|
condition: { fk_rollup_column_id: id }, |
|
|
|
condition: { fk_rollup_column_id: id }, |
|
|
|
}); |
|
|
|
}); |
|
|
@ -664,8 +661,7 @@ export default class Column<T = any> implements ColumnType { |
|
|
|
col.fk_model_id, |
|
|
|
col.fk_model_id, |
|
|
|
]); |
|
|
|
]); |
|
|
|
let { list: formulaColumns } = cachedList; |
|
|
|
let { list: formulaColumns } = cachedList; |
|
|
|
const { isEmptyList } = cachedList; |
|
|
|
if (!formulaColumns.length) { |
|
|
|
if (!isEmptyList && !formulaColumns.length) { |
|
|
|
|
|
|
|
formulaColumns = await ncMeta.metaList2(null, null, MetaTable.COLUMNS, { |
|
|
|
formulaColumns = await ncMeta.metaList2(null, null, MetaTable.COLUMNS, { |
|
|
|
condition: { |
|
|
|
condition: { |
|
|
|
fk_model_id: col.fk_model_id, |
|
|
|
fk_model_id: col.fk_model_id, |
|
|
@ -696,8 +692,7 @@ export default class Column<T = any> implements ColumnType { |
|
|
|
// get lookup columns using relation and delete
|
|
|
|
// get lookup columns using relation and delete
|
|
|
|
const cachedList = await NocoCache.getList(CacheScope.COL_LOOKUP, [id]); |
|
|
|
const cachedList = await NocoCache.getList(CacheScope.COL_LOOKUP, [id]); |
|
|
|
let { list: lookups } = cachedList; |
|
|
|
let { list: lookups } = cachedList; |
|
|
|
const { isEmptyList } = cachedList; |
|
|
|
if (!lookups.length) { |
|
|
|
if (!isEmptyList && !lookups.length) { |
|
|
|
|
|
|
|
lookups = await ncMeta.metaList2(null, null, MetaTable.COL_LOOKUP, { |
|
|
|
lookups = await ncMeta.metaList2(null, null, MetaTable.COL_LOOKUP, { |
|
|
|
condition: { fk_relation_column_id: id }, |
|
|
|
condition: { fk_relation_column_id: id }, |
|
|
|
}); |
|
|
|
}); |
|
|
@ -711,8 +706,7 @@ export default class Column<T = any> implements ColumnType { |
|
|
|
// get rollup columns using relation and delete
|
|
|
|
// get rollup columns using relation and delete
|
|
|
|
const cachedList = await NocoCache.getList(CacheScope.COL_ROLLUP, [id]); |
|
|
|
const cachedList = await NocoCache.getList(CacheScope.COL_ROLLUP, [id]); |
|
|
|
let { list: rollups } = cachedList; |
|
|
|
let { list: rollups } = cachedList; |
|
|
|
const { isEmptyList } = cachedList; |
|
|
|
if (!rollups.length) { |
|
|
|
if (!isEmptyList && !rollups.length) { |
|
|
|
|
|
|
|
rollups = await ncMeta.metaList2(null, null, MetaTable.COL_ROLLUP, { |
|
|
|
rollups = await ncMeta.metaList2(null, null, MetaTable.COL_ROLLUP, { |
|
|
|
condition: { fk_relation_column_id: id }, |
|
|
|
condition: { fk_relation_column_id: id }, |
|
|
|
}); |
|
|
|
}); |
|
|
|