import api_request from '@/utils/api-request';
class UploadAPI {
static getTree() {
return api_request({
url: `attachmentapi/category`,
method: 'post',
});
}
static saveTree(data: any) {
return api_request({
url: `attachmentapi/categorysave`,
method: 'post',
data,
});
}
static delTree(data: any) {
return api_request({
url: `attachmentapi/categorydelete`,
method: 'post',
data,
});
}
static moveTree(data: any) {
return api_request({
url: `attachmentapi/movecategory`,
method: 'post',
data,
});
}
static getAttachmentList(data: any) {
return api_request({
url: `attachmentapi/list`,
method: 'post',
data,
});
}
static saveAttachmentName(data: any) {
return api_request({
url: `attachmentapi/save`,
method: 'post',
data,
});
}
static delAttachment(data: any) {
return api_request({
url: `attachmentapi/delete`,
method: 'post',
data,
});
}
static uploadAttachment(data: any, progress: any) {
return api_request({
url: `attachmentapi/upload`,
method: 'post',
data,
headers: {
'Content-Type': 'multipart/form-data',
},
onUploadProgress: progress,
});
}
static uploadQrcode(data: any) {
return api_request({
url: `attachmentapi/scanuploaddata`,
method: 'post',
data,
});
}
static getAttachmentCatch(data: any) {
return api_request({
url: `attachmentapi/catch`,
method: 'post',
data,
});
}
}
export default UploadAPI;
export interface Tree {
id: string;
pid: string;
name: string;
path: string;
is_enable: number | string;
sort: number;
items?: Tree[];
icon?: string;
}