富文本

This commit is contained in:
kclf
2022-12-05 13:52:23 +08:00
parent ddd86d07c6
commit 6ab8fb8a27
5 changed files with 95 additions and 152 deletions

View File

@@ -2439,7 +2439,10 @@
</div>
<div class="i5_right">
<div class="stmm_btn btn3">
<span style="color: #ffffff" @click="showStuAdd(currentPlanItem)">
<span
style="color: #ffffff"
@click="showStuAdd(currentPlanItem)"
>
添加学员
</span>
</div>
@@ -3029,6 +3032,7 @@ import * as api1 from "../../api/index1";
import "@wangeditor/editor/dist/css/style.css";
import { Editor, Toolbar } from "@wangeditor/editor-for-vue";
// import { DomEditor } from "@wangeditor/editor";
import ProjectManager from "@/components/project/ProjectManager";
//列表表格
@@ -3766,12 +3770,35 @@ export default defineComponent({
const valueHtml = ref("");
// // 模拟 ajax 异步获取内容
onMounted(() => {
// setTimeout(() => {
// valueHtml.value = "<p>模拟 Ajax 异步设置内容</p>";
// }, 1500);
// setTimeout(() => {
// // valueHtml.value = "<p>模拟 Ajax 异步设置内容</p>";
// console.log("toolbar222222222222222");
// console.log(editorRef.value);
// // const toolbar = DomEditor.getToolbar(editorRef.value);
// // const menu = editorRef.value.getAllMenuKeys();
// // const bar = toolbar.getConfig().toolbarKeys;
// // console.log(menu);
// // console.log(bar);
// }, 3500);
});
const toolbarConfig = {};
const editorConfig = { placeholder: "请输入内容..." };
const toolbarConfig = {
excludeKeys: ["insertVideo", "insertImage"],
};
const editorConfig = { placeholder: "请输入内容...", MENU_CONF: {} };
editorConfig.MENU_CONF["uploadImage"] = {
// 自定义上传
async customUpload(file, insertFn) {
const formData = new FormData();
formData.append("file", file);
fileUp(formData).then((res) => {
if (res.data.code === 200) {
// 最后插入图片
insertFn(res.data.data, file.name, res.data.data);
}
});
},
};
// 组件销毁时,也及时销毁编辑器
onBeforeUnmount(() => {
const editor = editorRef.value;
@@ -5329,8 +5356,8 @@ export default defineComponent({
//管理权
const showManagePrower = (record) => {
// console.log("record", record);
console.log(22222222)
console.log(record)
console.log(22222222);
console.log(record);
state.selectCourseId = record.offcourseId;
state.shipType = 1;
state.authClassify = 2;
@@ -8005,4 +8032,12 @@ export default defineComponent({
// }
// }
// }
// ::v-deep .w-e-toolbar {
// .w-e-bar-item {
// &:nth-child(23) {
// display: none !important;
// }
// }
// }
</style>