index.vue 21 KB

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