|
@@ -2,10 +2,8 @@ import { ScrollView, View,Image } from "@tarojs/components";
|
|
import MessageRobotRich from "@/components/chat-message/MessageRobotRich";
|
|
import MessageRobotRich from "@/components/chat-message/MessageRobotRich";
|
|
import MessageRich from "@/components/chat-message/MessageRich";
|
|
import MessageRich from "@/components/chat-message/MessageRich";
|
|
import { WelcomeCard, AddSuccessfulTips } from "../asistant-message";
|
|
import { WelcomeCard, AddSuccessfulTips } from "../asistant-message";
|
|
|
|
+import KnowledgeIcon from '@/components/KnowledgeIcon'
|
|
|
|
|
|
-// import IconFIleTxt from "@/components/icon/IconFIleTxt";
|
|
|
|
-// import IconFIlePDF from "@/components/icon/IconFIlePDF";
|
|
|
|
-// import IconFIleXLSX from "@/components/icon/IconFIleXLSX";
|
|
|
|
|
|
|
|
import FigureList from "@/components/list/figure-list";
|
|
import FigureList from "@/components/list/figure-list";
|
|
import FigureListItem from "@/components/list/figure-list-item";
|
|
import FigureListItem from "@/components/list/figure-list-item";
|
|
@@ -15,6 +13,7 @@ import Taro, { useDidShow } from "@tarojs/taro";
|
|
|
|
|
|
import { useUserStore } from "@/store/userStore";
|
|
import { useUserStore } from "@/store/userStore";
|
|
import { useKnowledgeStore } from "@/store/knowledge";
|
|
import { useKnowledgeStore } from "@/store/knowledge";
|
|
|
|
+import { TKnowledgeItem } from "@/types/knowledge";
|
|
|
|
|
|
const ViewStyleChat = () => {
|
|
const ViewStyleChat = () => {
|
|
const { list, scrollTop, loadMore } = useKnowledgeStore();
|
|
const { list, scrollTop, loadMore } = useKnowledgeStore();
|
|
@@ -29,6 +28,15 @@ const ViewStyleChat = () => {
|
|
loadMore();
|
|
loadMore();
|
|
};
|
|
};
|
|
|
|
|
|
|
|
+ const handleEdit = (item: TKnowledgeItem)=> {
|
|
|
|
+ if(item.parseStatus !== 'parsed'){
|
|
|
|
+ return ;
|
|
|
|
+ }
|
|
|
|
+ Taro.navigateTo({
|
|
|
|
+ url: `/pages/knowledge-item/index?knowledgeId=${item.knowledgeId}`
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+
|
|
useEffect(() => {
|
|
useEffect(() => {
|
|
loadMore()
|
|
loadMore()
|
|
}, []);
|
|
}, []);
|
|
@@ -50,9 +58,9 @@ const ViewStyleChat = () => {
|
|
</MessageRobotRich>
|
|
</MessageRobotRich>
|
|
|
|
|
|
{/* 添加小蓝本助手成功 */}
|
|
{/* 添加小蓝本助手成功 */}
|
|
- <MessageRobotRich data={avatarData}>
|
|
|
|
|
|
+ {/* <MessageRobotRich data={avatarData}>
|
|
<AddSuccessfulTips />
|
|
<AddSuccessfulTips />
|
|
- </MessageRobotRich>
|
|
|
|
|
|
+ </MessageRobotRich> */}
|
|
|
|
|
|
{list.map((group) => {
|
|
{list.map((group) => {
|
|
// 渲染自己发送的消息
|
|
// 渲染自己发送的消息
|
|
@@ -64,7 +72,7 @@ const ViewStyleChat = () => {
|
|
name: whoami?.nickName ?? ''
|
|
name: whoami?.nickName ?? ''
|
|
}}>
|
|
}}>
|
|
<View className="flex items-center gap-12">
|
|
<View className="flex items-center gap-12">
|
|
- <Image src={item.icon} mode="widthFix" style={{width: '36px', height: '36px'}}></Image>
|
|
|
|
|
|
+ <View className="w-36 h-36 overflow-hidden"><Image src={item.icon} mode="widthFix" style={{width: '36px', height: '36px'}}></Image></View>
|
|
<View className="flex flex-col flex-1 gap-2">
|
|
<View className="flex flex-col flex-1 gap-2">
|
|
<View className="text-14 leading-22">{item.title}</View>
|
|
<View className="text-14 leading-22">{item.title}</View>
|
|
<View className="text-12 leading-20 text-gray-45">
|
|
<View className="text-12 leading-20 text-gray-45">
|
|
@@ -81,19 +89,18 @@ const ViewStyleChat = () => {
|
|
<MessageRobotRich
|
|
<MessageRobotRich
|
|
data={{...avatarData, fileLen: group.knowledgeList.length}}
|
|
data={{...avatarData, fileLen: group.knowledgeList.length}}
|
|
analyzeStatus={group.isParsing ? "doing" : "done"}
|
|
analyzeStatus={group.isParsing ? "doing" : "done"}
|
|
|
|
+ content={group.content}
|
|
>
|
|
>
|
|
<FigureList>
|
|
<FigureList>
|
|
{group.knowledgeList.map((item, index) => {
|
|
{group.knowledgeList.map((item, index) => {
|
|
return (
|
|
return (
|
|
<FigureListItem
|
|
<FigureListItem
|
|
figure={()=> {
|
|
figure={()=> {
|
|
- return <Image src={item.icon} mode="widthFix" style={{width: '36px', height: '36px'}}></Image>
|
|
|
|
|
|
+ return <KnowledgeIcon data={item}/>
|
|
}}
|
|
}}
|
|
underline={index + 1 < group.knowledgeList.length}
|
|
underline={index + 1 < group.knowledgeList.length}
|
|
arrow={item.parseStatus === 'parsed'}
|
|
arrow={item.parseStatus === 'parsed'}
|
|
- onClick={()=> Taro.navigateTo({
|
|
|
|
- url: `/pages/knowledge-item/index?knowledgeId=${item.knowledgeId}`
|
|
|
|
- })}
|
|
|
|
|
|
+ onClick={()=> handleEdit(item)}
|
|
>
|
|
>
|
|
<View className="flex flex-col flex-1 gap-2 w-full">
|
|
<View className="flex flex-col flex-1 gap-2 w-full">
|
|
<View className="text-14 leading-22">{item.title}</View>
|
|
<View className="text-14 leading-22">{item.title}</View>
|
|
@@ -108,72 +115,6 @@ const ViewStyleChat = () => {
|
|
</MessageRobotRich>
|
|
</MessageRobotRich>
|
|
);
|
|
);
|
|
})}
|
|
})}
|
|
-
|
|
|
|
- {/* <MessageRich data={avatarData}>
|
|
|
|
- <View className="flex items-center gap-12">
|
|
|
|
- <IconFIleTxt />
|
|
|
|
- <View className="flex flex-col flex-1 gap-2">
|
|
|
|
- <View className="text-14 leading-22">文件名称</View>
|
|
|
|
- <View className="text-12 leading-20 text-gray-45">
|
|
|
|
- 03-24 12:20 | 822.KB
|
|
|
|
- </View>
|
|
|
|
- </View>
|
|
|
|
- </View>
|
|
|
|
- </MessageRich> */}
|
|
|
|
-
|
|
|
|
- {/* <MessageRobotRich data={avatarData} analyzeStatus="doing">
|
|
|
|
- <FigureList>
|
|
|
|
- <FigureListItem figure={IconFIleTxt} underline>
|
|
|
|
- <View className="flex flex-col flex-1 gap-2 w-full">
|
|
|
|
- <View className="text-14 leading-22">文件名称</View>
|
|
|
|
- <View className="text-12 leading-20 text-gray-45">
|
|
|
|
- 03-24 12:20 | 822.KB
|
|
|
|
- </View>
|
|
|
|
- </View>
|
|
|
|
- </FigureListItem>
|
|
|
|
- <FigureListItem figure={IconFIlePDF}>
|
|
|
|
- <View className="flex flex-col flex-1 gap-2 w-full">
|
|
|
|
- <View className="text-14 leading-22">飞秒小知识.pdf</View>
|
|
|
|
- <View className="text-12 leading-20 text-gray-45">
|
|
|
|
- 03-24 12:20 | 822.KB
|
|
|
|
- </View>
|
|
|
|
- </View>
|
|
|
|
- </FigureListItem>
|
|
|
|
- </FigureList>
|
|
|
|
- </MessageRobotRich>
|
|
|
|
-
|
|
|
|
- <MessageRobotRich data={avatarData} analyzeStatus="done">
|
|
|
|
- <FigureList className="bg-gray-2 px-16 py-12">
|
|
|
|
- <FigureListItem figure={IconFIleTxt} underline arrow>
|
|
|
|
- <View className="flex flex-col flex-1 gap-2 w-full">
|
|
|
|
- <View className="text-14 leading-22">文件名称</View>
|
|
|
|
- <View className="text-12 leading-20 text-gray-45">
|
|
|
|
- 03-24 12:20 | 822.KB
|
|
|
|
- </View>
|
|
|
|
- </View>
|
|
|
|
- </FigureListItem>
|
|
|
|
- <FigureListItem figure={IconFIlePDF} arrow>
|
|
|
|
- <View className="flex flex-col flex-1 gap-2 w-full">
|
|
|
|
- <View className="text-14 leading-22">飞秒小知识.pdf</View>
|
|
|
|
- <View className="text-12 leading-20 text-gray-45">
|
|
|
|
- 03-24 12:20 | 822.KB
|
|
|
|
- </View>
|
|
|
|
- </View>
|
|
|
|
- </FigureListItem>
|
|
|
|
- </FigureList>
|
|
|
|
- </MessageRobotRich> */}
|
|
|
|
-
|
|
|
|
- {/* <MessageRich data={avatarData}>
|
|
|
|
- <View className="flex items-center gap-12">
|
|
|
|
- <IconFIleXLSX />
|
|
|
|
- <View className="flex flex-col flex-1 gap-2">
|
|
|
|
- <View className="text-14 leading-22">文件名称</View>
|
|
|
|
- <View className="text-12 leading-20 text-gray-45">
|
|
|
|
- 03-24 12:20 | 822.KB
|
|
|
|
- </View>
|
|
|
|
- </View>
|
|
|
|
- </View>
|
|
|
|
- </MessageRich> */}
|
|
|
|
</View>
|
|
</View>
|
|
</ScrollView>
|
|
</ScrollView>
|
|
);
|
|
);
|