|
|
|
@ -1,72 +1,54 @@ |
|
|
|
<template> |
|
|
|
<div class="chat-input-area"> |
|
|
|
<div :class="['edit-chat-container',isEmpty?'':'not-empty']" contenteditable="true" |
|
|
|
@paste.prevent="onPaste" |
|
|
|
@keydown="onKeydown" |
|
|
|
@compositionstart="compositionFlag=true" |
|
|
|
@compositionend="compositionFlag=false;updateRange()" |
|
|
|
@input="onEditorInput" |
|
|
|
@mousedown="onMousedown" |
|
|
|
v-html="contentHtml" |
|
|
|
ref="content" |
|
|
|
@blur="onBlur" |
|
|
|
> |
|
|
|
<div :class="['edit-chat-container',isEmpty?'':'not-empty']" contenteditable="true" @paste.prevent="onPaste" |
|
|
|
@keydown="onKeydown" @compositionstart="compositionFlag=true" @compositionend="onCompositionEnd" |
|
|
|
@input="onEditorInput" @mousedown="onMousedown" ref="content" @blur="onBlur"> |
|
|
|
</div> |
|
|
|
<chat-at-box @select="onAtSelect" |
|
|
|
:search-text="atSearchText" |
|
|
|
ref="atBox" |
|
|
|
:ownerId="ownerId" |
|
|
|
:members="groupMembers" |
|
|
|
|
|
|
|
></chat-at-box> |
|
|
|
<chat-at-box @select="onAtSelect" :search-text="atSearchText" ref="atBox" :ownerId="ownerId" |
|
|
|
:members="groupMembers"></chat-at-box> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
|
|
|
|
<script> |
|
|
|
import ChatAtBox from "./ChatAtBox"; |
|
|
|
import ChatAtBox from "./ChatAtBox"; |
|
|
|
|
|
|
|
export default { |
|
|
|
export default { |
|
|
|
name: "ChatInput", |
|
|
|
components: {ChatAtBox}, |
|
|
|
components: { ChatAtBox }, |
|
|
|
props: { |
|
|
|
ownerId: { |
|
|
|
type: Number, |
|
|
|
|
|
|
|
}, |
|
|
|
groupMembers: { |
|
|
|
type: Array, |
|
|
|
}, |
|
|
|
}, |
|
|
|
data() { |
|
|
|
const defaultContentHtml = '<div></div>'; |
|
|
|
return { |
|
|
|
// contentList: [], |
|
|
|
// content: null, |
|
|
|
defaultContentHtml, |
|
|
|
contentHtml: defaultContentHtml + '', |
|
|
|
imageList: [], |
|
|
|
fileList: [], |
|
|
|
currentId: 0, |
|
|
|
atSearchText: null, |
|
|
|
compositionFlag: false, |
|
|
|
history: [defaultContentHtml], |
|
|
|
atIng: false, |
|
|
|
isEmpty: true, |
|
|
|
changeStored: true, |
|
|
|
blurRange: null |
|
|
|
} |
|
|
|
}, methods: { |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
onPaste(e) { |
|
|
|
this.isEmpty = false; |
|
|
|
let txt = e.clipboardData.getData('Text') |
|
|
|
let range = window.getSelection().getRangeAt(0) |
|
|
|
|
|
|
|
if (range.startContainer !== range.endContainer || range.startOffset !== range.endOffset) { |
|
|
|
range.deleteContents(); |
|
|
|
} |
|
|
|
// 粘贴图片和文件时,这里没有数据 |
|
|
|
if (txt && typeof (txt) == 'string') { |
|
|
|
if (txt && typeof(txt) == 'string') { |
|
|
|
let textNode = document.createTextNode(txt); |
|
|
|
range.insertNode(textNode) |
|
|
|
range.collapse(); |
|
|
|
return; |
|
|
|
} |
|
|
|
let items = (e.clipboardData || window.clipboardData).items |
|
|
|
@ -80,49 +62,37 @@ export default { |
|
|
|
url: URL.createObjectURL(file) |
|
|
|
}; |
|
|
|
this.imageList[imagePush.fileId] = (imagePush); |
|
|
|
|
|
|
|
let divElement = this.newLine(); |
|
|
|
let text = document.createTextNode('\u00A0'); |
|
|
|
divElement.appendChild(text); |
|
|
|
|
|
|
|
let line = this.newLine(); |
|
|
|
let imageElement = document.createElement('img'); |
|
|
|
imageElement.className = 'chat-image no-text'; |
|
|
|
imageElement.src = imagePush.url; |
|
|
|
imageElement.dataset.imgId = imagePush.fileId; |
|
|
|
|
|
|
|
divElement.appendChild(imageElement); |
|
|
|
line.appendChild(imageElement); |
|
|
|
let after = document.createTextNode('\u00A0'); |
|
|
|
divElement.appendChild(after); |
|
|
|
line.appendChild(after); |
|
|
|
this.selectElement(after, 1); |
|
|
|
// range.insertNode(divElement); |
|
|
|
} else { |
|
|
|
let asFile = items[i].getAsFile(); |
|
|
|
if (!asFile) { |
|
|
|
continue; |
|
|
|
} |
|
|
|
let filePush = {fileId: this.generateId(), file: asFile}; |
|
|
|
let filePush = { fileId: this.generateId(), file: asFile }; |
|
|
|
this.fileList[filePush.fileId] = (filePush) |
|
|
|
let line = this.newLine(); |
|
|
|
let text = document.createTextNode('\u00A0'); |
|
|
|
line.appendChild(text); |
|
|
|
|
|
|
|
let fileElement = this.createFile(filePush); |
|
|
|
line.appendChild(fileElement); |
|
|
|
|
|
|
|
let after = document.createTextNode('\u00A0'); |
|
|
|
line.appendChild(after); |
|
|
|
this.selectElement(after, 1); |
|
|
|
// fileElement.insertAdjacentHTML('afterend', '\u00A0'); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
range.collapse(); |
|
|
|
|
|
|
|
}, |
|
|
|
selectElement(element, endOffset) { |
|
|
|
let selection = window.getSelection(); |
|
|
|
// 插入元素可能不是立即执行的,vue可能会在插入元素后再更新dom |
|
|
|
setTimeout(() => { |
|
|
|
this.$nextTick(() => { |
|
|
|
let t1 = document.createRange(); |
|
|
|
t1.setStart(element, 0); |
|
|
|
t1.setEnd(element, endOffset || 0); |
|
|
|
@ -130,7 +100,6 @@ export default { |
|
|
|
t1.selectNodeContents(element.firstChild); |
|
|
|
} |
|
|
|
t1.collapse(); |
|
|
|
|
|
|
|
selection.removeAllRanges(); |
|
|
|
selection.addRange(t1); |
|
|
|
// 需要时自动聚焦 |
|
|
|
@ -139,6 +108,10 @@ export default { |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
onCompositionEnd(e) { |
|
|
|
this.compositionFlag = false; |
|
|
|
this.onEditorInput(e); |
|
|
|
}, |
|
|
|
onKeydown(e) { |
|
|
|
if (e.keyCode === 13) { |
|
|
|
e.preventDefault(); |
|
|
|
@ -148,10 +121,11 @@ export default { |
|
|
|
this.$refs.atBox.select(); |
|
|
|
return; |
|
|
|
} |
|
|
|
if (e.shiftKey) { |
|
|
|
let divElement = this.newLine(); |
|
|
|
|
|
|
|
this.selectElement(divElement); |
|
|
|
if (e.ctrlKey) { |
|
|
|
let line = this.newLine(); |
|
|
|
let after = document.createTextNode('\u00A0'); |
|
|
|
line.appendChild(after); |
|
|
|
this.selectElement(line.childNodes[0], 0); |
|
|
|
} else { |
|
|
|
// 中文输入标记 |
|
|
|
if (this.compositionFlag) { |
|
|
|
@ -161,42 +135,15 @@ export default { |
|
|
|
} |
|
|
|
return; |
|
|
|
} |
|
|
|
if (e.keyCode === 90) { |
|
|
|
// Ctrl+Z,这里兼容mac的command+z |
|
|
|
if (e.ctrlKey || e.metaKey) { |
|
|
|
// 阻止默认的ctrl+z,浏览器的ctrl+z很low |
|
|
|
e.preventDefault(); |
|
|
|
e.stopPropagation(); |
|
|
|
if (this.history.length <= 1) { |
|
|
|
return; |
|
|
|
} |
|
|
|
if (this.changeStored) { |
|
|
|
this.history.pop(); |
|
|
|
} |
|
|
|
let last = this.history.pop(); |
|
|
|
// console.log('回滚为:', last); |
|
|
|
this.contentHtml = last; |
|
|
|
if (this.history.length === 0) { |
|
|
|
// 保底 |
|
|
|
this.history.push(this.defaultContentHtml); |
|
|
|
} |
|
|
|
// 等待刷新dom |
|
|
|
setTimeout(() => { |
|
|
|
let t = this.$refs.content.lastElementChild.lastChild; |
|
|
|
if (!t || !t.textContent) { |
|
|
|
return; |
|
|
|
} |
|
|
|
this.selectElement(t, t.textContent.length); |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
// 删除键 |
|
|
|
if (e.keyCode === 8) { |
|
|
|
console.log("delete") |
|
|
|
// 等待dom更新 |
|
|
|
setTimeout(() => { |
|
|
|
let s = this.$refs.content.innerHTML.trim(); |
|
|
|
// 空dom时,需要刷新dom |
|
|
|
if (s === '' || s === '<br>' || s === '<div><br></div>' || s === '<div><br/></div>') { |
|
|
|
console.log(s); |
|
|
|
if (s === '' || s === '<br>' || s === '<div> </div>' ) { |
|
|
|
// 拼接随机长度的空格,以刷新dom |
|
|
|
this.empty(); |
|
|
|
this.isEmpty = true; |
|
|
|
@ -219,24 +166,27 @@ export default { |
|
|
|
this.$refs.atBox.moveDown(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
onAtSelect(member) { |
|
|
|
this.atIng = false; |
|
|
|
|
|
|
|
// 选中输入的 @xx 符 |
|
|
|
let blurRange = this.blurRange; |
|
|
|
let startOffset = blurRange.endOffset - this.atSearchText.length - 1; |
|
|
|
let endContainer = blurRange.endContainer |
|
|
|
let startOffset = endContainer.data.indexOf("@"+this.atSearchText); |
|
|
|
let endOffset = startOffset + this.atSearchText.length + 1; |
|
|
|
blurRange.setStart(blurRange.endContainer, startOffset); |
|
|
|
blurRange.setEnd(blurRange.endContainer, endOffset); |
|
|
|
blurRange.deleteContents() |
|
|
|
blurRange.collapse(); |
|
|
|
|
|
|
|
console.log("onAtSelect") |
|
|
|
this.focus(); |
|
|
|
// 创建元素节点 |
|
|
|
let element = document.createElement('SPAN') |
|
|
|
element.className = "chat-at-user"; |
|
|
|
element.dataset.id = member.userId; |
|
|
|
element.contentEditable = 'false' |
|
|
|
element.innerText = `@${member.aliasName}` |
|
|
|
element.innerText = `@${member.showNickName}` |
|
|
|
blurRange.insertNode(element) |
|
|
|
// 光标移动到末尾 |
|
|
|
blurRange.collapse() |
|
|
|
@ -250,10 +200,8 @@ export default { |
|
|
|
this.selectElement(textNode, 1); |
|
|
|
}, |
|
|
|
onEditorInput(e) { |
|
|
|
// 加timeout是为了先响应compositionend事件 |
|
|
|
this.isEmpty = false; |
|
|
|
this.changeStored = false; |
|
|
|
setTimeout(() => { |
|
|
|
if (this.$props.groupMembers && !this.compositionFlag) { |
|
|
|
let selection = window.getSelection() |
|
|
|
let range = selection.getRangeAt(0); |
|
|
|
@ -273,8 +221,7 @@ export default { |
|
|
|
this.$refs.atBox.close(); |
|
|
|
return; |
|
|
|
} |
|
|
|
// 打开选择弹窗 |
|
|
|
this.showAtBox(e) |
|
|
|
|
|
|
|
let endIndex = endOffset; |
|
|
|
for (let i = endOffset; i < textContent.length; i++) { |
|
|
|
if (textContent[i] === ' ') { |
|
|
|
@ -283,11 +230,16 @@ export default { |
|
|
|
} |
|
|
|
} |
|
|
|
this.atSearchText = textContent.substring(startIndex + 1, endIndex).trim(); |
|
|
|
// 打开选择弹窗 |
|
|
|
if (this.atSearchText == '') { |
|
|
|
this.showAtBox(e) |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
onBlur(e) { |
|
|
|
this.updateRange(); |
|
|
|
|
|
|
|
}, |
|
|
|
onMousedown() { |
|
|
|
if (this.atIng) { |
|
|
|
@ -337,8 +289,7 @@ export default { |
|
|
|
container.appendChild(left); |
|
|
|
|
|
|
|
let icon = document.createElement('div'); |
|
|
|
icon.className = 'file-icon'; |
|
|
|
icon.innerText = '?'; |
|
|
|
icon.className = 'el-icon-document'; |
|
|
|
left.appendChild(icon); |
|
|
|
|
|
|
|
let right = document.createElement('div'); |
|
|
|
@ -376,24 +327,18 @@ export default { |
|
|
|
newLine() { |
|
|
|
let selection = window.getSelection(); |
|
|
|
let range = selection.getRangeAt(0); |
|
|
|
|
|
|
|
let divElement = document.createElement('div'); |
|
|
|
|
|
|
|
let endContainer = range.endContainer; |
|
|
|
let parentElement = endContainer.parentElement; |
|
|
|
|
|
|
|
let newText = endContainer.textContent.substring(range.endOffset).trim(); |
|
|
|
if (parentElement.parentElement === this.$refs.content) { |
|
|
|
divElement.innerHTML = endContainer.textContent.substring(range.endOffset).trim(); |
|
|
|
endContainer.textContent = endContainer.textContent.substring(0, range.endOffset); |
|
|
|
divElement.innerHTML = newText || ''; |
|
|
|
|
|
|
|
// 有时候at完或者插入图片、文件后,可能parent可能直接是编辑器本身了,这里直接追加就可以了,可能有bug,但在所难免 |
|
|
|
if (parentElement === this.$refs.content) { |
|
|
|
this.$refs.content.append(divElement); |
|
|
|
} else { |
|
|
|
// 插入到当前div(当前行)后面 |
|
|
|
parentElement.insertAdjacentElement('afterend', divElement); |
|
|
|
} else { |
|
|
|
divElement.innerHTML = ''; |
|
|
|
this.$refs.content.append(divElement); |
|
|
|
} |
|
|
|
this.isEmpty = false; |
|
|
|
return divElement; |
|
|
|
}, |
|
|
|
clear() { |
|
|
|
@ -402,12 +347,11 @@ export default { |
|
|
|
this.fileList = []; |
|
|
|
}, |
|
|
|
empty() { |
|
|
|
let emptyCount = Math.random() * 100 + 5; |
|
|
|
let content = ''; |
|
|
|
for (let i = 0; i < emptyCount; i++) { |
|
|
|
content += ' '; |
|
|
|
} |
|
|
|
this.contentHtml = this.defaultContentHtml + content; |
|
|
|
this.$refs.content.innerHTML = ""; |
|
|
|
let line = this.newLine(); |
|
|
|
let after = document.createTextNode('\u00A0'); |
|
|
|
line.appendChild(after); |
|
|
|
this.$nextTick(()=>this.selectElement(after)); |
|
|
|
}, |
|
|
|
showAtBox(e) { |
|
|
|
this.atIng = true; |
|
|
|
@ -424,17 +368,21 @@ export default { |
|
|
|
// 记录光标所在位置 |
|
|
|
this.updateRange(); |
|
|
|
}, |
|
|
|
html2Escape(strHtml) { |
|
|
|
return strHtml.replace(/[<>&"]/g, function(c) { |
|
|
|
return { |
|
|
|
'<': '<', |
|
|
|
'>': '>', |
|
|
|
'&': '&', |
|
|
|
'"': '"' |
|
|
|
} [c]; |
|
|
|
}); |
|
|
|
}, |
|
|
|
submit() { |
|
|
|
// console.log(this.content) |
|
|
|
let nodes = this.$refs.content.childNodes; |
|
|
|
let textList = []; |
|
|
|
let imageList = []; |
|
|
|
let fileList = []; |
|
|
|
|
|
|
|
let fullList = []; |
|
|
|
|
|
|
|
|
|
|
|
let tempText = ''; |
|
|
|
let atUserIds = []; |
|
|
|
let each = (nodes) => { |
|
|
|
for (let i = 0; i < nodes.length; i++) { |
|
|
|
let node = nodes[i]; |
|
|
|
@ -442,7 +390,7 @@ export default { |
|
|
|
continue; |
|
|
|
} |
|
|
|
if (node.nodeType === 3) { |
|
|
|
tempText += node.textContent; |
|
|
|
tempText += this.html2Escape(node.textContent); |
|
|
|
continue; |
|
|
|
} |
|
|
|
let nodeName = node.nodeName.toLowerCase(); |
|
|
|
@ -456,16 +404,16 @@ export default { |
|
|
|
if (text) { |
|
|
|
fullList.push({ |
|
|
|
type: 'text', |
|
|
|
content: text |
|
|
|
content: text, |
|
|
|
atUserIds: atUserIds |
|
|
|
}) |
|
|
|
tempText = ''; |
|
|
|
atUserIds = [] |
|
|
|
} |
|
|
|
fullList.push({ |
|
|
|
type: 'image', |
|
|
|
content: this.imageList[imgId] |
|
|
|
}) |
|
|
|
imageList.push(this.imageList[imgId]); |
|
|
|
textList.push(text); |
|
|
|
tempText = ''; |
|
|
|
} else { |
|
|
|
let emojiCode = node.dataset.emojiCode; |
|
|
|
tempText += emojiCode; |
|
|
|
@ -477,33 +425,27 @@ export default { |
|
|
|
if (text) { |
|
|
|
fullList.push({ |
|
|
|
type: 'text', |
|
|
|
content: text |
|
|
|
content: text, |
|
|
|
atUserIds: atUserIds |
|
|
|
}) |
|
|
|
tempText = ''; |
|
|
|
atUserIds = [] |
|
|
|
} |
|
|
|
fullList.push({ |
|
|
|
type: 'file', |
|
|
|
content: this.fileList[fileId] |
|
|
|
}) |
|
|
|
fileList.push(this.fileList[fileId]); |
|
|
|
textList.push(text); |
|
|
|
tempText = ''; |
|
|
|
} else { |
|
|
|
tempText += '\n'; |
|
|
|
each(node.childNodes); |
|
|
|
} |
|
|
|
} else if (nodeName === 'span') { |
|
|
|
let userId = node.dataset.id; |
|
|
|
if (userId !== null && userId !== undefined) { |
|
|
|
tempText += node.outerHTML; |
|
|
|
} |
|
|
|
} else { |
|
|
|
console.warn('未处理的标签'); |
|
|
|
if (getComputedStyle(node).display === 'block') { |
|
|
|
tempText += '\n'; |
|
|
|
} else { |
|
|
|
tempText += ' '; |
|
|
|
if(node.dataset.id){ |
|
|
|
tempText += node.innerHTML; |
|
|
|
atUserIds.push(node.dataset.id) |
|
|
|
}else { |
|
|
|
tempText += node.outerHtml; |
|
|
|
} |
|
|
|
each(node.childNodes); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
@ -512,51 +454,27 @@ export default { |
|
|
|
if (text !== '') { |
|
|
|
fullList.push({ |
|
|
|
type: 'text', |
|
|
|
content: text |
|
|
|
content: text, |
|
|
|
atUserIds: atUserIds |
|
|
|
}) |
|
|
|
textList.push(text); |
|
|
|
} |
|
|
|
// console.log(textList, imageList, fileList) |
|
|
|
|
|
|
|
this.$emit('submit', fullList, textList, imageList, fileList); |
|
|
|
this.$emit('submit', fullList); |
|
|
|
}, |
|
|
|
focus() { |
|
|
|
this.$refs.content.focus(); |
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
mounted() { |
|
|
|
// console.log(this.$props.groupMembers) |
|
|
|
// this.$refs.content.firstElementChild.focus(); |
|
|
|
this.selectElement(this.$refs.content.firstElementChild); |
|
|
|
setInterval(() => { |
|
|
|
if (!this.$refs.content) { |
|
|
|
return; |
|
|
|
} |
|
|
|
// 输入中文时不记录 |
|
|
|
if (this.compositionFlag) { |
|
|
|
return; |
|
|
|
} |
|
|
|
let last = this.history[this.history.length - 1]; |
|
|
|
let newContent = this.$refs.content.innerHTML; |
|
|
|
if (last !== newContent) { |
|
|
|
this.history.push(newContent); |
|
|
|
} |
|
|
|
this.changeStored = true; |
|
|
|
}, 1000); |
|
|
|
} |
|
|
|
} |
|
|
|
</script> |
|
|
|
|
|
|
|
<style lang="scss"> |
|
|
|
.chat-input-area { |
|
|
|
.chat-input-area { |
|
|
|
width: 100%; |
|
|
|
height: 100%; |
|
|
|
position: relative; |
|
|
|
|
|
|
|
.edit-chat-container { |
|
|
|
//width: 100%; |
|
|
|
//height: 100%; |
|
|
|
position: absolute; |
|
|
|
top: 0; |
|
|
|
left: 0; |
|
|
|
@ -564,19 +482,14 @@ export default { |
|
|
|
bottom: 0; |
|
|
|
border: 1px solid #c3c3c3; |
|
|
|
outline: none; |
|
|
|
padding: 10px 0; |
|
|
|
padding: 5px; |
|
|
|
line-height: 30px; |
|
|
|
font-size: 16px; |
|
|
|
text-align: left; |
|
|
|
|
|
|
|
> div { |
|
|
|
padding-left: 10px; |
|
|
|
//width: 1px; |
|
|
|
min-height: 30px; |
|
|
|
} |
|
|
|
overflow-y: scroll; |
|
|
|
|
|
|
|
// 单独一行时,无法在前面输入的bug |
|
|
|
> div:before { |
|
|
|
>div:before { |
|
|
|
content: "\00a0"; |
|
|
|
font-size: 14px; |
|
|
|
position: absolute; |
|
|
|
@ -585,11 +498,11 @@ export default { |
|
|
|
} |
|
|
|
|
|
|
|
.chat-image { |
|
|
|
display: block; |
|
|
|
max-width: 200px; |
|
|
|
max-height: 100px; |
|
|
|
border: 1px solid #e6e6e6; |
|
|
|
cursor: pointer; |
|
|
|
//margin-left: 10px; |
|
|
|
} |
|
|
|
|
|
|
|
.chat-emoji { |
|
|
|
@ -600,66 +513,59 @@ export default { |
|
|
|
} |
|
|
|
|
|
|
|
.chat-file-container { |
|
|
|
width: 200px; |
|
|
|
//height: 100px; |
|
|
|
padding: 5px 7px; |
|
|
|
border: 1px solid #4cd964; |
|
|
|
max-width: 65%; |
|
|
|
padding: 10px; |
|
|
|
border: 2px solid #587ff0; |
|
|
|
display: flex; |
|
|
|
background: #eeeC; |
|
|
|
border-radius: 10px; |
|
|
|
|
|
|
|
.file-position-left { |
|
|
|
width: 30%; |
|
|
|
flex: 1; |
|
|
|
display: flex; |
|
|
|
width: 80px; |
|
|
|
justify-content: center; |
|
|
|
align-items: center; |
|
|
|
|
|
|
|
.file-icon { |
|
|
|
width: 30px; |
|
|
|
height: 30px; |
|
|
|
.el-icon-document { |
|
|
|
font-size: 40px; |
|
|
|
text-align: center; |
|
|
|
justify-content: center; |
|
|
|
align-items: center; |
|
|
|
vertical-align: center; |
|
|
|
border: 1px solid #e6e6e6; |
|
|
|
color: #d42e07; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.file-position-right { |
|
|
|
width: 70%; |
|
|
|
flex: 3; |
|
|
|
flex: 1; |
|
|
|
|
|
|
|
.file-name { |
|
|
|
font-size: 14px; |
|
|
|
color: #333; |
|
|
|
font-size: 16px; |
|
|
|
font-weight: 600; |
|
|
|
color: #66b1ff; |
|
|
|
} |
|
|
|
|
|
|
|
.file-size { |
|
|
|
font-size: 12px; |
|
|
|
color: #666; |
|
|
|
font-size: 14px; |
|
|
|
font-weight: 600; |
|
|
|
color: black; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.chat-at-user { |
|
|
|
background-color: #4cd964; |
|
|
|
padding: 2px 5px; |
|
|
|
color: white; |
|
|
|
//border: 1px solid #c3c3c3; |
|
|
|
color: #00f; |
|
|
|
font-weight: 600; |
|
|
|
|
|
|
|
border-radius: 3px; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.edit-chat-container > div:nth-of-type(1):empty:after { |
|
|
|
content: '请输入消息(按Shift+Enter键换行)'; |
|
|
|
.edit-chat-container>div:nth-of-type(1):after { |
|
|
|
content: '请输入消息(按Ctrl+Enter键换行)'; |
|
|
|
color: gray; |
|
|
|
} |
|
|
|
|
|
|
|
.edit-chat-container > div:nth-of-type(1):focus:after { |
|
|
|
.edit-chat-container.not-empty>div:nth-of-type(1):after { |
|
|
|
content: none; |
|
|
|
} |
|
|
|
|
|
|
|
.edit-chat-container.not-empty > div:nth-of-type(1):after { |
|
|
|
content: none; |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
</style> |