import { post, fetch } from '@/utils/request'

const getViewToken = (fileId: string) => fetch(`/bf/view/token?fileId=${fileId}`)

// 获取某个属性的所有值
const getPropValueList = (
  properties: string,
  targetIds: string, // 对应fileId
  targetType = 'file' // 对应目标类型, 默认file
) => fetch(`/bf/data/v2/query/propertyValues?properties=${properties}&targetIds=${targetIds}&targetType=${targetType}`)

// 查询符合条件的构件ID列表
const getElementsConditional = (params: any) => post(`/bf/data/v2/query/elementIds`, params)

export {
  getViewToken,
  getPropValueList,
  getElementsConditional
}