@@ -8,7 +8,7 @@ import styles from './index.module.scss'
88import DrawInfo from './DrawInfo'
99import AddModal from './AddModal'
1010import AddModelList from './AddModelList'
11- import Toast from '@/app/components/base/flash-notice'
11+ import Toast , { ToastTypeEnum } from '@/app/components/base/flash-notice'
1212import { getModelInfo , reDown } from '@/infrastructure/api/modelWarehouse'
1313import { deleteModel , getModelList } from '@/infrastructure/api/modelAdjust'
1414import { useApplicationContext } from '@/shared/hooks/app-context'
@@ -71,10 +71,10 @@ const ModelDetail = (req) => {
7171 const getInfo = ( ) => {
7272 getModelInfo ( { url : `mh/model_info/${ id } ` , options : { params : { qtype, namespace : isMine } } } ) . then ( ( res ) => {
7373 setBaseInfo ( res )
74- if ( res ?. models ?. length > 0 ) {
74+ if ( res ?. models ?. length > 0 )
7575 setType ( res ?. models [ 0 ] ?. id )
76- search . submit ( )
77- }
76+ // 初始化时加载微调模型列表
77+ search . submit ( )
7878 } )
7979 }
8080 useEffect ( ( ) => {
@@ -83,14 +83,14 @@ const ModelDetail = (req) => {
8383 const handleDelete = async ( record ) => {
8484 const res = await deleteModel ( { url : `/mh/delete_finetune_model/${ id } /${ record ?. id } ` } )
8585 if ( res ) {
86- Toast . notify ( { type : 'success' , message : '删除成功' } )
86+ Toast . notify ( { type : ToastTypeEnum . Success , message : '删除成功' } )
8787 search . submit ( )
8888 }
8989 }
9090 const reDownload = ( ) => {
9191 reDown ( { url : `/mh/retry_download/${ id } ` } ) . then ( ( res ) => {
9292 if ( res ) {
93- Toast . notify ( { type : 'success' , message : '操作成功' } )
93+ Toast . notify ( { type : ToastTypeEnum . Success , message : '操作成功' } )
9494 getInfo ( )
9595 }
9696 } )
0 commit comments