fetch(add): 分配记录,批量分配/回收, 单卡列表, 任务列表, 导入ICCID
All checks were successful
构建并部署前端到测试环境 / build-and-deploy (push) Successful in 2m21s

This commit is contained in:
sexygoat
2026-01-24 16:18:30 +08:00
parent c69124a819
commit 0eed8244e5
13 changed files with 2375 additions and 334 deletions

View File

@@ -269,4 +269,86 @@ export class CardService extends BaseService {
static getCardChangeNotices(params?: any): Promise<PaginationResponse<any>> {
return this.getPage('/api/card-change-notices', params)
}
// ========== ICCID批量导入相关 ==========
/**
* 批量导入ICCID
* @param file Excel文件
* @param carrier_id 运营商ID
* @param batch_no 批次号(可选)
*/
static importIotCards(
file: File,
carrier_id: number,
batch_no?: string
): Promise<BaseResponse> {
const formData = new FormData()
formData.append('file', file)
formData.append('carrier_id', carrier_id.toString())
if (batch_no) {
formData.append('batch_no', batch_no)
}
return this.upload('/api/admin/iot-cards/import', file, { carrier_id, batch_no })
}
/**
* 获取导入任务列表
* @param params 查询参数
*/
static getIotCardImportTasks(params?: any): Promise<PaginationResponse<any>> {
return this.getPage('/api/admin/iot-cards/import-tasks', params)
}
/**
* 获取导入任务详情
* @param id 任务ID
*/
static getIotCardImportTaskDetail(id: number): Promise<BaseResponse<any>> {
return this.getOne(`/api/admin/iot-cards/import-tasks/${id}`)
}
// ========== 单卡列表(未绑定设备)相关 ==========
/**
* 获取单卡列表(未绑定设备)
* @param params 查询参数
*/
static getStandaloneIotCards(params?: any): Promise<PaginationResponse<any>> {
return this.getPage('/api/admin/iot-cards/standalone', params)
}
/**
* 批量分配单卡
* @param data 分配参数
*/
static allocateStandaloneCards(data: any): Promise<BaseResponse<any>> {
return this.post('/api/admin/iot-cards/standalone/allocate', data)
}
/**
* 批量回收单卡
* @param data 回收参数
*/
static recallStandaloneCards(data: any): Promise<BaseResponse<any>> {
return this.post('/api/admin/iot-cards/standalone/recall', data)
}
// ========== 资产分配记录相关 ==========
/**
* 获取资产分配记录列表
* @param params 查询参数
*/
static getAssetAllocationRecords(params?: any): Promise<PaginationResponse<any>> {
return this.getPage('/api/admin/asset-allocation-records', params)
}
/**
* 获取资产分配记录详情
* @param id 记录ID
*/
static getAssetAllocationRecordDetail(id: number): Promise<BaseResponse<any>> {
return this.getOne(`/api/admin/asset-allocation-records/${id}`)
}
}