index.vue 21 KB

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