获取指定列数据接口
接口名称
位置:DetailedQueryImpl
名称:getFieldData
调用方式
作为前端js函数被调用
参数
参数名 | 必选 | 类型 | 说明 |
field | 是 |
| 实际就是输出字段的定义,已有接口getOutputFields获取所有的输出字段,除了uniqueId是必填, 其它项选填,若不指定其它项,都使用原来的设置. |
options | 否 |
| options是取数配置, 若想获取所有数据,pagination应为{ pageNum: 0, pageSize: -1 }, 取所有数据请自行确保数据量不会导致内存溢出等. |
输出
同表格的取数接口
result = { total: -1, // 可能没什么意义 gridData: { stringHeaders: string[] // 字段名称 data: Cell[][] } } Cell = { uniqueId: string, uniqueName: string, value: any, // 真实值,格式化前的值 displayValue: string, // 显示值,格式化后的值 type: string, // 值类型 useTransformRule: boolean // 应用了转换规则 }
异常
当uniqueId不指定或找不到相应字段时,抛出异常
throw { type: 'field.uniqueId is undefined' } throw { type: 'the special field is not found in output fields' }
输入示例
detailQueryImpl.getFieldData({ uniqueId: 'd280fbb81f5bb7da694191b701256a09', orderBy: 'DESC' }, { distinct: true }).then((result) => { console.info(result) }).catch(error) => { console.info(error.type) }
输出示例
{ total: -1, gridData: { stringHeanders: ['发货区域'], data: [ [ { "type": "STRING", "displayValue": "西北", "value": "西北", "useTransformRule": false, "uniqueId": null, "uniqueName": null, "crossUniqueId": null } ], [ { "type": "STRING", "displayValue": "华北", "value": "华北", "useTransformRule": false, "uniqueId": null, "uniqueName": null, "crossUniqueId": null } ] ] } }