import request from '@/utils/request'; // ==================== 客户设备台账 ==================== export interface CustomerEquipment { id: number; equipmentNo: string; equipmentName: string; equipType?: string; customerId?: number; customerName?: string; building?: string; floor?: string; location?: string; photo?: string; status?: number; remark?: string; createdAt: string; updatedAt: string; } export interface CustomerEquipmentQuery { page?: number; pageSize?: number; keyword?: string; customerId?: number; building?: string; equipType?: string; } export interface CustomerEquipmentListResult { list: CustomerEquipment[]; total: number; page: number; pageSize: number; } export interface CustomerEquipmentCreateParams { equipmentName: string; equipType?: string; customerId?: number; building?: string; floor?: string; location?: string; photo?: string; status?: number; remark?: string; } export interface CustomerEquipmentUpdateParams { equipmentName?: string; equipType?: string; customerId?: number; building?: string; floor?: string; location?: string; photo?: string; status?: number; remark?: string; } export const customerEquipmentApi = { getList: (params: CustomerEquipmentQuery) => request.get('/customer-equipments', { params }), getDetail: (id: number) => request.get(`/customer-equipments/${id}`), create: (data: CustomerEquipmentCreateParams) => request.post('/customer-equipments', data), update: (id: number, data: CustomerEquipmentUpdateParams) => request.put(`/customer-equipments/${id}`, data), delete: (id: number) => request.delete(`/customer-equipments/${id}`), }; // ==================== 智电设备型号 ==================== export interface SmartDevice { id: number; modelNo: string; modelName: string; spec?: string; deviceType?: string; functionDesc?: string; supplier?: string; status?: number; remark?: string; createdAt: string; updatedAt: string; } export interface SmartDeviceQuery { page?: number; pageSize?: number; keyword?: string; deviceType?: string; } export interface SmartDeviceListResult { list: SmartDevice[]; total: number; page: number; pageSize: number; } export interface SmartDeviceCreateParams { modelNo: string; modelName: string; spec?: string; deviceType?: string; functionDesc?: string; supplier?: string; status?: number; remark?: string; } export interface SmartDeviceUpdateParams { modelNo?: string; modelName?: string; spec?: string; deviceType?: string; functionDesc?: string; supplier?: string; status?: number; remark?: string; } export const smartDeviceApi = { getList: (params: SmartDeviceQuery) => request.get('/smart-devices', { params }), getDetail: (id: number) => request.get(`/smart-devices/${id}`), create: (data: SmartDeviceCreateParams) => request.post('/smart-devices', data), update: (id: number, data: SmartDeviceUpdateParams) => request.put(`/smart-devices/${id}`, data), delete: (id: number) => request.delete(`/smart-devices/${id}`), }; // ==================== 智电改造线路台账 ==================== export interface ElectricLine { id: number; lineCode: string; equipId: number; iccDeviceCode?: string; lineName?: string; customerId: number; buildingId?: number; floorNo?: string; location?: string; status: number; syncedAt?: string; createdAt: string; // 联表补全字段 customerNo?: string; customerName?: string; equipCode?: string; equipName?: string; buildingName?: string; } export interface ElectricLineQuery { page?: number; pageSize?: number; keyword?: string; customerId?: number; equipId?: number; buildingId?: number; status?: number; } export interface ElectricLineListResult { list: ElectricLine[]; total: number; page: number; pageSize: number; } export interface IccLineSyncResult { pulled: number; synced: number; inserted: number; updated: number; skipped: number; } export const electricLineApi = { getList: (params: ElectricLineQuery) => request.get('/electric-lines', { params }), getDetail: (id: number) => request.get(`/electric-lines/${id}`), sync: () => request.post('/electric-lines/sync'), };