fix: 修复测试反馈问题

develop2
donghao 9 months ago
parent 2dff260baa
commit 3090ffa557

@ -3,4 +3,4 @@ REACT_APP_ENV = dev
API_SERVER = 127.0.0.1:8888
SERVER_HOST = http://localhost:8888/
FILE_SERVER_HOST = http://192.168.10.28:8088
WEBRTC_SERVER_HOST = http://192.168.10.70:8889
WEBRTC_SERVER_HOST = http://192.168.10.70:8989

@ -3,4 +3,4 @@ REACT_APP_ENV = dev
API_SERVER = 127.0.0.1:8888
SERVER_HOST = http://localhost:8888/
FILE_SERVER_HOST = http://192.168.10.28:8088
WEBRTC_SERVER_HOST = http://192.168.10.70:8889
WEBRTC_SERVER_HOST = http://192.168.10.70:8989

@ -2,4 +2,4 @@ REACT_APP_ENV = prod
API_SERVER = 127.0.0.1:8888
SERVER_HOST = /
FILE_SERVER_HOST = http://192.168.10.70
WEBRTC_SERVER_HOST = http://192.168.10.70:8889
WEBRTC_SERVER_HOST = http://192.168.10.70:8989

@ -2,7 +2,7 @@
* @Author: zhoux zhouxia@supervision.ltd
* @Date: 2023-11-13 11:32:26
* @LastEditors: donghao donghao@supervision.ltd
* @LastEditTime: 2024-05-13 10:24:31
* @LastEditTime: 2024-07-16 10:37:54
* @FilePath: \general-ai-platform-web\config\defaultTable.ts
* @Description:
*/
@ -29,6 +29,7 @@ export const proTablePaginationOptions: PaginationProps = {
showSizeChanger: true,
// showQuickJumper: true,
showTotal: (total) => `${total}`,
// pageSizeOptions: ['5', '10', '20', '500'], // 每页条数选项
};
// 默认索引列配置

@ -33,7 +33,7 @@ export default {
// localhost:8000/api/** -> https://preview.pro.ant.design/api/**
'/api/v1/': {
// 要代理的地址
target: 'http://192.168.10.70:8889/',
target: 'http://192.168.10.70:8989/',
// target: 'https://www.baidu.com',
// 配置了这个可以从 http 代理到 https
// 依赖 origin 的功能可能需要这个,比如 cookie

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

@ -22,7 +22,10 @@
width: calc(100vw - 200px);
min-width: 100px;
height: 64px;
padding: 0 24px;
background-color: white;
}
.app_page_wrap .page_body .body_nav_bar .body_nav_bar_inner {
padding: 8px 24px;
}
.app_page_wrap .page_body .body_nav_bar .avatar_box > img {
width: 40px;
@ -30,7 +33,7 @@
border-radius: 50%;
}
.app_page_wrap .page_body .body_content {
padding-top: 64px;
padding-top: 80px;
}
.ant-pro-layout .ant-pro-layout-content {
position: relative;

@ -21,7 +21,12 @@
width: calc(100vw - 200px);
min-width: 100px;
height: 64px;
padding: 0 24px;
// padding: 0 24px ;
background-color: white;
.body_nav_bar_inner {
// border-radius: 6px;
padding: 8px 24px;
}
// background-color: #f8fafd;
.avatar_box {
& > img {
@ -32,7 +37,7 @@
}
}
.body_content {
padding-top: 64px;
padding-top: 80px;
}
}
}

