import http from '../scan/httpUtil'

const baseUrl = '/api';

/**
 * info: 查询统计数量(查询总数量不传参数，查询已完成数量TaskState=0，查询未找到TaskState=-1，查询未验证TaskState=1)
 * @param {Filters:string} param 查询参数
 * @param {*} success  成功的回调函数
 *
 */
export function queryTaskCount(param, success) {
    let url = `${baseUrl}/datacenter/scan-task-base/count`;
    http.postJson(url, param, success)
}

/*************************模型任务接口****************************/
//创建模型任务
export function createModelTask(param, success) {
    let url = `${baseUrl}/datacenter/model-scan-task/create`;
    http.postJson(url, param, success)
}
//根据id删除模型任务
export function deleteModelTask(param, success) {
    let url = `${baseUrl}/datacenter/model-scan-task/delete`;
    http.postJson(url, param, success)
}
//查询：根据模型空间ID查询设备信息
export function queryModelDiglog(param, success) {
    let url = `${baseUrl}/datacenter/model-scan-task/equip-query`;
    http.postJson(url, param, success)
}
//查询模型任务
export function queryModelTask(param, success) {
    let url = `${baseUrl}/datacenter/model-scan-task/page-query`;
    http.postJson(url, param, success)
}
//更新模型任务
export function updateModelTask(param, success) {
    let url = `${baseUrl}/datacenter/model-scan-task/update`;
    http.postJson(url, param, success)
}

//查询设备分类
export function queryModelCategory(param, success) {
  let url = `${baseUrl}/datacenter/model-scan-task/model-category-query`;
  http.postJson(url, param, success)
}

//查询模型文件夹和文件
export function queryModelFile(param, success) {
  let url = `${baseUrl}/datacenter/model-scan-task/model-file-query`;
  http.postJson(url, param, success)
}

//查询模型任务下的部件类型及数量
export function modelCategoryCount(param, success) {
  let url = `${baseUrl}/datacenter/model-scan-task/category-count`;
  http.postJson(url, param, success)
}

/*************************设备台账任务接口****************************/
//创建设备台账任务
export function createDeviceTask(param, success) {
  let url = `${baseUrl}/datacenter/equip-scan-task/create`;
  http.postJson(url, param, success)
}

//根据id删除设备台账任务
export function deleteDeviceTask(param, success) {
  let url = `${baseUrl}/datacenter/equip-scan-task/delete`;
  http.postJson(url, param, success)
}
//查询设备台账任务
export function queryDeviceTask(param, success) {
    let url = `${baseUrl}/datacenter/equip-scan-task/page-query`;
    http.postJson(url, param, success)
}

//更新设备台账任务
export function updateDeviceTask(param, success) {
  let url = `${baseUrl}/datacenter/equip-scan-task/update`;
  http.postJson(url, param, success)
}

//查询设备分类
export function queryDeviceCategory(param, success) {
  let url = `${baseUrl}/datacenter/equip-scan-task/equip-category-query`;
  http.postJson(url, param, success)
}

//查询设备任务下的部件类型及数量
export function categoryCount(param, success) {
  let url = `${baseUrl}/datacenter/equip-scan-task/category-count`
  http.postJson(url, param, success)
}

/*************************资产台账任务接口****************************/
//统计数量
export function countAssetsTask(param, success) {
  let url = `${baseUrl}/datacenter/property-scan-task/count`;
  http.postJson(url, param, success)
}

//创建设备台账任务
export function createAssetsTask(param, success) {
  let url = `${baseUrl}/datacenter/property-scan-task/create`;
    http.postJson(url, param, success)
}
//根据id删除设备台账任务
export function deleteAssetsTask(param, success) {
    let url = `${baseUrl}/datacenter/property-scan-task/delete`;
    http.postJson(url, param, success)
}
//查询设备台账任务
export function queryAssetsTask(param, success) {
    let url = `${baseUrl}/datacenter/property-scan-task/page-query`;
    http.postJson(url, param, success)
}
//更新设备台账任务
export function updateAssetsTask(param, success) {
    let url = `${baseUrl}/datacenter/property-scan-task/update`;
    http.postJson(url, param, success)
}
//查询设备族
export function queryAssetsFamily(param, success) {
    let url = `${baseUrl}/datacenter/property-scan-task/property-category-query`;
    http.postJson(url, param, success)
}
