diff --git a/DigitalHumanWeb/src/app/(main)/@nav/_layout/Desktop/Avatar.tsx b/DigitalHumanWeb/src/app/(main)/@nav/_layout/Desktop/Avatar.tsx index 09fe443..723370c 100644 --- a/DigitalHumanWeb/src/app/(main)/@nav/_layout/Desktop/Avatar.tsx +++ b/DigitalHumanWeb/src/app/(main)/@nav/_layout/Desktop/Avatar.tsx @@ -1,29 +1,13 @@ -import { ActionIcon } from '@lobehub/ui'; -import {Image, Tooltip} from 'antd'; -import { LucideX } from 'lucide-react'; +import {Image} from 'antd'; import { memo } from 'react'; -import { useTranslation } from 'react-i18next'; import { Flexbox } from 'react-layout-kit'; - -import UserAvatar from '@/features/User/UserAvatar'; -import UserPanel from '@/features/User/UserPanel'; -import { useUserStore } from '@/store/user'; -import { preferenceSelectors } from '@/store/user/selectors'; +// import UserAvatar from '@/features/User/UserAvatar'; +// import UserPanel from '@/features/User/UserPanel'; const Avatar = memo(() => { - const { t } = useTranslation('common'); - const hideSettingsMoveGuide = useUserStore(preferenceSelectors.hideSettingsMoveGuide); - const updateGuideState = useUserStore((s) => s.updateGuideState); - const content = ( - - - - ); return ( - <> {""} - ) }); diff --git a/DigitalHumanWeb/src/app/(main)/@nav/_layout/Desktop/TopActions.tsx b/DigitalHumanWeb/src/app/(main)/@nav/_layout/Desktop/TopActions.tsx index d2e6fd5..46cf716 100644 --- a/DigitalHumanWeb/src/app/(main)/@nav/_layout/Desktop/TopActions.tsx +++ b/DigitalHumanWeb/src/app/(main)/@nav/_layout/Desktop/TopActions.tsx @@ -1,7 +1,7 @@ -import { ActionIcon } from '@lobehub/ui'; -import { Compass, FolderClosed, MessageSquare } from 'lucide-react'; +// import { ActionIcon } from '@lobehub/ui'; +// import { Compass, FolderClosed, MessageSquare } from 'lucide-react'; import Link from 'next/link'; -import {memo, useEffect, useState} from 'react'; +import {memo, useState} from 'react'; import { useTranslation } from 'react-i18next'; import { useGlobalStore } from '@/store/global'; @@ -10,17 +10,20 @@ import { featureFlagsSelectors, useServerConfigStore } from '@/store/serverConfi import { useSessionStore } from '@/store/session'; import { useUserStore } from '@/store/user'; import { createStyles } from 'antd-style'; -import {Button, Image} from "antd"; +import { Image } from "antd"; -const useStyles = createStyles(({ css, token }) => ({ +const useStyles = createStyles(({ css }) => ({ + iconImg: css` + width: 48px; + height: 48px; + `, iconText: css` text-align: center; color: #fff; `, - iconImg: css` - width: 48px; - height: 48px; + iconSelectText: css` + color: #0044FF; `, linkUrl: css` width: 100%; @@ -29,34 +32,26 @@ const useStyles = createStyles(({ css, token }) => ({ linkclic: css` background-color: #fff; `, - iconSelectText: css` - color: #0044FF; - `, })); export interface TopActionProps { tab?: SidebarTabKey; } - -const TopActions = memo(({ tab }) => { +const getUserId = (s) => s.user?.id +const TopActions = memo(() => { const { t } = useTranslation('common'); const switchBackToChat = useGlobalStore((s) => s.switchBackToChat); const { showMarket, enableKnowledgeBase } = useServerConfigStore(featureFlagsSelectors); const { styles, cx } = useStyles() const [value, setValue] = useState("chat") - const getUserId = (s: UserStore) => s.user?.id const userId = getUserId(useUserStore.getState()) console.log(userId,'3837373266262266') - const testFuc = (s: UserStore) => { - console.log(s,'999999999') - } - testFuc(useUserStore.getState()) return ( -
+
{ e.preventDefault(); setValue("/chat") @@ -65,48 +60,48 @@ const TopActions = memo(({ tab }) => { }} > {"chat"} -
会话
+
会话
{enableKnowledgeBase && ( - {setValue("/discover/assistants"); window.localStorage.setItem("nowChat", "")}}> + {setValue("/discover/assistants"); window.localStorage.setItem("nowChat", "")}}> {"files"} -
助手
+
助手
)} {showMarket && ( - {setValue("/files"); window.localStorage.setItem("nowChat", "")}}> + {setValue("/files"); window.localStorage.setItem("nowChat", "")}}> {"discover"} -
工具
+
工具
)} {showMarket && ( - {setValue("/model"); window.localStorage.setItem("nowChat", "")}}> + {setValue("/model"); window.localStorage.setItem("nowChat", "")}}> {"model"} -
模型
+
模型
)} {showMarket && ( - {setValue("/robot"); window.localStorage.setItem("nowChat", "")}}> + {setValue("/robot"); window.localStorage.setItem("nowChat", "")}}> {"robot"} -
数字人
+
数字人
)} {showMarket && ( - {setValue("/plugins"); window.localStorage.setItem("nowChat", "")}}> + {setValue("/plugins"); window.localStorage.setItem("nowChat", "")}}> {"plugins"} -
插件
+
插件
)} {showMarket && ( - {setValue("/power"); window.localStorage.setItem("nowChat", "")}}> + {setValue("/power"); window.localStorage.setItem("nowChat", "")}}> {"power"} -
算力
+
算力
)} {showMarket && ( - {setValue("/knowledge")}}> + {setValue("/knowledge")}}> -
知识库
+
知识库
)}
diff --git a/DigitalHumanWeb/src/app/(main)/@nav/_layout/Desktop/index.tsx b/DigitalHumanWeb/src/app/(main)/@nav/_layout/Desktop/index.tsx index 1efeaa6..405fb39 100644 --- a/DigitalHumanWeb/src/app/(main)/@nav/_layout/Desktop/index.tsx +++ b/DigitalHumanWeb/src/app/(main)/@nav/_layout/Desktop/index.tsx @@ -6,7 +6,6 @@ import { memo } from 'react'; import { useActiveTabKey } from '@/hooks/useActiveTabKey'; import Avatar from './Avatar'; -import BottomActions from './BottomActions'; import TopActions from './TopActions'; const Nav = memo(() => { @@ -14,8 +13,8 @@ const Nav = memo(() => { return ( } - // bottomActions={} - style={{ height: '100%', zIndex: 100, width: '100px', backgroundColor: '#2E62FF' }} + bottomActions={<>} + style={{ backgroundColor: '#2E62FF', height: '100%', width: '100px', zIndex: 100 }} topActions={} /> ); diff --git a/DigitalHumanWeb/src/app/(main)/chat/(workspace)/@conversation/default.tsx b/DigitalHumanWeb/src/app/(main)/chat/(workspace)/@conversation/default.tsx index 70fb8e9..df628c2 100644 --- a/DigitalHumanWeb/src/app/(main)/chat/(workspace)/@conversation/default.tsx +++ b/DigitalHumanWeb/src/app/(main)/chat/(workspace)/@conversation/default.tsx @@ -15,9 +15,9 @@ const ChatConversation = () => { -
+
文字输入快捷键提示: - + 键 发送 键 + Ctrl 键 换行 diff --git a/DigitalHumanWeb/src/app/(main)/chat/(workspace)/@conversation/features/ChatInput/Desktop/Footer/index.tsx b/DigitalHumanWeb/src/app/(main)/chat/(workspace)/@conversation/features/ChatInput/Desktop/Footer/index.tsx index ff76189..2aa9f24 100644 --- a/DigitalHumanWeb/src/app/(main)/chat/(workspace)/@conversation/features/ChatInput/Desktop/Footer/index.tsx +++ b/DigitalHumanWeb/src/app/(main)/chat/(workspace)/@conversation/features/ChatInput/Desktop/Footer/index.tsx @@ -1,23 +1,23 @@ -import { Icon } from '@lobehub/ui'; -import { Button, Skeleton, Space } from 'antd'; +// import { Icon } from '@lobehub/ui'; +import { Button, Space } from 'antd'; import { createStyles } from 'antd-style'; -import { ChevronUp, CornerDownLeft, LucideCommand, Eraser } from 'lucide-react'; +// import { ChevronUp, CornerDownLeft, LucideCommand } from 'lucide-react'; import { rgba } from 'polished'; -import { memo, useEffect, useState } from 'react'; +import { memo } from 'react'; import { useTranslation } from 'react-i18next'; -import { Center, Flexbox } from 'react-layout-kit'; +import { Flexbox } from 'react-layout-kit'; import StopLoadingIcon from '@/components/StopLoading'; -import SaveTopic from '@/features/ChatInput/Topic'; +// import SaveTopic from '@/features/ChatInput/Topic'; import { useSendMessage } from '@/features/ChatInput/useSend'; import { useChatStore } from '@/store/chat'; import { chatSelectors } from '@/store/chat/selectors'; -import { useUserStore } from '@/store/user'; -import { preferenceSelectors } from '@/store/user/selectors'; -import { isMacOS } from '@/utils/platform'; +// import { useUserStore } from '@/store/user'; +// import { preferenceSelectors } from '@/store/user/selectors'; +// import { isMacOS } from '@/utils/platform'; -import LocalFiles from '../FilePreview'; -import SendMore from './SendMore'; +// import LocalFiles from '../FilePreview'; +// import SendMore from './SendMore'; import {HighlightOutlined, SendOutlined} from "@ant-design/icons"; const useStyles = createStyles(({ css, prefixCls, token }) => { @@ -27,10 +27,6 @@ const useStyles = createStyles(({ css, prefixCls, token }) => { width: 28px; } `, - btnDiv: css` - height: 50%; - width: 100px; - `, btn: css` width: 96px; height: 80%; @@ -39,6 +35,10 @@ const useStyles = createStyles(({ css, prefixCls, token }) => { color: #2E62FF !important; font-size: 16px; `, + btnDiv: css` + height: 50%; + width: 100px; + `, btnSend: css` width: 96px; height: 80%; @@ -77,47 +77,47 @@ interface FooterProps { setExpand?: (expand: boolean) => void; } -const Footer = memo(({ setExpand, expand, clearClick }) => { +const Footer = memo(({ clearClick, setExpand }) => { const { t } = useTranslation('chat'); - const { theme, styles } = useStyles(); + const { styles } = useStyles(); const [isAIGenerating, stopGenerateMessage] = useChatStore((s) => [ chatSelectors.isAIGenerating(s), s.stopGenerateMessage, ]); - const [useCmdEnterToSend] = useUserStore((s) => [preferenceSelectors.useCmdEnterToSend(s)]); + // const [useCmdEnterToSend] = useUserStore((s) => [preferenceSelectors.useCmdEnterToSend(s)]); const { send: sendMessage, canSend } = useSendMessage(); - const [isMac, setIsMac] = useState(); - useEffect(() => { - setIsMac(isMacOS()); - }, [setIsMac]); - - const cmdEnter = ( - - {typeof isMac === 'boolean' ? ( - - ) : ( - - {' '} - - )} - - - ); - - const enter = ( -
- -
- ); - - const sendShortcut = useCmdEnterToSend ? cmdEnter : enter; - - const wrapperShortcut = useCmdEnterToSend ? enter : cmdEnter; + // const [isMac, setIsMac] = useState(); + // useEffect(() => { + // setIsMac(isMacOS()); + // }, [setIsMac]); + + // const cmdEnter = ( + // + // {typeof isMac === 'boolean' ? ( + // + // ) : ( + // + // {' '} + // + // )} + // + // + // ); + + // const enter = ( + //
+ // + //
+ // ); + + // const sendShortcut = useCmdEnterToSend ? cmdEnter : enter; + + // const wrapperShortcut = useCmdEnterToSend ? enter : cmdEnter; const handleClickClear = () => { clearClick() @@ -127,12 +127,12 @@ const Footer = memo(({ setExpand, expand, clearClick }) => { {/**/} {/* {expand && }*/} diff --git a/DigitalHumanWeb/src/app/(main)/chat/(workspace)/@conversation/features/ChatInput/Desktop/index.tsx b/DigitalHumanWeb/src/app/(main)/chat/(workspace)/@conversation/features/ChatInput/Desktop/index.tsx index 0987dda..945ea55 100644 --- a/DigitalHumanWeb/src/app/(main)/chat/(workspace)/@conversation/features/ChatInput/Desktop/index.tsx +++ b/DigitalHumanWeb/src/app/(main)/chat/(workspace)/@conversation/features/ChatInput/Desktop/index.tsx @@ -8,7 +8,6 @@ import { CHAT_TEXTAREA_HEIGHT, CHAT_TEXTAREA_MAX_HEIGHT, HEADER_HEIGHT, - CHAT_TEXTAREA_MIN_HEIGHT, } from '@/const/layoutTokens'; import { useGlobalStore } from '@/store/global'; import { systemStatusSelectors } from '@/store/global/selectors'; @@ -59,9 +58,9 @@ const DesktopChatInput = memo(() => { style={{ minHeight: CHAT_TEXTAREA_HEIGHT, position: 'relative' }} > -
+