11import React , { ChangeEvent , useEffect , useState } from 'react' ;
22import styles from './index.less' ;
33import AIImg from '@/assets/img/ai.svg' ;
4- import { Button , Checkbox , Dropdown , Input , Modal , Popover , Select , Spin , Tooltip , Radio } from 'antd' ;
4+ import { Button , Checkbox , Dropdown , Input , Modal , Popover , Select , Spin , Tooltip , Radio , Space } from 'antd' ;
55import i18n from '@/i18n/' ;
66import Iconfont from '@/components/Iconfont' ;
77import { WarningOutlined } from '@ant-design/icons' ;
@@ -43,34 +43,41 @@ const ChatInput = (props: IProps) => {
4343 const options = ( tables || [ ] ) . map ( ( t ) => ( { value : t , label : t } ) ) ;
4444 return (
4545 < div className = { styles . aiSelectedTable } >
46- < Radio . Group onChange = { ( v ) => onSelectTableSyncModel ( v . target . value ) } value = { syncTableModel } >
47- < Radio value = { 0 } > { i18n ( 'chat.input.syncTable.tips' ) } </ Radio >
48- < Radio value = { 1 } style = { { marginTop : '8px' , display : 'flex' } } >
49- < >
50- < span className = { styles . aiSelectedTableTips } >
51- { /* <WarningOutlined style={{color: 'yellow'}}/> */ }
52- { i18n ( 'chat.input.remain.tooltip' ) }
53- </ span >
54- < Select
55- showSearch
56- mode = "multiple"
57- allowClear
58- options = { options }
59- placeholder = { i18n ( 'chat.input.tableSelect.placeholder' ) }
60- value = { selectedTables }
61- onChange = { ( v ) => {
62- onSelectTables && onSelectTables ( v ) ;
63- } }
64- />
65- </ >
66- </ Radio >
46+ < Radio . Group
47+ onChange = { ( v ) => onSelectTableSyncModel ( v . target . value ) }
48+ value = { syncTableModel }
49+ style = { { marginBottom : '8px' } }
50+ >
51+ < Space direction = "horizontal" >
52+ < Radio value = { 0 } > 自动</ Radio >
53+ < Radio value = { 1 } > 手动</ Radio >
54+ </ Space >
6755 </ Radio . Group >
56+ { syncTableModel === 0 ? (
57+ i18n ( 'chat.input.syncTable.tips' )
58+ ) : (
59+ < >
60+ < span className = { styles . aiSelectedTableTips } > { i18n ( 'chat.input.remain.tooltip' ) } </ span >
61+ < Select
62+ showSearch
63+ mode = "multiple"
64+ allowClear
65+ options = { options }
66+ placeholder = { i18n ( 'chat.input.tableSelect.placeholder' ) }
67+ value = { selectedTables }
68+ onChange = { ( v ) => {
69+ onSelectTables && onSelectTables ( v ) ;
70+ } }
71+ />
72+ </ >
73+ ) }
6874 </ div >
6975 ) ;
7076 } ;
7177
7278 const renderSuffix = ( ) => {
7379 // const remainCnt = props?.remainingUse?.remainingUses ?? '-';
80+ const hasBubble = localStorage . getItem ( 'syncTableBubble' ) ;
7481 return (
7582 < div className = { styles . suffixBlock } >
7683 < Button
@@ -85,8 +92,10 @@ const ChatInput = (props: IProps) => {
8592 < Iconfont code = "" className = { styles . enterIcon } />
8693 </ Button >
8794 < Tooltip
88- title = "🎉上线自动同步所有表功能"
89- open = { ! localStorage . getItem ( 'syncTableBubble' ) }
95+ title = { < span style = { { color : window . _AppThemePack . colorText } } > { i18n ( 'chat.input.syncTable.tempTips' ) } </ span > }
96+ defaultOpen = { ! hasBubble }
97+ color = { window . _AppThemePack . colorBgBase }
98+ trigger = { 'click' }
9099 onOpenChange = { ( ) => {
91100 localStorage . setItem ( 'syncTableBubble' , 'true' ) ;
92101 } }
0 commit comments