新增资产管理页面,实现资产列表查询、状态切换和删除功能
This commit is contained in:
37
src/api/assets/asset/index.ts
Normal file
37
src/api/assets/asset/index.ts
Normal file
@@ -0,0 +1,37 @@
|
||||
import { newService } from '/@/utils/request';
|
||||
|
||||
// 资产列表查询参数
|
||||
export interface AssetQueryParams {
|
||||
name?: string;
|
||||
type?: string;
|
||||
status?: number;
|
||||
page?: number;
|
||||
pageSize?: number;
|
||||
}
|
||||
|
||||
// 获取资产列表
|
||||
export function listAssets(params?: AssetQueryParams) {
|
||||
return newService({
|
||||
url: '/assets/asset/listAssets',
|
||||
method: 'get',
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
||||
// 更新资产状态
|
||||
export function updateAssetStatus(id: string, status: number) {
|
||||
return newService({
|
||||
url: '/assets/asset/updateAssetStatus',
|
||||
method: 'put',
|
||||
data: { id, status },
|
||||
});
|
||||
}
|
||||
|
||||
// 删除资产
|
||||
export function deleteAsset(id: string) {
|
||||
return newService({
|
||||
url: '/assets/asset/deleteAsset',
|
||||
method: 'delete',
|
||||
params: { id },
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user