import request from '@/apps/mobile/utils/request'

// 品牌管理----------------------------------------------

// 品牌列表
export function queryLifeBrandList(data) {
    return request({
        method: 'post',
        url: '/api/liftBrands/query-page',
        data,
    });
}
// 查询所有品牌
export function queryAllBrand(data) {
    return request({
        method: 'post',
        url: '/api/liftBrands/query',
        data,
    });
}

// 查询单个品牌
export function queryBrandById(id) {
    return request({
        method: 'get',
        url: `/api/liftBrands/query/${id}`,
    });
}

// 更新电梯品牌
export function updateLifeBrandStatus(data) {
    return request({
        method: 'put',
        url: `/api/liftBrands/update`,
        data,
    });
}

// 单个删除电梯品牌
export function deleteBrandsSingle(id) {
    return request({
        method: 'delete',
        url: `/api/liftBrands/delete/${id}`,
    });
}

// 批量删除电梯品牌
export function deleteBrandsBatch(data) {
    return request({
        method: 'delete',
        url: `/api/liftBrands/delete-batch`,
        data
    });
}


// 新增电梯品牌
export function addLifeBrand(data) {
    return request({
        method: 'post',
        url: '/api/liftBrands/insert',
        data,
    });
}

// 批量关闭
export function batchCloseBrand(data) {
    return request({
        method: 'post',
        url: '/api/liftBrands/noUseBath',
        data,
    });
}



// 资料库文件-----------------------------------------
// 根据dataTable类型查询  1:tsg 2:品牌资料 3:系统资料
export function queryLifeFilesList(data) {
    return request({
        method: 'post',
        url: '/api/liftFiles/query-page',
        data,
    });
}

// 更新资料库文件
export function updateLifeFilesStatus(data) {
    return request({
        method: 'put',
        url: `/api/liftFiles/update`,
        data,
    });
}

// 新增资料库文件
export function addLifeFiles(data) {
    return request({
        method: 'post',
        url: '/api/liftFiles/insert',
        data,
    });
}


// 单个删除资料库文件
export function deleteFilesSingle(data) {
    return request({
        method: 'delete',
        url: `/api/liftFiles/delete`,
        data,
    });
}


// 批量删除资料库文件
export function deleteFilesBatch(data) {
    return request({
        method: 'delete',
        url: `/api/liftFiles/delete-batch`,
        data
    });
}

// 批量启用资料库文件
export function openFilesBatch(data) {
    return request({
        method: 'post',
        url: '/api/liftFiles/useBath',
        data,
    });
}

// 批量关闭资料库文件
export function closeFilesBatch(data) {
    return request({
        method: 'post',
        url: '/api/liftFiles/nouseBath',
        data,
    });
}



// 资料分类----------------------------------------------
// 资料分类列表
export function queryLiftCategorysList(data) {
    return request({
        method: 'post',
        url: '/api/liftCategorys/query-page',
        data,
    });
}

// 更新资料分类
export function updateLiftCategorysStatus(data) {
    return request({
        method: 'put',
        url: `/api/liftCategorys/update`,
        data,
    });
}

// 单个删除资料分类
export function deleteLiftCategorysSingle(data) {
    return request({
        method: 'delete',
        url: `/api/liftCategorys/delete`,
        data
    });
}

// 批量删除资料分类
export function deleteLiftCategorysBatch(data) {
    return request({
        method: 'delete',
        url: `/api/liftCategorys/delete-batch`,
        data
    });
}

// 批量启用资料分类
export function openLiftCategorysBatch(data) {
    return request({
        method: 'post',
        url: '/api/liftCategorys/useBath',
        data,
    });
}

// 批量关闭资料分类
export function closeLiftCategorysBatch(data) {
    return request({
        method: 'post',
        url: '/api/liftCategorys/nouseBath',
        data,
    });
}



// 新增资料分类
export function addLiftCategorys(data) {
    return request({
        method: 'post',
        url: '/api/liftCategorys/insert',
        data,
    });
}

// 查询分类树状结构
export function queryLiftCategorysTree(id) {
    return request({
        method: 'get',
        url: `/api/liftCategorys/queryToTree?brandId=${id}`,
    });
}

// 查询分类树状结构
export function queryCategorysTree() {
    return request({
        method: 'get',
        url: `/api/liftCategorys/queryToTree`,
    });
}



// 故障代码----------------------------------------------
// 列表分页
export function queryFaultCodeList(data) {
    return request({
        method: 'post',
        url: '/api/liftFaultCodes/query-page',
        data,
    });
}

// 新增故障代码
export function addFaultCodes(data) {
    return request({
        method: 'post',
        url: '/api/liftFaultCodes/insert',
        data,
    });
}

// 更新故障代码
export function updateFaultCodesStatus(data) {
    return request({
        method: 'put',
        url: `/api/liftFaultCodes/update`,
        data,
    });
}


// 单个删除故障代码
export function deleteFaultCodesSingle(data) {
    return request({
        method: 'delete',
        url: `/api/liftFaultCodes/delete`,
        data,
    });
}

// 批量删除故障代码
export function deleteFaultCodesBatch(data) {
    return request({
        method: 'delete',
        url: `/api/liftFaultCodes/delete-batch`,
        data
    });
}


// 批量首页展示故障代码
export function showFaultCodesBatch(data) {
    return request({
        method: 'post',
        url: '/api/liftFaultCodes/showIndex',
        data,
    });
}

// 操作系统管理------------------------------------------

// 分页列表
export function queryOperatingSystemList(data) {
    return request({
        method: 'post',
        url: '/api/liftControls/query-page',
        data,
    });
}


// 新增操作系统
export function addOperatingSystem(data) {
    return request({
        method: 'post',
        url: '/api/liftControls/insert',
        data,
    });
}

// 更新操作系统
export function updateOperatingSystemStatus(data) {
    return request({
        method: 'put',
        url: `/api/liftControls/update`,
        data,
    });
}


// 单个删除操作系统
export function deleteOperatingSystemSingle(data) {
    return request({
        method: 'delete',
        url: `/api/liftControls/delete`,
        data,
    });
}

// 批量删除操作系统
export function deleteOperatingSystemBatch(data) {
    return request({
        method: 'delete',
        url: `/api/liftControls/delete-batch`,
        data
    });
}

// 批量首页展示操作系统
export function showOperatingSystemBatch(data) {
    return request({
        method: 'post',
        url: '/api/liftControls/showIndex',
        data,
    });
}


// 查询所有电梯系统
export function queryAllOperatingSystem(data) {
    return request({
        method: 'post',
        url: '/api/liftControls/queryAll',
        data,
    });
}


