فهرست منبع

fix: 企业智能体个人知识库分享控制

王晓东 4 هفته پیش
والد
کامیت
7796e5ba88

+ 4 - 0
src/app.less

@@ -304,6 +304,10 @@
   padding-bottom: constant(safe-area-inset-bottom); /*兼容 IOS<11.2*/
 	padding-bottom: env(safe-area-inset-bottom); /*兼容 IOS>11.2*/
 }
+.bottom-bar-static{
+  .bottom-bar();
+  position: relative;
+}
 
 
 

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

@@ -85,7 +85,7 @@ export default ({agent, isVisitor}: IProps) => {
   const handleDelete = ()=> {
     Taro.hideTabBar();
     showModal({
-      content: <>确删除该智能体?</>,
+      content: <>确删除该智能体?</>,
       onConfirm() {
         confirmDelete()
       }

+ 3 - 2
src/components/BottomBar/index.tsx

@@ -1,11 +1,12 @@
 import { View } from "@tarojs/components";
 interface IProps {
   className?: string
+  isStatic?: boolean
   children: JSX.Element|JSX.Element[]
 }
-const BottomBar = ({className='', children }:IProps) => {
+const BottomBar = ({className='', isStatic=false, children }:IProps) => {
   return (
-    <View className="bottom-bar">
+    <View className={`${isStatic ? 'bottom-bar-static' : 'bottom-bar'}`}>
       <View className={`flex gap-8 px-20 py-12 ${className}`}>
         {children}
       </View>

+ 1 - 1
src/components/chat-message/index.module.less

@@ -53,7 +53,7 @@
 .messageContent{
   font-size: 15px;
   line-height: 28px;
-  word-break: break-all;
+  word-break: break-word;
   font-family: PingFang SC;
 }
 .deepThinkContainer{

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

@@ -27,7 +27,7 @@ const getCanvasSize = () => {
   // 设计宽度是 210*170 ,实际需要放大到 占满屏宽 375 * 300
   const designWidth = 375;
   const designHeight = 300;
-  
+
   // 为了清晰度,宽高放大一倍
   const canvasWidth = screenWidth * 2;
   const canvasHeight = (screenWidth / designWidth) * designHeight * 2;
@@ -50,13 +50,13 @@ export default (props: Props) => {
   const { canvasWidth, canvasHeight, ratio } = getCanvasSize();
   const isLogin = useIsLogin()
   let stage: Stage|null;
-  
+
   // character = useCurrentCharacter
   const agent = props.agent
   const initCanvas = async () => {
     // console.log('share:', character)
     if(!agent){
-      return 
+      return
     }
     const app = new Application(
       "#myShareCanvas",
@@ -69,7 +69,7 @@ export default (props: Props) => {
     }
 
     let avatarImg = agent.avatarLogo ?? DEFAULT_AVATAR_SHARE_BG
-    
+
     stage.backgroundColor = 'white'
 
     // 如果有头像,加载头像图片先
@@ -83,10 +83,10 @@ export default (props: Props) => {
         src: 'https://cdn.wehome.cn/cmn/png/221/META-H8UKXHWU-X0WXBKY1C0G0QA1DIH762-NSP5OMEM-IK.png',
       },
     ]
-    
+
     const loader = new ImgLoader(stage.canvas, imgArr);
     await loader.load();
-    
+
 
     // 头像
     const avatarTexture = loader.get("avatar");
@@ -96,9 +96,9 @@ export default (props: Props) => {
       dHeight: (canvasWidth / avatarTexture.width) * avatarTexture.height,
     });
     // 如果有头像,则需要上提,以显示出头像,如果是默认图则无需上提
-    if(agent.avatarLogo){
-      avatar.y = -56 * ratio;
-    }
+    // if(agent.avatarLogo){
+    //   avatar.y = ;
+    // }
     const avatarWrapper = new Container()
     avatarWrapper.width = canvasWidth
     avatarWrapper.height = 100
@@ -106,10 +106,10 @@ export default (props: Props) => {
     avatarWrapper.addChild(avatar)
     stage.addChild(avatar)
 
-    
+
     const blurBgTexture = loader.get("blurBg");
-    
-    
+
+
     // 毛玻璃背景
     const dHeight = 56 * ratio
     const blurBg = new DuduImage({
@@ -158,17 +158,17 @@ export default (props: Props) => {
       companyName.color = "rgba(17,17,17, .65)";
       infoList.addChild(companyName);
     }
-    
+
     stage.addChild(infoList)
-    
-    
+
+
     stage.update();
   };
 
 
   // 您好,这是xxx的智能体主页!
   const shareTitle = '快和我的智能体聊聊吧' // '想了解我?快和我的AI聊聊吧',
-  
+
   useShareAppMessage(async () => {
     const agentId = agent?.agentId;
     const path = `/pages/profile/index?agentId=${agentId}`
@@ -194,7 +194,7 @@ export default (props: Props) => {
       }
     }
     const reponse = await getSharePromise(agentId, shareTitle, tmpImage)
-    
+
     return reponse;
   });
 

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

@@ -72,7 +72,7 @@ export default function Index() {
       return
     }
     showModal({
-      content: <>确删除该形象?</>,
+      content: <>确删除该形象?</>,
       async onConfirm() {
         const response = await deleteAvatar(current.avatarId);
         if (isSuccess(response.status)) {

+ 4 - 15
src/pages/agent/components/AgentSetting/components/AgentKnowledgeLib/index.tsx

@@ -3,26 +3,15 @@ import CardList from "@/components/list/card-list";
 import CardListItem from "@/components/list/card-list-item";
 import WemetaSwitch from "@/components/WemetaSwitch";
 
-import IconArrow from "@/components/icon/icon-arrow";
-
 import IconPageColor from "@/components/icon/icon-page-color";
-import Taro from "@tarojs/taro";
+
 import { useAgentStore, useAgentStoreActions } from "@/store/agentStore";
 
 export default function Index() {
-  const agentEdit = useAgentStore((state) => state.agentEdit);
-  const agentCharacter = useAgentStore((state) => state.agentCharacter);
-  const { editAgentCharacter, fetchAgent } = useAgentStoreActions();
+  const agentEdit = useAgentStore((state)=> state.agentEdit);
+  const { updateEditAgent } = useAgentStoreActions();
   const handleSwitchChange = async (checked: boolean) => {
-    if (!agentEdit?.agentId || !agentCharacter) {
-      return;
-    }
-
-    await editAgentCharacter(agentEdit.agentId, {
-      ...agentCharacter,
-      enabledPersonalKb: checked,
-    });
-    fetchAgent(agentEdit.agentId);
+    updateEditAgent({enabledPersonalKb: checked });
   };
 
 

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

@@ -84,7 +84,7 @@ export default function Index() {
 
   const handleDelete = (contactId: string | number) => {
     Taro.showModal({
-      content: "😭 确删除该联系人吗?",
+      content: "😭 确删除该联系人吗?",
       async success(result) {
         if (result.confirm) {
           const response = await delContact(contactId);

+ 5 - 3
src/pages/editor-contact/index.tsx

@@ -80,8 +80,8 @@ export default function Index() {
 
   return (
     <PageCustom>
-      <NavBarNormal backText="数字名片"></NavBarNormal>
-      <View className="p-16 w-full pb-126">
+      <NavBarNormal>名片信息</NavBarNormal>
+      <View className="p-16 w-full">
         <View className="flex flex-col gap-16 w-full">
           <View className="flex flex-col gap-6">
             <View className={style.label}>姓名 <Text className="text-red leading-22 text-14">*</Text> </View>
@@ -129,6 +129,7 @@ export default function Index() {
                 onBlur={(value) => handleFieldChange('mobile', value)}
                 onInput={(value) => handleFieldChange('mobile', value)}
                 placeholderStyle="color: rgba(17,17,17,.25)"
+                cursorSpacing={40}
                 placeholder="请输入手机号"
               />
             </View>
@@ -141,6 +142,7 @@ export default function Index() {
                 onBlur={(value) => handleFieldChange('email', value)}
                 onInput={(value) => handleFieldChange('email', value)}
                 placeholderStyle="color: rgba(17,17,17,.25)"
+                cursorSpacing={40}
                 placeholder="请输入联系邮箱"
               />
             </View>
@@ -182,7 +184,7 @@ export default function Index() {
         </View>
       </View>
 
-      <BottomBar>
+      <BottomBar isStatic>
         <WemetaButton disabled={disabled} className="flex-1" onClick={handleSave}>保存</WemetaButton>
       </BottomBar>
     </PageCustom>

+ 1 - 1
src/pages/knowledge-item/index.tsx

@@ -92,7 +92,7 @@ export default function Index() {
       return;
     }
     showModal({
-      content: "确删除文件及其全部知识?",
+      content: "确删除文件及其全部知识?",
       onConfirm: async () => {
         const { status } = await deleteMyKnowledge(detail.knowledgeId);
         if (isSuccess(status)) {

+ 1 - 1
src/pages/knowledge/components/PersonalTab/components/ScrollList.tsx

@@ -70,7 +70,7 @@ const Index = ({ types, setTotalCount }: IProps) => {
 
   const handleDelete = async (id: string | number) => {
     Taro.showModal({
-      content: "确删除该知识?",
+      content: "确删除该知识?",
       async success(result) {
         if (result.confirm) {
           const response = await deleteMyKnowledge(id);

+ 1 - 1
src/pages/knowledge/components/PersonalTab/components/ScrollListChat.tsx

@@ -82,7 +82,7 @@ const Index = ({assistantOnly, setTotalCount}: IProps) => {
 
   const handleLongPress = async (streamId: string|number)=> {
     Taro.showModal({
-      content: "确删除该知识?",
+      content: "确删除该知识?",
       async success(result) {
         if (result.confirm) {
           const response = await deleteMyKnowledgeStream(streamId);

+ 1 - 1
src/pages/voice/components/MyVoiceList/index.tsx

@@ -121,7 +121,7 @@ export default ({ onPlay, onSelect, agent }: Props) => {
       return;
     }
     showModal({
-      content: "确删除该声音?",
+      content: "确删除该声音?",
       onConfirm: async () => {
         const response = await deleteVoice(item.voiceId);
         if (isSuccess(response.status)) {