feat: 暂存,添加app-manager

This commit is contained in:
2024-10-04 23:06:56 +08:00
parent 969243cbbb
commit 272ceaa6a6
9 changed files with 227 additions and 2 deletions

View File

@@ -2,7 +2,7 @@ import { useShallow } from 'zustand/react/shallow';
import { useAiStore } from './store/ai-store';
import { CloseOutlined, HistoryOutlined, PlusOutlined } from '@ant-design/icons';
import { Button, Dropdown, Form, Input, message, Modal, Tooltip } from 'antd';
import { useEffect, useState } from 'react';
import { useEffect, useMemo, useState } from 'react';
import { TextArea } from '../container/components/TextArea';
import clsx from 'clsx';
import { query } from '@/modules';
@@ -221,7 +221,11 @@ export const AiMoudle = () => {
const onSendNoPrompt = (value) => {
send({ type: 'messages', data: { message: value, root: true } });
};
const inputs = form.getFieldValue('inputs');
const inputs = useMemo(() => {
if (!aiStore.open) return [];
const inputs = form.getFieldValue('inputs');
return inputs;
}, [aiStore.open]);
const isNotShow = inputs?.length === 0 || !inputs;
const OnlyNormalMessage = (
<Tooltip title='不需要任何预设prompt'>