Files
fe_service_ebtp_frontend/src/services/untilService.ts
2022-03-10 14:24:13 +08:00

46 lines
1.2 KiB
TypeScript

import request from '@/utils/request';
import {doc} from "prettier";
/*雪花id获取*/
export async function SnowflakeID() {
return request('/api/core-service-ebtp-updownload/v1/business/id', {method: 'get'})
}
/*文档中心 根据bid获取文件列表 直接返回 upload组件 fileList 格式*/
export async function getFileBidList(BidID: any) {
if(BidID==null||BidID==""||BidID==undefined){
return ;
}
const Msg = <any>[];
await request('/api/core-service-ebtp-updownload/v1/attachment/find',
{
method: 'post',
data: {
"bidList": [BidID]
}
}
).then(res => {
if (res?.[BidID]?.length > 0) {
for (const f in res[BidID]) {
Msg.push(
{
uid: res[BidID][f].id,
name: res[BidID][f].filename,
status: 'done',
url: '/api/core-service-ebtp-updownload/v1/attachment/download/oid/' + res[BidID][f].id,
}
)
}
}
})
return Msg;
}
/*文档中心 逻辑删除 根据objectid */
export async function deleteFileObjId(ObjId: any) {
request('/api/core-service-ebtp-updownload/v1/attachment/item/'+ObjId,
{
method: 'delete',
}
)
}