|
@@ -2,7 +2,13 @@ import qs from 'qs';
|
|
|
|
|
|
import { request } from '@/utils';
|
|
|
|
|
|
-import type { DictTypeData, DictTypeDataParams } from '@/types';
|
|
|
+import type {
|
|
|
+ DictTypeData,
|
|
|
+ DictTypeDataParams,
|
|
|
+ ProtocolBaseInfo,
|
|
|
+ ProtocolParamData,
|
|
|
+ ProtocolParamSearchParams,
|
|
|
+} from '@/types';
|
|
|
|
|
|
/**
|
|
|
* 获取认证授权服务 url
|
|
@@ -77,6 +83,17 @@ export const addGateway = async () => {
|
|
|
await request(apiBiz('/gateway/add'));
|
|
|
};
|
|
|
|
|
|
+// 协议参数
|
|
|
+
|
|
|
+export const getProtocolParamList = async (params: ProtocolParamSearchParams) => {
|
|
|
+ const data = await request<ProtocolParamData>(apiBiz('/protocolParamInfo/getPageList'), {
|
|
|
+ method: 'POST',
|
|
|
+ body: JSON.stringify(params),
|
|
|
+ });
|
|
|
+
|
|
|
+ return data;
|
|
|
+};
|
|
|
+
|
|
|
// 协议基本信息
|
|
|
|
|
|
export const addProtocolBaseInfo = async () => {
|
|
@@ -94,8 +111,47 @@ export const uploadUserProtocol = async (protocolType: string, file: Blob) => {
|
|
|
const formData = new FormData();
|
|
|
formData.append('file', file);
|
|
|
|
|
|
- await request(`/protocolBaseInfo/uploadUserTemplate/?protocolType=${protocolType}`, {
|
|
|
+ const data = await request<Pick<ProtocolBaseInfo, 'id' | 'protocolName' | 'protocolType'>>(
|
|
|
+ apiBiz('/protocolBaseInfo/uploadUserTemplate/', { protocolType }),
|
|
|
+ {
|
|
|
+ method: 'POST',
|
|
|
+ body: formData,
|
|
|
+ },
|
|
|
+ );
|
|
|
+
|
|
|
+ return data;
|
|
|
+};
|
|
|
+
|
|
|
+export const downloadUserProtocol = async (protocolType: string, protocolName: string) => {
|
|
|
+ const blob = await request<Blob>(
|
|
|
+ apiBiz('/protocolBaseInfo/downloadUserProtocol/', {
|
|
|
+ protocolType,
|
|
|
+ protocolName,
|
|
|
+ }),
|
|
|
+ );
|
|
|
+
|
|
|
+ return blob;
|
|
|
+};
|
|
|
+
|
|
|
+export const getUploadProtocol = async (protocolType: string, protocolName: string) => {
|
|
|
+ const data = await request<ProtocolBaseInfo>(
|
|
|
+ apiBiz('/protocolBaseInfo/findUploadProtocolBaseInfo/', {
|
|
|
+ protocolType,
|
|
|
+ protocolName,
|
|
|
+ }),
|
|
|
+ );
|
|
|
+
|
|
|
+ return data;
|
|
|
+};
|
|
|
+
|
|
|
+export const getProtocolBaseInfo = async (id: number) => {
|
|
|
+ const data = await request<ProtocolBaseInfo>(apiBiz(`/protocolBaseInfo/info/${id}`));
|
|
|
+ return data;
|
|
|
+};
|
|
|
+
|
|
|
+export const updateProtocolBaseInfo = async (params: ProtocolBaseInfo) => {
|
|
|
+ await request(apiBiz('/protocolBaseInfo/update'), {
|
|
|
method: 'POST',
|
|
|
- body: formData,
|
|
|
+ body: JSON.stringify(params),
|
|
|
});
|
|
|
};
|