fix: 侧边栏优化,内敛图调大
This commit is contained in:
parent
d69d16e196
commit
55588504a1
|
|
@ -255,6 +255,8 @@ const insertMentionImage = (item) => {
|
||||||
editorRef.value.focus()
|
editorRef.value.focus()
|
||||||
restoreSelection()
|
restoreSelection()
|
||||||
removeMentionKeywordBeforeCursor()
|
removeMentionKeywordBeforeCursor()
|
||||||
|
// 删除 @关键字 后必须重新记录选区,否则 insertReference 里 restoreSelection 仍用删除前的 Range,会插错位置甚至覆盖后文
|
||||||
|
saveSelection()
|
||||||
insertReference(item)
|
insertReference(item)
|
||||||
hideMentionPanel()
|
hideMentionPanel()
|
||||||
emit('text-change', getPlainText())
|
emit('text-change', getPlainText())
|
||||||
|
|
@ -488,7 +490,7 @@ onMounted(() => {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
min-height: 220px;
|
min-height: 220px;
|
||||||
font-size: 15px;
|
font-size: 15px;
|
||||||
line-height: 1.6;
|
line-height: 1.9;
|
||||||
white-space: pre-wrap;
|
white-space: pre-wrap;
|
||||||
word-break: break-word;
|
word-break: break-word;
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
|
|
@ -496,7 +498,7 @@ onMounted(() => {
|
||||||
caret-color: #00cae0;
|
caret-color: #00cae0;
|
||||||
border: 1px solid rgba(255, 255, 255, 0.1);
|
border: 1px solid rgba(255, 255, 255, 0.1);
|
||||||
border-radius: 14px;
|
border-radius: 14px;
|
||||||
padding: 14px 16px;
|
padding: 16px 18px;
|
||||||
background: rgba(0, 0, 0, 0.25);
|
background: rgba(0, 0, 0, 0.25);
|
||||||
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
|
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
|
||||||
}
|
}
|
||||||
|
|
@ -512,22 +514,28 @@ onMounted(() => {
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
.video-rich-editor :deep(.inline-rich-image) {
|
.video-rich-editor :deep(.inline-rich-image) {
|
||||||
height: 1.1em;
|
display: inline-block;
|
||||||
width: auto;
|
width: auto;
|
||||||
vertical-align: baseline;
|
height: auto;
|
||||||
margin: 0 2px;
|
max-width: min(260px, 100%);
|
||||||
border-radius: 4px;
|
max-height: 148px;
|
||||||
|
object-fit: contain;
|
||||||
|
vertical-align: middle;
|
||||||
|
margin: 6px 8px;
|
||||||
|
border-radius: 8px;
|
||||||
|
border: 1px solid rgba(255, 255, 255, 0.12);
|
||||||
|
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
|
||||||
}
|
}
|
||||||
.video-rich-editor :deep(.inline-rich-reference) {
|
.video-rich-editor :deep(.inline-rich-reference) {
|
||||||
display: inline-flex;
|
display: inline-flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
padding: 0 6px;
|
padding: 0 6px;
|
||||||
margin: 0 2px;
|
margin: 0 3px;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
background: rgba(0, 202, 224, 0.15);
|
background: rgba(0, 202, 224, 0.15);
|
||||||
color: #5eebf5;
|
color: #5eebf5;
|
||||||
font-size: 0.85em;
|
font-size: 0.85em;
|
||||||
line-height: 1.6;
|
line-height: 1.5;
|
||||||
}
|
}
|
||||||
.mention-panel {
|
.mention-panel {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
|
|
|
||||||
|
|
@ -23,9 +23,9 @@
|
||||||
<a-menu-item :key="item.key">
|
<a-menu-item :key="item.key">
|
||||||
<template #icon>
|
<template #icon>
|
||||||
<a-image
|
<a-image
|
||||||
:width="24"
|
:width="28"
|
||||||
:preview="false"
|
:preview="false"
|
||||||
:height="24"
|
:height="28"
|
||||||
:src="`/images/nav/${
|
:src="`/images/nav/${
|
||||||
selectedKeys.indexOf(item.key) > -1
|
selectedKeys.indexOf(item.key) > -1
|
||||||
? item.icon + '-a'
|
? item.icon + '-a'
|
||||||
|
|
|
||||||
|
|
@ -443,7 +443,10 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
generateVideo() {
|
async generateVideo() {
|
||||||
|
if (this.generateLoading) {
|
||||||
|
return
|
||||||
|
}
|
||||||
const plain = this.plainPromptText()
|
const plain = this.plainPromptText()
|
||||||
const text = plain || '一个优雅的女孩在阳光下跳舞'
|
const text = plain || '一个优雅的女孩在阳光下跳舞'
|
||||||
|
|
||||||
|
|
@ -515,12 +518,12 @@ export default {
|
||||||
params.referenceUrl = this.firstReferenceImageUrlFromEditor()
|
params.referenceUrl = this.firstReferenceImageUrlFromEditor()
|
||||||
}
|
}
|
||||||
|
|
||||||
this.$axios({
|
try {
|
||||||
url: path,
|
const res = await this.$axios({
|
||||||
method: 'POST',
|
url: path,
|
||||||
data: params
|
method: 'POST',
|
||||||
}).then((res) => {
|
data: params
|
||||||
this.generateLoading = false
|
})
|
||||||
if (res.code == 200) {
|
if (res.code == 200) {
|
||||||
this.$message.success(
|
this.$message.success(
|
||||||
'已经提交任务,请等待或者稍后到个人中心查看作品'
|
'已经提交任务,请等待或者稍后到个人中心查看作品'
|
||||||
|
|
@ -539,14 +542,15 @@ export default {
|
||||||
const reason = res.msg || res.message || '提交失败'
|
const reason = res.msg || res.message || '提交失败'
|
||||||
this.$message.error(`${reason},如需帮助请联系管理员`)
|
this.$message.error(`${reason},如需帮助请联系管理员`)
|
||||||
}
|
}
|
||||||
}).catch((err) => {
|
} catch (err) {
|
||||||
this.generateLoading = false
|
|
||||||
const tip =
|
const tip =
|
||||||
typeof err === 'string' && err
|
typeof err === 'string' && err
|
||||||
? err
|
? err
|
||||||
: err?.message || err?.response?.data?.msg || '网络或服务异常,请稍后重试'
|
: err?.message || err?.response?.data?.msg || '网络或服务异常,请稍后重试'
|
||||||
this.$message.error(`${tip},如需帮助请联系管理员`)
|
this.$message.error(`${tip},如需帮助请联系管理员`)
|
||||||
})
|
} finally {
|
||||||
|
this.generateLoading = false
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
getVideo(videoId) {
|
getVideo(videoId) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue