完善牧安云哨-前端

This commit is contained in:
BBIT-Kai
2025-12-29 16:29:15 +08:00
parent e1fcc64236
commit d78d3be5e0
12 changed files with 1905 additions and 0 deletions
+65
View File
@@ -0,0 +1,65 @@
import type { Recordable } from '@vben/types';
import { pyRequestClient } from '#/api/request';
export namespace SystemUpdateApi {
export interface SystemUpdate {
[key: string]: any;
id: string;
code: number;
dept_id?: string;
dept_name?: string;
remark?: string;
oss_url?: string;
size?: number;
created_at?: string;
}
}
/**
* 获取升级包列表
*/
async function getUpdateList(params: Recordable<any>) {
return pyRequestClient.get<Array<SystemUpdateApi.SystemUpdate>>(
'/iot/common/update/list',
{ params },
);
}
/**
* 创建升级包
* @param data 升级包数据
*/
async function createUpdate(
data: Omit<SystemUpdateApi.SystemUpdate, 'id' | 'created_at'>,
) {
delete data.oss_url
return pyRequestClient.post('/iot/common/update', data);
}
/**
* 删除升级包
* @param id 升级包 ID
*/
async function deleteUpdate(id: string) {
return pyRequestClient.delete(`/iot/common/update/${id}`);
}
/**
* 上传
*/
export async function getUpdateUploadUrl() {
return pyRequestClient.get('/iot/common/update/getUploadUrl');
}
/**
* 上传
*/
export async function getMaxCodeByDeptId(dept_id: string) {
return pyRequestClient.get('/iot/common/update/getMaxCodeByDeptId',{
params: {dept_id}
});
}
export {
createUpdate,
deleteUpdate,
getUpdateList,
};