@ -196,17 +196,18 @@ export const layout: RunTimeLayoutConfig = ({ initialState, setInitialState }) =
</div>
<div className="page_body">
<div className="flex items-center justify-between body_nav_bar">
<span className="head2">
{currMenu?.name &&
intl.formatMessage({ id: `menu.${currMenu?.name}`, defaultMessage: '首页' })}
</span>
<div>
<AvatarDropdown menu={true}>
<div className="flex items-center cursor-pointer avatar_box">
<AvatarName></AvatarName>
</div>
</AvatarDropdown>
{/* {initialState?.currentUser?.userName ? (
<div className="flex items-center justify-between w-full bg-white body_nav_bar_inner">
<span className="head2">
{currMenu?.name &&
intl.formatMessage({ id: `menu.${currMenu?.name}`, defaultMessage: '首页' })}
</span>
<div>
<AvatarDropdown menu={true}>
<div className="flex items-center cursor-pointer avatar_box">
<AvatarName></AvatarName>
</div>
</AvatarDropdown>
{/* {initialState?.currentUser?.userName ? (
<AvatarDropdown menu={true}>
<div className="flex items-center cursor-pointer avatar_box">
<AvatarName></AvatarName>
@ -215,6 +216,7 @@ export const layout: RunTimeLayoutConfig = ({ initialState, setInitialState }) =
) : (
<></>
)} */}
</div>
</div>
</div>
<div className="body_content">

@ -52,7 +52,7 @@
}
.menu_top {
width: 100%;
height: 72px;
height: 64px;
color: @primary_color;
font-weight: bold;
border-radius: 0px 0px 64px 0px;

@ -2,7 +2,7 @@
* @Author: donghao donghao@supervision.ltd
* @Date: 2024-07-16 13:02:35
* @LastEditors: donghao donghao@supervision.ltd
* @LastEditTime: 2024-07-16 17:10:10
* @LastEditTime: 2024-07-18 09:33:17
* @FilePath: \general-ai-platform-web\src\components\UploadFile\src\draggerUpload.tsx
* @Description:
*
@ -53,7 +53,7 @@ const DraggerUpload: React.FC = (props) => {
const defualtOptions = {
accept: props?.proFieldProps?.accept || 'application/json, application/x-yaml', // 默认使用 JSON 或者 yaml 文件类型
max: props?.proFieldProps?.max || 1,
size: props?.proFieldProps?.size || 1024 * 1024 * 200,
size: props?.proFieldProps?.size || 1024 * 1024 * 200, // 默认200M
};
// const defalutOptions: UploadProps = {
// name: 'file',
@ -203,7 +203,6 @@ const DraggerUpload: React.FC = (props) => {
)}
</Upload>
</div>
{props?.openPreviewFile && <UploadFileForView file={previewFile} />}
</ProFormItem>
);

