88import React , { useEffect , useState , useRef , useImperativeHandle } from 'react' ;
99import { Form , Input , Drawer , Switch , Table , Popover , Select , Button } from 'antd' ;
1010import { QuestionCircleOutlined } from '@ant-design/icons' ;
11- import { useParams } from 'react-router-dom' ;
11+ import { TENANT_ID } from "@/pages/chatPreview/components/send-editor/common/config" ;
1212import { uuid } from '@/common/util' ;
1313import { useTranslation } from 'react-i18next' ;
1414import { addInspiration , editInspiration } from '@/shared/http/aipp' ;
@@ -19,7 +19,7 @@ import { useAppSelector } from '@/store/hook';
1919const AddIns = ( props ) => {
2020 const { t } = useTranslation ( ) ;
2121 const { addRef, refreshData } = props ;
22- const { tenantId , appId } = useParams ( ) ;
22+ const appId = useAppSelector ( ( state ) => state . appStore . appId ) ;
2323 const [ showModal , setShowModal ] = useState ( false ) ;
2424 const [ cachePromptVar , setCachePromptVar ] = useState ( null ) ;
2525 const [ promptVar , setPromptVar ] = useState ( [ ] ) ;
@@ -67,16 +67,6 @@ const AddIns = (props) => {
6767 </ >
6868 )
6969 } ,
70- {
71- title : t ( 'multiple' ) ,
72- dataIndex : 'multiple' ,
73- key : 'multiple' ,
74- render : ( checked , record ) => (
75- < >
76- < Switch checked = { checked } onChange = { ( checked ) => handleTableChange ( checked , record , 'multiple' ) } />
77- </ >
78- )
79- } ,
8070 {
8171 title : t ( 'operate' ) ,
8272 key : 'action' ,
@@ -101,7 +91,7 @@ const AddIns = (props) => {
10191 const addCallback = async ( params ) => {
10292 params . id = uuid ( ) ;
10393 let parentId = 'root' ;
104- const res : any = await addInspiration ( tenantId , appId , parentId , params ) ;
94+ const res : any = await addInspiration ( TENANT_ID , appId , parentId , params ) ;
10595 if ( res . code === 0 ) {
10696 setShowModal ( false ) ;
10797 Message ( { type : 'success' , content : t ( 'addedSuccessfully' ) } ) ;
@@ -115,7 +105,7 @@ const AddIns = (props) => {
115105 let parentId = '' ;
116106 let categoryArr = category . current . split ( ':' ) ;
117107 parentId = categoryArr [ categoryArr . length - 1 ] || '' ;
118- const res : any = await editInspiration ( tenantId , appId , parentId , editId . current , params ) ;
108+ const res : any = await editInspiration ( TENANT_ID , appId , parentId , editId . current , params ) ;
119109 if ( res . code === 0 ) {
120110 setShowModal ( false ) ;
121111 Message ( { type : 'success' , content : t ( 'operationSucceeded' ) } ) ;
0 commit comments