common_chat.vue 39 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987
  1. <!-- 聊天记录 -->
  2. <template>
  3. <div class="common_chat-wrapper">
  4. <div class="common_chat-inner">
  5. <!-- 聊天记录 -->
  6. <div class="common_chat-main" id="common_chat_main" ref="common_chat_main">
  7. <div class="common_chat-main-content">
  8. <div class="inner">
  9. <div v-for="(item ,index) in chatInfoEn.msgList" :key="index">
  10. <!-- 系统消息 -->
  11. <div v-if="item.role=='sys'" class="item sys">
  12. <!-- 1)文本类型 -->
  13. <div v-if="item.contentType=='text'" class="text-content">
  14. <p>{{item.content}}</p>
  15. </div>
  16. </div>
  17. <!-- 客户、客服 -->
  18. <div
  19. v-else
  20. class="item"
  21. :class="{ sender: item.role == oprRoleName, receiver: item.role != oprRoleName }"
  22. >
  23. <div class="info-wrapper" :class="item.state">
  24. <!-- 头像 -->
  25. <div class="avatar-wrapper">
  26. <img class="kf-img" :src="item.avatarUrl" />
  27. </div>
  28. <!-- 1)文本类型 -->
  29. <div
  30. v-if="item.contentType=='text'"
  31. class="item-content common_chat_emoji-wrapper-global"
  32. >
  33. <p class="text" v-html="getqqemojiEmoji(item.content)"></p>
  34. </div>
  35. <!-- 2)图片类型 -->
  36. <div v-else-if="item.contentType=='image'" class="item-content">
  37. <img class="img" :src="item.fileUrl" @click="imgViewDialog_show(item)" />
  38. </div>
  39. <!-- 3)文件类型 -->
  40. <div v-else-if="item.contentType=='file'" class="item-content">
  41. <div class="file">
  42. <i class="file-icon iconfont fa fa-file"></i>
  43. <div class="file-info">
  44. <p class="file-name">{{getFileName(item.fileName)}}</p>
  45. <div class="file-opr">
  46. <div v-show="item.state=='success'">
  47. <a
  48. class="file-download"
  49. :href="item.fileUrl"
  50. target="_blank"
  51. :download="item.fileUrl"
  52. >下载</a>
  53. </div>
  54. </div>
  55. </div>
  56. </div>
  57. </div>
  58. <!-- 4)文本类型 -->
  59. <div
  60. v-if="item.contentType=='transformServer'"
  61. class="item-content common_chat_emoji-wrapper-global"
  62. >
  63. <p class="text">
  64. 当前没有配置机器人,
  65. <el-button type="text" @click="chatCallback('transformServer')">转接客服</el-button>
  66. </p>
  67. </div>
  68. </div>
  69. </div>
  70. </div>
  71. </div>
  72. </div>
  73. </div>
  74. <!-- 底部区域 -->
  75. <div class="common_chat-footer">
  76. <div>
  77. <!-- 表情、文件选择等操作 -->
  78. <div class="opr-wrapper">
  79. <common-chat-emoji class="item" ref="qqemoji" @select="qqemoji_selectFace"></common-chat-emoji>
  80. <a class="item" href="javascript:void(0)" @click="fileUpload_click('file')">
  81. <i class="iconfont fa fa-file-o"></i>
  82. </a>
  83. <form method="post" enctype="multipart/form-data">
  84. <input
  85. type="file"
  86. name="uploadFile"
  87. id="common_chat_opr_fileUpload"
  88. style="display:none;position:absolute;left:0;top:0;width:0%;height:0%;opacity:0;"
  89. />
  90. </form>
  91. </div>
  92. <!-- 聊天输入框 -->
  93. <div class="input-wrapper">
  94. <div
  95. maxlength="500"
  96. class="inputContent common_chat_emoji-wrapper-global"
  97. id="common_chat_input"
  98. contenteditable="true"
  99. @paste.stop="inputContent_paste"
  100. @drop="inputContent_drop"
  101. @keydown="inputContent_keydown"
  102. @mouseup="inputContent_mouseup"
  103. ></div>
  104. <!-- @mouseleave="inputContent_mouseup" -->
  105. </div>
  106. <!-- 发送按钮 -->
  107. <el-button
  108. type="primary"
  109. size="small"
  110. class="send-btn"
  111. :class="chatInfoEn.state"
  112. @click="sendText()"
  113. :disabled="chatInfoEn.inputContent.length==0"
  114. >发送</el-button>
  115. </div>
  116. <!-- 离线 -->
  117. <div v-show="chatInfoEn.state=='off' || chatInfoEn.state=='end'" class="off-wrapper">
  118. <span class="content">会话已经结束</span>
  119. </div>
  120. </div>
  121. </div>
  122. <!-- 图片查看dialog -->
  123. <el-dialog title :visible.sync="imgViewDialogVisible" class="imgView-dialog" :modal="false">
  124. <div class="header">
  125. <i class="iconfont fa fa-remove" @click="imgViewDialog_close"></i>
  126. </div>
  127. <div class="main">
  128. <img class="img" :src="imgViewDialog_imgSrc" />
  129. </div>
  130. </el-dialog>
  131. </div>
  132. </template>
  133. <script>
  134. import common_chat_emoji from './common_chat_emoji.vue';
  135. export default {
  136. components: {
  137. commonChatEmoji: common_chat_emoji
  138. },
  139. props: {
  140. chatInfoEn: {
  141. required: true,
  142. type: Object,
  143. default: {
  144. inputContent: '',
  145. msgList: []
  146. }
  147. },
  148. oprRoleName: {
  149. required: true,
  150. type: String,
  151. default: ''
  152. } // 操作者名称;e.g. server:服务端、client:客服端
  153. },
  154. data() {
  155. return {
  156. inputContent_setTimeout: null, // 输入文字时在输入结束才修改具体内容
  157. selectionRange: null, // 输入框选中的区域
  158. shortcutMsgList: [], // 聊天区域的快捷回复列表
  159. imgViewDialogVisible: false, // 图片查看dialog的显示
  160. imgViewDialog_imgSrc: '' // 图片查看dialog的图片地址
  161. };
  162. },
  163. computed: {},
  164. watch: {},
  165. methods: {
  166. /**
  167. * 初始化
  168. * @param {Object} opts 可选对象
  169. */
  170. init: function(opts) {
  171. var self = this;
  172. // 初始化状态
  173. document.getElementById('common_chat_input').innerHTML = '';
  174. self.$refs.qqemoji.$data.faceHidden = true;
  175. // 在线状态
  176. if (this.chatInfoEn.state == 'on') {
  177. // 1.显示在输入框的内容
  178. setTimeout(function() {
  179. // 未断开获取焦点
  180. document.getElementById('common_chat_input').focus();
  181. self.setInputContentSelectRange();
  182. // 设置之前保存的输入框内容
  183. if (self.chatInfoEn.inputContent) {
  184. self.setInputDiv(self.chatInfoEn.inputContent);
  185. }
  186. }, 200);
  187. } else {
  188. document.getElementById('common_chat_input').blur();
  189. }
  190. // 2.滚动到底部
  191. this.$nextTick(function() {
  192. self.$refs.common_chat_main.scrollTop = self.$refs.common_chat_main.scrollHeight;
  193. document.getElementById('common_chat_input').focus();
  194. });
  195. },
  196. /**
  197. * 发送文本
  198. */
  199. sendText: function() {
  200. var self = this;
  201. if (self.chatInfoEn.inputContent.length == '') {
  202. return;
  203. }
  204. var msgContent = self.chatInfoEn.inputContent;
  205. document.getElementById('common_chat_input').innerHTML = '';
  206. self.setInputContentByDiv();
  207. this.sendMsg({
  208. contentType: 'text',
  209. content: msgContent
  210. });
  211. },
  212. /**
  213. * 设置输入内容
  214. * 根据input输入框innerHTML转换为纯文本
  215. */
  216. setInputContentByDiv: function() {
  217. var self = this;
  218. var htmlStr = document.getElementById('common_chat_input').innerHTML;
  219. // 1.转换表情为纯文本:<img textanme="[笑]"/> => [笑]
  220. var tmpInputContent = htmlStr.replace(/<img.+text=\"(.+?)\".+>/g, '[$1]').replace(/<.+?>/g, '');
  221. // 2.设置最长长度
  222. if (tmpInputContent.length > 500) {
  223. document.getElementById('common_chat_input').innerHTML = '';
  224. var value = tmpInputContent.substr(0, 499).replace(/\[(.+?)\]/g, function(item, value) {
  225. return self.$refs.qqemoji.getImgByFaceName(value);
  226. });
  227. this.setInputDiv(value);
  228. }
  229. // 3.修改store
  230. this.chatInfoEn.inputContent = tmpInputContent;
  231. },
  232. /**
  233. * 设置input输入框内容
  234. * @param {String} vlaue 设置的值
  235. */
  236. setInputDiv: function(value) {
  237. if (this.$data.selectionRange == null) {
  238. document.getElementById('common_chat_input').focus();
  239. return;
  240. }
  241. // 1.设置selectionRange
  242. if (window.getSelection) {
  243. window.getSelection().removeAllRanges();
  244. window.getSelection().addRange(this.$data.selectionRange);
  245. } else {
  246. this.$data.selectionRange && this.$data.selectionRange.select();
  247. }
  248. // 2.表情转换为img
  249. value = this.getqqemojiEmoji(value);
  250. // 3.聊天框中是否选中了文本,若选中文本将被替换成输入内容
  251. if (window.getSelection) {
  252. var sel, range;
  253. // IE9 and non-IE
  254. sel = window.getSelection();
  255. if (sel.getRangeAt && sel.rangeCount) {
  256. // 1)删除选中的文本(内容)
  257. range = sel.getRangeAt(0); // 获取鼠标选中的文本区域
  258. range.deleteContents(); // 删除选中的文本
  259. // 2)创建以输入内容为内容的DocumentFragment
  260. var elemnet;
  261. if (range.createContextualFragment) {
  262. elemnet = range.createContextualFragment(value);
  263. } else {
  264. // 以下代码等同createContextualFragment
  265. // 创建一个DocumentFragment
  266. elemnet = document.createDocumentFragment();
  267. var divEl = document.createElement('div');
  268. divEl.innerHTML = value;
  269. // divEl下的元素,依次插入到DocumentFragment
  270. for (let i = 0, len = divEl.children.length; i < len; i++) {
  271. elemnet.appendChild(divEl.firstChild);
  272. }
  273. }
  274. // 3)选中文本的位置替换为新输入的内容,并把光标定位到新内容后方
  275. var lastNode = elemnet.lastChild;
  276. range.insertNode(elemnet);
  277. range.setStartAfter(lastNode);
  278. sel.removeAllRanges();
  279. sel.addRange(range);
  280. }
  281. } else if (document.selection && document.selection.type != 'Control') {
  282. // IE < 9
  283. document.selection.createRange().pasteHTML(imgStr);
  284. }
  285. // 4.修改inputContent
  286. this.setInputContentByDiv();
  287. },
  288. /**
  289. * 转换为QQ表情
  290. */
  291. getqqemojiEmoji: function(value) {
  292. if (value == undefined) {
  293. return;
  294. }
  295. var self = this;
  296. return value.replace(/\[(.+?)\]/g, function(item, value) {
  297. return self.$refs.qqemoji.getImgByFaceName(value);
  298. });
  299. },
  300. /**
  301. * 设置input输入框的选择焦点
  302. */
  303. setInputContentSelectRange: function() {
  304. if (window.getSelection && window.getSelection().rangeCount > 0) {
  305. var selectRange = window.getSelection().getRangeAt(0);
  306. if (
  307. selectRange.commonAncestorContainer.nodeName == '#text' &&
  308. selectRange.commonAncestorContainer.parentElement &&
  309. selectRange.commonAncestorContainer.parentElement.id == 'common_chat_input'
  310. ) {
  311. // 选中了输入框内的文本
  312. this.$data.selectionRange = selectRange;
  313. } else if (selectRange.commonAncestorContainer.id == 'common_chat_input') {
  314. // 选中了输入框
  315. this.$data.selectionRange = selectRange;
  316. }
  317. }
  318. },
  319. /**
  320. * 输入框的mouseup
  321. */
  322. inputContent_mouseup: function(e) {
  323. this.setInputContentSelectRange();
  324. },
  325. /**
  326. * 输入框的keydown
  327. */
  328. inputContent_keydown: function(e) {
  329. // keyup触发时,绑定的数据还没有被变更,需要进行延后访问
  330. this.setInputContentSelectRange();
  331. clearTimeout(this.$data.inputContent_setTimeout);
  332. this.$data.inputContent_setTimeout = setTimeout(() => {
  333. this.setInputContentByDiv();
  334. // 若按了回车,直接发送
  335. if (e.keyCode == 13) {
  336. this.sendText();
  337. }
  338. }, 1);
  339. },
  340. /**
  341. * 输入框的粘贴
  342. */
  343. inputContent_paste: function(e) {
  344. var self = this;
  345. var isImage = false;
  346. if (e.clipboardData && e.clipboardData.items.length > 0) {
  347. // 1.上传图片
  348. for (var i = 0; i < e.clipboardData.items.length; i++) {
  349. var item = e.clipboardData.items[i];
  350. if (item.kind == 'file' && item.type.indexOf('image') >= 0) {
  351. // 粘贴板为图片类型
  352. var file = item.getAsFile();
  353. let formData = new FormData();
  354. formData.append('uploadFile', file);
  355. this.$http.uploadFile({
  356. url: '/upload',
  357. params: formData,
  358. successCallback: (rs) => {
  359. console.log(file);
  360. console.log(rs);
  361. document.getElementById('common_chat_opr_fileUpload').value = '';
  362. this.sendMsg({
  363. contentType: 'image',
  364. fileName: rs.fileName,
  365. fileUrl: rs.fileUrl,
  366. state: 'success'
  367. });
  368. }
  369. });
  370. isImage = true;
  371. }
  372. }
  373. // 2.非图片,粘贴纯文本
  374. if (!isImage) {
  375. var str = e.clipboardData.getData('text/plain');
  376. // 转化为纯文字
  377. var span = document.createElement('span');
  378. span.innerHTML = str;
  379. var txt = span.innerText;
  380. this.setInputDiv(
  381. txt
  382. .replace(/\n/g, '')
  383. .replace(/\r/g, '')
  384. .replace(/</g, '&lt;')
  385. .replace(/>/g, '&gt;')
  386. );
  387. }
  388. }
  389. e.stopPropagation();
  390. e.preventDefault();
  391. },
  392. /**
  393. * 文件上传_点击
  394. */
  395. fileUpload_click: function(fileType) {
  396. document.getElementById('common_chat_opr_fileUpload').onchange = this.fileUpload_change;
  397. document.getElementById('common_chat_opr_fileUpload').click();
  398. },
  399. /**
  400. * 文件上传_选中文件
  401. */
  402. fileUpload_change: function(e) {
  403. var fileNameIndex = document.getElementById('common_chat_opr_fileUpload').value.lastIndexOf('\\') + 1;
  404. var fileName = document.getElementById('common_chat_opr_fileUpload').value.substr(fileNameIndex);
  405. var extend = fileName.substring(fileName.lastIndexOf('.') + 1);
  406. // 1.判断有效
  407. // 1)大小
  408. if (document.getElementById('common_chat_opr_fileUpload').files[0].size >= 1000 * 1000 * 10) {
  409. this.$ak.Msg.toast('文件大小不能超过10M', 'error');
  410. document.getElementById('common_chat_opr_fileUpload').value = '';
  411. return false;
  412. }
  413. // 2.文件上传
  414. let formData = new FormData();
  415. formData.append('uploadFile', document.getElementById('common_chat_opr_fileUpload').files[0]);
  416. this.$http.uploadFile({
  417. url: '/upload',
  418. params: formData,
  419. successCallback: (rs) => {
  420. console.log(rs);
  421. document.getElementById('common_chat_opr_fileUpload').value = '';
  422. this.sendMsg({
  423. contentType: ['png', 'jpg', 'jpeg', 'gif', 'bmp'].indexOf(extend) >= 0 ? 'image' : 'file',
  424. fileName: fileName,
  425. fileUrl: rs.fileUrl,
  426. state: 'success'
  427. });
  428. }
  429. });
  430. },
  431. /**
  432. * qqemoji选中表情
  433. */
  434. qqemoji_selectFace: function(rs) {
  435. var imgStr = rs.imgStr;
  436. this.setInputDiv(imgStr);
  437. },
  438. /**
  439. * 转换文件名,若文件名称超过9个字符,将进行截取处理
  440. * @param {String} fileName 文件名称
  441. */
  442. getFileName: function(fileName) {
  443. if (!fileName) {
  444. return;
  445. }
  446. var name = fileName.substring(0, fileName.lastIndexOf('.'));
  447. var extend = fileName.substring(fileName.lastIndexOf('.') + 1);
  448. if (name.length > 9) {
  449. name = name.substring(0, 3) + '...' + name.substring(name.length - 3);
  450. }
  451. return name + '.' + extend;
  452. },
  453. /**
  454. * 图片查看dialog_显示
  455. */
  456. imgViewDialog_show: function(item) {
  457. this.$data.imgViewDialogVisible = true;
  458. this.$data.imgViewDialog_imgSrc = item.fileUrl;
  459. },
  460. /**
  461. * 图片查看dialog_显示
  462. */
  463. imgViewDialog_close: function() {
  464. this.$data.imgViewDialogVisible = false;
  465. var self = this;
  466. setTimeout(function() {
  467. self.$data.imgViewDialog_imgSrc = '';
  468. }, 100);
  469. },
  470. /**
  471. * 输入框的拖拽
  472. */
  473. inputContent_drop: function(e) {
  474. var self = this;
  475. setTimeout(function() {
  476. self.setInputContentByDiv();
  477. }, 100);
  478. },
  479. /**
  480. * 发送消息,e.g. 文本、图片、文件
  481. * @param {Object} msg 消息对象
  482. */
  483. sendMsg: function(msg) {
  484. var self = this;
  485. // 1.传递
  486. this.$emit('sendMsg', {
  487. msg: msg,
  488. successCallbcak: function() {
  489. document.getElementById('common_chat_input').focus();
  490. self.goEnd();
  491. }
  492. });
  493. },
  494. /**
  495. * 传递回调
  496. */
  497. chatCallback: function(emitType, data) {
  498. this.$emit('chatCallback', {
  499. eventType: emitType,
  500. data: data
  501. });
  502. },
  503. /**
  504. * 聊天记录滚动到底部
  505. */
  506. goEnd: function() {
  507. this.$nextTick(() => {
  508. setTimeout(() => {
  509. this.$refs.common_chat_main.scrollTop = this.$refs.common_chat_main.scrollHeight;
  510. }, 100);
  511. });
  512. }
  513. },
  514. mounted() {
  515. this.$nextTick(function() {
  516. this.init();
  517. });
  518. }
  519. };
  520. </script>
  521. <style lang="less">
  522. .common_chat-wrapper {
  523. width: 100%;
  524. height: 100%;
  525. overflow: hidden;
  526. position: relative;
  527. font-size: 12px;
  528. float: left;
  529. border: 0px;
  530. .common_chat-inner {
  531. width: 100%;
  532. height: 100%;
  533. .common_chat-main {
  534. position: relative;
  535. height: calc(~'100% - 190px');
  536. overflow-y: auto;
  537. overflow-x: hidden;
  538. .common_chat-main-header {
  539. padding-top: 14px;
  540. text-align: center;
  541. .el-button {
  542. padding: 0px;
  543. font-size: 12px;
  544. color: #8d8d8d;
  545. }
  546. }
  547. .common_chat-main-content {
  548. position: absolute;
  549. width: 100%;
  550. height: 100%;
  551. & > .inner {
  552. padding-bottom: 20px;
  553. .item {
  554. clear: both;
  555. overflow: hidden;
  556. }
  557. .sys {
  558. color: #b0b0b0;
  559. font-size: 12px;
  560. text-align: center;
  561. .text-content {
  562. padding-top: 20px;
  563. }
  564. .myd-content {
  565. .desc {
  566. margin-top: 18px;
  567. }
  568. .text {
  569. color: #3e3e3e;
  570. margin-top: 12px;
  571. }
  572. .remark {
  573. margin-top: 10px;
  574. }
  575. }
  576. }
  577. .receiver,
  578. .sender {
  579. margin-top: 18px;
  580. font-size: 12px;
  581. .avatar-wrapper {
  582. float: left;
  583. .kf-img {
  584. width: 40px;
  585. height: 40px;
  586. }
  587. }
  588. .info-wrapper {
  589. position: relative;
  590. text-align: left;
  591. font-size: 12px;
  592. .item-content {
  593. position: relative;
  594. max-width: 330px;
  595. color: #3e3e3e;
  596. font-size: 13px;
  597. border-radius: 3px;
  598. .text {
  599. line-height: 1.8;
  600. white-space: normal;
  601. word-wrap: break-word;
  602. word-break: break-all;
  603. padding: 10px 12px;
  604. }
  605. .qqemoji {
  606. width: 24px;
  607. height: 24px;
  608. }
  609. .img {
  610. max-width: 320px;
  611. max-height: 240px;
  612. white-space: normal;
  613. word-wrap: break-word;
  614. word-break: break-all;
  615. padding: 5px;
  616. cursor: pointer;
  617. }
  618. .file {
  619. width: 220px;
  620. padding: 10px 8px;
  621. margin: 3px;
  622. overflow: hidden;
  623. background: #fff;
  624. border-radius: 5px;
  625. .el-button {
  626. padding: 0px;
  627. font-size: 12px;
  628. }
  629. .file-info {
  630. float: left;
  631. padding: 0px 8px;
  632. .file-name {
  633. width: 160px;
  634. display: inline-block;
  635. color: #333333;
  636. white-space: nowrap;
  637. text-overflow: ellipsis;
  638. overflow: hidden;
  639. line-height: 1.3;
  640. }
  641. }
  642. .file-opr {
  643. margin-top: 8px;
  644. }
  645. .file-icon {
  646. float: left;
  647. color: #663399;
  648. font-size: 40px;
  649. }
  650. .file-download {
  651. color: #00a8d7;
  652. cursor: pointer;
  653. text-decoration: blink;
  654. }
  655. }
  656. .preInput {
  657. position: relative;
  658. color: #8d8d8d;
  659. img {
  660. height: 15px;
  661. position: relative;
  662. top: 3px;
  663. }
  664. }
  665. .issueList {
  666. width: 250px;
  667. padding: 10px;
  668. .title {
  669. position: relative;
  670. .content {
  671. position: absolute;
  672. margin-top: -1px;
  673. margin-left: 6px;
  674. }
  675. }
  676. .el-collapse-item__wrap {
  677. background: transparent;
  678. }
  679. .el-collapse {
  680. border: 0px;
  681. margin-top: 8px;
  682. margin-bottom: -8px;
  683. .el-collapse-item__header {
  684. font-size: 13px;
  685. background: transparent;
  686. color: #f7455d;
  687. padding-left: 5px;
  688. }
  689. .el-collapse-item__wrap {
  690. .el-collapse-item__content {
  691. font-size: 12px;
  692. color: #3e3e3e;
  693. padding-left: 5px;
  694. }
  695. }
  696. }
  697. }
  698. .issueExtend {
  699. width: 250px;
  700. padding: 10px 10px 0px;
  701. .main {
  702. border-top: 1px solid #eeeff0;
  703. margin-top: 10px;
  704. padding-top: 10px;
  705. p {
  706. margin-bottom: 5px;
  707. }
  708. .el-button {
  709. font-size: 12px;
  710. color: #f7455d;
  711. }
  712. }
  713. }
  714. .issueResult {
  715. width: 250px;
  716. .main {
  717. padding: 10px;
  718. }
  719. .footer {
  720. border-top: 1px solid #eeeff0;
  721. height: 30px;
  722. .btn {
  723. width: 60px;
  724. margin: 0px 30px;
  725. padding: 6px 0px;
  726. display: inline-block;
  727. text-align: center;
  728. font-size: 10px;
  729. color: #8d8d8d;
  730. cursor: pointer;
  731. position: relative;
  732. &:first-child::after {
  733. top: 4px;
  734. right: -30px;
  735. width: 1px;
  736. height: 80%;
  737. content: '';
  738. position: absolute;
  739. background-color: #eeeff0;
  740. z-index: 0;
  741. }
  742. }
  743. .iconfont {
  744. font-size: 10px;
  745. margin-right: 5px;
  746. }
  747. }
  748. }
  749. }
  750. }
  751. }
  752. .item.receiver {
  753. margin-left: 5px;
  754. .avatar-wrapper {
  755. margin-right: 15px;
  756. }
  757. .info-wrapper {
  758. .item-content {
  759. float: left;
  760. color: #000000;
  761. background-color: #f9fbfc;
  762. border: 1px solid #ccc;
  763. &::before {
  764. position: absolute;
  765. top: -1px;
  766. left: -10px;
  767. width: 0px;
  768. height: 0px;
  769. content: '';
  770. border-top: 0px;
  771. border-right: 10px solid #ccc;
  772. border-bottom: 5px solid transparent;
  773. border-left: 0px;
  774. }
  775. }
  776. }
  777. }
  778. .item.sender {
  779. margin-right: 5px;
  780. .avatar-wrapper {
  781. float: right;
  782. margin-left: 15px;
  783. }
  784. .info-wrapper {
  785. float: right;
  786. .item-content {
  787. float: right;
  788. background: #0095ff;
  789. border: 1px solid #0095ff;
  790. color: #ffffff;
  791. &::before {
  792. position: absolute;
  793. top: -1px;
  794. right: -10px;
  795. width: 0px;
  796. height: 0px;
  797. content: '';
  798. border-top: 0px;
  799. border-right: 0px;
  800. border-bottom: 5px solid transparent;
  801. border-left: 10px solid #0095ff;
  802. }
  803. }
  804. }
  805. }
  806. }
  807. }
  808. }
  809. .common_chat-footer {
  810. position: relative;
  811. width: 100%;
  812. border-top: 1px solid #ccc;
  813. .opr-wrapper {
  814. height: 20px;
  815. padding: 10px;
  816. text-align: left;
  817. & > .item {
  818. margin-right: 12px;
  819. float: left;
  820. font-weight: normal;
  821. text-decoration: blink;
  822. & > .iconfont {
  823. color: #aaa;
  824. font-size: 20px;
  825. }
  826. }
  827. }
  828. .input-wrapper {
  829. position: relative;
  830. padding: 2px 0px 0px 10px;
  831. .inputContent {
  832. width: 99%;
  833. padding: 2px;
  834. height: 85px;
  835. resize: none;
  836. overflow: auto;
  837. line-height: 1.5;
  838. outline: 0px solid transparent;
  839. }
  840. .shortcutPopover-wrapper {
  841. position: absolute;
  842. top: 30px;
  843. left: 10px;
  844. width: 440px;
  845. max-height: 80px;
  846. padding: 4px;
  847. font-size: 12px;
  848. overflow-y: auto;
  849. border: 1px solid #9b9aab;
  850. border-radius: 3px;
  851. background-color: #fff;
  852. cursor: pointer;
  853. p {
  854. padding: 4px;
  855. &.selected {
  856. background-color: #ded1cc;
  857. }
  858. .key {
  859. display: inline-block;
  860. width: 50px;
  861. white-space: nowrap;
  862. text-overflow: ellipsis;
  863. overflow: hidden;
  864. }
  865. .content {
  866. display: inline-block;
  867. width: 350px;
  868. margin-left: 10px;
  869. white-space: nowrap;
  870. text-overflow: ellipsis;
  871. overflow: hidden;
  872. }
  873. .highlight {
  874. color: #00a8d7;
  875. }
  876. }
  877. }
  878. .tips {
  879. position: absolute;
  880. top: 7px;
  881. left: 20px;
  882. width: auto;
  883. color: #8d8d8d;
  884. }
  885. }
  886. .send-btn {
  887. float: right;
  888. margin-right: 16px;
  889. &.off,
  890. &.end {
  891. background-color: #ccc;
  892. border-color: #ccc;
  893. }
  894. }
  895. .off-wrapper {
  896. position: absolute;
  897. top: 0px;
  898. left: 0px;
  899. width: 100%;
  900. height: 100%;
  901. background-color: rgba(255, 255, 255, 0.6);
  902. font-size: 14px;
  903. .content {
  904. position: absolute;
  905. top: 50%;
  906. left: 50%;
  907. transform: translate(-50%, -50%);
  908. }
  909. }
  910. }
  911. }
  912. }
  913. .imgView-dialog {
  914. background: #00000080;
  915. height: 100%;
  916. .el-dialog {
  917. max-width: 75%;
  918. position: relative;
  919. background: transparent;
  920. box-shadow: none;
  921. .el-dialog__header {
  922. display: none;
  923. }
  924. .el-dialog__body {
  925. padding: 0px;
  926. text-align: center;
  927. position: relative;
  928. .header {
  929. text-align: right;
  930. position: relative;
  931. height: 0px;
  932. .fa-remove {
  933. font-size: 32px;
  934. color: white;
  935. position: relative;
  936. right: -50px;
  937. top: -30px;
  938. cursor: pointer;
  939. }
  940. }
  941. .main {
  942. .img {
  943. max-width: 100%;
  944. max-height: 100%;
  945. height: 100%;
  946. }
  947. }
  948. }
  949. }
  950. }
  951. </style>