Bläddra i källkod

feat: 增加个人知识分享至企业知识的功能

王晓东 3 månader sedan
förälder
incheckning
4d0a016384

+ 5 - 32
project.private.config.json

@@ -8,19 +8,12 @@
   "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",
-          "launchMode": "default",
-          "scene": null
+          "query": "agentId=p_cb626719d6aYig5s-agent_408",
+          "scene": null,
+          "launchMode": "default"
         },
         {
           "name": "pages/knowledge/index",
@@ -36,27 +29,6 @@
           "launchMode": "default",
           "scene": null
         },
-        {
-          "name": "pages/visiteor-detail/index",
-          "pathName": "pages/visiteor-detail/index",
-          "query": "visitorId=1391",
-          "launchMode": "default",
-          "scene": null
-        },
-        {
-          "name": "pages/agent/index",
-          "pathName": "pages/agent/index",
-          "query": "agentId=p_2e73c9d7efaYfDo2-agent_991",
-          "launchMode": "default",
-          "scene": null
-        },
-        {
-          "name": "contactus",
-          "pathName": "pages/contact-us/index",
-          "query": "",
-          "launchMode": "default",
-          "scene": null
-        },
         {
           "name": "pages/contact/index",
           "pathName": "pages/contact/index",
@@ -73,5 +45,6 @@
         }
       ]
     }
-  }
+  },
+  "libVersion": "3.8.12"
 }

+ 1 - 1
src/app.less

