/**
* 表格查询
*
* @public
* @param {*} options
* @memberof TableHandle
*/
public queryMetaDataJobs(): void {
console.log(this.treeRowData);
if (!this.treeRowData.id) {
this.$notify.error('请选择分组!');
return;
}
const url = '/xxx/xxx/list';
const { name, isPass } = this.search;
const params: any = {
groupId: this.treeRowData.id,
name,
startTime: this.search.range[0] ? moment(this.search.range[0]).format('YYYY-MM-DD 00:00:00') : '',
endTime: this.search.range[1] ? moment(this.search.range[1]).format('YYYY-MM-DD 23:59:59') : '',
isPass,
pageNumber: this.pageNumber,
pageSize: this.pageSize
};
this.http.post(url, params).then((res: any) => {
if (res.statusCode == '0') {
const arr: any = [];
res.data.forEach((item: any) => {
item.metaobjNames = [];
item.metaobjs.forEach(async (id: string) => {
const data = await this.getObjDataById(id);
if (data.data) {
item.metaobjNames.push(data.data.name);
} else {
item.metaobjNames = item.metaobjs;
}
});
arr.push(item);
});
this.documentList = arr;
}
});
}
/**
* 通过数据对象id查询数据对象
*
* @memberof CreateForm
*/
getObjDataById(id: any): Promise<any> {
const url = `/xxx/xxx/xxxx?Id=${id}`;
return this.http.post(url);
}
表格显示名称,通过id查找名称
最新推荐文章于 2023-08-05 11:56:02 发布