Initial commit
This commit is contained in:
@@ -0,0 +1,136 @@
|
||||
import request from '@/utils/request';
|
||||
import type { ApiResult, PageResult } from '@/api';
|
||||
import type {
|
||||
TowerEquipment,
|
||||
TowerEquipmentParam
|
||||
} from '@/api/tower/equipment/model';
|
||||
/**
|
||||
* 分页查询设备
|
||||
*/
|
||||
export async function pageTowerEquipment(params: TowerEquipmentParam) {
|
||||
const res = await request.get<ApiResult<PageResult<TowerEquipment>>>(
|
||||
'/tower/tower-equipment/page',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询设备列表
|
||||
*/
|
||||
export async function listTowerEquipment(params?: TowerEquipmentParam) {
|
||||
const res = await request.get<ApiResult<TowerEquipment[]>>(
|
||||
'/tower/tower-equipment',
|
||||
{
|
||||
params
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0 && res.data.data) {
|
||||
return res.data.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加设备
|
||||
*/
|
||||
export async function addTowerEquipment(data: TowerEquipment) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/tower/tower-equipment',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改设备
|
||||
*/
|
||||
export async function updateTowerEquipment(data: TowerEquipment) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/tower/tower-equipment',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 绑定设备
|
||||
*/
|
||||
export async function bindTowerEquipment(data: TowerEquipment) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/tower/tower-equipment/bind',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除设备
|
||||
*/
|
||||
export async function removeTowerEquipment(id?: number) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/tower/tower-equipment/' + id
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量添加设备
|
||||
*/
|
||||
export async function addBatchTowerEquipment(data: TowerEquipment[]) {
|
||||
const res = await request.post<ApiResult<unknown>>(
|
||||
'/tower/tower-equipment/batch',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量修改设备状态
|
||||
*/
|
||||
export async function updateBatchTowerEquipment(data: TowerEquipment[]) {
|
||||
const res = await request.put<ApiResult<unknown>>(
|
||||
'/tower/tower-equipment/status',
|
||||
data
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除设备
|
||||
*/
|
||||
export async function removeBatchTowerEquipment(data: (number | undefined)[]) {
|
||||
const res = await request.delete<ApiResult<unknown>>(
|
||||
'/tower/tower-equipment/batch',
|
||||
{
|
||||
data
|
||||
}
|
||||
);
|
||||
if (res.data.code === 0) {
|
||||
return res.data.message;
|
||||
}
|
||||
return Promise.reject(new Error(res.data.message));
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
import type { PageParam } from '@/api';
|
||||
|
||||
export interface TowerEquipment {
|
||||
equipmentId?: number;
|
||||
name?: string;
|
||||
model?: string;
|
||||
equipmentNo?: string;
|
||||
factoryNo?: string;
|
||||
factoryDate?: string;
|
||||
manufactor?: string;
|
||||
lifeYear?: number;
|
||||
surplusYear?: number;
|
||||
scrapDate?: string;
|
||||
beianNo?: string;
|
||||
licenceNo?: string;
|
||||
company?: string;
|
||||
organization?: string;
|
||||
warehouse?: string;
|
||||
source?: string;
|
||||
filingNo?: string;
|
||||
machineNo?: string;
|
||||
maxLiftingHeight?: string;
|
||||
armLength?: string;
|
||||
isOutOrg?: boolean;
|
||||
buyDate?: string;
|
||||
currentLocation?: string;
|
||||
designHeight?: number;
|
||||
height?: number;
|
||||
ratedLoad?: string;
|
||||
files?: string;
|
||||
file1?: string;
|
||||
file2?: string;
|
||||
file3?: string;
|
||||
file4?: string;
|
||||
file5?: string;
|
||||
file6?: string;
|
||||
file7?: string;
|
||||
users?: string;
|
||||
status?: number;
|
||||
comments?: string;
|
||||
userId?: number;
|
||||
deleted?: number;
|
||||
tenantId?: number;
|
||||
createTime?: number;
|
||||
maxRatedLoad?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* 搜索条件
|
||||
*/
|
||||
export interface TowerEquipmentParam extends PageParam {
|
||||
equipmentId?: number;
|
||||
name?: string;
|
||||
status?: number;
|
||||
}
|
||||
Reference in New Issue
Block a user