split_wrapper.vue 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274
  1. <template>
  2. <div ref="splitContainer" class="split-container">
  3. <div class="panel top-panel">
  4. <div class="room-container-header">
  5. <div class="room-container-header-title">
  6. {{ ' 测试群聊 (29)' }}
  7. </div>
  8. <div class="room-container-header-operate">
  9. <span class="item-margin">
  10. <div class="room-operate">
  11. {{ '房主' }}
  12. <Badge dot status="success" class="badge-right-bottom"></Badge>
  13. </div>
  14. </span>
  15. <span class="item-margin">
  16. <FileSearchOutlined style="font-size: 20px; color: #666667" />
  17. </span>
  18. <span class="item-margin">
  19. <Switch
  20. v-model:checked="state.aiChecked"
  21. checked-children="AI"
  22. un-checked-children="人工"
  23. />
  24. </span>
  25. <span class="item-margin" style="margin-right: 30px">
  26. <EllipsisOutlined style="font-size: 20px; color: #333" />
  27. </span>
  28. </div>
  29. </div>
  30. <!-- 聊天对话区域 -->
  31. <div class="room-container-body">
  32. <div v-show="false" class="chat-roomings-tip-box">
  33. <span style="color: #307ef2;font-size14px;">当前用户正在被人工接待...</span>
  34. <Button class="chat-roomings-tip-btn" size="small">自动回复</Button>
  35. </div>
  36. <div v-show="false" class="room-container-body-messages">
  37. <div class="room-container__loading">
  38. 加载中...
  39. <LoadingOutlined />
  40. </div>
  41. </div>
  42. </div>
  43. </div>
  44. <div class="panel bottom-panel">
  45. <div class="chat-roomings__message">
  46. <div class="send-message">
  47. <div class="editor">
  48. <div class="header">
  49. <div class="left-part">
  50. <div class="img-emo"></div>
  51. <div class="img-file"></div>
  52. <div class="img-link"></div>
  53. <div class="img-text"></div>
  54. <!-- <SmileOutlined />
  55. <FolderOutlined />
  56. <LayoutOutlined /> -->
  57. </div>
  58. <div class="right-part"></div>
  59. </div>
  60. </div>
  61. </div>
  62. </div>
  63. </div>
  64. </div>
  65. </template>
  66. <script lang="ts" setup>
  67. import { onMounted, ref, reactive } from 'vue';
  68. import Split from 'split.js';
  69. import { Popover, Switch, Badge, Button } from 'ant-design-vue';
  70. import { EllipsisOutlined, FileSearchOutlined, LoadingOutlined ,SmileOutlined,FolderOutlined,LayoutOutlined} from '@ant-design/icons-vue';
  71. const splitContainer = ref(null);
  72. const state = reactive({
  73. aiChecked: true,
  74. });
  75. onMounted(() => {
  76. Split([splitContainer.value.children[0], splitContainer.value.children[1]], {
  77. sizes: [55, 45], // 初始高度百分比
  78. minSize: [window.innerHeight * 0.42, window.innerHeight * 0.29], // 每个面板的最小高度
  79. gutterSize: 10, // 分割条的大小
  80. cursor: 'row-resize', // 改变鼠标光标以适应垂直分割
  81. direction: 'vertical', // 设置方向为垂直
  82. gutter: (index, direction) => {
  83. const gutter = document.createElement('div');
  84. gutter.className = `gutter gutter-${direction}`;
  85. return gutter;
  86. },
  87. });
  88. });
  89. </script>
  90. <style scoped lang="less">
  91. .split-container {
  92. display: flex;
  93. flex-direction: column; /* 改为纵向排列 */
  94. height: 100vh;
  95. }
  96. .panel {
  97. overflow: auto;
  98. background-color: #fcfcfc;
  99. // padding: 16px;
  100. }
  101. .top-panel {
  102. // border-bottom: 1px solid #d9d9d9;
  103. }
  104. .bottom-panel {
  105. // border-top: 1px solid #d9d9d9;
  106. }
  107. ::v-deep .gutter {
  108. background-color: transparent; /* 分隔条的背景色 */
  109. position: relative; /* 使用绝对定位调整内部实线 */
  110. z-index: 1; /* 确保分隔条在顶层 */
  111. }
  112. ::v-deep .gutter-vertical {
  113. background: transparent !important; /* 设置背景透明 */
  114. border: none !important; /* 移除边框 */
  115. height: 10px; /* 保持可拖拽区域的高度 */
  116. width: 100%; /* 宽度为100% */
  117. }
  118. ::v-deep .gutter-vertical::before {
  119. content: '';
  120. position: absolute;
  121. top: 4.5px; /* 使实线居中 */
  122. left: 0;
  123. right: 0;
  124. height: 1px; /* 实线的高度 */
  125. background-color: #e4e9f3; /* 实线的颜色 */
  126. z-index: 2; /* 确保实线在分隔条的上层 */
  127. }
  128. .room-container-header {
  129. display: flex;
  130. justify-content: space-between;
  131. align-items: center;
  132. padding: 10px;
  133. border-bottom: 1px solid #ccc;
  134. flex-basis: 51px;
  135. min-height: 51px;
  136. }
  137. .room-container-header-title {
  138. font-weight: 600;
  139. font-size: 14px;
  140. }
  141. .room-container-header-operate {
  142. display: flex;
  143. align-items: center;
  144. cursor: pointer;
  145. }
  146. ::v-deep .ant-switch {
  147. height: 24px;
  148. }
  149. .item-margin {
  150. margin-left: 15px;
  151. }
  152. .room-operate {
  153. border-radius: 50%;
  154. width: 32px;
  155. height: 32px;
  156. display: flex;
  157. align-items: center;
  158. justify-content: center;
  159. background-color: #307ef2;
  160. color: #fff;
  161. position: relative;
  162. font-size: 12px;
  163. }
  164. .badge-right-bottom {
  165. position: absolute; /* 绝对定位 */
  166. bottom: -5px; /* 定位到底部 */
  167. right: -5px; /* 定位到右侧 */
  168. }
  169. ::v-deep .ant-badge.ant-badge-status .ant-badge-status-dot {
  170. width: 7px;
  171. height: 7px;
  172. }
  173. .room-container-body {
  174. position: relative;
  175. flex: 1;
  176. overflow: auto;
  177. display: flex;
  178. flex-direction: column;
  179. padding: 10px 10px 0 10px;
  180. width: 100%;
  181. // background: pink;
  182. height: calc(100% - 53px);
  183. }
  184. .chat-roomings-tip-box {
  185. line-height: 36px;
  186. background: #f1f5fb;
  187. box-shadow: 0 2px 6px 0 rgba(4, 29, 85, 0.14);
  188. text-align: center;
  189. position: absolute;
  190. width: 100%;
  191. top: 0;
  192. left: 0;
  193. z-index: 100;
  194. }
  195. .chat-roomings-tip-btn {
  196. margin-left: 8px;
  197. background: #e0e9fb;
  198. // padding: 7px 15px;
  199. font-size: 12px;
  200. border-radius: 3px;
  201. display: inline-block;
  202. line-height: 1;
  203. white-space: nowrap;
  204. cursor: pointer;
  205. background: #fff;
  206. border: 1px solid #dcdfe6;
  207. border-color: #dcdfe6;
  208. color: #606266;
  209. text-align: center;
  210. box-sizing: border-box;
  211. outline: none;
  212. margin: 0;
  213. transition: 0.1s;
  214. font-weight: 400;
  215. }
  216. .room-container-body-messages {
  217. display: flex;
  218. flex-direction: column;
  219. padding: 10px;
  220. width: 100%;
  221. overflow-y: auto;
  222. flex-grow: 1;
  223. }
  224. .room-container__loading {
  225. height: 44px;
  226. display: flex;
  227. justify-content: center;
  228. align-items: center;
  229. font-size: 14px;
  230. color: #c5c5c5;
  231. margin-bottom: 16px;
  232. }
  233. .chat-roomings__message {
  234. position: relative;
  235. height: 100%;
  236. background: #fff;
  237. }
  238. .send-message {
  239. height: 100%;
  240. background: #fcfcfc;
  241. }
  242. .editor{
  243. position: static;
  244. }
  245. .header{
  246. display: flex;
  247. justify-content: space-between;
  248. align-items: flex-start;
  249. padding: 0 16px 6px 0;
  250. background: #fcfcfc;
  251. margin-top: 15px;
  252. }
  253. .left-part{
  254. display: flex;
  255. }
  256. .img-emo{
  257. width: 18px;
  258. height: 18px;
  259. background-size: contain;
  260. margin: 0 10px;
  261. background-image: url('@/assets/images/icon-emoji.png');
  262. }
  263. </style>