Browse Source

fix: 修复形象列表可删除状态; 知识库空状态

王晓东 2 days ago
parent
commit
d340547cd6

+ 9 - 2
project.private.config.json

@@ -8,12 +8,19 @@
   "condition": {
     "miniprogram": {
       "list": [
+        {
+          "name": "pages/agent-gen/index",
+          "pathName": "pages/agent-gen/index",
+          "query": "avatarUrl=https%3A%2F%2F51saas.oss-cn-hangzhou.aliyuncs.com%2Fu260727532%2F20250804%2FJpGLNPDG6d_537f0bdc05da4d818d3c8941f3fda98d.jpg",
+          "scene": null,
+          "launchMode": "default"
+        },
         {
           "name": "pages/profile/index",
           "pathName": "pages/profile/index",
           "query": "scene=894778d0982940e5fecfc73311ff482e",
-          "scene": null,
-          "launchMode": "default"
+          "launchMode": "default",
+          "scene": null
         },
         {
           "name": "pages/knowledge/index",

+ 4 - 0
src/components/AgentPage/components/AgentQRcode/index.module.less

@@ -1,6 +1,10 @@
 .container{
   padding-top: 12px;
   height: 70vh;
+  display: flex;
+  align-items: center;
+  flex-direction: column;
+  justify-content: center;
   overflow: auto;
 }
 .card{

+ 1 - 0
src/components/AgentPage/components/AgentSwap/index.tsx

@@ -43,6 +43,7 @@ export default ({ show, setShow }: IProps) => {
 
   const handleCreate = async ()=> {
     Taro.showLoading()
+    Taro.showTabBar().catch(()=> {});
     if (loading) {
       return;
     }

+ 15 - 3
src/components/EmptyData/index.tsx

@@ -1,15 +1,27 @@
 import { View } from "@tarojs/components";
+
+
+export const EmptyDataTitle = ({children}) => {
+  return <View className='text-16 text-black font-medium text-center leading-24 mt-20 font-pingfangSCMedium'>{children}</View>
+}
+export const EmptyDataSubInfo= ({children}) => {
+  return <View className='leading-28 text-gray-45 text-14'>{children}</View>
+}
+
 interface IProps {
   type?: 'plane'|'search'|'chat' | 'box' | 'whiteboard' | (string & {}),
   text?: string,
   children?: JSX.Element|JSX.Element[]
   className?: string
 }
+
 export default ({type = 'plane', className='', text = '暂无数据', children}: IProps)=> {
   return (
     <View className={`flex flex-col items-center mt-44 ${className}`}>
-      <View className={`data-empty data-empty-${type}`}></View>
-      {children ? children : <View className='text-16 text-black font-medium text-center leading-24 mt-20'>{text}</View>}
+      <View className={`data-empty data-empty-${type}`}></View>      
+      {children ? children : <EmptyDataTitle>{text}</EmptyDataTitle>}
     </View>
   )
-}
+}
+
+

+ 1 - 1
src/components/KnowledgePicker/index.tsx

@@ -75,7 +75,7 @@ export default function Index({title = '知识库',  show, setShow, multi, types
               <View className="leading-24 text-black font-medium text-16 mb-4 font-pingfangSCMedium">
                 你还没有加入任何企业
               </View>
-              <View className="leading-20 text-gray-45 mb-12 text-14">
+              <View className="leading-28 text-gray-45 mb-12 text-14">
                 访问公司统一知识内容, 提升回复效率与专业度
               </View>
               <View

+ 1 - 1
src/components/custom-share/index.tsx

@@ -193,7 +193,7 @@ export default (props: Props) => {
   // Taro.nextTick(() => {
   //   initCanvas();
   // });
-
+  // 您好,这是xxx的智能体主页!
   const shareTitle = '快和我的智能体聊聊吧' // '想了解我?快和我的AI聊聊吧',
   
   useShareAppMessage(async () => {

+ 4 - 2
src/components/popup-link-copyer/index.module.less

@@ -28,14 +28,16 @@
   align-items: center;
 }
 .iconCorrect{
+  display: flex;
+  align-items: center;
+  justify-content: center;
   margin-bottom: 20px;
   width: 64px;
   height: 64px;
   border-radius: 100%;
-  background: url(https://cdn.wehome.cn/cmn/png/131/META-H8UK0IWU-9NNPJOLLD1MU95DE0NMA3-E65WYT2M-3Y.png) no-repeat;
   background-size: 24px 18px;
   background-position: center center;
-  background-color: #CBF706;
+  background-color: var(--color-primary);
 }
 .linkRow{
   margin-top: 48px;

+ 4 - 1
src/components/popup-link-copyer/index.tsx

@@ -3,6 +3,7 @@ import { TSocialMediaItem } from '@/types/index'
 import style from './index.module.less'
 import Taro from "@tarojs/taro"
 import closeIcon from '@/images/icon-close-8.png';
+import IconCorrect from '@/images/svgs/website/IconCorrect.svg'
 
 import Popup from "@/components/popup/popup";
 interface Props {
@@ -51,7 +52,9 @@ export default ({show, setShow, link, mediaItem}:Props)=> {
     >
       <View className={style.container}>
         <View className={style.content}>
-          <View className={style.iconCorrect}></View>
+          <View className={style.iconCorrect}>
+            <Image src={IconCorrect} className="w-28 h-40"></Image>
+          </View>
           <View className="text-center text-black leading-32 font-medium text-24">链接已复制</View>
           <View className={style.copyTips}>复制内容到浏览器或使用对应软件搜索</View>
           <View className={style.linkRow}>

+ 3 - 3
src/components/popup/popup-sheets/index.module.less

@@ -11,11 +11,11 @@
 }
 .container{
   position: absolute;
-  left: 10px;
-  right: 10px;
+  left: 0px;
+  right: 0px;
   bottom: 0;
   padding-top: 12px;
-  width: calc(100% - 20px);
+  width: 100%;
   border-radius: 24px 24px 0 0;
   background-color: white;
   transition: transform .14s ease-in;

+ 3 - 3
src/components/popup/popup/index.module.less

@@ -11,11 +11,11 @@
 }
 .container{
   position: absolute;
-  left: 10px;
-  right: 10px;
+  left: 0px;
+  right: 0px;
   bottom: 0;
   padding-top: 12px;
-  width: calc(100% - 20px);
+  width: 100%;
   border-radius: 24px 24px 0 0;
   background-color: white;
   transition: transform .14s ease-in;

+ 3 - 0
src/images/svgs/website/IconCorrect.svg

@@ -0,0 +1,3 @@
+<svg width="25" height="19" viewBox="0 0 25 19" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path fill-rule="evenodd" clip-rule="evenodd" d="M24.6765 3.39524L10.0608 18.011L0.666491 8.61671L3.79061 5.49259L10.0608 11.7627L21.5524 0.271125L24.6765 3.39524Z" fill="white"/>
+</svg>

+ 1 - 1
src/pages/agent-avatars/index.tsx

@@ -118,7 +118,7 @@ export default function Index() {
           className={`${isCurrent ? style.gridItemActived : style.gridItem}`}
           onClick={() => handleClick(avatar)}
         >
-          {!isCurrent && (
+          {avatar.canDel && (
             <View
               className={style.deleteButton}
               onClick={(e) => handleDelete(e, avatar)}

+ 4 - 3
src/pages/agent-gen/components/step/StepConfirm.tsx

@@ -3,6 +3,7 @@ import React, { useState } from "react";
 import style from "./index.module.less";
 import WemetaRadio from '@/components/WemetaRadio'
 import { AvatarMedia } from "@/components/AvatarMedia";
+import ButtonMain from '@/components/buttons/ButtonMain'
 import Taro from "@tarojs/taro";
 import { TAvatarItem } from "@/service/storage";
 import { editAgentAvatar } from "@/service/agent";
@@ -35,12 +36,12 @@ export default React.memo(function Index({prev, pickedAvatar}:IProps) {
           <Image
             mode='aspectFill'
             className={style.confirmRoundedAvatar}
-            src={pickedAvatar.avatarLogo}
+            src={pickedAvatar?.avatarLogo}
           ></Image>
         </View>
         <View className={style.confirmChatAvatarBg}>
           <View className={style.confirmChatAvatarImage}>
-            <AvatarMedia source={pickedAvatar.avatarUrl} className={style.confirmChatAvatarImage} />
+            <AvatarMedia roundedFull={false}  source={pickedAvatar?.avatarUrl} className={style.confirmChatAvatarImage} />
             {/* <Image
               mode="widthFix"
               className="w-full"
@@ -62,7 +63,7 @@ export default React.memo(function Index({prev, pickedAvatar}:IProps) {
       <View className="bottom-bar">
         <View className="grid grid-cols-2 gap-8 px-20 py-12">
           <View className={`button-rounded`} onClick={prev}>更换形象</View>
-          <View className={`button-rounded primary`} onClick={handleConfirm}>确定</View>
+          <ButtonMain className="flex-1" onClick={handleConfirm}>确定</ButtonMain>
         </View>
       </View>
     </View>

+ 1 - 1
src/pages/agent-gen/components/step/StepStart.tsx

@@ -81,7 +81,7 @@ export default React.memo(function StepStart({ next, setTaskId }: IProps) {
         <View className="px-20 py-12">
           <View className={`button-rounded-big gap-4 ${style.startGenButton}`} onClick={handleClick}>
             <IconStar />
-            <View>生成微视频</View>
+            <View>生成AI形象</View>
           </View>
         </View>
       </View>

+ 38 - 0
src/pages/agent/components/AgentSetting/components/AgentCard/index.module.less

@@ -53,4 +53,42 @@
   color: rgba(#000, .85); 
   background-color: rgba(#FFF, .7);
   backdrop-filter: blur(7px) brightness(0.94) contrast(146%) grayscale(3%) opacity(81%);
+}
+
+.confirmChatAvatarBgCover{
+  position: absolute;
+  display: flex;
+  flex-direction: column;
+  justify-content: flex-end;
+  position: absolute;
+  left: 0;
+  bottom: 0;
+  right: 0;
+  z-index: 1;
+  width: 200px;
+  min-height: 373px;
+  box-sizing: border-box;
+  padding: 0 24px 54px;
+  border-radius: 24px;
+  gap: 8px;
+  background: linear-gradient(180deg, rgba(255, 255, 255, 0) 50.12%, #D6D6D6 100%); 
+}
+.block{
+  background-color: white;
+  border-radius: 4px;
+  height: 20px;
+}
+.block1{
+  .block();
+  width: 114px;
+}
+.block2{
+  .block();
+  align-self: flex-end;
+  width: 102px;
+  background-color: rgba(#317CFA, .5);
+}
+.block3{
+  .block();
+  width: 160px;
 }

+ 27 - 21
src/pages/agent/components/AgentSetting/components/AgentCard/index.tsx

@@ -3,7 +3,7 @@ import style from "./index.module.less";
 import IconPlusBig from "@/components/icon/icon-plus-big";
 import Taro from "@tarojs/taro";
 import { uploadAndNavToGenNewAvatar } from "@/utils/avatar";
-import WemetaRadio from '@/components/WemetaRadio'
+import WemetaRadio from "@/components/WemetaRadio";
 import { useAgentStore } from "@/store/agentStore";
 import { editAgentChatBg } from "@/service/agent";
 import { isSuccess } from "@/utils";
@@ -11,39 +11,38 @@ import { fetchMyAvatars } from "@/service/storage";
 import { AvatarMedia } from "@/components/AvatarMedia";
 
 export default () => {
-  const {agent, fetchAgent} = useAgentStore()
+  const { agent, fetchAgent } = useAgentStore();
 
-  const handleChange = async (isChecked: boolean)=> {
-    if(!agent?.agentId){
-      return
+  const handleChange = async (isChecked: boolean) => {
+    if (!agent?.agentId || !agent.avatarUrl) {
+      return;
     }
-    const response = await editAgentChatBg(agent.agentId, isChecked)
-    if(isSuccess(response.status)) {
+    const response = await editAgentChatBg(agent.agentId, isChecked);
+    if (isSuccess(response.status)) {
       Taro.showToast({
-        title: isChecked ? '启用成功' : '取消启用',
-        icon: 'success',
+        title: isChecked ? "启用成功" : "取消启用",
+        icon: "success",
       });
-      fetchAgent(agent.agentId); // 刷新智能体信息  
+      fetchAgent(agent.agentId); // 刷新智能体信息
     }
-  }
+  };
   const handleClick = async () => {
     const response = await fetchMyAvatars({ pageIndex: 1, pageSize: 2 });
-    if(isSuccess(response.status)){
-      if(response.data.data.length > 0){
-        Taro.navigateTo({url: '/pages/agent-avatars/index'})
-        return
+    if (isSuccess(response.status)) {
+      if (response.data.data.length > 0) {
+        Taro.navigateTo({ url: "/pages/agent-avatars/index" });
+        return;
       }
     }
     if (agent?.avatarUrl) {
       return;
     }
-    uploadAndNavToGenNewAvatar()
-    
+    uploadAndNavToGenNewAvatar();
   };
 
-  const handleChangeAvatar = async (e:any) => {
+  const handleChangeAvatar = async (e: any) => {
     e.stopPropagation();
-    Taro.navigateTo({url: '/pages/agent-avatars/index'})
+    Taro.navigateTo({ url: "/pages/agent-avatars/index" });
   };
 
   const renderContent = () => {
@@ -61,11 +60,15 @@ export default () => {
     return (
       <View className="relative overflow-hidden w-full h-full">
         <AvatarMedia source={agent.avatarUrl} className={style.card} />
+        {agent?.enabledChatBg &&  <View className={style.confirmChatAvatarBgCover}>
+          <View className={style.block1}></View>
+          <View className={style.block2}></View>
+          <View className={style.block3}></View>
+        </View>}
         <View className={style.changeButton} onClick={handleChangeAvatar}>
           更换形象
         </View>
       </View>
-      
     );
   };
 
@@ -74,7 +77,10 @@ export default () => {
       <View className={style.card} onClick={handleClick}>
         {renderContent()}
       </View>
-      <View className="w-full flex-center pt-24 gap-6" onClick={()=> handleChange(!!!agent?.enabledChatBg)}>
+      <View
+        className="w-full flex-center pt-24 gap-6"
+        onClick={() => handleChange(!!!agent?.enabledChatBg)}
+      >
         {/* ={agent?.enabledChatBg} */}
         <WemetaRadio checkbox checked={agent?.enabledChatBg}></WemetaRadio>
         <View className="font-medium text-14 text-black">启用聊天背景</View>

+ 24 - 13
src/pages/agent/index.tsx

@@ -11,7 +11,6 @@ import { useDidShow, useRouter } from "@tarojs/taro";
 import { useComponentStore } from "@/store/componentStore";
 import { useUserStore } from "@/store/userStore";
 import { useAppStore } from "@/store/appStore";
-import style from './index.module.less'
 
 export default function Index() {
   const [tabIndex, setTabIndex] = useState('1');
@@ -54,20 +53,32 @@ export default function Index() {
     <PageCustom>
       <NavBarNormal scrollFadeIn backText="创建"></NavBarNormal>
       <View className="px-16 w-full flex flex-col gap-20">
-        {/* <View className={style.tabContainer} style={{top: (headerHeight) + 'px'}}>
-          
-        </View> */}
-        <TabBarButtons
-            current={tabIndex}
-            list={tabList}
-            onTabIndexChange={handleTabIndexChange}
-          ></TabBarButtons>
-        <View className={`${tabIndex === "1" ? "block" : "hidden"}`}>
-          <AgentSetting></AgentSetting>
+        <View className="fixed top-0 left-0 right-0 z-10" 
+        style={{
+          paddingTop: headerHeight,
+        }}
+        >
+          <View className="flex flex-center px-16">
+            <TabBarButtons
+              current={tabIndex}
+              list={tabList}
+              onTabIndexChange={handleTabIndexChange}
+            ></TabBarButtons>
+          </View>
         </View>
-        <View className={`${tabIndex === "2" ? "block" : "hidden"}`}>
-          <AgentWebsite></AgentWebsite>
+        <View className="pt-40">
+          <View className={`${tabIndex === "1" ? "block" : "hidden"}`}>
+            <View className="pt-12">
+            <AgentSetting></AgentSetting>
+            </View>
+          </View>
+          <View className={`${tabIndex === "2" ? "block" : "hidden"}`}>
+            <View className="pt-36 pb-80">
+              <AgentWebsite></AgentWebsite>  
+            </View>          
+          </View>
         </View>
+        
       </View>
     </PageCustom>
   );

+ 1 - 0
src/pages/chat/components/input-bar/chatInput.ts

@@ -204,6 +204,7 @@ export const useChatInput = ({ agent, setShowWelcome, setDisabled, }: Props) =>
         setDisabled?.(false);
       },
       onError: () => {
+        setDisabled?.(false);
         deleteMessage(currentRobotMsgUk);
       },
     });

+ 2 - 3
src/pages/dashboard/index.tsx

@@ -30,7 +30,6 @@ export default () => {
   const [summary, setSummary] = useState<TVisitorSummary>()
 
   const fetcher = async ([_url, {nextId, pageSize}, [agentId]]) => {
-    console.log(nextId, agentId)
     const res = await getVisitorList({ startId: nextId, pageSize, agentId});
     return res.data;
   };
@@ -107,9 +106,9 @@ export default () => {
 
         <View className="grid grid-cols-2 gap-8 bg-white rounded-12 p-12 mb-12">
           <DataCard text="今日访问次数" unitText="次" value={summary?.todayPv ?? 0} />
-          <DataCard text="今日对话人数" unitText="人" value={summary?.todayUv ?? 0} />
+          <DataCard text="今日对话人数" unitText="人" value={summary?.todayChatUv ?? 0} />
           <DataCard text="累计访问次数" unitText="次" value={summary?.sumPv ?? 0} />
-          <DataCard text="累计对话人数" unitText="人" value={summary?.sumPv ?? 0} />
+          <DataCard text="累计对话人数" unitText="人" value={summary?.sumChatUv ?? 0} />
           <DataCard text="好评" unitText="条" value={summary?.unreadLikeCnt ?? 0} />
           <DataCard onClick={()=> {
             if(unprocessedDislikeCnt <= 0) {

+ 5 - 6
src/pages/knowledge/components/CompanyList/index.tsx

@@ -61,15 +61,14 @@ const Index = ({currentEnt, setCurrentEnt, extraEnt = []}: IProps) => {
   // 如果没有公司
   if (!allEnt.length) {
     return (
-      <View className="flex-center pt-40">
+      <View className="flex-center pt-22 w-full">
         <EmptyData type={'box'}>
-          <View className="text-center text-14 leading-28 text-gray-45 mb-44 w-172">
+          <View className="text-center text-14 leading-28 text-gray-45 mb-44 w-full">
             <View className="text-center text-16 leading-24 font-medium text-black">
-              绑定企业,知识自动到位
+            开通企业知识库
             </View>
-            <View>访问公司统一知识内容</View>
-            <View>一键同步到你的智能体</View>
-            <View>提升回复效率与专业度</View>
+            <View>让员工智能体高效运转,全公司知识自动同步</View>
+            <View>客户咨询准确率提升80%+</View>
             <View
               className="button-rounded button-primary-light button-border-primary button-inline-flex mt-24"
               onClick={() =>

+ 10 - 4
src/pages/knowledge/components/CompanyTab/components/ScrollList.tsx

@@ -4,7 +4,7 @@ import FigureList from "@/components/list/FigureList";
 import FigureListItem from "@/components/list/FigureListItem";
 import { useDidShow } from "@tarojs/taro";
 import { useEffect, useState } from "react";
-import EmptyData from "@/components/EmptyData";
+import EmptyData, {EmptyDataTitle, EmptyDataSubInfo} from "@/components/EmptyData";
 import RotateLoading from "@/components/rotate-loading";
 import Taro from "@tarojs/taro";
 import IconError from '@/images/svgs/knowledge/IconError.svg'
@@ -95,9 +95,15 @@ const Index = ({ entId, setTotalCount }: Iprops) => {
       }}
     >
       {list.length <= 0 ? (
-        <View className="pt-46">
-          <EmptyData type={"plane"} />
-        </View>
+        <EmptyData type={"search"}>
+          <View className="text-center text-14 leading-28 text-gray-45 mb-44 w-full">
+            <EmptyDataTitle>暂无数据</EmptyDataTitle>
+            <EmptyDataSubInfo>
+              <View>可登录电报端管理企业知识库</View>
+              <View>也可以开启个人知识库同步到企业知识库</View>
+            </EmptyDataSubInfo>
+          </View> 
+        </EmptyData>
       ) : (
         <></>
       )}

+ 108 - 95
src/pages/knowledge/components/CompanyTab/components/ScrollListChat.tsx

@@ -4,7 +4,7 @@ import MessageRich from "@/components/chat-message/MessageRich";
 
 import FigureList from "@/components/list/FigureList";
 import FigureListItem from "@/components/list/FigureListItem";
-import EmptyData from "@/components/EmptyData";
+import EmptyData, {EmptyDataTitle, EmptyDataSubInfo} from "@/components/EmptyData";
 
 import { useEffect, useRef, useState } from "react";
 import Taro, { useDidShow } from "@tarojs/taro";
@@ -14,17 +14,14 @@ import KnowledgeIcon from "@/components/KnowledgeIcon";
 import {
   isParsedFail,
   isParsedSuccess,
-  isParsing
-} from '../../../knowledgeUtils'
-import {
-  getEntKnowledgeStream,
-} from "@/service/knowledge";
+  isParsing,
+} from "../../../knowledgeUtils";
+import { getEntKnowledgeStream } from "@/service/knowledge";
 
-import type {TKnowledgeStreamResponseData } from "@/types/knowledge";
+import type { TKnowledgeStreamResponseData } from "@/types/knowledge";
 import { DEFAULT_AGENT } from "@/config";
 import { useLoadMoreInfinite, createKey } from "@/utils/loadMoreInfinite";
 
-
 export interface Iprops {
   entId: string | number;
   assistantOnly?: boolean;
@@ -32,123 +29,139 @@ export interface Iprops {
 }
 
 const Index = ({ entId, assistantOnly, setTotalCount }: Iprops) => {
-
-  const [scrollTop, setScrollTop] = useState(9999)
+  const [scrollTop, setScrollTop] = useState(9999);
   const { whoami } = useUserStore();
 
-  const fetcher = async ([_url, {nextId, pageSize}, [entId]]) => {
-    const res = await getEntKnowledgeStream({ startId: nextId, pageSize, entId });
+  const fetcher = async ([_url, { nextId, pageSize }, [entId]]) => {
+    const res = await getEntKnowledgeStream({
+      startId: nextId,
+      pageSize,
+      entId,
+    });
     return res.data;
   };
-  const { list, loadMore, pageIndex, mutate, data } = useLoadMoreInfinite<TKnowledgeStreamResponseData[]>(
-    createKey(`getEntKnowledgeStream ${entId}`, 20, [entId]),
-    fetcher);
+  const { list, loadMore, pageIndex, mutate, data } = useLoadMoreInfinite<
+    TKnowledgeStreamResponseData[]
+  >(createKey(`getEntKnowledgeStream ${entId}`, 20, [entId]), fetcher);
 
   const getFilterList = (list: TKnowledgeStreamResponseData[]) => {
-    if(!assistantOnly) return list;
+    if (!assistantOnly) return list;
     return list.filter((item) => {
-      return item.role === 'assistant';
+      return item.role === "assistant";
     });
   };
 
   const reversedList = getFilterList(list).reverse();
 
-
   const onScrollToUpper = async () => {
     console.log("toUpper");
     loadMore();
   };
-  useDidShow(()=> {
+  useDidShow(() => {
     mutate(undefined, { revalidate: true });
-  })
+  });
   useEffect(() => {
-    if(pageIndex === 1){
-        setScrollTop(prev => prev + 1)
-      }
+    if (pageIndex === 1) {
+      setScrollTop((prev) => prev + 1);
+    }
   }, [pageIndex]);
 
   useEffect(() => {
-    if(data &&  pageIndex === 1) {
-      setTotalCount(data?.[0].totalCount || 0)
+    if (data && pageIndex === 1) {
+      setTotalCount(data?.[0].totalCount || 0);
     }
   }, [data, pageIndex]);
 
-  
-
   return (
     <View className="flex-1 h-full overflow-hidden">
-    <ScrollView
-      scrollY
-      onScrollToUpper={onScrollToUpper}
-      scrollTop={scrollTop}
-      style={{
-        flex: 1,
-        height: "100%", // 高度自适应
-      }}
-    >
-      <View className="flex flex-col gap-20 pb-32 mx-16">
-        {reversedList.length<=0 ? <View className="pt-46"><EmptyData type={'plane'}/></View> : <></>}
-        {reversedList.map((group) => {
-          // 渲染自己发送的消息
-          if (group.role === "user") {
-            return group.knowledgeList.map((item) => {
-              return (
-                <MessageRich
-                  data={{
-                    avatar: whoami?.avatarUrl ?? "",
-                    name: whoami?.nickName ?? "",
-                  }}
-                >
-                  <View className="flex items-center gap-12">
-                    <KnowledgeIcon data={item} />
-                    <View className="flex flex-col flex-1 gap-2">
-                      <View className="text-14 leading-22 truncate">{item.title}</View>
-                      <View className="text-12 leading-20 text-gray-45">
-                        {item.createTime} | {item.fileSizeStr}
-                      </View>
-                    </View>
-                  </View>
-                </MessageRich>
-              );
-            });
-          }
-          // 渲染机器人小蓝本助手的消息
-          return (
-            <MessageRobotRich
-              data={{ ...DEFAULT_AGENT, fileLen: group.knowledgeList.length }}
-              analyzeStatus={group.isParsing ? "doing" : "done"}
-              content={group.content}
-            >
-              <FigureList>
-                {group.knowledgeList.map((item, index) => {
-                  return (
-                    <FigureListItem
-                      figure={() => {
-                        return <KnowledgeIcon data={item} />;
-                      }}
-                      underline={index + 1 < group.knowledgeList.length}
-                      arrow={isParsedSuccess(item)}
-                      onClick={() =>
-                        Taro.navigateTo({
-                          url: `/pages/knowledge-item/index?knowledgeId=${item.knowledgeId}&entId=${entId}`,
-                        })
-                      }
-                    >
-                      <View className="flex flex-col flex-1 gap-2 w-full">
-                        <View className="text-14 leading-22 truncate">{item.title}</View>
+      <ScrollView
+        scrollY
+        onScrollToUpper={onScrollToUpper}
+        scrollTop={scrollTop}
+        style={{
+          flex: 1,
+          height: "100%", // 高度自适应
+        }}
+      >
+        <View className="flex flex-col gap-20 pb-32 mx-16">
+          {reversedList.length <= 0 ? (
+            <EmptyData type={"search"}>
+              <View className="text-center text-14 leading-28 text-gray-45 mb-44 w-full">
+                <EmptyDataTitle>暂无数据</EmptyDataTitle>
+                <EmptyDataSubInfo>
+                  <View>可登录电报端管理企业知识库</View>
+                  <View>也可以开启个人知识库同步到企业知识库</View>
+                </EmptyDataSubInfo>
+              </View> 
+            </EmptyData>
+          ) : (
+            <></>
+          )}
+          {reversedList.map((group) => {
+            // 渲染自己发送的消息
+            if (group.role === "user") {
+              return group.knowledgeList.map((item) => {
+                return (
+                  <MessageRich
+                    data={{
+                      avatar: whoami?.avatarUrl ?? "",
+                      name: whoami?.nickName ?? "",
+                    }}
+                  >
+                    <View className="flex items-center gap-12">
+                      <KnowledgeIcon data={item} />
+                      <View className="flex flex-col flex-1 gap-2">
+                        <View className="text-14 leading-22 truncate">
+                          {item.title}
+                        </View>
                         <View className="text-12 leading-20 text-gray-45">
                           {item.createTime} | {item.fileSizeStr}
                         </View>
                       </View>
-                    </FigureListItem>
-                  );
-                })}
-              </FigureList>
-            </MessageRobotRich>
-          );
-        })}
-      </View>
-    </ScrollView>
+                    </View>
+                  </MessageRich>
+                );
+              });
+            }
+            // 渲染机器人小蓝本助手的消息
+            return (
+              <MessageRobotRich
+                data={{ ...DEFAULT_AGENT, fileLen: group.knowledgeList.length }}
+                analyzeStatus={group.isParsing ? "doing" : "done"}
+                content={group.content}
+              >
+                <FigureList>
+                  {group.knowledgeList.map((item, index) => {
+                    return (
+                      <FigureListItem
+                        figure={() => {
+                          return <KnowledgeIcon data={item} />;
+                        }}
+                        underline={index + 1 < group.knowledgeList.length}
+                        arrow={isParsedSuccess(item)}
+                        onClick={() =>
+                          Taro.navigateTo({
+                            url: `/pages/knowledge-item/index?knowledgeId=${item.knowledgeId}&entId=${entId}`,
+                          })
+                        }
+                      >
+                        <View className="flex flex-col flex-1 gap-2 w-full">
+                          <View className="text-14 leading-22 truncate">
+                            {item.title}
+                          </View>
+                          <View className="text-12 leading-20 text-gray-45">
+                            {item.createTime} | {item.fileSizeStr}
+                          </View>
+                        </View>
+                      </FigureListItem>
+                    );
+                  })}
+                </FigureList>
+              </MessageRobotRich>
+            );
+          })}
+        </View>
+      </ScrollView>
     </View>
   );
 };

+ 9 - 12
src/pages/knowledge/components/CorrectionTab/index.tsx

@@ -1,5 +1,6 @@
 import { View } from "@tarojs/components";
-import EmptyData from "@/components/EmptyData";
+import EmptyData, {EmptyDataTitle, EmptyDataSubInfo} from "@/components/EmptyData";
+
 
 import StyleFilter, { TListStyle } from "../StyleFilter";
 import { useRef, useState } from "react";
@@ -49,17 +50,13 @@ const Index = () => {
     // 空数据
     if (!totalCount) {
       return (
-        <View className="flex-center pt-40">
-          <EmptyData type={"whiteboard"}>
-            <View className="text-center text-14 leading-28 text-gray-45 mb-44 w-[296px]">
-              <View className="text-center text-16 leading-24 font-medium text-black">
-                还没有纠正过的内容
-              </View>
-              <View>当你发现 AI 理解有误的知识点并进行修改后,</View>
-              <View>会汇总在这里,用于优化AI回答。</View>
-            </View>
-          </EmptyData>
-        </View>
+        <EmptyData type={"whiteboard"}>
+          <EmptyDataTitle>还没有纠正过的内容</EmptyDataTitle>
+          <EmptyDataSubInfo>
+            <View>当你发现 AI 理解有误的知识点并进行修改后,</View>
+            <View>会汇总在这里,用于优化AI回答。</View>
+          </EmptyDataSubInfo>
+        </EmptyData>
       );
     }
     return <></>;

+ 1 - 0
src/service/storage.ts

@@ -13,6 +13,7 @@ export type TAvatarItem = {
   avatarLogo: string,
   avatarUrl: string,
   isOriginal: boolean
+  canDel: boolean
   isVideo: boolean
   videoSeconds: number
 }