102 lines
2.2 KiB
TypeScript
102 lines
2.2 KiB
TypeScript
import request from '@/utils/request';
|
|
import { AxiosPromise } from 'axios';
|
|
import {
|
|
KnowledgeDocumentVO,
|
|
KnowledgeDocumentForm,
|
|
KnowledgeDocumentQuery,
|
|
KnowledgeDocumentPutFileNameQuery
|
|
} from '@/api/safety/knowledgeDocument/types';
|
|
|
|
/**
|
|
* 查询安全知识库列表
|
|
* @param query
|
|
* @returns {*}
|
|
*/
|
|
|
|
export const listKnowledgeDocument = (query?: KnowledgeDocumentQuery): AxiosPromise<KnowledgeDocumentVO[]> => {
|
|
return request({
|
|
url: '/safety/knowledgeDocument/file/list',
|
|
method: 'get',
|
|
params: query
|
|
});
|
|
};
|
|
|
|
/**
|
|
* 查询安全知识库详细
|
|
* @param id
|
|
*/
|
|
export const getKnowledgeDocument = (id: string | number): AxiosPromise<KnowledgeDocumentVO> => {
|
|
return request({
|
|
url: '/safety/knowledgeDocument/' + id,
|
|
method: 'get'
|
|
});
|
|
};
|
|
|
|
/**
|
|
* 新增安全知识库
|
|
* @param data
|
|
*/
|
|
export const addKnowledgeDocument = (data: { file: string }, query: { projectId: string; pid: string }) => {
|
|
return request({
|
|
url: '/safety/knowledgeDocument/file',
|
|
method: 'post',
|
|
data: data,
|
|
params: query
|
|
});
|
|
};
|
|
|
|
/**
|
|
* 修改安全知识库
|
|
* @param data
|
|
*/
|
|
export const updateKnowledgeDocument = (data: KnowledgeDocumentForm) => {
|
|
return request({
|
|
url: '/safety/knowledgeDocument',
|
|
method: 'put',
|
|
data: data
|
|
});
|
|
};
|
|
|
|
/**
|
|
* 删除安全知识库
|
|
* @param id
|
|
*/
|
|
export const delKnowledgeDocument = (id: string | number | Array<string | number>) => {
|
|
return request({
|
|
url: '/safety/knowledgeDocument/file/' + id,
|
|
method: 'delete'
|
|
});
|
|
};
|
|
|
|
/**
|
|
* 查询安全知识库文件树列表
|
|
* @param id
|
|
*/
|
|
export const treeStructureData = (projectId: string | number): AxiosPromise<KnowledgeDocumentVO> => {
|
|
return request({
|
|
url: '/safety/knowledgeDocument/folder/tree/list',
|
|
method: 'get',
|
|
params: { projectId }
|
|
});
|
|
};
|
|
|
|
/**
|
|
* 修改安全知识库
|
|
* @param data
|
|
*/
|
|
export const documentDataEdit = (data: KnowledgeDocumentPutFileNameQuery) => {
|
|
return request({
|
|
url: '/safety/knowledgeDocument/file',
|
|
method: 'put',
|
|
data: data
|
|
});
|
|
};
|
|
|
|
export const uniFolderDownload = (data: any): AxiosPromise<KnowledgeDocumentVO> => {
|
|
return request({});
|
|
};
|
|
|
|
export const getProfileDetail = (data: any): AxiosPromise<KnowledgeDocumentVO> => {
|
|
return request({});
|
|
};
|