|
|
@@ -678,10 +678,69 @@ export function ChatActions(props: {
|
|
|
setGuessList([]);
|
|
|
}
|
|
|
}, [props.isClickStop])
|
|
|
+
|
|
|
+ const [activeKey, setActiveKey]= useState('0'); // 控制手风琴是否展示
|
|
|
|
|
|
return (
|
|
|
<div className={styles["chat-input-actions"]}>
|
|
|
{
|
|
|
+ props.sendStatus &&
|
|
|
+ <Collapse
|
|
|
+ accordion={true}
|
|
|
+ activeKey={activeKey}
|
|
|
+ onChange={(key)=>{setActiveKey(key[0])}}
|
|
|
+ bordered={false}
|
|
|
+ style={{ width: '100%',backgroundColor:'#fff' }}
|
|
|
+ expandIconPosition="end"
|
|
|
+ items={[
|
|
|
+ {
|
|
|
+ key: '1',
|
|
|
+ label:<span style={{ color: '#8096ca' }}>你还可以尝试提问:</span>,
|
|
|
+ children: <div style={{ color: '#8096ca', fontSize: 13, overflowX: 'auto' }}>
|
|
|
+ {/* <div>
|
|
|
+ 你还可以尝试提问:
|
|
|
+ </div> */}
|
|
|
+
|
|
|
+ {
|
|
|
+ guessList.length === 0 ?
|
|
|
+ <Space style={{ margin: '10px 0' }}>
|
|
|
+ <Skeleton.Button size="small" active={true} />
|
|
|
+ <Skeleton.Button size="small" active={true} />
|
|
|
+ <Skeleton.Button size="small" active={true} />
|
|
|
+ </Space>
|
|
|
+ :
|
|
|
+ <div style={{ display: 'flex', margin: '10px 0', overflowX: 'auto' }}>
|
|
|
+ {
|
|
|
+ guessList.map((item, index) => {
|
|
|
+ return (
|
|
|
+ <div
|
|
|
+ style={{
|
|
|
+ padding: '5px 10px',
|
|
|
+ background: '#f2f4f8',
|
|
|
+ borderRadius: 5,
|
|
|
+ margin: '0 10px 10px 0',
|
|
|
+ cursor: 'pointer',
|
|
|
+ }}
|
|
|
+ onClick={() => {
|
|
|
+ props.setUserInput(item);
|
|
|
+ props.doSubmit(item)
|
|
|
+ setActiveKey('')
|
|
|
+ }}
|
|
|
+ key={index}
|
|
|
+ >
|
|
|
+ {item}
|
|
|
+ </div>
|
|
|
+ )
|
|
|
+ })
|
|
|
+ }
|
|
|
+ </div>
|
|
|
+ }
|
|
|
+ </div>
|
|
|
+ }
|
|
|
+ ]}
|
|
|
+ />
|
|
|
+ }
|
|
|
+ {/* {
|
|
|
props.sendStatus &&
|
|
|
<div style={{ color: '#8096ca', fontSize: 13, overflowX: 'auto' }}>
|
|
|
<div>
|
|
|
@@ -721,7 +780,7 @@ export function ChatActions(props: {
|
|
|
</div>
|
|
|
}
|
|
|
</div>
|
|
|
- }
|
|
|
+ } */}
|
|
|
{/* {couldStop && (
|
|
|
<ChatAction
|
|
|
onClick={stopAll}
|
|
|
@@ -2042,9 +2101,10 @@ function _Chat() {
|
|
|
items={[
|
|
|
{
|
|
|
key: '1',
|
|
|
- label: `查询到“${message.sliceInfo.doc.length}条”相关切片`,
|
|
|
+ // label: `查询到“${message.sliceInfo?.doc?.length}条”相关切片`,
|
|
|
+ label: `查询到${message.sliceInfo?.doc?.length}个文档共${message.sliceInfo?.allChunkNum}条切片`,
|
|
|
children: <div>
|
|
|
- {message.sliceInfo.doc.map((item, index) => {
|
|
|
+ {message.sliceInfo?.doc?.map((item, index) => {
|
|
|
return <div
|
|
|
style={{
|
|
|
padding: 10,
|
|
|
@@ -2059,7 +2119,7 @@ function _Chat() {
|
|
|
key={item.doc_id}
|
|
|
onClick={() => {
|
|
|
setDrawerData({
|
|
|
- knowledge_id: message.sliceInfo!.knowledge_id,
|
|
|
+ knowledge_id: item!.knowledge_id,
|
|
|
doc_name: item.doc_name,
|
|
|
chunk_info: {
|
|
|
doc_id: item.doc_id,
|