@@ -399,7 +399,7 @@
 
 // 智能体内容容器毛玻璃效果,距顶部距离 240 ,留出空间显示形象, 最小高度 600px 以防止没有顶到底部
 .blur-rounded-container{
-  margin-top: 240px;
+  margin-top: 296px;
   width: 100%;
   min-height: calc(100vh - 240px);
   box-sizing: border-box;

+ 1 - 0
src/app.tsx

@@ -7,6 +7,7 @@ import {LOGIN_ID_STORAGE_KEY } from '@/xiaolanbenlib/constant'
 import dayjs from "dayjs";
 import 'dayjs/locale/zh-cn'
 import relativeTime from  'dayjs/plugin/relativeTime'
+dayjs.locale('zh-cn');
 
 dayjs.extend(relativeTime)
 

+ 1 - 1
src/components/AgentPage/components/AgentActionBar/index.tsx

@@ -185,7 +185,7 @@ export default ({agent, isVisitor}: IProps) => {
       {!isVisitor && <AgentSwap show={showAgentSwap} setShow={setShowAgentSwap}></AgentSwap>}
 
       {/* 二维码弹窗 */}
-      <AgentQRCode isVisitor={isVisitor} show={showAgentQRcode} setShow={setShowAgentQRcode} />
+      <AgentQRCode isVisitor={isVisitor} agent={agent} show={showAgentQRcode} setShow={setShowAgentQRcode} />
 
       {/* 分享弹窗 */}
       {agent && <SharePopup

+ 6 - 9
src/components/AgentPage/components/AgentQRcode/index.tsx

@@ -9,22 +9,19 @@ import { useAgentStore } from "@/store/agentStore";
 import { pickAndUploadImage } from "@/utils/upload";
 import { EUploadFileScene } from "@/consts/enum";
 import Taro from "@tarojs/taro";
+import { TAgentDetail } from "@/types/agent";
 
 interface IProps {
   show: boolean;
   setShow: (show: boolean) => void;
   isVisitor?: boolean
+  agent: TAgentDetail
 }
-export default ({ show, setShow, isVisitor }: IProps) => {
-  const agentContactCard = useAgentStore((state) => state.agentContactCard);
-  const agent = useAgentStore((state) => state.agent);
+export default ({ show, setShow, agent, isVisitor }: IProps) => {
   const isMine = (!isVisitor) 
-  // ?? (agent?.isMineAgent !== false)
-  // const agents = useAgentStore((state) => state.agents);
-  // const existed = agents.find((item)=> agent?.agentId === item.agentId)
   const { setValue, submit } = useEditContactCard(
     "qrCodeUrl",
-    agentContactCard?.qrCodeUrl
+    agent?.qrCodeUrl
   );
   const handleClick = async () => {
     Taro.showLoading();
@@ -52,8 +49,8 @@ export default ({ show, setShow, isVisitor }: IProps) => {
   }
 
   const renderQrcode = () => {
-    if (agentContactCard?.qrCodeUrl) {
-      return <Image src={agentContactCard?.qrCodeUrl} showMenuByLongpress mode="aspectFit"></Image>;
+    if (agent?.qrCodeUrl) {
+      return <Image src={agent?.qrCodeUrl} showMenuByLongpress mode="aspectFit"></Image>;
     }
     
     if(isMine){

+ 56 - 0
src/components/RenderContent/RenderLinks.tsx

@@ -0,0 +1,56 @@
+import { View, Image, Text } from "@tarojs/components";
+import IconCopyDashboard from "@/images/svgs/dashboard/IconCopy.svg";
+
+import Taro from "@tarojs/taro";
+interface Props {
+  urls: string[];
+}
+export default ({ urls }: Props) => {
+  const handleCopy = (e: any, textStr: string) => {
+    e.stopPropagation();
+    // 手动复制并 toast 提示
+    if (textStr) {
+      Taro.setClipboardData({
+        data: textStr,
+        success() {
+          Taro.showToast({
+            title: "复制成功",
+            icon: "none",
+          });
+        },
+        fail(res) {
+          console.log(res);
+          Taro.showToast({
+            title: "复制失败",
+            icon: "none",
+          });
+        },
+      });
+    }
+  };
+  if (urls.length === 0) {
+    return <></>;
+  }
+  return (
+    <>
+      {urls.length ? <View className="leading-28 mb-8">查看链接: </View> : <></>}
+      {urls.map((link: string) => {
+        return (
+          <View className="flex items-center gap-6 truncate overflow-hidden">
+            <View
+              className="truncate leading-28"
+              user-select
+            >
+              {link}
+            </View>
+            <Image
+              src={IconCopyDashboard}
+              className="w-16 h-16 shrink-0"
+              onClick={(e) => handleCopy(e, link)}
+            ></Image>
+          </View>
+        );
+      })}
+    </>
+  );
+};

+ 54 - 0
src/components/RenderContent/RenderMedia.tsx

@@ -0,0 +1,54 @@
+import { View, Image } from "@tarojs/components";
+import Taro from "@tarojs/taro";
+interface Props {
+  urls: string[];
+}
+export default ({ urls }: Props) => {
+  const handlePreview = (e: any, index: number) => {
+    e.stopPropagation();
+    Taro.previewMedia({
+      current: index,
+      //@ts-ignore
+      sources: urls.map((item) => {
+        return {
+          url: item,
+          type: "image",
+        };
+      }),
+    });
+  };
+  if (urls.length === 0) {
+    return <></>;
+  }
+  if (urls.length === 1) {
+    return (
+      <View className="w-full max-h-156 overflow-hidden rounded-8">
+        <Image
+          src={urls[0]}
+          mode="widthFix"
+          className="w-full rounded-8"
+        ></Image>
+      </View>
+    );
+  }
+  return (
+    <View className="flex justify-center">
+      <View className="bg-white rounded-12 grid grid-cols-3 gap-6 justify-center w-full">
+        {urls.map((pic: string, index) => {
+          return (
+            <View
+              className="w-80 h-80 overflow-hidden rounded-8"
+              onClick={(e) => handlePreview(e, index)}
+            >
+              <Image
+                src={pic}
+                mode="widthFix"
+                className="w-full rounded-8"
+              ></Image>
+            </View>
+          );
+        })}
+      </View>
+    </View>
+  );
+};

+ 0 - 1
src/components/UploaderGrid/index.tsx

@@ -18,7 +18,6 @@ const Index = ({onNewUpload, list, onChange, onDelete }: IndexProps) => {
   
   // 预览媒体
   const handlePreview = (e: any, index: number, item: TMediaType) => {
-    console.log(index, item,3333)
     e.stopPropagation();
     Taro.previewMedia({
       current: index,

+ 5 - 3
src/components/WemetaRadio/index.module.less

@@ -4,6 +4,7 @@
   justify-content: center;
   width: 16px;
   height: 16px;
+  overflow: hidden;
   border: 1px solid rgba(#000, .45);
   border-radius: 100%;
   transition: all .3s;
@@ -13,10 +14,11 @@
   width: 6px;
   height: 6px;
   border-radius: 100%;
-  background: var(--color-bg-primary);
+  background-color: var(--color-bg-primary);
 }
 .innerDisabled{
-  background: #EDEDED;
+  opacity: .5;
+  background-color: #EDEDED;
 }
 .radio.checked{
   border: 1px solid var(--color-primary);
@@ -39,5 +41,5 @@
 }
 .innerDisabledCheckBox{
  .innerCheckbox(); 
- background: #EDEDED;
+//  background-color: #EDEDED;
 }

+ 6 - 4
src/components/chat-message/Message.tsx

@@ -6,10 +6,12 @@ interface Props {
 }
 export default ({text}:Props) => {
   return <View className="flex justify-end">
-    <View className={`${style.message } ${style.messageMe}`}>
-      <View className={`${style.messageContent} text-white`}>
-        {text.length === 0 && <ThinkAnimation></ThinkAnimation>}
-        <Text user-select>{text}</Text>
+    <View className="max-w-[280px]">
+      <View className={`${style.message } ${style.messageMe}`}>
+        <View className={`${style.messageContent} text-white`}>
+          {text.length === 0 && <ThinkAnimation></ThinkAnimation>}
+          <Text user-select>{text}</Text>
+        </View>
       </View>
     </View>
   </View>

+ 9 - 17
src/components/chat-message/MessageRobot.tsx

@@ -6,6 +6,10 @@ import IconDislikeBlue from "@/components/icon/IconDislikeBlue";
 import IconLike from "@/components/icon/IconLike";
 import IconLikeBlue from "@/components/icon/IconLikeBlue";
 import IconSpeaker from "@/components/icon/icon-speaker";
+import IconCopyDashboard from '@/images/svgs/dashboard/IconCopy.svg'
+import RenderMedia from "@/components/RenderContent/RenderMedia";
+import RenderLinks from "@/components/RenderContent/RenderLinks";
+
 import { TAgentDetail } from "@/types/agent";
 
 import Taro from "@tarojs/taro";
@@ -113,23 +117,11 @@ export default ({ agent, text, message, showUser=false, textReasoning = "" }: Pr
       // console.log(body)
       return (
         <View>
-          <View className="pb-12">
-            {pics.map((pic: string) => {
-              return (
-                <View>
-                  <Image src={pic} mode="widthFix" className="w-full"></Image>
-                </View>
-              );
-            })}
+          <View className="pb-10">
+            <RenderMedia urls={pics}></RenderMedia>
           </View>
-          <View className="pb-12">
-            {links.map((link: string) => {
-              return (
-                <View onClick={(e) => handleCopy(e, link)}>
-                  <Text className="text-primary">复制链接</Text> <Text user-select>{link}</Text>
-                </View>
-              );
-            })}
+          <View className="pb-10">
+            <RenderLinks urls={links}></RenderLinks>
           </View>
         </View>
       );
@@ -138,7 +130,7 @@ export default ({ agent, text, message, showUser=false, textReasoning = "" }: Pr
   };
 
   return (
-    <View>
+    <View className="max-w-[280px]">
       {showUser && (
         <View className="flex gap-8 mb-10">
           <View className={style.avatarContainer}>

+ 3 - 2
src/components/chat-message/index.module.less

@@ -1,9 +1,10 @@
 .message{
-  display: flex;
+  display: inline-flex;
   flex-direction: column;
   padding: 12px 16px;
   background-color: white;
   gap: 10px;
+  max-width: 280px;
   border-top-left-radius: 16px;
   border-top-right-radius: 2px;
   border-bottom-right-radius: 16px;
@@ -30,7 +31,7 @@
 
 
 .messageMe{
-  display: flex;
+  display: inline-flex;
   justify-content: flex-end;
   padding: 12px 16px;
   background: var(--color-primary);

+ 3 - 7
src/components/page-wrapper/CustomBg.tsx

@@ -5,26 +5,22 @@ import { View, Video } from "@tarojs/components";
 import React, { useEffect, useState } from "react";
 import pageStyle from "./index.module.less";
 import Taro from "@tarojs/taro";
-// import { useAppStore } from "@/store/appStore";
+import { useAppStore } from "@/store/appStore";
 interface Props {
   styleBg?: string|null;
 }
 
 const Index: React.FC<Props> = ({styleBg}) => {
   // 自定义背景样式
-  // const {windowHeight, windowWidth} = useAppStore()
-
+  const {windowHeight, windowWidth} = useAppStore()
   // const [offsetMargin, setOffsetMargin] = useState({ x: 0, y: 0 });
   // const [bgSize, setBgSize] = useState({ width: windowWidth, height: windowHeight });
 
   const  bg =  styleBg || ''  
   
   const bgImageStyle = {
+    height: `${(750 / windowWidth) * windowHeight}rpx`,
     backgroundImage: `url(${bg})`,
-    // marginLeft: `${offsetMargin.x}px`,
-    // marginTop: `${offsetMargin.y}px`,
-    // height: `${bgSize.height}px`,
-    // width: `${bgSize.width}px`,
     backgroundSize: 'auto 100%',
     backgroundPosition: 'center center'
   };

+ 1 - 0
src/components/page-wrapper/index.module.less

@@ -24,4 +24,5 @@
   height: 100%;
   background-size: auto 100%!important;
   background-repeat: no-repeat!important;
+  transition: all ease-in .5s;
 }

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

@@ -36,7 +36,7 @@ export default ({
       setTimeout(() => {
         setSlideUp(true);
       }, 100);
-      Taro.hideTabBar();
+      Taro.hideTabBar().catch(()=> {});
     } else {
       Taro.showTabBar().catch(()=> {});
       

BIN
src/images/tabbar/personal-actived.png


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

@@ -159,7 +159,7 @@ export const useChatInput = ({ agent, setShowWelcome, setDisabled, }: Props) =>
           loginId,
           messages: [{
             saveStatus: 2,
-            content: content,
+            content: currentRobotMessage?.body?.content || content,
             contentType: currentRobotMessage?.body?.contentType ?? EContentType.TextPlain,
             isStreaming: false,
             role: currentRobotMessage.role,
@@ -190,7 +190,7 @@ export const useChatInput = ({ agent, setShowWelcome, setDisabled, }: Props) =>
             loginId,
             messages: [{
               saveStatus: 2,
-              content: content,
+              content: currentRobotMessage?.body?.content || content ,
               contentType: currentRobotMessage?.body?.contentType ?? EContentType.TextPlain,
               isStreaming: false,
               role: currentRobotMessage.role,

+ 1 - 1
src/pages/chat/index.tsx

@@ -208,7 +208,7 @@ const agent = useAgentStore((state) => {
         backgroundColor: 'transparent'
       })
     }
-  })
+  },[])
   
 
 

+ 1 - 1
src/pages/dashboard/components/VisitorCard/index.tsx

@@ -37,7 +37,7 @@ const Index = ({ data }: IndexProps) => {
           </View>
           <View className="flex-center text-12 leading-20">
             <View className="flex-1">
-              <Text className="text-primary font-medium leading-20">{data.chatRound}</Text> 轮对话
+              <Text className="text-primary text-16 font-medium leading-20">{data.chatRound}</Text> 轮对话
             </View>
             <View className="text-gray-45 leading-20">{dayjs(data.lastChatTime).fromNow()}</View>
           </View>

+ 9 - 2
src/pages/dashboard/components/VisitorList/index.tsx

@@ -6,7 +6,7 @@ import { TVisitorAgent } from "@/types/visitor";
 import { getVisitorList } from "@/service/visitor";
 import { useLoadMoreInfinite, createKey } from "@/utils/loadMoreInfinite";
 import { useEffect } from "react";
-import EmptyData from "@/components/EmptyData";
+import EmptyData, { EmptyDataSubInfo, EmptyDataTitle } from "@/components/EmptyData";
 interface IProps {
   agentId?: string;
   list: TVisitorAgent[]
@@ -19,7 +19,14 @@ export default ({ agentId, list }: IProps) => {
     <View className="p-16">
       <View className="mb-16 text-14 leading-22 font-medium font-pingfangSCMedium">访问详情</View>
       <View className="flex flex-col gap-8">
-        {!list.length && <View className="pb-44"><EmptyData type='search'></EmptyData></View>}
+        {!list.length && <View className="pb-44">
+          <EmptyData type='search'>
+            <EmptyDataSubInfo>
+              <View>当前暂无用户访问记录</View>
+              <View>你的智能体正在等待首次互动</View>
+            </EmptyDataSubInfo>
+          </EmptyData>
+        </View>}
         {list.map((item) => {
           return (
             <VisitorCard

+ 2 - 3
src/pages/dislike-messages/index.tsx

@@ -175,7 +175,7 @@ export default function Index() {
 
   return (
     <PageCustom fullPage>
-      <NavBarNormal scrollFadeIn>待处理差评</NavBarNormal>
+      <NavBarNormal scrollFadeIn backText="待处理差评"></NavBarNormal>
       <View className="w-full flex flex-col overflow-hidden h-full pt-2">
         <View className="rounded-container-header"></View>
         {/* <View className="text-14 font-medium leading-22 px-16 pb-16">
@@ -194,12 +194,11 @@ export default function Index() {
           <View className="pb-80">
             {qaList.length <= 0 ? (
               <View className="pt-24">
-                <EmptyData type="box" />{" "}
+                <EmptyData type="search" text="待处理差评"></EmptyData>
               </View>
             ) : (
               <></>
             )}
-            {/* {dislikeList.length <=0 ? <View className="pt-24"><EmptyData type="box" /> </View>: <></>} */}
             {qaList.map((item) => {
               if (!item.assistant) {
                 return <></>;

+ 118 - 60
src/pages/knowledge-item/components/ShareToEntPopup/index.tsx

@@ -4,96 +4,154 @@
 
 import { Text, View, Image, ScrollView } from "@tarojs/components";
 
-
-import WemetaSwitch from "@/components/WemetaSwitch";
+import WemetaRadio from "@/components/WemetaRadio";
 
 import Popup from "@/components/popup/popup";
 import { useEffect, useState } from "react";
 import Taro, { useRouter, useDidShow } from "@tarojs/taro";
-import {
-  shareToEnt,
-} from "@/service/knowledge";
+import { shareToEnts, getSharedEnts } from "@/service/knowledge";
 import { useUserStore } from "@/store/userStore";
 import { TEntItem } from "@/types/user";
 import { isSuccess } from "@/utils";
+import EmptyData, { EmptyDataSubInfo } from "@/components/EmptyData";
+import BottomBar from "@/components/BottomBar";
+import ButtonMain from "@/components/buttons/ButtonMain";
+
 
 
 interface IProps {
-  knowledgeId: string|number
-  showPopup: boolean
-  setShowPopup: (show: boolean)=> void,
+  knowledgeId: string | number;
+  showPopup: boolean;
+  setShowPopup: (show: boolean) => void;
 }
 
-export default function Index({knowledgeId, showPopup, setShowPopup }:IProps) {
+export default function Index({
+  knowledgeId,
+  showPopup,
+  setShowPopup,
+}: IProps) {
+  const { entList, fetchMyEntList } = useUserStore();
+  const [sharedEntIds, setSharedEntIds] = useState<string[]>([]);
+  const [currentEnts, setCurrentEnts] = useState<TEntItem[]>([]);
 
-  const {entList, fetchMyEntList} = useUserStore()
-  const [shareEntList, setShareEntList] = useState(entList ?? []);
-  
-  
-  const handleSwitchChange = async (ent: TEntItem, checked: boolean)=> {
-    if(!knowledgeId){
-      return false;
+  const parsedEntList = entList.map( item => {
+    if(sharedEntIds.includes(item.entId as string)){
+      return {...item, shared: true}
     }
-    const response = await shareToEnt({
-      knowledgeIds: [knowledgeId],
-      toEntId: ent.entId,
+    return {...item, shared: false}
+  })
+
+  const handleSwitchChange = async (ent: TEntItem & {shared: boolean}) => {
+    if(ent.shared){
+      return;
+    }
+    setCurrentEnts((prev) => {
+      if(!prev?.find(item => item.entId === ent.entId)){
+        return [...prev, ent]
+      }
+      return  prev.filter( item => item.entId !== ent.entId)
     })
+  };
+
+  const submit = async () => {
+    if (!knowledgeId || !currentEnts.length) {
+      return false;
+    }
+    console.log(currentEnts, '当前企业')
+    const ents = currentEnts.map((item)=> item.entId).filter(item => item !== undefined)
+    if(!ents.length){
+      return 
+    }
+    const response = await shareToEnts(knowledgeId, ents);
+    if (isSuccess(response.status)) {
+      if(!response.data.failEntIds.length){
+        Taro.showToast({ title: "分享成功" });
+        fetchSharedEnts()
+        setShowPopup(false)
+        setCurrentEnts([])
+      }else{
+        // todo 分开处理展示结果
+        Taro.showToast({ title: "分享失败" });
+      }
+      
+    }
+  };
+
+  const fetchData = ()=> {
+    fetchMyEntList();
+  }
+  const fetchSharedEnts = async ()=> {
+    const response = await getSharedEnts(knowledgeId)
     if(isSuccess(response.status)){
-      Taro.showToast({title: checked ? '分享成功' : '取消分享成功'})
-      setShareEntList((prev) => {
-        if(checked){
-          return [...prev, ent]
-        }
-        return  prev.filter( item => item.entId !== ent.entId)
-      })
+      setSharedEntIds(response.data.entIds)
     }
   }
 
   useDidShow(() => {
-    fetchMyEntList()
+    fetchData()
   });
 
-  const renderContent = ()=> {
-    if(!entList.length){
-      return <View className="rounded-8 bg-gray-3 py-20 text-center">
-        <View className="leading-24 text-gray-45 font-medium text-14 mb-4">
-          暂未加入任何企业
-        </View>
-        
-        <View
-          className="text-primary"
-          onClick={() => {
-            Taro.navigateTo({
-              url: "/pages/contact-us/index",
-            });
-          }}
-        >
-          联系我们
-        </View>
-      </View>
-    }
+  useEffect(()=> {
+    setCurrentEnts([])
+    fetchSharedEnts()
+  }, [knowledgeId])
 
-    return <View className="flex flex-col gap-12 pb-24" style={{maxHeight: '60vh', overflow: 'auto'}}>
-      {entList.map(ent=> {
-        return <View className="flex items-center rounded-8 bg-gray-3 px-16 py-24">
-            <View className="flex-1 text-black font-medium text-14 leading-22">{ent.entName}</View>
-            <WemetaSwitch
-              checked={!!shareEntList.find((item)=> item.entId === ent.entId)}
-              onChange={(checked) => handleSwitchChange(ent, checked)}
-            ></WemetaSwitch>
+  const renderContent = () => {
+    if (!parsedEntList.length) {
+      return (
+        <View className="h-[320px]">
+          <EmptyData type="box">
+            <EmptyDataSubInfo>暂未加入任何企业</EmptyDataSubInfo>
+            <View
+              className="button-rounded button-primary-light button-border-primary button-inline-flex mt-20"
+              onClick={() => Taro.navigateTo({ url: "/pages/contact-us/index" })}
+            >
+              联系我们
+            </View>
+          </EmptyData>
         </View>
-      })}
-    </View>
+      );
+    }
 
-  }
-  
+    return (
+      <View
+        className="flex flex-col gap-12 pb-88"
+        style={{ maxHeight: "66vh", overflow: "auto" }}
+      >
+        {parsedEntList.map((ent) => {
+          return (
+            <View
+              className="flex items-center rounded-8 bg-gray-3 px-16 py-20"
+              onClick={() => handleSwitchChange(ent)}
+            >
+              <View className="flex-1 text-black font-medium text-14 leading-22 font-pingfangSCMedium">
+                {ent.entName}
+              </View>
+              <WemetaRadio
+                checkbox
+                disabled={ent.shared}
+                checked={ent.shared || !!currentEnts.find((item)=> item.entId === ent.entId)}
+              ></WemetaRadio>
+            </View>
+          );
+        })}
+      </View>
+    );
+  };
 
   return (
     <Popup setShow={setShowPopup} show={showPopup} title="共享至">
-      <View className="text-gray-45 leading-20 mb-16 text-12">开启后,该组织下的所有成员都可引用,可随时取消共享。</View>
+      <View className="text-gray-45 leading-20 mb-16 text-12">
+        开启后,该组织下的所有成员都可引用。
+      </View>
       
       {renderContent()}
-      
+
+      {(!!parsedEntList.length) ? <BottomBar>
+        <ButtonMain className="flex-1" disabled={!currentEnts.length} onClick={submit}>
+          确定
+        </ButtonMain>
+      </BottomBar> : <></>}
     </Popup>
   );
 }

+ 3 - 3
src/pages/profile/index.tsx

@@ -9,7 +9,7 @@ import { isSuccess } from "@/utils";
 
 import IconArrowLeft from "@/components/icon/icon-arrow-left";
 import IconHomeOutline from "@/components/icon/IconHomeOutline";
-import SummaryBar from "@/components/AgentPage/components/AgentActionBar";
+import AgentActionBar from "@/components/AgentPage/components/AgentActionBar";
 import { useAgentStore } from "@/store/agentStore";
 import style from "./index.module.less";
 import { sceneUnzip } from "@/service/wechat";
@@ -171,9 +171,9 @@ export default function Profile() {
   return (
     <PageCustom styleBg={agentProfile?.avatarUrl}>
       <View className="w-full">
-        <NavBarNormal leftColumn={renderNavBarLeft}></NavBarNormal>
+        <NavBarNormal blur scrollFadeIn scrollFadeInDelta={240}  leftColumn={renderNavBarLeft}></NavBarNormal>
         {agentProfile && <View className="blur-rounded-container">
-          <SummaryBar isVisitor agent={agentProfile}></SummaryBar>
+          <AgentActionBar isVisitor agent={agentProfile}></AgentActionBar>
           <View className="flex flex-col w-full p-16 gap-12">
             <ComponentList
               components={agentProfile.components ?? []}

+ 1 - 1
src/pages/visiteor-detail/components/VisitorSummary/index.tsx

@@ -46,7 +46,7 @@ const VisitorSummary = ({ data }: IndexProps) => {
         <View className="flex gap-8 items-center text-12 leading-20">
           <Image src={IconPhone} className="w-16 h-16 shrink-0"></Image>
           <Text>{data.mobile}</Text>
-          <Image src={IconCopy} className="w-16 h-16 shrink-0" onClick={()=> handleCopy(data.mobile)}></Image>
+          <Image src={IconCopy} className="w-16 h-16 shrink-0" onClick={()=> handleCopy(data.mobile ?? '')}></Image>
         </View>
         <View className="flex gap-8 items-center text-12 leading-20">
           <Image src={IconMark} className="w-16 h-16 shrink-0"></Image>

+ 14 - 0
src/service/knowledge.ts

@@ -60,6 +60,14 @@ export const getKnowledgeList = ({startId, pageSize = 1, types = []}: {
   );
 };
 
+
+// 将指定的1个知识库共享至多个企业
+export const shareToEnts = (knowledgeId: string|number, entIds: (string|number)[]) => {
+  return request.post<{
+    failEntIds: number[], // (Array[integer], optional): 失败的entId列表 ,
+    successEntIds: number[] // 成功分享的entId列表
+  }>(`${bluebookAiAgent}api/v1/my/knowledge/${knowledgeId}/share2Ents?entIds=${entIds.join(',')}`)
+}
 // 共享我的知识库至企业
 export const shareToEnt = (data: 
   {
@@ -70,6 +78,12 @@ export const shareToEnt = (data:
   return request.post(`${bluebookAiAgent}api/v1/my/knowledge/shareToEnt`, data)
 }
 
+// 获取指定的知识库已共享的企业列表,响应体为{'entIds':[]}
+export const getSharedEnts = (knowledgeId: string|number) => {
+  return request.get<{entIds: string[]}>(`${bluebookAiAgent}api/v1/my/knowledge/${knowledgeId}/sharedEnts`)
+}
+
+
 
 // 我的知识库--信息流
 

+ 1 - 1
src/store/agentStore.ts

@@ -126,7 +126,7 @@ export const useAgentStore = create<AgentStoreState>((set, get) => ({
   fetchAgentProfile: async (agentId: string, shareKey?:string) => {
     if(shareKey){
       shareKey = decodeURIComponent(shareKey)
-      console.log(shareKey,33333)
+      
     }
     const response = await _getAgent(agentId, shareKey);
     const result = isSuccess(response.status)