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