// GET /dc/res/base/getObjListNotInspGroupId

/**
 *  @description：督查模块
 *  @author: niuxiaokui
 */
import request from '../utils/gw_ajax_request.js';

const baseurl = '/pdcApi';
// const baseurl = 'http://10.8.4.135:8872'
// const baseurl = 'http://36.250.234.48:8105'
/**
 * @description 督查查询
 * @author niuxiaokui
 * @date 2018-10-26
 * @export
 * @param {*} data
 * @returns
 */
// 督查问题
export function getObjListNotInspGroupId(
  inspGroupId,
  objType,
  pageSize,
  pageIndex,
  searchNameOfRsName,
  searchNameOfAdName,
  searchNameOfwtdstNm,
  engScal,
  rsAdmDep,
  wtdstType,
  wtdstState,
  searchProvTreeListCode,
) {
  const paramsObj = {
    inspGroupId: inspGroupId,
    objType: objType,
    pageSize: pageSize,
    pageNum: pageIndex,
  };
  if (searchProvTreeListCode && searchProvTreeListCode != '') {
    paramsObj['adCode'] = searchProvTreeListCode;
  }
  if (objType == '1') {
    paramsObj['rsName'] = searchNameOfRsName;
    paramsObj['engScal'] = engScal;
    paramsObj['rsAdmDep'] = rsAdmDep;
  } else if (objType == '2') {
    paramsObj['adName'] = searchNameOfAdName;
  } else {
    paramsObj['wtdstNm'] = searchNameOfwtdstNm;
    paramsObj['wtdstType'] = wtdstType;
    paramsObj['wtdstState'] = wtdstState;
  }
  return request({
    url: '/dc/insp/obj/getObjListNotInspGroupId',
    method: 'get',
    params: paramsObj,
  });
}
export function addDcAndObjRel(
  objId,
  objName,
  objLttd,
  objLgtd,
  objType,
  inspGroupId,
  plnaId,
  guid,
) {
  return request({
    url: '/dc/insp/obj/addDcAndObjRel',
    method: 'POST',
    params: {
      objId: objId,
      objName: objName,
      objLttd: objLttd,
      objLgtd: objLgtd,
      objType: objType,
      inspGroupId: inspGroupId,
      plnaId: plnaId,
      guid: guid,
    },
  });
}
// 督查对象名录-
export function getDcdxList(
  objType,
  pageSize,
  pageIndex,
  searchNameOfRsName,
  searchNameOfAdName,
  searchNameOfwtdstNm,
  engScal,
  rsAdmDep,
  wtdstType,
  wtdstState,
  groupId,
) {
  const paramsObj = {
    // 'orgId': orgId,
    // 'groupId': groupId,
    // 'inspGroupId': inspGroupId,
    objType: objType,
    pageSize: pageSize,
    pageNum: pageIndex,
  };
  if (groupId && groupId != '') {
    paramsObj['groupId'] = groupId;
  }
  if (objType == '1') {
    paramsObj['rsName'] = searchNameOfRsName;
    paramsObj['engScal'] = engScal;
    paramsObj['rsAdmDep'] = rsAdmDep;
  } else if (objType == '2') {
    paramsObj['adName'] = searchNameOfAdName;
  } else {
    paramsObj['wtdstNm'] = searchNameOfwtdstNm;
    paramsObj['wtdstType'] = wtdstType;
    paramsObj['wtdstState'] = wtdstState;
  }
  return request({
    url: '/dc/insp/obj/getObjByPersId',
    method: 'get',
    params: paramsObj,
  });
}
