index.vue 21 KB

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