|
|
|
@ -116,7 +116,6 @@ export async function getDataList(param: {
|
|
|
|
|
|
|
|
|
|
const { ast, dependencyFields } = await getAst({ model, query, view }); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const listArgs: any = dependencyFields; |
|
|
|
|
try { |
|
|
|
|
listArgs.filterArr = JSON.parse(listArgs.filterArrJson); |
|
|
|
@ -128,12 +127,7 @@ export async function getDataList(param: {
|
|
|
|
|
let data = []; |
|
|
|
|
let count = 0; |
|
|
|
|
try { |
|
|
|
|
data = await nocoExecute( |
|
|
|
|
ast, |
|
|
|
|
await baseModel.list(listArgs), |
|
|
|
|
{}, |
|
|
|
|
listArgs |
|
|
|
|
); |
|
|
|
|
data = await nocoExecute(ast, await baseModel.list(listArgs), {}, listArgs); |
|
|
|
|
count = await baseModel.count(listArgs); |
|
|
|
|
} catch (e) { |
|
|
|
|
console.log(e); |
|
|
|
@ -171,17 +165,10 @@ export async function getFindOne(param: {
|
|
|
|
|
args.sortArr = JSON.parse(args.sortArrJson); |
|
|
|
|
} catch (e) {} |
|
|
|
|
|
|
|
|
|
const {ast, dependencyFields} = await getAst({ model, query: args, view }) |
|
|
|
|
const { ast, dependencyFields } = await getAst({ model, query: args, view }); |
|
|
|
|
|
|
|
|
|
const data = await baseModel.findOne({ ...args, dependencyFields }); |
|
|
|
|
return data |
|
|
|
|
? await nocoExecute( |
|
|
|
|
ast, |
|
|
|
|
data, |
|
|
|
|
{}, |
|
|
|
|
{} |
|
|
|
|
) |
|
|
|
|
: {}; |
|
|
|
|
return data ? await nocoExecute(ast, data, {}, {}) : {}; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
export async function getDataGroupBy(param: { |
|
|
|
@ -228,14 +215,9 @@ export async function dataRead(
|
|
|
|
|
NcError.notFound('Row not found'); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const { ast, dependencyFields } = await getAst({ model, query: param.query, view }) |
|
|
|
|
const { ast } = await getAst({ model, query: param.query, view }); |
|
|
|
|
|
|
|
|
|
return await nocoExecute( |
|
|
|
|
ast, |
|
|
|
|
row, |
|
|
|
|
{}, |
|
|
|
|
param.query |
|
|
|
|
); |
|
|
|
|
return await nocoExecute(ast, row, {}, param.query); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
export async function dataExist( |
|
|
|
@ -303,12 +285,7 @@ export async function getGroupedDataList(param: {
|
|
|
|
|
...listArgs, |
|
|
|
|
groupColumnId: param.columnId, |
|
|
|
|
}); |
|
|
|
|
data = await nocoExecute( |
|
|
|
|
{ key: 1, value: ast }, |
|
|
|
|
groupedData, |
|
|
|
|
{}, |
|
|
|
|
listArgs |
|
|
|
|
); |
|
|
|
|
data = await nocoExecute({ key: 1, value: ast }, groupedData, {}, listArgs); |
|
|
|
|
const countArr = await baseModel.groupedListCount({ |
|
|
|
|
...listArgs, |
|
|
|
|
groupColumnId: param.columnId, |
|
|
|
@ -655,7 +632,7 @@ export async function dataReadByViewId(param: {
|
|
|
|
|
dbDriver: await NcConnectionMgrv2.get(base), |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
const { ast } = await getAst({ model, query: param.query }) |
|
|
|
|
const { ast } = await getAst({ model, query: param.query }); |
|
|
|
|
|
|
|
|
|
return await nocoExecute( |
|
|
|
|
ast, |
|
|
|
|