讲师管理bug

This commit is contained in:
zhangsir
2024-11-13 20:28:47 +08:00
parent 49252a1ad7
commit 2ad3530d99
6 changed files with 34 additions and 18 deletions

View File

@@ -6,10 +6,10 @@
* @Descripttion: 富文本编辑器组件
-->
<template>
<div style="border: 1px solid #ccc; width: 100%; ">
<div style="border: 1px solid #ccc; width: 100%;position:relative; ">
<Toolbar style="border-bottom: 1px solid #ccc ;font-size:4px" :editor="editorRef" :defaultConfig="toolbarConfig" mode="simple" />
<Editor style="height: 100px; overflow-y: hidden" v-model="valueHtml" :defaultConfig="editorConfig" mode="simple" @onCreated="handleCreated" @customPaste="customPaste" />
<span>{{ }}</span>
<Editor style="height: 100px; overflow-y: hidden" v-model="valueHtml" :defaultConfig="editorConfig" mode="simple" @onCreated="handleCreated" @onChange="handleChange" @customPaste="customPaste" />
<span style="position:absolute;right:6px;bottom:4px;">{{ valueLength }}/200</span>
</div>
</template>
@@ -37,7 +37,6 @@
})
watch(()=>props.value,(val)=>{
valueHtml.value = val
console.log(val,'222222222222222');
})
const toolbarConfig = {
excludeKeys: [
@@ -79,7 +78,16 @@
console.log('上传视频', file);
},
};
const valueLength = ref(0)
const handleChange = (editor) => {
const reg = /<[^<>]+>/g;
const value = valueHtml.value.replace(reg, "");
valueLength.value = value.length
if (valueLength.value > 200) {
valueHtml.value = '<p>' + value.slice(0, 200) + '</p>'
editor.setHtml(valueHtml.value);
}
};
// 富文本编辑器生成后触发
const handleCreated = editor => {
editorRef.value = editor; // 记录 editor 实例,重要!

View File

@@ -202,6 +202,7 @@ const searchMember = (keyword) => {
sLevelName:item.sLevelName,
payrollPlaceCode: item.payrollPlaceCode,
payrollPlaceName:item.payrollPlaceName,
avatar: item.avatar,
}
})
}else{