diff --git a/.env b/.env index 6f53fc7..5a1b6e2 100644 --- a/.env +++ b/.env @@ -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 diff --git a/.env.development b/.env.development index 6f53fc7..5a1b6e2 100644 --- a/.env.development +++ b/.env.development @@ -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 diff --git a/.env.production b/.env.production index a083394..f258860 100644 --- a/.env.production +++ b/.env.production @@ -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 diff --git a/config/defaultTable.ts b/config/defaultTable.ts index f564b73..259b8f4 100644 --- a/config/defaultTable.ts +++ b/config/defaultTable.ts @@ -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'], // 每页条数选项 }; // 默认索引列配置 diff --git a/config/proxy.ts b/config/proxy.ts index f36da90..401df37 100644 --- a/config/proxy.ts +++ b/config/proxy.ts @@ -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 diff --git a/dist.zip b/dist.zip new file mode 100644 index 0000000..c4410eb Binary files /dev/null and b/dist.zip differ diff --git a/public/images/industryClassification/0.png b/public/images/industryClassification/0.png new file mode 100644 index 0000000..147db8f Binary files /dev/null and b/public/images/industryClassification/0.png differ diff --git a/public/images/industryClassification/1.png b/public/images/industryClassification/1.png new file mode 100644 index 0000000..dab2d35 Binary files /dev/null and b/public/images/industryClassification/1.png differ diff --git a/public/images/industryClassification/10.png b/public/images/industryClassification/10.png new file mode 100644 index 0000000..252efc9 Binary files /dev/null and b/public/images/industryClassification/10.png differ diff --git a/public/images/industryClassification/11.png b/public/images/industryClassification/11.png new file mode 100644 index 0000000..acb0eb4 Binary files /dev/null and b/public/images/industryClassification/11.png differ diff --git a/public/images/industryClassification/12.png b/public/images/industryClassification/12.png new file mode 100644 index 0000000..08439af Binary files /dev/null and b/public/images/industryClassification/12.png differ diff --git a/public/images/industryClassification/13.png b/public/images/industryClassification/13.png new file mode 100644 index 0000000..2ac7670 Binary files /dev/null and b/public/images/industryClassification/13.png differ diff --git a/public/images/industryClassification/14.png b/public/images/industryClassification/14.png new file mode 100644 index 0000000..af7e331 Binary files /dev/null and b/public/images/industryClassification/14.png differ diff --git a/public/images/industryClassification/15.png b/public/images/industryClassification/15.png new file mode 100644 index 0000000..a406146 Binary files /dev/null and b/public/images/industryClassification/15.png differ diff --git a/public/images/industryClassification/2.png b/public/images/industryClassification/2.png new file mode 100644 index 0000000..7e82e80 Binary files /dev/null and b/public/images/industryClassification/2.png differ diff --git a/public/images/industryClassification/3.png b/public/images/industryClassification/3.png new file mode 100644 index 0000000..681bb55 Binary files /dev/null and b/public/images/industryClassification/3.png differ diff --git a/public/images/industryClassification/4.png b/public/images/industryClassification/4.png new file mode 100644 index 0000000..70574ca Binary files /dev/null and b/public/images/industryClassification/4.png differ diff --git a/public/images/industryClassification/5.png b/public/images/industryClassification/5.png new file mode 100644 index 0000000..ba2716d Binary files /dev/null and b/public/images/industryClassification/5.png differ diff --git a/public/images/industryClassification/6.png b/public/images/industryClassification/6.png new file mode 100644 index 0000000..b9d96a8 Binary files /dev/null and b/public/images/industryClassification/6.png differ diff --git a/public/images/industryClassification/7.png b/public/images/industryClassification/7.png new file mode 100644 index 0000000..ec73f6e Binary files /dev/null and b/public/images/industryClassification/7.png differ diff --git a/public/images/industryClassification/8.png b/public/images/industryClassification/8.png new file mode 100644 index 0000000..83ad048 Binary files /dev/null and b/public/images/industryClassification/8.png differ diff --git a/public/images/industryClassification/9.png b/public/images/industryClassification/9.png new file mode 100644 index 0000000..4562a38 Binary files /dev/null and b/public/images/industryClassification/9.png differ diff --git a/src/app.css b/src/app.css index 115e579..07282d6 100644 --- a/src/app.css +++ b/src/app.css @@ -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; diff --git a/src/app.less b/src/app.less index 83f829d..10eaed0 100644 --- a/src/app.less +++ b/src/app.less @@ -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; } } } diff --git a/src/app.tsx b/src/app.tsx index 4d75192..40595ad 100644 --- a/src/app.tsx +++ b/src/app.tsx @@ -196,17 +196,18 @@ export const layout: RunTimeLayoutConfig = ({ initialState, setInitialState }) =
- - {currMenu?.name && - intl.formatMessage({ id: `menu.${currMenu?.name}`, defaultMessage: '首页' })} - -
- -
- -
-
- {/* {initialState?.currentUser?.userName ? ( +
+ + {currMenu?.name && + intl.formatMessage({ id: `menu.${currMenu?.name}`, defaultMessage: '首页' })} + +
+ +
+ +
+
+ {/* {initialState?.currentUser?.userName ? (
@@ -215,6 +216,7 @@ export const layout: RunTimeLayoutConfig = ({ initialState, setInitialState }) = ) : ( <> )} */} +
diff --git a/src/components/MenuBar/index.less b/src/components/MenuBar/index.less index 0f017f2..20a5acc 100644 --- a/src/components/MenuBar/index.less +++ b/src/components/MenuBar/index.less @@ -52,7 +52,7 @@ } .menu_top { width: 100%; - height: 72px; + height: 64px; color: @primary_color; font-weight: bold; border-radius: 0px 0px 64px 0px; diff --git a/src/components/UploadFile/src/draggerUpload.tsx b/src/components/UploadFile/src/draggerUpload.tsx index 297ad50..dafee65 100644 --- a/src/components/UploadFile/src/draggerUpload.tsx +++ b/src/components/UploadFile/src/draggerUpload.tsx @@ -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) => { )}
- {props?.openPreviewFile && } ); diff --git a/src/pages/Business/BusinessModel/components/createForm.tsx b/src/pages/Business/BusinessModel/components/createForm.tsx index 9e51f47..29c7471 100644 --- a/src/pages/Business/BusinessModel/components/createForm.tsx +++ b/src/pages/Business/BusinessModel/components/createForm.tsx @@ -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 = (props) => { ), }} > - @@ -309,6 +309,8 @@ const CreateForm: React.FC = (props) => { icon: , 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 = (props) => { return { ...data, business_logic: '' }; }); }} - openPreviewFile={true} /> {/* 参数配置 */} @@ -343,7 +344,7 @@ const CreateForm: React.FC = (props) => { return true; }} > - diff --git a/src/pages/Business/BusinessModel/components/updateForm.tsx b/src/pages/Business/BusinessModel/components/updateForm.tsx index d4f4321..de88e32 100644 --- a/src/pages/Business/BusinessModel/components/updateForm.tsx +++ b/src/pages/Business/BusinessModel/components/updateForm.tsx @@ -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 = (props) => { ), }} > - @@ -342,6 +342,7 @@ const UpdateForm: React.FC = (props) => { }, ] : [], + accept: 'application/zip, application/gzip, application/x-tar', }} afterUploadFile={({ resp }) => { setCurrFormData((data) => { @@ -353,7 +354,6 @@ const UpdateForm: React.FC = (props) => { return { ...data, business_logic: '' }; }); }} - openPreviewFile={true} /> {/* 参数配置 */} @@ -376,7 +376,7 @@ const UpdateForm: React.FC = (props) => { return true; }} > - diff --git a/src/pages/Business/BusinessModel/index.tsx b/src/pages/Business/BusinessModel/index.tsx index 238ff85..2658a6c 100644 --- a/src/pages/Business/BusinessModel/index.tsx +++ b/src/pages/Business/BusinessModel/index.tsx @@ -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: ( { - 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( diff --git a/src/pages/Business/DeviceGroup/components/alarmSetForm.tsx b/src/pages/Business/DeviceGroup/components/alarmSetForm.tsx index 2b0cdec..401ca3b 100644 --- a/src/pages/Business/DeviceGroup/components/alarmSetForm.tsx +++ b/src/pages/Business/DeviceGroup/components/alarmSetForm.tsx @@ -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 = (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 = (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 = (props) => { {({ isChecked }) => { console.log(isChecked, 'isChecked'); return ( - { + // // const resp = await postCurrentIP(); + // const resp = ['用户A', '用户B', '用户C']; + // return resp?.map((v: any) => { + // return { + // label: v, + // value: v, + // }; + // }); + // }} + // /> + { - // 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: '$$$', + })}`} /> ); }} diff --git a/src/pages/Business/DeviceGroup/components/createModelParams.tsx b/src/pages/Business/DeviceGroup/components/createModelParams.tsx index 008e19f..060d2d7 100644 --- a/src/pages/Business/DeviceGroup/components/createModelParams.tsx +++ b/src/pages/Business/DeviceGroup/components/createModelParams.tsx @@ -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 = (props) => { return true; }} > - @@ -168,6 +168,8 @@ const CreateModelParams: React.FC = (props) => { icon: , 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 = (props) => { return { ...data, busi_conf_file: '' }; }); }} - openPreviewFile={true} /> {/* 运行库选择 runtimeLib */} @@ -343,7 +344,7 @@ const CreateModelParams: React.FC = (props) => { return true; }} > - @@ -361,6 +362,7 @@ const CreateModelParams: React.FC = (props) => { icon: , 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 = (props) => { return { ...data, model_conf_file: '' }; }); }} - openPreviewFile={true} /> diff --git a/src/pages/Model/ModelDetail/components/createForm.tsx b/src/pages/Model/ModelDetail/components/createForm.tsx index 5987c61..7a2aaf9 100644 --- a/src/pages/Model/ModelDetail/components/createForm.tsx +++ b/src/pages/Model/ModelDetail/components/createForm.tsx @@ -310,7 +310,6 @@ const CreateForm: React.FC = (props) => { name: 'config_file_arr', max: 1, // initialValue: [], - // accept: 'application/zip, application/gzip, application/x-tar', }} afterUploadFile={({ resp }) => { setCurrFormData((data) => { diff --git a/src/pages/Project/BusinessInfo/components/accountPsw.tsx b/src/pages/Project/BusinessInfo/components/accountPsw.tsx index 870dbd0..632062a 100644 --- a/src/pages/Project/BusinessInfo/components/accountPsw.tsx +++ b/src/pages/Project/BusinessInfo/components/accountPsw.tsx @@ -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; @@ -16,7 +18,20 @@ type AccountPswProps = { const AccountPsw: React.FC = (props) => { const [form] = ProForm.useForm(); // form 对象 const intl = useIntl(); - + const [passwordVisible, setPasswordVisible] = useState(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 = (props) => { width="34.45vw" label={} name="pwd" + initialValue={'******'} placeholder={'输入新密码'} + fieldProps={{ + visibilityToggle: { visible: passwordVisible, onVisibleChange: handleVisibilityToggle }, + }} /> diff --git a/src/pages/Project/BusinessInfo/components/algorithmCard.tsx b/src/pages/Project/BusinessInfo/components/algorithmCard.tsx index e0d52e8..5483113 100644 --- a/src/pages/Project/BusinessInfo/components/algorithmCard.tsx +++ b/src/pages/Project/BusinessInfo/components/algorithmCard.tsx @@ -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; @@ -20,6 +34,64 @@ type AlgorithmCardProps = { const AlgorithmCard: React.FC = ({ 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 ; + } + return ( = ({ 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}
- + {renderIcon()}
); diff --git a/src/pages/Project/BusinessInfo/index.tsx b/src/pages/Project/BusinessInfo/index.tsx index ccdd641..7ce7cd6 100644 --- a/src/pages/Project/BusinessInfo/index.tsx +++ b/src/pages/Project/BusinessInfo/index.tsx @@ -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>({}); - const [pwdInfo, setPwdInfo] = useState>({}); + // const [pwdInfo, setPwdInfo] = useState>({}); const { getStoreBusinessInfo } = useBusinessInfo(); + + const [commInfo] = useState>({ ...getStoreBusinessInfo() }); // 通用信息 + const [updateModalOpen, setUpdateModalOpen] = useState(false); // 动态设置每页数量 const [currentPageSize, setCurrentPageSize] = useState(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 (
@@ -139,7 +136,7 @@ const BusinessInfo: React.FC = () => {
账号信息}> - +
diff --git a/src/pages/User/Login/index.tsx b/src/pages/User/Login/index.tsx index c826cc2..d767b55 100644 --- a/src/pages/User/Login/index.tsx +++ b/src/pages/User/Login/index.tsx @@ -87,6 +87,8 @@ const LoginMessage: React.FC<{ }; const Login: React.FC = () => { + const [form] = Form.useForm>(); + const [userLoginState, setUserLoginState] = useState({}); const [type] = useState('account'); const { initialState, setInitialState } = useModel('@@initialState'); @@ -94,7 +96,10 @@ const Login: React.FC = () => { // const [captcha, setCaptcha] = useState(''); // const [captchaId, setCaptchaId] = useState(''); const [loginLoading, setLoginLoading] = useState(false); - + const [remember, setRemember] = useState(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>(); - 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, }} > - 记住用户名 + + 记住用户名 + ( + `/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( diff --git a/src/services/business/model.ts b/src/services/business/model.ts index 07396bc..19434d7 100644 --- a/src/services/business/model.ts +++ b/src/services/business/model.ts @@ -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/v1/enterprise/model/deployment/delete`, + `/api/v1/enterprise/model/delete`, { method: 'POST', headers: {