import {
	request
} from '@/utils/request'

// 获取巡检数量统计
export function getInspectCount(params) {
	return request({
		url: '/rq/stat/inspect/total',
		method: 'get',
		params
	})
}
// 巡检工单列表
export function getInspectOrderList(params) {
	return request({
		url: '/rq/iot-inspect-order/page/app',
		method: 'get',
		params
	})
}

// 巡检工单列表 - 忽略
export function inspectOrderIgnore(data) {
	return request({
		url: '/rq/iot-inspect-order/ignore',
		method: 'post',
		params: data
	})
}

// 巡检工单详情 - 查看
export function getInspectOrderGet(params) {
	return request({
		url: '/rq/iot-inspect-order/get',
		method: 'get',
		params
	})
}
// 巡检工单详情 - 填写
export function getInspectOrderGetDetails(params) {
	return request({
		url: '/rq/iot-inspect-order/get/details',
		method: 'get',
		params
	})
}
// 巡检工单详情 - 提交
export function inspectOrderWrite(id, data) {
	return request({
		url: '/rq/iot-inspect-order/write/' + id,
		method: 'post',
		data
	})
}

/**
 * 获取启用的巡检计划
 * @param params
 */
export const getInspectPlanList = (params) =>
	request({
		url: '/rq/iot-inspect-plan/page',
		method: 'GET',
		params: { pageNo: 1, pageSize: 100, status: 0 },
	})