@ -1,4 +1,4 @@
import { FormUploadDraggerToken } from '@/components/UploadFile';
import { DraggerUpload } from '@/components/UploadFile';
import { apiEntityNodes } from '@/services/business/entity';
import { apiModelDeploymentAdd } from '@/services/business/model';
import { isSuccessApi } from '@/utils/forApi';
@ -291,7 +291,7 @@ const CreateForm: React.FC<CreateFormProps> = (props) => {
),
}}
>
<FormUploadDraggerToken
<DraggerUpload
proFieldProps={{
label: (
<div className="flex">
@ -309,6 +309,8 @@ const CreateForm: React.FC<CreateFormProps> = (props) => {
icon: <i className="iconfont icon-shangchuanwenjian text_primary text-[32px]"></i>,
name: 'business_logic_arr',
max: 1,
// initialValue: [],
accept: 'application/zip, application/gzip, application/x-tar',
}}
afterUploadFile={({ resp }) => {
setCurrFormData((data) => {
@ -320,7 +322,6 @@ const CreateForm: React.FC<CreateFormProps> = (props) => {
return { ...data, business_logic: '' };
});
}}
openPreviewFile={true}
/>
</StepsForm.StepForm>
{/* 参数配置 */}
@ -343,7 +344,7 @@ const CreateForm: React.FC<CreateFormProps> = (props) => {
return true;
}}
>
<FormUploadDraggerToken
<DraggerUpload
proFieldProps={{
label: (
<div className="flex">

@ -1,4 +1,4 @@
import { FormUploadDraggerToken } from '@/components/UploadFile';
import { DraggerUpload } from '@/components/UploadFile';
import { apiEntityNodes } from '@/services/business/entity';
import { apiModelDeploymentEdit } from '@/services/business/model';
import { isSuccessApi } from '@/utils/forApi';
@ -314,7 +314,7 @@ const UpdateForm: React.FC<UpdateFormProps> = (props) => {
),
}}
>
<FormUploadDraggerToken
<DraggerUpload
proFieldProps={{
label: (
<div className="flex">
@ -342,6 +342,7 @@ const UpdateForm: React.FC<UpdateFormProps> = (props) => {
},
]
: [],
accept: 'application/zip, application/gzip, application/x-tar',
}}
afterUploadFile={({ resp }) => {
setCurrFormData((data) => {
@ -353,7 +354,6 @@ const UpdateForm: React.FC<UpdateFormProps> = (props) => {
return { ...data, business_logic: '' };
});
}}
openPreviewFile={true}
/>
</StepsForm.StepForm>
{/* 参数配置 */}
@ -376,7 +376,7 @@ const UpdateForm: React.FC<UpdateFormProps> = (props) => {
return true;
}}
>
<FormUploadDraggerToken
<DraggerUpload
proFieldProps={{
label: (
<div className="flex">

@ -2,7 +2,7 @@
* @Author: donghao donghao@supervision.ltd
* @Date: 2024-04-22 15:23:36
* @LastEditors: donghao donghao@supervision.ltd
* @LastEditTime: 2024-06-25 15:10:47
* @LastEditTime: 2024-07-18 11:15:26
* @FilePath: \general-ai-platform-web\src\pages\Node\BusinessModel\index.tsx
* @Description:
* @
@ -142,8 +142,9 @@ const BusinessModel: React.FC = () => {
renderDom: (
<IsDelete
deleteApi={async () => {
console.log('删除成功');
const resp = apiModelDeploymentDelete({ id: record.id });
// console.log('删除成功');
const resp = await apiModelDeploymentDelete({ id: record.model_id });
console.log(resp, 'apiModelDeploymentDelete');
if (isSuccessApi(resp)) {
reloadList();
message.success(

@ -2,7 +2,7 @@
* @Author: donghao donghao@supervision.ltd
* @Date: 2024-04-30 10:02:29
* @LastEditors: donghao donghao@supervision.ltd
* @LastEditTime: 2024-06-20 11:30:56
* @LastEditTime: 2024-07-18 17:24:34
* @FilePath: \general-ai-platform-web\src\pages\Business\DeviceGroup\components\alarmSetForm.tsx
* @Description:
* @
@ -18,7 +18,7 @@ import {
ProFormGroup,
ProFormList,
ProFormRadio,
ProFormSelect,
ProFormText,
} from '@ant-design/pro-components';
import { useIntl } from '@umijs/max';
import { Form, message } from 'antd';
@ -40,12 +40,14 @@ const AlarmSetForm: React.FC<AlarmSetFormProps> = (props) => {
ways: [
{
label: '短信',
value: is_sms === 1 && sms_to ? sms_to.split(',') : [],
value: sms_to,
// value: is_sms === 1 && sms_to ? sms_to.split(',') : [],
isChecked: is_sms === 1 ? ['1'] : [],
},
{
label: '邮件',
value: is_email === 1 && email_to ? email_to.split(',') : [],
value: email_to,
// value: is_email === 1 && email_to ? email_to.split(',') : [],
isChecked: is_email === 1 ? ['1'] : [],
},
],
@ -77,8 +79,11 @@ const AlarmSetForm: React.FC<AlarmSetFormProps> = (props) => {
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(',') : '';
const sms_to = is_sms === 1 ? ways[0].value : '';
const email_to = is_email === 1 ? ways[1].value : '';
// 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,
@ -132,22 +137,31 @@ const AlarmSetForm: React.FC<AlarmSetFormProps> = (props) => {
{({ isChecked }) => {
console.log(isChecked, 'isChecked');
return (
<ProFormSelect
// <ProFormSelect
// width={'lg'}
// mode="multiple"
// name="value"
// debounceTime={1000}
// disabled={!isChecked?.length}
// request={async () => {
// // const resp = await postCurrentIP();
// const resp = ['用户A', '用户B', '用户C'];
// return resp?.map((v: any) => {
// return {
// label: v,
// value: v,
// };
// });
// }}
// />
<ProFormText
width={'lg'}
mode="multiple"
name="value"
debounceTime={1000}
disabled={!isChecked?.length}
request={async () => {
// const resp = await postCurrentIP();
const resp = ['用户A', '用户B', '用户C'];
return resp?.map((v: any) => {
return {
label: v,
value: v,
};
});
}}
placeholder={`${intl.formatMessage({
id: 'common.please_input',
defaultMessage: '$$$',
})}`}
/>
);
}}

@ -1,5 +1,5 @@
import { CommButton } from '@/components/Button';
import { FormUploadDraggerToken } from '@/components/UploadFile';
import { DraggerUpload } from '@/components/UploadFile';
import { apiModelHubSync } from '@/services/business/model';
import {
@ -150,7 +150,7 @@ const CreateModelParams: React.FC<CreateModelParamsProps> = (props) => {
return true;
}}
>
<FormUploadDraggerToken
<DraggerUpload
proFieldProps={{
label: (
<div className="flex">
@ -168,6 +168,8 @@ const CreateModelParams: React.FC<CreateModelParamsProps> = (props) => {
icon: <i className="iconfont icon-shangchuanwenjian text_primary text-[32px]"></i>,
name: 'busi_conf_file_arr',
max: 1,
// initialValue: [],
accept: 'application/zip, application/gzip, application/x-tar',
}}
afterUploadFile={({ resp }) => {
setCurrFormData((data) => {
@ -179,7 +181,6 @@ const CreateModelParams: React.FC<CreateModelParamsProps> = (props) => {
return { ...data, busi_conf_file: '' };
});
}}
openPreviewFile={true}
/>
</StepsForm.StepForm>
{/* 运行库选择 runtimeLib */}
@ -343,7 +344,7 @@ const CreateModelParams: React.FC<CreateModelParamsProps> = (props) => {
return true;
}}
>
<FormUploadDraggerToken
<DraggerUpload
proFieldProps={{
label: (
<div className="flex">
@ -361,6 +362,7 @@ const CreateModelParams: React.FC<CreateModelParamsProps> = (props) => {
icon: <i className="iconfont icon-shangchuanwenjian text_primary text-[32px]"></i>,
name: 'model_conf_file_arr',
max: 1,
accept: 'application/zip, application/gzip, application/x-tar',
}}
afterUploadFile={({ resp }) => {
setCurrFormData((data) => {
@ -372,7 +374,6 @@ const CreateModelParams: React.FC<CreateModelParamsProps> = (props) => {
return { ...data, model_conf_file: '' };
});
}}
openPreviewFile={true}
/>
</StepsForm.StepForm>
</StepsForm>

@ -310,7 +310,6 @@ const CreateForm: React.FC<CreateFormProps> = (props) => {
name: 'config_file_arr',
max: 1,
// initialValue: [],
// accept: 'application/zip, application/gzip, application/x-tar',
}}
afterUploadFile={({ resp }) => {
setCurrFormData((data) => {

@ -2,13 +2,15 @@
* @Author: donghao donghao@supervision.ltd
* @Date: 2024-04-23 17:46:47
* @LastEditors: donghao donghao@supervision.ltd
* @LastEditTime: 2024-06-25 13:42:26
* @LastEditTime: 2024-07-18 17:12:59
* @FilePath: \general-ai-platform-web\src\pages\Project\BusinessInfo\components\accountPsw.tsx
* @Description:
*/
import { apiEntityPwdcheck } from '@/services/business/entity';
import { isSuccessApi } from '@/utils/forApi';
import { ProForm, ProFormText } from '@ant-design/pro-components';
import { FormattedMessage, useIntl } from '@umijs/max';
import React, { useEffect } from 'react';
import React, { useEffect, useState } from 'react';
type AccountPswProps = {
info: Record<string, any>;
@ -16,7 +18,20 @@ type AccountPswProps = {
const AccountPsw: React.FC<AccountPswProps> = (props) => {
const [form] = ProForm.useForm(); // form 对象
const intl = useIntl();
const [passwordVisible, setPasswordVisible] = useState<boolean>(false);
// 登录密码信息
async function loadPwdInfo() {
const { id } = props.commInfo;
const resp = await apiEntityPwdcheck({ id });
if (isSuccessApi(resp)) {
form.setFieldValue('pwd', resp?.data?.pwd);
}
}
const handleVisibilityToggle = (visible: boolean) => {
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
!passwordVisible && loadPwdInfo();
setPasswordVisible(visible);
};
useEffect(() => {
if (props.info) {
form.setFieldsValue(props.info);
@ -60,7 +75,11 @@ const AccountPsw: React.FC<AccountPswProps> = (props) => {
width="34.45vw"
label={<FormattedMessage id="business_info.list.table.form.pwd" defaultMessage="密码" />}
name="pwd"
initialValue={'******'}
placeholder={'输入新密码'}
fieldProps={{
visibilityToggle: { visible: passwordVisible, onVisibleChange: handleVisibilityToggle },
}}
/>
</ProForm.Group>
</ProForm>

@ -2,16 +2,30 @@
* @Author: donghao donghao@supervision.ltd
* @Date: 2024-04-08 16:57:30
* @LastEditors: donghao donghao@supervision.ltd
* @LastEditTime: 2024-05-09 09:54:36
* @LastEditTime: 2024-07-18 15:15:26
* @FilePath: \general-ai-manage\src\pages\Project\BusinessProject\components\businessCard.tsx
* @Description:
*/
import { ProCard } from '@ant-design/pro-components';
import { Image, theme } from 'antd';
import icon1 from '/public/images/bussnessInfo/icon1.png';
import svg1 from '/public/images/bussnessInfo/model_1.png';
import icon2 from '/public/images/bussnessInfo/icon2.png';
import industryClassification0 from '/public/images/industryClassification/0.png';
import industryClassification1 from '/public/images/industryClassification/1.png';
import industryClassification10 from '/public/images/industryClassification/10.png';
import industryClassification11 from '/public/images/industryClassification/11.png';
import industryClassification12 from '/public/images/industryClassification/12.png';
import industryClassification13 from '/public/images/industryClassification/13.png';
import industryClassification14 from '/public/images/industryClassification/14.png';
import industryClassification15 from '/public/images/industryClassification/15.png';
import industryClassification2 from '/public/images/industryClassification/2.png';
import industryClassification3 from '/public/images/industryClassification/3.png';
import industryClassification4 from '/public/images/industryClassification/4.png';
import industryClassification5 from '/public/images/industryClassification/5.png';
import industryClassification6 from '/public/images/industryClassification/6.png';
import industryClassification7 from '/public/images/industryClassification/7.png';
import industryClassification8 from '/public/images/industryClassification/8.png';
import industryClassification9 from '/public/images/industryClassification/9.png';
type AlgorithmCardProps = {
info: Record<string, any>;
@ -20,6 +34,64 @@ type AlgorithmCardProps = {
const AlgorithmCard: React.FC<AlgorithmCardProps> = ({ info }) => {
const { token } = theme.useToken();
console.log(theme, 'AlgorithmCard_token', theme.useToken());
function renderIcon() {
let currUrl = industryClassification0;
switch (info?.classification_name) {
case 'IT服务':
currUrl = industryClassification1;
break;
case '管材':
currUrl = industryClassification2;
break;
case '建筑房地产':
currUrl = industryClassification3;
break;
case '教育':
currUrl = industryClassification4;
break;
case '金融行业':
currUrl = industryClassification5;
break;
case '零售':
currUrl = industryClassification6;
break;
case '能源矿采':
currUrl = industryClassification7;
break;
case '农林牧渔':
currUrl = industryClassification8;
break;
case '生活服务':
currUrl = industryClassification9;
break;
case '手机电子行业':
currUrl = industryClassification10;
break;
case '文化娱乐':
currUrl = industryClassification11;
break;
case '医疗':
currUrl = industryClassification12;
break;
case '运输物流':
currUrl = industryClassification13;
break;
case '政府':
currUrl = industryClassification14;
break;
case '制造业':
currUrl = industryClassification15;
break;
case '其他行业':
default:
currUrl = industryClassification0;
break;
}
return <Image width={64} preview={false} src={currUrl} />;
}
return (
<ProCard
className="algorithmCard_box"
@ -48,28 +120,28 @@ const AlgorithmCard: React.FC<AlgorithmCardProps> = ({ info }) => {
className="tag_type"
style={{
background:
info.typeName === '机器学习'
info.model_type === '机器学习'
? 'linear-gradient( 180deg, #FFB21A 0%, #FF9B3E 100%)'
: 'linear-gradient(180deg, #21c7ff 0%, #428cff 100%)',
}}
>
{info.typeName}
{info.model_type}
</span>
</div>
<ul className="p1">
<li className="flex items-center mb-[8px]">
<Image width={16} className="flex items-center" preview={false} src={icon1} />
<span className="pl-[8px]"> </span>
<span className="text_color_1">{info.version}</span>
<span className="text_color_1">{info.default_version}</span>
</li>
<li className="flex items-center">
<Image width={16} className="flex items-center" preview={false} src={icon2} />
<span className="pl-[8px]"> </span>
<span className="text_color_1">{info.industryName}</span>
<span className="text_color_1">{info.classification_name}</span>
</li>
</ul>
</div>
<Image width={64} preview={false} src={svg1} />
{renderIcon()}
</div>
</ProCard>
);

@ -9,8 +9,7 @@
import { useBusinessInfo } from '@/hooks/useBusinessInfo';
import { useMoment } from '@/hooks/useMoment';
import { apiEntityInfo, apiEntityPwdcheck } from '@/services/business/entity';
import { getBusinessAlgorithmList } from '@/services/testApi/businessProject';
import { apiEntityInfo, apiEntityModels } from '@/services/business/entity';
import { isSuccessApi } from '@/utils/forApi';
import { ProCard, ProList } from '@ant-design/pro-components';
@ -32,9 +31,12 @@ const { formatTimeByDateType } = useMoment();
const BusinessInfo: React.FC = () => {
//state
const [detailInfo, setDetailInfo] = useState<Record<string, any>>({});
const [pwdInfo, setPwdInfo] = useState<Record<string, any>>({});
// const [pwdInfo, setPwdInfo] = useState<Record<string, any>>({});
const { getStoreBusinessInfo } = useBusinessInfo();
const [commInfo] = useState<Record<string, any>>({ ...getStoreBusinessInfo() }); // 通用信息
const [updateModalOpen, setUpdateModalOpen] = useState<boolean>(false);
// 动态设置每页数量
const [currentPageSize, setCurrentPageSize] = useState<number>(10);
@ -70,25 +72,20 @@ const BusinessInfo: React.FC = () => {
}
}
// 登录密码信息
async function loadPwdInfo() {
const { id } = getStoreBusinessInfo();
const resp = await apiEntityPwdcheck({ id });
if (isSuccessApi(resp)) {
setPwdInfo(resp?.data);
}
}
// 算法列表
// eslint-disable-next-line @typescript-eslint/no-unused-vars
async function initList(tabId: string) {
const { id } = getStoreBusinessInfo();
const reqParams = {
pageNo: currentPage,
pageSize: currentPageSize,
// desc: false,
warning_type: tabId,
// warning_type: tabId,
id,
// ...rest,
};
const resp = await getBusinessAlgorithmList({ ...reqParams });
const resp = await apiEntityModels({ ...reqParams });
if (isSuccessApi(resp)) {
// console.log(resp,'resp');
// setCurrentPageSize(resp?.data?.count)
@ -103,7 +100,7 @@ const BusinessInfo: React.FC = () => {
useEffect(() => {
loadDetailData();
loadPwdInfo();
// loadPwdInfo();
}, []);
return (
<div className="businessInfo_page pb-[1px]">
@ -139,7 +136,7 @@ const BusinessInfo: React.FC = () => {
<div className="gn_head_card mb-[20px]">
<ProCard className="gn_card_wrap" title={<span className="head3"></span>}>
<AccountPsw info={{ ...pwdInfo, phone: detailInfo?.phone }}></AccountPsw>
<AccountPsw commInfo={commInfo} info={{ phone: detailInfo?.phone }}></AccountPsw>
</ProCard>
</div>

@ -87,6 +87,8 @@ const LoginMessage: React.FC<{
};
const Login: React.FC = () => {
const [form] = Form.useForm<Record<string, any>>();
const [userLoginState, setUserLoginState] = useState<API.LoginResult>({});
const [type] = useState<string>('account');
const { initialState, setInitialState } = useModel('@@initialState');
@ -94,7 +96,10 @@ const Login: React.FC = () => {
// const [captcha, setCaptcha] = useState<string>('');
// const [captchaId, setCaptchaId] = useState<string>('');
const [loginLoading, setLoginLoading] = useState<boolean>(false);
const [remember, setRemember] = useState<boolean>(false);
const handleRememberChange = (e) => {
setRemember(e.target.checked);
};
const containerClassName = useEmotionCss(() => {
return {
display: 'flex',
@ -152,6 +157,13 @@ const Login: React.FC = () => {
const resp = await apiLogin({ ...values });
// const resp = await login({ ...values, type });
if (isSuccessApi(resp)) {
if (remember) {
// 在这里实现记住账号的逻辑,比如存储到 localStorage
localStorage.setItem('rememberedAccount', JSON.stringify(form.getFieldsValue()));
} else {
// 取消记住账号时的逻辑
localStorage.removeItem('rememberedAccount');
}
// const defaultLoginSuccessMessage = intl.formatMessage({
// id: 'pages.login.success',
// defaultMessage: '登录成功!',
@ -187,12 +199,12 @@ const Login: React.FC = () => {
}
};
// TEST 测试使用admin
const [form] = Form.useForm<Record<string, any>>();
useEffect(() => {
// localStorage.removeItem('access')
form.setFieldsValue({ username: 'admin', pwd: 'Sju2984?' });
if (localStorage.getItem('rememberedAccount')) {
form.setFieldsValue(JSON.parse(localStorage.getItem('rememberedAccount')));
}
// form.setFieldsValue({ username: 'admin', pwd: 'Sju2984?' });
// console.log(form.getFieldsValue(), 'login_form');
}, []);
@ -352,7 +364,15 @@ const Login: React.FC = () => {
marginBlockEnd: 24,
}}
>
<ProFormCheckbox noStyle></ProFormCheckbox>
<ProFormCheckbox
noStyle
name="remember"
fieldProps={{
onChange: handleRememberChange,
}}
>
</ProFormCheckbox>
<a
style={{
float: 'right',

@ -2,7 +2,7 @@
* @Author: donghao donghao@supervision.ltd
* @Date: 2024-05-23 13:50:50
* @LastEditors: donghao donghao@supervision.ltd
* @LastEditTime: 2024-06-12 10:04:45
* @LastEditTime: 2024-07-18 11:28:53
* @FilePath: \general-ai-platform-web\src\services\Business\entity.ts
* @Description: api
*/
@ -75,6 +75,22 @@ export async function apiEntityInfo(body: any, options?: { [key: string]: any })
);
}
// 企业算法
export async function apiEntityModels(body: any, options?: { [key: string]: any }) {
return request<API.Response & { data?: API.ENTITY_INDEX_DATA; msg?: string }>(
`/api/v1/enterprise/entity/models`,
{
method: 'POST',
headers: {
// 'Content-Type': 'application/json',
// "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8"
},
data: body,
...(options || {}),
},
);
}
// 编辑企业信息
export async function apiEntityEdit(body: any, options?: { [key: string]: any }) {
return request<API.Response & { data?: API.ENTITY_INDEX_DATA; msg?: string }>(

@ -2,7 +2,7 @@
* @Author: donghao donghao@supervision.ltd
* @Date: 2024-05-24 17:57:19
* @LastEditors: donghao donghao@supervision.ltd
* @LastEditTime: 2024-06-25 13:58:15
* @LastEditTime: 2024-07-18 11:13:02
* @FilePath: \general-ai-platform-web\src\services\business\model.ts
* @Description: api
*/
@ -77,7 +77,7 @@ export async function apiModelDeploymentList(body: any, options?: { [key: string
// 删除企业部署的业务模型
export async function apiModelDeploymentDelete(body: any, options?: { [key: string]: any }) {
return request<API.Response & { data?: API.ENTITY_INDEX_DATA; msg?: string }>(
`/api/v1/enterprise/model/deployment/delete`,
`/api/v1/enterprise/model/delete`,
{
method: 'POST',
headers: {

Loading…
Cancel
Save