feat: 节点设置模块初步完成对接

develop2
donghao
parent cd816525b7
commit 7a37d4db6e

@ -2,7 +2,7 @@
* @Author: donghao donghao@supervision.ltd
* @Date: 2024-03-27 16:03:20
* @LastEditors: donghao donghao@supervision.ltd
* @LastEditTime: 2024-05-21 16:59:57
* @LastEditTime: 2024-05-30 14:53:21
* @FilePath: \general-ai-manage\src\components\Header\index.tsx
* @Description: layout
*/
@ -112,7 +112,7 @@ const MenuBar: React.FC<MenuBarProps> = ({ menuData, changeMenu }) => {
<BusinessBigLogo></BusinessBigLogo>
</div>
<div className="business_log_box flex items-center justify-center mx-[12px] mt-[16px] px-[10px] mb-[12px] font-bold bg-[#154DDD1a] text-[#154DDD] rounded-[8px] text-[14px]">
<img src={businessLogoIcon} />
<img src={getStoreBusinessInfo()?.logo || businessLogoIcon} />
<span className="pl-[8px] flex flex-1">{getStoreBusinessInfo()?.name}</span>
</div>
</div>

@ -2,13 +2,15 @@
* @Author: donghao donghao@supervision.ltd
* @Date: 2024-04-30 10:02:29
* @LastEditors: donghao donghao@supervision.ltd
* @LastEditTime: 2024-05-29 17:04:34
* @LastEditTime: 2024-05-30 16:21:27
* @FilePath: \general-ai-platform-web\src\pages\Business\DeviceGroup\components\alarmSetForm.tsx
* @Description:
* @
* 1
* 2
*/
import { apiEntityNodesAlert, apiEntityNodesAlertConfig } from '@/services/business/entity';
import { isSuccessApi } from '@/utils/forApi';
import {
ProForm,
ProFormCheckbox,
@ -18,20 +20,55 @@ import {
ProFormRadio,
ProFormSelect,
} from '@ant-design/pro-components';
import { Form } from 'antd';
import { useIntl } from '@umijs/max';
import { Form, message } from 'antd';
import { useEffect } from 'react';
type AlarmSetFormProps = {
currentRow: Record<string, any>;
values: Record<string, any>;
};
const AlarmSetForm: React.FC<AlarmSetFormProps> = (props) => {
const intl = useIntl();
const [form] = Form.useForm<API.DeviceCategory>();
// const [initialValues, setInitialValues] = useState<Record<string, any>>({});
function fetchInitialValues(record) {
const { is_sms, is_email, sms_to, email_to, ...restParams } = record;
form.setFieldsValue({
...restParams,
ways: [
{
label: '短信',
value: is_sms === 1 && sms_to ? sms_to.split(',') : [],
isChecked: is_sms === 1 ? ['1'] : [],
},
{
label: '邮件',
value: is_email === 1 && email_to ? email_to.split(',') : [],
isChecked: is_email === 1 ? ['1'] : [],
},
],
});
}
function fetchInitialValues() {}
async function loadData() {
// TODO 确认入参是否正确
const resp = await apiEntityNodesAlert({ node_id: props.values.node_id });
if (isSuccessApi(resp) && resp?.data) {
fetchInitialValues(resp?.data);
}
fetchInitialValues({
is_sms: 1,
is_email: 0,
sms_to: '用户A',
email_to: '',
freq: 'T',
});
}
useEffect(() => {
fetchInitialValues();
loadData();
}, []);
return (
<ProForm
className="gn_form alarmSetForm_wrap"
@ -42,19 +79,31 @@ const AlarmSetForm: React.FC<AlarmSetFormProps> = (props) => {
},
}}
form={form}
initialValues={props.currentRow}
onFinish={async (values) => {
// TODO 提交告警设置调用api
console.log('onFinish_values', values);
// postProjectCreateProject(values)
// .then(() => {
// message.success(intl.formatMessage({ id: 'common.action.success', defaultMessage: '$$$' }));
// props.reload();
// })
// .catch(() => {
// message.error(intl.formatMessage({ id: 'common.action.failure', defaultMessage: '$$$' }));
// });
// props.reload();
const { ways, ...restParams } = values;
const is_sms = ways[0].value.length ? 1 : 0;
const is_email = ways[1].value.length ? 1 : 0;
const sms_to = is_sms === 1 ? ways[0].value.join(',') : '';
const email_to = is_email === 1 ? ways[1].value.join(',') : '';
let resp = await apiEntityNodesAlertConfig({
...restParams,
is_sms,
is_email,
sms_to,
email_to,
node_id: props.values.node_id,
});
if (isSuccessApi(resp)) {
message.success(
intl.formatMessage({ id: 'common.action.success', defaultMessage: '$$$' }),
);
} else {
message.error(
resp?.meta?.message ||
intl.formatMessage({ id: 'common.action.failure', defaultMessage: '$$$' }),
);
}
return true;
}}
>
@ -119,24 +168,24 @@ const AlarmSetForm: React.FC<AlarmSetFormProps> = (props) => {
</ProFormGroup>
<ProFormGroup title="通知频次" titleStyle={{ margin: '0 0 8px' }}>
<ProFormRadio.Group
name="type"
name="freq"
initialValue={props.values?.type || '0'}
options={[
{
label: '每次',
value: '0',
value: 'T',
},
{
label: '每天',
value: '1',
value: 'D',
},
{
label: '每周',
value: '2',
value: 'W',
},
{
label: '每月',
value: '3',
value: 'M',
},
]}
></ProFormRadio.Group>

@ -4,7 +4,8 @@ import { ModalForm, ProForm, ProFormText, ProFormTextArea } from '@ant-design/pr
import { FormattedMessage, useIntl } from '@umijs/max';
import { Form, message } from 'antd';
import React from 'react';
import React from // , {useEffect}
'react';
import {
proFormSmallItemStyleProps,
proFormSmallModelWidth,

@ -2,7 +2,7 @@
* @Author: donghao donghao@supervision.ltd
* @Date: 2024-04-22 15:23:36
* @LastEditors: donghao donghao@supervision.ltd
* @LastEditTime: 2024-05-29 16:35:16
* @LastEditTime: 2024-05-30 15:25:27
* @FilePath: \general-ai-platform-web\src\pages\Business\DeviceGroup\components\deviceList.tsx
* @Description: deviceGroupdg
* @
@ -159,7 +159,6 @@ const DeviceList: React.FC<DeviceListProps> = (props) => {
<TableActionCard
key="TableActionCardRef"
renderActions={[
// TODO 设为默认交互补充
{
key: 'setModel',
renderDom: (
@ -168,7 +167,7 @@ const DeviceList: React.FC<DeviceListProps> = (props) => {
type="link"
size="small"
onClick={() => {
setCurrentRow(record);
setCurrentRow({ ...record, device_id: record.id });
setIsSettingOpen(true);
}}
>
@ -293,7 +292,7 @@ const DeviceList: React.FC<DeviceListProps> = (props) => {
return { data: [], success: true };
}
let resp = await apiEntityNodesDeviceList({ ...reqParams });
console.log(resp, 'getDeviceListByGroup_resp');
console.log(resp, 'apiEntityNodesDeviceList_resp');
return {
data: resp.data?.data,
success: resp.success,

@ -2,7 +2,7 @@
* @Author: donghao donghao@supervision.ltd
* @Date: 2024-04-30 10:02:29
* @LastEditors: donghao donghao@supervision.ltd
* @LastEditTime: 2024-05-13 10:44:10
* @LastEditTime: 2024-05-30 15:28:00
* @FilePath: \general-ai-platform-web\src\pages\Business\DeviceGroup\components\modelDeploy.tsx
* @Description:
* @
@ -11,7 +11,8 @@
*/
import { TextButton } from '@/components/Button';
import TableActionCard from '@/components/TableActionCard';
import { getBusinessModelList } from '@/services/testApi/businessModel';
import { apiEntityNodesBusimodel } from '@/services/business/entity';
import { ExclamationCircleFilled } from '@ant-design/icons';
import type { ActionType, ProColumns } from '@ant-design/pro-components';
import { ProTable } from '@ant-design/pro-components';
@ -23,8 +24,11 @@ import {
} from '../../../../../config/defaultTable';
import ModelDeployConfig from './modelDeployConfig';
// import CreateForm from './components/createForm';
type ModelDeployProps = {
nodeInfo: Record<string, any>;
};
const ModelDeploy: React.FC = () => {
const ModelDeploy: React.FC<ModelDeployProps> = (props) => {
// const intl = useIntl();
const actionRef = useRef<ActionType>();
@ -166,10 +170,14 @@ const ModelDeploy: React.FC = () => {
const { current, ...rest } = params;
const reqParams = {
pageNo: current,
node_id: props.nodeInfo.id,
...rest,
};
let resp = await getBusinessModelList({ ...reqParams });
console.log(resp, 'getModelVersionList_resp');
if (!reqParams.node_id) {
return { data: [], success: true };
}
let resp = await apiEntityNodesBusimodel({ ...reqParams });
console.log(resp, 'apiEntityNodesBusimodel_resp');
return {
data: resp.data?.data,
success: resp.success,

@ -2,7 +2,7 @@
* @Author: donghao donghao@supervision.ltd
* @Date: 2024-04-30 10:02:29
* @LastEditors: donghao donghao@supervision.ltd
* @LastEditTime: 2024-05-21 15:26:02
* @LastEditTime: 2024-05-30 15:06:39
* @FilePath: \general-ai-platform-web\src\pages\Business\DeviceGroup\components\modelSetting.tsx
* @Description:
* @
@ -10,21 +10,21 @@
* 2
*/
import TableActionCard from '@/components/TableActionCard';
import { getModelGroupBaseModelList } from '@/services/testApi/model';
import { apiEntityNodesDeviceModels } from '@/services/business/entity';
import { isSuccessApi } from '@/utils/forApi';
import type { ProColumns } from '@ant-design/pro-components';
import { ProList, ProTable } from '@ant-design/pro-components';
import { FormattedMessage } from '@umijs/max';
import { Button } from 'antd';
import { useEffect, useState } from 'react';
// import CreateForm from './components/createForm';
import { isSuccessApi } from '@/utils/forApi';
import CreateModelParams from './createModelParams';
type ModelSettingProps = {
info: Record<string, any>;
};
const ModelSetting: React.FC<ModelSettingProps> = () => {
const ModelSetting: React.FC<ModelSettingProps> = (props) => {
/**state */
const [modelData, setModelData] = useState<Record<string, any>[]>([]); // 列表数据
@ -117,6 +117,7 @@ const ModelSetting: React.FC<ModelSettingProps> = () => {
];
// 将数据组装成reactDom
// eslint-disable-next-line @typescript-eslint/no-unused-vars
function toListDomByData(record) {
let startList = [...record];
let finalList = startList.map((item) => ({
@ -161,9 +162,13 @@ const ModelSetting: React.FC<ModelSettingProps> = () => {
// 基础模型列表数据api
async function fetchData() {
const resp = await getModelGroupBaseModelList();
const resp = await apiEntityNodesDeviceModels({
pageNo: 1,
pageSize: 100,
device_id: props.info.device_id,
});
if (isSuccessApi(resp)) {
toListDomByData(resp.data.data);
// toListDomByData(resp.data.data);
}
}
@ -173,8 +178,9 @@ const ModelSetting: React.FC<ModelSettingProps> = () => {
// 初始化加载
useEffect(() => {
console.log(props.info, 'useEffect_info');
fetchData();
}, []);
}, [props.info]);
return (
<div className="dg_modelSetting_page">

@ -2,7 +2,7 @@
* @Author: donghao donghao@supervision.ltd
* @Date: 2024-04-22 15:23:36
* @LastEditors: donghao donghao@supervision.ltd
* @LastEditTime: 2024-05-29 15:15:23
* @LastEditTime: 2024-05-30 16:08:28
* @FilePath: \general-ai-platform-web\src\pages\Business\DeviceGroup\index.tsx
* @Description: deviceGroupdg
* @
@ -192,26 +192,8 @@ const DeviceGroup: React.FC = () => {
}}
></Tabs>
{tabKey === '1' && <DeviceList commInfo={commInfo} nodeInfo={nodeInfo}></DeviceList>}
{tabKey === '2' && <ModelDeploy info={nodeInfo}></ModelDeploy>}
{tabKey === '3' && (
<AlarmSetForm
currentRow={{
type: '2',
ways: [
{
label: '短信',
value: [],
isChecked: [],
},
{
label: '邮件',
value: [],
isChecked: [],
},
],
}}
></AlarmSetForm>
)}
{tabKey === '2' && <ModelDeploy nodeInfo={nodeInfo}></ModelDeploy>}
{tabKey === '3' && <AlarmSetForm values={nodeInfo}></AlarmSetForm>}
</div>
</ProCard>
</div>

@ -2,7 +2,7 @@
* @Author: donghao donghao@supervision.ltd
* @Date: 2024-04-07 14:02:00
* @LastEditors: donghao donghao@supervision.ltd
* @LastEditTime: 2024-05-28 14:30:32
* @LastEditTime: 2024-05-30 16:39:17
* @FilePath: \general-ai-manage\src\pages\ModelIndex\ModelIndex.tsx
* @Description:
* @
@ -268,10 +268,6 @@ const ModelIndex: React.FC = () => {
</Button>
</Access>
}
bodyStyle={{
maxHeight: 'calc(100vh - 250px)',
overflowY: 'scroll',
}}
>
<ProTable
className="gn_pro_table"

@ -2,7 +2,7 @@
* @Author: donghao donghao@supervision.ltd
* @Date: 2024-04-08 16:57:30
* @LastEditors: donghao donghao@supervision.ltd
* @LastEditTime: 2024-05-24 14:21:10
* @LastEditTime: 2024-05-29 17:46:16
* @FilePath: \general-ai-manage\src\pages\Project\BusinessProject\components\businessCard.tsx
* @Description:
*/
@ -34,7 +34,7 @@ const BusinessCard: React.FC<BusinessCardProps> = ({ info, renderActions }) => {
>
<div className="bp_card_body">
<div className="tag_box">
<div className="bg_tag_info single_line">{info?.industry}</div>
<div className="bg_tag_info single_line px-[8px]">{info?.industry}</div>
</div>
<div className="flex justify-end items-center pt-[8px]">
<span className="pr-[14px]">

@ -111,6 +111,10 @@
display: inline-block;
width: 48px;
height: 48px;
img {
// width: 48px;
height: 48px;
}
}
}
.main_info {

@ -2,7 +2,7 @@
* @Author: donghao donghao@supervision.ltd
* @Date: 2024-05-24 17:57:19
* @LastEditors: donghao donghao@supervision.ltd
* @LastEditTime: 2024-05-28 11:03:42
* @LastEditTime: 2024-05-30 14:44:21
* @FilePath: \general-ai-platform-web\src\services\business\basemodel.ts
* @Description:
*/
@ -135,7 +135,7 @@ export async function apiBasemodelInfo(body: any, options?: { [key: string]: any
},
);
}
/** 模型版本 */
// 添加模型版本
export async function apiBasemodelVersionAdd(body: any, options?: { [key: string]: any }) {
return request<API.Response & { data?: API.ENTITY_INDEX_DATA; msg?: string }>(
@ -151,6 +151,21 @@ export async function apiBasemodelVersionAdd(body: any, options?: { [key: string
},
);
}
// 编辑模型版本
export async function apiBasemodelVersionEdit(body: any, options?: { [key: string]: any }) {
return request<API.Response & { data?: API.ENTITY_INDEX_DATA; msg?: string }>(
`/api/v1/basemodel/version/edit`,
{
method: 'POST',
headers: {
// 'Content-Type': 'application/json',
// "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8"
},
data: body,
...(options || {}),
},
);
}
// 模型版本列表
export async function apiBasemodelVersionList(body: any, options?: { [key: string]: any }) {
return request<API.Response & { data?: API.ENTITY_INDEX_DATA; msg?: string }>(
@ -166,6 +181,39 @@ export async function apiBasemodelVersionList(body: any, options?: { [key: strin
},
);
}
// 模型版本信息
export async function apiBasemodelVersionInfo(body: any, options?: { [key: string]: any }) {
return request<API.Response & { data?: API.ENTITY_INDEX_DATA; msg?: string }>(
`/api/v1/basemodel/version/info`,
{
method: 'POST',
headers: {
// 'Content-Type': 'application/json',
// "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8"
},
data: body,
...(options || {}),
},
);
}
// 设置模型默认版本
export async function apiBasemodelVersionSetdefault(body: any, options?: { [key: string]: any }) {
return request<API.Response & { data?: API.ENTITY_INDEX_DATA; msg?: string }>(
`/api/v1/basemodel/version/setdefault`,
{
method: 'POST',
headers: {
// 'Content-Type': 'application/json',
// "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8"
},
data: body,
...(options || {}),
},
);
}
// 删除模型版本
export async function apiBasemodelVersionDelete(body: any, options?: { [key: string]: any }) {
return request<API.Response & { data?: API.ENTITY_INDEX_DATA; msg?: string }>(
@ -181,11 +229,72 @@ export async function apiBasemodelVersionDelete(body: any, options?: { [key: str
},
);
}
/** 模型运行库 */
// 添加模型运行库
export async function apiBasemodelHubAdd(body: any, options?: { [key: string]: any }) {
return request<API.Response & { data?: API.ENTITY_INDEX_DATA; msg?: string }>(
`/api/v1/basemodel/hub/add`,
{
method: 'POST',
headers: {
// 'Content-Type': 'application/json',
// "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8"
},
data: body,
...(options || {}),
},
);
}
// 编辑模型运行库
export async function apiBasemodelHubEdit(body: any, options?: { [key: string]: any }) {
return request<API.Response & { data?: API.ENTITY_INDEX_DATA; msg?: string }>(
`/api/v1/basemodel/hub/edit`,
{
method: 'POST',
headers: {
// 'Content-Type': 'application/json',
// "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8"
},
data: body,
...(options || {}),
},
);
}
// 模型运行库列表
export async function apiBasemodelHubList(body: any, options?: { [key: string]: any }) {
return request<API.Response & { data?: API.ENTITY_INDEX_DATA; msg?: string }>(
`/api/v1/basemodel/hub/list`,
{
method: 'POST',
headers: {
// 'Content-Type': 'application/json',
// "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8"
},
data: body,
...(options || {}),
},
);
}
// 删除模型运行库
export async function apiBasemodelHubDelete(body: any, options?: { [key: string]: any }) {
return request<API.Response & { data?: API.ENTITY_INDEX_DATA; msg?: string }>(
`/api/v1/basemodel/hub/delete`,
{
method: 'POST',
headers: {
// 'Content-Type': 'application/json',
// "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8"
},
data: body,
...(options || {}),
},
);
}
// 模型版本信息
export async function apiBasemodelVersionInfo(body: any, options?: { [key: string]: any }) {
// 模型运行库信息
export async function apiBasemodelHubInfo(body: any, options?: { [key: string]: any }) {
return request<API.Response & { data?: API.ENTITY_INDEX_DATA; msg?: string }>(
`/api/v1/basemodel/version/info`,
`/api/v1/basemodel/hub/info`,
{
method: 'POST',
headers: {

@ -2,7 +2,7 @@
* @Author: donghao donghao@supervision.ltd
* @Date: 2024-05-23 13:50:50
* @LastEditors: donghao donghao@supervision.ltd
* @LastEditTime: 2024-05-28 14:16:29
* @LastEditTime: 2024-05-30 15:01:21
* @FilePath: \general-ai-platform-web\src\services\Business\entity.ts
* @Description: api
*/
@ -283,3 +283,134 @@ export async function apiEntityNodesDeviceList(body: any, options?: { [key: stri
},
);
}
/** 节点其它内容 模型列表、部署、告警设置 */
// 企业节点,所有设备列表的简单数据
export async function apiEntityNodesDeviceListSimple(body: any, options?: { [key: string]: any }) {
return request<API.Response & { data?: API.ENTITY_INDEX_DATA; msg?: string }>(
`/api/v1/enterprise/entity/nodes/device/list/simple`,
{
method: 'POST',
headers: {
// 'Content-Type': 'application/json',
// "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8"
},
data: body,
...(options || {}),
},
);
}
// 企业节点,业务模型部署
export async function apiEntityNodesBusimodel(body: any, options?: { [key: string]: any }) {
return request<API.Response & { data?: API.ENTITY_INDEX_DATA; msg?: string }>(
`/api/v1/enterprise/entity/nodes/busimodel`,
{
method: 'POST',
headers: {
// 'Content-Type': 'application/json',
// "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8"
},
data: body,
...(options || {}),
},
);
}
// 企业节点,业务模型部署 -> 业务模型信息
export async function apiEntityNodesBusimodelInfo(body: any, options?: { [key: string]: any }) {
return request<API.Response & { data?: API.ENTITY_INDEX_DATA; msg?: string }>(
`/api/v1/enterprise/entity/nodes/busimodel/info`,
{
method: 'POST',
headers: {
// 'Content-Type': 'application/json',
// "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8"
},
data: body,
...(options || {}),
},
);
}
// 企业节点,节点信息 -> 业务模型部署 -> 业务模型配置
export async function apiEntityNodesBusimodelDeploy(body: any, options?: { [key: string]: any }) {
return request<API.Response & { data?: API.ENTITY_INDEX_DATA; msg?: string }>(
`/api/v1/enterprise/entity/nodes/busimodel/deploy`,
{
method: 'POST',
headers: {
// 'Content-Type': 'application/json',
// "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8"
},
data: body,
...(options || {}),
},
);
}
// 企业节点,节点信息 -> 设备列表 -> 基础模型配置 -> 模型列表
export async function apiEntityNodesDeviceModels(body: any, options?: { [key: string]: any }) {
return request<API.Response & { data?: API.ENTITY_INDEX_DATA; msg?: string }>(
`/api/v1/enterprise/entity/nodes/device/models`,
{
method: 'POST',
headers: {
// 'Content-Type': 'application/json',
// "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8"
},
data: body,
...(options || {}),
},
);
}
// 企业节点,节点信息 -> 设备列表 -> 基础模型配置 -> 基础模型参数配置
export async function apiEntityNodesDeviceBasemodelCustomConfig(
body: any,
options?: { [key: string]: any },
) {
return request<API.Response & { data?: API.ENTITY_INDEX_DATA; msg?: string }>(
`/api/v1/enterprise/entity/nodes/device/basemodel/custom/config`,
{
method: 'POST',
headers: {
// 'Content-Type': 'application/json',
// "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8"
},
data: body,
...(options || {}),
},
);
}
// 企业节点,节点信息 -> 设备列表 -> 告警设置信息
export async function apiEntityNodesAlert(body: any, options?: { [key: string]: any }) {
return request<API.Response & { data?: API.ENTITY_INDEX_DATA; msg?: string }>(
`/api/v1/enterprise/entity/nodes/alert`,
{
method: 'POST',
headers: {
// 'Content-Type': 'application/json',
// "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8"
},
data: body,
...(options || {}),
},
);
}
// 企业节点,节点信息 -> 设备列表 -> 告警设置,更新配置
export async function apiEntityNodesAlertConfig(body: any, options?: { [key: string]: any }) {
return request<API.Response & { data?: API.ENTITY_INDEX_DATA; msg?: string }>(
`/api/v1/enterprise/entity/nodes/alert/config`,
{
method: 'POST',
headers: {
// 'Content-Type': 'application/json',
// "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8"
},
data: body,
...(options || {}),
},
);
}

@ -0,0 +1,43 @@
/*
* @Author: donghao donghao@supervision.ltd
* @Date: 2024-05-24 17:57:19
* @LastEditors: donghao donghao@supervision.ltd
* @LastEditTime: 2024-05-30 14:14:24
* @FilePath: \general-ai-platform-web\src\services\business\file.ts
* @Description: api
*/
// @ts-ignore
/* eslint-disable */
import { request } from '@umijs/max';
/** 文件存储 */
// 上传文件
export async function apiFileUpload(body: any, options?: { [key: string]: any }) {
return request<API.Response & { data?: API.ENTITY_INDEX_DATA; msg?: string }>(
`/api/v1/file/upload`,
{
method: 'POST',
headers: {
// 'Content-Type': 'application/json',
// "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8"
},
data: body,
...(options || {}),
},
);
}
// 上传文件
export async function apiFileDelete(body: any, options?: { [key: string]: any }) {
return request<API.Response & { data?: API.ENTITY_INDEX_DATA; msg?: string }>(
`/api/v1/file/delete`,
{
method: 'POST',
headers: {
// 'Content-Type': 'application/json',
// "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8"
},
data: body,
...(options || {}),
},
);
}

@ -0,0 +1,90 @@
/*
* @Author: donghao donghao@supervision.ltd
* @Date: 2024-05-24 17:57:19
* @LastEditors: donghao donghao@supervision.ltd
* @LastEditTime: 2024-05-30 14:58:40
* @FilePath: \general-ai-platform-web\src\services\business\model.ts
* @Description: api
*/
// @ts-ignore
/* eslint-disable */
import { request } from '@umijs/max';
/** 企业业务模型部署 */
// 添加企业部署的业务模型
export async function apiModelDeploymentAdd(body: any, options?: { [key: string]: any }) {
return request<API.Response & { data?: API.ENTITY_INDEX_DATA; msg?: string }>(
`/api/v1/model/deployment/add`,
{
method: 'POST',
headers: {
// 'Content-Type': 'application/json',
// "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8"
},
data: body,
...(options || {}),
},
);
}
// 编辑企业部署的业务模型
export async function apiModelDeploymentEdit(body: any, options?: { [key: string]: any }) {
return request<API.Response & { data?: API.ENTITY_INDEX_DATA; msg?: string }>(
`/api/v1/model/deployment/edit`,
{
method: 'POST',
headers: {
// 'Content-Type': 'application/json',
// "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8"
},
data: body,
...(options || {}),
},
);
}
// 企业部署的业务模型列表
export async function apiModelDeploymentList(body: any, options?: { [key: string]: any }) {
return request<API.Response & { data?: API.ENTITY_INDEX_DATA; msg?: string }>(
`/api/v1/model/deployment/list`,
{
method: 'POST',
headers: {
// 'Content-Type': 'application/json',
// "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8"
},
data: body,
...(options || {}),
},
);
}
// // 删除企业部署的业务模型
// export async function apiModelDeploymentDelete(body: any, options?: { [key: string]: any }) {
// return request<API.Response & { data?: API.ENTITY_INDEX_DATA; msg?: string }>(
// `/api/v1/model/deployment/delete`,
// {
// method: 'POST',
// headers: {
// // 'Content-Type': 'application/json',
// // "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8"
// },
// data: body,
// ...(options || {}),
// },
// );
// }
// 企业部署的业务模型信息
export async function apiModelDeploymentInfo(body: any, options?: { [key: string]: any }) {
return request<API.Response & { data?: API.ENTITY_INDEX_DATA; msg?: string }>(
`/api/v1/model/deployment/info`,
{
method: 'POST',
headers: {
// 'Content-Type': 'application/json',
// "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8"
},
data: body,
...(options || {}),
},
);
}
Loading…
Cancel
Save