index.vue 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799
  1. <template>
  2. <el-container class="ai-layout">
  3. <!-- 左侧:会话列表 -->
  4. <Conversation :active-id="activeConversationId"
  5. ref="conversationRef"
  6. @onConversationCreate="handleConversationCreate"
  7. @onConversationClick="handleConversationClick"
  8. @onConversationClear="handlerConversationClear"
  9. @onConversationDelete="handlerConversationDelete"
  10. />
  11. <!-- 右侧:会话详情 -->
  12. <el-container class="detail-container">
  13. <!-- 右顶部 TODO 芋艿:右对齐 -->
  14. <el-header class="header">
  15. <div class="title">
  16. {{ activeConversation?.title ? activeConversation?.title : '对话' }}
  17. <span v-if="list.length">({{list.length}})</span>
  18. </div>
  19. <div class="btns" v-if="activeConversation">
  20. <!-- TODO @fan:样式改下;这里我已经改成点击后,弹出了 -->
  21. <el-button type="primary" bg text="plain" size="small" @click="openChatConversationUpdateForm">
  22. <span v-html="activeConversation?.modelName"></span>
  23. <Icon icon="ep:setting" style="margin-left: 10px"/>
  24. </el-button>
  25. <el-button size="small" class="btn" @click="handlerMessageClear">
  26. <img src="@/assets/ai/clear.svg" style="height: 14px;" />
  27. </el-button>
  28. <el-button size="small" :icon="Download" class="btn" />
  29. <el-button size="small" :icon="Top" class="btn" @click="handlerGoTop" />
  30. </div>
  31. </el-header>
  32. <!-- main -->
  33. <el-main class="main-container" >
  34. <div >
  35. <div class="message-container" >
  36. <MessageLoading v-if="listLoading" />
  37. <MessageNewChat v-if="!activeConversation" @on-new-chat="handlerNewChat" />
  38. <ChatEmpty v-if="!listLoading && messageList.length === 0 && activeConversation" @on-prompt="doSend"/>
  39. <Message v-if="!listLoading && messageList.length > 0"
  40. ref="messageRef"
  41. :conversation="activeConversation"
  42. :list="messageList"
  43. @on-delete-success="handlerMessageDelete"
  44. @on-edit="handlerMessageEdit"
  45. @on-refresh="handlerMessageRefresh"/>
  46. </div>
  47. </div>
  48. </el-main>
  49. <!-- 底部 -->
  50. <el-footer class="footer-container">
  51. <form class="prompt-from">
  52. <textarea
  53. class="prompt-input"
  54. v-model="prompt"
  55. @keydown="onSend"
  56. @input="onPromptInput"
  57. @compositionstart="onCompositionstart"
  58. @compositionend="onCompositionend"
  59. placeholder="问我任何问题...(Shift+Enter 换行,按下 Enter 发送)"
  60. ></textarea>
  61. <div class="prompt-btns">
  62. <div>
  63. <el-switch v-model="enableContext" /> <span style="font-size: 14px; color: #8f8f8f;">上下文</span>
  64. </div>
  65. <el-button
  66. type="primary"
  67. size="default"
  68. @click="onSendBtn"
  69. :loading="conversationInProgress"
  70. v-if="conversationInProgress == false"
  71. >
  72. {{ conversationInProgress ? '进行中' : '发送' }}
  73. </el-button>
  74. <el-button
  75. type="danger"
  76. size="default"
  77. @click="stopStream()"
  78. v-if="conversationInProgress == true"
  79. >
  80. 停止
  81. </el-button>
  82. </div>
  83. </form>
  84. </el-footer>
  85. </el-container>
  86. <!-- ========= 额外组件 ========== -->
  87. <!-- 更新对话 form -->
  88. <ChatConversationUpdateForm
  89. ref="chatConversationUpdateFormRef"
  90. @success="handlerTitleSuccess"
  91. />
  92. </el-container>
  93. </template>
  94. <script setup lang="ts">
  95. import Conversation from './Conversation.vue'
  96. import Message from './Message.vue'
  97. import ChatEmpty from './ChatEmpty.vue'
  98. import MessageLoading from './MessageLoading.vue'
  99. import MessageNewChat from './MessageNewChat.vue'
  100. import {ChatMessageApi, ChatMessageVO} from '@/api/ai/chat/message'
  101. import {ChatConversationApi, ChatConversationVO} from '@/api/ai/chat/conversation'
  102. import { getUserProfile, ProfileVO } from '@/api/system/user/profile'
  103. import ChatConversationUpdateForm from "@/views/ai/chat/components/ChatConversationUpdateForm.vue";
  104. import {Download, Top} from "@element-plus/icons-vue";
  105. const route = useRoute() // 路由
  106. const message = useMessage() // 消息弹窗
  107. // ref 属性定义
  108. const activeConversationId = ref<string | null>(null) // 选中的对话编号
  109. const activeConversation = ref<ChatConversationVO | null>(null) // 选中的 Conversation
  110. const conversationInProgress = ref(false) // 对话进行中
  111. const conversationInAbortController = ref<any>() // 对话进行中 abort 控制器(控制 stream 对话)
  112. const inputTimeout = ref<any>() // 处理输入中回车的定时器
  113. const prompt = ref<string>() // prompt
  114. const userInfo = ref<ProfileVO>() // 用户信息
  115. const enableContext = ref<boolean>(true) // 是否开启上下文
  116. const fullText = ref('');
  117. const displayedText = ref('');
  118. const textSpeed = ref<number>(50); // Typing speed in milliseconds
  119. const textRoleRunning = ref<boolean>(false); // Typing speed in milliseconds
  120. // chat message 列表
  121. const list = ref<ChatMessageVO[]>([]) // 列表的数据
  122. const listLoading = ref<boolean>(false) // 是否加载中
  123. const listLoadingTime = ref<any>() // time定时器,如果加载速度很快,就不进入加载中
  124. // 判断 消息列表 滚动的位置(用于判断是否需要滚动到消息最下方)
  125. const messageRef = ref()
  126. const conversationRef = ref()
  127. const isComposing = ref(false) // 判断用户是否在输入
  128. // 默认 role 头像
  129. const defaultRoleAvatar = 'http://test.yudao.iocoder.cn/eaef5f41acb911dd718429a0702dcc3c61160d16e57ba1d543132fab58934f9f.png'
  130. // =========== 自提滚动效果
  131. const textRoll = async () => {
  132. let index = 0;
  133. try {
  134. // 只能执行一次
  135. if (textRoleRunning.value) {
  136. return
  137. }
  138. // 设置状态
  139. textRoleRunning.value = true
  140. displayedText.value = ''
  141. const task = async () => {
  142. // 调整速度
  143. const diff = (fullText.value.length - displayedText.value.length) / 10
  144. if (diff > 5) {
  145. textSpeed.value = 10
  146. } else if (diff > 2) {
  147. textSpeed.value = 30
  148. } else if (diff > 1.5) {
  149. textSpeed.value = 50
  150. } else {
  151. textSpeed.value = 100
  152. }
  153. // 对话结束,就按30的速度
  154. if (!conversationInProgress.value) {
  155. textSpeed.value = 10
  156. }
  157. // console.log('index < fullText.value.length', index < fullText.value.length, conversationInProgress.value)
  158. if (index < fullText.value.length) {
  159. displayedText.value += fullText.value[index];
  160. index++;
  161. // 更新 message
  162. const lastMessage = list.value[list.value.length - 1]
  163. lastMessage.content = displayedText.value
  164. list.value[list.value - 1] = lastMessage
  165. // 滚动到住下面
  166. await scrollToBottom()
  167. // 重新设置任务
  168. timer = setTimeout(task, textSpeed.value);
  169. } else {
  170. // 不是对话中可以结束
  171. if (!conversationInProgress.value) {
  172. textRoleRunning.value = false
  173. clearTimeout(timer);
  174. console.log("字体滚动退出!")
  175. } else {
  176. // 重新设置任务
  177. timer = setTimeout(task, textSpeed.value);
  178. }
  179. }
  180. }
  181. let timer = setTimeout(task, textSpeed.value);
  182. } finally {
  183. }
  184. };
  185. // ============ 处理对话滚动 ==============
  186. function scrollToBottom(isIgnore?: boolean) {
  187. // isIgnore = isIgnore !== null ? isIgnore : false
  188. nextTick(() => {
  189. if (messageRef.value) {
  190. messageRef.value.scrollToBottom(isIgnore)
  191. }
  192. })
  193. }
  194. // ============= 处理聊天输入回车发送 =============
  195. const onCompositionstart = () => {
  196. isComposing.value = true
  197. }
  198. const onCompositionend = () => {
  199. // console.log('输入结束...')
  200. setTimeout(() => {
  201. isComposing.value = false
  202. }, 200)
  203. }
  204. const onPromptInput = (event) => {
  205. // 非输入法 输入设置为 true
  206. if (!isComposing.value) {
  207. // 回车 event data 是 null
  208. if (event.data == null) {
  209. return
  210. }
  211. isComposing.value = true
  212. }
  213. // 清理定时器
  214. if (inputTimeout.value) {
  215. clearTimeout(inputTimeout.value)
  216. }
  217. // 重置定时器
  218. inputTimeout.value = setTimeout(() => {
  219. isComposing.value = false
  220. }, 400)
  221. }
  222. // ============== 对话消息相关 =================
  223. /**
  224. * 发送消息
  225. */
  226. const onSend = async (event) => {
  227. // 判断用户是否在输入
  228. if (isComposing.value) {
  229. return
  230. }
  231. // 进行中不允许发送
  232. if (conversationInProgress.value) {
  233. return
  234. }
  235. const content = prompt.value?.trim() as string
  236. if (event.key === 'Enter') {
  237. if (event.shiftKey) {
  238. // 插入换行
  239. prompt.value += '\r\n';
  240. event.preventDefault(); // 防止默认的换行行为
  241. } else {
  242. // 发送消息
  243. await doSend(content)
  244. event.preventDefault(); // 防止默认的提交行为
  245. }
  246. }
  247. }
  248. const onSendBtn = async () => {
  249. await doSend(prompt.value?.trim() as string)
  250. }
  251. const doSend = async (content: string) => {
  252. if (content.length < 2) {
  253. ElMessage({
  254. message: '请输入内容!',
  255. type: 'error'
  256. })
  257. return
  258. }
  259. if (activeConversationId.value == null) {
  260. ElMessage({
  261. message: '还没创建对话,不能发送!',
  262. type: 'error'
  263. })
  264. return
  265. }
  266. // TODO 芋艿:这块交互要在优化;应该是先插入到 UI 界面,里面会有当前的消息,和正在思考中;之后发起请求;
  267. // 清空输入框
  268. prompt.value = ''
  269. const userMessage = {
  270. conversationId: activeConversationId.value,
  271. content: content
  272. } as ChatMessageVO
  273. // stream
  274. await doSendStream(userMessage)
  275. }
  276. const doSendStream = async (userMessage: ChatMessageVO) => {
  277. // 创建AbortController实例,以便中止请求
  278. conversationInAbortController.value = new AbortController()
  279. // 标记对话进行中
  280. conversationInProgress.value = true
  281. // 设置为空
  282. fullText.value = ''
  283. try {
  284. // 先添加两个假数据,等 stream 返回再替换
  285. list.value.push({
  286. id: -1,
  287. conversationId: activeConversationId.value,
  288. type: 'user',
  289. content: userMessage.content,
  290. userAvatar: userInfo.value?.avatar,
  291. createTime: new Date()
  292. } as ChatMessageVO)
  293. list.value.push({
  294. id: -2,
  295. conversationId: activeConversationId.value,
  296. type: 'system',
  297. content: '思考中...',
  298. roleAvatar: (activeConversation.value as ChatConversationVO).roleAvatar,
  299. createTime: new Date()
  300. } as ChatMessageVO)
  301. // 滚动到最下面
  302. nextTick(async () => {
  303. await scrollToBottom()
  304. })
  305. // 开始滚动
  306. textRoll()
  307. // 发送 event stream
  308. let isFirstMessage = true
  309. ChatMessageApi.sendStream(
  310. userMessage.conversationId, // TODO 芋艿:这里可能要在优化;
  311. userMessage.content,
  312. conversationInAbortController.value,
  313. enableContext.value,
  314. async (message) => {
  315. const data = JSON.parse(message.data) // TODO 芋艿:类型处理;
  316. // 如果内容为空,就不处理。
  317. if (data.receive.content === '') {
  318. return
  319. }
  320. // 首次返回需要添加一个 message 到页面,后面的都是更新
  321. if (isFirstMessage) {
  322. isFirstMessage = false
  323. // 弹出两个 假数据
  324. list.value.pop()
  325. list.value.pop()
  326. // 更新返回的数据
  327. list.value.push(data.send)
  328. list.value.push(data.receive)
  329. }
  330. // debugger
  331. fullText.value = fullText.value + data.receive.content
  332. // 滚动到最下面
  333. await scrollToBottom()
  334. },
  335. (error) => {
  336. console.log('onError')
  337. // 标记对话结束
  338. conversationInProgress.value = false
  339. // 结束 stream 对话
  340. conversationInAbortController.value.abort()
  341. },
  342. () => {
  343. console.log('onClose')
  344. // 标记对话结束
  345. conversationInProgress.value = false
  346. // 结束 stream 对话
  347. conversationInAbortController.value.abort()
  348. }
  349. )
  350. } finally {
  351. }
  352. }
  353. const stopStream = async () => {
  354. console.log('stopStream...')
  355. // tip:如果 stream 进行中的 message,就需要调用 controller 结束
  356. if (conversationInAbortController.value) {
  357. conversationInAbortController.value.abort()
  358. }
  359. // 设置为 false
  360. conversationInProgress.value = false
  361. }
  362. // ============== message 数据 =================
  363. /** 消息列表 */
  364. const messageList = computed(() => {
  365. if (list.value.length > 0) {
  366. return list.value
  367. }
  368. // 没有消息时,如果有 systemMessage 则展示它
  369. // TODO add by 芋艿:这个消息下面,不能有复制、删除按钮
  370. if (activeConversation.value?.systemMessage) {
  371. return [{
  372. id: 0,
  373. type: 'system',
  374. content: activeConversation.value.systemMessage
  375. }]
  376. }
  377. return []
  378. })
  379. /**
  380. * 获取 - message 列表
  381. */
  382. const getMessageList = async () => {
  383. try {
  384. // time 定时器,如果加载速度很快,就不进入加载中
  385. listLoadingTime.value = setTimeout(() => {
  386. listLoading.value = true
  387. }, 60)
  388. if (activeConversationId.value === null) {
  389. return
  390. }
  391. // 获取列表数据
  392. const messageListRes = await ChatMessageApi.messageList(activeConversationId.value)
  393. // 设置用户头像
  394. messageListRes.map(item => {
  395. // 设置 role 默认头像
  396. item.roleAvatar = item.roleAvatar ? item.roleAvatar : defaultRoleAvatar
  397. })
  398. list.value = messageListRes
  399. // 滚动到最下面
  400. await nextTick(() => {
  401. // 滚动到最后
  402. scrollToBottom()
  403. })
  404. } finally {
  405. // time 定时器,如果加载速度很快,就不进入加载中
  406. if (listLoadingTime.value) {
  407. clearTimeout(listLoadingTime.value)
  408. }
  409. // 加载结束
  410. listLoading.value = false
  411. }
  412. }
  413. /** 修改聊天会话 */
  414. const chatConversationUpdateFormRef = ref()
  415. const openChatConversationUpdateForm = async () => {
  416. chatConversationUpdateFormRef.value.open(activeConversationId.value)
  417. }
  418. /**
  419. * 对话 - 标题修改成功
  420. */
  421. const handlerTitleSuccess = async () => {
  422. // TODO 需要刷新 对话列表
  423. await getConversation(activeConversationId.value)
  424. }
  425. /**
  426. * 对话 - 创建
  427. */
  428. const handleConversationCreate = async () => {
  429. // 创建新的对话,清空输入框
  430. prompt.value = ''
  431. }
  432. /**
  433. * 对话 - 点击
  434. */
  435. const handleConversationClick = async (conversation: ChatConversationVO) => {
  436. // 对话进行中,不允许切换
  437. if (conversationInProgress.value) {
  438. await message.alert("对话中,不允许切换!")
  439. return false
  440. }
  441. // 更新选中的对话 id
  442. activeConversationId.value = conversation.id
  443. activeConversation.value = conversation
  444. // 处理进行中的对话
  445. if (conversationInProgress.value) {
  446. await stopStream()
  447. }
  448. // 刷新 message 列表
  449. await getMessageList()
  450. // 滚动底部
  451. scrollToBottom(true)
  452. return true
  453. }
  454. /**
  455. * 对话 - 清理全部对话
  456. */
  457. const handlerConversationClear = async ()=> {
  458. activeConversationId.value = null
  459. activeConversation.value = null
  460. list.value = []
  461. }
  462. /**
  463. * 对话 - 删除
  464. */
  465. const handlerConversationDelete = async (delConversation: ChatConversationVO) => {
  466. // 删除的对话如果是当前选中的,那么久重置
  467. if (activeConversationId.value === delConversation.id) {
  468. await handlerConversationClear()
  469. }
  470. }
  471. /**
  472. * 对话 - 获取
  473. */
  474. const getConversation = async (id: string | null) => {
  475. if (!id) {
  476. return
  477. }
  478. const conversation: ChatConversationVO = await ChatConversationApi.getChatConversationMy(id)
  479. if (conversation) {
  480. activeConversation.value = conversation
  481. activeConversationId.value = conversation.id
  482. }
  483. }
  484. /**
  485. * 对话 - 新建
  486. */
  487. const handlerNewChat = async () => {
  488. // 创建对话
  489. await conversationRef.value.createConversation()
  490. }
  491. // ============ message ===========
  492. /**
  493. * 删除 message
  494. */
  495. const handlerMessageDelete = async () => {
  496. // 刷新 message
  497. await getMessageList()
  498. }
  499. /**
  500. * 编辑 message
  501. */
  502. const handlerMessageEdit = async (message: ChatMessageVO) => {
  503. prompt.value = message.content
  504. }
  505. /**
  506. * 编辑 message
  507. */
  508. const handlerMessageRefresh = async (message: ChatMessageVO) => {
  509. await doSend(message.content)
  510. }
  511. /**
  512. * 回到顶部
  513. */
  514. const handlerGoTop = async () => {
  515. await messageRef.value.handlerGoTop()
  516. }
  517. /**
  518. * message 清除
  519. */
  520. const handlerMessageClear = async () => {
  521. if (!activeConversationId.value) {
  522. return
  523. }
  524. // 确认提示
  525. await message.delConfirm("确认清空对话消息?")
  526. // 清空对话
  527. await ChatMessageApi.deleteByConversationId(activeConversationId.value as string)
  528. // 刷新 message 列表
  529. await getMessageList()
  530. }
  531. /** 初始化 **/
  532. onMounted(async () => {
  533. // 设置当前对话 TODO 角色仓库过来的,自带 conversationId 需要选中
  534. if (route.query.conversationId) {
  535. const id = route.query.conversationId as string
  536. activeConversationId.value = id
  537. await getConversation(id)
  538. }
  539. // 获取列表数据
  540. listLoading.value = true
  541. await getMessageList()
  542. // 获取用户信息
  543. userInfo.value = await getUserProfile()
  544. })
  545. </script>
  546. <style lang="scss" scoped>
  547. .ai-layout {
  548. // TODO @范 这里height不能 100% 先这样临时处理
  549. position: absolute;
  550. flex: 1;
  551. top: 0;
  552. left: 0;
  553. height: 100%;
  554. width: 100%;
  555. }
  556. .conversation-container {
  557. position: relative;
  558. display: flex;
  559. flex-direction: column;
  560. justify-content: space-between;
  561. padding: 0 10px;
  562. padding-top: 10px;
  563. .btn-new-conversation {
  564. padding: 18px 0;
  565. }
  566. .search-input {
  567. margin-top: 20px;
  568. }
  569. .conversation-list {
  570. margin-top: 20px;
  571. .conversation {
  572. display: flex;
  573. flex-direction: row;
  574. justify-content: space-between;
  575. flex: 1;
  576. padding: 0 5px;
  577. margin-top: 10px;
  578. cursor: pointer;
  579. border-radius: 5px;
  580. align-items: center;
  581. line-height: 30px;
  582. &.active {
  583. background-color: #e6e6e6;
  584. .button {
  585. display: inline-block;
  586. }
  587. }
  588. .title-wrapper {
  589. display: flex;
  590. flex-direction: row;
  591. align-items: center;
  592. }
  593. .title {
  594. padding: 5px 10px;
  595. max-width: 220px;
  596. font-size: 14px;
  597. overflow: hidden;
  598. white-space: nowrap;
  599. text-overflow: ellipsis;
  600. }
  601. .avatar {
  602. width: 28px;
  603. height: 28px;
  604. display: flex;
  605. flex-direction: row;
  606. justify-items: center;
  607. }
  608. // 对话编辑、删除
  609. .button-wrapper {
  610. right: 2px;
  611. display: flex;
  612. flex-direction: row;
  613. justify-items: center;
  614. color: #606266;
  615. .el-icon {
  616. margin-right: 5px;
  617. }
  618. }
  619. }
  620. }
  621. // 角色仓库、清空未设置对话
  622. .tool-box {
  623. line-height: 35px;
  624. display: flex;
  625. justify-content: space-between;
  626. align-items: center;
  627. color: var(--el-text-color);
  628. > div {
  629. display: flex;
  630. align-items: center;
  631. color: #606266;
  632. padding: 0;
  633. margin: 0;
  634. cursor: pointer;
  635. > span {
  636. margin-left: 5px;
  637. }
  638. }
  639. }
  640. }
  641. // 头部
  642. .detail-container {
  643. background: #ffffff;
  644. .header {
  645. display: flex;
  646. flex-direction: row;
  647. align-items: center;
  648. justify-content: space-between;
  649. background: #fbfbfb;
  650. box-shadow: 0 0 0 0 #dcdfe6;
  651. .title {
  652. font-size: 18px;
  653. font-weight: bold;
  654. }
  655. .btns {
  656. display: flex;
  657. width: 300px;
  658. flex-direction: row;
  659. justify-content: flex-end;
  660. //justify-content: space-between;
  661. .btn {
  662. padding: 10px;
  663. }
  664. }
  665. }
  666. }
  667. // main 容器
  668. .main-container {
  669. margin: 0;
  670. padding: 0;
  671. position: relative;
  672. height: 100%;
  673. width: 100%;
  674. .message-container {
  675. position: absolute;
  676. top: 0;
  677. bottom: 0;
  678. left: 0;
  679. right: 0;
  680. //width: 100%;
  681. //height: 100%;
  682. overflow-y: hidden;
  683. padding: 0;
  684. margin: 0;
  685. }
  686. }
  687. // 底部
  688. .footer-container {
  689. display: flex;
  690. flex-direction: column;
  691. height: auto;
  692. margin: 0;
  693. padding: 0;
  694. .prompt-from {
  695. display: flex;
  696. flex-direction: column;
  697. height: auto;
  698. border: 1px solid #e3e3e3;
  699. border-radius: 10px;
  700. margin: 10px 20px 20px 20px;
  701. padding: 9px 10px;
  702. }
  703. .prompt-input {
  704. height: 80px;
  705. //box-shadow: none;
  706. border: none;
  707. box-sizing: border-box;
  708. resize: none;
  709. padding: 0px 2px;
  710. //padding: 5px 5px;
  711. overflow: auto;
  712. }
  713. .prompt-input:focus {
  714. outline: none;
  715. }
  716. .prompt-btns {
  717. display: flex;
  718. justify-content: space-between;
  719. padding-bottom: 0px;
  720. padding-top: 5px;
  721. }
  722. }
  723. </style>